@mux/mux-player 2.3.2 → 2.3.3-canary.0-9c4cb2a
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/CHANGELOG.md +911 -0
- package/dist/cjs.json +1 -0
- package/dist/esm.json +1 -0
- package/dist/iife.json +1 -0
- package/dist/index.cjs.js +892 -371
- package/dist/index.mjs +27 -32
- package/dist/module.json +1 -0
- package/dist/mux-player.js +903 -382
- package/dist/mux-player.mjs +903 -382
- package/dist/themes/classic/index.cjs.js +98 -23
- package/dist/themes/classic/index.js +98 -23
- package/dist/themes/classic/index.mjs +98 -23
- package/dist/themes/gerwig/index.cjs.js +124 -52
- package/dist/themes/gerwig/index.js +124 -52
- package/dist/themes/gerwig/index.mjs +124 -52
- package/dist/themes/microvideo/index.cjs.js +106 -25
- package/dist/themes/microvideo/index.js +106 -25
- package/dist/themes/microvideo/index.mjs +106 -25
- package/dist/themes/minimal/index.cjs.js +102 -23
- package/dist/themes/minimal/index.js +102 -23
- package/dist/themes/minimal/index.mjs +102 -23
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -7
- package/LICENSE +0 -9
package/dist/index.cjs.js
CHANGED
|
@@ -1,98 +1,14 @@
|
|
|
1
|
-
"use strict";var Wu=Object.create;var Ea=Object.defineProperty;var Fu=Object.getOwnPropertyDescriptor;var Ku=Object.getOwnPropertyNames;var Yu=Object.getPrototypeOf,Gu=Object.prototype.hasOwnProperty;var Zu=(i,e)=>{for(var t in e)Ea(i,t,{get:e[t],enumerable:!0})},Zs=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ku(e))!Gu.call(i,r)&&r!==t&&Ea(i,r,{get:()=>e[r],enumerable:!(a=Fu(e,r))||a.enumerable});return i};var qu=(i,e,t)=>(t=i!=null?Wu(Yu(i)):{},Zs(e||!i||!i.__esModule?Ea(t,"default",{value:i,enumerable:!0}):t,i)),Qu=i=>Zs(Ea({},"__esModule",{value:!0}),i);var Tn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var S=(i,e,t)=>(Tn(i,e,"read from private field"),t?t.call(i):e.get(i)),W=(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)=>(Tn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var F=(i,e,t)=>(Tn(i,e,"access private method"),t);var _h={};Zu(_h,{MediaError:()=>g.MediaError,default:()=>Ah,getVideoAttribute:()=>Wt});module.exports=Qu(_h);var Yt=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Yt{}globalThis.DocumentFragment=i}var ki=class extends Yt{},In=class extends Yt{},zu={get(i){},define(i,e,t){},upgrade(i){},whenDefined(i){return Promise.resolve(ki)}},Si,kn=class{constructor(e,t={}){W(this,Si,void 0);ce(this,Si,t==null?void 0:t.detail)}get detail(){return S(this,Si)}initCustomEvent(){}};Si=new WeakMap;function Xu(i,e){return new ki}var qs={document:{createElement:Xu},DocumentFragment,customElements:zu,CustomEvent:kn,EventTarget:Yt,HTMLElement:ki,HTMLVideoElement:In},Qs=typeof window=="undefined"||typeof globalThis.customElements=="undefined",U=Qs?qs:globalThis,ne=Qs?qs.document:globalThis.document;var f={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_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},A={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},gt={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",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_IS_AIRPLAYING:"mediaIsAirplaying",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",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled"},zs=Object.entries(gt),o=zs.reduce((i,[e,t])=>(i[e]=`${t.toLowerCase()}`,i),{}),Fe=zs.reduce((i,[e,t])=>(i[e]=`${t.toLowerCase()}`,i),{USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"}),kh=Object.entries(Fe).reduce((i,[e,t])=>{let a=o[e];return a&&(i[t]=a),i},{userinactivechange:"userinactive"}),Xs=Object.entries(o).reduce((i,[e,t])=>{let a=Fe[e];return a&&(i[t]=a),i},{userinactive:"userinactivechange"}),et={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},At={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Sn={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},oe={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},fe={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"},D={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",ENTER_AIRPLAY:()=>"start airplay",EXIT_AIRPLAY:()=>"stop airplay",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"},ju={...q,...D};function Js(i){return i==null?void 0:i.map(ec).join(" ")}function js(i){return i==null?void 0:i.split(/\s+/).map(tc)}function ec(i){if(i){let{id:e,width:t,height:a}=i;return[e,t,a].filter(r=>r!=null).join(":")}}function tc(i){if(i){let[e,t,a]=i.split(":");return{id:e,width:t,height:a}}}function el(i){return i==null?void 0:i.map(ic).join(" ")}function tl(i){return i==null?void 0:i.split(/\s+/).map(ac)}function ic(i){if(i){let{id:e,kind:t,language:a,label:r}=i;return[e,t,a,r].filter(n=>n!=null).join(":")}}function ac(i){if(i){let[e,t,a,r]=i.split(":");return{id:e,kind:t,language:a,label:r}}}function fa(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 il(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function al(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function va(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var ga=i=>new Promise(e=>setTimeout(e,i));var rl=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],rc=(i,e)=>{let t=i===1?rl[e].singular:rl[e].plural;return`${i} ${t}`},_t=i=>{if(!al(i))return"";let e=Math.abs(i),t=e!==i,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((d,u)=>d&&rc(d,u)).filter(d=>d).join(", ")}${t?" remaining":""}`};function Se(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let a=Math.floor(i%60),r=Math.floor(i/60%60),n=Math.floor(i/3600),s=Math.floor(e/60%60),d=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=a="0"),n=n>0||d>0?n+":":"",r=((n||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+n+r+a}var Lh=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}});var Aa=(i,e,t=".value")=>{let a=i.querySelector(t);a&&(a.textContent=e)},oc=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},_a=(i,e)=>oc(i,e)[0],tt=(i,e)=>!i||!e?!1:i.contains(e)?!0:tt(i,e.getRootNode().host),it=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||it(i.getRootNode().host,e)};function Mn(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=Mn(t.shadowRoot))!=null?e:t:null}function nl(i){var e;let t=(e=i==null?void 0:i.getRootNode)==null?void 0:e.call(i);return t instanceof ShadowRoot||t instanceof Document?t:null}function ol(i,e=3){if(i.checkVisibility)return i.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0});let t=i;for(;t&&e>0;){let a=getComputedStyle(t);if(a.opacity==="0"||a.visibility==="hidden"||a.display==="none")return!1;t=t.parentElement,e--}return!0}function sl(i,e,t,a){let r=Cn(t,a),n=Cn(t,{x:i,y:e}),s=Cn(a,{x:i,y:e});return n>r||s>r?n>s?1:0:n/r}function Cn(i,e){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))}function N(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:()=>{},getPropertyValue:()=>""}}}function M(i,e,t=Number.NaN){let a=i.getAttribute(e);return a!=null?+a:t}function O(i,e,t){let a=+t;if(t==null||Number.isNaN(a)){i.hasAttribute(e)&&i.removeAttribute(e);return}M(i,e,void 0)!==a&&i.setAttribute(e,`${a}`)}function L(i,e){return i.hasAttribute(e)}function C(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}L(i,e)!=t&&i.toggleAttribute(e,t)}function x(i,e,t=null){var a;return(a=i.getAttribute(e))!=null?a:t}function R(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let a=`${t}`;x(i,e,void 0)!==a&&i.setAttribute(e,a)}var ya=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Ln=class{observe(){}unobserve(){}disconnect(){}},ll={createElement:function(){return new Rn.HTMLElement},addEventListener(){},removeEventListener(){}},Rn={ResizeObserver:Ln,document:ll,HTMLElement:class extends ya{},DocumentFragment:class extends ya{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[]}},dl=typeof window=="undefined"||typeof window.customElements=="undefined",ul=Object.keys(Rn).every(i=>i in globalThis),l=dl&&!ul?Rn:globalThis,c=dl&&!ul?ll:globalThis.document;var sc=Object.defineProperty,lc=(i,e,t)=>e in i?sc(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,dc=(i,e,t)=>(lc(i,typeof e!="symbol"?e+"":e,t),t),cl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},me=(i,e,t)=>(cl(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)},Ia=(i,e,t,a)=>(cl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ce,ka,Gt,Sa,ml=c.createElement("template");ml.innerHTML=`
|
|
2
|
-
<style>
|
|
3
|
-
:host {
|
|
4
|
-
font: var(--media-font,
|
|
5
|
-
var(--media-font-weight, bold)
|
|
6
|
-
var(--media-font-size, 14px) /
|
|
7
|
-
var(--media-text-content-height, var(--media-control-height, 24px))
|
|
8
|
-
var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
|
|
9
|
-
color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
|
|
10
|
-
background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));
|
|
11
|
-
padding: var(--media-button-padding, var(--media-control-padding, 10px));
|
|
12
|
-
justify-content: var(--media-button-justify-content, center);
|
|
13
|
-
display: inline-flex;
|
|
14
|
-
align-items: center;
|
|
15
|
-
vertical-align: middle;
|
|
16
|
-
box-sizing: border-box;
|
|
17
|
-
transition: background .15s linear;
|
|
18
|
-
pointer-events: auto;
|
|
19
|
-
cursor: pointer;
|
|
20
|
-
-webkit-tap-highlight-color: transparent;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
:host(:focus-visible) {
|
|
25
|
-
box-shadow: inset 0 0 0 2px rgb(27 127 204 / .9);
|
|
26
|
-
outline: 0;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
:host(:where(:focus)) {
|
|
30
|
-
box-shadow: none;
|
|
31
|
-
outline: 0;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
:host(:hover) {
|
|
35
|
-
background: var(--media-control-hover-background, rgba(50 50 70 / .7));
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
svg, img, ::slotted(svg), ::slotted(img) {
|
|
39
|
-
width: var(--media-button-icon-width);
|
|
40
|
-
height: var(--media-button-icon-height, var(--media-control-height, 24px));
|
|
41
|
-
transform: var(--media-button-icon-transform);
|
|
42
|
-
transition: var(--media-button-icon-transition);
|
|
43
|
-
fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));
|
|
44
|
-
vertical-align: middle;
|
|
45
|
-
max-width: 100%;
|
|
46
|
-
max-height: 100%;
|
|
47
|
-
min-width: 100%;
|
|
48
|
-
}
|
|
49
|
-
</style>
|
|
50
|
-
`;var w=class extends l.HTMLElement{constructor(e={}){if(super(),Ta(this,Ce,void 0),dc(this,"preventClick",!1),Ta(this,ka,a=>{this.preventClick||this.handleClick(a)}),Ta(this,Gt,a=>{let{key:r}=a;if(!this.keysUsed.includes(r)){this.removeEventListener("keyup",me(this,Gt));return}this.preventClick||this.handleClick(a)}),Ta(this,Sa,a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!this.keysUsed.includes(s)){this.removeEventListener("keyup",me(this,Gt));return}this.addEventListener("keyup",me(this,Gt),{once:!0})}),!this.shadowRoot){this.attachShadow({mode:"open"});let a=ml.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}=N(this.shadowRoot,":host");t.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`)}static get observedAttributes(){return["disabled",A.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",me(this,ka)),this.addEventListener("keydown",me(this,Sa)),this.tabIndex=0}disable(){this.removeEventListener("click",me(this,ka)),this.removeEventListener("keydown",me(this,Sa)),this.removeEventListener("keyup",me(this,Gt)),this.tabIndex=-1}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===A.MEDIA_CONTROLLER?(t&&((n=(r=me(this,Ce))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ia(this,Ce,null)),a&&this.isConnected&&(Ia(this,Ce,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=me(this,Ce))==null?void 0:d.associateElement)==null||u.call(d,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(A.MEDIA_CONTROLLER);r&&(Ia(this,Ce,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=me(this,Ce))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=me(this,Ce))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ia(this,Ce,null)}get keysUsed(){return["Enter"," "]}handleClick(e){}};Ce=new WeakMap;ka=new WeakMap;Gt=new WeakMap;Sa=new WeakMap;l.customElements.get("media-chrome-button")||l.customElements.define("media-chrome-button",w);var hl=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
51
|
-
<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"/>
|
|
52
|
-
</svg>
|
|
53
|
-
`,bl=c.createElement("template");bl.innerHTML=`
|
|
54
|
-
<style>
|
|
55
|
-
:host([${o.MEDIA_IS_AIRPLAYING}]) slot:not([name=exit]):not([name=icon]) {
|
|
56
|
-
display: none !important;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
:host(:not([${o.MEDIA_IS_AIRPLAYING}])) slot:not([name=enter]):not([name=icon]) {
|
|
61
|
-
display: none !important;
|
|
62
|
-
}
|
|
63
|
-
</style>
|
|
64
|
-
|
|
65
|
-
<slot name="icon">
|
|
66
|
-
<slot name="enter">${hl}</slot>
|
|
67
|
-
<slot name="exit">${hl}</slot>
|
|
68
|
-
</slot>
|
|
69
|
-
`;var pl=i=>{let e=i.mediaIsAirplaying?D.EXIT_AIRPLAY():D.ENTER_AIRPLAY();i.setAttribute("aria-label",e)},wn=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_AIRPLAYING,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:bl,...e})}connectedCallback(){super.connectedCallback(),pl(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_IS_AIRPLAYING&&pl(this)}get mediaIsAirplaying(){return L(this,o.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){C(this,o.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return x(this,o.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){R(this,o.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new l.CustomEvent(f.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};l.customElements.get("media-airplay-button")||l.customElements.define("media-airplay-button",wn);var uc='<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>',cc='<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>',fl=c.createElement("template");fl.innerHTML=`
|
|
70
|
-
<style>
|
|
71
|
-
:host([${o.MEDIA_IS_CASTING}]) slot:not([name=exit]):not([name=icon]) {
|
|
72
|
-
display: none !important;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
:host(:not([${o.MEDIA_IS_CASTING}])) slot:not([name=enter]):not([name=icon]) {
|
|
77
|
-
display: none !important;
|
|
78
|
-
}
|
|
79
|
-
</style>
|
|
80
|
-
|
|
81
|
-
<slot name="icon">
|
|
82
|
-
<slot name="enter">${uc}</slot>
|
|
83
|
-
<slot name="exit">${cc}</slot>
|
|
84
|
-
</slot>
|
|
85
|
-
`;var El=i=>{let e=i.mediaIsCasting?D.EXIT_CAST():D.ENTER_CAST();i.setAttribute("aria-label",e)},xn=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:fl,...e})}connectedCallback(){super.connectedCallback(),El(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_IS_CASTING&&El(this)}get mediaIsCasting(){return L(this,o.MEDIA_IS_CASTING)}set mediaIsCasting(e){C(this,o.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return x(this,o.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){R(this,o.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?f.MEDIA_EXIT_CAST_REQUEST:f.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-cast-button")||l.customElements.define("media-cast-button",xn);var vl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},at=(i,e,t)=>(vl(i,e,"read from private field"),t?t.call(i):e.get(i)),mc=(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)},Ca=(i,e,t,a)=>(vl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),te,gl=c.createElement("template");gl.innerHTML=`
|
|
1
|
+
"use strict";var uv=Object.create;var Wr=Object.defineProperty;var cv=Object.getOwnPropertyDescriptor;var mv=Object.getOwnPropertyNames;var hv=Object.getPrototypeOf,pv=Object.prototype.hasOwnProperty;var vv=(i,e)=>{for(var t in e)Wr(i,t,{get:e[t],enumerable:!0})},vc=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of mv(e))!pv.call(i,r)&&r!==t&&Wr(i,r,{get:()=>e[r],enumerable:!(a=cv(e,r))||a.enumerable});return i};var fv=(i,e,t)=>(t=i!=null?uv(hv(i)):{},vc(e||!i||!i.__esModule?Wr(t,"default",{value:i,enumerable:!0}):t,i)),bv=i=>vc(Wr({},"__esModule",{value:!0}),i);var Po=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var D=(i,e,t)=>(Po(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)},Ce=(i,e,t,a)=>(Po(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var te=(i,e,t)=>(Po(i,e,"access private method"),t);var w0={};vv(w0,{MediaError:()=>A.MediaError,default:()=>M0,getVideoAttribute:()=>Di});module.exports=bv(w0);var Ni=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Ni{}globalThis.DocumentFragment=i}var xa=class extends Ni{},No=class extends Ni{},Ev={get(i){},define(i,e,t){},upgrade(i){},whenDefined(i){return Promise.resolve(xa)}},Ra,Uo=class{constructor(e,t={}){ee(this,Ra,void 0);Ce(this,Ra,t==null?void 0:t.detail)}get detail(){return D(this,Ra)}initCustomEvent(){}};Ra=new WeakMap;function gv(i,e){return new xa}var fc={document:{createElement:gv},DocumentFragment,customElements:Ev,CustomEvent:Uo,EventTarget:Ni,HTMLElement:xa,HTMLVideoElement:No},bc=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Z=bc?fc:globalThis,ye=bc?fc.document:globalThis.document;var h={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},y={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Bo={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",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_IS_AIRPLAYING:"mediaIsAirplaying",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_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_LOADING:"mediaLoading",MEDIA_BUFFERED:"mediaBuffered",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_CHAPTERS_CUES:"mediaChaptersCues"},Ec=Object.entries(Bo),s=Ec.reduce((i,[e,t])=>(i[e]=`${t.toLowerCase()}`,i),{}),yt=Ec.reduce((i,[e,t])=>(i[e]=`${t.toLowerCase()}`,i),{USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"}),P0=Object.entries(yt).reduce((i,[e,t])=>{let a=s[e];return a&&(i[t]=a),i},{userinactivechange:"userinactive"}),gc=Object.entries(s).reduce((i,[e,t])=>{let a=yt[e];return a&&(i[t]=a),i},{userinactive:"userinactivechange"}),Ne={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Pt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Wo={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Te={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Ue={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"},_c={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};var K={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",SETTINGS:()=>"settings",AUDIO_TRACKS:()=>"audio tracks",QUALITY:()=>"quality"},Y={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",ENTER_AIRPLAY:()=>"start airplay",EXIT_AIRPLAY:()=>"stop airplay",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"},Av={...K,...Y};function Ac(i){return i==null?void 0:i.map(yv).join(" ")}function Hr(i){return i==null?void 0:i.split(/\s+/).map(Tv)}function yv(i){if(i){let{id:e,width:t,height:a}=i;return[e,t,a].filter(r=>r!=null).join(":")}}function Tv(i){if(i){let[e,t,a]=i.split(":");return{id:e,width:t,height:a}}}function yc(i){return i==null?void 0:i.map(kv).join(" ")}function $r(i){return i==null?void 0:i.split(/\s+/).map(Sv)}function kv(i){if(i){let{id:e,kind:t,language:a,label:r}=i;return[e,t,a,r].filter(n=>n!=null).join(":")}}function Sv(i){if(i){let[e,t,a,r]=i.split(":");return{id:e,kind:t,language:a,label:r}}}function Tc(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function kc(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function Fr(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var Vr=i=>new Promise(e=>setTimeout(e,i));var Sc=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Iv=(i,e)=>{let t=i===1?Sc[e].singular:Sc[e].plural;return`${i} ${t}`},ii=i=>{if(!kc(i))return"";let e=Math.abs(i),t=e!==i,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((d,u)=>d&&Iv(d,u)).filter(d=>d).join(", ")}${t?" remaining":""}`};function ze(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),o=Math.floor(e/60%60),d=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=a="0"),n=n>0||d>0?n+":":"",r=((n||o>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+n+r+a}var W0=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}});var Kr=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Yr=class extends Kr{},Ho=class{observe(){}unobserve(){}disconnect(){}},Ic={createElement:function(){return new Gr.HTMLElement},createElementNS:function(){return new Gr.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},Gr={ResizeObserver:Ho,document:Ic,Node:Yr,HTMLElement:class extends Yr{},DocumentFragment:class extends Kr{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(i){return null},setItem(i,e){},removeItem(i){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(i){return{matches:!1,media:i}}},Cc=typeof window=="undefined"||typeof window.customElements=="undefined",Lc=Object.keys(Gr).every(i=>i in globalThis),l=Cc&&!Lc?Gr:globalThis,m=Cc&&!Lc?Ic:globalThis.document;var Mc=new WeakMap,$o=i=>{let e=Mc.get(i);return e||Mc.set(i,e=new Set),e},wc=new l.ResizeObserver(i=>{for(let e of i)for(let t of $o(e.target))t(e)});function Le(i,e){$o(i).add(e),wc.observe(i)}function Xe(i,e){let t=$o(i);t.delete(e),t.size||wc.unobserve(i)}function X(i){var e;return(e=qr(i))!=null?e:Be(i,"media-controller")}function qr(i){var e;let{MEDIA_CONTROLLER:t}=y,a=i.getAttribute(t);if(a)return(e=ri(i))==null?void 0:e.getElementById(a)}var Zr=(i,e,t=".value")=>{let a=i.querySelector(t);a&&(a.textContent=e)},Lv=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},Qr=(i,e)=>Lv(i,e)[0],ue=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:ue(i,e.getRootNode().host),Be=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||Be(i.getRootNode().host,e)};function ai(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=ai(t.shadowRoot))!=null?e:t:null}function ri(i){var e;let t=(e=i==null?void 0:i.getRootNode)==null?void 0:e.call(i);return t instanceof ShadowRoot||t instanceof Document?t:null}function xc(i,e=3){if(i.checkVisibility)return i.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0});let t=i;for(;t&&e>0;){let a=getComputedStyle(t);if(a.opacity==="0"||a.visibility==="hidden"||a.display==="none")return!1;t=t.parentElement,e--}return!0}function Rc(i,e,t,a){let r=Fo(t,a),n=Fo(t,{x:i,y:e}),o=Fo(a,{x:i,y:e});return n>r||o>r?n>o?1:0:n/r}function Fo(i,e){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))}function P(i,e){let t=Mv(i,a=>a===e);return t||Vo(i,e)}function Mv(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(e(n.selectorText))return n}}function Vo(i,e){var t,a;let r=(t=i.querySelectorAll("style"))!=null?t:[],n=r==null?void 0:r[r.length-1];return n!=null&&n.sheet?(n==null||n.sheet.insertRule(`${e}{}`,n.sheet.cssRules.length),(a=n.sheet.cssRules)==null?void 0:a[n.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function x(i,e,t=Number.NaN){let a=i.getAttribute(e);return a!=null?+a:t}function N(i,e,t){let a=+t;if(t==null||Number.isNaN(a)){i.hasAttribute(e)&&i.removeAttribute(e);return}x(i,e,void 0)!==a&&i.setAttribute(e,`${a}`)}function H(i,e){return i.hasAttribute(e)}function U(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}H(i,e)!=t&&i.toggleAttribute(e,t)}function I(i,e,t=null){var a;return(a=i.getAttribute(e))!=null?a:t}function k(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let a=`${t}`;I(i,e,void 0)!==a&&i.setAttribute(e,a)}var Dc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Nt=(i,e,t)=>(Dc(i,e,"read from private field"),t?t.call(i):e.get(i)),wv=(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)},zr=(i,e,t,a)=>(Dc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),be,Oc=m.createElement("template");Oc.innerHTML=`
|
|
86
2
|
<style>
|
|
87
3
|
:host {
|
|
88
4
|
display: var(--media-control-display, var(--media-gesture-receiver-display, inline-block));
|
|
89
5
|
box-sizing: border-box;
|
|
90
6
|
}
|
|
91
7
|
</style>
|
|
92
|
-
`;var
|
|
8
|
+
`;var Ko=class extends l.HTMLElement{constructor(e={}){if(super(),wv(this,be,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=Oc.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=m.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a)}}static get observedAttributes(){return[y.MEDIA_CONTROLLER,s.MEDIA_PAUSED]}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===y.MEDIA_CONTROLLER&&(t&&((n=(r=Nt(this,be))==null?void 0:r.unassociateElement)==null||n.call(r,this),zr(this,be,null)),a&&this.isConnected&&(zr(this,be,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=Nt(this,be))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),zr(this,be,xv(this)),this.getAttribute(y.MEDIA_CONTROLLER)&&((t=(e=Nt(this,be))==null?void 0:e.associateElement)==null||t.call(e,this)),(a=Nt(this,be))==null||a.addEventListener("pointerdown",this),(r=Nt(this,be))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,t,a,r;this.getAttribute(y.MEDIA_CONTROLLER)&&((t=(e=Nt(this,be))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(a=Nt(this,be))==null||a.removeEventListener("pointerdown",this),(r=Nt(this,be))==null||r.removeEventListener("click",this),zr(this,be,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:o}=e,{left:d,top:u,width:c,height:f}=this.getBoundingClientRect(),E=n-d,v=o-u;if(E<0||v<0||E>c||v>f||c===0&&f===0)return;let{pointerType:b=this._pointerType}=e;if(this._pointerType=void 0,b===Wo.TOUCH){this.handleTap(e);return}else if(b===Wo.MOUSE){this.handleMouseClick(e);return}}}}get mediaPaused(){return H(this,s.MEDIA_PAUSED)}set mediaPaused(e){U(this,s.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(t,{composed:!0,bubbles:!0}))}};be=new WeakMap;function xv(i){var e;let t=i.getAttribute(y.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):Be(i,"media-controller")}l.customElements.get("media-gesture-receiver")||l.customElements.define("media-gesture-receiver",Ko);var Rv=Object.defineProperty,Dv=(i,e,t)=>e in i?Rv(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ov=(i,e,t)=>(Dv(i,typeof e!="symbol"?e+"":e,t),t),Qo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Go=(i,e,t)=>(Qo(i,e,"read from private field"),t?t.call(i):e.get(i)),ni=(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)},Yo=(i,e,t,a)=>(Qo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),We=(i,e,t)=>(Qo(i,e,"access private method"),t),Xr,Ui,qo,Pc,Zo,Nc,Da,Jr,jr,zo,Bi,Oa,M={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive"},Uc=m.createElement("template");Uc.innerHTML=`
|
|
93
9
|
<style>
|
|
94
10
|
|
|
95
|
-
:host([${
|
|
11
|
+
:host([${s.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
|
|
96
12
|
outline: none;
|
|
97
13
|
}
|
|
98
14
|
|
|
@@ -104,7 +20,7 @@
|
|
|
104
20
|
background-color: var(--media-background-color, #000);
|
|
105
21
|
}
|
|
106
22
|
|
|
107
|
-
:host(:not([${
|
|
23
|
+
:host(:not([${M.AUDIO}])) [part~=layer]:not([part~=media-layer]) {
|
|
108
24
|
position: absolute;
|
|
109
25
|
top: 0;
|
|
110
26
|
left: 0;
|
|
@@ -122,34 +38,34 @@
|
|
|
122
38
|
}
|
|
123
39
|
|
|
124
40
|
|
|
125
|
-
:host([${
|
|
41
|
+
:host([${M.AUDIO}]) slot[name=media] {
|
|
126
42
|
display: var(--media-slot-display, none);
|
|
127
43
|
}
|
|
128
44
|
|
|
129
45
|
|
|
130
|
-
:host([${
|
|
46
|
+
:host([${M.AUDIO}]) [part~=layer][part~=gesture-layer] {
|
|
131
47
|
height: 0;
|
|
132
48
|
display: block;
|
|
133
49
|
}
|
|
134
50
|
|
|
135
51
|
|
|
136
|
-
:host(:not([${
|
|
137
|
-
:host(:not([${
|
|
52
|
+
:host(:not([${M.AUDIO}])[${M.GESTURES_DISABLED}]) ::slotted([slot=gestures-chrome]),
|
|
53
|
+
:host(:not([${M.AUDIO}])[${M.GESTURES_DISABLED}]) media-gesture-receiver[slot=gestures-chrome] {
|
|
138
54
|
display: none;
|
|
139
55
|
}
|
|
140
56
|
|
|
141
57
|
|
|
142
|
-
::slotted(:not([slot=media]):not([slot=poster]):not(media-loading-indicator)) {
|
|
58
|
+
::slotted(:not([slot=media]):not([slot=poster]):not(media-loading-indicator):not([hidden])) {
|
|
143
59
|
pointer-events: auto;
|
|
144
60
|
}
|
|
145
61
|
|
|
146
|
-
:host(:not([${
|
|
62
|
+
:host(:not([${M.AUDIO}])) *[part~=layer][part~=centered-layer] {
|
|
147
63
|
align-items: center;
|
|
148
64
|
justify-content: center;
|
|
149
65
|
}
|
|
150
66
|
|
|
151
|
-
:host(:not([${
|
|
152
|
-
:host(:not([${
|
|
67
|
+
:host(:not([${M.AUDIO}])) ::slotted(media-gesture-receiver[slot=gestures-chrome]),
|
|
68
|
+
:host(:not([${M.AUDIO}])) media-gesture-receiver[slot=gestures-chrome] {
|
|
153
69
|
align-self: stretch;
|
|
154
70
|
flex-grow: 1;
|
|
155
71
|
}
|
|
@@ -169,7 +85,7 @@
|
|
|
169
85
|
}
|
|
170
86
|
|
|
171
87
|
|
|
172
|
-
:host(:not([${
|
|
88
|
+
:host(:not([${M.AUDIO}])) .spacer {
|
|
173
89
|
flex-grow: 1;
|
|
174
90
|
}
|
|
175
91
|
|
|
@@ -181,18 +97,18 @@
|
|
|
181
97
|
}
|
|
182
98
|
|
|
183
99
|
|
|
184
|
-
::slotted(:not([slot=media]):not([${
|
|
100
|
+
::slotted(:not([slot=media]):not([slot=poster]):not([${M.NO_AUTOHIDE}]):not([hidden])) {
|
|
185
101
|
opacity: 1;
|
|
186
102
|
transition: opacity 0.25s;
|
|
187
103
|
}
|
|
188
104
|
|
|
189
105
|
|
|
190
|
-
:host([${
|
|
106
|
+
:host([${M.USER_INACTIVE}]:not([${s.MEDIA_PAUSED}]):not([${s.MEDIA_IS_AIRPLAYING}]):not([${s.MEDIA_IS_CASTING}]):not([${M.AUDIO}])) ::slotted(:not([slot=media]):not([slot=poster]):not([${M.NO_AUTOHIDE}])) {
|
|
191
107
|
opacity: 0;
|
|
192
108
|
transition: opacity 1s;
|
|
193
109
|
}
|
|
194
110
|
|
|
195
|
-
:host([${
|
|
111
|
+
:host([${M.USER_INACTIVE}]:not([${s.MEDIA_PAUSED}]):not([${s.MEDIA_IS_CASTING}]):not([${M.AUDIO}])) ::slotted([slot=media]) {
|
|
196
112
|
cursor: none;
|
|
197
113
|
}
|
|
198
114
|
|
|
@@ -201,13 +117,17 @@
|
|
|
201
117
|
}
|
|
202
118
|
|
|
203
119
|
|
|
204
|
-
:host(:not([${
|
|
120
|
+
:host(:not([${M.AUDIO}])[${s.MEDIA_HAS_PLAYED}]) slot[name=poster] {
|
|
205
121
|
display: none;
|
|
206
122
|
}
|
|
207
123
|
|
|
208
|
-
::slotted([role=menu]) {
|
|
124
|
+
::slotted([role="menu"]) {
|
|
209
125
|
align-self: end;
|
|
210
126
|
}
|
|
127
|
+
|
|
128
|
+
::slotted([role="dialog"]) {
|
|
129
|
+
align-self: center;
|
|
130
|
+
}
|
|
211
131
|
</style>
|
|
212
132
|
|
|
213
133
|
<slot name="media" part="layer media-layer"></slot>
|
|
@@ -220,9 +140,457 @@
|
|
|
220
140
|
<slot name="middle-chrome" part="middle chrome"></slot>
|
|
221
141
|
<slot name="centered-chrome" part="layer centered-layer center centered chrome"></slot>
|
|
222
142
|
|
|
223
|
-
<slot part="bottom chrome"></slot>
|
|
224
|
-
</span>
|
|
225
|
-
`;var fc=Object.values(o),vc="sm:384 md:576 lg:768 xl:960";function gc(i){Ac(i.target,i.contentRect.width)}function Ac(i,e){var t;if(!i.isConnected)return;let a=(t=i.getAttribute(T.BREAKPOINTS))!=null?t:vc,r=_c(a),n=yc(r,e),s=!1;if(Object.keys(r).forEach(d=>{if(n.includes(d)){i.hasAttribute(`breakpoint${d}`)||(i.setAttribute(`breakpoint${d}`,""),s=!0);return}i.hasAttribute(`breakpoint${d}`)&&(i.removeAttribute(`breakpoint${d}`),s=!0)}),s){let d=new CustomEvent(Fe.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(d)}}function _c(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function yc(i,e){return Object.keys(i).filter(t=>e>=i[t])}var La=class extends l.HTMLElement{constructor(){super(),yt(this,Pn),yt(this,Bn),yt(this,Mi),yt(this,wa),yt(this,qt),yt(this,Ma,0),yt(this,Ke,void 0),Ec(this,"breakpointsComputed",!1),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Il.content.cloneNode(!0)));let e=s=>{let d=this.media;for(let u of s)u.type==="childList"&&(u.removedNodes.forEach(h=>{if(h.slot=="media"&&u.target==this){let m=u.previousSibling&&u.previousSibling.previousElementSibling;if(!m||!d)this.mediaUnsetCallback(h);else{let b=m.slot!=="media";for(;(m=m.previousSibling)!==null;)m.slot=="media"&&(b=!1);b&&this.mediaUnsetCallback(h)}}}),d&&u.addedNodes.forEach(h=>{h===d&&d!==Zt(this,Ke)&&this.handleMediaUpdated(d).then(m=>this.mediaSetCallback(m))}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let a=!1;Ci(this,s=>{a||(setTimeout(()=>{gc(s),a=!1,this.breakpointsComputed||(this.breakpointsComputed=!0,this.dispatchEvent(new CustomEvent(Fe.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))},0),a=!0)});let n=this.querySelector(":scope > slot[slot=media]");n&&n.addEventListener("slotchange",()=>{if(!n.assignedElements({flatten:!0}).length){Zt(this,Ke)&&this.mediaUnsetCallback(Zt(this,Ke));return}this.media&&this.media!==Zt(this,Ke)&&this.handleMediaUpdated(this.media).then(d=>this.mediaSetCallback(d))})}static get observedAttributes(){return[T.AUTOHIDE,T.GESTURES_DISABLED].concat(fc).filter(e=>![o.MEDIA_RENDITION_LIST,o.MEDIA_AUDIO_TRACK_LIST].includes(e))}attributeChangedCallback(e,t,a){e.toLowerCase()==T.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}async handleMediaUpdated(e){Un(this,Ke,e);let t=a=>(Un(this,Ke,null),console.error('Media Chrome: Media element set with slot="media" does not appear to be compatible.',a),Promise.reject(a));return e?(e.localName.includes("-")&&await l.customElements.whenDefined(e.localName),e):t(e)}connectedCallback(){var e;let a=this.getAttribute(T.AUDIO)!=null?q.AUDIO_PLAYER():q.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.media&&this.media!==Zt(this,Ke)&&this.handleMediaUpdated(this.media).then(r=>this.mediaSetCallback(r)),this.setAttribute(T.USER_INACTIVE,""),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=l.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;this.media&&this.mediaUnsetCallback(this.media),(e=l.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){}handleEvent(e){switch(e.type){case"pointerdown":Un(this,Ma,e.timeStamp);break;case"pointermove":ve(this,Pn,yl).call(this,e);break;case"pointerup":ve(this,Bn,Tl).call(this,e);break;case"mouseleave":ve(this,Mi,Ra).call(this);break;case"mouseup":this.removeAttribute(T.KEYBOARD_CONTROL);break;case"keyup":ve(this,qt,Li).call(this),this.setAttribute(T.KEYBOARD_CONTROL,"");break}}set autohide(e){e=Number(e),this._autohide=isNaN(e)?0:e}get autohide(){return this._autohide===void 0?2:this._autohide}};Ma=new WeakMap;Ke=new WeakMap;Pn=new WeakSet;yl=function(i){i.pointerType!=="mouse"&&i.timeStamp-Zt(this,Ma)<250||(ve(this,wa,Hn).call(this),clearTimeout(this._inactiveTimeout),[this,this.media].includes(i.target)&&ve(this,qt,Li).call(this))};Bn=new WeakSet;Tl=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(T.USER_INACTIVE);[this,this.media].includes(i.target)&&e?ve(this,Mi,Ra).call(this):ve(this,qt,Li).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&ve(this,qt,Li).call(this)};Mi=new WeakSet;Ra=function(){if(this.autohide<0||this.hasAttribute(T.USER_INACTIVE))return;this.setAttribute(T.USER_INACTIVE,"");let i=new l.CustomEvent(Fe.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};wa=new WeakSet;Hn=function(){if(!this.hasAttribute(T.USER_INACTIVE))return;this.removeAttribute(T.USER_INACTIVE);let i=new l.CustomEvent(Fe.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};qt=new WeakSet;Li=function(){ve(this,wa,Hn).call(this),clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=setTimeout(()=>{ve(this,Mi,Ra).call(this)},this.autohide*1e3))};var kl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},K=(i,e,t)=>(kl(i,e,"read from private field"),t?t.call(i):e.get(i)),Ri=(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)},xa=(i,e,t,a)=>(kl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Qt,zt,Da,Tt,Ye,rt,nt=class{constructor(e,t,{defaultValue:a}={defaultValue:void 0}){Ri(this,Ye),Ri(this,Qt,void 0),Ri(this,zt,void 0),Ri(this,Da,void 0),Ri(this,Tt,new Set),xa(this,Qt,e),xa(this,zt,t),xa(this,Da,new Set(a))}[Symbol.iterator](){return K(this,Ye,rt).values()}get length(){return K(this,Ye,rt).size}get value(){var e;return(e=[...K(this,Ye,rt)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(xa(this,Tt,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...K(this,Ye,rt)][e]}values(){return K(this,Ye,rt).values()}forEach(e){K(this,Ye,rt).forEach(e)}add(...e){var t,a;e.forEach(r=>K(this,Tt).add(r)),!(this.value===""&&!((t=K(this,Qt))!=null&&t.hasAttribute(`${K(this,zt)}`)))&&((a=K(this,Qt))==null||a.setAttribute(`${K(this,zt)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>K(this,Tt).delete(a)),(t=K(this,Qt))==null||t.setAttribute(`${K(this,zt)}`,`${this.value}`)}contains(e){return K(this,Ye,rt).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}};Qt=new WeakMap;zt=new WeakMap;Da=new WeakMap;Tt=new WeakMap;Ye=new WeakSet;rt=function(){return K(this,Tt).size?K(this,Tt):K(this,Da)};var Tc=(i="")=>i.split(/\s+/),Sl=(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}},wi=(i="",e={})=>Tc(i).map(t=>{let a=Sl(t);return{...e,...a}}),$n=i=>Array.isArray(i)?i.map(e=>typeof e=="string"?Sl(e):e):typeof i=="string"?wi(i):[i],Oa=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,It=(i=[])=>Array.prototype.map.call(i,Oa).join(" "),Ic=(i,e)=>t=>t[i]===e,Cl=i=>{let e=Object.entries(i).map(([t,a])=>Ic(t,a));return t=>e.every(a=>a(t))},Xt=(i,e=[],t=[])=>{let a=$n(t).map(Cl),r=n=>a.some(s=>s(n));Array.from(e).filter(r).forEach(n=>{n.mode=i})},Na=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:Cl(e);return Array.from(i.textTracks).filter(t)},Ml=i=>!!i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);var B={enter:"requestFullscreen",exit:"exitFullscreen",rootEvents:["fullscreenchange"],mediaEvents:[],element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};c.fullscreenElement===void 0&&(B.enter="webkitRequestFullScreen",B.exit=c.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",B.rootEvents=["webkitfullscreenchange"],B.mediaEvents=["webkitbeginfullscreen","webkitendfullscreen"],B.element="webkitFullscreenElement",B.error="webkitfullscreenerror",B.enabled="webkitFullscreenEnabled");var Ua,Wn=()=>{var i,e;return Ua||(Ua=(e=(i=c)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),Ua)},Ll=async(i=Wn())=>{if(!i)return!1;let e=i.volume;return i.volume=e/2+.1,await ga(0),i.volume!==e},kc=(i=Wn())=>typeof(i==null?void 0:i.requestPictureInPicture)=="function",Sc=(i=Wn())=>{let e=c[B.enabled];return!e&&i&&(e="webkitSupportsFullscreen"in i),e},Fn=Sc(),Rl=kc(),wl=!!l.WebKitPlaybackTargetAvailabilityEvent,xl=!!l.chrome;var Ba,Dl=Ll().then(i=>(Ba=i,Ba)),Cc=Object.values(fe),Pa=i=>Na(i.media,e=>[et.SUBTITLES,et.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),Ol=i=>Na(i.media,e=>e.mode===At.SHOWING&&[et.SUBTITLES,et.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:["playing","pause","timeupdate","loadedmetadata"]},MEDIA_DURATION:{get:function(i){let{media:e}=i;return i.hasAttribute("defaultduration")&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?+i.getAttribute("defaultduration"):!e||!Number.isFinite(e.duration)?Number.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))]},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,t,a;let r=(e=i.media)==null?void 0:e.buffered;return Array.from((a=(t=i.media)==null?void 0:t.buffered)!=null?a:[]).map((n,s)=>[Number(r.start(s)).toFixed(3),Number(r.end(s)).toFixed(3)])},mediaEvents:["progress","emptied"]},MEDIA_STREAM_TYPE:{get:function(i){let{media:e}=i;if(!e)return;let{streamType:t}=e;if(Cc.includes(t)){if(t===fe.UNKNOWN){let r=i.getAttribute("defaultstreamtype");return[fe.LIVE,fe.ON_DEMAND].includes(r)?r:void 0}return t}let a=e.duration;if(a===1/0)return fe.LIVE;if(Number.isFinite(a))return fe.ON_DEMAND;{let r=i.getAttribute("defaultstreamtype");if([fe.LIVE,fe.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===fe.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,a;let r=i.media;if(r&&c[B.element]===void 0&&"webkitDisplayingFullscreen"in r)return r.webkitDisplayingFullscreen&&r.webkitPresentationMode==="fullscreen";let n;return e?n=c[B.element]?e.target:null:n=(a=(t=nl(i))==null?void 0:t.fullscreenElement)!=null?a:c[B.element],tt(i.fullscreenElement,n)},rootEvents:B.rootEvents,mediaEvents:B.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 tt(a,r)}},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},MEDIA_IS_AIRPLAYING:{get:function(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:t.remote.state},remoteEvents:["playing","connect","connecting","disconnect"]},MEDIA_IS_CASTING:{get:function(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:t.remote.state},remoteEvents:["connect","connecting","disconnect"]},MEDIA_AIRPLAY_UNAVAILABLE:{get:function(i,{availability:e=!1}={}){if(!wl)return oe.UNSUPPORTED;if(!(e==null||e===!0))return oe.UNAVAILABLE},mediaSetCallback(i,e){var t;(t=i.remote)==null||t.watchAvailability(a=>e({availability:a}))},mediaUnsetCallback(i){var e;(e=i.remote)==null||e.cancelWatchAvailability()}},MEDIA_CAST_UNAVAILABLE:{get:function(i,{availability:e=!1}={}){var t;let{media:a}=i;if(!xl||!((t=a==null?void 0:a.remote)!=null&&t.state))return oe.UNSUPPORTED;if(!(e==null||e===!0))return oe.UNAVAILABLE},mediaSetCallback(i,e){var t;(t=i.remote)==null||t.watchAvailability(a=>e({availability:a}))},mediaUnsetCallback(i){var e;(e=i.remote)==null||e.cancelWatchAvailability()}},MEDIA_FULLSCREEN_UNAVAILABLE:{get:function(){return Fn?void 0:oe.UNAVAILABLE}},MEDIA_PIP_UNAVAILABLE:{get:function(){return Rl?void 0:oe.UNSUPPORTED}},MEDIA_RENDITION_UNAVAILABLE:{get:function(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return oe.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return oe.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},MEDIA_AUDIO_TRACK_UNAVAILABLE:{get:function(i){var e,t;let{media:a}=i;if(!(a!=null&&a.audioTracks))return oe.UNSUPPORTED;if(((t=(e=a.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return oe.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},MEDIA_VOLUME_UNAVAILABLE:{get:function(i){if(Ba!==void 0&&!Ba)return oe.UNSUPPORTED;let{media:e}=i;if(e&&typeof e.volume=="undefined")return oe.UNAVAILABLE},mediaEvents:["loadstart"]},MEDIA_SUBTITLES_LIST:{get:function(i){return Pa(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},MEDIA_SUBTITLES_SHOWING:{get:function(i,e){var t;return i.hasAttribute("defaultsubtitles")&&["addtrack","removetrack"].includes(e==null?void 0:e.type)&&[et.CAPTIONS,et.SUBTITLES].includes((t=e==null?void 0:e.track)==null?void 0:t.kind)&&xi.MEDIA_TOGGLE_SUBTITLES_REQUEST(void 0,{detail:!0},i),Ol(i).map(({kind:a,label:r,language:n})=>({kind:a,label:r,language:n}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"]},MEDIA_RENDITION_LIST:{get:function(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]]},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},MEDIA_RENDITION_SELECTED:{get:function(i){var e,t,a;let{media:r}=i;return(a=(t=r==null?void 0:r.videoRenditions)==null?void 0:t[(e=r.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:a.id},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},MEDIA_AUDIO_TRACK_LIST:{get:function(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},MEDIA_AUDIO_TRACK_ENABLED:{get:function(i){var e,t;let{media:a}=i;return(t=[...(e=a==null?void 0:a.audioTracks)!=null?e:[]].find(r=>r.enabled))==null?void 0:t.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]}},xi={MEDIA_PLAY_REQUEST:(i,e,t)=>{var a;let r=ie.MEDIA_STREAM_TYPE.get(t),n=t.getAttribute("noautoseektolive")===null;r==fe.LIVE&&n&&xi.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{l.localStorage.setItem("media-chrome-pref-volume",a.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:(i,e,t)=>{if(!Fn){console.warn("MediaChrome: Fullscreen support is unavailable; not entering fullscreen");return}c.pictureInPictureElement&&c.exitPictureInPicture(),t[B.enter]?t.fullscreenElement[B.enter]():i.webkitEnterFullscreen?i.webkitEnterFullscreen():i.requestFullscreen?i.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{c[B.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[B.element]&&c[B.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:async i=>{var e;if(((e=i.remote)==null?void 0:e.state)==="disconnected"){if(c[B.element]&&c[B.exit](),!i.remote.prompt){console.warn("MediaChrome: Casting is not supported in this environment");return}try{await i.remote.prompt()}catch{}}},MEDIA_EXIT_CAST_REQUEST:i=>{var e;((e=i.remote)==null?void 0:e.state)==="connected"&&i.remote.prompt()},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]=Na(i,{kind:et.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,m=>m.startTime>=r);if(!s)return;let d=/'^(?:[a-z]+:)?\/\//i.test(s.text)||(a=i.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,u=new URL(s.text,d),h=new URLSearchParams(u.hash).get("#xywh");t.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,u.href),t.propagateMediaState(o.MEDIA_PREVIEW_COORDS,h.split(","))},MEDIA_SHOW_SUBTITLES_REQUEST:(i,e,t)=>{var a;let r=Pa(t),{detail:n=[]}=e,s=$n(n),d=(a=s[0])==null?void 0:a.language;d&&!(t!=null&&t.hasAttribute("nosubtitleslangpref"))&&l.localStorage.setItem("media-chrome-pref-subtitles-lang",d),Xt(At.SHOWING,r,s)},MEDIA_DISABLE_SUBTITLES_REQUEST:(i,e,t)=>{let a=Pa(t),{detail:r=[]}=e;Xt(At.DISABLED,a,r)},MEDIA_TOGGLE_SUBTITLES_REQUEST:(i,e,t)=>{let{detail:a}=e!=null?e:{},r=Pa(t),n=Ol(t),s=!!n.length;if(r.length){if(a===!1||s&&a!==!0)Xt(At.DISABLED,r,n);else if(a===!0||!s&&a!==!1){let d=r[0];if(!(t!=null&&t.hasAttribute("nosubtitleslangpref"))){let b=l.localStorage.getItem("media-chrome-pref-subtitles-lang"),E=b?[b,...l.navigator.languages]:l.navigator.languages,I=r.filter(H=>E.some(k=>H.language.toLowerCase().startsWith(k.split("-")[0]))).sort((H,k)=>{let $=E.findIndex(ee=>H.language.toLowerCase().startsWith(ee.split("-")[0])),Z=E.findIndex(ee=>k.language.toLowerCase().startsWith(ee.split("-")[0]));return $-Z});I[0]&&(d=I[0])}let{language:u,label:h,kind:m}=d;Xt(At.DISABLED,r,n),Xt(At.SHOWING,r,[{language:u,label:h,kind:m}])}}},MEDIA_AIRPLAY_REQUEST:async i=>{if(i!=null&&i.remote){if(!i.remote.prompt){console.warn("MediaChrome: AirPlay is not supported in this environment");return}try{await i.remote.prompt()}catch{}}},MEDIA_SEEK_TO_LIVE_REQUEST:i=>{let e=i.seekable;if(!e){console.warn("MediaChrome: Media element does not support seeking to live.");return}if(!e.length){console.warn("MediaChrome: Media is unable to seek to live.");return}i.currentTime=e.end(e.length-1)},MEDIA_RENDITION_REQUEST:(i,e)=>{if(!(i!=null&&i.videoRenditions)){console.warn("MediaChrome: Rendition selection not supported by this media.");return}let t=e.detail,a=[...i.videoRenditions].findIndex(r=>r.id==t);i.videoRenditions.selectedIndex!=a&&(i.videoRenditions.selectedIndex=a)},MEDIA_AUDIO_TRACK_REQUEST:(i,e)=>{if(!(i!=null&&i.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let t=e.detail;for(let a of i.audioTracks)a.enabled=t==a.id}};var Zn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Me=(i,e,t)=>(Zn(i,e,"read from private field"),t?t.call(i):e.get(i)),Di=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Kn=(i,e,t,a)=>(Zn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),jt=(i,e,t)=>(Zn(i,e,"access private method"),t),ot,Oi,Jt,ei,Ni,Va,Yn,Hl=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],Mc=10,Nl=0,X={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYS_USED:"keysused",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_HOTKEYS:"nohotkeys"},Ha=class extends La{constructor(){super(),Di(this,ei),Di(this,Va),Di(this,ot,new nt(this,X.HOTKEYS)),Di(this,Oi,void 0),Di(this,Jt,void 0),ie.MEDIA_VOLUME_UNAVAILABLE.get(this)===void 0&&Dl.then(()=>{this.propagateMediaState(o.MEDIA_VOLUME_UNAVAILABLE,ie.MEDIA_VOLUME_UNAVAILABLE.get(this))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associateElement(this),Object.keys(xi).forEach(e=>{let t=`_handle${fa(e,!0)}`;this[t]=a=>{if(a.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}xi[e](this.media,a,this)},this.addEventListener(f[e],this[t])}),this._mediaStatePropagators={},Object.keys(ie).forEach(e=>{this._mediaStatePropagators[e]=t=>{this.propagateMediaState(gt[e],ie[e].get(this,t))}})}static get observedAttributes(){return super.observedAttributes.concat(X.NO_HOTKEYS,X.HOTKEYS,X.DEFAULT_STREAM_TYPE,X.DEFAULT_SUBTITLES,X.DEFAULT_DURATION)}get fullscreenElement(){var e;return(e=Me(this,Oi))!=null?e:this}set fullscreenElement(e){this.hasAttribute(X.FULLSCREEN_ELEMENT)&&this.removeAttribute(X.FULLSCREEN_ELEMENT),Kn(this,Oi,e)}attributeChangedCallback(e,t,a){var r;if(super.attributeChangedCallback(e,t,a),e===X.NO_HOTKEYS)a!==t&&a===""?(this.hasAttribute(X.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===X.HOTKEYS)Me(this,ot).value=a;else if(e===X.DEFAULT_SUBTITLES&&a!==t&&a==="")this.dispatchEvent(new l.CustomEvent(f.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:!0}));else if(e===X.DEFAULT_STREAM_TYPE)this.propagateMediaState(gt.MEDIA_STREAM_TYPE);else if(e===X.FULLSCREEN_ELEMENT){let n=a?(r=Me(this,Jt))==null?void 0:r.getElementById(a):void 0;Kn(this,Oi,n)}}connectedCallback(){super.connectedCallback(),Kn(this,Jt,this.getRootNode()),this.enableHotkeys()}disconnectedCallback(){super.disconnectedCallback(),this.disableHotkeys(),this.dispatchEvent(new l.CustomEvent(f.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:!1}))}mediaSetCallback(e){if(super.mediaSetCallback(e),e.hasAttribute("tabindex")||(e.tabIndex=-1),Object.keys(ie).forEach(t=>{let{mediaSetCallback:a,mediaEvents:r,rootEvents:n,textTracksEvents:s,videoRenditionsEvents:d,audioTracksEvents:u,remoteEvents:h}=ie[t],m=this._mediaStatePropagators[t];a&&(a(e,m),m()),r==null||r.forEach(b=>{e.addEventListener(b,m),m()}),n==null||n.forEach(b=>{var E;(E=Me(this,Jt))==null||E.addEventListener(b,m),m()}),s==null||s.forEach(b=>{var E;(E=e.textTracks)==null||E.addEventListener(b,m),m()}),d==null||d.forEach(b=>{var E;(E=e.videoRenditions)==null||E.addEventListener(b,m),m()}),u==null||u.forEach(b=>{var E;(E=e.audioTracks)==null||E.addEventListener(b,m),m()}),h==null||h.forEach(b=>{var E;(E=e.remote)==null||E.addEventListener(b,m),m()})}),!this.hasAttribute("novolumepref"))try{let t=l.localStorage.getItem("media-chrome-pref-volume");t!==null&&(e.volume=t)}catch(t){console.debug("Error getting volume pref",t)}}mediaUnsetCallback(e){super.mediaUnsetCallback(e),Object.keys(ie).forEach(t=>{let{mediaUnsetCallback:a,mediaEvents:r,rootEvents:n,textTracksEvents:s,videoRenditionsEvents:d,audioTracksEvents:u,remoteEvents:h}=ie[t],m=this._mediaStatePropagators[t];r==null||r.forEach(b=>{e.removeEventListener(b,m)}),n==null||n.forEach(b=>{var E;(E=Me(this,Jt))==null||E.removeEventListener(b,m)}),s==null||s.forEach(b=>{var E;(E=e.textTracks)==null||E.removeEventListener(b,m)}),d==null||d.forEach(b=>{var E;(E=e.videoRenditions)==null||E.removeEventListener(b,m),m()}),u==null||u.forEach(b=>{var E;(E=e.audioTracks)==null||E.removeEventListener(b,m),m()}),h==null||h.forEach(b=>{var E;(E=e.remote)==null||E.removeEventListener(b,m),m()}),a&&(a(e,m),m())}),this.propagateMediaState(gt.MEDIA_PAUSED,!0)}propagateMediaState(e,t){let a=Vl(this.mediaStateReceivers,e);if(Bl(this.mediaStateReceivers,e,t),a===Vl(this.mediaStateReceivers,e))return;let r=e.toLowerCase(),n=new l.CustomEvent(Xs[r],{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(n)}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=Oc(e,a,r);Object.keys(f).forEach(s=>{e.addEventListener(f[s],this[`_handle${fa(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(f).forEach(r=>{e.removeEventListener(f[r],this[`_handle${fa(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];Bl([e],gt[r],n.get(this))}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",jt(this,Va,Yn))}disableHotkeys(){this.removeEventListener("keydown",jt(this,Va,Yn)),this.removeEventListener("keyup",jt(this,ei,Ni))}get hotkeys(){return Me(this,ot)}keyboardShortcutHandler(e){var t,a,r,n;if(((n=(r=(t=e.target.getAttribute(X.KEYS_USED))==null?void 0:t.split(" "))!=null?r:(a=e.target)==null?void 0:a.keysUsed)!=null?n:[]).map(I=>I==="Space"?" ":I).filter(Boolean).includes(e.key))return;let d,u,h,m,b,E=Mc;if(!Me(this,ot).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&Me(this,ot).contains("nospace")))switch(e.key){case" ":case"k":d=this.getAttribute(o.MEDIA_PAUSED)!=null?f.MEDIA_PLAY_REQUEST:f.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"m":d=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?f.MEDIA_UNMUTE_REQUEST:f.MEDIA_MUTE_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"f":d=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?f.MEDIA_EXIT_FULLSCREEN_REQUEST:f.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new l.CustomEvent(f.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":u=this.getAttribute(o.MEDIA_CURRENT_TIME),h=u&&!Number.isNaN(+u)?+u:Nl,m=Math.max(h-E,0),b=new l.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:m}),this.dispatchEvent(b);break;case"ArrowRight":u=this.getAttribute(o.MEDIA_CURRENT_TIME),h=u&&!Number.isNaN(+u)?+u:Nl,m=Math.max(h+E,0),b=new l.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:m}),this.dispatchEvent(b);break;default:break}}};ot=new WeakMap;Oi=new WeakMap;Jt=new WeakMap;ei=new WeakSet;Ni=function(i){let{key:e}=i;if(!Hl.includes(e)){this.removeEventListener("keyup",jt(this,ei,Ni));return}this.keyboardShortcutHandler(i)};Va=new WeakSet;Yn=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!Hl.includes(a)){this.removeEventListener("keyup",jt(this,ei,Ni));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(Me(this,ot).contains(`no${a.toLowerCase()}`)||a===" "&&Me(this,ot).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",jt(this,ei,Ni),{once:!0})};var Lc=Object.values(o),Rc=Object.values(gt),qn=i=>{var e,t,a,r;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)!=null&&e.includes("-"))&&(l.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let s=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,A.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(d=>Lc.includes(d)):[]},wc=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&l.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof l.customElements.get(i.nodeName.toLowerCase()))&&l.customElements.upgrade(i),Rc.some(a=>a in i)},Gn=i=>wc(i)||!!qn(i).length,Ul=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},Pl={[o.MEDIA_SUBTITLES_LIST]:It,[o.MEDIA_SUBTITLES_SHOWING]:It,[o.MEDIA_SEEKABLE]:Ul,[o.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(Ul).join(" "),[o.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[o.MEDIA_RENDITION_LIST]:Js,[o.MEDIA_AUDIO_TRACK_LIST]:el},xc=async(i,e,t)=>{var a,r;if(i.isConnected||await ga(0),typeof t=="boolean"||t==null)return C(i,e,t);if(typeof t=="number")return O(i,e,t);if(typeof t=="string")return R(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(r=(a=Pl[e])==null?void 0:a.call(Pl,t))!=null?r:t;return i.setAttribute(e,n)},Dc=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},kt=(i,e)=>{if(Dc(i))return;let t=(r,n)=>{var s,d;Gn(r)&&n(r);let{children:u=[]}=r!=null?r:{},h=(d=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?d:[];[...u,...h].forEach(b=>kt(b,n))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!Gn(i)){l.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},Bl=(i,e,t)=>{i.forEach(a=>{if(e in a){a[e]=t;return}let r=qn(a),n=e.toLowerCase();r.includes(n)&&xc(a,n,t)})},Vl=(i,e)=>{for(let t of i){if(e in t)return t[e];let a=qn(t),r=e.toLowerCase();if(a.includes(r))return t.getAttribute(r)}},Oc=(i,e,t)=>{kt(i,e);let a=m=>{var b;let E=(b=m==null?void 0:m.composedPath()[0])!=null?b:m.target;e(E)},r=m=>{var b;let E=(b=m==null?void 0:m.composedPath()[0])!=null?b:m.target;t(E)};i.addEventListener(f.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(f.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=m=>{m.forEach(b=>{let{addedNodes:E=[],removedNodes:I=[],type:H,target:k,attributeName:$}=b;H==="childList"?(Array.prototype.forEach.call(E,Z=>kt(Z,e)),Array.prototype.forEach.call(I,Z=>kt(Z,t))):H==="attributes"&&$===A.MEDIA_CHROME_ATTRIBUTES&&(Gn(k)?e(k):t(k))})},s=[],d=m=>{let b=m.target;b.name!=="media"&&(s.forEach(E=>kt(E,t)),s=[...b.assignedElements({flatten:!0})],s.forEach(E=>kt(E,e)))};i.addEventListener("slotchange",d);let u=new MutationObserver(n);return u.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{kt(i,t),i.removeEventListener("slotchange",d),u.disconnect(),i.removeEventListener(f.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(f.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};l.customElements.get("media-controller")||l.customElements.define("media-controller",Ha);var Qn=Ha;var io=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ge=(i,e,t)=>(io(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)},St=(i,e,t,a)=>(io(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Le=(i,e,t)=>(io(i,e,"access private method"),t),Re,qa,Ya,Ga,$a,Wa,Fa,zn,Ka,Xn,Za,ao,Jn,$l,jn,Wl,eo,Fl,to,Kl,Yl=c.createElement("template");Yl.innerHTML=`
|
|
143
|
+
<slot part="bottom chrome"></slot>
|
|
144
|
+
</span>
|
|
145
|
+
`;var Pv=Object.values(s),Nv="sm:384 md:576 lg:768 xl:960";function Uv(i){Bv(i.target,i.contentRect.width)}function Bv(i,e){var t;if(!i.isConnected)return;let a=(t=i.getAttribute(M.BREAKPOINTS))!=null?t:Nv,r=Wv(a),n=Hv(r,e),o=!1;if(Object.keys(r).forEach(d=>{if(n.includes(d)){i.hasAttribute(`breakpoint${d}`)||(i.setAttribute(`breakpoint${d}`,""),o=!0);return}i.hasAttribute(`breakpoint${d}`)&&(i.removeAttribute(`breakpoint${d}`),o=!0)}),o){let d=new CustomEvent(yt.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(d)}}function Wv(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function Hv(i,e){return Object.keys(i).filter(t=>e>=i[t])}var Pa=class extends l.HTMLElement{constructor(){super(),ni(this,qo),ni(this,Zo),ni(this,Da),ni(this,jr),ni(this,Bi),ni(this,Xr,0),ni(this,Ui,void 0),Ov(this,"breakpointsComputed",!1),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Uc.content.cloneNode(!0)));let e=o=>{let d=this.media;for(let u of o)u.type==="childList"&&(u.removedNodes.forEach(c=>{if(c.slot=="media"&&u.target==this){let f=u.previousSibling&&u.previousSibling.previousElementSibling;if(!f||!d)this.mediaUnsetCallback(c);else{let E=f.slot!=="media";for(;(f=f.previousSibling)!==null;)f.slot=="media"&&(E=!1);E&&this.mediaUnsetCallback(c)}}}),d&&u.addedNodes.forEach(c=>{c===d&&this.handleMediaUpdated(d)}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let a=!1;Le(this,o=>{a||(setTimeout(()=>{Uv(o),a=!1,this.breakpointsComputed||(this.breakpointsComputed=!0,this.dispatchEvent(new CustomEvent(yt.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))},0),a=!0)});let n=this.querySelector(":scope > slot[slot=media]");n&&n.addEventListener("slotchange",()=>{if(!n.assignedElements({flatten:!0}).length){Go(this,Ui)&&this.mediaUnsetCallback(Go(this,Ui));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[M.AUTOHIDE,M.GESTURES_DISABLED].concat(Pv).filter(e=>![s.MEDIA_RENDITION_LIST,s.MEDIA_AUDIO_TRACK_LIST,s.MEDIA_CHAPTERS_CUES].includes(e))}attributeChangedCallback(e,t,a){e.toLowerCase()==M.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}async handleMediaUpdated(e){e&&(Yo(this,Ui,e),e.localName.includes("-")&&await l.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;let a=this.getAttribute(M.AUDIO)!=null?K.AUDIO_PLAYER():K.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.handleMediaUpdated(this.media),this.setAttribute(M.USER_INACTIVE,""),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=l.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;this.media&&this.mediaUnsetCallback(this.media),(e=l.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Yo(this,Ui,null)}handleEvent(e){switch(e.type){case"pointerdown":Yo(this,Xr,e.timeStamp);break;case"pointermove":We(this,qo,Pc).call(this,e);break;case"pointerup":We(this,Zo,Nc).call(this,e);break;case"mouseleave":We(this,Da,Jr).call(this);break;case"mouseup":this.removeAttribute(M.KEYBOARD_CONTROL);break;case"keyup":We(this,Bi,Oa).call(this),this.setAttribute(M.KEYBOARD_CONTROL,"");break}}set autohide(e){e=Number(e),this._autohide=isNaN(e)?0:e}get autohide(){return this._autohide===void 0?2:this._autohide}};Xr=new WeakMap;Ui=new WeakMap;qo=new WeakSet;Pc=function(i){i.pointerType!=="mouse"&&i.timeStamp-Go(this,Xr)<250||(We(this,jr,zo).call(this),clearTimeout(this._inactiveTimeout),[this,this.media].includes(i.target)&&We(this,Bi,Oa).call(this))};Zo=new WeakSet;Nc=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(M.USER_INACTIVE);[this,this.media].includes(i.target)&&e?We(this,Da,Jr).call(this):We(this,Bi,Oa).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&We(this,Bi,Oa).call(this)};Da=new WeakSet;Jr=function(){if(this.autohide<0||this.hasAttribute(M.USER_INACTIVE))return;this.setAttribute(M.USER_INACTIVE,"");let i=new l.CustomEvent(yt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};jr=new WeakSet;zo=function(){if(!this.hasAttribute(M.USER_INACTIVE))return;this.removeAttribute(M.USER_INACTIVE);let i=new l.CustomEvent(yt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};Bi=new WeakSet;Oa=function(){We(this,jr,zo).call(this),clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=setTimeout(()=>{We(this,Da,Jr).call(this)},this.autohide*1e3))};l.customElements.get("media-container")||l.customElements.define("media-container",Pa);var Bc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},re=(i,e,t)=>(Bc(i,e,"read from private field"),t?t.call(i):e.get(i)),Na=(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)},en=(i,e,t,a)=>(Bc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Wi,Hi,tn,si,Tt,Ut,Me=class{constructor(e,t,{defaultValue:a}={defaultValue:void 0}){Na(this,Tt),Na(this,Wi,void 0),Na(this,Hi,void 0),Na(this,tn,void 0),Na(this,si,new Set),en(this,Wi,e),en(this,Hi,t),en(this,tn,new Set(a))}[Symbol.iterator](){return re(this,Tt,Ut).values()}get length(){return re(this,Tt,Ut).size}get value(){var e;return(e=[...re(this,Tt,Ut)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(en(this,si,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...re(this,Tt,Ut)][e]}values(){return re(this,Tt,Ut).values()}forEach(e){re(this,Tt,Ut).forEach(e)}add(...e){var t,a;e.forEach(r=>re(this,si).add(r)),!(this.value===""&&!((t=re(this,Wi))!=null&&t.hasAttribute(`${re(this,Hi)}`)))&&((a=re(this,Wi))==null||a.setAttribute(`${re(this,Hi)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>re(this,si).delete(a)),(t=re(this,Wi))==null||t.setAttribute(`${re(this,Hi)}`,`${this.value}`)}contains(e){return re(this,Tt,Ut).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}};Wi=new WeakMap;Hi=new WeakMap;tn=new WeakMap;si=new WeakMap;Tt=new WeakSet;Ut=function(){return re(this,si).size?re(this,si):re(this,tn)};var $v=(i="")=>i.split(/\s+/),Wc=(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}},kt=(i="",e={})=>$v(i).map(t=>{let a=Wc(t);return{...e,...a}}),Xo=i=>i?Array.isArray(i)?i.map(e=>typeof e=="string"?Wc(e):e):typeof i=="string"?kt(i):[i]:[],oi=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,He=(i=[])=>Array.prototype.map.call(i,oi).join(" "),Fv=(i,e)=>t=>t[i]===e,Hc=i=>{let e=Object.entries(i).map(([t,a])=>Fv(t,a));return t=>e.every(a=>a(t))},li=(i,e=[],t=[])=>{let a=Xo(t).map(Hc),r=n=>a.some(o=>o(n));Array.from(e).filter(r).forEach(n=>{n.mode=i})},di=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:Hc(e);return Array.from(i.textTracks).filter(t)},an=i=>{var e;return!!((e=i.mediaSubtitlesShowing)!=null&&e.length)||i.hasAttribute(s.MEDIA_SUBTITLES_SHOWING)};var G={enter:"requestFullscreen",exit:"exitFullscreen",rootEvents:["fullscreenchange"],mediaEvents:[],element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};m.fullscreenElement===void 0&&(G.enter="webkitRequestFullScreen",G.exit=m.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",G.rootEvents=["webkitfullscreenchange"],G.mediaEvents=["webkitbeginfullscreen","webkitendfullscreen"],G.element="webkitFullscreenElement",G.error="webkitfullscreenerror",G.enabled="webkitFullscreenEnabled");var rn,Jo=()=>{var i,e;return rn||(rn=(e=(i=m)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),rn)},$c=async(i=Jo())=>{if(!i)return!1;let e=i.volume;return i.volume=e/2+.1,await Vr(0),i.volume!==e},Vv=/.*Version\/.*Safari\/.*/.test(l.navigator.userAgent),jo=(i=Jo())=>l.matchMedia("(display-mode: standalone)").matches&&Vv?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",el=(i=Jo())=>{let e=m[G.enabled];return!e&&i&&(e="webkitSupportsFullscreen"in i),e},Fc=el(),Vc=jo(),Kc=!!l.WebKitPlaybackTargetAvailabilityEvent,Yc=!!l.chrome;var $i=i=>di(i.media,e=>[Ne.SUBTITLES,Ne.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),tl=i=>di(i.media,e=>e.mode===Pt.SHOWING&&[Ne.SUBTITLES,Ne.CAPTIONS].includes(e.kind)),nn=(i,e)=>{let t=$i(i),a=tl(i),r=!!a.length;if(t.length){if(e===!1||r&&e!==!0)li(Pt.DISABLED,t,a);else if(e===!0||!r&&e!==!1){let n=t[0],{options:o}=i;if(!(o!=null&&o.noSubtitlesLangPref)){let f=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),E=f?[f,...globalThis.navigator.languages]:globalThis.navigator.languages,v=t.filter(b=>E.some(w=>b.language.toLowerCase().startsWith(w.split("-")[0]))).sort((b,w)=>{let _=E.findIndex(R=>b.language.toLowerCase().startsWith(R.split("-")[0])),T=E.findIndex(R=>w.language.toLowerCase().startsWith(R.split("-")[0]));return _-T});v[0]&&(n=v[0])}let{language:d,label:u,kind:c}=n;li(Pt.DISABLED,t,a),li(Pt.SHOWING,t,[{language:d,label:u,kind:c}])}}},sn=(i,e)=>i===e?!0:typeof i!=typeof e?!1:typeof i=="number"&&Number.isNaN(i)&&Number.isNaN(e)?!0:typeof i!="object"?!1:Array.isArray(i)?Kv(i,e):Object.entries(i).every(([t,a])=>t in e&&sn(a,e[t])),Kv=(i,e)=>{let t=Array.isArray(i),a=Array.isArray(e);return t!==a?!1:t||a?i.length!==e.length?!1:i.every((r,n)=>sn(r,e[n])):!0};var Yv=Object.values(Ue),on,Gv=$c().then(i=>(on=i,on)),Gc=async(...i)=>{await i.filter(e=>e).forEach(async e=>{if(!("localName"in e&&e instanceof l.HTMLElement))return;let t=e.localName;if(!t.includes("-"))return;let a=l.customElements.get(t);a&&e instanceof a||(await l.customElements.whenDefined(t),l.customElements.upgrade(e))})},Ua={mediaPaused:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.paused)!=null?e:!0},set(i,e){let{media:t}=e;t&&(i?t.pause():t.play().catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(i,e){let{media:t}=i;return t?e?e.type==="playing":!t.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.playbackRate)!=null?e:1},set(i,e){let{media:t}=e;t&&Number.isFinite(+i)&&(t.playbackRate=+i)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.muted)!=null?e:!1},set(i,e){let{media:t}=e;t&&(t.muted=i)},mediaEvents:["volumechange"]},mediaVolume:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.volume)!=null?e:1},set(i,e){let{media:t}=e;if(t){try{i==null?l.localStorage.removeItem("media-chrome-pref-volume"):l.localStorage.setItem("media-chrome-pref-volume",i.toString())}catch{}Number.isFinite(+i)&&(t.volume=+i)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(i,e)=>{let{options:{noVolumePref:t}}=e;if(!t)try{let a=l.localStorage.getItem("media-chrome-pref-volume");if(a==null)return;Ua.mediaVolume.set(+a,e),i(a)}catch(a){console.debug("Error getting volume pref",a)}}]},mediaVolumeLevel:{get(i){let{media:e}=i;return typeof(e==null?void 0:e.volume)=="undefined"?"high":e.muted||e.volume===0?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(i){var e;let{media:t}=i;return(e=t==null?void 0:t.currentTime)!=null?e:0},set(i,e){let{media:t}=e;t!=null&&t.readyState&&(t.currentTime=i)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(i){let{media:e,options:{defaultDuration:t}={}}=i;return t&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?t:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(i){let{media:e}=i;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(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))]},mediaEvents:["loadedmetadata","emptied","progress"]},mediaBuffered:{get(i){var e;let{media:t}=i,a=(e=t==null?void 0:t.buffered)!=null?e:[];return Array.from(a).map((r,n)=>[Number(a.start(n).toFixed(3)),Number(a.end(n).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(i){let{media:e,options:{defaultStreamType:t}={}}=i,a=[Ue.LIVE,Ue.ON_DEMAND].includes(t)?t:void 0;if(!e)return a;let{streamType:r}=e;if(Yv.includes(r))return r===Ue.UNKNOWN?a:r;let n=e.duration;return n===1/0?Ue.LIVE:Number.isFinite(n)?Ue.ON_DEMAND:a},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(i){let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e,a=Ua.mediaStreamType.get(i);return(t==null||Number.isNaN(t))&&a===Ue.LIVE?0:t},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(i){let{media:e,options:{liveEdgeOffset:t=10}={}}=i;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Ua.mediaStreamType.get(i)===Ue.LIVE))return!1;let r=e.seekable;if(!r)return!0;if(!r.length)return!1;let n=r.end(r.length-1)-t;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(i){return $i(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(i){return tl(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{var t,a;let{media:r,options:n}=e;if(!r)return;let o=d=>{var u;!n.defaultSubtitles||d&&![Ne.CAPTIONS,Ne.SUBTITLES].includes((u=d==null?void 0:d.track)==null?void 0:u.kind)||nn(e,!0)};return(t=r.textTracks)==null||t.addEventListener("addtrack",o),(a=r.textTracks)==null||a.addEventListener("removetrack",o),o(),()=>{var d,u;(d=r.textTracks)==null||d.removeEventListener("addtrack",o),(u=r.textTracks)==null||u.removeEventListener("removetrack",o)}}]},mediaChaptersCues:{get(i){var e;let{media:t}=i;if(!t)return[];let[a]=di(t,{kind:Ne.CHAPTERS});return Array.from((e=a==null?void 0:a.cues)!=null?e:[]).map(({text:r,startTime:n,endTime:o})=>({text:r,startTime:n,endTime:o}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(i,e)=>{let{media:t}=e;if(!t)return;let a=t.querySelector('track[kind="chapters"][default][src]');return a==null||a.addEventListener("load",i),()=>{a==null||a.removeEventListener("load",i)}}]},mediaIsPip:{get(i){var e,t;let{media:a,documentElement:r}=i;if(!a||!r||!r.pictureInPictureElement)return!1;if(r.pictureInPictureElement===a)return!0;if(r.pictureInPictureElement instanceof HTMLMediaElement)return(e=a.localName)!=null&&e.includes("-")?ue(a,r.pictureInPictureElement):!1;if(r.pictureInPictureElement.localName.includes("-")){let n=r.pictureInPictureElement.shadowRoot;for(;n!=null&&n.pictureInPictureElement;){if(n.pictureInPictureElement===a)return!0;n=(t=n.pictureInPictureElement)==null?void 0:t.shadowRoot}}return!1},set(i,e){let{media:t}=e;if(t)if(i){if(!m.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!t.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}let a=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};t.requestPictureInPicture().catch(r=>{if(r.code===11){if(!t.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(t.readyState===0&&t.preload==="none"){let n=()=>{t.removeEventListener("loadedmetadata",o),t.preload="none"},o=()=>{t.requestPictureInPicture().catch(a),n()};t.addEventListener("loadedmetadata",o),t.preload="metadata",setTimeout(()=>{t.readyState===0&&a(),n()},1e3)}else throw r}else throw r})}else m.pictureInPictureElement&&m.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]].map(a=>({...a}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(i){var e,t,a;let{media:r}=i;return(a=(t=r==null?void 0:r.videoRenditions)==null?void 0:t[(e=r.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:a.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let a=i,r=Array.prototype.findIndex.call(t.videoRenditions,n=>n.id==a);t.videoRenditions.selectedIndex!=r&&(t.videoRenditions.selectedIndex=r)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(i){var e,t;let{media:a}=i;return(t=[...(e=a==null?void 0:a.audioTracks)!=null?e:[]].find(r=>r.enabled))==null?void 0:t.id},set(i,e){let{media:t}=e;if(!(t!=null&&t.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let a=i;for(let r of t.audioTracks)r.enabled=a==r.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(i){var e;let{media:t,documentElement:a,fullscreenElement:r=t}=i;if(!t||!a)return!1;if(!a[G.element])return"webkitDisplayingFullscreen"in t&&"webkitPresentationMode"in t?t.webkitDisplayingFullscreen&&t.webkitPresentationMode===_c.FULLSCREEN:!1;if(a[G.element]===r)return!0;if(a[G.element].localName.includes("-")){let n=a[G.element].shadowRoot;if(!(G.element in n))return ue(a[G.element],r);for(;n!=null&&n[G.element];){if(n[G.element]===r)return!0;n=(e=n[G.element])==null?void 0:e.shadowRoot}}return!1},set(i,e){var t,a;let{media:r,fullscreenElement:n,documentElement:o}=e;if(!i&&(o!=null&&o[G.exit])){let d=(t=o==null?void 0:o[G.exit])==null?void 0:t.call(o);d instanceof Promise&&d.catch(()=>{});return}if(n!=null&&n[G.enter]){let d=(a=n[G.enter])==null?void 0:a.call(n);d instanceof Promise&&d.catch(()=>{})}else r!=null&&r.webkitEnterFullscreen?r.webkitEnterFullscreen():r!=null&&r.requestFullscreen&&r.requestFullscreen()},rootEvents:G.rootEvents,mediaEvents:G.mediaEvents},mediaIsCasting:{get(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:!!t.remote.state},set(i,e){var t,a;let{media:r}=e;if(r&&!(i&&((t=r.remote)==null?void 0:t.state)!=="disconnected")&&!(!i&&((a=r.remote)==null?void 0:a.state)!=="connected")){if(typeof r.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}r.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(i,e){let{media:t}=e;if(t){if(!(t.webkitShowPlaybackTargetPicker&&l.WebKitPlaybackTargetAvailabilityEvent)){console.warn("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}t.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(i){let{media:e}=i;if(!Fc||!el(e))return Te.UNSUPPORTED}},mediaPipUnavailable:{get(i){let{media:e}=i;if(!Vc||!jo(e))return Te.UNSUPPORTED}},mediaVolumeUnavailable:{get(i){let{media:e}=i;if(on===!1||(e==null?void 0:e.volume)==null)return Te.UNSUPPORTED},stateOwnersUpdateHandlers:[i=>{on==null&&Gv.then(e=>i(e?void 0:Te.UNSUPPORTED))}]},mediaCastUnavailable:{get(i,{availability:e="not-available"}={}){var t;let{media:a}=i;if(!Yc||!((t=a==null?void 0:a.remote)!=null&&t.state))return Te.UNSUPPORTED;if(!(e==null||e==="available"))return Te.UNAVAILABLE},stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(t=a==null?void 0:a.remote)==null||t.watchAvailability(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=a==null?void 0:a.remote)==null||n.cancelWatchAvailability()}):void 0}]},mediaAirplayUnavailable:{get(i,e){if(!Kc)return Te.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return Te.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(i,e)=>{var t;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(t=a==null?void 0:a.remote)==null||t.watchAvailability(n=>{i({availability:n?"available":"not-available"})}).catch(n=>{n.name==="NotSupportedError"?i({availability:null}):i({availability:"not-available"})}),()=>{var n;(n=a==null?void 0:a.remote)==null||n.cancelWatchAvailability()}):void 0}]},mediaRenditionUnavailable:{get(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return Te.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return Te.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(i){var e,t;let{media:a}=i;if(!(a!=null&&a.audioTracks))return Te.UNSUPPORTED;if(((t=(e=a.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return Te.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]}};var qc={[h.MEDIA_PREVIEW_REQUEST](i,e,{detail:t}){var a,r,n;let{media:o}=e,d=t!=null?t:void 0,u,c;if(o&&d!=null){let[b]=di(o,{kind:Ne.METADATA,label:"thumbnails"}),w=Array.prototype.find.call((a=b==null?void 0:b.cues)!=null?a:[],(_,T,R)=>T===0?_.endTime>d:T===R.length-1?_.startTime<=d:_.startTime<=d&&_.endTime>d);if(w){let _=/'^(?:[a-z]+:)?\/\//i.test(w.text)||(r=o==null?void 0:o.querySelector('track[label="thumbnails"]'))==null?void 0:r.src,T=new URL(w.text,_);c=new URLSearchParams(T.hash).get("#xywh").split(","),u=T.href}}let f=i.mediaDuration.get(e),v=(n=i.mediaChaptersCues.get(e).find((b,w,_)=>w===_.length-1&&f===b.endTime?b.startTime<=d&&b.endTime>=d:b.startTime<=d&&b.endTime>d))==null?void 0:n.text;return t!=null&&v==null&&(v=""),{mediaPreviewTime:d,mediaPreviewImage:u,mediaPreviewCoords:c,mediaPreviewChapter:v}},[h.MEDIA_PAUSE_REQUEST](i,e){i["mediaPaused"].set(!0,e)},[h.MEDIA_PLAY_REQUEST](i,e){var t;let a="mediaPaused";if(i.mediaStreamType.get(e)===Ue.LIVE){let o=!(i.mediaTargetLiveWindow.get(e)>0),d=(t=i.mediaSeekable.get(e))==null?void 0:t[1];o&&d&&i.mediaCurrentTime.set(d,e)}i[a].set(!1,e)},[h.MEDIA_PLAYBACK_RATE_REQUEST](i,e,{detail:t}){let a="mediaPlaybackRate",r=t;i[a].set(r,e)},[h.MEDIA_MUTE_REQUEST](i,e){i["mediaMuted"].set(!0,e)},[h.MEDIA_UNMUTE_REQUEST](i,e){let t="mediaMuted";i.mediaVolume.get(e)||i.mediaVolume.set(.25,e),i[t].set(!1,e)},[h.MEDIA_VOLUME_REQUEST](i,e,{detail:t}){let a="mediaVolume",r=t;r&&i.mediaMuted.get(e)&&i.mediaMuted.set(!1,e),i[a].set(r,e)},[h.MEDIA_SEEK_REQUEST](i,e,{detail:t}){let a="mediaCurrentTime",r=t;i[a].set(r,e)},[h.MEDIA_SEEK_TO_LIVE_REQUEST](i,e){var t;let a="mediaCurrentTime",r=(t=i.mediaSeekable.get(e))==null?void 0:t[1];Number.isNaN(Number(r))&&i[a].set(r,e)},[h.MEDIA_SHOW_SUBTITLES_REQUEST](i,e,{detail:t}){var a;let{options:r}=e,n=$i(e),o=Xo(t),d=(a=o[0])==null?void 0:a.language;d&&!r.noSubtitlesLangPref&&l.localStorage.setItem("media-chrome-pref-subtitles-lang",d),li(Pt.SHOWING,n,o)},[h.MEDIA_DISABLE_SUBTITLES_REQUEST](i,e,{detail:t}){let a=$i(e),r=t!=null?t:[];li(Pt.DISABLED,a,r)},[h.MEDIA_TOGGLE_SUBTITLES_REQUEST](i,e,{detail:t}){nn(e,t)},[h.MEDIA_RENDITION_REQUEST](i,e,{detail:t}){let a="mediaRenditionSelected",r=t;i[a].set(r,e)},[h.MEDIA_AUDIO_TRACK_REQUEST](i,e,{detail:t}){let a="mediaAudioTrackEnabled",r=t;i[a].set(r,e)},[h.MEDIA_ENTER_PIP_REQUEST](i,e){let t="mediaIsPip";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[h.MEDIA_EXIT_PIP_REQUEST](i,e){i["mediaIsPip"].set(!1,e)},[h.MEDIA_ENTER_FULLSCREEN_REQUEST](i,e){let t="mediaIsFullscreen";i.mediaIsPip.get(e)&&i.mediaIsPip.set(!1,e),i[t].set(!0,e)},[h.MEDIA_EXIT_FULLSCREEN_REQUEST](i,e){i["mediaIsFullscreen"].set(!1,e)},[h.MEDIA_ENTER_CAST_REQUEST](i,e){let t="mediaIsCasting";i.mediaIsFullscreen.get(e)&&i.mediaIsFullscreen.set(!1,e),i[t].set(!0,e)},[h.MEDIA_EXIT_CAST_REQUEST](i,e){i["mediaIsCasting"].set(!1,e)},[h.MEDIA_AIRPLAY_REQUEST](i,e){i["mediaIsAirplaying"].set(!0,e)}};var qv=({media:i,fullscreenElement:e,documentElement:t,stateMediator:a=Ua,requestMap:r=qc,options:n={},monitorStateOwnersOnlyWithSubscriptions:o=!0})=>{let d=[],u={options:{...n}},c=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),f=_=>{_!=null&&(sn(_,c)||(c=Object.freeze({...c,..._}),d.forEach(T=>T(c))))},E=()=>{let _=Object.entries(a).reduce((T,[R,{get:oe}])=>(T[R]=oe(u),T),{});f(_)},v={},b,w=async(_,T)=>{var R,oe,ge,Ot,_t,Ea,ga,_a,Aa,ya,Ta,ka,Sa,Ia,Ca,La;let Br=!!b;if(b={...u,...b!=null?b:{},..._},Br)return;await Gc(...Object.values(_));let At=d.length>0&&T===0&&o,Ma=u.media!==b.media,Qu=((R=u.media)==null?void 0:R.textTracks)!==((oe=b.media)==null?void 0:oe.textTracks),zu=((ge=u.media)==null?void 0:ge.videoRenditions)!==((Ot=b.media)==null?void 0:Ot.videoRenditions),Xu=((_t=u.media)==null?void 0:_t.audioTracks)!==((Ea=b.media)==null?void 0:Ea.audioTracks),Ju=((ga=u.media)==null?void 0:ga.remote)!==((_a=b.media)==null?void 0:_a.remote),ju=u.documentElement!==b.documentElement,ec=!!u.media&&(Ma||At),tc=!!((Aa=u.media)!=null&&Aa.textTracks)&&(Qu||At),ic=!!((ya=u.media)!=null&&ya.videoRenditions)&&(zu||At),ac=!!((Ta=u.media)!=null&&Ta.audioTracks)&&(Xu||At),rc=!!((ka=u.media)!=null&&ka.remote)&&(Ju||At),nc=!!u.documentElement&&(ju||At),sc=ec||tc||ic||ac||rc||nc,Pi=d.length===0&&T===1&&o,oc=!!b.media&&(Ma||Pi),lc=!!((Sa=b.media)!=null&&Sa.textTracks)&&(Qu||Pi),dc=!!((Ia=b.media)!=null&&Ia.videoRenditions)&&(zu||Pi),uc=!!((Ca=b.media)!=null&&Ca.audioTracks)&&(Xu||Pi),cc=!!((La=b.media)!=null&&La.remote)&&(Ju||Pi),mc=!!b.documentElement&&(ju||Pi),hc=oc||lc||dc||uc||cc||mc;if(!(sc||hc)){Object.entries(b).forEach(([F,wa])=>{u[F]=wa}),E(),b=void 0;return}Object.entries(a).forEach(([F,{get:wa,mediaEvents:av=[],textTracksEvents:rv=[],videoRenditionsEvents:nv=[],audioTracksEvents:sv=[],remoteEvents:ov=[],rootEvents:lv=[],stateOwnersUpdateHandlers:dv=[]}])=>{v[F]||(v[F]={});let _e=j=>{let Ae=wa(u,j);f({[F]:Ae})},ae;ae=v[F].mediaEvents,av.forEach(j=>{ae&&ec&&(u.media.removeEventListener(j,ae),v[F].mediaEvents=void 0),oc&&(b.media.addEventListener(j,_e),v[F].mediaEvents=_e)}),ae=v[F].textTracksEvents,rv.forEach(j=>{var Ae,Pe;ae&&tc&&((Ae=u.media.textTracks)==null||Ae.removeEventListener(j,ae),v[F].textTracksEvents=void 0),lc&&((Pe=b.media.textTracks)==null||Pe.addEventListener(j,_e),v[F].textTracksEvents=_e)}),ae=v[F].videoRenditionsEvents,nv.forEach(j=>{var Ae,Pe;ae&&ic&&((Ae=u.media.videoRenditions)==null||Ae.removeEventListener(j,ae),v[F].videoRenditionsEvents=void 0),dc&&((Pe=b.media.videoRenditions)==null||Pe.addEventListener(j,_e),v[F].videoRenditionsEvents=_e)}),ae=v[F].audioTracksEvents,sv.forEach(j=>{var Ae,Pe;ae&&ac&&((Ae=u.media.audioTracks)==null||Ae.removeEventListener(j,ae),v[F].audioTracksEvents=void 0),uc&&((Pe=b.media.audioTracks)==null||Pe.addEventListener(j,_e),v[F].audioTracksEvents=_e)}),ae=v[F].remoteEvents,ov.forEach(j=>{var Ae,Pe;ae&&rc&&((Ae=u.media.remote)==null||Ae.removeEventListener(j,ae),v[F].remoteEvents=void 0),cc&&((Pe=b.media.remote)==null||Pe.addEventListener(j,_e),v[F].remoteEvents=_e)}),ae=v[F].rootEvents,lv.forEach(j=>{ae&&nc&&(u.documentElement.removeEventListener(j,ae),v[F].rootEvents=void 0),mc&&(b.documentElement.addEventListener(j,_e),v[F].rootEvents=_e)});let pc=v[F].stateOwnersUpdateHandlers;dv.forEach(j=>{pc&&sc&&pc(),hc&&(v[F].stateOwnersUpdateHandlers=j(_e,b))})}),Object.entries(b).forEach(([F,wa])=>{u[F]=wa}),E(),b=void 0};return w({media:i,fullscreenElement:e,documentElement:t,options:n}),{dispatch(_){let{type:T,detail:R}=_;if(r[T]){f(r[T](a,u,_));return}T==="mediaelementchangerequest"?w({media:R}):T==="fullscreenelementchangerequest"?w({fullscreenElement:R}):T==="documentelementchangerequest"?w({documentElement:R}):T==="optionschangerequest"&&Object.entries(R!=null?R:{}).forEach(([oe,ge])=>{u.options[oe]=ge})},getState(){return c},subscribe(_){return w({},d.length+1),d.push(_),_(c),()=>{let T=d.indexOf(_);T>=0&&(w({},d.length-1),d.splice(T,1))}}}},Zc=qv;var nl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},L=(i,e,t)=>(nl(i,e,"read from private field"),t?t.call(i):e.get(i)),St=(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)},Bt=(i,e,t,a)=>(nl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Wt=(i,e,t)=>(nl(i,e,"access private method"),t),Ht,Ba,q,Wa,Je,ln,dn,il,Fi,Ha,un,al,jc=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],Qc=10,B={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYS_USED:"keysused",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_HOTKEYS:"nohotkeys",NO_VOLUME_PREF:"novolumepref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_DEFAULT_STORE:"nodefaultstore"},cn=class extends Pa{constructor(){super(),St(this,dn),St(this,Fi),St(this,un),St(this,Ht,new Me(this,B.HOTKEYS)),St(this,Ba,void 0),St(this,q,void 0),St(this,Wa,void 0),St(this,Je,void 0),St(this,ln,t=>{var a;(a=L(this,q))==null||a.dispatch(t)}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associateElement(this);let e={};Bt(this,Wa,t=>{Object.entries(t).forEach(([a,r])=>{if(a in e&&e[a]===r)return;this.propagateMediaState(a,r);let n=a.toLowerCase(),o=new l.CustomEvent(gc[n],{composed:!0,detail:r});this.dispatchEvent(o)}),e=t}),this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(B.NO_HOTKEYS,B.HOTKEYS,B.DEFAULT_STREAM_TYPE,B.DEFAULT_SUBTITLES,B.DEFAULT_DURATION)}get mediaStore(){return L(this,q)}set mediaStore(e){var t,a;if(L(this,q)&&((t=L(this,Je))==null||t.call(this),Bt(this,Je,void 0)),Bt(this,q,e),!L(this,q)&&!this.hasAttribute(B.NO_DEFAULT_STORE)){Wt(this,dn,il).call(this);return}Bt(this,Je,(a=L(this,q))==null?void 0:a.subscribe(L(this,Wa)))}get fullscreenElement(){var e;return(e=L(this,Ba))!=null?e:this}set fullscreenElement(e){var t;this.hasAttribute(B.FULLSCREEN_ELEMENT)&&this.removeAttribute(B.FULLSCREEN_ELEMENT),Bt(this,Ba,e),(t=L(this,q))==null||t.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}attributeChangedCallback(e,t,a){var r,n,o,d,u,c;if(super.attributeChangedCallback(e,t,a),e===B.NO_HOTKEYS)a!==t&&a===""?(this.hasAttribute(B.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==t&&a===null&&this.enableHotkeys();else if(e===B.HOTKEYS)L(this,Ht).value=a;else if(e===B.DEFAULT_SUBTITLES&&a!==t)(r=L(this,q))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(B.DEFAULT_SUBTITLES)}});else if(e===B.DEFAULT_STREAM_TYPE)(o=L(this,q))==null||o.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(n=this.getAttribute(B.DEFAULT_STREAM_TYPE))!=null?n:void 0}});else if(e===B.LIVE_EDGE_OFFSET)(d=L(this,q))==null||d.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(B.LIVE_EDGE_OFFSET)?+this.getAttribute(B.LIVE_EDGE_OFFSET):void 0}});else if(e===B.FULLSCREEN_ELEMENT){let f=a?(u=this.getRootNode())==null?void 0:u.getElementById(a):void 0;Bt(this,Ba,f),(c=L(this,q))==null||c.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}}connectedCallback(){var e,t;!L(this,q)&&!this.hasAttribute(B.NO_DEFAULT_STORE)&&Wt(this,dn,il).call(this),(e=L(this,q))==null||e.dispatch({type:"documentelementchangerequest",detail:m}),super.connectedCallback(),L(this,q)&&!L(this,Je)&&Bt(this,Je,(t=L(this,q))==null?void 0:t.subscribe(L(this,Wa))),this.enableHotkeys()}disconnectedCallback(){var e,t,a,r;(e=super.disconnectedCallback)==null||e.call(this),L(this,q)&&((t=L(this,q))==null||t.dispatch({type:"documentelementchangerequest",detail:void 0}),(a=L(this,q))==null||a.dispatch({type:h.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})),L(this,Je)&&((r=L(this,Je))==null||r.call(this),Bt(this,Je,void 0))}mediaSetCallback(e){var t;super.mediaSetCallback(e),(t=L(this,q))==null||t.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),(t=L(this,q))==null||t.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,t){Jc(this.mediaStateReceivers,e,t)}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=jv(e,a,r);Object.values(h).forEach(o=>{e.addEventListener(o,L(this,ln))}),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.values(h).forEach(r=>{e.removeEventListener(r,L(this,ln))})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),L(this,q)&&Object.entries(L(this,q).getState()).forEach(([r,n])=>{Jc([e],r,n)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",Wt(this,un,al))}disableHotkeys(){this.removeEventListener("keydown",Wt(this,un,al)),this.removeEventListener("keyup",Wt(this,Fi,Ha))}get hotkeys(){return L(this,Ht)}keyboardShortcutHandler(e){var t,a,r,n,o,d;if(((n=(r=(t=e.target.getAttribute(B.KEYS_USED))==null?void 0:t.split(" "))!=null?r:(a=e.target)==null?void 0:a.keysUsed)!=null?n:[]).map(v=>v==="Space"?" ":v).filter(Boolean).includes(e.key))return;let c,f,E;if(!L(this,Ht).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&L(this,Ht).contains("nospace")))switch(e.key){case" ":case"k":c=L(this,q).getState().mediaPaused?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new l.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"m":c=this.mediaStore.getState().mediaVolumeLevel==="off"?h.MEDIA_UNMUTE_REQUEST:h.MEDIA_MUTE_REQUEST,this.dispatchEvent(new l.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"f":c=this.mediaStore.getState().mediaIsFullscreen?h.MEDIA_EXIT_FULLSCREEN_REQUEST:h.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new l.CustomEvent(c,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new l.CustomEvent(h.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":f=Math.max(((o=this.mediaStore.getState().mediaCurrentTime)!=null?o:0)-Qc,0),E=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:f}),this.dispatchEvent(E);break;case"ArrowRight":f=Math.max(((d=this.mediaStore.getState().mediaCurrentTime)!=null?d:0)+Qc,0),E=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:f}),this.dispatchEvent(E);break;default:break}}};Ht=new WeakMap;Ba=new WeakMap;q=new WeakMap;Wa=new WeakMap;Je=new WeakMap;ln=new WeakMap;dn=new WeakSet;il=function(){var i;this.mediaStore=Zc({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(B.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(B.DEFAULT_DURATION)?+this.getAttribute(B.DEFAULT_DURATION):void 0,defaultStreamType:(i=this.getAttribute(B.DEFAULT_STREAM_TYPE))!=null?i:void 0,liveEdgeOffset:this.hasAttribute(B.LIVE_EDGE_OFFSET)?+this.getAttribute(B.LIVE_EDGE_OFFSET):void 0,noVolumePref:this.hasAttribute(B.NO_VOLUME_PREF),noSubtitlesLangPref:this.hasAttribute(B.NO_SUBTITLES_LANG_PREF)}})};Fi=new WeakSet;Ha=function(i){let{key:e}=i;if(!jc.includes(e)){this.removeEventListener("keyup",Wt(this,Fi,Ha));return}this.keyboardShortcutHandler(i)};un=new WeakSet;al=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!jc.includes(a)){this.removeEventListener("keyup",Wt(this,Fi,Ha));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(L(this,Ht).contains(`no${a.toLowerCase()}`)||a===" "&&L(this,Ht).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",Wt(this,Fi,Ha),{once:!0})};var Zv=Object.values(s),Qv=Object.values(Bo),em=i=>{var e,t,a,r;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)!=null&&e.includes("-"))&&(l.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let o=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,y.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||o)?(n||o).filter(d=>Zv.includes(d)):[]},zv=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&l.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof l.customElements.get(i.nodeName.toLowerCase()))&&l.customElements.upgrade(i),Qv.some(a=>a in i)},rl=i=>zv(i)||!!em(i).length,zc=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},Xc={[s.MEDIA_SUBTITLES_LIST]:He,[s.MEDIA_SUBTITLES_SHOWING]:He,[s.MEDIA_SEEKABLE]:zc,[s.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(zc).join(" "),[s.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[s.MEDIA_RENDITION_LIST]:Ac,[s.MEDIA_AUDIO_TRACK_LIST]:yc},Xv=async(i,e,t)=>{var a,r;if(i.isConnected||await Vr(0),typeof t=="boolean"||t==null)return U(i,e,t);if(typeof t=="number")return N(i,e,t);if(typeof t=="string")return k(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(r=(a=Xc[e])==null?void 0:a.call(Xc,t))!=null?r:t;return i.setAttribute(e,n)},Jv=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},ui=(i,e)=>{if(Jv(i))return;let t=(r,n)=>{var o,d;rl(r)&&n(r);let{children:u=[]}=r!=null?r:{},c=(d=(o=r==null?void 0:r.shadowRoot)==null?void 0:o.children)!=null?d:[];[...u,...c].forEach(E=>ui(E,n))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!rl(i)){l.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},Jc=(i,e,t)=>{i.forEach(a=>{if(e in a){a[e]=t;return}let r=em(a),n=e.toLowerCase();r.includes(n)&&Xv(a,n,t)})},jv=(i,e,t)=>{ui(i,e);let a=f=>{var E;let v=(E=f==null?void 0:f.composedPath()[0])!=null?E:f.target;e(v)},r=f=>{var E;let v=(E=f==null?void 0:f.composedPath()[0])!=null?E:f.target;t(v)};i.addEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=f=>{f.forEach(E=>{let{addedNodes:v=[],removedNodes:b=[],type:w,target:_,attributeName:T}=E;w==="childList"?(Array.prototype.forEach.call(v,R=>ui(R,e)),Array.prototype.forEach.call(b,R=>ui(R,t))):w==="attributes"&&T===y.MEDIA_CHROME_ATTRIBUTES&&(rl(_)?e(_):t(_))})},o=[],d=f=>{let E=f.target;E.name!=="media"&&(o.forEach(v=>ui(v,t)),o=[...E.assignedElements({flatten:!0})],o.forEach(v=>ui(v,e)))};i.addEventListener("slotchange",d);let u=new MutationObserver(n);return u.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{ui(i,t),i.removeEventListener("slotchange",d),u.disconnect(),i.removeEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};l.customElements.get("media-controller")||l.customElements.define("media-controller",cn);var sl=cn;var ef=Object.defineProperty,tf=(i,e,t)=>e in i?ef(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,af=(i,e,t)=>(tf(i,typeof e!="symbol"?e+"":e,t),t),tm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},we=(i,e,t)=>(tm(i,e,"read from private field"),t?t.call(i):e.get(i)),mn=(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)},hn=(i,e,t,a)=>(tm(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),je,pn,Vi,vn,im=m.createElement("template");im.innerHTML=`
|
|
146
|
+
<style>
|
|
147
|
+
:host {
|
|
148
|
+
font: var(--media-font,
|
|
149
|
+
var(--media-font-weight, bold)
|
|
150
|
+
var(--media-font-size, 14px) /
|
|
151
|
+
var(--media-text-content-height, var(--media-control-height, 24px))
|
|
152
|
+
var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
|
|
153
|
+
color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
|
|
154
|
+
background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));
|
|
155
|
+
padding: var(--media-button-padding, var(--media-control-padding, 10px));
|
|
156
|
+
justify-content: var(--media-button-justify-content, center);
|
|
157
|
+
display: inline-flex;
|
|
158
|
+
align-items: center;
|
|
159
|
+
vertical-align: middle;
|
|
160
|
+
box-sizing: border-box;
|
|
161
|
+
transition: background .15s linear;
|
|
162
|
+
pointer-events: auto;
|
|
163
|
+
cursor: pointer;
|
|
164
|
+
-webkit-tap-highlight-color: transparent;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
:host(:focus-visible) {
|
|
169
|
+
box-shadow: inset 0 0 0 2px rgb(27 127 204 / .9);
|
|
170
|
+
outline: 0;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
:host(:where(:focus)) {
|
|
174
|
+
box-shadow: none;
|
|
175
|
+
outline: 0;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
:host(:hover) {
|
|
179
|
+
background: var(--media-control-hover-background, rgba(50 50 70 / .7));
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
svg, img, ::slotted(svg), ::slotted(img) {
|
|
183
|
+
width: var(--media-button-icon-width);
|
|
184
|
+
height: var(--media-button-icon-height, var(--media-control-height, 24px));
|
|
185
|
+
transform: var(--media-button-icon-transform);
|
|
186
|
+
transition: var(--media-button-icon-transition);
|
|
187
|
+
fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));
|
|
188
|
+
vertical-align: middle;
|
|
189
|
+
max-width: 100%;
|
|
190
|
+
max-height: 100%;
|
|
191
|
+
min-width: 100%;
|
|
192
|
+
}
|
|
193
|
+
</style>
|
|
194
|
+
`;var O=class extends l.HTMLElement{constructor(e={}){if(super(),mn(this,je,void 0),af(this,"preventClick",!1),mn(this,pn,t=>{this.preventClick||this.handleClick(t)}),mn(this,Vi,t=>{let{key:a}=t;if(!this.keysUsed.includes(a)){this.removeEventListener("keyup",we(this,Vi));return}this.preventClick||this.handleClick(t)}),mn(this,vn,t=>{let{metaKey:a,altKey:r,key:n}=t;if(a||r||!this.keysUsed.includes(n)){this.removeEventListener("keyup",we(this,Vi));return}this.addEventListener("keyup",we(this,Vi),{once:!0})}),!this.shadowRoot){this.attachShadow({mode:"open"});let t=im.content.cloneNode(!0);this.nativeEl=t;let a=e.slotTemplate;a||(a=m.createElement("template"),a.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(a.content.cloneNode(!0)),this.shadowRoot.appendChild(t)}}static get observedAttributes(){return["disabled",y.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",we(this,pn)),this.addEventListener("keydown",we(this,vn)),this.tabIndex=0}disable(){this.removeEventListener("click",we(this,pn)),this.removeEventListener("keydown",we(this,vn)),this.removeEventListener("keyup",we(this,Vi)),this.tabIndex=-1}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===y.MEDIA_CONTROLLER?(t&&((n=(r=we(this,je))==null?void 0:r.unassociateElement)==null||n.call(r,this),hn(this,je,null)),a&&this.isConnected&&(hn(this,je,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=we(this,je))==null?void 0:d.associateElement)==null||u.call(d,this))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;let{style:r}=P(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","button");let n=this.getAttribute(y.MEDIA_CONTROLLER);n&&(hn(this,je,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=we(this,je))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=we(this,je))==null?void 0:e.unassociateElement)==null||t.call(e,this),hn(this,je,null)}get keysUsed(){return["Enter"," "]}handleClick(e){}};je=new WeakMap;pn=new WeakMap;Vi=new WeakMap;vn=new WeakMap;l.customElements.get("media-chrome-button")||l.customElements.define("media-chrome-button",O);var am=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
195
|
+
<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"/>
|
|
196
|
+
</svg>
|
|
197
|
+
`,nm=m.createElement("template");nm.innerHTML=`
|
|
198
|
+
<style>
|
|
199
|
+
:host([${s.MEDIA_IS_AIRPLAYING}]) slot:not([name=exit]):not([name=icon]) {
|
|
200
|
+
display: none !important;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
:host(:not([${s.MEDIA_IS_AIRPLAYING}])) slot:not([name=enter]):not([name=icon]) {
|
|
205
|
+
display: none !important;
|
|
206
|
+
}
|
|
207
|
+
</style>
|
|
208
|
+
|
|
209
|
+
<slot name="icon">
|
|
210
|
+
<slot name="enter">${am}</slot>
|
|
211
|
+
<slot name="exit">${am}</slot>
|
|
212
|
+
</slot>
|
|
213
|
+
`;var rm=i=>{let e=i.mediaIsAirplaying?Y.EXIT_AIRPLAY():Y.ENTER_AIRPLAY();i.setAttribute("aria-label",e)},ol=class extends O{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_AIRPLAYING,s.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:nm,...e})}connectedCallback(){super.connectedCallback(),rm(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_IS_AIRPLAYING&&rm(this)}get mediaIsAirplaying(){return H(this,s.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){U(this,s.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return I(this,s.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){k(this,s.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new l.CustomEvent(h.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};l.customElements.get("media-airplay-button")||l.customElements.define("media-airplay-button",ol);function sm({anchor:i,floating:e,placement:t}){let a=rf({anchor:i,floating:e}),{x:r,y:n}=sf(a,t);return{x:r,y:n}}function rf({anchor:i,floating:e}){return{anchor:nf(i,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function nf(i,e){let t=i.getBoundingClientRect(),a=e.getBoundingClientRect();return{x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}function sf({anchor:i,floating:e},t){let a=of(t)==="x"?"y":"x",r=a==="y"?"height":"width",n=om(t),o=i.x+i.width/2-e.width/2,d=i.y+i.height/2-e.height/2,u=i[r]/2-e[r]/2,c;switch(n){case"top":c={x:o,y:i.y-e.height};break;case"bottom":c={x:o,y:i.y+i.height};break;case"right":c={x:i.x+i.width,y:d};break;case"left":c={x:i.x-e.width,y:d};break;default:c={x:i.x,y:i.y}}switch(t.split("-")[1]){case"start":c[a]-=u;break;case"end":c[a]+=u;break}return c}function om(i){return i.split("-")[0]}function of(i){return["top","bottom"].includes(om(i))?"y":"x"}var lf=Object.defineProperty,df=(i,e,t)=>e in i?lf(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,fn=(i,e,t)=>(df(i,typeof e!="symbol"?e+"":e,t),t),$t=class extends Event{constructor({action:e="auto",relatedTarget:t,...a}){super("invoke",a),fn(this,"action"),fn(this,"relatedTarget"),this.action=e,this.relatedTarget=t}},bn=class extends Event{constructor({newState:e,oldState:t,...a}){super("toggle",a),fn(this,"newState"),fn(this,"oldState"),this.newState=e,this.oldState=t}};var uf=Object.defineProperty,cf=(i,e,t)=>e in i?uf(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,mf=(i,e,t)=>(cf(i,typeof e!="symbol"?e+"":e,t),t),gl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},W=(i,e,t)=>(gl(i,e,"read from private field"),t?t.call(i):e.get(i)),$=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},It=(i,e,t,a)=>(gl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),V=(i,e,t)=>(gl(i,e,"access private method"),t),et,mi,Ft,lm,dm,En,gn,hi,ll,um,yn,_n,dl,ul,cm,cl,mm,ml,hm,Ki,Yi,pi,Gi,Tn,_l,hl,pm,Al,vm,pl,fm,yl,bm,vl,Em,fl,gm,$a,kn,bl,_m,Fa,Sn,An,El;function tt({type:i,text:e,value:t,checked:a}){let r=m.createElement("media-chrome-menu-item");r.type=i!=null?i:"",r.part.add("menu-item"),i&&r.part.add(i),r.value=t,r.checked=a;let n=m.createElement("span");return n.textContent=e,r.append(n),r}function $e(i,e){let t=i.querySelector(`:scope > [slot="${e}"]`);if((t==null?void 0:t.nodeName)=="SLOT"&&(t=t.assignedElements({flatten:!0})[0]),t)return t=t.cloneNode(!0),t;let a=i.shadowRoot.querySelector(`[name="${e}"] > svg`);return a?a.cloneNode(!0):""}var Am=m.createElement("template");Am.innerHTML=`
|
|
214
|
+
<style>
|
|
215
|
+
:host {
|
|
216
|
+
font: var(--media-font,
|
|
217
|
+
var(--media-font-weight, normal)
|
|
218
|
+
var(--media-font-size, 14px) /
|
|
219
|
+
var(--media-text-content-height, var(--media-control-height, 24px))
|
|
220
|
+
var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
|
|
221
|
+
color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
|
|
222
|
+
background: var(--media-menu-background, var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .8))));
|
|
223
|
+
border-radius: var(--media-menu-border-radius);
|
|
224
|
+
border: var(--media-menu-border, none);
|
|
225
|
+
display: var(--media-menu-display, inline-flex);
|
|
226
|
+
transition: var(--media-menu-transition-in,
|
|
227
|
+
visibility 0s,
|
|
228
|
+
opacity .2s ease-out,
|
|
229
|
+
transform .15s ease-out,
|
|
230
|
+
left .2s ease-in-out,
|
|
231
|
+
min-width .2s ease-in-out,
|
|
232
|
+
min-height .2s ease-in-out
|
|
233
|
+
) !important;
|
|
234
|
+
|
|
235
|
+
visibility: var(--media-menu-visibility, visible);
|
|
236
|
+
opacity: var(--media-menu-opacity, 1);
|
|
237
|
+
max-height: var(--media-menu-max-height, var(--_menu-max-height, 300px));
|
|
238
|
+
transform: var(--media-menu-transform-in, translateY(0) scale(1));
|
|
239
|
+
flex-direction: column;
|
|
240
|
+
|
|
241
|
+
min-height: 0;
|
|
242
|
+
position: relative;
|
|
243
|
+
box-sizing: border-box;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
:host([hidden]) {
|
|
247
|
+
transition: var(--media-menu-transition-out,
|
|
248
|
+
visibility .15s ease-in,
|
|
249
|
+
opacity .15s ease-in,
|
|
250
|
+
transform .15s ease-in
|
|
251
|
+
) !important;
|
|
252
|
+
visibility: var(--media-menu-hidden-visibility, hidden);
|
|
253
|
+
opacity: var(--media-menu-hidden-opacity, 0);
|
|
254
|
+
max-height: var(--media-menu-hidden-max-height,
|
|
255
|
+
var(--media-menu-max-height, var(--_menu-max-height, 300px)));
|
|
256
|
+
transform: var(--media-menu-transform-out, translateY(2px) scale(.99));
|
|
257
|
+
pointer-events: none;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
:host([slot="submenu"]) {
|
|
261
|
+
background: none;
|
|
262
|
+
width: 100%;
|
|
263
|
+
min-height: 100%;
|
|
264
|
+
position: absolute;
|
|
265
|
+
bottom: 0;
|
|
266
|
+
right: -100%;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
#container {
|
|
270
|
+
display: flex;
|
|
271
|
+
flex-direction: column;
|
|
272
|
+
min-height: 0;
|
|
273
|
+
transition: transform .2s ease-out;
|
|
274
|
+
transform: translate(0, 0);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
#container.has-expanded {
|
|
278
|
+
transition: transform .2s ease-in;
|
|
279
|
+
transform: translate(-100%, 0);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
slot[name="header"] {
|
|
283
|
+
display: flex;
|
|
284
|
+
padding: .4em .7em;
|
|
285
|
+
border-bottom: 1px solid rgb(255 255 255 / .25);
|
|
286
|
+
cursor: default;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
slot[name="header"][hidden] {
|
|
290
|
+
display: none;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
button[part~="back"] {
|
|
294
|
+
background: none;
|
|
295
|
+
color: inherit;
|
|
296
|
+
border: none;
|
|
297
|
+
padding: 0;
|
|
298
|
+
font: inherit;
|
|
299
|
+
cursor: pointer;
|
|
300
|
+
outline: inherit;
|
|
301
|
+
display: inline-flex;
|
|
302
|
+
align-items: center;
|
|
303
|
+
cursor: pointer;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
svg[part~="back"] {
|
|
307
|
+
height: var(--media-menu-icon-height, var(--media-control-height, 24px));
|
|
308
|
+
fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));
|
|
309
|
+
display: block;
|
|
310
|
+
margin-right: .5ch;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
slot:not([name]) {
|
|
314
|
+
gap: var(--media-menu-gap);
|
|
315
|
+
flex-direction: var(--media-menu-flex-direction, column);
|
|
316
|
+
overflow: var(--media-menu-overflow, hidden auto);
|
|
317
|
+
display: flex;
|
|
318
|
+
min-height: 0;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
:host([role="menu"]) slot:not([name]) {
|
|
322
|
+
padding-block: .4em;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
slot:not([name])::slotted([role="menu"]) {
|
|
326
|
+
background: none;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
media-chrome-menu-item > span {
|
|
330
|
+
margin-right: .5ch;
|
|
331
|
+
max-width: var(--media-menu-item-max-width);
|
|
332
|
+
text-overflow: ellipsis;
|
|
333
|
+
overflow: hidden;
|
|
334
|
+
}
|
|
335
|
+
</style>
|
|
336
|
+
<style id="layout-row" media="width:0">
|
|
337
|
+
|
|
338
|
+
slot[name="header"] {
|
|
339
|
+
padding: .4em .5em;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
slot:not([name]) {
|
|
343
|
+
gap: var(--media-menu-gap, .25em);
|
|
344
|
+
flex-direction: var(--media-menu-flex-direction, row);
|
|
345
|
+
padding-inline: .5em;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
media-chrome-menu-item {
|
|
349
|
+
padding: .3em .5em;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
media-chrome-menu-item[aria-checked="true"] {
|
|
353
|
+
background: var(--media-menu-item-checked-background, rgb(255 255 255 / .2));
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
media-chrome-menu-item::part(checked-indicator) {
|
|
358
|
+
display: var(--media-menu-item-checked-indicator-display, none);
|
|
359
|
+
}
|
|
360
|
+
</style>
|
|
361
|
+
<div id="container">
|
|
362
|
+
<slot name="header" hidden>
|
|
363
|
+
<button part="back button" aria-label="Back to previous menu">
|
|
364
|
+
<slot name="back-icon">
|
|
365
|
+
<svg aria-hidden="true" viewBox="0 0 20 24" part="back indicator">
|
|
366
|
+
<path d="m11.88 17.585.742-.669-4.2-4.665 4.2-4.666-.743-.669-4.803 5.335 4.803 5.334Z"/>
|
|
367
|
+
</svg>
|
|
368
|
+
</slot>
|
|
369
|
+
<slot name="title"></slot>
|
|
370
|
+
</button>
|
|
371
|
+
</slot>
|
|
372
|
+
<slot></slot>
|
|
373
|
+
</div>
|
|
374
|
+
<slot name="checked-indicator" hidden></slot>
|
|
375
|
+
`;var ci={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},ce=class extends l.HTMLElement{constructor(){super(),$(this,ll),$(this,_n),$(this,ul),$(this,cl),$(this,ml),$(this,pi),$(this,Tn),$(this,hl),$(this,Al),$(this,pl),$(this,yl),$(this,vl),$(this,fl),$(this,$a),$(this,bl),$(this,Fa),$(this,An),$(this,et,void 0),$(this,mi,void 0),$(this,Ft,void 0),$(this,lm,""),$(this,dm,null),$(this,En,new Set),$(this,gn,void 0),$(this,hi,!1),$(this,yn,()=>{let e=W(this,En),t=new Set(this.items);for(let a of e)t.has(a)||this.dispatchEvent(new CustomEvent("removemenuitem",{detail:a}));for(let a of t)e.has(a)||this.dispatchEvent(new CustomEvent("addmenuitem",{detail:a}));It(this,En,t)}),$(this,Ki,()=>{V(this,pi,Gi).call(this,!1),V(this,Tn,_l).call(this,!1)}),$(this,Yi,()=>{V(this,pi,Gi).call(this,!1)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.nativeEl=this.constructor.template.content.cloneNode(!0),this.shadowRoot.append(this.nativeEl)),this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),It(this,gn,new MutationObserver(W(this,yn))),W(this,gn).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[ci.DISABLED,ci.HIDDEN,ci.STYLE,ci.ANCHOR,y.MEDIA_CONTROLLER]}static formatMenuItemText(e){return e}enable(){this.addEventListener("click",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this),this.addEventListener("invoke",this),this.addEventListener("toggle",this)}disable(){this.removeEventListener("click",this),this.removeEventListener("focusout",this),this.removeEventListener("keyup",this),this.removeEventListener("invoke",this),this.removeEventListener("toggle",this)}handleEvent(e){switch(e.type){case"slotchange":V(this,ll,um).call(this,e);break;case"invoke":V(this,ul,cm).call(this,e);break;case"click":V(this,hl,pm).call(this,e);break;case"toggle":V(this,pl,fm).call(this,e);break;case"focusout":V(this,vl,Em).call(this,e);break;case"keydown":V(this,fl,gm).call(this,e);break}}connectedCallback(){var e,t;V(this,_n,dl).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),It(this,et,qr(this)),(t=(e=W(this,et))==null?void 0:e.associateElement)==null||t.call(e,this),this.hidden||(Le(Va(this),W(this,Ki)),Le(this,W(this,Yi)))}disconnectedCallback(){var e,t;Xe(Va(this),W(this,Ki)),Xe(this,W(this,Yi)),this.disable(),(t=(e=W(this,et))==null?void 0:e.unassociateElement)==null||t.call(e,this),It(this,et,null)}attributeChangedCallback(e,t,a){var r,n,o,d;e===ci.HIDDEN&&a!==t?(W(this,hi)||It(this,hi,!0),this.hidden?V(this,ml,hm).call(this):V(this,cl,mm).call(this),this.dispatchEvent(new bn({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===y.MEDIA_CONTROLLER?(t&&((n=(r=W(this,et))==null?void 0:r.unassociateElement)==null||n.call(r,this),It(this,et,null)),a&&this.isConnected&&(It(this,et,qr(this)),(d=(o=W(this,et))==null?void 0:o.associateElement)==null||d.call(o,this))):e===ci.DISABLED&&a!==t?a==null?this.enable():this.disable():e===ci.STYLE&&a!==t&&V(this,_n,dl).call(this)}formatMenuItemText(e,t){return this.constructor.formatMenuItemText(e,t)}get anchor(){return this.getAttribute("anchor")}set anchor(e){this.setAttribute("anchor",`${e}`)}get anchorElement(){var e;return this.anchor?(e=ri(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(hf)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,t;return(t=(e=this.checkedItems[0])==null?void 0:e.value)!=null?t:""}set value(e){let t=this.items.find(a=>a.value===e);t&&V(this,An,El).call(this,t)}focus(){if(It(this,mi,ai()),this.items.length){V(this,Fa,Sn).call(this,this.items[0]),this.items[0].focus();return}let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}handleSelect(e){var t;let a=V(this,$a,kn).call(this,e);a&&(V(this,An,El).call(this,a,a.type==="checkbox"),W(this,Ft)&&!this.hidden&&((t=W(this,mi))==null||t.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var t,a;let{key:r}=e,n=this.items,o=(a=(t=V(this,$a,kn).call(this,e))!=null?t:V(this,bl,_m).call(this))!=null?a:n[0],d=n.indexOf(o),u=Math.max(0,d);r==="ArrowDown"?u++:r==="ArrowUp"?u--:e.key==="Home"?u=0:e.key==="End"&&(u=n.length-1),u<0&&(u=n.length-1),u>n.length-1&&(u=0),V(this,Fa,Sn).call(this,n[u]),n[u].focus()}};et=new WeakMap;mi=new WeakMap;Ft=new WeakMap;lm=new WeakMap;dm=new WeakMap;En=new WeakMap;gn=new WeakMap;hi=new WeakMap;ll=new WeakSet;um=function(i){let e=i.target;for(let t of e.assignedNodes({flatten:!0}))t.nodeType===3&&t.textContent.trim()===""&&t.remove();if(["header","title"].includes(e.name)){let t=this.shadowRoot.querySelector('slot[name="header"]');t.hidden=e.assignedNodes().length===0}e.name||W(this,yn).call(this)};yn=new WeakMap;_n=new WeakSet;dl=function(){var i;let e=this.shadowRoot.querySelector("#layout-row"),t=(i=getComputedStyle(this).getPropertyValue("--media-menu-layout"))==null?void 0:i.trim();e.setAttribute("media",t==="row"?"":"width:0")};ul=new WeakSet;cm=function(i){It(this,Ft,i.relatedTarget),ue(this,i.relatedTarget)||(this.hidden=!this.hidden)};cl=new WeakSet;mm=function(){var i;(i=W(this,Ft))==null||i.setAttribute("aria-expanded","true"),requestAnimationFrame(()=>V(this,pi,Gi).call(this,!1)),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),Le(Va(this),W(this,Ki)),Le(this,W(this,Yi))};ml=new WeakSet;hm=function(){var i;(i=W(this,Ft))==null||i.setAttribute("aria-expanded","false"),Xe(Va(this),W(this,Ki)),Xe(this,W(this,Yi))};Ki=new WeakMap;Yi=new WeakMap;pi=new WeakSet;Gi=function(i,e){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:t,y:a}=sm({anchor:this.anchorElement,floating:this,placement:"top-start"});e!=null||(e=this.offsetWidth);let n=Va(this).getBoundingClientRect(),o=this.anchorElement.getBoundingClientRect(),d=n.width-t-e,u=n.height-a-this.offsetHeight,c=n.height-o.height,{style:f}=P(this.shadowRoot,":host");i||f.setProperty("--media-menu-transition-in","none"),f.setProperty("position","absolute"),f.setProperty("right",`${Math.max(0,d)}px`),f.setProperty("bottom",`${u}px`),f.setProperty("--_menu-max-height",`${c}px`),f.removeProperty("--media-menu-transition-in")};Tn=new WeakSet;_l=function(i){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),t=e==null?void 0:e.querySelector('[role="menu"]'),{style:a}=P(this.shadowRoot,":host");if(i||a.setProperty("--media-menu-transition-in","none"),t){let r=t.offsetHeight,n=Math.max(t.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${n}px`),this.style.setProperty("min-height",`${r}px`),V(this,pi,Gi).call(this,i,n)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),V(this,pi,Gi).call(this,i);a.removeProperty("--media-menu-transition-in")};hl=new WeakSet;pm=function(i){var e;if(i.stopPropagation(),i.composedPath().includes(W(this,Al,vm))){(e=W(this,mi))==null||e.focus(),this.hidden=!0;return}let t=V(this,$a,kn).call(this,i);!t||t.hasAttribute("disabled")||(V(this,Fa,Sn).call(this,t),this.handleSelect(i))};Al=new WeakSet;vm=function(){var i;return(i=this.shadowRoot.querySelector('slot[name="header"]').assignedElements({flatten:!0}))==null?void 0:i.find(t=>t.part.contains("back")&&t.part.contains("button"))};pl=new WeakSet;fm=function(i){if(i.target===this)return;V(this,yl,bm).call(this);let e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]'));for(let t of e)t.invokeTargetElement!=i.target&&i.newState=="open"&&t.getAttribute("aria-expanded")=="true"&&!t.invokeTargetElement.hidden&&t.invokeTargetElement.dispatchEvent(new $t({relatedTarget:t}));for(let t of e)t.setAttribute("aria-expanded",`${!t.submenuElement.hidden}`);V(this,Tn,_l).call(this,!0)};yl=new WeakSet;bm=function(){let i='[role="menuitem"] > [role="menu"]:not([hidden])',e=this.querySelector(i);this.container.classList.toggle("has-expanded",!!e)};vl=new WeakSet;Em=function(i){var e;ue(this,i.relatedTarget)||(W(this,hi)&&((e=W(this,mi))==null||e.focus()),W(this,Ft)&&W(this,Ft)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};fl=new WeakSet;gm=function(i){var e,t,a,r,n;let{key:o,ctrlKey:d,altKey:u,metaKey:c}=i;if(!(d||u||c)&&this.keysUsed.includes(o))if(i.preventDefault(),i.stopPropagation(),o==="Tab"){if(W(this,hi)){this.hidden=!0;return}i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()}else o==="Escape"?((n=W(this,mi))==null||n.focus(),W(this,hi)&&(this.hidden=!0)):o==="Enter"||o===" "?this.handleSelect(i):this.handleMove(i)};$a=new WeakSet;kn=function(i){return i.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};bl=new WeakSet;_m=function(){return this.items.find(i=>i.tabIndex===0)};Fa=new WeakSet;Sn=function(i){for(let e of this.items)e.tabIndex=e===i?0:-1};An=new WeakSet;El=function(i,e){let t=[...this.checkedItems];i.type==="radio"&&this.radioGroupItems.forEach(a=>a.checked=!1),e?i.checked=!i.checked:i.checked=!0,this.checkedItems.some((a,r)=>a!=t[r])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};mf(ce,"template",Am);function hf(i){return["menuitem","menuitemradio","menuitemcheckbox"].includes(i==null?void 0:i.role)}function Va(i){var e;return(e=i.getAttribute("bounds")?Be(i,`#${i.getAttribute("bounds")}`):X(i)||i.parentElement)!=null?e:i}l.customElements.get("media-chrome-menu")||l.customElements.define("media-chrome-menu",ce);var Cl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ym=(i,e,t)=>(Cl(i,e,"read from private field"),t?t.call(i):e.get(i)),In=(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)},Tl=(i,e,t,a)=>(Cl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Cn=(i,e,t)=>(Cl(i,e,"access private method"),t),Ka,wn,Ln,kl,Mn,Sl,Il=class extends ce{constructor(){super(...arguments),In(this,Ln),In(this,Mn),In(this,Ka,[]),In(this,wn,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_LIST,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_AUDIO_TRACK_ENABLED&&t!==a?this.value=a:e===s.MEDIA_AUDIO_TRACK_LIST&&t!==a&&(Tl(this,Ka,$r(a)),Cn(this,Ln,kl).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Cn(this,Mn,Sl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Cn(this,Mn,Sl))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return ym(this,Ka)}set mediaAudioTrackList(e){Tl(this,Ka,e),Cn(this,Ln,kl).call(this)}get mediaAudioTrackEnabled(){return I(this,s.MEDIA_AUDIO_TRACK_ENABLED)}set mediaAudioTrackEnabled(e){k(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};Ka=new WeakMap;wn=new WeakMap;Ln=new WeakSet;kl=function(){if(ym(this,wn)===JSON.stringify(this.mediaAudioTrackList))return;Tl(this,wn,JSON.stringify(this.mediaAudioTrackList));let i=this.mediaAudioTrackList;this.defaultSlot.textContent="";for(let e of i){let t=this.formatMenuItemText(e.label,e),a=tt({type:"radio",text:t,value:`${e.id}`,checked:e.enabled});a.prepend($e(this,"checked-indicator")),this.defaultSlot.append(a)}};Mn=new WeakSet;Sl=function(){if(this.value==null)return;let i=new l.CustomEvent(h.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-audio-track-menu")||l.customElements.define("media-audio-track-menu",Il);var ke=class extends O{connectedCallback(){super.connectedCallback(),this.invokeTargetElement&&this.setAttribute("aria-haspopup","menu")}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=ri(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){this.invokeTargetElement.dispatchEvent(new $t({relatedTarget:this}))}};l.customElements.get("media-chrome-menu-button")||l.customElements.define("media-chrome-menu-button",ke);var pf=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
376
|
+
<path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
|
|
377
|
+
<path d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-2 0a8 8 0 1 0-16 0 8 8 0 0 0 16 0Z"/>
|
|
378
|
+
</svg>`,Tm=m.createElement("template");Tm.innerHTML=`
|
|
379
|
+
<slot name="icon">${pf}</slot>
|
|
380
|
+
`;var Ll=class extends ke{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}constructor(){super({slotTemplate:Tm})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",K.AUDIO_TRACKS())}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){return I(this,s.MEDIA_AUDIO_TRACK_ENABLED)}set mediaAudioTrackEnabled(e){k(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};l.customElements.get("media-audio-track-menu-button")||l.customElements.define("media-audio-track-menu-button",Ll);var vf=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
381
|
+
<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"/>
|
|
382
|
+
</svg>`,ff=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
383
|
+
<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"/>
|
|
384
|
+
</svg>`,Cm=m.createElement("template");Cm.innerHTML=`
|
|
385
|
+
<style>
|
|
386
|
+
:host([aria-checked="true"]) slot[name=off] {
|
|
387
|
+
display: none !important;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
:host(:not([aria-checked="true"])) slot[name=on] {
|
|
392
|
+
display: none !important;
|
|
393
|
+
}
|
|
394
|
+
</style>
|
|
395
|
+
|
|
396
|
+
<slot name="icon">
|
|
397
|
+
<slot name="on">${vf}</slot>
|
|
398
|
+
<slot name="off">${ff}</slot>
|
|
399
|
+
</slot>
|
|
400
|
+
`;var km=i=>{i.setAttribute("aria-checked",an(i))},Ml=class extends O{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:Cm,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",K.CLOSED_CAPTIONS()),km(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_SUBTITLES_SHOWING&&km(this)}get mediaSubtitlesList(){return Sm(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Im(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Sm(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Im(this,s.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new l.CustomEvent(h.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}},Sm=(i,e)=>{let t=i.getAttribute(e);return t?kt(t):[]},Im=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=He(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};l.customElements.get("media-captions-button")||l.customElements.define("media-captions-button",Ml);var bf=Object.defineProperty,Ef=(i,e,t)=>e in i?bf(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,gf=(i,e,t)=>(Ef(i,typeof e!="symbol"?e+"":e,t),t),Ol=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_f=(i,e,t)=>(Ol(i,e,"read from private field"),t?t.call(i):e.get(i)),wl=(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)},Af=(i,e,t,a)=>(Ol(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),xl=(i,e,t)=>(Ol(i,e,"access private method"),t),Rn,Rl,wm,xn,Dl,yf=`
|
|
401
|
+
<svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
|
|
402
|
+
<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"/>
|
|
403
|
+
</svg>`,xm=m.createElement("template");xm.innerHTML=ce.template.innerHTML+`
|
|
404
|
+
<slot name="captions-indicator" hidden>${yf}</slot>`;var Dn=class extends ce{constructor(){super(...arguments),wl(this,Rl),wl(this,xn),wl(this,Rn,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_SUBTITLES_LIST&&t!==a?xl(this,Rl,wm).call(this):e===s.MEDIA_SUBTITLES_SHOWING&&t!==a&&(this.value=a)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",xl(this,xn,Dl))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",xl(this,xn,Dl))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return Lm(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Mm(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Lm(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Mm(this,s.MEDIA_SUBTITLES_SHOWING,e)}};Rn=new WeakMap;Rl=new WeakSet;wm=function(){var i;if(_f(this,Rn)===JSON.stringify(this.mediaSubtitlesList))return;Af(this,Rn,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let e=!this.value,t=tt({type:"radio",text:this.formatMenuItemText("Off"),value:"off",checked:e});t.prepend($e(this,"checked-indicator")),this.defaultSlot.append(t);let a=this.mediaSubtitlesList;for(let r of a){let n=tt({type:"radio",text:this.formatMenuItemText(r.label,r),value:oi(r),checked:this.value==oi(r)});n.prepend($e(this,"checked-indicator")),((i=r.kind)!=null?i:"subs")==="captions"&&n.append($e(this,"captions-indicator")),this.defaultSlot.append(n)}};xn=new WeakSet;Dl=function(){let i=this.mediaSubtitlesShowing,e=this.getAttribute(s.MEDIA_SUBTITLES_SHOWING),t=this.value!==e;if(i!=null&&i.length&&t&&this.dispatchEvent(new l.CustomEvent(h.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let a=new l.CustomEvent(h.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(a)};gf(Dn,"template",xm);var Lm=(i,e)=>{let t=i.getAttribute(e);return t?kt(t):[]},Mm=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=He(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};l.customElements.get("media-captions-menu")||l.customElements.define("media-captions-menu",Dn);var Tf=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
405
|
+
<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"/>
|
|
406
|
+
</svg>`,kf=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
407
|
+
<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"/>
|
|
408
|
+
</svg>`,Pm=m.createElement("template");Pm.innerHTML=`
|
|
409
|
+
<style>
|
|
410
|
+
:host([aria-checked="true"]) slot[name=off] {
|
|
411
|
+
display: none !important;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
:host(:not([aria-checked="true"])) slot[name=on] {
|
|
416
|
+
display: none !important;
|
|
417
|
+
}
|
|
418
|
+
</style>
|
|
419
|
+
|
|
420
|
+
<slot name="icon">
|
|
421
|
+
<slot name="on">${Tf}</slot>
|
|
422
|
+
<slot name="off">${kf}</slot>
|
|
423
|
+
</slot>
|
|
424
|
+
`;var Rm=i=>{i.setAttribute("aria-checked",an(i))},Pl=class extends ke{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:Pm,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",K.CLOSED_CAPTIONS()),Rm(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_SUBTITLES_SHOWING&&Rm(this)}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-captions-menu")}get mediaSubtitlesList(){return Dm(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Om(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Dm(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Om(this,s.MEDIA_SUBTITLES_SHOWING,e)}},Dm=(i,e)=>{let t=i.getAttribute(e);return t?kt(t):[]},Om=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=He(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};l.customElements.get("media-captions-menu-button")||l.customElements.define("media-captions-menu-button",Pl);var Sf='<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>',If='<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>',Um=m.createElement("template");Um.innerHTML=`
|
|
425
|
+
<style>
|
|
426
|
+
:host([${s.MEDIA_IS_CASTING}]) slot:not([name=exit]):not([name=icon]) {
|
|
427
|
+
display: none !important;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
:host(:not([${s.MEDIA_IS_CASTING}])) slot:not([name=enter]):not([name=icon]) {
|
|
432
|
+
display: none !important;
|
|
433
|
+
}
|
|
434
|
+
</style>
|
|
435
|
+
|
|
436
|
+
<slot name="icon">
|
|
437
|
+
<slot name="enter">${Sf}</slot>
|
|
438
|
+
<slot name="exit">${If}</slot>
|
|
439
|
+
</slot>
|
|
440
|
+
`;var Nm=i=>{let e=i.mediaIsCasting?Y.EXIT_CAST():Y.ENTER_CAST();i.setAttribute("aria-label",e)},Nl=class extends O{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_CASTING,s.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Um,...e})}connectedCallback(){super.connectedCallback(),Nm(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_IS_CASTING&&Nm(this)}get mediaIsCasting(){return H(this,s.MEDIA_IS_CASTING)}set mediaIsCasting(e){U(this,s.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return I(this,s.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){k(this,s.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?h.MEDIA_EXIT_CAST_REQUEST:h.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-cast-button")||l.customElements.define("media-cast-button",Nl);var Cf=Object.defineProperty,Lf=(i,e,t)=>e in i?Cf(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Mf=(i,e,t)=>(Lf(i,typeof e!="symbol"?e+"":e,t),t),Vl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},qi=(i,e,t)=>(Vl(i,e,"read from private field"),t?t.call(i):e.get(i)),vi=(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)},Bm=(i,e,t,a)=>(Vl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ya=(i,e,t)=>(Vl(i,e,"access private method"),t),Ga,fi,Bl,Wm,Wl,Hm,Hl,$m,$l,Fm,Fl,Vm,Km=m.createElement("template");Km.innerHTML=`
|
|
441
|
+
<style>
|
|
442
|
+
:host {
|
|
443
|
+
font: var(--media-font,
|
|
444
|
+
var(--media-font-weight, normal)
|
|
445
|
+
var(--media-font-size, 14px) /
|
|
446
|
+
var(--media-text-content-height, var(--media-control-height, 24px))
|
|
447
|
+
var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
|
|
448
|
+
color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
|
|
449
|
+
background: var(--media-dialog-background, var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .8))));
|
|
450
|
+
border-radius: var(--media-dialog-border-radius);
|
|
451
|
+
border: var(--media-dialog-border, none);
|
|
452
|
+
display: var(--media-dialog-display, inline-flex);
|
|
453
|
+
transition: var(--media-dialog-transition-in,
|
|
454
|
+
visibility 0s,
|
|
455
|
+
opacity .2s ease-out,
|
|
456
|
+
transform .15s ease-out
|
|
457
|
+
) !important;
|
|
458
|
+
|
|
459
|
+
visibility: var(--media-dialog-visibility, visible);
|
|
460
|
+
opacity: var(--media-dialog-opacity, 1);
|
|
461
|
+
transform: var(--media-dialog-transform-in, translateY(0) scale(1));
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
:host([hidden]) {
|
|
465
|
+
transition: var(--media-dialog-transition-out,
|
|
466
|
+
visibility .15s ease-in,
|
|
467
|
+
opacity .15s ease-in,
|
|
468
|
+
transform .15s ease-in
|
|
469
|
+
) !important;
|
|
470
|
+
visibility: var(--media-dialog-hidden-visibility, hidden);
|
|
471
|
+
opacity: var(--media-dialog-hidden-opacity, 0);
|
|
472
|
+
transform: var(--media-dialog-transform-out, translateY(2px) scale(.99));
|
|
473
|
+
pointer-events: none;
|
|
474
|
+
}
|
|
475
|
+
</style>
|
|
476
|
+
<slot></slot>
|
|
477
|
+
`;var Ul={HIDDEN:"hidden",ANCHOR:"anchor"},On=class extends l.HTMLElement{constructor(){super(),vi(this,Bl),vi(this,Wl),vi(this,Hl),vi(this,$l),vi(this,Fl),vi(this,Ga,void 0),vi(this,fi,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.nativeEl=this.constructor.template.content.cloneNode(!0),this.shadowRoot.append(this.nativeEl)),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[Ul.HIDDEN,Ul.ANCHOR]}handleEvent(e){switch(e.type){case"invoke":Ya(this,Hl,$m).call(this,e);break;case"focusout":Ya(this,$l,Fm).call(this,e);break;case"keydown":Ya(this,Fl,Vm).call(this,e);break}}connectedCallback(){this.role||(this.role="dialog")}attributeChangedCallback(e,t,a){e===Ul.HIDDEN&&a!==t&&(this.hidden?Ya(this,Wl,Hm).call(this):Ya(this,Bl,Wm).call(this))}focus(){Bm(this,Ga,ai());let e=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');e==null||e.focus()}get keysUsed(){return["Escape","Tab"]}};Ga=new WeakMap;fi=new WeakMap;Bl=new WeakSet;Wm=function(){var i;(i=qi(this,fi))==null||i.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};Wl=new WeakSet;Hm=function(){var i;(i=qi(this,fi))==null||i.setAttribute("aria-expanded","false")};Hl=new WeakSet;$m=function(i){Bm(this,fi,i.relatedTarget),ue(this,i.relatedTarget)||(this.hidden=!this.hidden)};$l=new WeakSet;Fm=function(i){var e;ue(this,i.relatedTarget)||((e=qi(this,Ga))==null||e.focus(),qi(this,fi)&&qi(this,fi)!==i.relatedTarget&&!this.hidden&&(this.hidden=!0))};Fl=new WeakSet;Vm=function(i){var e,t,a,r,n;let{key:o,ctrlKey:d,altKey:u,metaKey:c}=i;d||u||c||this.keysUsed.includes(o)&&(i.preventDefault(),i.stopPropagation(),o==="Tab"?(i.shiftKey?(t=(e=this.previousElementSibling)==null?void 0:e.focus)==null||t.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()):o==="Escape"&&((n=qi(this,Ga))==null||n.focus(),this.hidden=!0))};Mf(On,"template",Km);l.customElements.get("media-chrome-dialog")||l.customElements.define("media-chrome-dialog",On);var wf=Object.defineProperty,xf=(i,e,t)=>e in i?wf(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Rf=(i,e,t)=>(xf(i,typeof e!="symbol"?e+"":e,t),t),Ql=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},at=(i,e,t)=>(Ql(i,e,"read from private field"),t?t.call(i):e.get(i)),Ct=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Kl=(i,e,t,a)=>(Ql(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),it=(i,e,t)=>(Ql(i,e,"access private method"),t),Pn,Za,Yl,Ym,zl,Gm,Xl,qm,rt,Zi,Qa,Gl,Zm,Nn,ql,Qm=m.createElement("template");Qm.innerHTML=`
|
|
478
|
+
<style>
|
|
479
|
+
:host {
|
|
480
|
+
transition: var(--media-menu-item-transition,
|
|
481
|
+
background .15s linear,
|
|
482
|
+
opacity .2s ease-in-out
|
|
483
|
+
);
|
|
484
|
+
outline: var(--media-menu-item-outline, 0);
|
|
485
|
+
outline-offset: var(--media-menu-item-outline-offset, -1px);
|
|
486
|
+
cursor: pointer;
|
|
487
|
+
display: flex;
|
|
488
|
+
align-items: center;
|
|
489
|
+
align-self: stretch;
|
|
490
|
+
justify-self: stretch;
|
|
491
|
+
white-space: nowrap;
|
|
492
|
+
white-space-collapse: collapse;
|
|
493
|
+
text-wrap: nowrap;
|
|
494
|
+
padding: .4em .8em .4em 1em;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
:host(:focus-visible) {
|
|
498
|
+
box-shadow: var(--media-menu-item-focus-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
|
|
499
|
+
outline: var(--media-menu-item-hover-outline, 0);
|
|
500
|
+
outline-offset: var(--media-menu-item-hover-outline-offset, var(--media-menu-item-outline-offset, -1px));
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
:host(:hover) {
|
|
504
|
+
cursor: pointer;
|
|
505
|
+
background: var(--media-menu-item-hover-background, rgb(92 92 102 / .5));
|
|
506
|
+
outline: var(--media-menu-item-hover-outline);
|
|
507
|
+
outline-offset: var(--media-menu-item-hover-outline-offset, var(--media-menu-item-outline-offset, -1px));
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
:host([aria-checked="true"]) {
|
|
511
|
+
background: var(--media-menu-item-checked-background);
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
:host([hidden]) {
|
|
515
|
+
display: none;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
:host([disabled]) {
|
|
519
|
+
pointer-events: none;
|
|
520
|
+
color: rgba(255, 255, 255, .3);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
slot:not([name]) {
|
|
524
|
+
width: 100%;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
slot:not([name="submenu"]) {
|
|
528
|
+
display: inline-flex;
|
|
529
|
+
align-items: center;
|
|
530
|
+
transition: inherit;
|
|
531
|
+
opacity: var(--media-menu-item-opacity, 1);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
slot[name="description"] {
|
|
535
|
+
justify-content: end;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
slot[name="description"] > span {
|
|
539
|
+
display: inline-block;
|
|
540
|
+
margin-inline: 1em .2em;
|
|
541
|
+
max-width: var(--media-menu-item-description-max-width, 100px);
|
|
542
|
+
text-overflow: ellipsis;
|
|
543
|
+
overflow: hidden;
|
|
544
|
+
font-size: .8em;
|
|
545
|
+
font-weight: 400;
|
|
546
|
+
text-align: right;
|
|
547
|
+
position: relative;
|
|
548
|
+
top: .04em;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
slot[name="checked-indicator"] {
|
|
552
|
+
display: none;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
:host(:is([role="menuitemradio"],[role="menuitemcheckbox"])) slot[name="checked-indicator"] {
|
|
556
|
+
display: var(--media-menu-item-checked-indicator-display, inline-block);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
svg, img, ::slotted(svg), ::slotted(img) {
|
|
561
|
+
height: var(--media-menu-item-icon-height, var(--media-control-height, 24px));
|
|
562
|
+
fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));
|
|
563
|
+
display: block;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
[part~="indicator"],
|
|
568
|
+
::slotted([part~="indicator"]) {
|
|
569
|
+
fill: var(--media-menu-item-indicator-fill,
|
|
570
|
+
var(--media-icon-color, var(--media-primary-color, rgb(238 238 238))));
|
|
571
|
+
height: var(--media-menu-item-indicator-height, 1.25em);
|
|
572
|
+
margin-right: .5ch;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
[part~="checked-indicator"] {
|
|
576
|
+
visibility: hidden;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
:host([aria-checked="true"]) [part~="checked-indicator"] {
|
|
580
|
+
visibility: visible;
|
|
581
|
+
}
|
|
582
|
+
</style>
|
|
583
|
+
<slot name="checked-indicator">
|
|
584
|
+
<svg aria-hidden="true" viewBox="0 1 24 24" part="checked-indicator indicator">
|
|
585
|
+
<path d="m10 15.17 9.193-9.191 1.414 1.414-10.606 10.606-6.364-6.364 1.414-1.414 4.95 4.95Z"/>
|
|
586
|
+
</svg>
|
|
587
|
+
</slot>
|
|
588
|
+
<slot name="prefix"></slot>
|
|
589
|
+
<slot></slot>
|
|
590
|
+
<slot name="description"></slot>
|
|
591
|
+
<slot name="suffix"></slot>
|
|
592
|
+
<slot name="submenu"></slot>
|
|
593
|
+
`;var xe={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},bi=class extends l.HTMLElement{constructor(){super(),Ct(this,Yl),Ct(this,zl),Ct(this,Xl),Ct(this,Zi),Ct(this,Gl),Ct(this,Nn),Ct(this,Pn,!1),Ct(this,Za,void 0),Ct(this,rt,()=>{var e,t;this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let a=this.shadowRoot.querySelector('slot[name="description"]'),r=(t=(e=this.submenuElement.checkedItems)==null?void 0:e[0])==null?void 0:t.text,n=m.createElement("span");n.textContent=r!=null?r:"",a.replaceChildren(n)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.append(this.constructor.template.content.cloneNode(!0))),this.shadowRoot.addEventListener("slotchange",this)}static get observedAttributes(){return[xe.TYPE,xe.DISABLED,xe.CHECKED,xe.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),qa(this)&&!this.hasAttribute("aria-checked")&&this.setAttribute("aria-checked","false"),this.addEventListener("click",this),this.addEventListener("keydown",this)}disable(){this.removeAttribute("tabindex"),this.removeEventListener("click",this),this.removeEventListener("keydown",this),this.removeEventListener("keyup",this)}handleEvent(e){switch(e.type){case"slotchange":it(this,Yl,Ym).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":it(this,Gl,Zm).call(this,e);break;case"keyup":it(this,Zi,Qa).call(this,e);break}}attributeChangedCallback(e,t,a){e===xe.CHECKED&&qa(this)&&!at(this,Pn)?this.setAttribute("aria-checked",a!=null?"true":"false"):e===xe.TYPE&&a!==t?this.role="menuitem"+a:e===xe.DISABLED&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(xe.DISABLED)||this.enable(),this.role="menuitem"+this.type,Kl(this,Za,Zl(this,this.parentNode)),it(this,Nn,ql).call(this)}disconnectedCallback(){this.disable(),it(this,Nn,ql).call(this),Kl(this,Za,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=ri(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):this.submenuElement}get submenuElement(){return this.shadowRoot.querySelector('slot[name="submenu"]').assignedElements({flatten:!0})[0]}get type(){var e;return(e=this.getAttribute(xe.TYPE))!=null?e:""}set type(e){this.setAttribute(xe.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(xe.VALUE))!=null?e:this.text}set value(e){this.setAttribute(xe.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(qa(this))return this.getAttribute("aria-checked")==="true"}set checked(e){qa(this)&&(Kl(this,Pn,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){qa(this)||this.invokeTargetElement&&ue(this,e.target)&&this.invokeTargetElement.dispatchEvent(new $t({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};Pn=new WeakMap;Za=new WeakMap;Yl=new WeakSet;Ym=function(i){let e=i.target;if(!(e!=null&&e.name))for(let a of e.assignedNodes({flatten:!0}))a instanceof Text&&a.textContent.trim()===""&&a.remove();e.name==="submenu"&&(this.submenuElement?it(this,zl,Gm).call(this):it(this,Xl,qm).call(this))};zl=new WeakSet;Gm=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",at(this,rt)),this.submenuElement.addEventListener("addmenuitem",at(this,rt)),this.submenuElement.addEventListener("removemenuitem",at(this,rt)),at(this,rt).call(this)};Xl=new WeakSet;qm=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",at(this,rt)),this.submenuElement.removeEventListener("addmenuitem",at(this,rt)),this.submenuElement.removeEventListener("removemenuitem",at(this,rt)),at(this,rt).call(this)};rt=new WeakMap;Zi=new WeakSet;Qa=function(i){let{key:e}=i;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",it(this,Zi,Qa));return}this.handleClick(i)};Gl=new WeakSet;Zm=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!this.keysUsed.includes(a)){this.removeEventListener("keyup",it(this,Zi,Qa));return}this.addEventListener("keyup",it(this,Zi,Qa),{once:!0})};Nn=new WeakSet;ql=function(){var i;let e=(i=at(this,Za))==null?void 0:i.radioGroupItems;if(!e)return;let t=e.filter(a=>a.getAttribute("aria-checked")==="true").pop();t||(t=e[0]);for(let a of e)a.setAttribute("aria-checked","false");t==null||t.setAttribute("aria-checked","true")};Rf(bi,"template",Qm);function qa(i){return i.type==="radio"||i.type==="checkbox"}function Zl(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?Zl(i,t):e!=null&&e.items?e:Zl(e,e==null?void 0:e.parentNode)}l.customElements.get("media-chrome-menu-item")||l.customElements.define("media-chrome-menu-item",bi);var rd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Q=(i,e,t)=>(rd(i,e,"read from private field"),t?t.call(i):e.get(i)),le=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Vt=(i,e,t,a)=>(rd(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Fe=(i,e,t)=>(rd(i,e,"access private method"),t),nt,Gn,Un,Bn,Ve,Kn,Wn,Hn,$n,nd,zm,Fn,Jl,Vn,jl,Yn,sd,ed,Xm,td,Jm,id,jm,ad,eh,th=m.createElement("template");th.innerHTML=`
|
|
226
594
|
<style>
|
|
227
595
|
:host {
|
|
228
596
|
--_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
|
|
@@ -332,6 +700,8 @@
|
|
|
332
700
|
justify-content: center;
|
|
333
701
|
width: 100%;
|
|
334
702
|
position: absolute;
|
|
703
|
+
|
|
704
|
+
will-change: transform;
|
|
335
705
|
}
|
|
336
706
|
|
|
337
707
|
#background,
|
|
@@ -358,35 +728,33 @@
|
|
|
358
728
|
overflow: hidden;
|
|
359
729
|
}
|
|
360
730
|
|
|
361
|
-
#progress
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
transition: var(--media-range-track-transition);
|
|
731
|
+
#progress,
|
|
732
|
+
#highlight,
|
|
733
|
+
#pointer {
|
|
365
734
|
position: absolute;
|
|
366
735
|
height: 100%;
|
|
736
|
+
will-change: width;
|
|
367
737
|
}
|
|
368
738
|
|
|
369
|
-
#
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
height: 100%;
|
|
739
|
+
#progress {
|
|
740
|
+
background: var(--media-range-bar-color, var(--media-primary-color, rgb(238 238 238)));
|
|
741
|
+
transition: var(--media-range-track-transition);
|
|
373
742
|
}
|
|
374
743
|
|
|
375
744
|
#pointer {
|
|
376
745
|
background: var(--media-range-track-pointer-background);
|
|
377
746
|
border-right: var(--media-range-track-pointer-border-right);
|
|
378
|
-
border-radius: var(--media-range-track-border-radius, 1px);
|
|
379
747
|
transition: visibility .25s, opacity .25s;
|
|
380
748
|
visibility: hidden;
|
|
381
749
|
opacity: 0;
|
|
382
|
-
position: absolute;
|
|
383
|
-
height: 100%;
|
|
384
750
|
}
|
|
385
751
|
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
752
|
+
@media (hover: hover) {
|
|
753
|
+
:host(:hover) #pointer {
|
|
754
|
+
transition: visibility .5s, opacity .5s;
|
|
755
|
+
visibility: visible;
|
|
756
|
+
opacity: 1;
|
|
757
|
+
}
|
|
390
758
|
}
|
|
391
759
|
|
|
392
760
|
#thumb {
|
|
@@ -408,12 +776,44 @@
|
|
|
408
776
|
:host([disabled]) #thumb {
|
|
409
777
|
background-color: #777;
|
|
410
778
|
}
|
|
779
|
+
|
|
780
|
+
.segments #appearance {
|
|
781
|
+
height: var(--media-range-segment-hover-height, 7px);
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
#background,
|
|
785
|
+
#track {
|
|
786
|
+
clip-path: url(#segments-clipping);
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
#segments {
|
|
790
|
+
--segments-gap: var(--media-range-segments-gap, 2px);
|
|
791
|
+
position: absolute;
|
|
792
|
+
width: 100%;
|
|
793
|
+
height: 100%;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
#segments-clipping {
|
|
797
|
+
transform: translateX(calc(var(--segments-gap) / 2));
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
#segments-clipping:empty {
|
|
801
|
+
display: none;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
#segments-clipping rect {
|
|
805
|
+
height: var(--media-range-track-height, 4px);
|
|
806
|
+
y: calc((var(--media-range-segment-hover-height, 7px) - var(--media-range-track-height, 4px)) / 2);
|
|
807
|
+
transition: var(--media-range-segment-transition, transform .1s ease-in-out);
|
|
808
|
+
transform: var(--media-range-segment-transform, scaleY(1));
|
|
809
|
+
transform-origin: center;
|
|
810
|
+
}
|
|
411
811
|
</style>
|
|
412
812
|
<div id="leftgap"></div>
|
|
413
813
|
<div id="container">
|
|
414
814
|
<div id="startpoint"></div>
|
|
415
815
|
<div id="endpoint"></div>
|
|
416
|
-
<div id="appearance">
|
|
816
|
+
<div id="appearance" part="appearance">
|
|
417
817
|
<div id="background"></div>
|
|
418
818
|
<div id="track">
|
|
419
819
|
<div id="highlight"></div>
|
|
@@ -421,11 +821,12 @@
|
|
|
421
821
|
<div id="progress"></div>
|
|
422
822
|
</div>
|
|
423
823
|
<div id="thumb"></div>
|
|
824
|
+
<svg id="segments"><clipPath id="segments-clipping"></clipPath></svg>
|
|
424
825
|
</div>
|
|
425
826
|
<input id="range" type="range" min="0" max="1" step="any" value="0">
|
|
426
827
|
</div>
|
|
427
828
|
<div id="rightgap"></div>
|
|
428
|
-
`;var
|
|
829
|
+
`;var Ei=class extends l.HTMLElement{constructor(){super(),le(this,nd),le(this,Fn),le(this,Vn),le(this,Yn),le(this,ed),le(this,td),le(this,id),le(this,ad),le(this,nt,void 0),le(this,Gn,void 0),le(this,Un,void 0),le(this,Bn,void 0),le(this,Ve,{}),le(this,Kn,[]),le(this,Wn,()=>{if(this.range.matches(":focus-visible")){let{style:e}=P(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),le(this,Hn,()=>{let{style:e}=P(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),le(this,$n,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(th.content.cloneNode(!0))),this.container=this.shadowRoot.querySelector("#container"),Vt(this,Un,this.shadowRoot.querySelector("#startpoint")),Vt(this,Bn,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",y.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===y.MEDIA_CONTROLLER?(t&&((n=(r=Q(this,nt))==null?void 0:r.unassociateElement)==null||n.call(r,this),Vt(this,nt,null)),a&&this.isConnected&&(Vt(this,nt,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=Q(this,nt))==null?void 0:d.associateElement)==null||u.call(d,this))):(e==="disabled"||e==="aria-disabled"&&t!==a)&&(a==null?(this.range.removeAttribute(e),Fe(this,Fn,Jl).call(this)):(this.range.setAttribute(e,a),Fe(this,Vn,jl).call(this)))}connectedCallback(){var e,t,a;let{style:r}=P(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),Q(this,Ve).pointer=P(this.shadowRoot,"#pointer"),Q(this,Ve).progress=P(this.shadowRoot,"#progress"),Q(this,Ve).thumb=P(this.shadowRoot,"#thumb");let n=this.getAttribute(y.MEDIA_CONTROLLER);n&&(Vt(this,nt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=Q(this,nt))==null?void 0:t.associateElement)==null||a.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",Q(this,Wn)),this.shadowRoot.addEventListener("focusout",Q(this,Hn)),Fe(this,Fn,Jl).call(this),Le(this.container,Q(this,$n))}disconnectedCallback(){var e,t;Fe(this,Vn,jl).call(this),(t=(e=Q(this,nt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Vt(this,nt,null),this.shadowRoot.removeEventListener("focusin",Q(this,Wn)),this.shadowRoot.removeEventListener("focusout",Q(this,Hn)),Xe(this.container,Q(this,$n))}updatePointerBar(e){var t;(t=Q(this,Ve).pointer)==null||t.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,t;let a=this.range.valueAsNumber*100;(e=Q(this,Ve).progress)==null||e.style.setProperty("width",`${a}%`),(t=Q(this,Ve).thumb)==null||t.style.setProperty("left",`${a}%`)}updateSegments(e){let t=this.shadowRoot.querySelector("#segments-clipping");if(t.textContent="",this.container.classList.toggle("segments",!!(e!=null&&e.length)),!(e!=null&&e.length))return;Q(this,Ve).activeSegment=Vo(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let a=[...new Set([+this.range.min,...e.flatMap(n=>[n.start,n.end]),+this.range.max])];Vt(this,Kn,[...a]);let r=a.pop();for(let[n,o]of a.entries()){let[d,u]=[n===0,n===a.length-1],c=d?"calc(var(--segments-gap) / -1)":`${o*100}%`,E=`calc(${((u?r:a[n+1])-o)*100}%${d||u?"":" - var(--segments-gap)"})`,v=m.createElementNS("http://www.w3.org/2000/svg","rect"),b=P(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);b.style.setProperty("x",c),b.style.setProperty("width",E),t.append(v)}}getPointerRatio(e){let t=Rc(e.clientX,e.clientY,Q(this,Un).getBoundingClientRect(),Q(this,Bn).getBoundingClientRect());return Math.max(0,Math.min(1,t))}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":Fe(this,ad,eh).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":Fe(this,ed,Xm).call(this,e);break;case"pointerdown":Fe(this,Yn,sd).call(this,e);break;case"pointerup":Fe(this,td,Jm).call(this);break;case"pointerleave":Fe(this,id,jm).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};nt=new WeakMap;Gn=new WeakMap;Un=new WeakMap;Bn=new WeakMap;Ve=new WeakMap;Kn=new WeakMap;Wn=new WeakMap;Hn=new WeakMap;$n=new WeakMap;nd=new WeakSet;zm=function(i){let e=Q(this,Ve).activeSegment;if(!e)return;let t=this.getPointerRatio(i),r=`#segments-clipping rect:nth-child(${Q(this,Kn).findIndex((n,o,d)=>{let u=d[o+1];return u!=null&&t>=n&&t<=u})+1})`;(e.selectorText!=r||!e.style.transform)&&(e.selectorText=r,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};Fn=new WeakSet;Jl=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};Vn=new WeakSet;jl=function(){var i,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(i=l.window)==null||i.removeEventListener("pointerup",this),(e=l.window)==null||e.removeEventListener("pointermove",this)};Yn=new WeakSet;sd=function(i){var e;Vt(this,Gn,i.composedPath().includes(this.range)),(e=l.window)==null||e.addEventListener("pointerup",this)};ed=new WeakSet;Xm=function(i){var e;i.pointerType!=="mouse"&&Fe(this,Yn,sd).call(this,i),this.addEventListener("pointerleave",this),(e=l.window)==null||e.addEventListener("pointermove",this)};td=new WeakSet;Jm=function(){var i;(i=l.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};id=new WeakSet;jm=function(){var i,e;this.removeEventListener("pointerleave",this),(i=l.window)==null||i.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=Q(this,Ve).activeSegment)==null||e.style.removeProperty("transform")};ad=new WeakSet;eh=function(i){this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),Fe(this,nd,zm).call(this,i),this.dragging&&(i.pointerType!=="mouse"||!Q(this,Gn))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(i),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})))};l.customElements.get("media-chrome-range")||l.customElements.define("media-chrome-range",Ei);var ih=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},qn=(i,e,t)=>(ih(i,e,"read from private field"),t?t.call(i):e.get(i)),Df=(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)},Zn=(i,e,t,a)=>(ih(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),st,ah=m.createElement("template");ah.innerHTML=`
|
|
429
830
|
<style>
|
|
430
831
|
:host {
|
|
431
832
|
|
|
@@ -447,7 +848,7 @@
|
|
|
447
848
|
</style>
|
|
448
849
|
|
|
449
850
|
<slot></slot>
|
|
450
|
-
`;var
|
|
851
|
+
`;var od=class extends l.HTMLElement{constructor(){super(),Df(this,st,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(ah.content.cloneNode(!0)))}static get observedAttributes(){return[y.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===y.MEDIA_CONTROLLER&&(t&&((n=(r=qn(this,st))==null?void 0:r.unassociateElement)==null||n.call(r,this),Zn(this,st,null)),a&&this.isConnected&&(Zn(this,st,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=qn(this,st))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(y.MEDIA_CONTROLLER);r&&(Zn(this,st,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=qn(this,st))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=qn(this,st))==null?void 0:e.unassociateElement)==null||t.call(e,this),Zn(this,st,null)}};st=new WeakMap;l.customElements.get("media-control-bar")||l.customElements.define("media-control-bar",od);var rh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Qn=(i,e,t)=>(rh(i,e,"read from private field"),t?t.call(i):e.get(i)),Of=(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)},zn=(i,e,t,a)=>(rh(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ot,nh=m.createElement("template");nh.innerHTML=`
|
|
451
852
|
<style>
|
|
452
853
|
:host {
|
|
453
854
|
font: var(--media-font,
|
|
@@ -480,49 +881,27 @@
|
|
|
480
881
|
}
|
|
481
882
|
</style>
|
|
482
883
|
<slot></slot>
|
|
483
|
-
`;var
|
|
484
|
-
<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"/>
|
|
485
|
-
</svg>`,Yc=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
486
|
-
<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"/>
|
|
487
|
-
</svg>`,nd=c.createElement("template");nd.innerHTML=`
|
|
488
|
-
<style>
|
|
489
|
-
:host([aria-checked="true"]) slot[name=off] {
|
|
490
|
-
display: none !important;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
:host(:not([aria-checked="true"])) slot[name=on] {
|
|
495
|
-
display: none !important;
|
|
496
|
-
}
|
|
497
|
-
</style>
|
|
498
|
-
|
|
499
|
-
<slot name="icon">
|
|
500
|
-
<slot name="on">${Kc}</slot>
|
|
501
|
-
<slot name="off">${Yc}</slot>
|
|
502
|
-
</slot>
|
|
503
|
-
`;var id=i=>{i.setAttribute("aria-checked",Ml(i))},lo=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:nd,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",q.CLOSED_CAPTIONS()),id(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_SUBTITLES_SHOWING&&id(this)}get mediaSubtitlesList(){return ad(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){rd(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return ad(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){rd(this,o.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new l.CustomEvent(f.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}},ad=(i,e)=>{let t=i.getAttribute(e);return t?wi(t):[]},rd=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=It(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};l.customElements.get("media-captions-button")||l.customElements.define("media-captions-button",lo);var ii={SEEK_OFFSET:"seekoffset"},ja=30,Gc=`<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)">${ja}</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>`,od=c.createElement("template");od.innerHTML=`
|
|
504
|
-
<slot name="icon">${Gc}</slot>
|
|
505
|
-
`;var Zc=0,uo=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,ii.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:od,...e})}connectedCallback(){this.seekOffset=M(this,ii.SEEK_OFFSET,ja),super.connectedCallback()}attributeChangedCallback(e,t,a){e===ii.SEEK_OFFSET&&(this.seekOffset=M(this,ii.SEEK_OFFSET,ja)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return M(this,ii.SEEK_OFFSET,ja)}set seekOffset(e){O(this,ii.SEEK_OFFSET,e),this.setAttribute("aria-label",D.SEEK_FORWARD_N_SECS({seekOffset:this.seekOffset})),Aa(_a(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME,Zc)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new l.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};l.customElements.get("media-seek-forward-button")||l.customElements.define("media-seek-forward-button",uo);var qc=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
884
|
+
`;var lt=class extends l.HTMLElement{constructor(){super(),Of(this,ot,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(nh.content.cloneNode(!0)))}static get observedAttributes(){return[y.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===y.MEDIA_CONTROLLER&&(t&&((n=(r=Qn(this,ot))==null?void 0:r.unassociateElement)==null||n.call(r,this),zn(this,ot,null)),a&&this.isConnected&&(zn(this,ot,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=Qn(this,ot))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a;let{style:r}=P(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(y.MEDIA_CONTROLLER);n&&(zn(this,ot,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=Qn(this,ot))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Qn(this,ot))==null?void 0:e.unassociateElement)==null||t.call(e,this),zn(this,ot,null)}};ot=new WeakMap;l.customElements.get("media-text-display")||l.customElements.define("media-text-display",lt);var sh=lt;var lh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},oh=(i,e,t)=>(lh(i,e,"read from private field"),t?t.call(i):e.get(i)),Pf=(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)},Nf=(i,e,t,a)=>(lh(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),za,ld=class extends lt{constructor(){super(),Pf(this,za,void 0),Nf(this,za,this.shadowRoot.querySelector("slot")),oh(this,za).textContent=ze(0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_DURATION]}attributeChangedCallback(e,t,a){e===s.MEDIA_DURATION&&(oh(this,za).textContent=ze(a)),super.attributeChangedCallback(e,t,a)}get mediaDuration(){return x(this,s.MEDIA_DURATION)}set mediaDuration(e){N(this,s.MEDIA_DURATION,e)}};za=new WeakMap;l.customElements.get("media-duration-display")||l.customElements.define("media-duration-display",ld);var Uf=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
506
885
|
<path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
|
|
507
|
-
</svg>`,
|
|
886
|
+
</svg>`,Bf=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
508
887
|
<path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
|
|
509
|
-
</svg>`,
|
|
888
|
+
</svg>`,uh=m.createElement("template");uh.innerHTML=`
|
|
510
889
|
<style>
|
|
511
|
-
:host([${
|
|
890
|
+
:host([${s.MEDIA_IS_FULLSCREEN}]) slot:not([name=exit]):not([name=icon]) {
|
|
512
891
|
display: none !important;
|
|
513
892
|
}
|
|
514
893
|
|
|
515
894
|
|
|
516
|
-
:host(:not([${
|
|
895
|
+
:host(:not([${s.MEDIA_IS_FULLSCREEN}])) slot:not([name=enter]):not([name=icon]) {
|
|
517
896
|
display: none !important;
|
|
518
897
|
}
|
|
519
898
|
</style>
|
|
520
899
|
|
|
521
900
|
<slot name="icon">
|
|
522
|
-
<slot name="enter">${
|
|
523
|
-
<slot name="exit">${
|
|
901
|
+
<slot name="enter">${Uf}</slot>
|
|
902
|
+
<slot name="exit">${Bf}</slot>
|
|
524
903
|
</slot>
|
|
525
|
-
`;var
|
|
904
|
+
`;var dh=i=>{let e=i.mediaIsFullscreen?Y.EXIT_FULLSCREEN():Y.ENTER_FULLSCREEN();i.setAttribute("aria-label",e)},dd=class extends O{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_FULLSCREEN,s.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(e={}){super({slotTemplate:uh,...e})}connectedCallback(){super.connectedCallback(),dh(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_IS_FULLSCREEN&&dh(this)}get mediaFullscreenUnavailable(){return I(this,s.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){k(this,s.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return H(this,s.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){U(this,s.MEDIA_IS_FULLSCREEN,e)}handleClick(){let e=this.mediaIsFullscreen?h.MEDIA_EXIT_FULLSCREEN_REQUEST:h.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-fullscreen-button")||l.customElements.define("media-fullscreen-button",dd);var{MEDIA_TIME_IS_LIVE:Xn,MEDIA_PAUSED:Xa}=s,{MEDIA_SEEK_TO_LIVE_REQUEST:Wf,MEDIA_PLAY_REQUEST:Hf}=h,$f='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>',mh=m.createElement("template");mh.innerHTML=`
|
|
526
905
|
<style>
|
|
527
906
|
|
|
528
907
|
slot[name=indicator] > *,
|
|
@@ -533,100 +912,168 @@
|
|
|
533
912
|
color: var(--media-live-button-icon-color, rgb(140, 140, 140));
|
|
534
913
|
}
|
|
535
914
|
|
|
536
|
-
:host([${
|
|
537
|
-
:host([${
|
|
915
|
+
:host([${Xn}]:not([${Xa}])) slot[name=indicator] > *,
|
|
916
|
+
:host([${Xn}]:not([${Xa}])) ::slotted([slot=indicator]) {
|
|
538
917
|
fill: var(--media-live-button-indicator-color, rgb(255, 0, 0));
|
|
539
918
|
color: var(--media-live-button-indicator-color, rgb(255, 0, 0));
|
|
540
919
|
}
|
|
541
920
|
|
|
542
|
-
:host([${
|
|
921
|
+
:host([${Xn}]:not([${Xa}])) {
|
|
543
922
|
cursor: not-allowed;
|
|
544
923
|
}
|
|
545
924
|
|
|
546
925
|
</style>
|
|
547
926
|
|
|
548
|
-
<slot name="indicator">${
|
|
927
|
+
<slot name="indicator">${$f}</slot>
|
|
549
928
|
|
|
550
929
|
<slot name="spacer"> </slot><slot name="text">LIVE</slot>
|
|
551
|
-
`;var
|
|
930
|
+
`;var ch=i=>{let e=i.mediaPaused||!i.mediaTimeIsLive,t=e?Y.SEEK_LIVE():Y.PLAYING_LIVE();i.setAttribute("aria-label",t),e?i.removeAttribute("aria-disabled"):i.setAttribute("aria-disabled","true")},ud=class extends O{static get observedAttributes(){return[...super.observedAttributes,Xa,Xn]}constructor(e={}){super({slotTemplate:mh,...e})}connectedCallback(){ch(this),super.connectedCallback()}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),ch(this)}get mediaPaused(){return H(this,s.MEDIA_PAUSED)}set mediaPaused(e){U(this,s.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return H(this,s.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){U(this,s.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new l.CustomEvent(Wf,{composed:!0,bubbles:!0})),this.hasAttribute(Xa)&&this.dispatchEvent(new l.CustomEvent(Hf,{composed:!0,bubbles:!0})))}};l.customElements.get("media-live-button")||l.customElements.define("media-live-button",ud);var vh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ja=(i,e,t)=>(vh(i,e,"read from private field"),t?t.call(i):e.get(i)),hh=(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)},ja=(i,e,t,a)=>(vh(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),dt,Jn,ph={LOADING_DELAY:"loadingdelay"},fh=500,bh=m.createElement("template"),Ff=`
|
|
931
|
+
<svg aria-hidden="true" viewBox="0 0 100 100">
|
|
932
|
+
<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">
|
|
933
|
+
<animateTransform
|
|
934
|
+
attributeName="transform"
|
|
935
|
+
attributeType="XML"
|
|
936
|
+
type="rotate"
|
|
937
|
+
dur="1s"
|
|
938
|
+
from="0 50 50"
|
|
939
|
+
to="360 50 50"
|
|
940
|
+
repeatCount="indefinite" />
|
|
941
|
+
</path>
|
|
942
|
+
</svg>
|
|
943
|
+
`;bh.innerHTML=`
|
|
944
|
+
<style>
|
|
945
|
+
:host {
|
|
946
|
+
display: var(--media-control-display, var(--media-loading-indicator-display, inline-block));
|
|
947
|
+
vertical-align: middle;
|
|
948
|
+
box-sizing: border-box;
|
|
949
|
+
--_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${fh}ms);
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
#status {
|
|
953
|
+
color: rgba(0,0,0,0);
|
|
954
|
+
width: 0px;
|
|
955
|
+
height: 0px;
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
:host slot[name=icon] > *,
|
|
959
|
+
:host ::slotted([slot=icon]) {
|
|
960
|
+
opacity: var(--media-loading-indicator-opacity, 0);
|
|
961
|
+
transition: opacity 0.15s;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
:host([${s.MEDIA_LOADING}]:not([${s.MEDIA_PAUSED}])) slot[name=icon] > *,
|
|
965
|
+
:host([${s.MEDIA_LOADING}]:not([${s.MEDIA_PAUSED}])) ::slotted([slot=icon]) {
|
|
966
|
+
opacity: var(--media-loading-indicator-opacity, 1);
|
|
967
|
+
transition: opacity 0.15s var(--_loading-indicator-delay);
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
:host #status {
|
|
971
|
+
visibility: var(--media-loading-indicator-opacity, hidden);
|
|
972
|
+
transition: visibility 0.15s;
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
:host([${s.MEDIA_LOADING}]:not([${s.MEDIA_PAUSED}])) #status {
|
|
976
|
+
visibility: var(--media-loading-indicator-opacity, visible);
|
|
977
|
+
transition: visibility 0.15s var(--_loading-indicator-delay);
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
svg, img, ::slotted(svg), ::slotted(img) {
|
|
981
|
+
width: var(--media-loading-indicator-icon-width);
|
|
982
|
+
height: var(--media-loading-indicator-icon-height, 100px);
|
|
983
|
+
fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));
|
|
984
|
+
vertical-align: middle;
|
|
985
|
+
}
|
|
986
|
+
</style>
|
|
987
|
+
|
|
988
|
+
<slot name="icon">${Ff}</slot>
|
|
989
|
+
<div id="status" role="status" aria-live="polite">${K.MEDIA_LOADING()}</div>
|
|
990
|
+
`;var cd=class extends l.HTMLElement{constructor(){if(super(),hh(this,dt,void 0),hh(this,Jn,fh),!this.shadowRoot){let e=this.attachShadow({mode:"open"}),t=bh.content.cloneNode(!0);e.appendChild(t)}}static get observedAttributes(){return[y.MEDIA_CONTROLLER,s.MEDIA_PAUSED,s.MEDIA_LOADING,ph.LOADING_DELAY]}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===ph.LOADING_DELAY&&t!==a?this.loadingDelay=Number(a):e===y.MEDIA_CONTROLLER&&(t&&((n=(r=Ja(this,dt))==null?void 0:r.unassociateElement)==null||n.call(r,this),ja(this,dt,null)),a&&this.isConnected&&(ja(this,dt,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=Ja(this,dt))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(y.MEDIA_CONTROLLER);r&&(ja(this,dt,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Ja(this,dt))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Ja(this,dt))==null?void 0:e.unassociateElement)==null||t.call(e,this),ja(this,dt,null)}get loadingDelay(){return Ja(this,Jn)}set loadingDelay(e){ja(this,Jn,e);let{style:t}=P(this.shadowRoot,":host");t.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return H(this,s.MEDIA_PAUSED)}set mediaPaused(e){U(this,s.MEDIA_PAUSED,e)}get mediaLoading(){return H(this,s.MEDIA_LOADING)}set mediaLoading(e){U(this,s.MEDIA_LOADING,e)}};dt=new WeakMap;Jn=new WeakMap;l.customElements.get("media-loading-indicator")||l.customElements.define("media-loading-indicator",cd);var{MEDIA_VOLUME_LEVEL:er}=s,Vf=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
552
991
|
<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"/>
|
|
553
|
-
</svg>`,
|
|
992
|
+
</svg>`,Eh=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
554
993
|
<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"/>
|
|
555
|
-
</svg>`,
|
|
994
|
+
</svg>`,Kf=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
556
995
|
<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"/>
|
|
557
|
-
</svg>`,
|
|
996
|
+
</svg>`,_h=m.createElement("template");_h.innerHTML=`
|
|
558
997
|
<style>
|
|
559
998
|
|
|
560
|
-
:host(:not([${
|
|
561
|
-
:host([${
|
|
999
|
+
:host(:not([${er}])) slot:not([name=high]):not([name=icon]),
|
|
1000
|
+
:host([${er}=high]) slot:not([name=high]):not([name=icon]) {
|
|
562
1001
|
display: none !important;
|
|
563
1002
|
}
|
|
564
1003
|
|
|
565
|
-
:host([${
|
|
1004
|
+
:host([${er}=off]) slot:not([name=off]):not([name=icon]) {
|
|
566
1005
|
display: none !important;
|
|
567
1006
|
}
|
|
568
1007
|
|
|
569
|
-
:host([${
|
|
1008
|
+
:host([${er}=low]) slot:not([name=low]):not([name=icon]) {
|
|
570
1009
|
display: none !important;
|
|
571
1010
|
}
|
|
572
1011
|
|
|
573
|
-
:host([${
|
|
1012
|
+
:host([${er}=medium]) slot:not([name=medium]):not([name=icon]) {
|
|
574
1013
|
display: none !important;
|
|
575
1014
|
}
|
|
576
1015
|
</style>
|
|
577
1016
|
|
|
578
1017
|
<slot name="icon">
|
|
579
|
-
<slot name="off">${
|
|
580
|
-
<slot name="low">${
|
|
581
|
-
<slot name="medium">${
|
|
582
|
-
<slot name="high">${
|
|
1018
|
+
<slot name="off">${Vf}</slot>
|
|
1019
|
+
<slot name="low">${Eh}</slot>
|
|
1020
|
+
<slot name="medium">${Eh}</slot>
|
|
1021
|
+
<slot name="high">${Kf}</slot>
|
|
583
1022
|
</slot>
|
|
584
|
-
`;var
|
|
1023
|
+
`;var gh=i=>{let t=i.mediaVolumeLevel==="off"?Y.UNMUTE():Y.MUTE();i.setAttribute("aria-label",t)},md=class extends O{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_VOLUME_LEVEL]}constructor(e={}){super({slotTemplate:_h,...e})}connectedCallback(){gh(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===s.MEDIA_VOLUME_LEVEL&&gh(this),super.attributeChangedCallback(e,t,a)}get mediaVolumeLevel(){return I(this,s.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){k(this,s.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?h.MEDIA_UNMUTE_REQUEST:h.MEDIA_MUTE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-mute-button")||l.customElements.define("media-mute-button",md);var Ah=`<svg aria-hidden="true" viewBox="0 0 28 24">
|
|
585
1024
|
<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"/>
|
|
586
|
-
</svg>`,
|
|
1025
|
+
</svg>`,Th=m.createElement("template");Th.innerHTML=`
|
|
587
1026
|
<style>
|
|
588
|
-
:host([${
|
|
1027
|
+
:host([${s.MEDIA_IS_PIP}]) slot:not([name=exit]):not([name=icon]) {
|
|
589
1028
|
display: none !important;
|
|
590
1029
|
}
|
|
591
1030
|
|
|
592
1031
|
|
|
593
|
-
:host(:not([${
|
|
1032
|
+
:host(:not([${s.MEDIA_IS_PIP}])) slot:not([name=enter]):not([name=icon]) {
|
|
594
1033
|
display: none !important;
|
|
595
1034
|
}
|
|
596
1035
|
</style>
|
|
597
1036
|
|
|
598
1037
|
<slot name="icon">
|
|
599
|
-
<slot name="enter">${
|
|
600
|
-
<slot name="exit">${
|
|
1038
|
+
<slot name="enter">${Ah}</slot>
|
|
1039
|
+
<slot name="exit">${Ah}</slot>
|
|
601
1040
|
</slot>
|
|
602
|
-
`;var
|
|
1041
|
+
`;var yh=i=>{let e=i.mediaIsPip?Y.EXIT_PIP():Y.ENTER_PIP();i.setAttribute("aria-label",e)},hd=class extends O{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_PIP,s.MEDIA_PIP_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Th,...e})}connectedCallback(){yh(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===s.MEDIA_IS_PIP&&yh(this),super.attributeChangedCallback(e,t,a)}get mediaPipUnavailable(){return I(this,s.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){k(this,s.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return H(this,s.MEDIA_IS_PIP)}set mediaIsPip(e){U(this,s.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?h.MEDIA_EXIT_PIP_REQUEST:h.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-pip-button")||l.customElements.define("media-pip-button",hd);var Yf=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},jn=(i,e,t)=>(Yf(i,e,"read from private field"),t?t.call(i):e.get(i)),Gf=(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)},Qi,pd={RATES:"rates"},tr=[1,1.2,1.5,1.7,2],Kt=1,kh=m.createElement("template");kh.innerHTML=`
|
|
1042
|
+
<style>
|
|
1043
|
+
:host {
|
|
1044
|
+
min-width: 5ch;
|
|
1045
|
+
padding: var(--media-button-padding, var(--media-control-padding, 10px 5px));
|
|
1046
|
+
}
|
|
1047
|
+
</style>
|
|
1048
|
+
<slot name="icon"></slot>
|
|
1049
|
+
`;var vd=class extends O{constructor(e={}){super({slotTemplate:kh,...e}),Gf(this,Qi,new Me(this,pd.RATES,{defaultValue:tr})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${Kt}x`}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE,pd.RATES]}attributeChangedCallback(e,t,a){if(super.attributeChangedCallback(e,t,a),e===pd.RATES&&(jn(this,Qi).value=a),e===s.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?Kt:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",K.PLAYBACK_RATE({playbackRate:n}))}}get rates(){return jn(this,Qi)}set rates(e){e?Array.isArray(e)&&(jn(this,Qi).value=e.join(" ")):jn(this,Qi).value=""}get mediaPlaybackRate(){return x(this,s.MEDIA_PLAYBACK_RATE,Kt)}set mediaPlaybackRate(e){N(this,s.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let a=Array.from(this.rates.values(),o=>+o).sort((o,d)=>o-d),r=(t=(e=a.find(o=>o>this.mediaPlaybackRate))!=null?e:a[0])!=null?t:Kt,n=new l.CustomEvent(h.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};Qi=new WeakMap;l.customElements.get("media-playback-rate-button")||l.customElements.define("media-playback-rate-button",vd);var Sh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},es=(i,e,t)=>(Sh(i,e,"read from private field"),t?t.call(i):e.get(i)),fd=(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)},ir=(i,e,t)=>(Sh(i,e,"access private method"),t),zi,ar,ts,is,Ed,bd={RATES:"rates"},gd=class extends ce{constructor(){super(),fd(this,ar),fd(this,is),fd(this,zi,new Me(this,bd.RATES,{defaultValue:tr})),ir(this,ar,ts).call(this)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE,bd.RATES]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_PLAYBACK_RATE&&t!=a?this.value=a:e===bd.RATES&&t!=a&&(es(this,zi).value=a,ir(this,ar,ts).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",ir(this,is,Ed))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",ir(this,is,Ed))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-playback-rate-menu-button")}get rates(){return es(this,zi)}set rates(e){e?Array.isArray(e)&&(es(this,zi).value=e.join(" ")):es(this,zi).value="",ir(this,ar,ts).call(this)}get mediaPlaybackRate(){return x(this,s.MEDIA_PLAYBACK_RATE,Kt)}set mediaPlaybackRate(e){N(this,s.MEDIA_PLAYBACK_RATE,e)}};zi=new WeakMap;ar=new WeakSet;ts=function(){this.defaultSlot.textContent="";for(let i of this.rates){let e=tt({type:"radio",text:this.formatMenuItemText(`${i}x`,i),value:i,checked:this.mediaPlaybackRate==i});e.prepend($e(this,"checked-indicator")),this.defaultSlot.append(e)}};is=new WeakSet;Ed=function(){if(!this.value)return;let i=new l.CustomEvent(h.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-playback-rate-menu")||l.customElements.define("media-playback-rate-menu",gd);var qf=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},as=(i,e,t)=>(qf(i,e,"read from private field"),t?t.call(i):e.get(i)),Zf=(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)},Xi,_d={RATES:"rates"},Qf=[1,1.2,1.5,1.7,2],Ad=1,Ih=m.createElement("template");Ih.innerHTML=`
|
|
1050
|
+
<style>
|
|
1051
|
+
:host {
|
|
1052
|
+
min-width: 5ch;
|
|
1053
|
+
padding: var(--media-button-padding, var(--media-control-padding, 10px 5px));
|
|
1054
|
+
}
|
|
1055
|
+
</style>
|
|
1056
|
+
<slot name="icon"></slot>
|
|
1057
|
+
`;var yd=class extends ke{constructor(e={}){super({slotTemplate:Ih,...e}),Zf(this,Xi,new Me(this,_d.RATES,{defaultValue:Qf})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${Ad}x`}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE,_d.RATES]}attributeChangedCallback(e,t,a){if(super.attributeChangedCallback(e,t,a),e===_d.RATES&&(as(this,Xi).value=a),e===s.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?Ad:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",K.PLAYBACK_RATE({playbackRate:n}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-playback-rate-menu")}get rates(){return as(this,Xi)}set rates(e){e?Array.isArray(e)&&(as(this,Xi).value=e.join(" ")):as(this,Xi).value=""}get mediaPlaybackRate(){return x(this,s.MEDIA_PLAYBACK_RATE,Ad)}set mediaPlaybackRate(e){N(this,s.MEDIA_PLAYBACK_RATE,e)}};Xi=new WeakMap;l.customElements.get("media-playback-rate-menu-button")||l.customElements.define("media-playback-rate-menu-button",yd);var zf=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
603
1058
|
<path d="m6 21 15-9L6 3v18Z"/>
|
|
604
|
-
</svg>`,
|
|
1059
|
+
</svg>`,Xf=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
605
1060
|
<path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
|
|
606
|
-
</svg>`,
|
|
1061
|
+
</svg>`,Lh=m.createElement("template");Lh.innerHTML=`
|
|
607
1062
|
<style>
|
|
608
|
-
:host([${
|
|
1063
|
+
:host([${s.MEDIA_PAUSED}]) slot[name=pause] {
|
|
609
1064
|
display: none !important;
|
|
610
1065
|
}
|
|
611
1066
|
|
|
612
|
-
:host(:not([${
|
|
1067
|
+
:host(:not([${s.MEDIA_PAUSED}])) slot[name=play] {
|
|
613
1068
|
display: none !important;
|
|
614
1069
|
}
|
|
615
1070
|
</style>
|
|
616
1071
|
|
|
617
1072
|
<slot name="icon">
|
|
618
|
-
<slot name="play">${
|
|
619
|
-
<slot name="pause">${
|
|
1073
|
+
<slot name="play">${zf}</slot>
|
|
1074
|
+
<slot name="pause">${Xf}</slot>
|
|
620
1075
|
</slot>
|
|
621
|
-
`;var
|
|
622
|
-
<style>
|
|
623
|
-
:host {
|
|
624
|
-
min-width: 5ch;
|
|
625
|
-
padding: var(--media-button-padding, var(--media-control-padding, 10px 5px));
|
|
626
|
-
}
|
|
627
|
-
</style>
|
|
628
|
-
<slot name="icon"></slot>
|
|
629
|
-
`;var fo=class extends w{constructor(e={}){super({slotTemplate:gd,...e}),rm(this,ai,new nt(this,Eo.RATES,{defaultValue:vo})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${ri}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,Eo.RATES]}attributeChangedCallback(e,t,a){if(super.attributeChangedCallback(e,t,a),e===Eo.RATES&&(tr(this,ai).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?ri:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",q.PLAYBACK_RATE({playbackRate:n}))}}get rates(){return tr(this,ai)}set rates(e){e?Array.isArray(e)&&(tr(this,ai).value=e.join(" ")):tr(this,ai).value=""}get mediaPlaybackRate(){return M(this,o.MEDIA_PLAYBACK_RATE,ri)}set mediaPlaybackRate(e){O(this,o.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let a=Array.from(this.rates.values(),s=>+s).sort((s,d)=>s-d),r=(t=(e=a.find(s=>s>this.mediaPlaybackRate))!=null?e:a[0])!=null?t:ri,n=new l.CustomEvent(f.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};ai=new WeakMap;l.customElements.get("media-playback-rate-button")||l.customElements.define("media-playback-rate-button",fo);var De={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"},Ad=c.createElement("template");Ad.innerHTML=`
|
|
1076
|
+
`;var Ch=i=>{let e=i.mediaPaused?Y.PLAY():Y.PAUSE();i.setAttribute("aria-label",e)},Td=class extends O{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PAUSED,s.MEDIA_ENDED]}constructor(e={}){super({slotTemplate:Lh,...e})}connectedCallback(){Ch(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===s.MEDIA_PAUSED&&Ch(this),super.attributeChangedCallback(e,t,a)}get mediaPaused(){return H(this,s.MEDIA_PAUSED)}set mediaPaused(e){U(this,s.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-play-button")||l.customElements.define("media-play-button",Td);var ut={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"},Mh=m.createElement("template");Mh.innerHTML=`
|
|
630
1077
|
<style>
|
|
631
1078
|
:host {
|
|
632
1079
|
pointer-events: none;
|
|
@@ -648,9 +1095,7 @@
|
|
|
648
1095
|
</style>
|
|
649
1096
|
|
|
650
1097
|
<img part="poster img" aria-hidden="true" id="image"/>
|
|
651
|
-
`;var
|
|
652
|
-
<slot name="icon">${sm}</slot>
|
|
653
|
-
`;var lm=0,Ao=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,ni.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:_d,...e})}connectedCallback(){this.seekOffset=M(this,ni.SEEK_OFFSET,ir),super.connectedCallback()}attributeChangedCallback(e,t,a){e===ni.SEEK_OFFSET&&(this.seekOffset=M(this,ni.SEEK_OFFSET,ir)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return M(this,ni.SEEK_OFFSET,ir)}set seekOffset(e){O(this,ni.SEEK_OFFSET,e),this.setAttribute("aria-label",D.SEEK_BACK_N_SECS({seekOffset:this.seekOffset})),Aa(_a(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME,lm)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new l.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};l.customElements.get("media-seek-backward-button")||l.customElements.define("media-seek-backward-button",Ao);var Td=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},yd=(i,e,t)=>(Td(i,e,"read from private field"),t?t.call(i):e.get(i)),dm=(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)},um=(i,e,t,a)=>(Td(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Vi,_o=class extends Ge{constructor(){super(),dm(this,Vi,void 0),um(this,Vi,this.shadowRoot.querySelector("slot")),yd(this,Vi).textContent=Se(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,a){e===o.MEDIA_PREVIEW_TIME&&a!=null&&(yd(this,Vi).textContent=Se(a)),super.attributeChangedCallback(e,t,a)}get mediaPreviewTime(){return M(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){O(this,o.MEDIA_PREVIEW_TIME,e)}};Vi=new WeakMap;l.customElements.get("media-preview-time-display")||l.customElements.define("media-preview-time-display",_o);var Id=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ar=(i,e,t)=>(Id(i,e,"read from private field"),t?t.call(i):e.get(i)),cm=(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)},rr=(i,e,t,a)=>(Id(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Oe,kd=c.createElement("template");kd.innerHTML=`
|
|
1098
|
+
`;var Jf=i=>{i.style.removeProperty("background-image")},jf=(i,e)=>{i.style["background-image"]=`url('${e}')`},kd=class extends l.HTMLElement{static get observedAttributes(){return[ut.PLACEHOLDER_SRC,ut.SRC]}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Mh.content.cloneNode(!0))),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,a){e===ut.SRC&&(a==null?this.image.removeAttribute(ut.SRC):this.image.setAttribute(ut.SRC,a)),e===ut.PLACEHOLDER_SRC&&(a==null?Jf(this.image):jf(this.image,a))}get placeholderSrc(){return I(this,ut.PLACEHOLDER_SRC)}set placeholderSrc(e){k(this,ut.SRC,e)}get src(){return I(this,ut.SRC)}set src(e){k(this,ut.SRC,e)}};l.customElements.get("media-poster-image")||l.customElements.define("media-poster-image",kd);var wh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},eb=(i,e,t)=>(wh(i,e,"read from private field"),t?t.call(i):e.get(i)),tb=(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)},ib=(i,e,t,a)=>(wh(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),rs,Sd=class extends sh{constructor(){super(),tb(this,rs,void 0),ib(this,rs,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PREVIEW_CHAPTER]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_PREVIEW_CHAPTER&&a!==t&&a!=null&&(eb(this,rs).textContent=a,a!==""?this.setAttribute("aria-valuetext",`chapter: ${a}`):this.removeAttribute("aria-valuetext"))}get mediaPreviewChapter(){return I(this,s.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){k(this,s.MEDIA_PREVIEW_CHAPTER,e)}};rs=new WeakMap;l.customElements.get("media-preview-chapter-display")||l.customElements.define("media-preview-chapter-display",Sd);var xh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ns=(i,e,t)=>(xh(i,e,"read from private field"),t?t.call(i):e.get(i)),ab=(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)},ss=(i,e,t,a)=>(xh(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ct,Rh=m.createElement("template");Rh.innerHTML=`
|
|
654
1099
|
<style>
|
|
655
1100
|
:host {
|
|
656
1101
|
box-sizing: border-box;
|
|
@@ -664,12 +1109,74 @@
|
|
|
664
1109
|
}
|
|
665
1110
|
</style>
|
|
666
1111
|
<img crossorigin loading="eager" decoding="async">
|
|
667
|
-
`;var
|
|
1112
|
+
`;var Id=class extends l.HTMLElement{constructor(){super(),ab(this,ct,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Rh.content.cloneNode(!0)))}static get observedAttributes(){return[y.MEDIA_CONTROLLER,s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,a;let r=this.getAttribute(y.MEDIA_CONTROLLER);r&&(ss(this,ct,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ns(this,ct))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ns(this,ct))==null?void 0:e.unassociateElement)==null||t.call(e,this),ss(this,ct,null)}attributeChangedCallback(e,t,a){var r,n,o,d,u;[s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===y.MEDIA_CONTROLLER&&(t&&((n=(r=ns(this,ct))==null?void 0:r.unassociateElement)==null||n.call(r,this),ss(this,ct,null)),a&&this.isConnected&&(ss(this,ct,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=ns(this,ct))==null?void 0:d.associateElement)==null||u.call(d,this)))}get mediaPreviewImage(){return I(this,s.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){k(this,s.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(s.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(s.MEDIA_PREVIEW_COORDS);return}this.setAttribute(s.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[a,r,n,o]=e,d=t.split("#")[0],u=getComputedStyle(this),{maxWidth:c,maxHeight:f,minWidth:E,minHeight:v}=u,b=Math.min(parseInt(c)/n,parseInt(f)/o),w=Math.max(parseInt(E)/n,parseInt(v)/o),_=b<1,T=_?b:w>1?w:1,{style:R}=P(this.shadowRoot,":host"),oe=P(this.shadowRoot,"img").style,ge=this.shadowRoot.querySelector("img"),Ot=_?"min":"max";R.setProperty(`${Ot}-width`,"initial","important"),R.setProperty(`${Ot}-height`,"initial","important"),R.width=`${n*T}px`,R.height=`${o*T}px`;let _t=()=>{oe.width=`${this.imgWidth*T}px`,oe.height=`${this.imgHeight*T}px`,oe.display="block"};ge.src!==d&&(ge.onload=()=>{this.imgWidth=ge.naturalWidth,this.imgHeight=ge.naturalHeight,_t()},ge.src=d,_t()),_t(),oe.transform=`translate(-${a*T}px, -${r*T}px)`}};ct=new WeakMap;l.customElements.get("media-preview-thumbnail")||l.customElements.define("media-preview-thumbnail",Id);var Oh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Dh=(i,e,t)=>(Oh(i,e,"read from private field"),t?t.call(i):e.get(i)),rb=(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)},nb=(i,e,t,a)=>(Oh(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),rr,Cd=class extends lt{constructor(){super(),rb(this,rr,void 0),nb(this,rr,this.shadowRoot.querySelector("slot")),Dh(this,rr).textContent=ze(0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_PREVIEW_TIME&&a!=null&&(Dh(this,rr).textContent=ze(a))}get mediaPreviewTime(){return x(this,s.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){N(this,s.MEDIA_PREVIEW_TIME,e)}};rr=new WeakMap;l.customElements.get("media-preview-time-display")||l.customElements.define("media-preview-time-display",Cd);var Rd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ph=(i,e,t)=>(Rd(i,e,"read from private field"),t?t.call(i):e.get(i)),os=(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)},Ld=(i,e,t,a)=>(Rd(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ls=(i,e,t)=>(Rd(i,e,"access private method"),t),nr,cs,ds,Md,us,wd,xd=class extends ce{constructor(){super(...arguments),os(this,ds),os(this,us),os(this,nr,[]),os(this,cs,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_LIST,s.MEDIA_RENDITION_SELECTED,s.MEDIA_RENDITION_UNAVAILABLE]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_RENDITION_SELECTED&&t!==a?this.value=a!=null?a:"auto":e===s.MEDIA_RENDITION_LIST&&t!==a&&(Ld(this,nr,Hr(a)),ls(this,ds,Md).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",ls(this,us,wd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",ls(this,us,wd))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return Ph(this,nr)}set mediaRenditionList(e){Ld(this,nr,e),ls(this,ds,Md).call(this)}get mediaRenditionSelected(){return I(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){k(this,s.MEDIA_RENDITION_SELECTED,e)}};nr=new WeakMap;cs=new WeakMap;ds=new WeakSet;Md=function(){if(Ph(this,cs)===JSON.stringify(this.mediaRenditionList))return;Ld(this,cs,JSON.stringify(this.mediaRenditionList));let i=this.mediaRenditionList.sort((a,r)=>r.height-a.height);this.defaultSlot.textContent="";let e=!this.mediaRenditionSelected;for(let a of i){let r=this.formatMenuItemText(`${Math.min(a.width,a.height)}p`,a),n=tt({type:"radio",text:r,value:`${a.id}`,checked:a.selected&&!e});n.prepend($e(this,"checked-indicator")),this.defaultSlot.append(n)}let t=tt({type:"radio",text:this.formatMenuItemText("Auto"),value:"auto",checked:e});t.prepend($e(this,"checked-indicator")),this.defaultSlot.append(t)};us=new WeakSet;wd=function(){if(this.value==null)return;let i=new l.CustomEvent(h.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-rendition-menu")||l.customElements.define("media-rendition-menu",xd);var sb=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1113
|
+
<path d="M13.5 2.5h2v6h-2v-2h-11v-2h11v-2Zm4 2h4v2h-4v-2Zm-12 4h2v6h-2v-2h-3v-2h3v-2Zm4 2h12v2h-12v-2Zm1 4h2v6h-2v-2h-8v-2h8v-2Zm4 2h7v2h-7v-2Z" />
|
|
1114
|
+
</svg>`,Nh=m.createElement("template");Nh.innerHTML=`
|
|
1115
|
+
<slot name="icon">${sb}</slot>
|
|
1116
|
+
`;var Dd=class extends ke{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_SELECTED,s.MEDIA_RENDITION_UNAVAILABLE]}constructor(){super({slotTemplate:Nh})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",K.QUALITY())}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return I(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){k(this,s.MEDIA_RENDITION_SELECTED,e)}};l.customElements.get("media-rendition-menu-button")||l.customElements.define("media-rendition-menu-button",Dd);var Ji={SEEK_OFFSET:"seekoffset"},ms=30,ob=`<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)">${ms}</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>`,Uh=m.createElement("template");Uh.innerHTML=`
|
|
1117
|
+
<slot name="icon">${ob}</slot>
|
|
1118
|
+
`;var lb=0,Od=class extends O{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_CURRENT_TIME,Ji.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:Uh,...e})}connectedCallback(){this.seekOffset=x(this,Ji.SEEK_OFFSET,ms),super.connectedCallback()}attributeChangedCallback(e,t,a){e===Ji.SEEK_OFFSET&&(this.seekOffset=x(this,Ji.SEEK_OFFSET,ms)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return x(this,Ji.SEEK_OFFSET,ms)}set seekOffset(e){N(this,Ji.SEEK_OFFSET,e),this.setAttribute("aria-label",Y.SEEK_BACK_N_SECS({seekOffset:this.seekOffset})),Zr(Qr(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return x(this,s.MEDIA_CURRENT_TIME,lb)}set mediaCurrentTime(e){N(this,s.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};l.customElements.get("media-seek-backward-button")||l.customElements.define("media-seek-backward-button",Od);var ji={SEEK_OFFSET:"seekoffset"},hs=30,db=`<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)">${hs}</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>`,Bh=m.createElement("template");Bh.innerHTML=`
|
|
1119
|
+
<slot name="icon">${db}</slot>
|
|
1120
|
+
`;var ub=0,Pd=class extends O{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_CURRENT_TIME,ji.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:Bh,...e})}connectedCallback(){this.seekOffset=x(this,ji.SEEK_OFFSET,hs),super.connectedCallback()}attributeChangedCallback(e,t,a){e===ji.SEEK_OFFSET&&(this.seekOffset=x(this,ji.SEEK_OFFSET,hs)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return x(this,ji.SEEK_OFFSET,hs)}set seekOffset(e){N(this,ji.SEEK_OFFSET,e),this.setAttribute("aria-label",Y.SEEK_FORWARD_N_SECS({seekOffset:this.seekOffset})),Zr(Qr(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return x(this,s.MEDIA_CURRENT_TIME,ub)}set mediaCurrentTime(e){N(this,s.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};l.customElements.get("media-seek-forward-button")||l.customElements.define("media-seek-forward-button",Pd);var cb=Object.defineProperty,mb=(i,e,t)=>e in i?cb(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,hb=(i,e,t)=>(mb(i,typeof e!="symbol"?e+"":e,t),t),Wh=m.createElement("template");Wh.innerHTML=ce.template.innerHTML+`
|
|
1121
|
+
<style>
|
|
1122
|
+
:host {
|
|
1123
|
+
background: var(--media-settings-menu-background,
|
|
1124
|
+
var(--media-menu-background,
|
|
1125
|
+
var(--media-control-background,
|
|
1126
|
+
var(--media-secondary-color, rgb(20 20 30 / .8)))));
|
|
1127
|
+
min-width: var(--media-settings-menu-min-width, 160px);
|
|
1128
|
+
border-radius: 2px 2px 0 0;
|
|
1129
|
+
overflow: hidden;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
:host([role="menu"]) {
|
|
1133
|
+
|
|
1134
|
+
justify-content: end;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
slot:not([name]) {
|
|
1138
|
+
justify-content: var(--media-settings-menu-justify-content);
|
|
1139
|
+
flex-direction: var(--media-settings-menu-flex-direction, column);
|
|
1140
|
+
overflow: visible;
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
#container.has-expanded {
|
|
1144
|
+
--media-settings-menu-item-opacity: 0;
|
|
1145
|
+
}
|
|
1146
|
+
</style>
|
|
1147
|
+
`;var ps=class extends ce{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:X(this).querySelector("media-settings-menu-button")}};hb(ps,"template",Wh);l.customElements.get("media-settings-menu")||l.customElements.define("media-settings-menu",ps);var Hh=m.createElement("template");Hh.innerHTML=`
|
|
1148
|
+
<slot name="icon">
|
|
1149
|
+
<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1150
|
+
<path d="M4.5 14.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm7.5 0a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm7.5 0a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"/>
|
|
1151
|
+
</svg>
|
|
1152
|
+
</slot>
|
|
1153
|
+
`;var Nd=class extends ke{static get observedAttributes(){return[...super.observedAttributes,"target"]}constructor(){super({slotTemplate:Hh})}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",K.SETTINGS())}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:X(this).querySelector("media-settings-menu")}};l.customElements.get("media-settings-menu-button")||l.customElements.define("media-settings-menu-button",Nd);var pb=Object.defineProperty,vb=(i,e,t)=>e in i?pb(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,fb=(i,e,t)=>(vb(i,typeof e!="symbol"?e+"":e,t),t),$h,vs=m.createElement("template");vs.innerHTML=bi.template.innerHTML+`
|
|
1154
|
+
<style>
|
|
1155
|
+
slot:not([name="submenu"]) {
|
|
1156
|
+
opacity: var(--media-settings-menu-item-opacity, var(--media-menu-item-opacity));
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
:host([aria-expanded="true"]:hover) {
|
|
1160
|
+
background: transparent;
|
|
1161
|
+
}
|
|
1162
|
+
</style>
|
|
1163
|
+
`;($h=vs.content)!=null&&$h.querySelector&&(vs.content.querySelector('slot[name="suffix"]').innerHTML=`
|
|
1164
|
+
<svg aria-hidden="true" viewBox="0 0 20 24">
|
|
1165
|
+
<path d="m8.12 17.585-.742-.669 4.2-4.665-4.2-4.666.743-.669 4.803 5.335-4.803 5.334Z"/>
|
|
1166
|
+
</svg>
|
|
1167
|
+
`);var fs=class extends bi{};fb(fs,"template",vs);l.customElements.get("media-settings-menu-item")||l.customElements.define("media-settings-menu-item",fs);var Yh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ud=(i,e,t)=>(Yh(i,e,"read from private field"),t?t.call(i):e.get(i)),bb=(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)},Eb=(i,e,t,a)=>(Yh(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ea,Ke={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Fh=[...Object.values(Ke),s.MEDIA_CURRENT_TIME,s.MEDIA_DURATION,s.MEDIA_SEEKABLE],Vh=["Enter"," "],gb=" / ",Kh=(i,{timesSep:e=gb}={})=>{var t,a;let r=i.hasAttribute(Ke.REMAINING),n=i.hasAttribute(Ke.SHOW_DURATION),o=(t=i.mediaCurrentTime)!=null?t:0,[,d]=(a=i.mediaSeekable)!=null?a:[],u=0;Number.isFinite(i.mediaDuration)?u=i.mediaDuration:Number.isFinite(d)&&(u=d);let c=r?ze(0-(u-o)):ze(o);return n?`${c}${e}${ze(u)}`:c},_b="video not loaded, unknown time.",Ab=i=>{var e;let t=i.mediaCurrentTime,[,a]=(e=i.mediaSeekable)!=null?e:[],r=null;if(Number.isFinite(i.mediaDuration)?r=i.mediaDuration:Number.isFinite(a)&&(r=a),t==null||r===null){i.setAttribute("aria-valuetext",_b);return}let n=i.hasAttribute(Ke.REMAINING),o=i.hasAttribute(Ke.SHOW_DURATION),d=n?ii(0-(r-t)):ii(t);if(!o){i.setAttribute("aria-valuetext",d);return}let u=ii(r),c=`${d} of ${u}`;i.setAttribute("aria-valuetext",c)},Bd=class extends lt{constructor(){super(),bb(this,ea,void 0),Eb(this,ea,this.shadowRoot.querySelector("slot")),Ud(this,ea).innerHTML=`${Kh(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Fh,"disabled"]}connectedCallback(){let{style:e}=P(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","pointer"),e.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))"),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",K.PLAYBACK_TIME());let t=a=>{let{key:r}=a;if(!Vh.includes(r)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:o}=a;if(r||n||!Vh.includes(o)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,a){Fh.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 H(this,Ke.REMAINING)}set remaining(e){U(this,Ke.REMAINING,e)}get showDuration(){return H(this,Ke.SHOW_DURATION)}set showDuration(e){U(this,Ke.SHOW_DURATION,e)}get noToggle(){return H(this,Ke.NO_TOGGLE)}set noToggle(e){U(this,Ke.NO_TOGGLE,e)}get mediaDuration(){return x(this,s.MEDIA_DURATION)}set mediaDuration(e){N(this,s.MEDIA_DURATION,e)}get mediaCurrentTime(){return x(this,s.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){N(this,s.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(s.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(s.MEDIA_SEEKABLE);return}this.setAttribute(s.MEDIA_SEEKABLE,e.join(":"))}update(){let e=Kh(this);Ab(this),e!==Ud(this,ea).innerHTML&&(Ud(this,ea).innerHTML=e)}};ea=new WeakMap;l.customElements.get("media-time-display")||l.customElements.define("media-time-display",Bd);var Gh=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ne=(i,e,t)=>(Gh(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)},Se=(i,e,t,a)=>(Gh(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),yb=(i,e,t,a)=>({set _(r){Se(i,e,r,t)},get _(){return ne(i,e,a)}}),ta,bs,ia,sr,Es,gs,_s,aa,gi,As,ys=class{constructor(e,t,a){mt(this,ta,void 0),mt(this,bs,void 0),mt(this,ia,void 0),mt(this,sr,void 0),mt(this,Es,void 0),mt(this,gs,void 0),mt(this,_s,void 0),mt(this,aa,void 0),mt(this,gi,0),mt(this,As,(r=performance.now())=>{Se(this,gi,requestAnimationFrame(ne(this,As))),Se(this,sr,performance.now()-ne(this,ia));let n=1e3/this.fps;if(ne(this,sr)>n){Se(this,ia,r-ne(this,sr)%n);let o=1e3/((r-ne(this,bs))/++yb(this,Es)._),d=(r-ne(this,gs))/1e3/this.duration,u=ne(this,_s)+d*this.playbackRate;u-ne(this,ta).valueAsNumber>0?Se(this,aa,this.playbackRate/this.duration/o):(Se(this,aa,.995*ne(this,aa)),u=ne(this,ta).valueAsNumber+ne(this,aa)),this.callback(u)}}),Se(this,ta,e),this.callback=t,this.fps=a}start(){ne(this,gi)===0&&(Se(this,ia,performance.now()),Se(this,bs,ne(this,ia)),Se(this,Es,0),ne(this,As).call(this))}stop(){ne(this,gi)!==0&&(cancelAnimationFrame(ne(this,gi)),Se(this,gi,0))}update({start:e,duration:t,playbackRate:a}){let r=e-ne(this,ta).valueAsNumber;(r>0||r<-.03)&&this.callback(e),Se(this,_s,e),Se(this,gs,performance.now()),this.duration=t,this.playbackRate=a}};ta=new WeakMap;bs=new WeakMap;ia=new WeakMap;sr=new WeakMap;Es=new WeakMap;gs=new WeakMap;_s=new WeakMap;aa=new WeakMap;gi=new WeakMap;As=new WeakMap;var Vd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ie=(i,e,t)=>(Vd(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)},ht=(i,e,t,a)=>(Vd(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),me=(i,e,t)=>(Vd(i,e,"access private method"),t),ra,_i,Ss,lr,Is,ks,dr,ur,na,sa,or,Kd,qh,Wd,Cs,Yd,Ls,Gd,Ms,qd,Hd,Zh,cr,ws,$d,Qh,Tb="video not loaded, unknown time.",kb=i=>{let e=i.range,t=ii(+Xh(i)),a=ii(+i.mediaSeekableEnd),r=t&&a?`${t} of ${a}`:Tb;e.setAttribute("aria-valuetext",r)},zh=m.createElement("template");zh.innerHTML=`
|
|
668
1168
|
<style>
|
|
669
1169
|
:host {
|
|
670
|
-
--media-
|
|
1170
|
+
--media-box-border-radius: 4px;
|
|
671
1171
|
--media-box-padding-left: 10px;
|
|
672
1172
|
--media-box-padding-right: 10px;
|
|
1173
|
+
--media-preview-border-radius: var(--media-box-border-radius);
|
|
1174
|
+
--media-box-arrow-offset: var(--media-box-border-radius);
|
|
1175
|
+
--_control-background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));
|
|
1176
|
+
--_preview-background: var(--media-preview-background, var(--_control-background));
|
|
1177
|
+
|
|
1178
|
+
|
|
1179
|
+
contain: layout;
|
|
673
1180
|
}
|
|
674
1181
|
|
|
675
1182
|
#highlight {
|
|
@@ -678,25 +1185,33 @@
|
|
|
678
1185
|
|
|
679
1186
|
#preview-rail,
|
|
680
1187
|
#current-rail {
|
|
681
|
-
|
|
682
|
-
width: 1%;
|
|
1188
|
+
width: 100%;
|
|
683
1189
|
position: absolute;
|
|
684
1190
|
left: 0;
|
|
685
1191
|
bottom: 100%;
|
|
686
1192
|
pointer-events: none;
|
|
1193
|
+
will-change: transform;
|
|
687
1194
|
}
|
|
688
1195
|
|
|
689
1196
|
[part~="box"] {
|
|
1197
|
+
width: min-content;
|
|
690
1198
|
|
|
691
1199
|
position: absolute;
|
|
692
1200
|
bottom: 100%;
|
|
693
|
-
display: flex;
|
|
694
1201
|
flex-direction: column;
|
|
695
1202
|
align-items: center;
|
|
696
1203
|
transform: translateX(-50%);
|
|
697
1204
|
}
|
|
698
1205
|
|
|
1206
|
+
[part~="current-box"] {
|
|
1207
|
+
display: var(--media-current-box-display, var(--media-box-display, flex));
|
|
1208
|
+
margin: var(--media-current-box-margin, var(--media-box-margin, 0 0 5px));
|
|
1209
|
+
visibility: hidden;
|
|
1210
|
+
}
|
|
1211
|
+
|
|
699
1212
|
[part~="preview-box"] {
|
|
1213
|
+
display: var(--media-preview-box-display, var(--media-box-display, flex));
|
|
1214
|
+
margin: var(--media-preview-box-margin, var(--media-box-margin, 0 0 5px));
|
|
700
1215
|
transition-property: var(--media-preview-transition-property, visibility, opacity);
|
|
701
1216
|
transition-duration: var(--media-preview-transition-duration-out, .25s);
|
|
702
1217
|
transition-delay: var(--media-preview-transition-delay-out, 0s);
|
|
@@ -704,7 +1219,7 @@
|
|
|
704
1219
|
opacity: 0;
|
|
705
1220
|
}
|
|
706
1221
|
|
|
707
|
-
:host(:is([${
|
|
1222
|
+
:host(:is([${s.MEDIA_PREVIEW_IMAGE}], [${s.MEDIA_PREVIEW_TIME}])[dragging]) [part~="preview-box"] {
|
|
708
1223
|
transition-duration: var(--media-preview-transition-duration-in, .5s);
|
|
709
1224
|
transition-delay: var(--media-preview-transition-delay-in, .25s);
|
|
710
1225
|
visibility: visible;
|
|
@@ -712,7 +1227,7 @@
|
|
|
712
1227
|
}
|
|
713
1228
|
|
|
714
1229
|
@media (hover: hover) {
|
|
715
|
-
:host(:is([${
|
|
1230
|
+
:host(:is([${s.MEDIA_PREVIEW_IMAGE}], [${s.MEDIA_PREVIEW_TIME}]):hover) [part~="preview-box"] {
|
|
716
1231
|
transition-duration: var(--media-preview-transition-duration-in, .5s);
|
|
717
1232
|
transition-delay: var(--media-preview-transition-delay-in, .25s);
|
|
718
1233
|
visibility: visible;
|
|
@@ -726,7 +1241,7 @@
|
|
|
726
1241
|
|
|
727
1242
|
transition: visibility 0s .25s;
|
|
728
1243
|
transition-delay: calc(var(--media-preview-transition-delay-out, 0s) + var(--media-preview-transition-duration-out, .25s));
|
|
729
|
-
background: var(--media-preview-thumbnail-background, var(--
|
|
1244
|
+
background: var(--media-preview-thumbnail-background, var(--_preview-background));
|
|
730
1245
|
box-shadow: var(--media-preview-thumbnail-box-shadow, 0 0 4px rgb(0 0 0 / .2));
|
|
731
1246
|
max-width: var(--media-preview-thumbnail-max-width, 180px);
|
|
732
1247
|
max-height: var(--media-preview-thumbnail-max-height, 160px);
|
|
@@ -737,51 +1252,122 @@
|
|
|
737
1252
|
var(--media-preview-border-radius) var(--media-preview-border-radius) 0 0);
|
|
738
1253
|
}
|
|
739
1254
|
|
|
740
|
-
:host([${
|
|
741
|
-
:host([${
|
|
1255
|
+
:host([${s.MEDIA_PREVIEW_IMAGE}][dragging]) media-preview-thumbnail,
|
|
1256
|
+
:host([${s.MEDIA_PREVIEW_IMAGE}][dragging]) ::slotted(media-preview-thumbnail) {
|
|
742
1257
|
transition-delay: var(--media-preview-transition-delay-in, .25s);
|
|
743
1258
|
visibility: visible;
|
|
744
1259
|
}
|
|
745
1260
|
|
|
746
1261
|
@media (hover: hover) {
|
|
747
|
-
:host([${
|
|
748
|
-
:host([${
|
|
1262
|
+
:host([${s.MEDIA_PREVIEW_IMAGE}]:hover) media-preview-thumbnail,
|
|
1263
|
+
:host([${s.MEDIA_PREVIEW_IMAGE}]:hover) ::slotted(media-preview-thumbnail) {
|
|
749
1264
|
transition-delay: var(--media-preview-transition-delay-in, .25s);
|
|
750
1265
|
visibility: visible;
|
|
751
1266
|
}
|
|
752
1267
|
|
|
753
|
-
:host([${
|
|
1268
|
+
:host([${s.MEDIA_PREVIEW_TIME}]:hover) {
|
|
754
1269
|
--media-time-range-hover-display: block;
|
|
755
1270
|
}
|
|
756
1271
|
}
|
|
757
1272
|
|
|
1273
|
+
media-preview-chapter-display,
|
|
1274
|
+
::slotted(media-preview-chapter-display) {
|
|
1275
|
+
font-size: var(--media-font-size, 13px);
|
|
1276
|
+
line-height: 17px;
|
|
1277
|
+
min-width: 0;
|
|
1278
|
+
visibility: hidden;
|
|
1279
|
+
|
|
1280
|
+
transition: min-width 0s, border-radius 0s, margin 0s, padding 0s, visibility 0s;
|
|
1281
|
+
transition-delay: calc(var(--media-preview-transition-delay-out, 0s) + var(--media-preview-transition-duration-out, .25s));
|
|
1282
|
+
background: var(--media-preview-chapter-background, var(--_preview-background));
|
|
1283
|
+
border-radius: var(--media-preview-chapter-border-radius,
|
|
1284
|
+
var(--media-preview-border-radius) var(--media-preview-border-radius)
|
|
1285
|
+
var(--media-preview-border-radius) var(--media-preview-border-radius));
|
|
1286
|
+
padding: var(--media-preview-chapter-padding, 3.5px 9px);
|
|
1287
|
+
margin: var(--media-preview-chapter-margin, 0 0 5px);
|
|
1288
|
+
text-shadow: var(--media-preview-chapter-text-shadow, 0 0 4px rgb(0 0 0 / .75));
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
:host([${s.MEDIA_PREVIEW_IMAGE}]) media-preview-chapter-display,
|
|
1292
|
+
:host([${s.MEDIA_PREVIEW_IMAGE}]) ::slotted(media-preview-chapter-display) {
|
|
1293
|
+
transition-delay: var(--media-preview-transition-delay-in, .25s);
|
|
1294
|
+
border-radius: var(--media-preview-chapter-border-radius, 0);
|
|
1295
|
+
padding: var(--media-preview-chapter-padding, 3.5px 9px 0);
|
|
1296
|
+
margin: var(--media-preview-chapter-margin, 0);
|
|
1297
|
+
min-width: 100%;
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
media-preview-chapter-display[${s.MEDIA_PREVIEW_CHAPTER}],
|
|
1301
|
+
::slotted(media-preview-chapter-display[${s.MEDIA_PREVIEW_CHAPTER}]) {
|
|
1302
|
+
visibility: visible;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
media-preview-chapter-display:not([aria-valuetext]),
|
|
1306
|
+
::slotted(media-preview-chapter-display:not([aria-valuetext])) {
|
|
1307
|
+
display: none;
|
|
1308
|
+
}
|
|
1309
|
+
|
|
758
1310
|
media-preview-time-display,
|
|
759
|
-
::slotted(media-preview-time-display)
|
|
1311
|
+
::slotted(media-preview-time-display),
|
|
1312
|
+
media-time-display,
|
|
1313
|
+
::slotted(media-time-display) {
|
|
1314
|
+
font-size: var(--media-font-size, 13px);
|
|
1315
|
+
line-height: 17px;
|
|
760
1316
|
min-width: 0;
|
|
761
1317
|
|
|
762
1318
|
transition: min-width 0s, border-radius 0s;
|
|
763
1319
|
transition-delay: calc(var(--media-preview-transition-delay-out, 0s) + var(--media-preview-transition-duration-out, .25s));
|
|
764
|
-
background: var(--media-preview-time-background, var(--
|
|
1320
|
+
background: var(--media-preview-time-background, var(--_preview-background));
|
|
765
1321
|
border-radius: var(--media-preview-time-border-radius,
|
|
766
1322
|
var(--media-preview-border-radius) var(--media-preview-border-radius)
|
|
767
1323
|
var(--media-preview-border-radius) var(--media-preview-border-radius));
|
|
768
|
-
padding: var(--media-preview-time-padding,
|
|
769
|
-
margin: var(--media-preview-time-margin, 0
|
|
1324
|
+
padding: var(--media-preview-time-padding, 3.5px 9px);
|
|
1325
|
+
margin: var(--media-preview-time-margin, 0);
|
|
770
1326
|
text-shadow: var(--media-preview-time-text-shadow, 0 0 4px rgb(0 0 0 / .75));
|
|
1327
|
+
transform: translateX(min(
|
|
1328
|
+
max(calc(50% - var(--_box-width) / 2),
|
|
1329
|
+
calc(var(--_box-shift, 0))),
|
|
1330
|
+
calc(var(--_box-width) / 2 - 50%)
|
|
1331
|
+
));
|
|
771
1332
|
}
|
|
772
1333
|
|
|
773
|
-
:host([${
|
|
774
|
-
:host([${
|
|
1334
|
+
:host([${s.MEDIA_PREVIEW_IMAGE}]) media-preview-time-display,
|
|
1335
|
+
:host([${s.MEDIA_PREVIEW_IMAGE}]) ::slotted(media-preview-time-display) {
|
|
775
1336
|
transition-delay: var(--media-preview-transition-delay-in, .25s);
|
|
776
|
-
min-width: 100%;
|
|
777
1337
|
border-radius: var(--media-preview-time-border-radius,
|
|
778
1338
|
0 0 var(--media-preview-border-radius) var(--media-preview-border-radius));
|
|
1339
|
+
min-width: 100%;
|
|
1340
|
+
transform: translateX(0);
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
:host([${s.MEDIA_PREVIEW_TIME}]:hover) {
|
|
1344
|
+
--media-time-range-hover-display: block;
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
[part~="arrow"],
|
|
1348
|
+
::slotted([part~="arrow"]) {
|
|
1349
|
+
display: var(--media-box-arrow-display, inline-block);
|
|
1350
|
+
transform: translateX(min(
|
|
1351
|
+
max(calc(50% - var(--_box-width) / 2 + var(--media-box-arrow-offset)),
|
|
1352
|
+
calc(var(--_box-shift, 0))),
|
|
1353
|
+
calc(var(--_box-width) / 2 - 50% - var(--media-box-arrow-offset))
|
|
1354
|
+
));
|
|
1355
|
+
|
|
1356
|
+
border-color: transparent;
|
|
1357
|
+
border-top-color: var(--media-box-arrow-background, var(--_control-background));
|
|
1358
|
+
border-width: var(--media-box-arrow-border-width,
|
|
1359
|
+
var(--media-box-arrow-height, 5px) var(--media-box-arrow-width, 6px) 0);
|
|
1360
|
+
border-style: solid;
|
|
1361
|
+
justify-content: center;
|
|
1362
|
+
height: 0;
|
|
779
1363
|
}
|
|
780
1364
|
</style>
|
|
781
1365
|
<div id="preview-rail">
|
|
782
1366
|
<slot name="preview" part="box preview-box">
|
|
783
1367
|
<media-preview-thumbnail></media-preview-thumbnail>
|
|
1368
|
+
<media-preview-chapter-display></media-preview-chapter-display>
|
|
784
1369
|
<media-preview-time-display></media-preview-time-display>
|
|
1370
|
+
<slot name="preview-arrow"><div part="arrow"></div></slot>
|
|
785
1371
|
</slot>
|
|
786
1372
|
</div>
|
|
787
1373
|
<div id="current-rail">
|
|
@@ -789,70 +1375,10 @@
|
|
|
789
1375
|
|
|
790
1376
|
</slot>
|
|
791
1377
|
</div>
|
|
792
|
-
`;var
|
|
793
|
-
<svg aria-hidden="true" viewBox="0 0 100 100">
|
|
794
|
-
<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">
|
|
795
|
-
<animateTransform
|
|
796
|
-
attributeName="transform"
|
|
797
|
-
attributeType="XML"
|
|
798
|
-
type="rotate"
|
|
799
|
-
dur="1s"
|
|
800
|
-
from="0 50 50"
|
|
801
|
-
to="360 50 50"
|
|
802
|
-
repeatCount="indefinite" />
|
|
803
|
-
</path>
|
|
804
|
-
</svg>
|
|
805
|
-
`;Ud.innerHTML=`
|
|
806
|
-
<style>
|
|
807
|
-
:host {
|
|
808
|
-
display: var(--media-control-display, var(--media-loading-indicator-display, inline-block));
|
|
809
|
-
vertical-align: middle;
|
|
810
|
-
box-sizing: border-box;
|
|
811
|
-
--_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${Nd}ms);
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
#status {
|
|
815
|
-
color: rgba(0,0,0,0);
|
|
816
|
-
width: 0px;
|
|
817
|
-
height: 0px;
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
:host slot[name=icon] > *,
|
|
821
|
-
:host ::slotted([slot=icon]) {
|
|
822
|
-
opacity: var(--media-loading-indicator-opacity, 0);
|
|
823
|
-
transition: opacity 0.15s;
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
:host([${o.MEDIA_LOADING}]:not([${o.MEDIA_PAUSED}])) slot[name=icon] > *,
|
|
827
|
-
:host([${o.MEDIA_LOADING}]:not([${o.MEDIA_PAUSED}])) ::slotted([slot=icon]) {
|
|
828
|
-
opacity: var(--media-loading-indicator-opacity, 1);
|
|
829
|
-
transition: opacity 0.15s var(--_loading-indicator-delay);
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
:host #status {
|
|
833
|
-
visibility: var(--media-loading-indicator-opacity, hidden);
|
|
834
|
-
transition: visibility 0.15s;
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
:host([${o.MEDIA_LOADING}]:not([${o.MEDIA_PAUSED}])) #status {
|
|
838
|
-
visibility: var(--media-loading-indicator-opacity, visible);
|
|
839
|
-
transition: visibility 0.15s var(--_loading-indicator-delay);
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
svg, img, ::slotted(svg), ::slotted(img) {
|
|
843
|
-
width: var(--media-loading-indicator-icon-width);
|
|
844
|
-
height: var(--media-loading-indicator-icon-height, 100px);
|
|
845
|
-
fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));
|
|
846
|
-
vertical-align: middle;
|
|
847
|
-
}
|
|
848
|
-
</style>
|
|
849
|
-
|
|
850
|
-
<slot name="icon">${bm}</slot>
|
|
851
|
-
<div id="status" role="status" aria-live="polite">${q.MEDIA_LOADING()}</div>
|
|
852
|
-
`;var wo=class extends l.HTMLElement{constructor(){if(super(),Ro(this,Ue,void 0),Ro(this,fr,Nd),Ro(this,vr,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=Ud.content.cloneNode(!0);t.appendChild(a)}let{style:e}=N(this.shadowRoot,":host");mi(this,vr,e)}static get observedAttributes(){return[A.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,Dd.LOADING_DELAY]}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===Dd.LOADING_DELAY&&t!==a?this.loadingDelay=Number(a):e===A.MEDIA_CONTROLLER&&(t&&((n=(r=ci(this,Ue))==null?void 0:r.unassociateElement)==null||n.call(r,this),mi(this,Ue,null)),a&&this.isConnected&&(mi(this,Ue,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=ci(this,Ue))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(mi(this,Ue,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ci(this,Ue))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ci(this,Ue))==null?void 0:e.unassociateElement)==null||t.call(e,this),mi(this,Ue,null)}get loadingDelay(){return ci(this,fr)}set loadingDelay(e){mi(this,fr,e),ci(this,vr).setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return L(this,o.MEDIA_PAUSED)}set mediaPaused(e){C(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return L(this,o.MEDIA_LOADING)}set mediaLoading(e){C(this,o.MEDIA_LOADING,e)}};Ue=new WeakMap;fr=new WeakMap;vr=new WeakMap;l.customElements.get("media-loading-indicator")||l.customElements.define("media-loading-indicator",wo);var Em=1,fm=i=>i.mediaMuted?0:i.mediaVolume,vm=({value:i})=>`${Math.round(i*100)}%`,xo=class extends Ct{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new l.CustomEvent(f.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",q.VOLUME())}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED)&&(this.range.valueAsNumber=fm(this),this.range.setAttribute("aria-valuetext",vm(this.range)),this.updateBar())}get mediaVolume(){return M(this,o.MEDIA_VOLUME,Em)}set mediaVolume(e){O(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return L(this,o.MEDIA_MUTED)}set mediaMuted(e){C(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return x(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){R(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};l.customElements.get("media-volume-range")||l.customElements.define("media-volume-range",xo);var Bo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},G=(i,e,t)=>(Bo(i,e,"read from private field"),t?t.call(i):e.get(i)),ue=(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)},ye=(i,e,t,a)=>(Bo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),_e=(i,e,t)=>(Bo(i,e,"access private method"),t),Pe,lt,pi,Ki,gr,Ar,Do,hi,Oo,_r,No,Yi,yr,Tr,Uo,Po,Pd,Vo,Bd,gm=`
|
|
1378
|
+
`;var Ts=(i,e=i.mediaCurrentTime)=>{if(Number.isNaN(i.mediaSeekableEnd))return 0;let t=(e-i.mediaSeekableStart)/(i.mediaSeekableEnd-i.mediaSeekableStart);return Math.max(0,Math.min(t,1))},Xh=(i,e=i.range.valueAsNumber)=>Number.isNaN(i.mediaSeekableEnd)?0:e*(i.mediaSeekableEnd-i.mediaSeekableStart)+i.mediaSeekableStart,Fd=class extends Ei{constructor(){super(),se(this,sa),se(this,Kd),se(this,Cs),se(this,Ls),se(this,Ms),se(this,Hd),se(this,cr),se(this,$d),se(this,ra,void 0),se(this,_i,void 0),se(this,Ss,void 0),se(this,lr,void 0),se(this,Is,void 0),se(this,ks,void 0),se(this,dr,void 0),se(this,ur,void 0),se(this,na,void 0),se(this,Wd,t=>{this.dragging||(this.range.valueAsNumber=t,this.updateBar())}),this.container.appendChild(zh.content.cloneNode(!0)),ht(this,Ss,this.shadowRoot.querySelectorAll('[part~="box"]')),ht(this,Is,this.shadowRoot.querySelector('[part~="preview-box"]')),ht(this,ks,this.shadowRoot.querySelector('[part~="current-box"]'));let e=getComputedStyle(this);ht(this,dr,parseInt(e.getPropertyValue("--media-box-padding-left"))),ht(this,ur,parseInt(e.getPropertyValue("--media-box-padding-right"))),ht(this,_i,new ys(this.range,ie(this,Wd),60))}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PAUSED,s.MEDIA_DURATION,s.MEDIA_SEEKABLE,s.MEDIA_CURRENT_TIME,s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_TIME,s.MEDIA_PREVIEW_CHAPTER,s.MEDIA_BUFFERED,s.MEDIA_PLAYBACK_RATE,s.MEDIA_LOADING,s.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",K.SEEK()),me(this,sa,or).call(this),ht(this,ra,this.getRootNode()),(e=ie(this,ra))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),me(this,sa,or).call(this),(e=ie(this,ra))==null||e.removeEventListener("transitionstart",this),ht(this,ra,null)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),t!=a&&(e===s.MEDIA_CURRENT_TIME||e===s.MEDIA_PAUSED||e===s.MEDIA_ENDED||e===s.MEDIA_LOADING||e===s.MEDIA_DURATION||e===s.MEDIA_SEEKABLE?(ie(this,_i).update({start:Ts(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),me(this,sa,or).call(this),kb(this)):e===s.MEDIA_BUFFERED&&this.updateBufferedBar(),e===s.MEDIA_DURATION&&(this.mediaChaptersCues=ie(this,na),this.updateBar()))}get mediaChaptersCues(){return ie(this,na)}set mediaChaptersCues(e){var t;ht(this,na,e),this.updateSegments((t=ie(this,na))==null?void 0:t.map(a=>({start:Ts(this,a.startTime),end:Ts(this,a.endTime)})))}get mediaPaused(){return H(this,s.MEDIA_PAUSED)}set mediaPaused(e){U(this,s.MEDIA_PAUSED,e)}get mediaLoading(){return H(this,s.MEDIA_LOADING)}set mediaLoading(e){U(this,s.MEDIA_LOADING,e)}get mediaDuration(){return x(this,s.MEDIA_DURATION)}set mediaDuration(e){N(this,s.MEDIA_DURATION,e)}get mediaCurrentTime(){return x(this,s.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){N(this,s.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return x(this,s.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){N(this,s.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(s.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(s.MEDIA_BUFFERED);return}let t=e.map(a=>a.join(":")).join(" ");this.setAttribute(s.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(s.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(s.MEDIA_SEEKABLE);return}this.setAttribute(s.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,t=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t=0]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaPreviewImage(){return I(this,s.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){k(this,s.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return x(this,s.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){N(this,s.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return H(this,s.MEDIA_ENDED)}set mediaEnded(e){U(this,s.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let t=this.mediaBuffered;if(!t.length)return;let a;if(this.mediaEnded)a=1;else{let n=this.mediaCurrentTime,[,o=this.mediaSeekableStart]=(e=t.find(([d,u])=>d<=n&&n<=u))!=null?e:[];a=Ts(this,o)}let{style:r}=P(this.shadowRoot,"#highlight");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let t=P(this.shadowRoot,"#current-rail"),a=P(this.shadowRoot,'[part~="current-box"]'),r=me(this,Cs,Yd).call(this,ie(this,ks)),n=me(this,Ls,Gd).call(this,r,this.range.valueAsNumber),o=me(this,Ms,qd).call(this,r,this.range.valueAsNumber);t.style.transform=`translateX(${n})`,t.style.setProperty("--_range-width",`${r.range.width}`),a.style.setProperty("--_box-shift",`${o}`),a.style.setProperty("--_box-width",`${r.box.width}px`),a.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":me(this,$d,Qh).call(this);break;case"pointermove":me(this,Hd,Zh).call(this,e);break;case"pointerup":case"pointerleave":me(this,cr,ws).call(this,null);break;case"transitionstart":ue(e.target,this)&&setTimeout(()=>me(this,sa,or).call(this),0);break}}};ra=new WeakMap;_i=new WeakMap;Ss=new WeakMap;lr=new WeakMap;Is=new WeakMap;ks=new WeakMap;dr=new WeakMap;ur=new WeakMap;na=new WeakMap;sa=new WeakSet;or=function(){me(this,Kd,qh).call(this)?ie(this,_i).start():ie(this,_i).stop()};Kd=new WeakSet;qh=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaDuration>0&&xc(this)};Wd=new WeakMap;Cs=new WeakSet;Yd=function(i){var e;let a=((e=this.getAttribute("bounds")?Be(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),r=this.range.getBoundingClientRect(),n=i.offsetWidth,o=-(r.left-a.left-n/2),d=a.right-r.left-n/2;return{box:{width:n,min:o,max:d},bounds:a,range:r}};Ls=new WeakSet;Gd=function(i,e){let t=`${e*100}%`,{width:a,min:r,max:n}=i.box;if(!a)return t;if(Number.isNaN(r)||(t=`max(${`calc(1 / var(--_range-width) * 100 * ${r}% + var(--media-box-padding-left))`}, ${t})`),!Number.isNaN(n)){let d=`calc(1 / var(--_range-width) * 100 * ${n}% - var(--media-box-padding-right))`;t=`min(${t}, ${d})`}return t};Ms=new WeakSet;qd=function(i,e){let{width:t,min:a,max:r}=i.box,n=e*i.range.width;if(n<a+ie(this,dr)){let o=i.range.left-i.bounds.left-ie(this,dr);return`${n-t/2+o}px`}if(n>r-ie(this,ur)){let o=i.bounds.right-i.range.right-ie(this,ur);return`${n+t/2-o-i.range.width}px`}return 0};Hd=new WeakSet;Zh=function(i){let e=[...ie(this,Ss)].some(f=>i.composedPath().includes(f));if(!this.dragging&&(e||!i.composedPath().includes(this))){me(this,cr,ws).call(this,null);return}let t=this.mediaDuration;if(!t)return;let a=P(this.shadowRoot,"#preview-rail"),r=P(this.shadowRoot,'[part~="preview-box"]'),n=me(this,Cs,Yd).call(this,ie(this,Is)),o=(i.clientX-n.range.left)/n.range.width;o=Math.max(0,Math.min(1,o));let d=me(this,Ls,Gd).call(this,n,o),u=me(this,Ms,qd).call(this,n,o);a.style.transform=`translateX(${d})`,a.style.setProperty("--_range-width",`${n.range.width}`),r.style.setProperty("--_box-shift",`${u}`),r.style.setProperty("--_box-width",`${n.box.width}px`);let c=Math.round(ie(this,lr))-Math.round(o*t);Math.abs(c)<1&&o>.01&&o<.99||(ht(this,lr,o*t),me(this,cr,ws).call(this,ie(this,lr)))};cr=new WeakSet;ws=function(i){this.dispatchEvent(new l.CustomEvent(h.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};$d=new WeakSet;Qh=function(){ie(this,_i).stop();let i=Xh(this);this.dispatchEvent(new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};l.customElements.get("media-time-range")||l.customElements.define("media-time-range",Fd);var Sb=1,Ib=i=>i.mediaMuted?0:i.mediaVolume,Cb=({value:i})=>`${Math.round(i*100)}%`,Zd=class extends Ei{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_VOLUME,s.MEDIA_MUTED,s.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new l.CustomEvent(h.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",K.VOLUME())}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),(e===s.MEDIA_VOLUME||e===s.MEDIA_MUTED)&&(this.range.valueAsNumber=Ib(this),this.range.setAttribute("aria-valuetext",Cb(this.range)),this.updateBar())}get mediaVolume(){return x(this,s.MEDIA_VOLUME,Sb)}set mediaVolume(e){N(this,s.MEDIA_VOLUME,e)}get mediaMuted(){return H(this,s.MEDIA_MUTED)}set mediaMuted(e){U(this,s.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return I(this,s.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){k(this,s.MEDIA_VOLUME_UNAVAILABLE,e)}};l.customElements.get("media-volume-range")||l.customElements.define("media-volume-range",Zd);var eu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},de=(i,e,t)=>(eu(i,e,"read from private field"),t?t.call(i):e.get(i)),Ie=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ge=(i,e,t,a)=>(eu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ye=(i,e,t)=>(eu(i,e,"access private method"),t),pt,Yt,la,mr,xs,Rs,Qd,oa,zd,Ds,Xd,hr,Os,Ps,Jd,jd,Jh,tu,jh,Lb=`
|
|
853
1379
|
<svg aria-hidden="true" viewBox="0 1 24 24" part="select-indicator indicator">
|
|
854
1380
|
<path d="m10 15.17 9.193-9.191 1.414 1.414-10.606 10.606-6.364-6.364 1.414-1.414 4.95 4.95Z"/>
|
|
855
|
-
</svg>`;function
|
|
1381
|
+
</svg>`;function vt(i,e,t){let a=m.createElement("media-chrome-option");a.part.add("option"),a.value=e,a.selected=t;let r=m.createElement("span");return r.textContent=i,a.append(r),a}function qe(i,e){let t=i.querySelector(`:scope > [slot="${e}"]`);return(t==null?void 0:t.nodeName)=="SLOT"&&(t=t.assignedElements({flatten:!0})[0]),t?(t=t.cloneNode(!0),t.removeAttribute("slot"),t):i.shadowRoot.querySelector(`[name="${e}"] > svg`).cloneNode(!0)}var ep=m.createElement("template");ep.innerHTML=`
|
|
856
1382
|
<style>
|
|
857
1383
|
:host {
|
|
858
1384
|
font: var(--media-font,
|
|
@@ -931,8 +1457,8 @@ svg, img, ::slotted(svg), ::slotted(img) {
|
|
|
931
1457
|
</style>
|
|
932
1458
|
<slot name="header"></slot>
|
|
933
1459
|
<slot id="container"></slot>
|
|
934
|
-
<slot name="select-indicator" hidden>${
|
|
935
|
-
`;var
|
|
1460
|
+
<slot name="select-indicator" hidden>${Lb}</slot>
|
|
1461
|
+
`;var Re=class extends l.HTMLElement{constructor(e={}){super(),Ie(this,Rs),Ie(this,Ds),Ie(this,hr),Ie(this,Ps),Ie(this,jd),Ie(this,tu),Ie(this,pt,void 0),Ie(this,Yt,""),Ie(this,la,null),Ie(this,mr,!1),Ie(this,xs,t=>{this.handleClick(t)}),Ie(this,oa,t=>{let{key:a}=t;if(a==="Escape"){this.removeEventListener("keyup",de(this,oa));return}if(a==="Meta"){Ge(this,mr,!1);return}Ye(this,Rs,Qd).call(this,t)}),Ie(this,zd,t=>{let{key:a,altKey:r}=t;if(r){this.removeEventListener("keyup",de(this,oa));return}if(a==="Meta"){Ge(this,mr,!0);return}if(this.keysUsed.includes(a)&&t.preventDefault(),de(this,mr)&&this.keysUsed.includes(a)){Ye(this,Rs,Qd).call(this,t);return}this.addEventListener("keyup",de(this,oa),{once:!0})}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.nativeEl=ep.content.cloneNode(!0),e.slotTemplate&&this.nativeEl.append(e.slotTemplate.content.cloneNode(!0)),this.shadowRoot.append(this.nativeEl)),this.container=this.shadowRoot.querySelector("#container"),this.container.addEventListener("slotchange",t=>{for(let a of t.target.assignedNodes({flatten:!0}))a.nodeType===3&&a.textContent.trim()===""&&a.remove()})}static get observedAttributes(){return["disabled","style",y.MEDIA_CONTROLLER]}static formatOptionText(e){return e}formatOptionText(e,t){return this.constructor.formatOptionText(e,t)}get options(){var e;let t=this.querySelectorAll("media-chrome-option");return t.length||(t=(e=this.container)==null?void 0:e.querySelectorAll("media-chrome-option")),Array.from(t)}get selectedOptions(){return this.options.filter(e=>e.selected)}get value(){var e,t;return(t=(e=this.selectedOptions[0])==null?void 0:e.value)!=null?t:""}set value(e){let t=this.options.find(a=>a.value===e);t&&Ye(this,Ps,Jd).call(this,t)}focus(){var e;(e=this.selectedOptions[0])==null||e.focus()}enable(){this.addEventListener("click",de(this,xs)),this.addEventListener("keydown",de(this,zd))}disable(){this.removeEventListener("click",de(this,xs)),this.removeEventListener("keyup",de(this,oa))}attributeChangedCallback(e,t,a){var r,n,o,d,u;e==="style"&&a!==t?Ye(this,Ds,Xd).call(this):e===y.MEDIA_CONTROLLER?(t&&((n=(r=de(this,pt))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ge(this,pt,null)),a&&this.isConnected&&(Ge(this,pt,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=de(this,pt))==null?void 0:d.associateElement)==null||u.call(d,this))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;Ye(this,Ds,Xd).call(this),this.hasAttribute("disabled")||this.enable(),this.hasAttribute("role")||this.setAttribute("role","listbox");let r=this.getAttribute(y.MEDIA_CONTROLLER);r&&(Ge(this,pt,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=de(this,pt))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=de(this,pt))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ge(this,pt,null)}get keysUsed(){return["Enter"," ","ArrowDown","ArrowUp","Home","End"]}handleSelection(e,t){let a=Ye(this,hr,Os).call(this,e);a&&Ye(this,Ps,Jd).call(this,a,t)}handleMovement(e){let{key:t}=e,a=this.options,r=Ye(this,hr,Os).call(this,e);r||(r=a.filter(o=>o.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=Ye(this,jd,Jh).call(this,t);break}n&&(a.forEach(o=>o.setAttribute("tabindex","-1")),n.setAttribute("tabindex","0"),n.focus())}handleClick(e){let t=Ye(this,hr,Os).call(this,e);!t||t.hasAttribute("disabled")||(this.options.forEach(a=>a.setAttribute("tabindex","-1")),t.setAttribute("tabindex","0"),this.handleSelection(e,this.hasAttribute("aria-multiselectable")&&this.getAttribute("aria-multiselectable")==="true"))}};pt=new WeakMap;Yt=new WeakMap;la=new WeakMap;mr=new WeakMap;xs=new WeakMap;Rs=new WeakSet;Qd=function(i){let{key:e}=i;e==="Enter"||e===" "?this.handleSelection(i,this.hasAttribute("aria-multiselectable")&&this.getAttribute("aria-multiselectable")==="true"):this.handleMovement(i)};oa=new WeakMap;zd=new WeakMap;Ds=new WeakSet;Xd=function(){var i;let e=this.shadowRoot.querySelector("#layout-row"),t=((i=getComputedStyle(this).getPropertyValue("--media-listbox-layout"))==null?void 0:i.trim())==="row";e.setAttribute("media",t?"":"width:0")};hr=new WeakSet;Os=function(i){let e=i.composedPath(),t=e.findIndex(a=>a.nodeName==="MEDIA-CHROME-OPTION");return e[t]};Ps=new WeakSet;Jd=function(i,e){let t=[...this.selectedOptions];(!this.hasAttribute("aria-multiselectable")||this.getAttribute("aria-multiselectable")!=="true")&&this.options.forEach(a=>a.selected=!1),e?i.selected=!i.selected:i.selected=!0,this.selectedOptions.some((a,r)=>a!=t[r])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};jd=new WeakSet;Jh=function(i){Ye(this,tu,jh).call(this);let e=this.options,t=e.findIndex(c=>c.getAttribute("tabindex")==="0");Ge(this,Yt,de(this,Yt)+i);let a=de(this,Yt).split("").every(c=>c===i),r=e.slice(t+(a?1:0)).filter(c=>c.textContent.toLowerCase().startsWith(de(this,Yt))),n=e.slice(0,t-(a?1:0)).filter(c=>c.textContent.toLowerCase().startsWith(de(this,Yt))),o=[],d=[];return a&&(o=e.slice(t+(a?1:0)).filter(c=>c.textContent.startsWith(i)),d=e.slice(0,t-(a?1:0)).filter(c=>c.textContent.startsWith(i))),[...r,...n,...o,...d][0]};tu=new WeakSet;jh=function(){clearTimeout(de(this,la)),Ge(this,la,null),Ge(this,la,setTimeout(()=>{Ge(this,Yt,""),Ge(this,la,null)},500))};l.customElements.get("media-chrome-listbox")||l.customElements.define("media-chrome-listbox",Re);var ou=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ru=(i,e,t)=>(ou(i,e,"read from private field"),t?t.call(i):e.get(i)),iu=(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)},au=(i,e,t,a)=>(ou(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),tp=(i,e,t)=>(ou(i,e,"access private method"),t),Ns,da,Us,nu,ip=m.createElement("template");ip.innerHTML=`
|
|
936
1462
|
<style>
|
|
937
1463
|
:host {
|
|
938
1464
|
cursor: pointer;
|
|
@@ -970,7 +1496,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
|
|
|
970
1496
|
}
|
|
971
1497
|
</style>
|
|
972
1498
|
<slot></slot>
|
|
973
|
-
`;var
|
|
1499
|
+
`;var Gt={VALUE:"value",SELECTED:"selected",DISABLED:"disabled"},Bs=class extends l.HTMLElement{constructor(){super(),iu(this,Us),iu(this,Ns,!1),iu(this,da,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(ip.content.cloneNode(!0)))}static get observedAttributes(){return[Gt.DISABLED,Gt.SELECTED,Gt.VALUE]}get value(){var e;return(e=this.getAttribute(Gt.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Gt.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get selected(){return this.getAttribute("aria-selected")==="true"}set selected(e){au(this,Ns,!0),this.setAttribute("aria-selected",e?"true":"false"),e?this.part.add("option-selected"):this.part.remove("option-selected")}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex",-1),this.hasAttribute("aria-selected")||this.setAttribute("aria-selected","false")}disable(){this.removeAttribute("tabindex")}attributeChangedCallback(e,t,a){e===Gt.SELECTED&&!ru(this,Ns)?this.setAttribute("aria-selected",a!=null?"true":"false"):e===Gt.DISABLED&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Gt.DISABLED)||this.enable(),this.setAttribute("role","option"),au(this,da,su(this,this.parentNode)),tp(this,Us,nu).call(this)}disconnectedCallback(){this.disable(),tp(this,Us,nu).call(this),au(this,da,null)}handleClick(){}};Ns=new WeakMap;da=new WeakMap;Us=new WeakSet;nu=function(){var i;let e=(i=ru(this,da))==null?void 0:i.options;if(!e)return;let t=e.filter(a=>a.getAttribute("aria-selected")==="true").pop();t||(t=e[0]),ru(this,da).getAttribute("aria-multiselectable")!=="true"&&e.forEach(a=>{a.setAttribute("tabindex","-1"),a.setAttribute("aria-selected","false")}),t==null||t.setAttribute("tabindex","0"),t==null||t.setAttribute("aria-selected","true")};function su(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?su(i,t):e!=null&&e.options?e:su(e,e==null?void 0:e.parentNode)}l.customElements.get("media-chrome-option")||l.customElements.define("media-chrome-option",Bs);var du=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},g=(i,e,t)=>(du(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)},ft=(i,e,t,a)=>(du(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ai=(i,e,t)=>(du(i,e,"access private method"),t),bt,he,pr,J,Ze,ua,Ws,Hs,$s,Fs,Vs,lu,uu,ap,ca,vr,yi,rp=m.createElement("template");rp.innerHTML=`
|
|
974
1500
|
<style>
|
|
975
1501
|
:host {
|
|
976
1502
|
font: var(--media-font,
|
|
@@ -1021,22 +1547,22 @@ svg, img, ::slotted(svg), ::slotted(img) {
|
|
|
1021
1547
|
<slot></slot>
|
|
1022
1548
|
</media-chrome-listbox>
|
|
1023
1549
|
</slot>
|
|
1024
|
-
`;var
|
|
1550
|
+
`;var De=class extends l.HTMLElement{constructor(){var e;super(),Ee(this,Vs),Ee(this,uu),Ee(this,ca),Ee(this,bt,void 0),Ee(this,he,void 0),Ee(this,pr,void 0),Ee(this,J,void 0),Ee(this,Ze,void 0),Ee(this,ua,t=>{let{key:a}=t;if(!this.keysUsed.includes(a)){this.removeEventListener("keyup",g(this,ua));return}t.composedPath().includes(g(this,he))&&(a==="Enter"||a===" ")?Ai(this,Vs,lu).call(this):a==="Escape"&&Ai(this,ca,vr).call(this)}),Ee(this,Ws,t=>{let{metaKey:a,altKey:r,key:n}=t;if(a||r||!this.keysUsed.includes(n)){this.removeEventListener("keyup",g(this,ua));return}t.preventDefault(),this.addEventListener("keyup",g(this,ua),{once:!0})}),Ee(this,Hs,t=>{t.composedPath().includes(this)||Ai(this,ca,vr).call(this)}),Ee(this,$s,t=>{t.composedPath().includes(g(this,he))&&Ai(this,Vs,lu).call(this)}),Ee(this,Fs,()=>{Ai(this,ca,vr).call(this)}),Ee(this,yi,()=>{if(g(this,J).offsetWidth===0)return;let t=g(this,J).offsetWidth,a=g(this,he).getBoundingClientRect();if(this.hasAttribute("mediacontroller")||g(this,he).hasAttribute("mediacontroller")||g(this,J).hasAttribute("mediacontroller")){g(this,J).style.zIndex="1",g(this,J).style.bottom="unset",g(this,J).style.right=null,g(this,J).style.left="0",g(this,J).style.top=`${a.height}px`;return}let n=fr(this).getBoundingClientRect(),o=a.x+t,d=Math.max(a.right-o,a.right-n.right);g(this,J).style.left=null,g(this,J).style.right=`${d}px`,g(this,J).style.maxHeight=`${n.height-a.height}px`}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(rp.content.cloneNode(!0))),(e=this.init)==null||e.call(this),ft(this,he,this.shadowRoot.querySelector("[part=button]")),ft(this,J,this.shadowRoot.querySelector("[part=listbox]")),ft(this,pr,this.shadowRoot.querySelector("slot[name=button]")),g(this,pr).addEventListener("slotchange",()=>{let t=g(this,pr).assignedElements()[0];if(!t)return;ft(this,he,t),g(this,he).preventClick=!0,this.hasAttribute("disabled")||g(this,he).hasAttribute("disabled")?this.disable():(this.enable(),g(this,he).setAttribute("aria-haspopup","listbox"))}),ft(this,Ze,this.shadowRoot.querySelector("slot[name=listbox]")),g(this,Ze).addEventListener("slotchange",()=>{ft(this,J,g(this,Ze).assignedElements()[0]||g(this,J))})}static get observedAttributes(){return["disabled",y.MEDIA_CONTROLLER]}enable(){g(this,he).toggleAttribute("disabled",!1),this.addEventListener("change",g(this,Fs)),this.addEventListener("keydown",g(this,Ws)),this.addEventListener("click",g(this,$s)),m.addEventListener("click",g(this,Hs))}disable(){g(this,he).toggleAttribute("disabled",!0),this.removeEventListener("change",g(this,Fs)),this.removeEventListener("keydown",g(this,Ws)),this.removeEventListener("keyup",g(this,ua)),this.removeEventListener("click",g(this,$s)),m.removeEventListener("click",g(this,Hs))}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===y.MEDIA_CONTROLLER?(t&&((n=(r=g(this,bt))==null?void 0:r.unassociateElement)==null||n.call(r,this),ft(this,bt,null),g(this,J).removeAttribute(y.MEDIA_CONTROLLER)),a&&this.isConnected&&(ft(this,bt,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=g(this,bt))==null?void 0:d.associateElement)==null||u.call(d,this),g(this,J).setAttribute(y.MEDIA_CONTROLLER,a))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;let{style:r}=P(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(y.MEDIA_CONTROLLER);n&&(ft(this,bt,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=g(this,bt))==null?void 0:t.associateElement)==null||a.call(t,this),g(this,J).setAttribute(y.MEDIA_CONTROLLER,n)),this.hasAttribute("disabled")||this.enable(),g(this,Ze).hidden||Le(fr(this),g(this,yi))}disconnectedCallback(){var e,t;Xe(fr(this),g(this,yi)),this.disable(),(t=(e=g(this,bt))==null?void 0:e.unassociateElement)==null||t.call(e,this),ft(this,bt,null),g(this,J).removeAttribute(y.MEDIA_CONTROLLER)}get keysUsed(){return["Enter","Escape"," ","ArrowUp","ArrowDown","f","c","k","m"]}};bt=new WeakMap;he=new WeakMap;pr=new WeakMap;J=new WeakMap;Ze=new WeakMap;ua=new WeakMap;Ws=new WeakMap;Hs=new WeakMap;$s=new WeakMap;Fs=new WeakMap;Vs=new WeakSet;lu=function(){g(this,Ze).hidden?Ai(this,uu,ap).call(this):Ai(this,ca,vr).call(this)};uu=new WeakSet;ap=function(){g(this,Ze).hidden&&(g(this,Ze).hidden=!1,g(this,he).setAttribute("aria-expanded","true"),g(this,yi).call(this),g(this,J).focus(),Le(fr(this),g(this,yi)))};ca=new WeakSet;vr=function(){if(g(this,Ze).hidden)return;Xe(fr(this),g(this,yi));let i=ai();g(this,Ze).hidden=!0,g(this,he).setAttribute("aria-expanded","false"),ue(g(this,J),i)&&g(this,he).focus()};yi=new WeakMap;function fr(i){var e;return(e=i.getAttribute("bounds")?Be(i,`#${i.getAttribute("bounds")}`):Mb(i)||i.parentElement)!=null?e:i}function Mb(i){var e;let t=i.getAttribute(y.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):Be(i,"media-controller")}l.customElements.get("media-chrome-selectmenu")||l.customElements.define("media-chrome-selectmenu",De);var vu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},wb=(i,e,t)=>(vu(i,e,"read from private field"),t?t.call(i):e.get(i)),cu=(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)},xb=(i,e,t,a)=>(vu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),mu=(i,e,t)=>(vu(i,e,"access private method"),t),Ys,hu,op,Ks,pu,Rb=`
|
|
1025
1551
|
<svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
|
|
1026
1552
|
<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"/>
|
|
1027
|
-
</svg>`,
|
|
1028
|
-
<slot name="captions-indicator" hidden>${
|
|
1029
|
-
`;var
|
|
1553
|
+
</svg>`,lp=m.createElement("template");lp.innerHTML=`
|
|
1554
|
+
<slot name="captions-indicator" hidden>${Rb}</slot>
|
|
1555
|
+
`;var Gs=class extends Re{constructor(){super({slotTemplate:lp}),cu(this,hu),cu(this,Ks),cu(this,Ys,void 0)}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_SUBTITLES_LIST&&t!==a?mu(this,hu,op).call(this):e===s.MEDIA_SUBTITLES_SHOWING&&t!==a?this.value=a: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.textTracks API."))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",mu(this,Ks,pu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",mu(this,Ks,pu))}get mediaSubtitlesList(){return np(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){sp(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return np(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){sp(this,s.MEDIA_SUBTITLES_SHOWING,e)}};Ys=new WeakMap;hu=new WeakSet;op=function(){var i;if(wb(this,Ys)===JSON.stringify(this.mediaSubtitlesList))return;xb(this,Ys,JSON.stringify(this.mediaSubtitlesList));let e=this.shadowRoot.querySelector("#container");e.textContent="";let t=!this.value,a=vt(this.formatOptionText("Off"),"off",t);a.prepend(qe(this,"select-indicator")),e.append(a);let r=this.mediaSubtitlesList;for(let n of r){let o=vt(this.formatOptionText(n.label,n),oi(n),this.value==oi(n));o.prepend(qe(this,"select-indicator")),((i=n.kind)!=null?i:"subs")==="captions"&&o.append(qe(this,"captions-indicator")),e.append(o)}};Ks=new WeakSet;pu=function(){let i=this.mediaSubtitlesShowing,e=this.getAttribute(s.MEDIA_SUBTITLES_SHOWING),t=this.value!==e;if(i!=null&&i.length&&t&&this.dispatchEvent(new l.CustomEvent(h.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let a=new l.CustomEvent(h.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(a)};var np=(i,e)=>{let t=i.getAttribute(e);return t?kt(t):[]},sp=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=He(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};l.customElements.get("media-captions-listbox")||l.customElements.define("media-captions-listbox",Gs);var qs=class extends De{init(){let e=m.createElement("media-captions-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-captions-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-captions-selectmenu")||l.customElements.define("media-captions-selectmenu",qs);var dp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Zs=(i,e,t)=>(dp(i,e,"read from private field"),t?t.call(i):e.get(i)),fu=(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)},br=(i,e,t)=>(dp(i,e,"access private method"),t),ma,Er,Qs,zs,Eu,bu={RATES:"rates"},Xs=class extends Re{constructor(){super(),fu(this,Er),fu(this,zs),fu(this,ma,new Me(this,bu.RATES,{defaultValue:tr})),br(this,Er,Qs).call(this)}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",s.MEDIA_PLAYBACK_RATE,bu.RATES]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_PLAYBACK_RATE&&t!=a?this.value=a:e===bu.RATES&&t!=a&&(Zs(this,ma).value=a,br(this,Er,Qs).call(this))}get rates(){return Zs(this,ma)}set rates(e){e?Array.isArray(e)&&(Zs(this,ma).value=e.join(" ")):Zs(this,ma).value="",br(this,Er,Qs).call(this)}get mediaPlaybackRate(){return x(this,s.MEDIA_PLAYBACK_RATE,Kt)}set mediaPlaybackRate(e){N(this,s.MEDIA_PLAYBACK_RATE,e)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",br(this,zs,Eu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",br(this,zs,Eu))}};ma=new WeakMap;Er=new WeakSet;Qs=function(){let i=this.shadowRoot.querySelector("#container");i.textContent="";for(let e of this.rates){let t=vt(this.formatOptionText(`${e}x`,e),e,this.mediaPlaybackRate==e);t.prepend(qe(this,"select-indicator")),i.append(t)}};zs=new WeakSet;Eu=function(){if(!this.value)return;let i=new l.CustomEvent(h.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-playback-rate-listbox")||l.customElements.define("media-playback-rate-listbox",Xs);var Js=class extends De{init(){let e=m.createElement("media-playback-rate-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-playback-rate-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-playback-rate-selectmenu")||l.customElements.define("media-playback-rate-selectmenu",Js);var yu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},up=(i,e,t)=>(yu(i,e,"read from private field"),t?t.call(i):e.get(i)),js=(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)},gu=(i,e,t,a)=>(yu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),eo=(i,e,t)=>(yu(i,e,"access private method"),t),gr,ao,to,_u,io,Au,ro=class extends Re{constructor(){super(...arguments),js(this,to),js(this,io),js(this,gr,[]),js(this,ao,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_LIST,s.MEDIA_RENDITION_SELECTED]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_RENDITION_SELECTED&&t!==a?this.value=a!=null?a:"auto":e===s.MEDIA_RENDITION_LIST&&t!==a&&(gu(this,gr,Hr(a)),eo(this,to,_u).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",eo(this,io,Au))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",eo(this,io,Au))}get mediaRenditionList(){return up(this,gr)}set mediaRenditionList(e){gu(this,gr,e),eo(this,to,_u).call(this)}get mediaRenditionSelected(){return I(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){k(this,s.MEDIA_RENDITION_SELECTED,e)}};gr=new WeakMap;ao=new WeakMap;to=new WeakSet;_u=function(){if(up(this,ao)===JSON.stringify(this.mediaRenditionList))return;gu(this,ao,JSON.stringify(this.mediaRenditionList));let i=this.mediaRenditionList.sort((r,n)=>n.height-r.height),e=this.shadowRoot.querySelector("#container");e.textContent="";let t=!this.mediaRenditionSelected;for(let r of i){let n=this.formatOptionText(`${Math.min(r.width,r.height)}p`,r),o=vt(n,`${r.id}`,r.selected&&!t);o.prepend(qe(this,"select-indicator")),e.append(o)}let a=vt(this.formatOptionText("Auto"),"auto",t);a.prepend(qe(this,"select-indicator")),e.append(a)};io=new WeakSet;Au=function(){if(this.value==null)return;let i=new l.CustomEvent(h.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-rendition-listbox")||l.customElements.define("media-rendition-listbox",ro);var Db=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1030
1556
|
<path d="M13.5 2.5h2v6h-2v-2h-11v-2h11v-2Zm4 2h4v2h-4v-2Zm-12 4h2v6h-2v-2h-3v-2h3v-2Zm4 2h12v2h-12v-2Zm1 4h2v6h-2v-2h-8v-2h8v-2Zm4 2h7v2h-7v-2Z" />
|
|
1031
|
-
</svg>`,
|
|
1032
|
-
<slot name="icon">${
|
|
1033
|
-
`;var
|
|
1557
|
+
</svg>`,cp=m.createElement("template");cp.innerHTML=`
|
|
1558
|
+
<slot name="icon">${Db}</slot>
|
|
1559
|
+
`;var Tu=class extends O{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_SELECTED,s.MEDIA_RENDITION_UNAVAILABLE]}constructor(){super({slotTemplate:cp})}get mediaRenditionSelected(){return I(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){k(this,s.MEDIA_RENDITION_SELECTED,e)}};l.customElements.get("media-rendition-button")||l.customElements.define("media-rendition-button",Tu);var no=class extends De{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_SELECTED,s.MEDIA_RENDITION_UNAVAILABLE]}init(){let e=m.createElement("media-rendition-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-rendition-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-rendition-selectmenu")||l.customElements.define("media-rendition-selectmenu",no);var Cu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},mp=(i,e,t)=>(Cu(i,e,"read from private field"),t?t.call(i):e.get(i)),so=(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)},ku=(i,e,t,a)=>(Cu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),oo=(i,e,t)=>(Cu(i,e,"access private method"),t),_r,co,lo,Su,uo,Iu,mo=class extends Re{constructor(){super(...arguments),so(this,lo),so(this,uo),so(this,_r,[]),so(this,co,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_LIST,s.MEDIA_AUDIO_TRACK_ENABLED]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_AUDIO_TRACK_ENABLED&&t!==a?this.value=a:e===s.MEDIA_AUDIO_TRACK_LIST&&t!==a&&(ku(this,_r,$r(a)),oo(this,lo,Su).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",oo(this,uo,Iu))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",oo(this,uo,Iu))}get mediaAudioTrackList(){return mp(this,_r)}set mediaAudioTrackList(e){ku(this,_r,e),oo(this,lo,Su).call(this)}get mediaAudioTrackEnabled(){return I(this,s.MEDIA_AUDIO_TRACK_ENABLED)}set mediaAudioTrackEnabled(e){k(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};_r=new WeakMap;co=new WeakMap;lo=new WeakSet;Su=function(){if(mp(this,co)===JSON.stringify(this.mediaAudioTrackList))return;ku(this,co,JSON.stringify(this.mediaAudioTrackList));let i=this.mediaAudioTrackList,e=this.shadowRoot.querySelector("#container");e.textContent="";for(let t of i){let a=this.formatOptionText(t.label,t),r=vt(a,`${t.id}`,t.enabled);r.prepend(qe(this,"select-indicator")),e.append(r)}};uo=new WeakSet;Iu=function(){if(this.value==null)return;let i=new l.CustomEvent(h.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-audio-track-listbox")||l.customElements.define("media-audio-track-listbox",mo);var Ob=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1034
1560
|
<path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
|
|
1035
1561
|
<path d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-2 0a8 8 0 1 0-16 0 8 8 0 0 0 16 0Z"/>
|
|
1036
|
-
</svg>`,
|
|
1037
|
-
<slot name="icon">${
|
|
1038
|
-
`;var
|
|
1039
|
-
${a}${i.file}`}ct(e)}var z={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Nt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},su=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}}),wm=lu.VideoEvents.filter(i=>i!=="error"),xm=Object.values(z).filter(i=>![z.PLAYSINLINE].includes(i)),Dm=Object.values(Nt);function du(i){i.querySelectorAll(":scope > track").forEach(e=>{var t;(t=i.media)==null||t.append(e.cloneNode())}),wm.forEach(e=>{var t;(t=i.media)==null||t.addEventListener(e,a=>{i.dispatchEvent(new Event(a.type))})})}var fs=class extends U.HTMLElement{static get observedAttributes(){return[...xm,...Dm]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var r;(r=this.media)==null||r.append(a.cloneNode())});let e=a=>{for(let r of a)r.type==="childList"&&(r.removedNodes.forEach(n=>{var d,u;let s=(d=this.media)==null?void 0:d.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 Nt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Nt.VOLUME:{let s=(r=$e(a))!=null?r:1;this.media&&(this.media.volume=s);return}case Nt.PLAYBACKRATE:{let s=(n=$e(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 audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e,t;return(t=(e=this.media)==null?void 0:e.buffered)!=null?t:su}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:su}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=$e(this.getAttribute(Nt.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Nt.PLAYBACKRATE,`${e}`):this.removeAttribute(Nt.PLAYBACKRATE)}get crossOrigin(){return ea(this,z.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(z.CROSSORIGIN,`${e}`)}get autoplay(){return ea(this,z.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(z.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(z.AUTOPLAY)}get loop(){return ea(this,z.LOOP)!=null}set loop(e){e?this.setAttribute(z.LOOP,""):this.removeAttribute(z.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=!!e)}get defaultMuted(){return ea(this,z.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(z.MUTED,""):this.removeAttribute(z.MUTED)}get playsInline(){return ea(this,z.PLAYSINLINE)!=null}set playsInline(e){Ee("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(z.PRELOAD,e):this.removeAttribute(z.PRELOAD)}};function ea(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var vs=fs;var Om=Object.defineProperty,Nm=(i,e,t)=>e in i?Om(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Um=(i,e,t)=>(Nm(i,typeof e!="symbol"?e+"":e,t),t),pu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_=(i,e,t)=>(pu(i,e,"read from private field"),t?t.call(i):e.get(i)),We=(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)=>(pu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),gi,sn,Ut,ta,mt,ht,pt,Pt,Ai,ln,ke,uu=1,cu=0,Pm=1,Bm={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 j&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof j?r.element[r.attributeName]=n:r.value=n}}}},qe=class extends l.DocumentFragment{constructor(e,t,a=Bm){var r;super(),We(this,gi,void 0),We(this,sn,void 0),this.append(e.content.cloneNode(!0)),Ze(this,gi,bu(this)),Ze(this,sn,a),(r=a.createCallback)==null||r.call(a,this,_(this,gi),t),a.processCallback(this,_(this,gi),t)}update(e){_(this,sn).processCallback(this,_(this,gi),e)}};gi=new WeakMap;sn=new WeakMap;var bu=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new gs;for([t,a]of hu(r.value))if(!t)n.append(a);else{let s=new j(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===uu&&!(r instanceof HTMLTemplateElement))bu(r,e);else if(r.nodeType===uu||r.data.includes("{{")){let n=[];if(r.data)for([t,a]of hu(r.data))if(!t)n.push(new Text(a));else{let s=new Qe(i);n.push(s),e.push([a,s])}else if(r instanceof HTMLTemplateElement){let s=new ia(i,r);n.push(s),e.push([s.expression,s])}r.replaceWith(...n.flatMap(s=>s.replacementNodes||[s]))}return e},mu={},hu=i=>{let e="",t=0,a=mu[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([cu,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([Pm,e.trim()]),e="",r++):e+=n||"";return e&&a.push([cu,(t>0?"{{":"")+e]),mu[i]=a},Vm=11,dn=class{get value(){return""}set value(e){}toString(){return this.value}},Eu=new WeakMap,gs=class{constructor(){We(this,Ut,[])}[Symbol.iterator](){return _(this,Ut).values()}get length(){return _(this,Ut).length}item(e){return _(this,Ut)[e]}append(...e){for(let t of e)t instanceof j&&Eu.set(t,this),_(this,Ut).push(t)}toString(){return _(this,Ut).join("")}};Ut=new WeakMap;var j=class extends dn{constructor(e,t,a){super(),We(this,Pt),We(this,ta,""),We(this,mt,void 0),We(this,ht,void 0),We(this,pt,void 0),Ze(this,mt,e),Ze(this,ht,t),Ze(this,pt,a)}get attributeName(){return _(this,ht)}get attributeNamespace(){return _(this,pt)}get element(){return _(this,mt)}get value(){return _(this,ta)}set value(e){_(this,ta)!==e&&(Ze(this,ta,e),!_(this,Pt,Ai)||_(this,Pt,Ai).length===1?e==null?_(this,mt).removeAttributeNS(_(this,pt),_(this,ht)):_(this,mt).setAttributeNS(_(this,pt),_(this,ht),e):_(this,mt).setAttributeNS(_(this,pt),_(this,ht),_(this,Pt,Ai)))}get booleanValue(){return _(this,mt).hasAttributeNS(_(this,pt),_(this,ht))}set booleanValue(e){if(!_(this,Pt,Ai)||_(this,Pt,Ai).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};ta=new WeakMap;mt=new WeakMap;ht=new WeakMap;pt=new WeakMap;Pt=new WeakSet;Ai=function(){return Eu.get(this)};var Qe=class extends dn{constructor(e,t){super(),We(this,ln,void 0),We(this,ke,void 0),Ze(this,ln,e),Ze(this,ke,t?[...t]:[new Text])}get replacementNodes(){return _(this,ke)}get parentNode(){return _(this,ln)}get nextSibling(){return _(this,ke)[_(this,ke).length-1].nextSibling}get previousSibling(){return _(this,ke)[0].previousSibling}get value(){return _(this,ke).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===Vm?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),Ze(this,ke,Hm(_(this,ke)[0].parentNode,_(this,ke),t,this.nextSibling))}};ln=new WeakMap;ke=new WeakMap;var ia=class extends Qe{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),Um(this,"directive"),this.expression=r,this.template=t,this.directive=a}};function Hm(i,e,t,a=null){let r=0,n,s,d,u=t.length,h=e.length;for(;r<u&&r<h&&e[r]==t[r];)r++;for(;r<u&&r<h&&t[u-1]==e[h-1];)a=t[--h,--u];if(r==h)for(;r<u;)i.insertBefore(t[r++],a);if(r==u)for(;r<h;)i.removeChild(e[r++]);else{for(n=e[r];r<u;)d=t[r++],s=n?n.nextSibling:a,n==d?n=s:r<u&&t[r]==s?(i.replaceChild(d,n),n=s):i.insertBefore(d,n);for(;n!=a;)s=n.nextSibling,i.removeChild(n),n=s}return t}var fu={string:i=>String(i)},cn=class{constructor(e){this.template=e,this.state=void 0}},Bt=new WeakMap,Vt=new WeakMap,As={partial:(i,e)=>{e[i.expression]=new cn(i.template)},if:(i,e)=>{var t;if(gu(i.expression,e))if(Bt.get(i)!==i.template){Bt.set(i,i.template);let a=new qe(i.template,e,mn);i.replace(a),Vt.set(i,a)}else(t=Vt.get(i))==null||t.update(e);else i.replace(""),Bt.delete(i),Vt.delete(i)}},$m=Object.keys(As),mn={processCallback(i,e,t){var a,r;if(t)for(let[n,s]of e){if(s instanceof ia){if(!s.directive){let u=$m.find(h=>s.template.hasAttribute(h));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=As[s.directive])==null||a.call(As,s,t);continue}let d=gu(n,t);if(d instanceof cn){Bt.get(s)!==d.template?(Bt.set(s,d.template),d=new qe(d.template,d.state,mn),s.value=d,Vt.set(s,d)):(r=Vt.get(s))==null||r.update(d.state);continue}d?(s instanceof j&&s.attributeName.startsWith("aria-")&&(d=String(d)),s instanceof j?typeof d=="boolean"?s.booleanValue=d:typeof d=="function"?s.element[s.attributeName]=d:s.value=d:(s.value=d,Bt.delete(s),Vt.delete(s))):s instanceof j?s.value=void 0:(s.value=void 0,Bt.delete(s),Vt.delete(s))}}},vu={"!":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=fu[e])==null?void 0:t.call(fu,i)}};function Wm(i){return Fm(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function gu(i,e={}){var t,a,r,n,s,d,u;let h=Wm(i);if(h.length===0||h.some(({type:m})=>!m))return aa(i);if(((t=h[0])==null?void 0:t.token)===">"){let m=e[(a=h[1])==null?void 0:a.token];if(!m)return aa(i);let b={...e};m.state=b;let E=h.slice(2);for(let I=0;I<E.length;I+=3){let H=(r=E[I])==null?void 0:r.token,k=(n=E[I+1])==null?void 0:n.token,$=(s=E[I+2])==null?void 0:s.token;H&&k==="="&&(b[H]=ra($,e))}return m}if(h.length===1)return un(h[0])?ra(h[0].token,e):aa(i);if(h.length===2){let m=(d=h[0])==null?void 0:d.token,b=vu[m];if(!b||!un(h[1]))return aa(i);let E=ra(h[1].token,e);return b(E)}if(h.length===3){let m=(u=h[1])==null?void 0:u.token,b=vu[m];if(!b||!un(h[0])||!un(h[2]))return aa(i);let E=ra(h[0].token,e);if(m==="|")return b(E,h[2].token);let I=ra(h[2].token,e);return b(E,I)}}function aa(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function un({type:i}){return["number","boolean","string","param"].includes(i)}function ra(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):va(i)?parseFloat(i):e[i]}function Fm(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 Km=Object.defineProperty,Ym=(i,e,t)=>e in i?Km(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,oa=(i,e,t)=>(Ym(i,typeof e!="symbol"?e+"":e,t),t),Ss=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ts=(i,e,t)=>(Ss(i,e,"read from private field"),t?t.call(i):e.get(i)),na=(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)=>(Ss(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),_s=(i,e,t)=>(Ss(i,e,"access private method"),t),_i,hn,yi,Is,Au,pn,ks,ys={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},_u=c.createElement("template");_u.innerHTML=`
|
|
1562
|
+
</svg>`,hp=m.createElement("template");hp.innerHTML=`
|
|
1563
|
+
<slot name="icon">${Ob}</slot>
|
|
1564
|
+
`;var Lu=class extends O{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}constructor(){super({slotTemplate:hp})}get mediaAudioTrackEnabled(){return I(this,s.MEDIA_AUDIO_TRACK_ENABLED)}set mediaAudioTrackEnabled(e){k(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};l.customElements.get("media-audio-track-button")||l.customElements.define("media-audio-track-button",Lu);var ho=class extends De{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}init(){let e=m.createElement("media-audio-track-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-audio-track-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-audio-track-selectmenu")||l.customElements.define("media-audio-track-selectmenu",ho);var A=fv(require("@mux/mux-video")),z=require("@mux/playback-core");var Tp=require("@mux/mux-video");var Pb="en",Ti={code:Pb};var pp="en";function C(i,e=!0){var r,n;let t=e&&(n=(r=Ti)==null?void 0:r[i])!=null?n:i,a=e?Ti.code:pp;return new Mu(t,a)}var Mu=class{constructor(e,t=(a=>(a=Ti.code)!=null?a:pp)()){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 vp(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${po(t)}: ${a}; `)}),e?e.trim():void 0}function po(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function vo(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Et(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function wu(i){let e=Nb(i).toString();return e?"?"+e:""}function Nb(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}function qt(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 xu=(i,e)=>!i||!e?!1:i.contains(e)?!0:xu(i,e.getRootNode().host);var fo=require("@mux/playback-core");var fp="mux.com",Ub=()=>{try{return"2.3.3"}catch{}return"UNKNOWN"},Bb=Ub(),Eo=()=>Bb,bp=(i,{token:e,customDomain:t=fp,thumbnailTime:a}={})=>{let r=e==null?a:void 0,{aud:n}=qt(e);if(!(e&&n!=="t"))return`https://image.${t}/${i}/thumbnail.webp${wu({token:e,time:r})}`},Ep=(i,{token:e,customDomain:t=fp}={})=>{let{aud:a}=qt(e);if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${wu({token:e,format:"webp"})}`},Ar=i=>{if(i){if([fo.StreamTypes.LIVE,fo.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return fo.StreamTypes.LIVE}};var Wb={crossorigin:"crossOrigin",playsinline:"playsInline"};function gp(i){var e;return(e=Wb[i])!=null?e:vo(i)}var ki,Si,ve,bo=class{constructor(e,t){ee(this,ki,void 0);ee(this,Si,void 0);ee(this,ve,[]);Ce(this,ki,e),Ce(this,Si,t)}[Symbol.iterator](){return D(this,ve).values()}get length(){return D(this,ve).length}get value(){var e;return(e=D(this,ve).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Ce(this,ve,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return D(this,ve)[e]}values(){return D(this,ve).values()}keys(){return D(this,ve).keys()}forEach(e){D(this,ve).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||D(this,ve).push(r)}),!(this.value===""&&!((t=D(this,ki))!=null&&t.hasAttribute(`${D(this,Si)}`)))&&((a=D(this,ki))==null||a.setAttribute(`${D(this,Si)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{D(this,ve).splice(D(this,ve).indexOf(a),1)}),(t=D(this,ki))==null||t.setAttribute(`${D(this,Si)}`,`${this.value}`)}contains(e){return D(this,ve).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)}};ki=new WeakMap,Si=new WeakMap,ve=new WeakMap;var _p=`[mux-player ${Eo()}]`;function Zt(...i){console.warn(_p,...i)}function Oe(...i){console.error(_p,...i)}function Ru(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+=` ${C("Read more: ")}
|
|
1565
|
+
${a}${i.file}`}Zt(e)}var pe={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Ii={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},yp=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}}),Hb=Tp.VideoEvents.filter(i=>i!=="error"),$b=Object.values(pe).filter(i=>![pe.PLAYSINLINE].includes(i)),Fb=Object.values(Ii);function kp(i){i.querySelectorAll(":scope > track").forEach(e=>{var t;(t=i.media)==null||t.append(e.cloneNode())}),Hb.forEach(e=>{var t;(t=i.media)==null||t.addEventListener(e,a=>{i.dispatchEvent(new Event(a.type))})})}var Du=class extends Z.HTMLElement{static get observedAttributes(){return[...$b,...Fb]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var r;(r=this.media)==null||r.append(a.cloneNode())});let e=a=>{for(let r of a)r.type==="childList"&&(r.removedNodes.forEach(n=>{var d,u;let o=(d=this.media)==null?void 0:d.querySelector(`track[src="${n.src}"]`);o&&((u=this.media)==null||u.removeChild(o))}),r.addedNodes.forEach(n=>{var o;(o=this.media)==null||o.append(n.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,a){var r,n;switch(e){case Ii.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Ii.VOLUME:{let o=(r=Et(a))!=null?r:1;this.media&&(this.media.volume=o);return}case Ii.PLAYBACKRATE:{let o=(n=Et(a))!=null?n:1;this.media&&(this.media.playbackRate=o,this.media.defaultPlaybackRate=o);return}}}play(){var e,t;return(t=(e=this.media)==null?void 0:e.play())!=null?t:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e,t;return(t=(e=this.media)==null?void 0:e.buffered)!=null?t:yp}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:yp}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=Et(this.getAttribute(Ii.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Ii.PLAYBACKRATE,`${e}`):this.removeAttribute(Ii.PLAYBACKRATE)}get crossOrigin(){return yr(this,pe.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(pe.CROSSORIGIN,`${e}`)}get autoplay(){return yr(this,pe.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(pe.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(pe.AUTOPLAY)}get loop(){return yr(this,pe.LOOP)!=null}set loop(e){e?this.setAttribute(pe.LOOP,""):this.removeAttribute(pe.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=!!e)}get defaultMuted(){return yr(this,pe.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(pe.MUTED,""):this.removeAttribute(pe.MUTED)}get playsInline(){return yr(this,pe.PLAYSINLINE)!=null}set playsInline(e){Oe("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(pe.PRELOAD,e):this.removeAttribute(pe.PRELOAD)}};function yr(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var Ou=Du;var Vb=Object.defineProperty,Kb=(i,e,t)=>e in i?Vb(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Yb=(i,e,t)=>(Kb(i,typeof e!="symbol"?e+"":e,t),t),Mp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},S=(i,e,t)=>(Mp(i,e,"read from private field"),t?t.call(i):e.get(i)),gt=(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)},Lt=(i,e,t,a)=>(Mp(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ha,go,Ci,Tr,Qt,zt,Xt,Li,pa,_o,Qe,Sp=1,Ip=0,Gb=1,qb={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 fe&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof fe?r.element[r.attributeName]=n:r.value=n}}}},Mt=class extends l.DocumentFragment{constructor(e,t,a=qb){var r;super(),gt(this,ha,void 0),gt(this,go,void 0),this.append(e.content.cloneNode(!0)),Lt(this,ha,wp(this)),Lt(this,go,a),(r=a.createCallback)==null||r.call(a,this,S(this,ha),t),a.processCallback(this,S(this,ha),t)}update(e){S(this,go).processCallback(this,S(this,ha),e)}};ha=new WeakMap;go=new WeakMap;var wp=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new Pu;for([t,a]of Lp(r.value))if(!t)n.append(a);else{let o=new fe(i,r.name,r.namespaceURI);n.append(o),e.push([a,o])}r.value=n.toString()}for(let r of i.childNodes)if(r.nodeType===Sp&&!(r instanceof HTMLTemplateElement))wp(r,e);else if(r.nodeType===Sp||r.data.includes("{{")){let n=[];if(r.data)for([t,a]of Lp(r.data))if(!t)n.push(new Text(a));else{let o=new wt(i);n.push(o),e.push([a,o])}else if(r instanceof HTMLTemplateElement){let o=new kr(i,r);n.push(o),e.push([o.expression,o])}r.replaceWith(...n.flatMap(o=>o.replacementNodes||[o]))}return e},Cp={},Lp=i=>{let e="",t=0,a=Cp[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([Ip,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([Gb,e.trim()]),e="",r++):e+=n||"";return e&&a.push([Ip,(t>0?"{{":"")+e]),Cp[i]=a},Zb=11,Ao=class{get value(){return""}set value(e){}toString(){return this.value}},xp=new WeakMap,Pu=class{constructor(){gt(this,Ci,[])}[Symbol.iterator](){return S(this,Ci).values()}get length(){return S(this,Ci).length}item(e){return S(this,Ci)[e]}append(...e){for(let t of e)t instanceof fe&&xp.set(t,this),S(this,Ci).push(t)}toString(){return S(this,Ci).join("")}};Ci=new WeakMap;var fe=class extends Ao{constructor(e,t,a){super(),gt(this,Li),gt(this,Tr,""),gt(this,Qt,void 0),gt(this,zt,void 0),gt(this,Xt,void 0),Lt(this,Qt,e),Lt(this,zt,t),Lt(this,Xt,a)}get attributeName(){return S(this,zt)}get attributeNamespace(){return S(this,Xt)}get element(){return S(this,Qt)}get value(){return S(this,Tr)}set value(e){S(this,Tr)!==e&&(Lt(this,Tr,e),!S(this,Li,pa)||S(this,Li,pa).length===1?e==null?S(this,Qt).removeAttributeNS(S(this,Xt),S(this,zt)):S(this,Qt).setAttributeNS(S(this,Xt),S(this,zt),e):S(this,Qt).setAttributeNS(S(this,Xt),S(this,zt),S(this,Li,pa)))}get booleanValue(){return S(this,Qt).hasAttributeNS(S(this,Xt),S(this,zt))}set booleanValue(e){if(!S(this,Li,pa)||S(this,Li,pa).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};Tr=new WeakMap;Qt=new WeakMap;zt=new WeakMap;Xt=new WeakMap;Li=new WeakSet;pa=function(){return xp.get(this)};var wt=class extends Ao{constructor(e,t){super(),gt(this,_o,void 0),gt(this,Qe,void 0),Lt(this,_o,e),Lt(this,Qe,t?[...t]:[new Text])}get replacementNodes(){return S(this,Qe)}get parentNode(){return S(this,_o)}get nextSibling(){return S(this,Qe)[S(this,Qe).length-1].nextSibling}get previousSibling(){return S(this,Qe)[0].previousSibling}get value(){return S(this,Qe).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===Zb?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),Lt(this,Qe,Qb(S(this,Qe)[0].parentNode,S(this,Qe),t,this.nextSibling))}};_o=new WeakMap;Qe=new WeakMap;var kr=class extends wt{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),Yb(this,"directive"),this.expression=r,this.template=t,this.directive=a}};function Qb(i,e,t,a=null){let r=0,n,o,d,u=t.length,c=e.length;for(;r<u&&r<c&&e[r]==t[r];)r++;for(;r<u&&r<c&&t[u-1]==e[c-1];)a=t[--c,--u];if(r==c)for(;r<u;)i.insertBefore(t[r++],a);if(r==u)for(;r<c;)i.removeChild(e[r++]);else{for(n=e[r];r<u;)d=t[r++],o=n?n.nextSibling:a,n==d?n=o:r<u&&t[r]==o?(i.replaceChild(d,n),n=o):i.insertBefore(d,n);for(;n!=a;)o=n.nextSibling,i.removeChild(n),n=o}return t}var Rp={string:i=>String(i)},To=class{constructor(e){this.template=e,this.state=void 0}},Mi=new WeakMap,wi=new WeakMap,Nu={partial:(i,e)=>{e[i.expression]=new To(i.template)},if:(i,e)=>{var t;if(Op(i.expression,e))if(Mi.get(i)!==i.template){Mi.set(i,i.template);let a=new Mt(i.template,e,ko);i.replace(a),wi.set(i,a)}else(t=wi.get(i))==null||t.update(e);else i.replace(""),Mi.delete(i),wi.delete(i)}},zb=Object.keys(Nu),ko={processCallback(i,e,t){var a,r;if(t)for(let[n,o]of e){if(o instanceof kr){if(!o.directive){let u=zb.find(c=>o.template.hasAttribute(c));u&&(o.directive=u,o.expression=o.template.getAttribute(u))}(a=Nu[o.directive])==null||a.call(Nu,o,t);continue}let d=Op(n,t);if(d instanceof To){Mi.get(o)!==d.template?(Mi.set(o,d.template),d=new Mt(d.template,d.state,ko),o.value=d,wi.set(o,d)):(r=wi.get(o))==null||r.update(d.state);continue}d?(o instanceof fe&&o.attributeName.startsWith("aria-")&&(d=String(d)),o instanceof fe?typeof d=="boolean"?o.booleanValue=d:typeof d=="function"?o.element[o.attributeName]=d:o.value=d:(o.value=d,Mi.delete(o),wi.delete(o))):o instanceof fe?o.value=void 0:(o.value=void 0,Mi.delete(o),wi.delete(o))}}},Dp={"!":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=Rp[e])==null?void 0:t.call(Rp,i)}};function Xb(i){return Jb(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function Op(i,e={}){var t,a,r,n,o,d,u;let c=Xb(i);if(c.length===0||c.some(({type:f})=>!f))return Sr(i);if(((t=c[0])==null?void 0:t.token)===">"){let f=e[(a=c[1])==null?void 0:a.token];if(!f)return Sr(i);let E={...e};f.state=E;let v=c.slice(2);for(let b=0;b<v.length;b+=3){let w=(r=v[b])==null?void 0:r.token,_=(n=v[b+1])==null?void 0:n.token,T=(o=v[b+2])==null?void 0:o.token;w&&_==="="&&(E[w]=Ir(T,e))}return f}if(c.length===1)return yo(c[0])?Ir(c[0].token,e):Sr(i);if(c.length===2){let f=(d=c[0])==null?void 0:d.token,E=Dp[f];if(!E||!yo(c[1]))return Sr(i);let v=Ir(c[1].token,e);return E(v)}if(c.length===3){let f=(u=c[1])==null?void 0:u.token,E=Dp[f];if(!E||!yo(c[0])||!yo(c[2]))return Sr(i);let v=Ir(c[0].token,e);if(f==="|")return E(v,c[2].token);let b=Ir(c[2].token,e);return E(v,b)}}function Sr(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function yo({type:i}){return["number","boolean","string","param"].includes(i)}function Ir(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):Fr(i)?parseFloat(i):e[i]}function Jb(i,e){let t,a,r,n=[];for(;i;){r=null,t=i.length;for(let o in e)a=e[o].exec(i),a&&a.index<t&&(r={token:a[0],type:o,matches:a.slice(1)},t=a.index);t&&n.push({token:i.substr(0,t),type:void 0}),r&&n.push(r),i=i.substr(t+(r?r.token.length:0))}return n}var jb=Object.defineProperty,e0=(i,e,t)=>e in i?jb(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Lr=(i,e,t)=>(e0(i,typeof e!="symbol"?e+"":e,t),t),Fu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Wu=(i,e,t)=>(Fu(i,e,"read from private field"),t?t.call(i):e.get(i)),Cr=(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)},xi=(i,e,t,a)=>(Fu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Uu=(i,e,t)=>(Fu(i,e,"access private method"),t),va,So,fa,Hu,Pp,Io,$u,Bu={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Np=m.createElement("template");Np.innerHTML=`
|
|
1040
1566
|
<style>
|
|
1041
1567
|
:host {
|
|
1042
1568
|
display: inline-block;
|
|
@@ -1060,7 +1586,7 @@ ${a}${i.file}`}ct(e)}var z={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"
|
|
|
1060
1586
|
display: none;
|
|
1061
1587
|
}
|
|
1062
1588
|
</style>
|
|
1063
|
-
`;var
|
|
1589
|
+
`;var Jt=class extends l.HTMLElement{constructor(){super(),Cr(this,Hu),Cr(this,Io),Lr(this,"renderRoot"),Lr(this,"renderer"),Cr(this,va,void 0),Cr(this,So,void 0),Cr(this,fa,void 0),this.shadowRoot?this.renderRoot=this.shadowRoot:(this.renderRoot=this.attachShadow({mode:"open"}),this.createRenderer());let e=new MutationObserver(t=>{var a;this.mediaController&&!((a=this.mediaController)!=null&&a.breakpointsComputed)||t.some(r=>{let n=r.target;return n===this?!0:n.localName!=="media-controller"?!1:!!(Bu[r.attributeName]||r.attributeName.startsWith("breakpoint"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.addEventListener(yt.BREAKPOINTS_COMPUTED,this.render),Uu(this,Hu,Pp).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=Wu(this,va))!=null?e:this.constructor.template}set template(e){xi(this,fa,null),xi(this,va,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:o})=>Bu[o]||o.startsWith("breakpoint")),...Array.from(this.attributes)],n={};for(let o of r){let d=(a=Bu[o.name])!=null?a:Tc(o.name),{value:u}=o;u!=null?(Fr(u)&&(u=parseFloat(u)),n[d]=u===""?!0:u):n[d]=!1}return n}attributeChangedCallback(e,t,a){e==="template"&&t!=a&&Uu(this,Io,$u).call(this)}connectedCallback(){Uu(this,Io,$u).call(this)}createRenderer(){this.template&&this.template!==Wu(this,So)&&(xi(this,So,this.template),this.renderer=new Mt(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(Np.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};va=new WeakMap;So=new WeakMap;fa=new WeakMap;Hu=new WeakSet;Pp=function(i){if(Object.prototype.hasOwnProperty.call(this,i)){let e=this[i];delete this[i],this[i]=e}};Io=new WeakSet;$u=function(){var i;let e=this.getAttribute("template");if(!e||e===Wu(this,fa))return;let t=this.getRootNode(),a=(i=t==null?void 0:t.getElementById)==null?void 0:i.call(t,e);if(a){xi(this,fa,e),xi(this,va,a),this.createRenderer();return}t0(e)&&(xi(this,fa,e),i0(e).then(r=>{let n=m.createElement("template");n.innerHTML=r,xi(this,va,n),this.createRenderer()}).catch(console.error))};Lr(Jt,"template");Lr(Jt,"observedAttributes",["template"]);Lr(Jt,"processor",ko);function t0(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 i0(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()}l.customElements.get("media-theme")||l.customElements.define("media-theme",Jt);var Up=`:host {
|
|
1064
1590
|
--media-control-display: var(--controls);
|
|
1065
1591
|
--media-loading-indicator-display: var(--loading-indicator);
|
|
1066
1592
|
--media-dialog-display: var(--dialog);
|
|
@@ -1207,7 +1733,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1207
1733
|
--media-duration-display-display: var(--duration-display, var(--bottom-duration-display));
|
|
1208
1734
|
--media-title-display-display: var(--title-display, var(--bottom-title-display));
|
|
1209
1735
|
}
|
|
1210
|
-
`;var
|
|
1736
|
+
`;var Wp=`
|
|
1211
1737
|
:host {
|
|
1212
1738
|
z-index: 100;
|
|
1213
1739
|
display: var(--media-dialog-display, flex);
|
|
@@ -1259,17 +1785,17 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1259
1785
|
text-align: center;
|
|
1260
1786
|
line-height: 1.4;
|
|
1261
1787
|
}
|
|
1262
|
-
`,
|
|
1788
|
+
`,Hp=ye.createElement("template");Hp.innerHTML=`
|
|
1263
1789
|
<style>
|
|
1264
|
-
${
|
|
1790
|
+
${Wp}
|
|
1265
1791
|
</style>
|
|
1266
1792
|
|
|
1267
1793
|
<div class="dialog">
|
|
1268
1794
|
<slot></slot>
|
|
1269
1795
|
</div>
|
|
1270
|
-
`;var
|
|
1796
|
+
`;var jt=class extends Z.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})),Bp(this)}close(){this.hasAttribute("open")&&(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),r0(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")&&Bp(this)}};jt.styles=Wp,jt.template=Hp,jt.observedAttributes=["open"];function Bp(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=$p(i.shadowRoot)),i._previouslyFocusedElement=ye.activeElement,ye.activeElement instanceof HTMLElement&&ye.activeElement.blur(),i.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function $p(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=$p(r[n].shadowRoot),a));n++);}return a}function r0(i){i._previouslyFocusedElement instanceof HTMLElement&&i._previouslyFocusedElement.focus()}Z.customElements.get("media-dialog")||(Z.customElements.define("media-dialog",jt),Z.MediaDialog=jt);var Vu=jt;var Fp=ye.createElement("template");Fp.innerHTML=`
|
|
1271
1797
|
<style>
|
|
1272
|
-
${
|
|
1798
|
+
${Vu.styles}
|
|
1273
1799
|
|
|
1274
1800
|
.close {
|
|
1275
1801
|
background: none;
|
|
@@ -1298,86 +1824,86 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1298
1824
|
</svg>
|
|
1299
1825
|
</button>
|
|
1300
1826
|
</slot>
|
|
1301
|
-
`;var
|
|
1827
|
+
`;var Mr=class extends Vu{constructor(){var e,t;super(),(t=(e=this.shadowRoot)==null?void 0:e.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};Mr.template=Fp;Z.customElements.get("mxp-dialog")||(Z.customElements.define("mxp-dialog",Mr),Z.MxpDialog=Mr);var wr=new WeakMap,Yu=class i{constructor(e,t){this.element=e;this.type=t;this.element.addEventListener(this.type,this);let a=wr.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=wr.get(this.element);t&&t.delete(this.type)}}static for(e){wr.has(e.element)||wr.set(e.element,new Map);let t=e.attributeName.slice(2),a=wr.get(e.element);return a&&a.has(t)?a.get(t):new i(e.element,t)}};function n0(i,e){return i instanceof fe&&i.attributeName.startsWith("on")?(Yu.for(i).set(e),i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),!0):!1}function s0(i,e){return e instanceof Co&&i instanceof wt?(e.renderInto(i),!0):!1}function o0(i,e){return e instanceof DocumentFragment&&i instanceof wt?(e.childNodes.length&&i.replace(...e.childNodes),!0):!1}function l0(i,e){if(i instanceof fe){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 d0(i,e){if(i instanceof fe&&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 u0(i,e){if(typeof e=="boolean"&&i instanceof fe){let t=i.attributeNamespace,a=i.element.hasAttributeNS(t,i.attributeName);return e!==a&&(i.booleanValue=e),!0}return!1}function c0(i,e){return e===!1&&i instanceof wt?(i.replace(""),!0):!1}function m0(i,e){d0(i,e)||u0(i,e)||n0(i,e)||c0(i,e)||s0(i,e)||o0(i,e)||l0(i,e)}var Ku=new Map,Vp=new WeakMap,Kp=new WeakMap,Co=class{constructor(e,t,a){this.strings=e;this.values=t;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(Ku.has(this.stringsKey))return Ku.get(this.stringsKey);{let e=ye.createElement("template"),t=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<t?`{{ ${n} }}`:""),""),Ku.set(this.stringsKey,e),e}}renderInto(e){var r;let t=this.template;if(Vp.get(e)!==t){Vp.set(e,t);let n=new Mt(t,this.values,this.processor);Kp.set(e,n),e instanceof wt?e.replace(...n.children):e.appendChild(n);return}let a=Kp.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},h0={processCallback(i,e,t){var a;if(t){for(let[r,n]of e)if(r in t){let o=(a=t[r])!=null?a:"";m0(n,o)}}}};function xt(i,...e){return new Co(i,e,h0)}function Yp(i,e){i.renderInto(e)}var xr=require("@mux/playback-core"),Gp=i=>xt`
|
|
1302
1828
|
<style>
|
|
1303
|
-
${
|
|
1829
|
+
${Up}
|
|
1304
1830
|
</style>
|
|
1305
|
-
${
|
|
1306
|
-
`,
|
|
1831
|
+
${b0(i)}
|
|
1832
|
+
`,p0=i=>{let e=i.hotKeys?`${i.hotKeys}`:"";return Ar(i.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},v0={TOP:"top",CENTER:"center",BOTTOM:"bottom",LAYER:"layer",MEDIA_LAYER:"media-layer",POSTER_LAYER:"poster-layer",VERTICAL_LAYER:"vertical-layer",CENTERED_LAYER:"centered-layer",GESTURE_LAYER:"gesture-layer",CONTROLLER_LAYER:"controller",BUTTON:"button",RANGE:"range",DISPLAY:"display",CONTROL_BAR:"control-bar",SELECTMENU:"selectmenu",LISTBOX:"listbox",OPTION:"option",POSTER:"poster",LIVE:"live",PLAY:"play",PRE_PLAY:"pre-play",SEEK_BACKWARD:"seek-backward",SEEK_FORWARD:"seek-forward",MUTE:"mute",CAPTIONS:"captions",AIRPLAY:"airplay",PIP:"pip",FULLSCREEN:"fullscreen",CAST:"cast",PLAYBACK_RATE:"playback-rate",VOLUME:"volume",TIME:"time",TITLE:"title",AUDIO_TRACK:"audio-track",RENDITION:"rendition"},f0=Object.values(v0).join(", "),b0=i=>{var e,t,a,r,n,o,d,u,c,f,E,v,b,w,_,T,R,oe,ge,Ot,_t,Ea,ga,_a,Aa,ya,Ta,ka,Sa,Ia,Ca,La,Br,At,Ma;return xt`
|
|
1307
1833
|
<media-theme
|
|
1308
1834
|
template="${i.themeTemplate||!1}"
|
|
1309
1835
|
defaultstreamtype="${(e=i.defaultStreamType)!=null?e:!1}"
|
|
1310
|
-
hotkeys="${
|
|
1836
|
+
hotkeys="${p0(i)||!1}"
|
|
1311
1837
|
nohotkeys="${i.noHotKeys||!i.hasSrc||i.isDialogOpen||!1}"
|
|
1312
|
-
noautoseektolive="${!!((t=i.streamType)!=null&&t.includes(
|
|
1838
|
+
noautoseektolive="${!!((t=i.streamType)!=null&&t.includes(xr.StreamTypes.LIVE))&&i.targetLiveWindow!==0}"
|
|
1313
1839
|
novolumepref="${i.novolumepref||!1}"
|
|
1314
1840
|
disabled="${!i.hasSrc||i.isDialogOpen}"
|
|
1315
1841
|
audio="${(a=i.audio)!=null?a:!1}"
|
|
1316
|
-
style="${(r=
|
|
1842
|
+
style="${(r=vp({"--media-primary-color":i.primaryColor,"--media-secondary-color":i.secondaryColor,"--media-accent-color":i.accentColor}))!=null?r:!1}"
|
|
1317
1843
|
defaultsubtitles="${!i.defaultHiddenCaptions}"
|
|
1318
1844
|
forwardseekoffset="${(n=i.forwardSeekOffset)!=null?n:!1}"
|
|
1319
|
-
backwardseekoffset="${(
|
|
1845
|
+
backwardseekoffset="${(o=i.backwardSeekOffset)!=null?o:!1}"
|
|
1320
1846
|
playbackrates="${(d=i.playbackRates)!=null?d:!1}"
|
|
1321
1847
|
defaultshowremainingtime="${(u=i.defaultShowRemainingTime)!=null?u:!1}"
|
|
1322
|
-
defaultduration="${(
|
|
1323
|
-
hideduration="${(
|
|
1324
|
-
title="${(
|
|
1325
|
-
exportparts="${
|
|
1848
|
+
defaultduration="${(c=i.defaultDuration)!=null?c:!1}"
|
|
1849
|
+
hideduration="${(f=i.hideDuration)!=null?f:!1}"
|
|
1850
|
+
title="${(E=i.title)!=null?E:!1}"
|
|
1851
|
+
exportparts="${f0}"
|
|
1326
1852
|
>
|
|
1327
1853
|
<mux-video
|
|
1328
1854
|
slot="media"
|
|
1329
|
-
target-live-window="${(
|
|
1330
|
-
stream-type="${(
|
|
1331
|
-
crossorigin="${(
|
|
1855
|
+
target-live-window="${(v=i.targetLiveWindow)!=null?v:!1}"
|
|
1856
|
+
stream-type="${(b=Ar(i.streamType))!=null?b:!1}"
|
|
1857
|
+
crossorigin="${(w=i.crossOrigin)!=null?w:""}"
|
|
1332
1858
|
playsinline
|
|
1333
|
-
autoplay="${(
|
|
1334
|
-
muted="${(
|
|
1335
|
-
loop="${(
|
|
1336
|
-
preload="${(
|
|
1337
|
-
debug="${(
|
|
1338
|
-
prefer-cmcd="${(
|
|
1339
|
-
disable-cookies="${(
|
|
1340
|
-
prefer-playback="${(
|
|
1859
|
+
autoplay="${(_=i.autoplay)!=null?_:!1}"
|
|
1860
|
+
muted="${(T=i.muted)!=null?T:!1}"
|
|
1861
|
+
loop="${(R=i.loop)!=null?R:!1}"
|
|
1862
|
+
preload="${(oe=i.preload)!=null?oe:!1}"
|
|
1863
|
+
debug="${(ge=i.debug)!=null?ge:!1}"
|
|
1864
|
+
prefer-cmcd="${(Ot=i.preferCmcd)!=null?Ot:!1}"
|
|
1865
|
+
disable-cookies="${(_t=i.disableCookies)!=null?_t:!1}"
|
|
1866
|
+
prefer-playback="${(Ea=i.preferPlayback)!=null?Ea:!1}"
|
|
1341
1867
|
start-time="${i.startTime!=null?i.startTime:!1}"
|
|
1342
|
-
beacon-collection-domain="${(
|
|
1343
|
-
player-software-name="${(
|
|
1344
|
-
player-software-version="${(
|
|
1345
|
-
env-key="${(
|
|
1346
|
-
custom-domain="${(
|
|
1347
|
-
src="${i.src?i.src:i.playbackId?(0,
|
|
1348
|
-
cast-src="${i.src?i.src:i.playbackId?(0,
|
|
1868
|
+
beacon-collection-domain="${(ga=i.beaconCollectionDomain)!=null?ga:!1}"
|
|
1869
|
+
player-software-name="${(_a=i.playerSoftwareName)!=null?_a:!1}"
|
|
1870
|
+
player-software-version="${(Aa=i.playerSoftwareVersion)!=null?Aa:!1}"
|
|
1871
|
+
env-key="${(ya=i.envKey)!=null?ya:!1}"
|
|
1872
|
+
custom-domain="${(Ta=i.customDomain)!=null?Ta:!1}"
|
|
1873
|
+
src="${i.src?i.src:i.playbackId?(0,xr.toMuxVideoURL)(i):!1}"
|
|
1874
|
+
cast-src="${i.src?i.src:i.playbackId?(0,xr.toMuxVideoURL)(i):!1}"
|
|
1349
1875
|
exportparts="video"
|
|
1350
1876
|
>
|
|
1351
|
-
${i.storyboard?
|
|
1877
|
+
${i.storyboard?xt`<track label="thumbnails" default kind="metadata" src="${i.storyboard}" />`:xt``}
|
|
1352
1878
|
</mux-video>
|
|
1353
1879
|
<slot name="poster" slot="poster">
|
|
1354
1880
|
<media-poster-image
|
|
1355
1881
|
part="poster"
|
|
1356
1882
|
exportparts="poster, img"
|
|
1357
|
-
src="${i.poster===""?!1:(
|
|
1358
|
-
placeholdersrc="${(
|
|
1883
|
+
src="${i.poster===""?!1:(ka=i.poster)!=null?ka:!1}"
|
|
1884
|
+
placeholdersrc="${(Sa=i.placeholder)!=null?Sa:!1}"
|
|
1359
1885
|
></media-poster-image>
|
|
1360
1886
|
</slot>
|
|
1361
1887
|
<mxp-dialog
|
|
1362
1888
|
no-auto-hide
|
|
1363
|
-
open="${(
|
|
1889
|
+
open="${(Ia=i.isDialogOpen)!=null?Ia:!1}"
|
|
1364
1890
|
onclose="${i.onCloseErrorDialog}"
|
|
1365
1891
|
oninitfocus="${i.onInitFocusDialog}"
|
|
1366
1892
|
>
|
|
1367
|
-
${(
|
|
1893
|
+
${(Ca=i.dialog)!=null&&Ca.title?xt`<h3>${i.dialog.title}</h3>`:xt``}
|
|
1368
1894
|
<p>
|
|
1369
|
-
${(
|
|
1370
|
-
${(
|
|
1895
|
+
${(La=i.dialog)==null?void 0:La.message}
|
|
1896
|
+
${(Br=i.dialog)!=null&&Br.linkUrl?xt`<a
|
|
1371
1897
|
href="${i.dialog.linkUrl}"
|
|
1372
1898
|
target="_blank"
|
|
1373
1899
|
rel="external noopener"
|
|
1374
|
-
aria-label="${(
|
|
1375
|
-
>${(
|
|
1376
|
-
>`:
|
|
1900
|
+
aria-label="${(At=i.dialog.linkText)!=null?At:""} ${C("(opens in a new window)")}"
|
|
1901
|
+
>${(Ma=i.dialog.linkText)!=null?Ma:i.dialog.linkUrl}</a
|
|
1902
|
+
>`:xt``}
|
|
1377
1903
|
</p>
|
|
1378
1904
|
</mxp-dialog>
|
|
1379
1905
|
</media-theme>
|
|
1380
|
-
`};var
|
|
1906
|
+
`};var Rr=require("@mux/mux-video");function Lo(i,e,t,a,r){var d,u,c;let n={},o={};switch(i.code){case Rr.MediaError.MEDIA_ERR_NETWORK:{switch(n.title=C("Network Error",r),n.message=i.message,(d=i.data)==null?void 0:d.response.code){case 412:{n.title=C("Video is not currently available",r),n.message=C("The live stream or video file are not yet ready.",r),o.message=C("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),o.file="412-not-playable.md";break}case 404:{n.title=C("Video does not exist",r),n.message="",o.message=C("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),o.file="404-not-found.md";break}case 403:{if(n.title=C("Invalid playback URL",r),n.message=C("The video URL or playback-token are formatted with incorrect or incomplete information.",r),o.message=C("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",r),o.file="missing-signed-tokens.md",!a)break;let{exp:f,aud:E,sub:v}=qt(a),b=Date.now()>f*1e3,w=v!==t,_=E!=="v",T={timeStyle:"medium",dateStyle:"medium"};if(b){n.title=C("Video URL has expired",r),n.message=C("The video\u2019s secured playback-token has expired.",r),o.message=C("The video\u2019s secured playback-token has expired.",r),o.context=C("Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(Ti.code,T).format(f*1e3),currentDate:new Intl.DateTimeFormat(Ti.code,T).format(Date.now())}),o.file="403-expired-token.md";break}if(w){n.title=C("Video URL is formatted incorrectly",r),n.message=C("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),o.message=C("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),o.context=C("Specified playback ID: {playbackId} and the playback ID encoded in the playback-token: {tokenPlaybackId}",r).format({playbackId:t,tokenPlaybackId:v}),o.file="403-playback-id-mismatch.md";break}if(_){n.title=C("Video URL is formatted incorrectly",r),n.message=C("The playback-token is formatted with incorrect information.",r),o.message=C("The playback-token is formatted with incorrect information.",r),o.context=C("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:E}),o.file="403-incorrect-aud-value.md";break}o.message=C("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",r),o.file="403-malformatted-token.md";break}}break}case Rr.MediaError.MEDIA_ERR_DECODE:{let{message:f}=i;n={title:C("Media Error",r),message:f},o.file="media-decode-error.md";break}case Rr.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=Rr.MediaError.MEDIA_ERR_NETWORK,i.data={response:{code:f}},{dialog:n,devlog:o}=Lo(i,e,t,a);break}n={title:C("Source Not Supported",r),message:i.message},o.file="media-src-not-supported.md";break}default:n={title:C("Error",r),message:i.message};break}return e&&(n={title:C("Your device appears to be offline",r),message:C("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:o}}var qp=`<template id="media-theme-gerwig">
|
|
1381
1907
|
<style>
|
|
1382
1908
|
@keyframes pre-play-hide {
|
|
1383
1909
|
0% {
|
|
@@ -1405,10 +1931,6 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1405
1931
|
--media-control-background: var(--_secondary-color);
|
|
1406
1932
|
--media-control-hover-background: var(--_accent-color);
|
|
1407
1933
|
--media-time-buffered-color: rgba(255, 255, 255, 0.4);
|
|
1408
|
-
--media-preview-thumbnail-border: 0;
|
|
1409
|
-
--media-preview-thumbnail-border-radius: 2px 2px 0 0;
|
|
1410
|
-
--media-preview-time-border-radius: 0 0 2px 2px;
|
|
1411
|
-
--media-preview-time-margin: 0 0 8px;
|
|
1412
1934
|
--media-preview-time-text-shadow: none;
|
|
1413
1935
|
--media-control-height: 14px;
|
|
1414
1936
|
--media-control-padding: 6px;
|
|
@@ -1421,8 +1943,6 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1421
1943
|
|
|
1422
1944
|
:host([audio]) {
|
|
1423
1945
|
--_secondary-color: var(--media-secondary-color, black);
|
|
1424
|
-
--media-preview-time-border-radius: 3px;
|
|
1425
|
-
--media-preview-time-margin: 0 0 5px;
|
|
1426
1946
|
--media-preview-time-text-shadow: none;
|
|
1427
1947
|
}
|
|
1428
1948
|
|
|
@@ -1461,6 +1981,8 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1461
1981
|
}
|
|
1462
1982
|
|
|
1463
1983
|
media-time-range {
|
|
1984
|
+
--media-box-padding-left: 6px;
|
|
1985
|
+
--media-box-padding-right: 6px;
|
|
1464
1986
|
--media-range-bar-color: var(--_accent-color);
|
|
1465
1987
|
--media-time-range-buffered-color: var(--_primary-color);
|
|
1466
1988
|
--media-range-track-color: transparent;
|
|
@@ -1477,41 +1999,27 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1477
1999
|
--media-range-thumb-transform: scale(0);
|
|
1478
2000
|
--media-range-thumb-transition: transform 0.3s;
|
|
1479
2001
|
--media-range-thumb-opacity: 1;
|
|
1480
|
-
--media-preview-
|
|
2002
|
+
--media-preview-background: var(--_primary-color);
|
|
2003
|
+
--media-box-arrow-background: var(--_primary-color);
|
|
1481
2004
|
--media-preview-thumbnail-border: 5px solid var(--_primary-color);
|
|
1482
|
-
--media-preview-
|
|
1483
|
-
--media-preview-time-background: var(--_primary-color);
|
|
1484
|
-
--media-preview-time-border-radius: 0 0 5px 5px;
|
|
1485
|
-
--media-preview-time-margin: 0 0 10px;
|
|
1486
|
-
--media-preview-time-padding: 2px 0 6px;
|
|
2005
|
+
--media-preview-border-radius: 5px;
|
|
1487
2006
|
--media-text-color: var(--_text-color);
|
|
1488
|
-
--media-preview-thumbnail-max-width: 150px;
|
|
1489
|
-
--media-range-track-pointer-border-right: 2px solid #000;
|
|
1490
2007
|
--media-control-hover-background: transparent;
|
|
1491
2008
|
color: var(--_accent-color);
|
|
1492
2009
|
padding: 0 6px;
|
|
1493
2010
|
}
|
|
1494
2011
|
|
|
1495
2012
|
:host([audio]) media-time-range {
|
|
1496
|
-
--media-preview-time-
|
|
1497
|
-
--media-preview-
|
|
2013
|
+
--media-preview-time-padding: 1.5px 6px;
|
|
2014
|
+
--media-preview-box-margin: 0 0 -5px;
|
|
1498
2015
|
}
|
|
1499
2016
|
|
|
1500
2017
|
media-time-range:hover {
|
|
1501
2018
|
--media-range-thumb-transform: scale(1);
|
|
1502
2019
|
}
|
|
1503
2020
|
|
|
1504
|
-
media-
|
|
1505
|
-
|
|
1506
|
-
content: '';
|
|
1507
|
-
width: 0;
|
|
1508
|
-
height: 0;
|
|
1509
|
-
border-style: solid;
|
|
1510
|
-
border-width: 10px 8.5px 0 8.5px;
|
|
1511
|
-
border-color: var(--_primary-color) transparent transparent transparent;
|
|
1512
|
-
top: 100%;
|
|
1513
|
-
left: 50%;
|
|
1514
|
-
transform: translate(-50%, -10px);
|
|
2021
|
+
media-preview-thumbnail {
|
|
2022
|
+
border-bottom-width: 0;
|
|
1515
2023
|
}
|
|
1516
2024
|
|
|
1517
2025
|
[part~='listbox'] {
|
|
@@ -1602,12 +2110,20 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1602
2110
|
pointer-events: none;
|
|
1603
2111
|
}
|
|
1604
2112
|
|
|
2113
|
+
media-control-bar {
|
|
2114
|
+
--gradient-steps: hsl(0 0% 0% / 0) 0%, hsl(0 0% 0% / 0.013) 8.1%, hsl(0 0% 0% / 0.049) 15.5%,
|
|
2115
|
+
hsl(0 0% 0% / 0.104) 22.5%, hsl(0 0% 0% / 0.175) 29%, hsl(0 0% 0% / 0.259) 35.3%, hsl(0 0% 0% / 0.352) 41.2%,
|
|
2116
|
+
hsl(0 0% 0% / 0.45) 47.1%, hsl(0 0% 0% / 0.55) 52.9%, hsl(0 0% 0% / 0.648) 58.8%, hsl(0 0% 0% / 0.741) 64.7%,
|
|
2117
|
+
hsl(0 0% 0% / 0.825) 71%, hsl(0 0% 0% / 0.896) 77.5%, hsl(0 0% 0% / 0.951) 84.5%, hsl(0 0% 0% / 0.987) 91.9%,
|
|
2118
|
+
hsl(0 0% 0%) 100%;
|
|
2119
|
+
}
|
|
2120
|
+
|
|
1605
2121
|
:host([title]:not([audio])) media-control-bar[slot='top-chrome']::before {
|
|
1606
2122
|
content: '';
|
|
1607
2123
|
position: absolute;
|
|
1608
2124
|
width: 100%;
|
|
1609
2125
|
padding-bottom: min(100px, 25%);
|
|
1610
|
-
background: linear-gradient(
|
|
2126
|
+
background: linear-gradient(to top, var(--gradient-steps));
|
|
1611
2127
|
opacity: 0.8;
|
|
1612
2128
|
pointer-events: none;
|
|
1613
2129
|
}
|
|
@@ -1619,7 +2135,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1619
2135
|
bottom: 0;
|
|
1620
2136
|
left: 0;
|
|
1621
2137
|
padding-bottom: min(100px, 25%);
|
|
1622
|
-
background: linear-gradient(
|
|
2138
|
+
background: linear-gradient(to bottom, var(--gradient-steps));
|
|
1623
2139
|
opacity: 0.8;
|
|
1624
2140
|
z-index: 1;
|
|
1625
2141
|
pointer-events: none;
|
|
@@ -1769,7 +2285,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1769
2285
|
}
|
|
1770
2286
|
|
|
1771
2287
|
/* Intentionally don't target the div for transition but the children
|
|
1772
|
-
|
|
2288
|
+
of the div. Prevents messing with media-chrome's autohide feature. */
|
|
1773
2289
|
media-loading-indicator + div * {
|
|
1774
2290
|
transition: opacity 0.15s;
|
|
1775
2291
|
opacity: 1;
|
|
@@ -2166,7 +2682,12 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
2166
2682
|
</template>
|
|
2167
2683
|
|
|
2168
2684
|
<template partial="TimeRange">
|
|
2169
|
-
<media-time-range part="bottom time range" disabled="{{disabled}}" aria-disabled="{{disabled}}"
|
|
2685
|
+
<media-time-range part="bottom time range" disabled="{{disabled}}" aria-disabled="{{disabled}}">
|
|
2686
|
+
<media-preview-thumbnail slot="preview"></media-preview-thumbnail>
|
|
2687
|
+
<media-preview-chapter-display slot="preview"></media-preview-chapter-display>
|
|
2688
|
+
<media-preview-time-display slot="preview"></media-preview-time-display>
|
|
2689
|
+
<div slot="preview" part="arrow"></div>
|
|
2690
|
+
</media-time-range>
|
|
2170
2691
|
</template>
|
|
2171
2692
|
|
|
2172
2693
|
<template partial="AudioTrackSelect">
|
|
@@ -2371,5 +2892,5 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
2371
2892
|
<slot></slot>
|
|
2372
2893
|
</media-controller>
|
|
2373
2894
|
</template>
|
|
2374
|
-
`;var Rs=ne.createElement("template");"innerHTML"in Rs&&(Rs.innerHTML=xu);var Du,Ou,fn=class extends bt{};fn.template=(Ou=(Du=Rs.content)==null?void 0:Du.children)==null?void 0:Ou[0];U.customElements.get("media-theme-gerwig")||U.customElements.define("media-theme-gerwig",fn);var uh="gerwig";var Xe={SRC:"src",POSTER:"poster"},p={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",ACCENT_COLOR:"accent-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",DEFAULT_DURATION:"default-duration",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",EXTRA_SOURCE_PARAMS:"extra-source-params",NO_VOLUME_PREF:"no-volume-pref"},ws=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function ch(i,e){var a;return{src:!i.playbackId&&i.src,playbackId:i.playbackId,hasSrc:!!i.playbackId||!!i.src,poster:i.poster,storyboard:i.storyboard,storyboardSrc:i.getAttribute(p.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),themeTemplate:mh(i),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(p.NOHOTKEYS),hotKeys:i.getAttribute(p.HOTKEYS),muted:i.muted,paused:i.paused,preload:i.preload,envKey:i.envKey,preferCmcd:i.preferCmcd,debug:i.debug,disableCookies:i.disableCookies,tokens:i.tokens,beaconCollectionDomain:i.beaconCollectionDomain,maxResolution:i.maxResolution,minResolution:i.minResolution,renditionOrder:i.renditionOrder,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:ji(i.getAttribute(g.Attributes.STREAM_TYPE)),primaryColor:i.getAttribute(p.PRIMARY_COLOR),secondaryColor:i.getAttribute(p.SECONDARY_COLOR),accentColor:i.getAttribute(p.ACCENT_COLOR),forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultDuration:i.defaultDuration,defaultShowRemainingTime:i.defaultShowRemainingTime,hideDuration:hh(i),playbackRates:i.getAttribute(p.PLAYBACK_RATES),customDomain:(a=i.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(p.TITLE),novolumepref:i.hasAttribute(p.NO_VOLUME_PREF),...e,extraSourceParams:i.extraSourceParams}}function mh(i){var t,a;let e=i.theme;if(e){let r=(a=(t=i.getRootNode())==null?void 0:t.getElementById)==null?void 0:a.call(t,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let n=U.customElements.get(e);if(n!=null&&n.template)return n.template}}function hh(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 Nu(i){let e=i.hasAttribute(p.TITLE)?{video_title:i.getAttribute(p.TITLE)}:{};return i.getAttributeNames().filter(t=>t.startsWith("metadata-")).reduce((t,a)=>{let r=i.getAttribute(a);return r!==null&&(t[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),t},e)}var ph=Object.values(g.Attributes),bh=Object.values(Xe),Eh=Object.values(p),fh=on(),vh="mux-player",Uu={dialog:void 0,isDialogOpen:!1},gh={redundant_streams:!0},ma,ha,ft,pa,Ft,Je,$t,vn,Pu,ba,xs,vt,Ti,gn,Bu,An,Vu,_n,Hu,yn,$u,ca=class extends vs{constructor(){super();W(this,Je);W(this,vn);W(this,ba);W(this,vt);W(this,gn);W(this,An);W(this,_n);W(this,yn);W(this,ma,!1);W(this,ha,{});W(this,ft,!0);W(this,pa,new nn(this,"hotkeys"));W(this,Ft,{...Uu,onCloseErrorDialog:()=>F(this,ba,xs).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{bs(this,ne.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),F(this,vn,Pu).call(this),this.isConnected&&F(this,Je,$t).call(this)}static get observedAttributes(){var t;return[...(t=vs.observedAttributes)!=null?t:[],...bh,...ph,...Eh]}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=Nu(this))}attributeChangedCallback(t,a,r){switch(F(this,Je,$t).call(this),super.attributeChangedCallback(t,a,r),t){case p.HOTKEYS:S(this,pa).value=r;break;case p.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&ct(y("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case p.THUMBNAIL_TOKEN:{let{aud:s}=ut(r);r&&s!=="t"&&ct(y("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:s}));break}case p.STORYBOARD_TOKEN:{let{aud:s}=ut(r);r&&s!=="s"&&ct(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")&&Ee(y("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case g.Attributes.STREAM_TYPE:r&&![P.StreamTypes.LIVE,P.StreamTypes.ON_DEMAND,P.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:Es({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})}):r===P.StreamTypes.LIVE?this.getAttribute(p.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN}[g.Attributes.PLAYBACK_ID,Xe.SRC,p.PLAYBACK_TOKEN].includes(t)&&a!==r&&ce(this,Ft,{...S(this,Ft),...Uu}),F(this,vt,Ti).call(this,{[ru(t)]:r})}get preferCmcd(){var t;return(t=this.getAttribute(g.Attributes.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?P.CmcdTypeValues.includes(t)?this.setAttribute(g.Attributes.PREFER_CMCD,t):ct(`Invalid value for preferCmcd. Must be one of ${P.CmcdTypeValues.join()}`):this.removeAttribute(g.Attributes.PREFER_CMCD))}get hasPlayed(){var t,a;return(a=(t=this.mediaController)==null?void 0:t.hasAttribute(o.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var t;return(t=this.mediaController)==null?void 0:t.hasAttribute(o.MEDIA_TIME_IS_LIVE)}get _hls(){var t;return(t=this.media)==null?void 0:t._hls}get mux(){var t;return(t=this.media)==null?void 0:t.mux}get theme(){var t;return(t=this.getAttribute(p.THEME))!=null?t:uh}set theme(t){this.setAttribute(p.THEME,`${t}`)}get themeProps(){let t=this.mediaTheme;if(!t)return;let a={};for(let r of t.getAttributeNames()){if(ws.includes(r))continue;let n=t.getAttribute(r);a[an(r)]=n===""?!0:n}return a}set themeProps(t){var r,n;F(this,Je,$t).call(this);let a={...this.themeProps,...t};for(let s in a){if(ws.includes(s))continue;let d=t==null?void 0:t[s];typeof d=="boolean"||d==null?(r=this.mediaTheme)==null||r.toggleAttribute(tn(s),!!d):(n=this.mediaTheme)==null||n.setAttribute(tn(s),d)}}get playbackId(){var t;return(t=this.getAttribute(g.Attributes.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(g.Attributes.PLAYBACK_ID,t):this.removeAttribute(g.Attributes.PLAYBACK_ID)}get src(){var t,a;return this.playbackId?(t=Wt(this,Xe.SRC))!=null?t:void 0:(a=this.getAttribute(Xe.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(Xe.SRC,t):this.removeAttribute(Xe.SRC)}get poster(){var a;let t=this.getAttribute(Xe.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return iu(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(Xe.POSTER,t):this.removeAttribute(Xe.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(p.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(p.STORYBOARD_SRC,t):this.removeAttribute(p.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[P.StreamTypes.LIVE,P.StreamTypes.UNKNOWN].includes(this.streamType)))return au(this.playbackId,{customDomain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(p.AUDIO)}set audio(t){if(!t){this.removeAttribute(p.AUDIO);return}this.setAttribute(p.AUDIO,"")}get hotkeys(){return S(this,pa)}get nohotkeys(){return this.hasAttribute(p.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(p.NOHOTKEYS);return}this.setAttribute(p.NOHOTKEYS,"")}get thumbnailTime(){return $e(this.getAttribute(p.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(p.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(p.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(p.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=Wt(this,p.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(p.PLACEHOLDER,`${t}`)}get primaryColor(){var a,r;let t=this.getAttribute(p.PRIMARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=U.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),t))return t}set primaryColor(t){this.setAttribute(p.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var a,r;let t=this.getAttribute(p.SECONDARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=U.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),t))return t}set secondaryColor(t){this.setAttribute(p.SECONDARY_COLOR,`${t}`)}get accentColor(){var a,r;let t=this.getAttribute(p.ACCENT_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=U.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),t))return t}set accentColor(t){this.setAttribute(p.ACCENT_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(p.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(p.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(p.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(p.PLAYBACK_RATES))return this.getAttribute(p.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(t=>Number(t)).filter(t=>!Number.isNaN(t)).sort((t,a)=>t-a)}set playbackRates(t){if(!t){this.removeAttribute(p.PLAYBACK_RATES);return}this.setAttribute(p.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=$e(this.getAttribute(p.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(p.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=$e(this.getAttribute(p.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(p.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(p.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(p.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(p.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return $e(this.getAttribute(p.DEFAULT_DURATION))}set defaultDuration(t){t==null?this.removeAttribute(p.DEFAULT_DURATION):this.setAttribute(p.DEFAULT_DURATION,`${t}`)}get playerSoftwareName(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:vh}get playerSoftwareVersion(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:fh}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 minResolution(){var t;return(t=this.getAttribute(g.Attributes.MIN_RESOLUTION))!=null?t:void 0}set minResolution(t){t!==this.minResolution&&(t?this.setAttribute(g.Attributes.MIN_RESOLUTION,t):this.removeAttribute(g.Attributes.MIN_RESOLUTION))}get renditionOrder(){var t;return(t=this.getAttribute(g.Attributes.RENDITION_ORDER))!=null?t:void 0}set renditionOrder(t){t!==this.renditionOrder&&(t?this.setAttribute(g.Attributes.RENDITION_ORDER,t):this.removeAttribute(g.Attributes.RENDITION_ORDER))}get extraSourceParams(){return this.hasAttribute(p.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(p.EXTRA_SOURCE_PARAMS)).entries()].reduce((t,[a,r])=>(t[a]=r,t),{}):gh}set extraSourceParams(t){t==null?this.removeAttribute(p.EXTRA_SOURCE_PARAMS):this.setAttribute(p.EXTRA_SOURCE_PARAMS,new URLSearchParams(t).toString())}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=Wt(this,g.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(g.Attributes.ENV_KEY,`${t}`)}get noVolumePref(){return this.hasAttribute(p.NO_VOLUME_PREF)}set noVolumePref(t){t?this.setAttribute(p.NO_VOLUME_PREF,""):this.removeAttribute(p.NO_VOLUME_PREF)}get debug(){return Wt(this,g.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(g.Attributes.DEBUG,""):this.removeAttribute(g.Attributes.DEBUG)}get disableCookies(){return Wt(this,g.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(g.Attributes.DISABLE_COOKIES,""):this.removeAttribute(g.Attributes.DISABLE_COOKIES)}get streamType(){var t,a,r;return(r=(a=this.getAttribute(g.Attributes.STREAM_TYPE))!=null?a:(t=this.media)==null?void 0:t.streamType)!=null?r:P.StreamTypes.UNKNOWN}set streamType(t){this.setAttribute(g.Attributes.STREAM_TYPE,`${t}`)}get defaultStreamType(){var t,a,r;return(r=(a=this.getAttribute(p.DEFAULT_STREAM_TYPE))!=null?a:(t=this.mediaController)==null?void 0:t.getAttribute(p.DEFAULT_STREAM_TYPE))!=null?r:P.StreamTypes.ON_DEMAND}set defaultStreamType(t){t?this.setAttribute(p.DEFAULT_STREAM_TYPE,t):this.removeAttribute(p.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var t,a;return this.hasAttribute(p.TARGET_LIVE_WINDOW)?+this.getAttribute(p.TARGET_LIVE_WINDOW):(a=(t=this.media)==null?void 0:t.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(t){t==this.targetLiveWindow||Number.isNaN(t)&&Number.isNaN(this.targetLiveWindow)||(t==null?this.removeAttribute(p.TARGET_LIVE_WINDOW):this.setAttribute(p.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t;return(t=this.media)==null?void 0:t.liveEdgeStart}get startTime(){return $e(Wt(this,g.Attributes.START_TIME))}set startTime(t){this.setAttribute(g.Attributes.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(g.Attributes.PREFER_PLAYBACK);if(t===P.PlaybackTypes.MSE||t===P.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===P.PlaybackTypes.MSE||t===P.PlaybackTypes.NATIVE?this.setAttribute(g.Attributes.PREFER_PLAYBACK,t):this.removeAttribute(g.Attributes.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(F(this,Je,$t).call(this),!this.media){Ee("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Nu(this),...t}}get _hlsConfig(){var t;return(t=this.media)==null?void 0:t._hlsConfig}set _hlsConfig(t){if(F(this,Je,$t).call(this),!this.media){Ee("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=t}async addCuePoints(t){var a;if(F(this,Je,$t).call(this),!this.media){Ee("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(t)}get activeCuePoint(){var t;return(t=this.media)==null?void 0:t.activeCuePoint}get cuePoints(){var t,a;return(a=(t=this.media)==null?void 0:t.cuePoints)!=null?a:[]}getStartDate(){var t;return(t=this.media)==null?void 0:t.getStartDate()}get currentPdt(){var t;return(t=this.media)==null?void 0:t.currentPdt}get tokens(){let t=this.getAttribute(p.PLAYBACK_TOKEN),a=this.getAttribute(p.THUMBNAIL_TOKEN),r=this.getAttribute(p.STORYBOARD_TOKEN);return{...S(this,ha),...t!=null?{playback:t}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){ce(this,ha,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(p.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(p.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(p.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(p.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(p.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(p.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,n){var d;let s=(d=this.media)==null?void 0:d.nativeEl;if(s)return(0,P.addTextTrack)(s,t,a,r,n)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,P.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};ma=new WeakMap,ha=new WeakMap,ft=new WeakMap,pa=new WeakMap,Ft=new WeakMap,Je=new WeakSet,$t=function(){var t,a,r;if(!S(this,ma)){ce(this,ma,!0),F(this,vt,Ti).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof U.HTMLElement))throw""}catch{Ee("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof g.default))throw""}catch{Ee("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof Qn))throw""}catch{Ee("<media-controller> failed to upgrade!")}du(this),F(this,gn,Bu).call(this),F(this,An,Vu).call(this),F(this,_n,Hu).call(this),ce(this,ft,(a=(t=this.mediaController)==null?void 0:t.hasAttribute(T.USER_INACTIVE))!=null?a:!0),F(this,yn,$u).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>{F(this,vt,Ti).call(this)})}},vn=new WeakSet,Pu=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{}},ba=new WeakSet,xs=function(t){Object.assign(S(this,Ft),t),F(this,vt,Ti).call(this)},vt=new WeakSet,Ti=function(t={}){Ru(wu(ch(this,{...S(this,Ft),...t})),this.shadowRoot)},gn=new WeakSet,Bu=function(){let t=r=>{var d,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if(ws.includes(n))return;let s=this.getAttribute(r);s!=null?(d=this.mediaTheme)==null||d.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)},An=new WeakSet,Vu=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)){ct(n),n.data&&ct(`${n.name} data:`,n.data);return}let{dialog:s,devlog:d}=En(n,!window.navigator.onLine,this.playbackId,this.playbackToken);d.message&&Es(d),Ee(n),n.data&&Ee(`${n.name} data:`,n.data),F(this,ba,xs).call(this,{isDialogOpen:!0,dialog:s})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var s,d,u;if(!(((s=this.media)==null?void 0:s.error)instanceof g.MediaError))return r;let{devlog:n}=En((d=this.media)==null?void 0:d.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(u=this.media)==null?void 0:u.error.code,player_error_message:n.message?String(n.message):r.player_error_message,player_error_context:n.context?String(n.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var s,d;let{detail:n}=r;if(!n){let{message:u,code:h}=(d=(s=this.media)==null?void 0:s.error)!=null?d:{};n=new g.MediaError(u,h)}n!=null&&n.fatal&&this.dispatchEvent(new CustomEvent("error",{detail:n}))})},_n=new WeakSet,Hu=function(){var a,r,n,s;let t=()=>F(this,vt,Ti).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",t),(s=(n=this.media)==null?void 0:n.textTracks)==null||s.addEventListener("removetrack",t)},yn=new WeakSet,$u=function(){var h,m;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,n=()=>this.streamType===P.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(b,E,I=!1)=>{if(n())return;Array.from(b&&b.activeCues||[]).forEach(k=>{if(!(!k.snapToLines||k.line<-5||k.line>=0&&k.line<10))if(!E||this.paused){let $=k.text.split(`
|
|
2375
|
-
`).length,
|
|
2895
|
+
`;var Gu=ye.createElement("template");"innerHTML"in Gu&&(Gu.innerHTML=qp);var Zp,Qp,Mo=class extends Jt{};Mo.template=(Qp=(Zp=Gu.content)==null?void 0:Zp.children)==null?void 0:Qp[0];Z.customElements.get("media-theme-gerwig")||Z.customElements.define("media-theme-gerwig",Mo);var g0="gerwig";var Rt={SRC:"src",POSTER:"poster"},p={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",ACCENT_COLOR:"accent-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",DEFAULT_DURATION:"default-duration",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",EXTRA_SOURCE_PARAMS:"extra-source-params",NO_VOLUME_PREF:"no-volume-pref"},qu=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function _0(i,e){var a;return{src:!i.playbackId&&i.src,playbackId:i.playbackId,hasSrc:!!i.playbackId||!!i.src,poster:i.poster,storyboard:i.storyboard,storyboardSrc:i.getAttribute(p.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),themeTemplate:A0(i),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(p.NOHOTKEYS),hotKeys:i.getAttribute(p.HOTKEYS),muted:i.muted,paused:i.paused,preload:i.preload,envKey:i.envKey,preferCmcd:i.preferCmcd,debug:i.debug,disableCookies:i.disableCookies,tokens:i.tokens,beaconCollectionDomain:i.beaconCollectionDomain,maxResolution:i.maxResolution,minResolution:i.minResolution,renditionOrder:i.renditionOrder,metadata:i.metadata,playerSoftwareName:i.playerSoftwareName,playerSoftwareVersion:i.playerSoftwareVersion,startTime:i.startTime,preferPlayback:i.preferPlayback,audio:i.audio,defaultStreamType:i.defaultStreamType,targetLiveWindow:i.getAttribute(A.Attributes.TARGET_LIVE_WINDOW),streamType:Ar(i.getAttribute(A.Attributes.STREAM_TYPE)),primaryColor:i.getAttribute(p.PRIMARY_COLOR),secondaryColor:i.getAttribute(p.SECONDARY_COLOR),accentColor:i.getAttribute(p.ACCENT_COLOR),forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultDuration:i.defaultDuration,defaultShowRemainingTime:i.defaultShowRemainingTime,hideDuration:y0(i),playbackRates:i.getAttribute(p.PLAYBACK_RATES),customDomain:(a=i.getAttribute(A.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(p.TITLE),novolumepref:i.hasAttribute(p.NO_VOLUME_PREF),...e,extraSourceParams:i.extraSourceParams}}function A0(i){var t,a;let e=i.theme;if(e){let r=(a=(t=i.getRootNode())==null?void 0:t.getElementById)==null?void 0:a.call(t,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let n=Z.customElements.get(e);if(n!=null&&n.template)return n.template}}function y0(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 zp(i){let e=i.hasAttribute(p.TITLE)?{video_title:i.getAttribute(p.TITLE)}:{};return i.getAttributeNames().filter(t=>t.startsWith("metadata-")).reduce((t,a)=>{let r=i.getAttribute(a);return r!==null&&(t[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),t},e)}var T0=Object.values(A.Attributes),k0=Object.values(Rt),S0=Object.values(p),I0=Eo(),C0="mux-player",Xp={dialog:void 0,isDialogOpen:!1},L0={redundant_streams:!0},Or,Pr,ei,Nr,Oi,Dt,Ri,wo,Jp,Ur,Zu,ti,ba,xo,jp,Ro,ev,Do,tv,Oo,iv,Dr=class extends Ou{constructor(){super();ee(this,Dt);ee(this,wo);ee(this,Ur);ee(this,ti);ee(this,xo);ee(this,Ro);ee(this,Do);ee(this,Oo);ee(this,Or,!1);ee(this,Pr,{});ee(this,ei,!0);ee(this,Nr,new bo(this,"hotkeys"));ee(this,Oi,{...Xp,onCloseErrorDialog:()=>te(this,Ur,Zu).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{xu(this,ye.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),te(this,wo,Jp).call(this),this.isConnected&&te(this,Dt,Ri).call(this)}static get observedAttributes(){var t;return[...(t=Ou.observedAttributes)!=null?t:[],...k0,...T0,...S0]}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=zp(this))}attributeChangedCallback(t,a,r){switch(te(this,Dt,Ri).call(this),super.attributeChangedCallback(t,a,r),t){case p.HOTKEYS:D(this,Nr).value=r;break;case p.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&Zt(C("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case p.THUMBNAIL_TOKEN:{let{aud:o}=qt(r);r&&o!=="t"&&Zt(C("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:o}));break}case p.STORYBOARD_TOKEN:{let{aud:o}=qt(r);r&&o!=="s"&&Zt(C("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:o}));break}case A.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&Oe(C("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case A.Attributes.STREAM_TYPE:r&&![z.StreamTypes.LIVE,z.StreamTypes.ON_DEMAND,z.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:Ru({file:"invalid-stream-type.md",message:C("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===z.StreamTypes.LIVE?this.getAttribute(p.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN}[A.Attributes.PLAYBACK_ID,Rt.SRC,p.PLAYBACK_TOKEN].includes(t)&&a!==r&&Ce(this,Oi,{...D(this,Oi),...Xp}),te(this,ti,ba).call(this,{[gp(t)]:r})}get preferCmcd(){var t;return(t=this.getAttribute(A.Attributes.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?z.CmcdTypeValues.includes(t)?this.setAttribute(A.Attributes.PREFER_CMCD,t):Zt(`Invalid value for preferCmcd. Must be one of ${z.CmcdTypeValues.join()}`):this.removeAttribute(A.Attributes.PREFER_CMCD))}get hasPlayed(){var t,a;return(a=(t=this.mediaController)==null?void 0:t.hasAttribute(s.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var t;return(t=this.mediaController)==null?void 0:t.hasAttribute(s.MEDIA_TIME_IS_LIVE)}get _hls(){var t;return(t=this.media)==null?void 0:t._hls}get mux(){var t;return(t=this.media)==null?void 0:t.mux}get theme(){var t;return(t=this.getAttribute(p.THEME))!=null?t:g0}set theme(t){this.setAttribute(p.THEME,`${t}`)}get themeProps(){let t=this.mediaTheme;if(!t)return;let a={};for(let r of t.getAttributeNames()){if(qu.includes(r))continue;let n=t.getAttribute(r);a[vo(r)]=n===""?!0:n}return a}set themeProps(t){var r,n;te(this,Dt,Ri).call(this);let a={...this.themeProps,...t};for(let o in a){if(qu.includes(o))continue;let d=t==null?void 0:t[o];typeof d=="boolean"||d==null?(r=this.mediaTheme)==null||r.toggleAttribute(po(o),!!d):(n=this.mediaTheme)==null||n.setAttribute(po(o),d)}}get playbackId(){var t;return(t=this.getAttribute(A.Attributes.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(A.Attributes.PLAYBACK_ID,t):this.removeAttribute(A.Attributes.PLAYBACK_ID)}get src(){var t,a;return this.playbackId?(t=Di(this,Rt.SRC))!=null?t:void 0:(a=this.getAttribute(Rt.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(Rt.SRC,t):this.removeAttribute(Rt.SRC)}get poster(){var a;let t=this.getAttribute(Rt.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return bp(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(Rt.POSTER,t):this.removeAttribute(Rt.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(p.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(p.STORYBOARD_SRC,t):this.removeAttribute(p.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[z.StreamTypes.LIVE,z.StreamTypes.UNKNOWN].includes(this.streamType)))return Ep(this.playbackId,{customDomain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(p.AUDIO)}set audio(t){if(!t){this.removeAttribute(p.AUDIO);return}this.setAttribute(p.AUDIO,"")}get hotkeys(){return D(this,Nr)}get nohotkeys(){return this.hasAttribute(p.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(p.NOHOTKEYS);return}this.setAttribute(p.NOHOTKEYS,"")}get thumbnailTime(){return Et(this.getAttribute(p.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(p.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(p.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(p.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=Di(this,p.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(p.PLACEHOLDER,`${t}`)}get primaryColor(){var a,r;let t=this.getAttribute(p.PRIMARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=Z.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),t))return t}set primaryColor(t){this.setAttribute(p.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var a,r;let t=this.getAttribute(p.SECONDARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=Z.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),t))return t}set secondaryColor(t){this.setAttribute(p.SECONDARY_COLOR,`${t}`)}get accentColor(){var a,r;let t=this.getAttribute(p.ACCENT_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=Z.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),t))return t}set accentColor(t){this.setAttribute(p.ACCENT_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(p.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(p.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(p.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(p.PLAYBACK_RATES))return this.getAttribute(p.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(t=>Number(t)).filter(t=>!Number.isNaN(t)).sort((t,a)=>t-a)}set playbackRates(t){if(!t){this.removeAttribute(p.PLAYBACK_RATES);return}this.setAttribute(p.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=Et(this.getAttribute(p.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(p.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=Et(this.getAttribute(p.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(p.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(p.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(p.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(p.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return Et(this.getAttribute(p.DEFAULT_DURATION))}set defaultDuration(t){t==null?this.removeAttribute(p.DEFAULT_DURATION):this.setAttribute(p.DEFAULT_DURATION,`${t}`)}get playerSoftwareName(){var t;return(t=this.getAttribute(A.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:C0}get playerSoftwareVersion(){var t;return(t=this.getAttribute(A.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:I0}get beaconCollectionDomain(){var t;return(t=this.getAttribute(A.Attributes.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(A.Attributes.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(A.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var t;return(t=this.getAttribute(A.Attributes.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(A.Attributes.MAX_RESOLUTION,t):this.removeAttribute(A.Attributes.MAX_RESOLUTION))}get minResolution(){var t;return(t=this.getAttribute(A.Attributes.MIN_RESOLUTION))!=null?t:void 0}set minResolution(t){t!==this.minResolution&&(t?this.setAttribute(A.Attributes.MIN_RESOLUTION,t):this.removeAttribute(A.Attributes.MIN_RESOLUTION))}get renditionOrder(){var t;return(t=this.getAttribute(A.Attributes.RENDITION_ORDER))!=null?t:void 0}set renditionOrder(t){t!==this.renditionOrder&&(t?this.setAttribute(A.Attributes.RENDITION_ORDER,t):this.removeAttribute(A.Attributes.RENDITION_ORDER))}get extraSourceParams(){return this.hasAttribute(p.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(p.EXTRA_SOURCE_PARAMS)).entries()].reduce((t,[a,r])=>(t[a]=r,t),{}):L0}set extraSourceParams(t){t==null?this.removeAttribute(p.EXTRA_SOURCE_PARAMS):this.setAttribute(p.EXTRA_SOURCE_PARAMS,new URLSearchParams(t).toString())}get customDomain(){var t;return(t=this.getAttribute(A.Attributes.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(A.Attributes.CUSTOM_DOMAIN,t):this.removeAttribute(A.Attributes.CUSTOM_DOMAIN))}get envKey(){var t;return(t=Di(this,A.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(A.Attributes.ENV_KEY,`${t}`)}get noVolumePref(){return this.hasAttribute(p.NO_VOLUME_PREF)}set noVolumePref(t){t?this.setAttribute(p.NO_VOLUME_PREF,""):this.removeAttribute(p.NO_VOLUME_PREF)}get debug(){return Di(this,A.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(A.Attributes.DEBUG,""):this.removeAttribute(A.Attributes.DEBUG)}get disableCookies(){return Di(this,A.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(A.Attributes.DISABLE_COOKIES,""):this.removeAttribute(A.Attributes.DISABLE_COOKIES)}get streamType(){var t,a,r;return(r=(a=this.getAttribute(A.Attributes.STREAM_TYPE))!=null?a:(t=this.media)==null?void 0:t.streamType)!=null?r:z.StreamTypes.UNKNOWN}set streamType(t){this.setAttribute(A.Attributes.STREAM_TYPE,`${t}`)}get defaultStreamType(){var t,a,r;return(r=(a=this.getAttribute(p.DEFAULT_STREAM_TYPE))!=null?a:(t=this.mediaController)==null?void 0:t.getAttribute(p.DEFAULT_STREAM_TYPE))!=null?r:z.StreamTypes.ON_DEMAND}set defaultStreamType(t){t?this.setAttribute(p.DEFAULT_STREAM_TYPE,t):this.removeAttribute(p.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var t,a;return this.hasAttribute(p.TARGET_LIVE_WINDOW)?+this.getAttribute(p.TARGET_LIVE_WINDOW):(a=(t=this.media)==null?void 0:t.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(t){t==this.targetLiveWindow||Number.isNaN(t)&&Number.isNaN(this.targetLiveWindow)||(t==null?this.removeAttribute(p.TARGET_LIVE_WINDOW):this.setAttribute(p.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t;return(t=this.media)==null?void 0:t.liveEdgeStart}get startTime(){return Et(Di(this,A.Attributes.START_TIME))}set startTime(t){this.setAttribute(A.Attributes.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(A.Attributes.PREFER_PLAYBACK);if(t===z.PlaybackTypes.MSE||t===z.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===z.PlaybackTypes.MSE||t===z.PlaybackTypes.NATIVE?this.setAttribute(A.Attributes.PREFER_PLAYBACK,t):this.removeAttribute(A.Attributes.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(te(this,Dt,Ri).call(this),!this.media){Oe("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...zp(this),...t}}get _hlsConfig(){var t;return(t=this.media)==null?void 0:t._hlsConfig}set _hlsConfig(t){if(te(this,Dt,Ri).call(this),!this.media){Oe("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=t}async addCuePoints(t){var a;if(te(this,Dt,Ri).call(this),!this.media){Oe("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(t)}get activeCuePoint(){var t;return(t=this.media)==null?void 0:t.activeCuePoint}get cuePoints(){var t,a;return(a=(t=this.media)==null?void 0:t.cuePoints)!=null?a:[]}getStartDate(){var t;return(t=this.media)==null?void 0:t.getStartDate()}get currentPdt(){var t;return(t=this.media)==null?void 0:t.currentPdt}get tokens(){let t=this.getAttribute(p.PLAYBACK_TOKEN),a=this.getAttribute(p.THUMBNAIL_TOKEN),r=this.getAttribute(p.STORYBOARD_TOKEN);return{...D(this,Pr),...t!=null?{playback:t}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){Ce(this,Pr,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(p.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(p.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(p.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(p.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(p.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(p.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,n){var d;let o=(d=this.media)==null?void 0:d.nativeEl;if(o)return(0,z.addTextTrack)(o,t,a,r,n)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,z.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};Or=new WeakMap,Pr=new WeakMap,ei=new WeakMap,Nr=new WeakMap,Oi=new WeakMap,Dt=new WeakSet,Ri=function(){var t,a,r;if(!D(this,Or)){Ce(this,Or,!0),te(this,ti,ba).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof Z.HTMLElement))throw""}catch{Oe("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof A.default))throw""}catch{Oe("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof sl))throw""}catch{Oe("<media-controller> failed to upgrade!")}kp(this),te(this,xo,jp).call(this),te(this,Ro,ev).call(this),te(this,Do,tv).call(this),Ce(this,ei,(a=(t=this.mediaController)==null?void 0:t.hasAttribute(M.USER_INACTIVE))!=null?a:!0),te(this,Oo,iv).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>{te(this,ti,ba).call(this)})}},wo=new WeakSet,Jp=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{}},Ur=new WeakSet,Zu=function(t){Object.assign(D(this,Oi),t),te(this,ti,ba).call(this)},ti=new WeakSet,ba=function(t={}){Yp(Gp(_0(this,{...D(this,Oi),...t})),this.shadowRoot)},xo=new WeakSet,jp=function(){let t=r=>{var d,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if(qu.includes(n))return;let o=this.getAttribute(r);o!=null?(d=this.mediaTheme)==null||d.setAttribute(n,o):(u=this.mediaTheme)==null||u.removeAttribute(n)};new MutationObserver(r=>{for(let{attributeName:n}of r)t(n)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(t)},Ro=new WeakSet,ev=function(){var a;let t=r=>{let{detail:n}=r;if(n instanceof A.MediaError||(n=new A.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){Zt(n),n.data&&Zt(`${n.name} data:`,n.data);return}let{dialog:o,devlog:d}=Lo(n,!window.navigator.onLine,this.playbackId,this.playbackToken);d.message&&Ru(d),Oe(n),n.data&&Oe(`${n.name} data:`,n.data),te(this,Ur,Zu).call(this,{isDialogOpen:!0,dialog:o})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var o,d,u;if(!(((o=this.media)==null?void 0:o.error)instanceof A.MediaError))return r;let{devlog:n}=Lo((d=this.media)==null?void 0:d.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(u=this.media)==null?void 0:u.error.code,player_error_message:n.message?String(n.message):r.player_error_message,player_error_context:n.context?String(n.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var o,d;let{detail:n}=r;if(!n){let{message:u,code:c}=(d=(o=this.media)==null?void 0:o.error)!=null?d:{};n=new A.MediaError(u,c)}n!=null&&n.fatal&&this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Do=new WeakSet,tv=function(){var a,r,n,o;let t=()=>te(this,ti,ba).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",t),(o=(n=this.media)==null?void 0:n.textTracks)==null||o.addEventListener("removetrack",t)},Oo=new WeakSet,iv=function(){var c,f;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,n=()=>this.streamType===z.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,o=(E,v,b=!1)=>{if(n())return;Array.from(E&&E.activeCues||[]).forEach(_=>{if(!(!_.snapToLines||_.line<-5||_.line>=0&&_.line<10))if(!v||this.paused){let T=_.text.split(`
|
|
2896
|
+
`).length,R=-3;this.streamType===z.StreamTypes.LIVE&&(R=-2);let oe=R-T;if(_.line===oe&&!b)return;r.has(_)||r.set(_,_.line),_.line=oe}else setTimeout(()=>{_.line=r.get(_)||"auto"},500)})},d=()=>{var E,v;o(a,(v=(E=this.mediaController)==null?void 0:E.hasAttribute(M.USER_INACTIVE))!=null?v:!1)},u=()=>{var b,w;let v=Array.from(((w=(b=this.mediaController)==null?void 0:b.media)==null?void 0:w.textTracks)||[]).filter(_=>["subtitles","captions"].includes(_.kind)&&_.mode==="showing")[0];v!==a&&(a==null||a.removeEventListener("cuechange",d)),a=v,a==null||a.addEventListener("cuechange",d),o(a,D(this,ei))};u(),(c=this.textTracks)==null||c.addEventListener("change",u),(f=this.textTracks)==null||f.addEventListener("addtrack",u),this.addEventListener("userinactivechange",()=>{var v,b;let E=(b=(v=this.mediaController)==null?void 0:v.hasAttribute(M.USER_INACTIVE))!=null?b:!0;D(this,ei)!==E&&(Ce(this,ei,E),o(a,D(this,ei)))})};function Di(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}Z.customElements.get("mux-player")||(Z.customElements.define("mux-player",Dr),Z.MuxPlayerElement=Dr);var M0=Dr;
|