@mux/mux-player 3.9.1 → 3.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base.cjs.js +297 -171
- package/dist/base.mjs +1 -1
- package/dist/mux-player.js +310 -184
- package/dist/mux-player.mjs +310 -184
- package/dist/themes/classic/index.cjs.js +20 -6
- package/dist/themes/classic/index.js +20 -6
- package/dist/themes/classic/index.mjs +20 -6
- package/dist/themes/gerwig/index.cjs.js +20 -6
- package/dist/themes/gerwig/index.js +20 -6
- package/dist/themes/gerwig/index.mjs +20 -6
- package/dist/themes/news/index.cjs.js +20 -6
- package/dist/themes/news/index.js +20 -6
- package/dist/themes/news/index.mjs +20 -6
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
package/dist/base.cjs.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";var vs=Object.defineProperty;var sh=Object.getOwnPropertyDescriptor;var lh=Object.getOwnPropertyNames;var dh=Object.prototype.hasOwnProperty;var Jd=t=>{throw TypeError(t)};var uh=(t,e)=>{for(var i in e)vs(t,i,{get:e[i],enumerable:!0})},ch=(t,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of lh(e))!dh.call(t,r)&&r!==i&&vs(t,r,{get:()=>e[r],enumerable:!(a=sh(e,r))||a.enumerable});return t};var mh=t=>ch(vs({},"__esModule",{value:!0}),t);var Es=(t,e,i)=>e.has(t)||Jd("Cannot "+i);var U=(t,e,i)=>(Es(t,e,"read from private field"),i?i.call(t):e.get(t)),he=(t,e,i)=>e.has(t)?Jd("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),ye=(t,e,i,a)=>(Es(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),X=(t,e,i)=>(Es(t,e,"access private method"),i);var oE={};uh(oE,{MediaError:()=>b.MediaError,default:()=>rE,generatePlayerInitTime:()=>R.generatePlayerInitTime,getVideoAttribute:()=>Wt,playerSoftwareName:()=>Rd,playerSoftwareVersion:()=>wd});module.exports=mh(oE);var ki=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class t extends ki{}globalThis.DocumentFragment=t}var Oa=class extends ki{},bs=class extends ki{},hh={get(t){},define(t,e,i){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(Oa)}},Na,gs=class{constructor(e,i={}){he(this,Na);ye(this,Na,i==null?void 0:i.detail)}get detail(){return U(this,Na)}initCustomEvent(){}};Na=new WeakMap;function ph(t,e){return new Oa}var jd={document:{createElement:ph},DocumentFragment,customElements:hh,CustomEvent:gs,EventTarget:ki,HTMLElement:Oa,HTMLVideoElement:bs},eu=typeof window=="undefined"||typeof globalThis.customElements=="undefined",ke=eu?jd:globalThis,Vt=eu?jd.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"},w={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},_s={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_BUFFERED:"mediaBuffered",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_CHAPTERS_CUES:"mediaChaptersCues",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_ENDED:"mediaEnded",MEDIA_ERROR:"mediaError",MEDIA_ERROR_CODE:"mediaErrorCode",MEDIA_ERROR_MESSAGE:"mediaErrorMessage",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_HEIGHT:"mediaHeight",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_IS_PIP:"mediaIsPip",MEDIA_LOADING:"mediaLoading",MEDIA_MUTED:"mediaMuted",MEDIA_PAUSED:"mediaPaused",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_LANG:"mediaLang",MEDIA_WIDTH:"mediaWidth"},tu=Object.entries(_s),n=tu.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{}),fh={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Le=tu.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{...fh}),uE=Object.entries(Le).reduce((t,[e,i])=>{let a=n[e];return a&&(t[i]=a),t},{userinactivechange:"userinactive"}),iu=Object.entries(n).reduce((t,[e,i])=>{let a=Le[e];return a&&(t[i]=a),t},{userinactive:"userinactivechange"}),pe={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Tt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var jr={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},fe={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Ne={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var au={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function ru(t){return t==null?void 0:t.map(Eh).join(" ")}function ou(t){return t==null?void 0:t.split(/\s+/).map(bh)}function Eh(t){if(t){let{id:e,width:i,height:a}=t;return[e,i,a].filter(r=>r!=null).join(":")}}function bh(t){if(t){let[e,i,a]=t.split(":");return{id:e,width:+i,height:+a}}}function nu(t){return t==null?void 0:t.map(gh).join(" ")}function su(t){return t==null?void 0:t.split(/\s+/).map(_h)}function gh(t){if(t){let{id:e,kind:i,language:a,label:r}=t;return[e,i,a,r].filter(o=>o!=null).join(":")}}function _h(t){if(t){let[e,i,a,r]=t.split(":");return{id:e,kind:i,language:a,label:r}}}function lu(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function Si(t){return typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t)}function eo(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))}var to=t=>new Promise(e=>setTimeout(e,t));var du=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Ah=(t,e)=>{let i=t===1?du[e].singular:du[e].plural;return`${t} ${i}`},Kt=t=>{if(!Si(t))return"";let e=Math.abs(t),i=e!==t,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((d,u)=>d&&Ah(d,u)).filter(d=>d).join(", ")}${i?" remaining":""}`};function Pe(t,e){let i=!1;t<0&&(i=!0,t=0-t),t=t<0?0:t;let a=Math.floor(t%60),r=Math.floor(t/60%60),o=Math.floor(t/3600),s=Math.floor(e/60%60),d=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(o=r=a="0"),o=o>0||d>0?o+":":"",r=((o||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(i?"-":"")+o+r+a}var hE=Object.freeze({length:0,start(t){let e=t>>>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(t){let e=t>>>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 uu={"Start airplay":"Start airplay","Stop airplay":"Stop airplay",Audio:"Audio",Captions:"Captions","Enable captions":"Enable captions","Disable captions":"Disable captions","Start casting":"Start casting","Stop casting":"Stop casting","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",Mute:"Mute",Unmute:"Unmute","Enter picture in picture mode":"Enter picture in picture mode","Exit picture in picture mode":"Exit picture in picture mode",Play:"Play",Pause:"Pause","Playback rate":"Playback rate","Playback rate {playbackRate}":"Playback rate {playbackRate}",Quality:"Quality","Seek backward":"Seek backward","Seek forward":"Seek forward",Settings:"Settings",Auto:"Auto","audio player":"audio player","video player":"video player",volume:"volume",seek:"seek","closed captions":"closed captions","current playback rate":"current playback rate","playback time":"playback time","media loading":"media loading",settings:"settings","audio tracks":"audio tracks",quality:"quality",play:"play",pause:"pause",mute:"mute",unmute:"unmute","chapter: {chapterName}":"chapter: {chapterName}",live:"live",Off:"Off","start airplay":"start airplay","stop airplay":"stop airplay","start casting":"start casting","stop casting":"stop casting","enter fullscreen mode":"enter fullscreen mode","exit fullscreen mode":"exit fullscreen mode","enter picture in picture mode":"enter picture in picture mode","exit picture in picture mode":"exit picture in picture mode","seek to live":"seek to live","playing live":"playing live","seek back {seekOffset} seconds":"seek back {seekOffset} seconds","seek forward {seekOffset} seconds":"seek forward {seekOffset} seconds","Network Error":"Network Error","Decode Error":"Decode Error","Source Not Supported":"Source Not Supported","Encryption Error":"Encryption Error","A network error caused the media download to fail.":"A network error caused the media download to fail.","A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.","An unsupported error occurred. The server or network failed, or your browser does not support this format.":"An unsupported error occurred. The server or network failed, or your browser does not support this format.","The media is encrypted and there are no keys to decrypt it.":"The media is encrypted and there are no keys to decrypt it."};var cu,As={en:uu},Ts=((cu=globalThis.navigator)==null?void 0:cu.language)||"en",mu=t=>{Ts=t};var yh=t=>{var e,i,a;let[r]=Ts.split("-");return((e=As[Ts])==null?void 0:e[t])||((i=As[r])==null?void 0:i[t])||((a=As.en)==null?void 0:a[t])||t},m=(t,e={})=>yh(t).replace(/\{(\w+)\}/g,(i,a)=>a in e?String(e[a]):`{${a}}`);var io=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},ao=class extends io{},ro=class extends ao{constructor(){super(...arguments),this.role=null}},ys=class{observe(){}unobserve(){}disconnect(){}},hu={createElement:function(){return new Pa.HTMLElement},createElementNS:function(){return new Pa.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(t){return!1}},Pa={ResizeObserver:ys,document:hu,Node:ao,Element:ro,HTMLElement:class extends ro{constructor(){super(...arguments),this.innerHTML=""}get content(){return new Pa.DocumentFragment}},DocumentFragment:class extends io{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(t){return null},setItem(t,e){},removeItem(t){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(t){return{matches:!1,media:t}},DOMParser:class{parseFromString(e,i){return{body:{textContent:e}}}}},pu=typeof window=="undefined"||typeof window.customElements=="undefined",fu=Object.keys(Pa).every(t=>t in globalThis),l=pu&&!fu?Pa:globalThis,Y=pu&&!fu?hu:globalThis.document;var vu=new WeakMap,ks=t=>{let e=vu.get(t);return e||vu.set(t,e=new Set),e},Eu=new l.ResizeObserver(t=>{for(let e of t)for(let i of ks(e.target))i(e)});function ut(t,e){ks(t).add(e),Eu.observe(t)}function ct(t,e){let i=ks(t);i.delete(e),i.size||Eu.unobserve(t)}function Z(t){let e={};for(let i of t)e[i.name]=i.value;return e}function q(t){var e;return(e=oo(t))!=null?e:Fe(t,"media-controller")}function oo(t){var e;let{MEDIA_CONTROLLER:i}=w,a=t.getAttribute(i);if(a)return(e=Gt(t))==null?void 0:e.getElementById(a)}var no=(t,e,i=".value")=>{let a=t.querySelector(i);a&&(a.textContent=e)},kh=(t,e)=>{let i=`slot[name="${e}"]`,a=t.shadowRoot.querySelector(i);return a?a.children:[]},so=(t,e)=>kh(t,e)[0],de=(t,e)=>!t||!e?!1:t!=null&&t.contains(e)?!0:de(t,e.getRootNode().host),Fe=(t,e)=>{if(!t)return null;let i=t.closest(e);return i||Fe(t.getRootNode().host,e)};function Ua(t=document){var e;let i=t==null?void 0:t.activeElement;return i?(e=Ua(i.shadowRoot))!=null?e:i:null}function Gt(t){var e;let i=(e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t);return i instanceof ShadowRoot||i instanceof Document?i:null}function lo(t,{depth:e=3,checkOpacity:i=!0,checkVisibilityCSS:a=!0}={}){if(t.checkVisibility)return t.checkVisibility({checkOpacity:i,checkVisibilityCSS:a});let r=t;for(;r&&e>0;){let o=getComputedStyle(r);if(i&&o.opacity==="0"||a&&o.visibility==="hidden"||o.display==="none")return!1;r=r.parentElement,e--}return!0}function bu(t,e,i,a){let r=a.x-i.x,o=a.y-i.y,s=r*r+o*o;if(s===0)return 0;let d=((t-i.x)*r+(e-i.y)*o)/s;return Math.max(0,Math.min(1,d))}function F(t,e){let i=Sh(t,a=>a===e);return i||Ss(t,e)}function Sh(t,e){var i,a;let r;for(r of(i=t.querySelectorAll("style:not([media])"))!=null?i:[]){let o;try{o=(a=r.sheet)==null?void 0:a.cssRules}catch{continue}for(let s of o!=null?o:[])if(e(s.selectorText))return s}}function Ss(t,e){var i,a;let r=(i=t.querySelectorAll("style:not([media])"))!=null?i:[],o=r==null?void 0:r[r.length-1];return o!=null&&o.sheet?(o==null||o.sheet.insertRule(`${e}{}`,o.sheet.cssRules.length),(a=o.sheet.cssRules)==null?void 0:a[o.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",t),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function D(t,e,i=Number.NaN){let a=t.getAttribute(e);return a!=null?+a:i}function N(t,e,i){let a=+i;if(i==null||Number.isNaN(a)){t.hasAttribute(e)&&t.removeAttribute(e);return}D(t,e,void 0)!==a&&t.setAttribute(e,`${a}`)}function k(t,e){return t.hasAttribute(e)}function S(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}k(t,e)!=i&&t.toggleAttribute(e,i)}function M(t,e,i=null){var a;return(a=t.getAttribute(e))!=null?a:i}function C(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}let a=`${i}`;M(t,e,void 0)!==a&&t.setAttribute(e,a)}var gu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},yt=(t,e,i)=>(gu(t,e,"read from private field"),i?i.call(t):e.get(t)),Ih=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},uo=(t,e,i,a)=>(gu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ve;function Mh(t){return`
|
|
1
|
+
"use strict";var Ms=Object.defineProperty;var Eh=Object.getOwnPropertyDescriptor;var bh=Object.getOwnPropertyNames;var gh=Object.prototype.hasOwnProperty;var nu=t=>{throw TypeError(t)};var _h=(t,e)=>{for(var i in e)Ms(t,i,{get:e[i],enumerable:!0})},Ah=(t,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of bh(e))!gh.call(t,r)&&r!==i&&Ms(t,r,{get:()=>e[r],enumerable:!(a=Eh(e,r))||a.enumerable});return t};var Th=t=>Ah(Ms({},"__esModule",{value:!0}),t);var Cs=(t,e,i)=>e.has(t)||nu("Cannot "+i);var H=(t,e,i)=>(Cs(t,e,"read from private field"),i?i.call(t):e.get(t)),pe=(t,e,i)=>e.has(t)?nu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),ye=(t,e,i,a)=>(Cs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),X=(t,e,i)=>(Cs(t,e,"access private method"),i);var TE={};_h(TE,{MediaError:()=>g.MediaError,default:()=>AE,generatePlayerInitTime:()=>D.generatePlayerInitTime,getVideoAttribute:()=>Vt,playerSoftwareName:()=>Wd,playerSoftwareVersion:()=>$d});module.exports=Th(TE);var Mi=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Mi{}globalThis.DocumentFragment=t}var Wa=class extends Mi{},Ls=class extends Mi{},yh={get(t){},define(t,e,i){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(Wa)}},Fa,ws=class{constructor(e,i={}){pe(this,Fa);ye(this,Fa,i==null?void 0:i.detail)}get detail(){return H(this,Fa)}initCustomEvent(){}};Fa=new WeakMap;function kh(t,e){return new Wa}var su={document:{createElement:kh},DocumentFragment,customElements:yh,CustomEvent:ws,EventTarget:Mi,HTMLElement:Wa,HTMLVideoElement:Ls},lu=typeof window=="undefined"||typeof globalThis.customElements=="undefined",ke=lu?su:globalThis,Gt=lu?su.document:globalThis.document;var m={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_LOOP_REQUEST:"medialooprequest",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"},x={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Rs={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_BUFFERED:"mediaBuffered",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_CHAPTERS_CUES:"mediaChaptersCues",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_ENDED:"mediaEnded",MEDIA_ERROR:"mediaError",MEDIA_ERROR_CODE:"mediaErrorCode",MEDIA_ERROR_MESSAGE:"mediaErrorMessage",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_HEIGHT:"mediaHeight",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_IS_PIP:"mediaIsPip",MEDIA_LOADING:"mediaLoading",MEDIA_MUTED:"mediaMuted",MEDIA_LOOP:"mediaLoop",MEDIA_PAUSED:"mediaPaused",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_LANG:"mediaLang",MEDIA_WIDTH:"mediaWidth"},du=Object.entries(Rs),n=du.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{}),Sh={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Le=du.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{...Sh}),ME=Object.entries(Le).reduce((t,[e,i])=>{let a=n[e];return a&&(t[i]=a),t},{userinactivechange:"userinactive"}),uu=Object.entries(n).reduce((t,[e,i])=>{let a=Le[e];return a&&(t[i]=a),t},{userinactive:"userinactivechange"}),fe={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},St={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var so={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},ve={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Pe={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var cu={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function mu(t){return t==null?void 0:t.map(Mh).join(" ")}function hu(t){return t==null?void 0:t.split(/\s+/).map(Ch)}function Mh(t){if(t){let{id:e,width:i,height:a}=t;return[e,i,a].filter(r=>r!=null).join(":")}}function Ch(t){if(t){let[e,i,a]=t.split(":");return{id:e,width:+i,height:+a}}}function pu(t){return t==null?void 0:t.map(Lh).join(" ")}function fu(t){return t==null?void 0:t.split(/\s+/).map(wh)}function Lh(t){if(t){let{id:e,kind:i,language:a,label:r}=t;return[e,i,a,r].filter(o=>o!=null).join(":")}}function wh(t){if(t){let[e,i,a,r]=t.split(":");return{id:e,kind:i,language:a,label:r}}}function vu(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function Ci(t){return typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t)}function lo(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))}var uo=t=>new Promise(e=>setTimeout(e,t));var Eu=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Rh=(t,e)=>{let i=t===1?Eu[e].singular:Eu[e].plural;return`${t} ${i}`},Yt=t=>{if(!Ci(t))return"";let e=Math.abs(t),i=e!==t,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((d,u)=>d&&Rh(d,u)).filter(d=>d).join(", ")}${i?" remaining":""}`};function Ne(t,e){let i=!1;t<0&&(i=!0,t=0-t),t=t<0?0:t;let a=Math.floor(t%60),r=Math.floor(t/60%60),o=Math.floor(t/3600),s=Math.floor(e/60%60),d=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(o=r=a="0"),o=o>0||d>0?o+":":"",r=((o||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(i?"-":"")+o+r+a}var wE=Object.freeze({length:0,start(t){let e=t>>>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(t){let e=t>>>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 bu={"Start airplay":"Start airplay","Stop airplay":"Stop airplay",Audio:"Audio",Captions:"Captions","Enable captions":"Enable captions","Disable captions":"Disable captions","Start casting":"Start casting","Stop casting":"Stop casting","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",Mute:"Mute",Unmute:"Unmute",Loop:"Loop","Enter picture in picture mode":"Enter picture in picture mode","Exit picture in picture mode":"Exit picture in picture mode",Play:"Play",Pause:"Pause","Playback rate":"Playback rate","Playback rate {playbackRate}":"Playback rate {playbackRate}",Quality:"Quality","Seek backward":"Seek backward","Seek forward":"Seek forward",Settings:"Settings",Auto:"Auto","audio player":"audio player","video player":"video player",volume:"volume",seek:"seek","closed captions":"closed captions","current playback rate":"current playback rate","playback time":"playback time","media loading":"media loading",settings:"settings","audio tracks":"audio tracks",quality:"quality",play:"play",pause:"pause",mute:"mute",unmute:"unmute","chapter: {chapterName}":"chapter: {chapterName}",live:"live",Off:"Off","start airplay":"start airplay","stop airplay":"stop airplay","start casting":"start casting","stop casting":"stop casting","enter fullscreen mode":"enter fullscreen mode","exit fullscreen mode":"exit fullscreen mode","enter picture in picture mode":"enter picture in picture mode","exit picture in picture mode":"exit picture in picture mode","seek to live":"seek to live","playing live":"playing live","seek back {seekOffset} seconds":"seek back {seekOffset} seconds","seek forward {seekOffset} seconds":"seek forward {seekOffset} seconds","Network Error":"Network Error","Decode Error":"Decode Error","Source Not Supported":"Source Not Supported","Encryption Error":"Encryption Error","A network error caused the media download to fail.":"A network error caused the media download to fail.","A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.","An unsupported error occurred. The server or network failed, or your browser does not support this format.":"An unsupported error occurred. The server or network failed, or your browser does not support this format.","The media is encrypted and there are no keys to decrypt it.":"The media is encrypted and there are no keys to decrypt it."};var gu,xs={en:bu},Ds=((gu=globalThis.navigator)==null?void 0:gu.language)||"en",_u=t=>{Ds=t};var Dh=t=>{var e,i,a;let[r]=Ds.split("-");return((e=xs[Ds])==null?void 0:e[t])||((i=xs[r])==null?void 0:i[t])||((a=xs.en)==null?void 0:a[t])||t},h=(t,e={})=>Dh(t).replace(/\{(\w+)\}/g,(i,a)=>a in e?String(e[a]):`{${a}}`);var co=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},mo=class extends co{},ho=class extends mo{constructor(){super(...arguments),this.role=null}},Os=class{observe(){}unobserve(){}disconnect(){}},Au={createElement:function(){return new Va.HTMLElement},createElementNS:function(){return new Va.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(t){return!1}},Va={ResizeObserver:Os,document:Au,Node:mo,Element:ho,HTMLElement:class extends ho{constructor(){super(...arguments),this.innerHTML=""}get content(){return new Va.DocumentFragment}},DocumentFragment:class extends co{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(t){return null},setItem(t,e){},removeItem(t){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(t){return{matches:!1,media:t}},DOMParser:class{parseFromString(e,i){return{body:{textContent:e}}}}},Tu="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window=="undefined"||typeof window.customElements=="undefined",yu=Object.keys(Va).every(t=>t in globalThis),l=Tu&&!yu?Va:globalThis,V=Tu&&!yu?Au:globalThis.document;var ku=new WeakMap,Ps=t=>{let e=ku.get(t);return e||ku.set(t,e=new Set),e},Su=new l.ResizeObserver(t=>{for(let e of t)for(let i of Ps(e.target))i(e)});function ht(t,e){Ps(t).add(e),Su.observe(t)}function pt(t,e){let i=Ps(t);i.delete(e),i.size||Su.unobserve(t)}function Z(t){let e={};for(let i of t)e[i.name]=i.value;return e}function Y(t){var e;return(e=po(t))!=null?e:Ve(t,"media-controller")}function po(t){var e;let{MEDIA_CONTROLLER:i}=x,a=t.getAttribute(i);if(a)return(e=qt(t))==null?void 0:e.getElementById(a)}var fo=(t,e,i=".value")=>{let a=t.querySelector(i);a&&(a.textContent=e)},Oh=(t,e)=>{let i=`slot[name="${e}"]`,a=t.shadowRoot.querySelector(i);return a?a.children:[]},vo=(t,e)=>Oh(t,e)[0],ue=(t,e)=>!t||!e?!1:t!=null&&t.contains(e)?!0:ue(t,e.getRootNode().host),Ve=(t,e)=>{if(!t)return null;let i=t.closest(e);return i||Ve(t.getRootNode().host,e)};function Ka(t=document){var e;let i=t==null?void 0:t.activeElement;return i?(e=Ka(i.shadowRoot))!=null?e:i:null}function qt(t){var e;let i=(e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t);return i instanceof ShadowRoot||i instanceof Document?i:null}function Eo(t,{depth:e=3,checkOpacity:i=!0,checkVisibilityCSS:a=!0}={}){if(t.checkVisibility)return t.checkVisibility({checkOpacity:i,checkVisibilityCSS:a});let r=t;for(;r&&e>0;){let o=getComputedStyle(r);if(i&&o.opacity==="0"||a&&o.visibility==="hidden"||o.display==="none")return!1;r=r.parentElement,e--}return!0}function Iu(t,e,i,a){let r=a.x-i.x,o=a.y-i.y,s=r*r+o*o;if(s===0)return 0;let d=((t-i.x)*r+(e-i.y)*o)/s;return Math.max(0,Math.min(1,d))}function q(t,e){let i=Ph(t,a=>a===e);return i||Ga(t,e)}function Ph(t,e){var i,a;let r;for(r of(i=t.querySelectorAll("style:not([media])"))!=null?i:[]){let o;try{o=(a=r.sheet)==null?void 0:a.cssRules}catch{continue}for(let s of o!=null?o:[])if(e(s.selectorText))return s}}function Ga(t,e){var i,a;let r=(i=t.querySelectorAll("style:not([media])"))!=null?i:[],o=r==null?void 0:r[r.length-1];return o!=null&&o.sheet?(o==null||o.sheet.insertRule(`${e}{}`,o.sheet.cssRules.length),(a=o.sheet.cssRules)==null?void 0:a[o.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",t),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function O(t,e,i=Number.NaN){let a=t.getAttribute(e);return a!=null?+a:i}function N(t,e,i){let a=+i;if(i==null||Number.isNaN(a)){t.hasAttribute(e)&&t.removeAttribute(e);return}O(t,e,void 0)!==a&&t.setAttribute(e,`${a}`)}function k(t,e){return t.hasAttribute(e)}function S(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}k(t,e)!=i&&t.toggleAttribute(e,i)}function w(t,e,i=null){var a;return(a=t.getAttribute(e))!=null?a:i}function R(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}let a=`${i}`;w(t,e,void 0)!==a&&t.setAttribute(e,a)}var Mu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},It=(t,e,i)=>(Mu(t,e,"read from private field"),i?i.call(t):e.get(t)),Nh=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},bo=(t,e,i,a)=>(Mu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ee;function Uh(t){return`
|
|
2
2
|
<style>
|
|
3
3
|
:host {
|
|
4
4
|
display: var(--media-control-display, var(--media-gesture-receiver-display, inline-block));
|
|
5
5
|
box-sizing: border-box;
|
|
6
6
|
}
|
|
7
7
|
</style>
|
|
8
|
-
`}var
|
|
8
|
+
`}var Li=class extends l.HTMLElement{constructor(){if(super(),Nh(this,Ee,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[x.MEDIA_CONTROLLER,n.MEDIA_PAUSED]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===x.MEDIA_CONTROLLER&&(i&&((o=(r=It(this,Ee))==null?void 0:r.unassociateElement)==null||o.call(r,this),bo(this,Ee,null)),a&&this.isConnected&&(bo(this,Ee,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=It(this,Ee))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,i,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),bo(this,Ee,Hh(this)),this.getAttribute(x.MEDIA_CONTROLLER)&&((i=(e=It(this,Ee))==null?void 0:e.associateElement)==null||i.call(e,this)),(a=It(this,Ee))==null||a.addEventListener("pointerdown",this),(r=It(this,Ee))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,i,a,r;this.getAttribute(x.MEDIA_CONTROLLER)&&((i=(e=It(this,Ee))==null?void 0:e.unassociateElement)==null||i.call(e,this)),(a=It(this,Ee))==null||a.removeEventListener("pointerdown",this),(r=It(this,Ee))==null||r.removeEventListener("click",this),bo(this,Ee,null)}handleEvent(e){var i;let a=(i=e.composedPath())==null?void 0:i[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:o,clientY:s}=e,{left:d,top:u,width:p,height:T}=this.getBoundingClientRect(),_=o-d,E=s-u;if(_<0||E<0||_>p||E>T||p===0&&T===0)return;let f=this._pointerType||"mouse";if(this._pointerType=void 0,f===so.TOUCH){this.handleTap(e);return}else if(f===so.MOUSE||f===so.PEN){this.handleMouseClick(e);return}}}}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let i=this.mediaPaused?m.MEDIA_PLAY_REQUEST:m.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(i,{composed:!0,bubbles:!0}))}};Ee=new WeakMap;Li.shadowRootOptions={mode:"open"};Li.getTemplateHTML=Uh;function Hh(t){var e;let i=t.getAttribute(x.MEDIA_CONTROLLER);return i?(e=t.getRootNode())==null?void 0:e.getElementById(i):Ve(t,"media-controller")}l.customElements.get("media-gesture-receiver")||l.customElements.define("media-gesture-receiver",Li);var go=Li;var Bs=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Ie=(t,e,i)=>(Bs(t,e,"read from private field"),i?i.call(t):e.get(t)),Se=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Zt=(t,e,i,a)=>(Bs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),we=(t,e,i)=>(Bs(t,e,"access private method"),i),To,wi,qa,Ri,_o,Ns,Cu,Ya,Ao,Us,Lu,Hs,wu,Za,yo,ko,$s,xi,Qa,y={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"};function Bh(t){return`
|
|
9
9
|
<style>
|
|
10
10
|
|
|
11
11
|
:host([${n.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
|
|
@@ -143,8 +143,8 @@
|
|
|
143
143
|
<slot name="poster" part="layer poster-layer"></slot>
|
|
144
144
|
<slot name="gestures-chrome" part="layer gesture-layer">
|
|
145
145
|
<media-gesture-receiver slot="gestures-chrome">
|
|
146
|
-
<template shadowrootmode="${
|
|
147
|
-
${
|
|
146
|
+
<template shadowrootmode="${go.shadowRootOptions.mode}">
|
|
147
|
+
${go.getTemplateHTML({})}
|
|
148
148
|
</template>
|
|
149
149
|
</media-gesture-receiver>
|
|
150
150
|
</slot>
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
<slot part="bottom chrome"></slot>
|
|
157
157
|
</span>
|
|
158
158
|
<slot name="dialog" part="layer dialog-layer"></slot>
|
|
159
|
-
`}var wh=Object.values(n),Rh="sm:384 md:576 lg:768 xl:960";function xh(t){yu(t.target,t.contentRect.width)}function yu(t,e){var i;if(!t.isConnected)return;let a=(i=t.getAttribute(y.BREAKPOINTS))!=null?i:Rh,r=Dh(a),o=Oh(r,e),s=!1;if(Object.keys(r).forEach(d=>{if(o.includes(d)){t.hasAttribute(`breakpoint${d}`)||(t.setAttribute(`breakpoint${d}`,""),s=!0);return}t.hasAttribute(`breakpoint${d}`)&&(t.removeAttribute(`breakpoint${d}`),s=!0)}),s){let d=new CustomEvent(Le.BREAKPOINTS_CHANGE,{detail:o});t.dispatchEvent(d)}t.breakpointsComputed||(t.breakpointsComputed=!0,t.dispatchEvent(new CustomEvent(Le.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function Dh(t){let e=t.split(/\s+/);return Object.fromEntries(e.map(i=>i.split(":")))}function Oh(t,e){return Object.keys(t).filter(i=>e>=parseInt(t[i]))}var qt=class extends l.HTMLElement{constructor(){if(super(),Se(this,Is),Se(this,Ms),Se(this,Cs),Se(this,$a),Se(this,vo),Se(this,Li),Se(this,po,0),Se(this,Mi,null),Se(this,Ba,null),Se(this,Ci,void 0),this.breakpointsComputed=!1,Se(this,mo,new MutationObserver(we(this,Is,_u).bind(this))),Se(this,Ha,!1),Se(this,ho,i=>{Ie(this,Ha)||(setTimeout(()=>{xh(i),Yt(this,Ha,!1)},0),Yt(this,Ha,!0))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let i=Z(this.attributes),a=this.constructor.getTemplateHTML(i);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(a):this.shadowRoot.innerHTML=a}let e=this.querySelector(":scope > slot[slot=media]");e&&e.addEventListener("slotchange",()=>{if(!e.assignedElements({flatten:!0}).length){Ie(this,Mi)&&this.mediaUnsetCallback(Ie(this,Mi));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[y.AUTOHIDE,y.GESTURES_DISABLED].concat(wh).filter(e=>![n.MEDIA_RENDITION_LIST,n.MEDIA_AUDIO_TRACK_LIST,n.MEDIA_CHAPTERS_CUES,n.MEDIA_WIDTH,n.MEDIA_HEIGHT,n.MEDIA_ERROR,n.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,i,a){e.toLowerCase()==y.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&&(Yt(this,Mi,e),e.localName.includes("-")&&await l.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;Ie(this,mo).observe(this,{childList:!0,subtree:!0}),ut(this,Ie(this,ho));let a=this.getAttribute(y.AUDIO)!=null?m("audio player"):m("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.handleMediaUpdated(this.media),this.setAttribute(y.USER_INACTIVE,""),yu(this,this.getBoundingClientRect().width),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;Ie(this,mo).disconnect(),ct(this,Ie(this,ho)),this.media&&this.mediaUnsetCallback(this.media),(e=l.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Yt(this,Mi,null)}handleEvent(e){switch(e.type){case"pointerdown":Yt(this,po,e.timeStamp);break;case"pointermove":we(this,Ms,Au).call(this,e);break;case"pointerup":we(this,Cs,Tu).call(this,e);break;case"mouseleave":we(this,$a,fo).call(this);break;case"mouseup":this.removeAttribute(y.KEYBOARD_CONTROL);break;case"keyup":we(this,Li,Wa).call(this),this.setAttribute(y.KEYBOARD_CONTROL,"");break}}set autohide(e){let i=Number(e);Yt(this,Ci,isNaN(i)?0:i)}get autohide(){return(Ie(this,Ci)===void 0?2:Ie(this,Ci)).toString()}get breakpoints(){return M(this,y.BREAKPOINTS)}set breakpoints(e){C(this,y.BREAKPOINTS,e)}get audio(){return k(this,y.AUDIO)}set audio(e){S(this,y.AUDIO,e)}get gesturesDisabled(){return k(this,y.GESTURES_DISABLED)}set gesturesDisabled(e){S(this,y.GESTURES_DISABLED,e)}get keyboardControl(){return k(this,y.KEYBOARD_CONTROL)}set keyboardControl(e){S(this,y.KEYBOARD_CONTROL,e)}get noAutohide(){return k(this,y.NO_AUTOHIDE)}set noAutohide(e){S(this,y.NO_AUTOHIDE,e)}get autohideOverControls(){return k(this,y.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){S(this,y.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return k(this,y.USER_INACTIVE)}set userInteractive(e){S(this,y.USER_INACTIVE,e)}};po=new WeakMap;Mi=new WeakMap;Ba=new WeakMap;Ci=new WeakMap;mo=new WeakMap;Is=new WeakSet;_u=function(t){let e=this.media;for(let i of t){if(i.type!=="childList")continue;let a=i.removedNodes;for(let r of a){if(r.slot!="media"||i.target!=this)continue;let o=i.previousSibling&&i.previousSibling.previousElementSibling;if(!o||!e)this.mediaUnsetCallback(r);else{let s=o.slot!=="media";for(;(o=o.previousSibling)!==null;)o.slot=="media"&&(s=!1);s&&this.mediaUnsetCallback(r)}}if(e)for(let r of i.addedNodes)r===e&&this.handleMediaUpdated(e)}};Ha=new WeakMap;ho=new WeakMap;Ms=new WeakSet;Au=function(t){if(t.pointerType!=="mouse"&&t.timeStamp-Ie(this,po)<250)return;we(this,vo,ws).call(this),clearTimeout(Ie(this,Ba));let e=this.hasAttribute(y.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(t.target)||e)&&we(this,Li,Wa).call(this)};Cs=new WeakSet;Tu=function(t){if(t.pointerType==="touch"){let e=!this.hasAttribute(y.USER_INACTIVE);[this,this.media].includes(t.target)&&e?we(this,$a,fo).call(this):we(this,Li,Wa).call(this)}else t.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&we(this,Li,Wa).call(this)};$a=new WeakSet;fo=function(){if(Ie(this,Ci)<0||this.hasAttribute(y.USER_INACTIVE))return;this.setAttribute(y.USER_INACTIVE,"");let t=new l.CustomEvent(Le.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(t)};vo=new WeakSet;ws=function(){if(!this.hasAttribute(y.USER_INACTIVE))return;this.removeAttribute(y.USER_INACTIVE);let t=new l.CustomEvent(Le.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(t)};Li=new WeakSet;Wa=function(){we(this,vo,ws).call(this),clearTimeout(Ie(this,Ba));let t=parseInt(this.autohide);t<0||Yt(this,Ba,setTimeout(()=>{we(this,$a,fo).call(this)},t*1e3))};qt.shadowRootOptions={mode:"open"};qt.getTemplateHTML=Lh;l.customElements.get("media-container")||l.customElements.define("media-container",qt);var ku=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},re=(t,e,i)=>(ku(t,e,"read from private field"),i?i.call(t):e.get(t)),Fa=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Eo=(t,e,i,a)=>(ku(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),wi,Ri,bo,Zt,mt,kt,St=class{constructor(e,i,{defaultValue:a}={defaultValue:void 0}){Fa(this,mt),Fa(this,wi,void 0),Fa(this,Ri,void 0),Fa(this,bo,void 0),Fa(this,Zt,new Set),Eo(this,wi,e),Eo(this,Ri,i),Eo(this,bo,new Set(a))}[Symbol.iterator](){return re(this,mt,kt).values()}get length(){return re(this,mt,kt).size}get value(){var e;return(e=[...re(this,mt,kt)].join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Eo(this,Zt,new Set),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return[...re(this,mt,kt)][e]}values(){return re(this,mt,kt).values()}forEach(e,i){re(this,mt,kt).forEach(e,i)}add(...e){var i,a;e.forEach(r=>re(this,Zt).add(r)),!(this.value===""&&!((i=re(this,wi))!=null&&i.hasAttribute(`${re(this,Ri)}`)))&&((a=re(this,wi))==null||a.setAttribute(`${re(this,Ri)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>re(this,Zt).delete(a)),(i=re(this,wi))==null||i.setAttribute(`${re(this,Ri)}`,`${this.value}`)}contains(e){return re(this,mt,kt).has(e)}toggle(e,i){return typeof i!="undefined"?i?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,i){return this.remove(e),this.add(i),e===i}};wi=new WeakMap;Ri=new WeakMap;bo=new WeakMap;Zt=new WeakMap;mt=new WeakSet;kt=function(){return re(this,Zt).size?re(this,Zt):re(this,bo)};var Nh=(t="")=>t.split(/\s+/),Su=(t="")=>{let[e,i,a]=t.split(":"),r=a?decodeURIComponent(a):void 0;return{kind:e==="cc"?pe.CAPTIONS:pe.SUBTITLES,language:i,label:r}},Qt=(t="",e={})=>Nh(t).map(i=>{let a=Su(i);return{...e,...a}}),Rs=t=>t?Array.isArray(t)?t.map(e=>typeof e=="string"?Su(e):e):typeof t=="string"?Qt(t):[t]:[],go=({kind:t,label:e,language:i}={kind:"subtitles"})=>e?`${t==="captions"?"cc":"sb"}:${i}:${encodeURIComponent(e)}`:i,ht=(t=[])=>Array.prototype.map.call(t,go).join(" "),Ph=(t,e)=>i=>i[t]===e,Iu=t=>{let e=Object.entries(t).map(([i,a])=>Ph(i,a));return i=>e.every(a=>a(i))},zt=(t,e=[],i=[])=>{let a=Rs(i).map(Iu),r=o=>a.some(s=>s(o));Array.from(e).filter(r).forEach(o=>{o.mode=t})},Xt=(t,e=()=>!0)=>{if(!(t!=null&&t.textTracks))return[];let i=typeof e=="function"?e:Iu(e);return Array.from(t.textTracks).filter(i)},_o=t=>{var e;return!!((e=t.mediaSubtitlesShowing)!=null&&e.length)||t.hasAttribute(n.MEDIA_SUBTITLES_SHOWING)};var Cu=t=>{var e;let{media:i,fullscreenElement:a}=t;try{let r=a&&"requestFullscreen"in a?"requestFullscreen":a&&"webkitRequestFullScreen"in a?"webkitRequestFullScreen":void 0;if(r){let o=(e=a[r])==null?void 0:e.call(a);if(o instanceof Promise)return o.catch(()=>{})}else i!=null&&i.webkitEnterFullscreen?i.webkitEnterFullscreen():i!=null&&i.requestFullscreen&&i.requestFullscreen()}catch(r){console.error(r)}},Mu="exitFullscreen"in Y?"exitFullscreen":"webkitExitFullscreen"in Y?"webkitExitFullscreen":"webkitCancelFullScreen"in Y?"webkitCancelFullScreen":void 0,Lu=t=>{var e;let{documentElement:i}=t;if(Mu){let a=(e=i==null?void 0:i[Mu])==null?void 0:e.call(i);if(a instanceof Promise)return a.catch(()=>{})}},Va="fullscreenElement"in Y?"fullscreenElement":"webkitFullscreenElement"in Y?"webkitFullscreenElement":void 0,Uh=t=>{let{documentElement:e,media:i}=t,a=e==null?void 0:e[Va];return!a&&"webkitDisplayingFullscreen"in i&&"webkitPresentationMode"in i&&i.webkitDisplayingFullscreen&&i.webkitPresentationMode===au.FULLSCREEN?i:a},wu=t=>{var e;let{media:i,documentElement:a,fullscreenElement:r=i}=t;if(!i||!a)return!1;let o=Uh(t);if(!o)return!1;if(o===r||o===i)return!0;if(o.localName.includes("-")){let s=o.shadowRoot;if(!(Va in s))return de(o,r);for(;s!=null&&s[Va];){if(s[Va]===r)return!0;s=(e=s[Va])==null?void 0:e.shadowRoot}}return!1},Hh="fullscreenEnabled"in Y?"fullscreenEnabled":"webkitFullscreenEnabled"in Y?"webkitFullscreenEnabled":void 0,Ru=t=>{let{documentElement:e,media:i}=t;return!!(e!=null&&e[Hh])||i&&"webkitSupportsFullscreen"in i};var Ao,xs=()=>{var t,e;return Ao||(Ao=(e=(t=Y)==null?void 0:t.createElement)==null?void 0:e.call(t,"video"),Ao)},xu=async(t=xs())=>{if(!t)return!1;let e=t.volume;t.volume=e/2+.1;let i=new AbortController,a=await Promise.race([Bh(t,i.signal),$h(t,e)]);return i.abort(),a},Bh=(t,e)=>new Promise(i=>{t.addEventListener("volumechange",()=>i(!0),{signal:e})}),$h=async(t,e)=>{for(let i=0;i<10;i++){if(t.volume===e)return!1;await to(10)}return t.volume!==e},Wh=/.*Version\/.*Safari\/.*/.test(l.navigator.userAgent),Ds=(t=xs())=>l.matchMedia("(display-mode: standalone)").matches&&Wh?!1:typeof(t==null?void 0:t.requestPictureInPicture)=="function",Os=(t=xs())=>Ru({documentElement:Y,media:t}),Du=Os(),Ou=Ds(),Nu=!!l.WebKitPlaybackTargetAvailabilityEvent,Pu=!!l.chrome;var xi=t=>Xt(t.media,e=>[pe.SUBTITLES,pe.CAPTIONS].includes(e.kind)).sort((e,i)=>e.kind>=i.kind?1:-1),Ns=t=>Xt(t.media,e=>e.mode===Tt.SHOWING&&[pe.SUBTITLES,pe.CAPTIONS].includes(e.kind)),To=(t,e)=>{let i=xi(t),a=Ns(t),r=!!a.length;if(i.length){if(e===!1||r&&e!==!0)zt(Tt.DISABLED,i,a);else if(e===!0||!r&&e!==!1){let o=i[0],{options:s}=t;if(!(s!=null&&s.noSubtitlesLangPref)){let T=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),g=T?[T,...globalThis.navigator.languages]:globalThis.navigator.languages,v=i.filter(p=>g.some(I=>p.language.toLowerCase().startsWith(I.split("-")[0]))).sort((p,I)=>{let A=g.findIndex(P=>p.language.toLowerCase().startsWith(P.split("-")[0])),L=g.findIndex(P=>I.language.toLowerCase().startsWith(P.split("-")[0]));return A-L});v[0]&&(o=v[0])}let{language:d,label:u,kind:h}=o;zt(Tt.DISABLED,i,a),zt(Tt.SHOWING,i,[{language:d,label:u,kind:h}])}}},yo=(t,e)=>t===e?!0:t==null||e==null||typeof t!=typeof e?!1:typeof t=="number"&&Number.isNaN(t)&&Number.isNaN(e)?!0:typeof t!="object"?!1:Array.isArray(t)?Fh(t,e):Object.entries(t).every(([i,a])=>i in e&&yo(a,e[i])),Fh=(t,e)=>{let i=Array.isArray(t),a=Array.isArray(e);return i!==a?!1:i||a?t.length!==e.length?!1:t.every((r,o)=>yo(r,e[o])):!0};var Vh=Object.values(Ne),ko,Kh=xu().then(t=>(ko=t,ko)),Uu=async(...t)=>{await Promise.all(t.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof l.HTMLElement))return;let i=e.localName;if(!i.includes("-"))return;let a=l.customElements.get(i);a&&e instanceof a||(await l.customElements.whenDefined(i),l.customElements.upgrade(e))}))},Gh=new l.DOMParser,Yh=t=>t&&(Gh.parseFromString(t,"text/html").body.textContent||t),Di={mediaError:{get(t,e){let{media:i}=t;if((e==null?void 0:e.type)!=="playing")return i==null?void 0:i.error},mediaEvents:["emptied","error","playing"]},mediaErrorCode:{get(t,e){var i;let{media:a}=t;if((e==null?void 0:e.type)!=="playing")return(i=a==null?void 0:a.error)==null?void 0:i.code},mediaEvents:["emptied","error","playing"]},mediaErrorMessage:{get(t,e){var i,a;let{media:r}=t;if((e==null?void 0:e.type)!=="playing")return(a=(i=r==null?void 0:r.error)==null?void 0:i.message)!=null?a:""},mediaEvents:["emptied","error","playing"]},mediaWidth:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.videoHeight)!=null?e:0},mediaEvents:["resize"]},mediaPaused:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.paused)!=null?e:!0},set(t,e){var i;let{media:a}=e;a&&(t?a.pause():(i=a.play())==null||i.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(t,e){let{media:i}=t;return i?e?e.type==="playing":!i.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.playbackRate)!=null?e:1},set(t,e){let{media:i}=e;i&&Number.isFinite(+t)&&(i.playbackRate=+t)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.muted)!=null?e:!1},set(t,e){let{media:i,options:{noMutedPref:a}={}}=e;if(i){i.muted=t;try{let r=l.localStorage.getItem("media-chrome-pref-muted")!==null,o=i.hasAttribute("muted");if(a){r&&l.localStorage.removeItem("media-chrome-pref-muted");return}if(o&&!r)return;l.localStorage.setItem("media-chrome-pref-muted",t?"true":"false")}catch(r){console.debug("Error setting muted pref",r)}}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(t,e)=>{let{options:{noMutedPref:i}}=e,{media:a}=e;if(!(!a||a.muted||i))try{let r=l.localStorage.getItem("media-chrome-pref-muted")==="true";Di.mediaMuted.set(r,e),t(r)}catch(r){console.debug("Error getting muted pref",r)}}]},mediaVolume:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.volume)!=null?e:1},set(t,e){let{media:i,options:{noVolumePref:a}={}}=e;if(i){try{t==null?l.localStorage.removeItem("media-chrome-pref-volume"):!i.hasAttribute("muted")&&!a&&l.localStorage.setItem("media-chrome-pref-volume",t.toString())}catch(r){console.debug("Error setting volume pref",r)}Number.isFinite(+t)&&(i.volume=+t)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(t,e)=>{let{options:{noVolumePref:i}}=e;if(!i)try{let{media:a}=e;if(!a)return;let r=l.localStorage.getItem("media-chrome-pref-volume");if(r==null)return;Di.mediaVolume.set(+r,e),t(+r)}catch(a){console.debug("Error getting volume pref",a)}}]},mediaVolumeLevel:{get(t){let{media:e}=t;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(t){var e;let{media:i}=t;return(e=i==null?void 0:i.currentTime)!=null?e:0},set(t,e){let{media:i}=e;!i||!Si(t)||(i.currentTime=t)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(t){let{media:e,options:{defaultDuration:i}={}}=t;return i&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?i:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(t){let{media:e}=t;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(t){var e;let{media:i}=t;if(!((e=i==null?void 0:i.seekable)!=null&&e.length))return;let a=i.seekable.start(0),r=i.seekable.end(i.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(t){var e;let{media:i}=t,a=(e=i==null?void 0:i.buffered)!=null?e:[];return Array.from(a).map((r,o)=>[Number(a.start(o).toFixed(3)),Number(a.end(o).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(t){let{media:e,options:{defaultStreamType:i}={}}=t,a=[Ne.LIVE,Ne.ON_DEMAND].includes(i)?i:void 0;if(!e)return a;let{streamType:r}=e;if(Vh.includes(r))return r===Ne.UNKNOWN?a:r;let o=e.duration;return o===1/0?Ne.LIVE:Number.isFinite(o)?Ne.ON_DEMAND:a},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(t){let{media:e}=t;if(!e)return Number.NaN;let{targetLiveWindow:i}=e,a=Di.mediaStreamType.get(t);return(i==null||Number.isNaN(i))&&a===Ne.LIVE?0:i},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(t){let{media:e,options:{liveEdgeOffset:i=10}={}}=t;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Di.mediaStreamType.get(t)===Ne.LIVE))return!1;let r=e.seekable;if(!r)return!0;if(!r.length)return!1;let o=r.end(r.length-1)-i;return e.currentTime>=o},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(t){return xi(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(t){return Ns(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(t,e)=>{var i,a;let{media:r,options:o}=e;if(!r)return;let s=d=>{var u;!o.defaultSubtitles||d&&![pe.CAPTIONS,pe.SUBTITLES].includes((u=d==null?void 0:d.track)==null?void 0:u.kind)||To(e,!0)};return r.addEventListener("loadstart",s),(i=r.textTracks)==null||i.addEventListener("addtrack",s),(a=r.textTracks)==null||a.addEventListener("removetrack",s),()=>{var d,u;r.removeEventListener("loadstart",s),(d=r.textTracks)==null||d.removeEventListener("addtrack",s),(u=r.textTracks)==null||u.removeEventListener("removetrack",s)}}]},mediaChaptersCues:{get(t){var e;let{media:i}=t;if(!i)return[];let[a]=Xt(i,{kind:pe.CHAPTERS});return Array.from((e=a==null?void 0:a.cues)!=null?e:[]).map(({text:r,startTime:o,endTime:s})=>({text:Yh(r),startTime:o,endTime:s}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;if(!a)return;let r=a.querySelector('track[kind="chapters"][default][src]'),o=(i=a.shadowRoot)==null?void 0:i.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return r==null||r.addEventListener("load",t),o==null||o.addEventListener("load",t),()=>{r==null||r.removeEventListener("load",t),o==null||o.removeEventListener("load",t)}}]},mediaIsPip:{get(t){var e,i;let{media:a,documentElement:r}=t;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("-")?de(a,r.pictureInPictureElement):!1;if(r.pictureInPictureElement.localName.includes("-")){let o=r.pictureInPictureElement.shadowRoot;for(;o!=null&&o.pictureInPictureElement;){if(o.pictureInPictureElement===a)return!0;o=(i=o.pictureInPictureElement)==null?void 0:i.shadowRoot}}return!1},set(t,e){let{media:i}=e;if(i)if(t){if(!Y.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}let a=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};i.requestPictureInPicture().catch(r=>{if(r.code===11){if(!i.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(i.readyState===0&&i.preload==="none"){let o=()=>{i.removeEventListener("loadedmetadata",s),i.preload="none"},s=()=>{i.requestPictureInPicture().catch(a),o()};i.addEventListener("loadedmetadata",s),i.preload="metadata",setTimeout(()=>{i.readyState===0&&a(),o()},1e3)}else throw r}else throw r})}else Y.pictureInPictureElement&&Y.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(t){var e;let{media:i}=t;return[...(e=i==null?void 0:i.videoRenditions)!=null?e:[]].map(a=>({...a}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(t){var e,i,a;let{media:r}=t;return(a=(i=r==null?void 0:r.videoRenditions)==null?void 0:i[(e=r.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:a.id},set(t,e){let{media:i}=e;if(!(i!=null&&i.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let a=t,r=Array.prototype.findIndex.call(i.videoRenditions,o=>o.id==a);i.videoRenditions.selectedIndex!=r&&(i.videoRenditions.selectedIndex=r)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(t){var e;let{media:i}=t;return[...(e=i==null?void 0:i.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(t){var e,i;let{media:a}=t;return(i=[...(e=a==null?void 0:a.audioTracks)!=null?e:[]].find(r=>r.enabled))==null?void 0:i.id},set(t,e){let{media:i}=e;if(!(i!=null&&i.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let a=t;for(let r of i.audioTracks)r.enabled=a==r.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(t){return wu(t)},set(t,e,i){var a;t?(Cu(e),i.detail&&((a=e.media)==null||a.focus())):Lu(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(t){var e;let{media:i}=t;return!(i!=null&&i.remote)||((e=i.remote)==null?void 0:e.state)==="disconnected"?!1:!!i.remote.state},set(t,e){var i,a;let{media:r}=e;if(r&&!(t&&((i=r.remote)==null?void 0:i.state)!=="disconnected")&&!(!t&&((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(t,e){let{media:i}=e;if(i){if(!(i.webkitShowPlaybackTargetPicker&&l.WebKitPlaybackTargetAvailabilityEvent)){console.error("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}i.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(t){let{media:e}=t;if(!Du||!Os(e))return fe.UNSUPPORTED}},mediaPipUnavailable:{get(t){let{media:e}=t;if(!Ou||!Ds(e))return fe.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return fe.UNAVAILABLE}},mediaVolumeUnavailable:{get(t){let{media:e}=t;if(ko===!1||(e==null?void 0:e.volume)==null)return fe.UNSUPPORTED},stateOwnersUpdateHandlers:[t=>{ko==null&&Kh.then(e=>t(e?void 0:fe.UNSUPPORTED))}]},mediaCastUnavailable:{get(t,{availability:e="not-available"}={}){var i;let{media:a}=t;if(!Pu||!((i=a==null?void 0:a.remote)!=null&&i.state))return fe.UNSUPPORTED;if(!(e==null||e==="available"))return fe.UNAVAILABLE},stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(i=a==null?void 0:a.remote)==null||i.watchAvailability(o=>{t({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var o;(o=a==null?void 0:a.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(t,e){if(!Nu)return fe.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return fe.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(i=a==null?void 0:a.remote)==null||i.watchAvailability(o=>{t({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var o;(o=a==null?void 0:a.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(t){var e;let{media:i}=t;if(!(i!=null&&i.videoRenditions))return fe.UNSUPPORTED;if(!((e=i.videoRenditions)!=null&&e.length))return fe.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(t){var e,i;let{media:a}=t;if(!(a!=null&&a.audioTracks))return fe.UNSUPPORTED;if(((i=(e=a.audioTracks)==null?void 0:e.length)!=null?i:0)<=1)return fe.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(t){let{options:{mediaLang:e}={}}=t;return e!=null?e:"en"}}};var Hu={[f.MEDIA_PREVIEW_REQUEST](t,e,{detail:i}){var a,r,o;let{media:s}=e,d=i!=null?i:void 0,u,h;if(s&&d!=null){let[p]=Xt(s,{kind:pe.METADATA,label:"thumbnails"}),I=Array.prototype.find.call((a=p==null?void 0:p.cues)!=null?a:[],(A,L,P)=>L===0?A.endTime>d:L===P.length-1?A.startTime<=d:A.startTime<=d&&A.endTime>d);if(I){let A=/'^(?:[a-z]+:)?\/\//i.test(I.text)||(r=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:r.src,L=new URL(I.text,A);h=new URLSearchParams(L.hash).get("#xywh").split(",").map(te=>+te),u=L.href}}let T=t.mediaDuration.get(e),v=(o=t.mediaChaptersCues.get(e).find((p,I,A)=>I===A.length-1&&T===p.endTime?p.startTime<=d&&p.endTime>=d:p.startTime<=d&&p.endTime>d))==null?void 0:o.text;return i!=null&&v==null&&(v=""),{mediaPreviewTime:d,mediaPreviewImage:u,mediaPreviewCoords:h,mediaPreviewChapter:v}},[f.MEDIA_PAUSE_REQUEST](t,e){t["mediaPaused"].set(!0,e)},[f.MEDIA_PLAY_REQUEST](t,e){var i,a,r,o;let s="mediaPaused",u=t.mediaStreamType.get(e)===Ne.LIVE,h=!((i=e.options)!=null&&i.noAutoSeekToLive),T=t.mediaTargetLiveWindow.get(e)>0;if(u&&h&&!T){let g=(a=t.mediaSeekable.get(e))==null?void 0:a[1];if(g){let v=(o=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?o:0,p=g-v;t.mediaCurrentTime.set(p,e)}}t[s].set(!1,e)},[f.MEDIA_PLAYBACK_RATE_REQUEST](t,e,{detail:i}){let a="mediaPlaybackRate",r=i;t[a].set(r,e)},[f.MEDIA_MUTE_REQUEST](t,e){t["mediaMuted"].set(!0,e)},[f.MEDIA_UNMUTE_REQUEST](t,e){let i="mediaMuted";t.mediaVolume.get(e)||t.mediaVolume.set(.25,e),t[i].set(!1,e)},[f.MEDIA_VOLUME_REQUEST](t,e,{detail:i}){let a="mediaVolume",r=i;r&&t.mediaMuted.get(e)&&t.mediaMuted.set(!1,e),t[a].set(r,e)},[f.MEDIA_SEEK_REQUEST](t,e,{detail:i}){let a="mediaCurrentTime",r=i;t[a].set(r,e)},[f.MEDIA_SEEK_TO_LIVE_REQUEST](t,e){var i,a,r;let o="mediaCurrentTime",s=(i=t.mediaSeekable.get(e))==null?void 0:i[1];if(Number.isNaN(Number(s)))return;let d=(r=(a=e.options)==null?void 0:a.seekToLiveOffset)!=null?r:0,u=s-d;t[o].set(u,e)},[f.MEDIA_SHOW_SUBTITLES_REQUEST](t,e,{detail:i}){var a;let{options:r}=e,o=xi(e),s=Rs(i),d=(a=s[0])==null?void 0:a.language;d&&!r.noSubtitlesLangPref&&l.localStorage.setItem("media-chrome-pref-subtitles-lang",d),zt(Tt.SHOWING,o,s)},[f.MEDIA_DISABLE_SUBTITLES_REQUEST](t,e,{detail:i}){let a=xi(e),r=i!=null?i:[];zt(Tt.DISABLED,a,r)},[f.MEDIA_TOGGLE_SUBTITLES_REQUEST](t,e,{detail:i}){To(e,i)},[f.MEDIA_RENDITION_REQUEST](t,e,{detail:i}){let a="mediaRenditionSelected",r=i;t[a].set(r,e)},[f.MEDIA_AUDIO_TRACK_REQUEST](t,e,{detail:i}){let a="mediaAudioTrackEnabled",r=i;t[a].set(r,e)},[f.MEDIA_ENTER_PIP_REQUEST](t,e){let i="mediaIsPip";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[f.MEDIA_EXIT_PIP_REQUEST](t,e){t["mediaIsPip"].set(!1,e)},[f.MEDIA_ENTER_FULLSCREEN_REQUEST](t,e,i){let a="mediaIsFullscreen";t.mediaIsPip.get(e)&&t.mediaIsPip.set(!1,e),t[a].set(!0,e,i)},[f.MEDIA_EXIT_FULLSCREEN_REQUEST](t,e){t["mediaIsFullscreen"].set(!1,e)},[f.MEDIA_ENTER_CAST_REQUEST](t,e){let i="mediaIsCasting";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[f.MEDIA_EXIT_CAST_REQUEST](t,e){t["mediaIsCasting"].set(!1,e)},[f.MEDIA_AIRPLAY_REQUEST](t,e){t["mediaIsAirplaying"].set(!0,e)}};var Bu=({media:t,fullscreenElement:e,documentElement:i,stateMediator:a=Di,requestMap:r=Hu,options:o={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let d=[],u={options:{...o}},h=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),T=A=>{A!=null&&(yo(A,h)||(h=Object.freeze({...h,...A}),d.forEach(L=>L(h))))},g=()=>{let A=Object.entries(a).reduce((L,[P,{get:te}])=>(L[P]=te(u),L),{});T(A)},v={},p,I=async(A,L)=>{var P,te,_e,At,lt,ga,_a,Aa,Ta,ya,ka,Sa,Ia,Ma,Ca,La;let Jr=!!p;if(p={...u,...p!=null?p:{},...A},Jr)return;await Uu(...Object.values(A));let dt=d.length>0&&L===0&&s,wa=u.media!==p.media,Ra=((P=u.media)==null?void 0:P.textTracks)!==((te=p.media)==null?void 0:te.textTracks),xa=((_e=u.media)==null?void 0:_e.videoRenditions)!==((At=p.media)==null?void 0:At.videoRenditions),Od=((lt=u.media)==null?void 0:lt.audioTracks)!==((ga=p.media)==null?void 0:ga.audioTracks),Nd=((_a=u.media)==null?void 0:_a.remote)!==((Aa=p.media)==null?void 0:Aa.remote),Pd=u.documentElement!==p.documentElement,Ud=!!u.media&&(wa||dt),Hd=!!((Ta=u.media)!=null&&Ta.textTracks)&&(Ra||dt),Bd=!!((ya=u.media)!=null&&ya.videoRenditions)&&(xa||dt),$d=!!((ka=u.media)!=null&&ka.audioTracks)&&(Od||dt),Wd=!!((Sa=u.media)!=null&&Sa.remote)&&(Nd||dt),Fd=!!u.documentElement&&(Pd||dt),Vd=Ud||Hd||Bd||$d||Wd||Fd,yi=d.length===0&&L===1&&s,Kd=!!p.media&&(wa||yi),Gd=!!((Ia=p.media)!=null&&Ia.textTracks)&&(Ra||yi),Yd=!!((Ma=p.media)!=null&&Ma.videoRenditions)&&(xa||yi),qd=!!((Ca=p.media)!=null&&Ca.audioTracks)&&(Od||yi),Zd=!!((La=p.media)!=null&&La.remote)&&(Nd||yi),Qd=!!p.documentElement&&(Pd||yi),zd=Kd||Gd||Yd||qd||Zd||Qd;if(!(Vd||zd)){Object.entries(p).forEach(([G,Da])=>{u[G]=Da}),g(),p=void 0;return}Object.entries(a).forEach(([G,{get:Da,mediaEvents:eh=[],textTracksEvents:th=[],videoRenditionsEvents:ih=[],audioTracksEvents:ah=[],remoteEvents:rh=[],rootEvents:oh=[],stateOwnersUpdateHandlers:nh=[]}])=>{v[G]||(v[G]={});let Ae=z=>{let Te=Da(u,z);T({[G]:Te})},ae;ae=v[G].mediaEvents,eh.forEach(z=>{ae&&Ud&&(u.media.removeEventListener(z,ae),v[G].mediaEvents=void 0),Kd&&(p.media.addEventListener(z,Ae),v[G].mediaEvents=Ae)}),ae=v[G].textTracksEvents,th.forEach(z=>{var Te,Oe;ae&&Hd&&((Te=u.media.textTracks)==null||Te.removeEventListener(z,ae),v[G].textTracksEvents=void 0),Gd&&((Oe=p.media.textTracks)==null||Oe.addEventListener(z,Ae),v[G].textTracksEvents=Ae)}),ae=v[G].videoRenditionsEvents,ih.forEach(z=>{var Te,Oe;ae&&Bd&&((Te=u.media.videoRenditions)==null||Te.removeEventListener(z,ae),v[G].videoRenditionsEvents=void 0),Yd&&((Oe=p.media.videoRenditions)==null||Oe.addEventListener(z,Ae),v[G].videoRenditionsEvents=Ae)}),ae=v[G].audioTracksEvents,ah.forEach(z=>{var Te,Oe;ae&&$d&&((Te=u.media.audioTracks)==null||Te.removeEventListener(z,ae),v[G].audioTracksEvents=void 0),qd&&((Oe=p.media.audioTracks)==null||Oe.addEventListener(z,Ae),v[G].audioTracksEvents=Ae)}),ae=v[G].remoteEvents,rh.forEach(z=>{var Te,Oe;ae&&Wd&&((Te=u.media.remote)==null||Te.removeEventListener(z,ae),v[G].remoteEvents=void 0),Zd&&((Oe=p.media.remote)==null||Oe.addEventListener(z,Ae),v[G].remoteEvents=Ae)}),ae=v[G].rootEvents,oh.forEach(z=>{ae&&Fd&&(u.documentElement.removeEventListener(z,ae),v[G].rootEvents=void 0),Qd&&(p.documentElement.addEventListener(z,Ae),v[G].rootEvents=Ae)});let Xd=v[G].stateOwnersUpdateHandlers;nh.forEach(z=>{Xd&&Vd&&Xd(),zd&&(v[G].stateOwnersUpdateHandlers=z(Ae,p))})}),Object.entries(p).forEach(([G,Da])=>{u[G]=Da}),g(),p=void 0};return I({media:t,fullscreenElement:e,documentElement:i,options:o}),{dispatch(A){let{type:L,detail:P}=A;if(r[L]&&h.mediaErrorCode==null){T(r[L](a,u,A));return}L==="mediaelementchangerequest"?I({media:P}):L==="fullscreenelementchangerequest"?I({fullscreenElement:P}):L==="documentelementchangerequest"?I({documentElement:P}):L==="optionschangerequest"&&(Object.entries(P!=null?P:{}).forEach(([te,_e])=>{u.options[te]=_e}),g())},getState(){return h},subscribe(A){return I({},d.length+1),d.push(A),A(h),()=>{let L=d.indexOf(A);L>=0&&(I({},d.length-1),d.splice(L,1))}}}};var Bs=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},x=(t,e,i)=>(Bs(t,e,"read from private field"),i?i.call(t):e.get(t)),pt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},It=(t,e,i,a)=>(Bs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Mt=(t,e,i)=>(Bs(t,e,"access private method"),i),jt,Ka,$,Ga,Ve,So,Io,Ps,Oi,Ya,Mo,Us,Gu=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c"],$u=10,Wu=.025,E={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYS_USED:"keysused",LIVE_EDGE_OFFSET:"liveedgeoffset",SEEK_TO_LIVE_OFFSET:"seektoliveoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_HOTKEYS:"nohotkeys",NO_VOLUME_PREF:"novolumepref",NO_MUTED_PREF:"nomutedpref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_DEFAULT_STORE:"nodefaultstore",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset",KEYBOARD_UP_VOLUME_STEP:"keyboardupvolumestep",KEYBOARD_DOWN_VOLUME_STEP:"keyboarddownvolumestep",LANG:"lang"},Co=class extends qt{constructor(){super(),pt(this,Io),pt(this,Oi),pt(this,Mo),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,pt(this,jt,new St(this,E.HOTKEYS)),pt(this,Ka,void 0),pt(this,$,void 0),pt(this,Ga,void 0),pt(this,Ve,void 0),pt(this,So,i=>{var a;(a=x(this,$))==null||a.dispatch(i)}),this.associateElement(this);let e={};It(this,Ga,i=>{Object.entries(i).forEach(([a,r])=>{if(a in e&&e[a]===r)return;this.propagateMediaState(a,r);let o=a.toLowerCase(),s=new l.CustomEvent(iu[o],{composed:!0,detail:r});this.dispatchEvent(s)}),e=i}),this.hasAttribute(E.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(E.NO_HOTKEYS,E.HOTKEYS,E.DEFAULT_STREAM_TYPE,E.DEFAULT_SUBTITLES,E.DEFAULT_DURATION,E.NO_MUTED_PREF,E.NO_VOLUME_PREF,E.LANG)}get mediaStore(){return x(this,$)}set mediaStore(e){var i,a;if(x(this,$)&&((i=x(this,Ve))==null||i.call(this),It(this,Ve,void 0)),It(this,$,e),!x(this,$)&&!this.hasAttribute(E.NO_DEFAULT_STORE)){Mt(this,Io,Ps).call(this);return}It(this,Ve,(a=x(this,$))==null?void 0:a.subscribe(x(this,Ga)))}get fullscreenElement(){var e;return(e=x(this,Ka))!=null?e:this}set fullscreenElement(e){var i;this.hasAttribute(E.FULLSCREEN_ELEMENT)&&this.removeAttribute(E.FULLSCREEN_ELEMENT),It(this,Ka,e),(i=x(this,$))==null||i.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return k(this,E.DEFAULT_SUBTITLES)}set defaultSubtitles(e){S(this,E.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return M(this,E.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){C(this,E.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return D(this,E.DEFAULT_DURATION)}set defaultDuration(e){N(this,E.DEFAULT_DURATION,e)}get noHotkeys(){return k(this,E.NO_HOTKEYS)}set noHotkeys(e){S(this,E.NO_HOTKEYS,e)}get keysUsed(){return M(this,E.KEYS_USED)}set keysUsed(e){C(this,E.KEYS_USED,e)}get liveEdgeOffset(){return D(this,E.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){N(this,E.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return k(this,E.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){S(this,E.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return k(this,E.NO_VOLUME_PREF)}set noVolumePref(e){S(this,E.NO_VOLUME_PREF,e)}get noMutedPref(){return k(this,E.NO_MUTED_PREF)}set noMutedPref(e){S(this,E.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return k(this,E.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){S(this,E.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return k(this,E.NO_DEFAULT_STORE)}set noDefaultStore(e){S(this,E.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,i,a){var r,o,s,d,u,h,T,g,v,p,I;if(super.attributeChangedCallback(e,i,a),e===E.NO_HOTKEYS)a!==i&&a===""?(this.hasAttribute(E.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==i&&a===null&&this.enableHotkeys();else if(e===E.HOTKEYS)x(this,jt).value=a;else if(e===E.DEFAULT_SUBTITLES&&a!==i)(r=x(this,$))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(E.DEFAULT_SUBTITLES)}});else if(e===E.DEFAULT_STREAM_TYPE)(s=x(this,$))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(o=this.getAttribute(E.DEFAULT_STREAM_TYPE))!=null?o:void 0}});else if(e===E.LIVE_EDGE_OFFSET)(d=x(this,$))==null||d.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(E.LIVE_EDGE_OFFSET)?+this.getAttribute(E.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(E.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(E.LIVE_EDGE_OFFSET)}});else if(e===E.SEEK_TO_LIVE_OFFSET)(u=x(this,$))==null||u.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(E.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(E.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===E.NO_AUTO_SEEK_TO_LIVE)(h=x(this,$))==null||h.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(E.NO_AUTO_SEEK_TO_LIVE)}});else if(e===E.FULLSCREEN_ELEMENT){let A=a?(T=this.getRootNode())==null?void 0:T.getElementById(a):void 0;It(this,Ka,A),(g=x(this,$))==null||g.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===E.LANG&&a!==i?(mu(a),(v=x(this,$))==null||v.dispatch({type:"optionschangerequest",detail:{mediaLang:a}})):e===E.NO_VOLUME_PREF&&a!==i?(p=x(this,$))==null||p.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(E.NO_VOLUME_PREF)}}):e===E.NO_MUTED_PREF&&a!==i&&((I=x(this,$))==null||I.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(E.NO_MUTED_PREF)}}))}connectedCallback(){var e,i;!x(this,$)&&!this.hasAttribute(E.NO_DEFAULT_STORE)&&Mt(this,Io,Ps).call(this),(e=x(this,$))==null||e.dispatch({type:"documentelementchangerequest",detail:Y}),super.connectedCallback(),x(this,$)&&!x(this,Ve)&&It(this,Ve,(i=x(this,$))==null?void 0:i.subscribe(x(this,Ga))),this.hasAttribute(E.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,i,a,r;(e=super.disconnectedCallback)==null||e.call(this),x(this,$)&&((i=x(this,$))==null||i.dispatch({type:"documentelementchangerequest",detail:void 0}),(a=x(this,$))==null||a.dispatch({type:f.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})),x(this,Ve)&&((r=x(this,Ve))==null||r.call(this),It(this,Ve,void 0))}mediaSetCallback(e){var i;super.mediaSetCallback(e),(i=x(this,$))==null||i.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var i;super.mediaUnsetCallback(e),(i=x(this,$))==null||i.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,i){Ku(this.mediaStateReceivers,e,i)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:i}=this;if(i.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),o=Jh(e,a,r);Object.values(f).forEach(s=>{e.addEventListener(s,x(this,So))}),i.set(e,o)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:i}=this;if(!i.has(e))return;i.get(e)(),i.delete(e),Object.values(f).forEach(r=>{e.removeEventListener(r,x(this,So))})}registerMediaStateReceiver(e){if(!e)return;let i=this.mediaStateReceivers;i.indexOf(e)>-1||(i.push(e),x(this,$)&&Object.entries(x(this,$).getState()).forEach(([r,o])=>{Ku([e],r,o)}))}unregisterMediaStateReceiver(e){let i=this.mediaStateReceivers,a=i.indexOf(e);a<0||i.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",Mt(this,Mo,Us))}disableHotkeys(){this.removeEventListener("keydown",Mt(this,Mo,Us)),this.removeEventListener("keyup",Mt(this,Oi,Ya))}get hotkeys(){return M(this,E.HOTKEYS)}set hotkeys(e){C(this,E.HOTKEYS,e)}keyboardShortcutHandler(e){var i,a,r,o,s,d,u;let h=e.target;if(((r=(a=(i=h.getAttribute(E.KEYS_USED))==null?void 0:i.split(" "))!=null?a:h==null?void 0:h.keysUsed)!=null?r:[]).map(I=>I==="Space"?" ":I).filter(Boolean).includes(e.key))return;let g,v,p;if(!x(this,jt).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&x(this,jt).contains("nospace")))switch(e.key){case" ":case"k":g=x(this,$).getState().mediaPaused?f.MEDIA_PLAY_REQUEST:f.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new l.CustomEvent(g,{composed:!0,bubbles:!0}));break;case"m":g=this.mediaStore.getState().mediaVolumeLevel==="off"?f.MEDIA_UNMUTE_REQUEST:f.MEDIA_MUTE_REQUEST,this.dispatchEvent(new l.CustomEvent(g,{composed:!0,bubbles:!0}));break;case"f":g=this.mediaStore.getState().mediaIsFullscreen?f.MEDIA_EXIT_FULLSCREEN_REQUEST:f.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new l.CustomEvent(g,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new l.CustomEvent(f.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":{let I=this.hasAttribute(E.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(E.KEYBOARD_BACKWARD_SEEK_OFFSET):$u;v=Math.max(((o=this.mediaStore.getState().mediaCurrentTime)!=null?o:0)-I,0),p=new l.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:v}),this.dispatchEvent(p);break}case"ArrowRight":{let I=this.hasAttribute(E.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(E.KEYBOARD_FORWARD_SEEK_OFFSET):$u;v=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+I,0),p=new l.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:v}),this.dispatchEvent(p);break}case"ArrowUp":{let I=this.hasAttribute(E.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(E.KEYBOARD_UP_VOLUME_STEP):Wu;v=Math.min(((d=this.mediaStore.getState().mediaVolume)!=null?d:1)+I,1),p=new l.CustomEvent(f.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:v}),this.dispatchEvent(p);break}case"ArrowDown":{let I=this.hasAttribute(E.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(E.KEYBOARD_DOWN_VOLUME_STEP):Wu;v=Math.max(((u=this.mediaStore.getState().mediaVolume)!=null?u:1)-I,0),p=new l.CustomEvent(f.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:v}),this.dispatchEvent(p);break}default:break}}};jt=new WeakMap;Ka=new WeakMap;$=new WeakMap;Ga=new WeakMap;Ve=new WeakMap;So=new WeakMap;Io=new WeakSet;Ps=function(){var t;this.mediaStore=Bu({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(E.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(E.DEFAULT_DURATION)?+this.getAttribute(E.DEFAULT_DURATION):void 0,defaultStreamType:(t=this.getAttribute(E.DEFAULT_STREAM_TYPE))!=null?t:void 0,liveEdgeOffset:this.hasAttribute(E.LIVE_EDGE_OFFSET)?+this.getAttribute(E.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(E.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(E.SEEK_TO_LIVE_OFFSET):this.hasAttribute(E.LIVE_EDGE_OFFSET)?+this.getAttribute(E.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(E.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(E.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(E.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(E.NO_SUBTITLES_LANG_PREF)}})};Oi=new WeakSet;Ya=function(t){let{key:e}=t;if(!Gu.includes(e)){this.removeEventListener("keyup",Mt(this,Oi,Ya));return}this.keyboardShortcutHandler(t)};Mo=new WeakSet;Us=function(t){let{metaKey:e,altKey:i,key:a}=t;if(e||i||!Gu.includes(a)){this.removeEventListener("keyup",Mt(this,Oi,Ya));return}let r=t.target,o=r instanceof HTMLElement&&(r.tagName.toLowerCase()==="media-volume-range"||r.tagName.toLowerCase()==="media-time-range");[" ","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(a)&&!(x(this,jt).contains(`no${a.toLowerCase()}`)||a===" "&&x(this,jt).contains("nospace"))&&!o&&t.preventDefault(),this.addEventListener("keyup",Mt(this,Oi,Ya),{once:!0})};var qh=Object.values(n),Zh=Object.values(_s),Yu=t=>{var e,i,a,r;let{observedAttributes:o}=t.constructor;!o&&((e=t.nodeName)!=null&&e.includes("-"))&&(l.customElements.upgrade(t),{observedAttributes:o}=t.constructor);let s=(r=(a=(i=t==null?void 0:t.getAttribute)==null?void 0:i.call(t,w.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(o||s)?(o||s).filter(d=>qh.includes(d)):[]},Qh=t=>{var e,i;return(e=t.nodeName)!=null&&e.includes("-")&&l.customElements.get((i=t.nodeName)==null?void 0:i.toLowerCase())&&!(t instanceof l.customElements.get(t.nodeName.toLowerCase()))&&l.customElements.upgrade(t),Zh.some(a=>a in t)},Hs=t=>Qh(t)||!!Yu(t).length,Fu=t=>{var e;return(e=t==null?void 0:t.join)==null?void 0:e.call(t,":")},Vu={[n.MEDIA_SUBTITLES_LIST]:ht,[n.MEDIA_SUBTITLES_SHOWING]:ht,[n.MEDIA_SEEKABLE]:Fu,[n.MEDIA_BUFFERED]:t=>t==null?void 0:t.map(Fu).join(" "),[n.MEDIA_PREVIEW_COORDS]:t=>t==null?void 0:t.join(" "),[n.MEDIA_RENDITION_LIST]:ru,[n.MEDIA_AUDIO_TRACK_LIST]:nu},zh=async(t,e,i)=>{var a,r;if(t.isConnected||await to(0),typeof i=="boolean"||i==null)return S(t,e,i);if(typeof i=="number")return N(t,e,i);if(typeof i=="string")return C(t,e,i);if(Array.isArray(i)&&!i.length)return t.removeAttribute(e);let o=(r=(a=Vu[e])==null?void 0:a.call(Vu,i))!=null?r:i;return t.setAttribute(e,o)},Xh=t=>{var e;return!!((e=t.closest)!=null&&e.call(t,'*[slot="media"]'))},Jt=(t,e)=>{if(Xh(t))return;let i=(r,o)=>{var s,d;Hs(r)&&o(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(g=>Jt(g,o))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!Hs(t)){l.customElements.whenDefined(a).then(()=>{i(t,e)});return}i(t,e)},Ku=(t,e,i)=>{t.forEach(a=>{if(e in a){a[e]=i;return}let r=Yu(a),o=e.toLowerCase();r.includes(o)&&zh(a,o,i)})},Jh=(t,e,i)=>{Jt(t,e);let a=T=>{var g;let v=(g=T==null?void 0:T.composedPath()[0])!=null?g:T.target;e(v)},r=T=>{var g;let v=(g=T==null?void 0:T.composedPath()[0])!=null?g:T.target;i(v)};t.addEventListener(f.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(f.UNREGISTER_MEDIA_STATE_RECEIVER,r);let o=T=>{T.forEach(g=>{let{addedNodes:v=[],removedNodes:p=[],type:I,target:A,attributeName:L}=g;I==="childList"?(Array.prototype.forEach.call(v,P=>Jt(P,e)),Array.prototype.forEach.call(p,P=>Jt(P,i))):I==="attributes"&&L===w.MEDIA_CHROME_ATTRIBUTES&&(Hs(A)?e(A):i(A))})},s=[],d=T=>{let g=T.target;g.name!=="media"&&(s.forEach(v=>Jt(v,i)),s=[...g.assignedElements({flatten:!0})],s.forEach(v=>Jt(v,e)))};t.addEventListener("slotchange",d);let u=new MutationObserver(o);return u.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{Jt(t,i),t.removeEventListener("slotchange",d),u.disconnect(),t.removeEventListener(f.REGISTER_MEDIA_STATE_RECEIVER,a),t.removeEventListener(f.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};l.customElements.get("media-controller")||l.customElements.define("media-controller",Co);var $s=Co;var Ni={PLACEMENT:"placement",BOUNDS:"bounds"};function jh(t){return`
|
|
159
|
+
`}var $h=Object.values(n),Wh="sm:384 md:576 lg:768 xl:960";function Fh(t){Ru(t.target,t.contentRect.width)}function Ru(t,e){var i;if(!t.isConnected)return;let a=(i=t.getAttribute(y.BREAKPOINTS))!=null?i:Wh,r=Vh(a),o=Kh(r,e),s=!1;if(Object.keys(r).forEach(d=>{if(o.includes(d)){t.hasAttribute(`breakpoint${d}`)||(t.setAttribute(`breakpoint${d}`,""),s=!0);return}t.hasAttribute(`breakpoint${d}`)&&(t.removeAttribute(`breakpoint${d}`),s=!0)}),s){let d=new CustomEvent(Le.BREAKPOINTS_CHANGE,{detail:o});t.dispatchEvent(d)}t.breakpointsComputed||(t.breakpointsComputed=!0,t.dispatchEvent(new CustomEvent(Le.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function Vh(t){let e=t.split(/\s+/);return Object.fromEntries(e.map(i=>i.split(":")))}function Kh(t,e){return Object.keys(t).filter(i=>e>=parseInt(t[i]))}var Qt=class extends l.HTMLElement{constructor(){if(super(),Se(this,Ns),Se(this,Us),Se(this,Hs),Se(this,Za),Se(this,ko),Se(this,xi),Se(this,To,0),Se(this,wi,null),Se(this,qa,null),Se(this,Ri,void 0),this.breakpointsComputed=!1,Se(this,_o,new MutationObserver(we(this,Ns,Cu).bind(this))),Se(this,Ya,!1),Se(this,Ao,i=>{Ie(this,Ya)||(setTimeout(()=>{Fh(i),Zt(this,Ya,!1)},0),Zt(this,Ya,!0))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let i=Z(this.attributes),a=this.constructor.getTemplateHTML(i);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(a):this.shadowRoot.innerHTML=a}let e=this.querySelector(":scope > slot[slot=media]");e&&e.addEventListener("slotchange",()=>{if(!e.assignedElements({flatten:!0}).length){Ie(this,wi)&&this.mediaUnsetCallback(Ie(this,wi));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[y.AUTOHIDE,y.GESTURES_DISABLED].concat($h).filter(e=>![n.MEDIA_RENDITION_LIST,n.MEDIA_AUDIO_TRACK_LIST,n.MEDIA_CHAPTERS_CUES,n.MEDIA_WIDTH,n.MEDIA_HEIGHT,n.MEDIA_ERROR,n.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,i,a){e.toLowerCase()==y.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&&(Zt(this,wi,e),e.localName.includes("-")&&await l.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;Ie(this,_o).observe(this,{childList:!0,subtree:!0}),ht(this,Ie(this,Ao));let a=this.getAttribute(y.AUDIO)!=null?h("audio player"):h("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.handleMediaUpdated(this.media),this.setAttribute(y.USER_INACTIVE,""),Ru(this,this.getBoundingClientRect().width),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;Ie(this,_o).disconnect(),pt(this,Ie(this,Ao)),this.media&&this.mediaUnsetCallback(this.media),(e=l.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Zt(this,wi,null)}handleEvent(e){switch(e.type){case"pointerdown":Zt(this,To,e.timeStamp);break;case"pointermove":we(this,Us,Lu).call(this,e);break;case"pointerup":we(this,Hs,wu).call(this,e);break;case"mouseleave":we(this,Za,yo).call(this);break;case"mouseup":this.removeAttribute(y.KEYBOARD_CONTROL);break;case"keyup":we(this,xi,Qa).call(this),this.setAttribute(y.KEYBOARD_CONTROL,"");break}}set autohide(e){let i=Number(e);Zt(this,Ri,isNaN(i)?0:i)}get autohide(){return(Ie(this,Ri)===void 0?2:Ie(this,Ri)).toString()}get breakpoints(){return w(this,y.BREAKPOINTS)}set breakpoints(e){R(this,y.BREAKPOINTS,e)}get audio(){return k(this,y.AUDIO)}set audio(e){S(this,y.AUDIO,e)}get gesturesDisabled(){return k(this,y.GESTURES_DISABLED)}set gesturesDisabled(e){S(this,y.GESTURES_DISABLED,e)}get keyboardControl(){return k(this,y.KEYBOARD_CONTROL)}set keyboardControl(e){S(this,y.KEYBOARD_CONTROL,e)}get noAutohide(){return k(this,y.NO_AUTOHIDE)}set noAutohide(e){S(this,y.NO_AUTOHIDE,e)}get autohideOverControls(){return k(this,y.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){S(this,y.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return k(this,y.USER_INACTIVE)}set userInteractive(e){S(this,y.USER_INACTIVE,e)}};To=new WeakMap;wi=new WeakMap;qa=new WeakMap;Ri=new WeakMap;_o=new WeakMap;Ns=new WeakSet;Cu=function(t){let e=this.media;for(let i of t){if(i.type!=="childList")continue;let a=i.removedNodes;for(let r of a){if(r.slot!="media"||i.target!=this)continue;let o=i.previousSibling&&i.previousSibling.previousElementSibling;if(!o||!e)this.mediaUnsetCallback(r);else{let s=o.slot!=="media";for(;(o=o.previousSibling)!==null;)o.slot=="media"&&(s=!1);s&&this.mediaUnsetCallback(r)}}if(e)for(let r of i.addedNodes)r===e&&this.handleMediaUpdated(e)}};Ya=new WeakMap;Ao=new WeakMap;Us=new WeakSet;Lu=function(t){if(t.pointerType!=="mouse"&&t.timeStamp-Ie(this,To)<250)return;we(this,ko,$s).call(this),clearTimeout(Ie(this,qa));let e=this.hasAttribute(y.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(t.target)||e)&&we(this,xi,Qa).call(this)};Hs=new WeakSet;wu=function(t){if(t.pointerType==="touch"){let e=!this.hasAttribute(y.USER_INACTIVE);[this,this.media].includes(t.target)&&e?we(this,Za,yo).call(this):we(this,xi,Qa).call(this)}else t.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&we(this,xi,Qa).call(this)};Za=new WeakSet;yo=function(){if(Ie(this,Ri)<0||this.hasAttribute(y.USER_INACTIVE))return;this.setAttribute(y.USER_INACTIVE,"");let t=new l.CustomEvent(Le.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(t)};ko=new WeakSet;$s=function(){if(!this.hasAttribute(y.USER_INACTIVE))return;this.removeAttribute(y.USER_INACTIVE);let t=new l.CustomEvent(Le.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(t)};xi=new WeakSet;Qa=function(){we(this,ko,$s).call(this),clearTimeout(Ie(this,qa));let t=parseInt(this.autohide);t<0||Zt(this,qa,setTimeout(()=>{we(this,Za,yo).call(this)},t*1e3))};Qt.shadowRootOptions={mode:"open"};Qt.getTemplateHTML=Bh;l.customElements.get("media-container")||l.customElements.define("media-container",Qt);var xu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},oe=(t,e,i)=>(xu(t,e,"read from private field"),i?i.call(t):e.get(t)),za=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},So=(t,e,i,a)=>(xu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Di,Oi,Io,zt,ft,Mt,Ct=class{constructor(e,i,{defaultValue:a}={defaultValue:void 0}){za(this,ft),za(this,Di,void 0),za(this,Oi,void 0),za(this,Io,void 0),za(this,zt,new Set),So(this,Di,e),So(this,Oi,i),So(this,Io,new Set(a))}[Symbol.iterator](){return oe(this,ft,Mt).values()}get length(){return oe(this,ft,Mt).size}get value(){var e;return(e=[...oe(this,ft,Mt)].join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(So(this,zt,new Set),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return[...oe(this,ft,Mt)][e]}values(){return oe(this,ft,Mt).values()}forEach(e,i){oe(this,ft,Mt).forEach(e,i)}add(...e){var i,a;e.forEach(r=>oe(this,zt).add(r)),!(this.value===""&&!((i=oe(this,Di))!=null&&i.hasAttribute(`${oe(this,Oi)}`)))&&((a=oe(this,Di))==null||a.setAttribute(`${oe(this,Oi)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>oe(this,zt).delete(a)),(i=oe(this,Di))==null||i.setAttribute(`${oe(this,Oi)}`,`${this.value}`)}contains(e){return oe(this,ft,Mt).has(e)}toggle(e,i){return typeof i!="undefined"?i?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,i){return this.remove(e),this.add(i),e===i}};Di=new WeakMap;Oi=new WeakMap;Io=new WeakMap;zt=new WeakMap;ft=new WeakSet;Mt=function(){return oe(this,zt).size?oe(this,zt):oe(this,Io)};var Gh=(t="")=>t.split(/\s+/),Du=(t="")=>{let[e,i,a]=t.split(":"),r=a?decodeURIComponent(a):void 0;return{kind:e==="cc"?fe.CAPTIONS:fe.SUBTITLES,language:i,label:r}},Xt=(t="",e={})=>Gh(t).map(i=>{let a=Du(i);return{...e,...a}}),Ws=t=>t?Array.isArray(t)?t.map(e=>typeof e=="string"?Du(e):e):typeof t=="string"?Xt(t):[t]:[],Mo=({kind:t,label:e,language:i}={kind:"subtitles"})=>e?`${t==="captions"?"cc":"sb"}:${i}:${encodeURIComponent(e)}`:i,vt=(t=[])=>Array.prototype.map.call(t,Mo).join(" "),Yh=(t,e)=>i=>i[t]===e,Ou=t=>{let e=Object.entries(t).map(([i,a])=>Yh(i,a));return i=>e.every(a=>a(i))},Jt=(t,e=[],i=[])=>{let a=Ws(i).map(Ou),r=o=>a.some(s=>s(o));Array.from(e).filter(r).forEach(o=>{o.mode=t})},jt=(t,e=()=>!0)=>{if(!(t!=null&&t.textTracks))return[];let i=typeof e=="function"?e:Ou(e);return Array.from(t.textTracks).filter(i)},Co=t=>{var e;return!!((e=t.mediaSubtitlesShowing)!=null&&e.length)||t.hasAttribute(n.MEDIA_SUBTITLES_SHOWING)};var Nu=t=>{var e;let{media:i,fullscreenElement:a}=t;try{let r=a&&"requestFullscreen"in a?"requestFullscreen":a&&"webkitRequestFullScreen"in a?"webkitRequestFullScreen":void 0;if(r){let o=(e=a[r])==null?void 0:e.call(a);if(o instanceof Promise)return o.catch(()=>{})}else i!=null&&i.webkitEnterFullscreen?i.webkitEnterFullscreen():i!=null&&i.requestFullscreen&&i.requestFullscreen()}catch(r){console.error(r)}},Pu="exitFullscreen"in V?"exitFullscreen":"webkitExitFullscreen"in V?"webkitExitFullscreen":"webkitCancelFullScreen"in V?"webkitCancelFullScreen":void 0,Uu=t=>{var e;let{documentElement:i}=t;if(Pu){let a=(e=i==null?void 0:i[Pu])==null?void 0:e.call(i);if(a instanceof Promise)return a.catch(()=>{})}},Xa="fullscreenElement"in V?"fullscreenElement":"webkitFullscreenElement"in V?"webkitFullscreenElement":void 0,qh=t=>{let{documentElement:e,media:i}=t,a=e==null?void 0:e[Xa];return!a&&"webkitDisplayingFullscreen"in i&&"webkitPresentationMode"in i&&i.webkitDisplayingFullscreen&&i.webkitPresentationMode===cu.FULLSCREEN?i:a},Hu=t=>{var e;let{media:i,documentElement:a,fullscreenElement:r=i}=t;if(!i||!a)return!1;let o=qh(t);if(!o)return!1;if(o===r||o===i)return!0;if(o.localName.includes("-")){let s=o.shadowRoot;if(!(Xa in s))return ue(o,r);for(;s!=null&&s[Xa];){if(s[Xa]===r)return!0;s=(e=s[Xa])==null?void 0:e.shadowRoot}}return!1},Zh="fullscreenEnabled"in V?"fullscreenEnabled":"webkitFullscreenEnabled"in V?"webkitFullscreenEnabled":void 0,Bu=t=>{let{documentElement:e,media:i}=t;return!!(e!=null&&e[Zh])||i&&"webkitSupportsFullscreen"in i};var Lo,Fs=()=>{var t,e;return Lo||(Lo=(e=(t=V)==null?void 0:t.createElement)==null?void 0:e.call(t,"video"),Lo)},$u=async(t=Fs())=>{if(!t)return!1;let e=t.volume;t.volume=e/2+.1;let i=new AbortController,a=await Promise.race([Qh(t,i.signal),zh(t,e)]);return i.abort(),a},Qh=(t,e)=>new Promise(i=>{t.addEventListener("volumechange",()=>i(!0),{signal:e})}),zh=async(t,e)=>{for(let i=0;i<10;i++){if(t.volume===e)return!1;await uo(10)}return t.volume!==e},Xh=/.*Version\/.*Safari\/.*/.test(l.navigator.userAgent),Vs=(t=Fs())=>l.matchMedia("(display-mode: standalone)").matches&&Xh?!1:typeof(t==null?void 0:t.requestPictureInPicture)=="function",Ks=(t=Fs())=>Bu({documentElement:V,media:t}),Wu=Ks(),Fu=Vs(),Vu=!!l.WebKitPlaybackTargetAvailabilityEvent,Ku=!!l.chrome;var Pi=t=>jt(t.media,e=>[fe.SUBTITLES,fe.CAPTIONS].includes(e.kind)).sort((e,i)=>e.kind>=i.kind?1:-1),Gs=t=>jt(t.media,e=>e.mode===St.SHOWING&&[fe.SUBTITLES,fe.CAPTIONS].includes(e.kind)),wo=(t,e)=>{let i=Pi(t),a=Gs(t),r=!!a.length;if(i.length){if(e===!1||r&&e!==!0)Jt(St.DISABLED,i,a);else if(e===!0||!r&&e!==!1){let o=i[0],{options:s}=t;if(!(s!=null&&s.noSubtitlesLangPref)){let T=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),_=T?[T,...globalThis.navigator.languages]:globalThis.navigator.languages,E=i.filter(f=>_.some(I=>f.language.toLowerCase().startsWith(I.split("-")[0]))).sort((f,I)=>{let b=_.findIndex(C=>f.language.toLowerCase().startsWith(C.split("-")[0])),M=_.findIndex(C=>I.language.toLowerCase().startsWith(C.split("-")[0]));return b-M});E[0]&&(o=E[0])}let{language:d,label:u,kind:p}=o;Jt(St.DISABLED,i,a),Jt(St.SHOWING,i,[{language:d,label:u,kind:p}])}}},Ro=(t,e)=>t===e?!0:t==null||e==null||typeof t!=typeof e?!1:typeof t=="number"&&Number.isNaN(t)&&Number.isNaN(e)?!0:typeof t!="object"?!1:Array.isArray(t)?Jh(t,e):Object.entries(t).every(([i,a])=>i in e&&Ro(a,e[i])),Jh=(t,e)=>{let i=Array.isArray(t),a=Array.isArray(e);return i!==a?!1:i||a?t.length!==e.length?!1:t.every((r,o)=>Ro(r,e[o])):!0};var jh=Object.values(Pe),xo,ep=$u().then(t=>(xo=t,xo)),Gu=async(...t)=>{await Promise.all(t.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof l.HTMLElement))return;let i=e.localName;if(!i.includes("-"))return;let a=l.customElements.get(i);a&&e instanceof a||(await l.customElements.whenDefined(i),l.customElements.upgrade(e))}))},tp=new l.DOMParser,ip=t=>t&&(tp.parseFromString(t,"text/html").body.textContent||t),Ni={mediaError:{get(t,e){let{media:i}=t;if((e==null?void 0:e.type)!=="playing")return i==null?void 0:i.error},mediaEvents:["emptied","error","playing"]},mediaErrorCode:{get(t,e){var i;let{media:a}=t;if((e==null?void 0:e.type)!=="playing")return(i=a==null?void 0:a.error)==null?void 0:i.code},mediaEvents:["emptied","error","playing"]},mediaErrorMessage:{get(t,e){var i,a;let{media:r}=t;if((e==null?void 0:e.type)!=="playing")return(a=(i=r==null?void 0:r.error)==null?void 0:i.message)!=null?a:""},mediaEvents:["emptied","error","playing"]},mediaWidth:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.videoHeight)!=null?e:0},mediaEvents:["resize"]},mediaPaused:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.paused)!=null?e:!0},set(t,e){var i;let{media:a}=e;a&&(t?a.pause():(i=a.play())==null||i.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(t,e){let{media:i}=t;return i?e?e.type==="playing":!i.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.playbackRate)!=null?e:1},set(t,e){let{media:i}=e;i&&Number.isFinite(+t)&&(i.playbackRate=+t)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.muted)!=null?e:!1},set(t,e){let{media:i,options:{noMutedPref:a}={}}=e;if(i){i.muted=t;try{let r=l.localStorage.getItem("media-chrome-pref-muted")!==null,o=i.hasAttribute("muted");if(a){r&&l.localStorage.removeItem("media-chrome-pref-muted");return}if(o&&!r)return;l.localStorage.setItem("media-chrome-pref-muted",t?"true":"false")}catch(r){console.debug("Error setting muted pref",r)}}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(t,e)=>{let{options:{noMutedPref:i}}=e,{media:a}=e;if(!(!a||a.muted||i))try{let r=l.localStorage.getItem("media-chrome-pref-muted")==="true";Ni.mediaMuted.set(r,e),t(r)}catch(r){console.debug("Error getting muted pref",r)}}]},mediaLoop:{get(t){let{media:e}=t;return e==null?void 0:e.loop},set(t,e){let{media:i}=e;i&&(i.loop=t)},mediaEvents:["medialooprequest"]},mediaVolume:{get(t){var e;let{media:i}=t;return(e=i==null?void 0:i.volume)!=null?e:1},set(t,e){let{media:i,options:{noVolumePref:a}={}}=e;if(i){try{t==null?l.localStorage.removeItem("media-chrome-pref-volume"):!i.hasAttribute("muted")&&!a&&l.localStorage.setItem("media-chrome-pref-volume",t.toString())}catch(r){console.debug("Error setting volume pref",r)}Number.isFinite(+t)&&(i.volume=+t)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(t,e)=>{let{options:{noVolumePref:i}}=e;if(!i)try{let{media:a}=e;if(!a)return;let r=l.localStorage.getItem("media-chrome-pref-volume");if(r==null)return;Ni.mediaVolume.set(+r,e),t(+r)}catch(a){console.debug("Error getting volume pref",a)}}]},mediaVolumeLevel:{get(t){let{media:e}=t;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(t){var e;let{media:i}=t;return(e=i==null?void 0:i.currentTime)!=null?e:0},set(t,e){let{media:i}=e;!i||!Ci(t)||(i.currentTime=t)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(t){let{media:e,options:{defaultDuration:i}={}}=t;return i&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?i:Number.isFinite(e==null?void 0:e.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(t){let{media:e}=t;return(e==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(t){var e;let{media:i}=t;if(!((e=i==null?void 0:i.seekable)!=null&&e.length))return;let a=i.seekable.start(0),r=i.seekable.end(i.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(t){var e;let{media:i}=t,a=(e=i==null?void 0:i.buffered)!=null?e:[];return Array.from(a).map((r,o)=>[Number(a.start(o).toFixed(3)),Number(a.end(o).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(t){let{media:e,options:{defaultStreamType:i}={}}=t,a=[Pe.LIVE,Pe.ON_DEMAND].includes(i)?i:void 0;if(!e)return a;let{streamType:r}=e;if(jh.includes(r))return r===Pe.UNKNOWN?a:r;let o=e.duration;return o===1/0?Pe.LIVE:Number.isFinite(o)?Pe.ON_DEMAND:a},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(t){let{media:e}=t;if(!e)return Number.NaN;let{targetLiveWindow:i}=e,a=Ni.mediaStreamType.get(t);return(i==null||Number.isNaN(i))&&a===Pe.LIVE?0:i},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(t){let{media:e,options:{liveEdgeOffset:i=10}={}}=t;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Ni.mediaStreamType.get(t)===Pe.LIVE))return!1;let r=e.seekable;if(!r)return!0;if(!r.length)return!1;let o=r.end(r.length-1)-i;return e.currentTime>=o},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(t){return Pi(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(t){return Gs(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(t,e)=>{var i,a;let{media:r,options:o}=e;if(!r)return;let s=d=>{var u;!o.defaultSubtitles||d&&![fe.CAPTIONS,fe.SUBTITLES].includes((u=d==null?void 0:d.track)==null?void 0:u.kind)||wo(e,!0)};return r.addEventListener("loadstart",s),(i=r.textTracks)==null||i.addEventListener("addtrack",s),(a=r.textTracks)==null||a.addEventListener("removetrack",s),()=>{var d,u;r.removeEventListener("loadstart",s),(d=r.textTracks)==null||d.removeEventListener("addtrack",s),(u=r.textTracks)==null||u.removeEventListener("removetrack",s)}}]},mediaChaptersCues:{get(t){var e;let{media:i}=t;if(!i)return[];let[a]=jt(i,{kind:fe.CHAPTERS});return Array.from((e=a==null?void 0:a.cues)!=null?e:[]).map(({text:r,startTime:o,endTime:s})=>({text:ip(r),startTime:o,endTime:s}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;if(!a)return;let r=a.querySelector('track[kind="chapters"][default][src]'),o=(i=a.shadowRoot)==null?void 0:i.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return r==null||r.addEventListener("load",t),o==null||o.addEventListener("load",t),()=>{r==null||r.removeEventListener("load",t),o==null||o.removeEventListener("load",t)}}]},mediaIsPip:{get(t){var e,i;let{media:a,documentElement:r}=t;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 o=r.pictureInPictureElement.shadowRoot;for(;o!=null&&o.pictureInPictureElement;){if(o.pictureInPictureElement===a)return!0;o=(i=o.pictureInPictureElement)==null?void 0:i.shadowRoot}}return!1},set(t,e){let{media:i}=e;if(i)if(t){if(!V.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}let a=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};i.requestPictureInPicture().catch(r=>{if(r.code===11){if(!i.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(i.readyState===0&&i.preload==="none"){let o=()=>{i.removeEventListener("loadedmetadata",s),i.preload="none"},s=()=>{i.requestPictureInPicture().catch(a),o()};i.addEventListener("loadedmetadata",s),i.preload="metadata",setTimeout(()=>{i.readyState===0&&a(),o()},1e3)}else throw r}else throw r})}else V.pictureInPictureElement&&V.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(t){var e;let{media:i}=t;return[...(e=i==null?void 0:i.videoRenditions)!=null?e:[]].map(a=>({...a}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(t){var e,i,a;let{media:r}=t;return(a=(i=r==null?void 0:r.videoRenditions)==null?void 0:i[(e=r.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:a.id},set(t,e){let{media:i}=e;if(!(i!=null&&i.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let a=t,r=Array.prototype.findIndex.call(i.videoRenditions,o=>o.id==a);i.videoRenditions.selectedIndex!=r&&(i.videoRenditions.selectedIndex=r)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(t){var e;let{media:i}=t;return[...(e=i==null?void 0:i.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(t){var e,i;let{media:a}=t;return(i=[...(e=a==null?void 0:a.audioTracks)!=null?e:[]].find(r=>r.enabled))==null?void 0:i.id},set(t,e){let{media:i}=e;if(!(i!=null&&i.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let a=t;for(let r of i.audioTracks)r.enabled=a==r.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(t){return Hu(t)},set(t,e,i){var a;t?(Nu(e),i.detail&&((a=e.media)==null||a.focus())):Uu(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(t){var e;let{media:i}=t;return!(i!=null&&i.remote)||((e=i.remote)==null?void 0:e.state)==="disconnected"?!1:!!i.remote.state},set(t,e){var i,a;let{media:r}=e;if(r&&!(t&&((i=r.remote)==null?void 0:i.state)!=="disconnected")&&!(!t&&((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(t,e){let{media:i}=e;if(i){if(!(i.webkitShowPlaybackTargetPicker&&l.WebKitPlaybackTargetAvailabilityEvent)){console.error("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}i.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(t){let{media:e}=t;if(!Wu||!Ks(e))return ve.UNSUPPORTED}},mediaPipUnavailable:{get(t){let{media:e}=t;if(!Fu||!Vs(e))return ve.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return ve.UNAVAILABLE}},mediaVolumeUnavailable:{get(t){let{media:e}=t;if(xo===!1||(e==null?void 0:e.volume)==null)return ve.UNSUPPORTED},stateOwnersUpdateHandlers:[t=>{xo==null&&ep.then(e=>t(e?void 0:ve.UNSUPPORTED))}]},mediaCastUnavailable:{get(t,{availability:e="not-available"}={}){var i;let{media:a}=t;if(!Ku||!((i=a==null?void 0:a.remote)!=null&&i.state))return ve.UNSUPPORTED;if(!(e==null||e==="available"))return ve.UNAVAILABLE},stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(i=a==null?void 0:a.remote)==null||i.watchAvailability(o=>{t({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var o;(o=a==null?void 0:a.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(t,e){if(!Vu)return ve.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return ve.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(t,e)=>{var i;let{media:a}=e;return a?(a.disableRemotePlayback||a.hasAttribute("disableremoteplayback")||(i=a==null?void 0:a.remote)==null||i.watchAvailability(o=>{t({availability:o?"available":"not-available"})}).catch(o=>{o.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var o;(o=a==null?void 0:a.remote)==null||o.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(t){var e;let{media:i}=t;if(!(i!=null&&i.videoRenditions))return ve.UNSUPPORTED;if(!((e=i.videoRenditions)!=null&&e.length))return ve.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(t){var e,i;let{media:a}=t;if(!(a!=null&&a.audioTracks))return ve.UNSUPPORTED;if(((i=(e=a.audioTracks)==null?void 0:e.length)!=null?i:0)<=1)return ve.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(t){let{options:{mediaLang:e}={}}=t;return e!=null?e:"en"}}};var Yu={[m.MEDIA_PREVIEW_REQUEST](t,e,{detail:i}){var a,r,o;let{media:s}=e,d=i!=null?i:void 0,u,p;if(s&&d!=null){let[f]=jt(s,{kind:fe.METADATA,label:"thumbnails"}),I=Array.prototype.find.call((a=f==null?void 0:f.cues)!=null?a:[],(b,M,C)=>M===0?b.endTime>d:M===C.length-1?b.startTime<=d:b.startTime<=d&&b.endTime>d);if(I){let b=/'^(?:[a-z]+:)?\/\//i.test(I.text)||(r=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:r.src,M=new URL(I.text,b);p=new URLSearchParams(M.hash).get("#xywh").split(",").map(ie=>+ie),u=M.href}}let T=t.mediaDuration.get(e),E=(o=t.mediaChaptersCues.get(e).find((f,I,b)=>I===b.length-1&&T===f.endTime?f.startTime<=d&&f.endTime>=d:f.startTime<=d&&f.endTime>d))==null?void 0:o.text;return i!=null&&E==null&&(E=""),{mediaPreviewTime:d,mediaPreviewImage:u,mediaPreviewCoords:p,mediaPreviewChapter:E}},[m.MEDIA_PAUSE_REQUEST](t,e){t["mediaPaused"].set(!0,e)},[m.MEDIA_PLAY_REQUEST](t,e){var i,a,r,o;let s="mediaPaused",u=t.mediaStreamType.get(e)===Pe.LIVE,p=!((i=e.options)!=null&&i.noAutoSeekToLive),T=t.mediaTargetLiveWindow.get(e)>0;if(u&&p&&!T){let _=(a=t.mediaSeekable.get(e))==null?void 0:a[1];if(_){let E=(o=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?o:0,f=_-E;t.mediaCurrentTime.set(f,e)}}t[s].set(!1,e)},[m.MEDIA_PLAYBACK_RATE_REQUEST](t,e,{detail:i}){let a="mediaPlaybackRate",r=i;t[a].set(r,e)},[m.MEDIA_MUTE_REQUEST](t,e){t["mediaMuted"].set(!0,e)},[m.MEDIA_UNMUTE_REQUEST](t,e){let i="mediaMuted";t.mediaVolume.get(e)||t.mediaVolume.set(.25,e),t[i].set(!1,e)},[m.MEDIA_LOOP_REQUEST](t,e,{detail:i}){let a="mediaLoop",r=!!i;return t[a].set(r,e),{mediaLoop:r}},[m.MEDIA_VOLUME_REQUEST](t,e,{detail:i}){let a="mediaVolume",r=i;r&&t.mediaMuted.get(e)&&t.mediaMuted.set(!1,e),t[a].set(r,e)},[m.MEDIA_SEEK_REQUEST](t,e,{detail:i}){let a="mediaCurrentTime",r=i;t[a].set(r,e)},[m.MEDIA_SEEK_TO_LIVE_REQUEST](t,e){var i,a,r;let o="mediaCurrentTime",s=(i=t.mediaSeekable.get(e))==null?void 0:i[1];if(Number.isNaN(Number(s)))return;let d=(r=(a=e.options)==null?void 0:a.seekToLiveOffset)!=null?r:0,u=s-d;t[o].set(u,e)},[m.MEDIA_SHOW_SUBTITLES_REQUEST](t,e,{detail:i}){var a;let{options:r}=e,o=Pi(e),s=Ws(i),d=(a=s[0])==null?void 0:a.language;d&&!r.noSubtitlesLangPref&&l.localStorage.setItem("media-chrome-pref-subtitles-lang",d),Jt(St.SHOWING,o,s)},[m.MEDIA_DISABLE_SUBTITLES_REQUEST](t,e,{detail:i}){let a=Pi(e),r=i!=null?i:[];Jt(St.DISABLED,a,r)},[m.MEDIA_TOGGLE_SUBTITLES_REQUEST](t,e,{detail:i}){wo(e,i)},[m.MEDIA_RENDITION_REQUEST](t,e,{detail:i}){let a="mediaRenditionSelected",r=i;t[a].set(r,e)},[m.MEDIA_AUDIO_TRACK_REQUEST](t,e,{detail:i}){let a="mediaAudioTrackEnabled",r=i;t[a].set(r,e)},[m.MEDIA_ENTER_PIP_REQUEST](t,e){let i="mediaIsPip";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[m.MEDIA_EXIT_PIP_REQUEST](t,e){t["mediaIsPip"].set(!1,e)},[m.MEDIA_ENTER_FULLSCREEN_REQUEST](t,e,i){let a="mediaIsFullscreen";t.mediaIsPip.get(e)&&t.mediaIsPip.set(!1,e),t[a].set(!0,e,i)},[m.MEDIA_EXIT_FULLSCREEN_REQUEST](t,e){t["mediaIsFullscreen"].set(!1,e)},[m.MEDIA_ENTER_CAST_REQUEST](t,e){let i="mediaIsCasting";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[m.MEDIA_EXIT_CAST_REQUEST](t,e){t["mediaIsCasting"].set(!1,e)},[m.MEDIA_AIRPLAY_REQUEST](t,e){t["mediaIsAirplaying"].set(!0,e)}};var qu=({media:t,fullscreenElement:e,documentElement:i,stateMediator:a=Ni,requestMap:r=Yu,options:o={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let d=[],u={options:{...o}},p=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),T=b=>{b!=null&&(Ro(b,p)||(p=Object.freeze({...p,...b}),d.forEach(M=>M(p))))},_=()=>{let b=Object.entries(a).reduce((M,[C,{get:ie}])=>(M[C]=ie(u),M),{});T(b)},E={},f,I=async(b,M)=>{var C,ie,Ae,kt,ct,Ia,Ma,Ca,La,wa,Ra,xa,Da,Oa,Pa,Na;let oo=!!f;if(f={...u,...f!=null?f:{},...b},oo)return;await Gu(...Object.values(b));let mt=d.length>0&&M===0&&s,Ua=u.media!==f.media,Ha=((C=u.media)==null?void 0:C.textTracks)!==((ie=f.media)==null?void 0:ie.textTracks),Ba=((Ae=u.media)==null?void 0:Ae.videoRenditions)!==((kt=f.media)==null?void 0:kt.videoRenditions),Kd=((ct=u.media)==null?void 0:ct.audioTracks)!==((Ia=f.media)==null?void 0:Ia.audioTracks),Gd=((Ma=u.media)==null?void 0:Ma.remote)!==((Ca=f.media)==null?void 0:Ca.remote),Yd=u.documentElement!==f.documentElement,qd=!!u.media&&(Ua||mt),Zd=!!((La=u.media)!=null&&La.textTracks)&&(Ha||mt),Qd=!!((wa=u.media)!=null&&wa.videoRenditions)&&(Ba||mt),zd=!!((Ra=u.media)!=null&&Ra.audioTracks)&&(Kd||mt),Xd=!!((xa=u.media)!=null&&xa.remote)&&(Gd||mt),Jd=!!u.documentElement&&(Yd||mt),Is=qd||Zd||Qd||zd||Xd||Jd,Ii=d.length===0&&M===1&&s,jd=!!f.media&&(Ua||Ii),eu=!!((Da=f.media)!=null&&Da.textTracks)&&(Ha||Ii),tu=!!((Oa=f.media)!=null&&Oa.videoRenditions)&&(Ba||Ii),iu=!!((Pa=f.media)!=null&&Pa.audioTracks)&&(Kd||Ii),au=!!((Na=f.media)!=null&&Na.remote)&&(Gd||Ii),ru=!!f.documentElement&&(Yd||Ii),ou=jd||eu||tu||iu||au||ru;if(!(Is||ou)){Object.entries(f).forEach(([F,$a])=>{u[F]=$a}),_(),f=void 0;return}Object.entries(a).forEach(([F,{get:$a,mediaEvents:uh=[],textTracksEvents:ch=[],videoRenditionsEvents:mh=[],audioTracksEvents:hh=[],remoteEvents:ph=[],rootEvents:fh=[],stateOwnersUpdateHandlers:vh=[]}])=>{E[F]||(E[F]={});let Te=Q=>{let ee=$a(u,Q);T({[F]:ee})},re;re=E[F].mediaEvents,uh.forEach(Q=>{re&&qd&&(u.media.removeEventListener(Q,re),E[F].mediaEvents=void 0),jd&&(f.media.addEventListener(Q,Te),E[F].mediaEvents=Te)}),re=E[F].textTracksEvents,ch.forEach(Q=>{var ee,Oe;re&&Zd&&((ee=u.media.textTracks)==null||ee.removeEventListener(Q,re),E[F].textTracksEvents=void 0),eu&&((Oe=f.media.textTracks)==null||Oe.addEventListener(Q,Te),E[F].textTracksEvents=Te)}),re=E[F].videoRenditionsEvents,mh.forEach(Q=>{var ee,Oe;re&&Qd&&((ee=u.media.videoRenditions)==null||ee.removeEventListener(Q,re),E[F].videoRenditionsEvents=void 0),tu&&((Oe=f.media.videoRenditions)==null||Oe.addEventListener(Q,Te),E[F].videoRenditionsEvents=Te)}),re=E[F].audioTracksEvents,hh.forEach(Q=>{var ee,Oe;re&&zd&&((ee=u.media.audioTracks)==null||ee.removeEventListener(Q,re),E[F].audioTracksEvents=void 0),iu&&((Oe=f.media.audioTracks)==null||Oe.addEventListener(Q,Te),E[F].audioTracksEvents=Te)}),re=E[F].remoteEvents,ph.forEach(Q=>{var ee,Oe;re&&Xd&&((ee=u.media.remote)==null||ee.removeEventListener(Q,re),E[F].remoteEvents=void 0),au&&((Oe=f.media.remote)==null||Oe.addEventListener(Q,Te),E[F].remoteEvents=Te)}),re=E[F].rootEvents,fh.forEach(Q=>{re&&Jd&&(u.documentElement.removeEventListener(Q,re),E[F].rootEvents=void 0),ru&&(f.documentElement.addEventListener(Q,Te),E[F].rootEvents=Te)});let no=E[F].stateOwnersUpdateHandlers;if(no&&Is&&(Array.isArray(no)?no:[no]).forEach(ee=>{typeof ee=="function"&&ee()}),ou){let Q=vh.map(ee=>ee(Te,f)).filter(ee=>typeof ee=="function");E[F].stateOwnersUpdateHandlers=Q.length===1?Q[0]:Q}else Is&&(E[F].stateOwnersUpdateHandlers=void 0)}),Object.entries(f).forEach(([F,$a])=>{u[F]=$a}),_(),f=void 0};return I({media:t,fullscreenElement:e,documentElement:i,options:o}),{dispatch(b){let{type:M,detail:C}=b;if(r[M]&&p.mediaErrorCode==null){T(r[M](a,u,b));return}M==="mediaelementchangerequest"?I({media:C}):M==="fullscreenelementchangerequest"?I({fullscreenElement:C}):M==="documentelementchangerequest"?I({documentElement:C}):M==="optionschangerequest"&&(Object.entries(C!=null?C:{}).forEach(([ie,Ae])=>{u.options[ie]=Ae}),_())},getState(){return p},subscribe(b){return I({},d.length+1),d.push(b),b(p),()=>{let M=d.indexOf(b);M>=0&&(I({},d.length-1),d.splice(M,1))}}}};var zs=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},L=(t,e,i)=>(zs(t,e,"read from private field"),i?i.call(t):e.get(t)),Ue=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Et=(t,e,i,a)=>(zs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ge=(t,e,i)=>(zs(t,e,"access private method"),i),Lt,Ja,$,ti,ja,Ke,Do,Oo,Ys,ii,Ui,Po,qs,Zs,ec,tc=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],Zu=10,Qu=.025,zu=.25,ap=.25,rp=2,v={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_DOWN_VOLUME_STEP:"keyboarddownvolumestep",KEYBOARD_UP_VOLUME_STEP:"keyboardupvolumestep",KEYS_USED:"keysused",LANG:"lang",LOOP:"loop",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_DEFAULT_STORE:"nodefaultstore",NO_HOTKEYS:"nohotkeys",NO_MUTED_PREF:"nomutedpref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_VOLUME_PREF:"novolumepref",SEEK_TO_LIVE_OFFSET:"seektoliveoffset"},No=class extends Qt{constructor(){super(),Ue(this,Oo),Ue(this,ii),Ue(this,Po),Ue(this,Zs),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,Ue(this,Lt,new Ct(this,v.HOTKEYS)),Ue(this,Ja,void 0),Ue(this,$,void 0),Ue(this,ti,null),Ue(this,ja,void 0),Ue(this,Ke,void 0),Ue(this,Do,i=>{var a;(a=L(this,$))==null||a.dispatch(i)}),this.associateElement(this);let e={};Et(this,ja,i=>{Object.entries(i).forEach(([a,r])=>{if(a in e&&e[a]===r)return;this.propagateMediaState(a,r);let o=a.toLowerCase(),s=new l.CustomEvent(uu[o],{composed:!0,detail:r});this.dispatchEvent(s)}),e=i}),this.hasAttribute(v.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(v.NO_HOTKEYS,v.HOTKEYS,v.DEFAULT_STREAM_TYPE,v.DEFAULT_SUBTITLES,v.DEFAULT_DURATION,v.NO_MUTED_PREF,v.NO_VOLUME_PREF,v.LANG,v.LOOP)}get mediaStore(){return L(this,$)}set mediaStore(e){var i,a;if(L(this,$)&&((i=L(this,Ke))==null||i.call(this),Et(this,Ke,void 0)),Et(this,$,e),!L(this,$)&&!this.hasAttribute(v.NO_DEFAULT_STORE)){Ge(this,Oo,Ys).call(this);return}Et(this,Ke,(a=L(this,$))==null?void 0:a.subscribe(L(this,ja)))}get fullscreenElement(){var e;return(e=L(this,Ja))!=null?e:this}set fullscreenElement(e){var i;this.hasAttribute(v.FULLSCREEN_ELEMENT)&&this.removeAttribute(v.FULLSCREEN_ELEMENT),Et(this,Ja,e),(i=L(this,$))==null||i.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return k(this,v.DEFAULT_SUBTITLES)}set defaultSubtitles(e){S(this,v.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return w(this,v.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){R(this,v.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return O(this,v.DEFAULT_DURATION)}set defaultDuration(e){N(this,v.DEFAULT_DURATION,e)}get noHotkeys(){return k(this,v.NO_HOTKEYS)}set noHotkeys(e){S(this,v.NO_HOTKEYS,e)}get keysUsed(){return w(this,v.KEYS_USED)}set keysUsed(e){R(this,v.KEYS_USED,e)}get liveEdgeOffset(){return O(this,v.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){N(this,v.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return k(this,v.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){S(this,v.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return k(this,v.NO_VOLUME_PREF)}set noVolumePref(e){S(this,v.NO_VOLUME_PREF,e)}get noMutedPref(){return k(this,v.NO_MUTED_PREF)}set noMutedPref(e){S(this,v.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return k(this,v.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){S(this,v.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return k(this,v.NO_DEFAULT_STORE)}set noDefaultStore(e){S(this,v.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,i,a){var r,o,s,d,u,p,T,_,E,f,I,b;if(super.attributeChangedCallback(e,i,a),e===v.NO_HOTKEYS)a!==i&&a===""?(this.hasAttribute(v.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==i&&a===null&&this.enableHotkeys();else if(e===v.HOTKEYS)L(this,Lt).value=a;else if(e===v.DEFAULT_SUBTITLES&&a!==i)(r=L(this,$))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(v.DEFAULT_SUBTITLES)}});else if(e===v.DEFAULT_STREAM_TYPE)(s=L(this,$))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(o=this.getAttribute(v.DEFAULT_STREAM_TYPE))!=null?o:void 0}});else if(e===v.LIVE_EDGE_OFFSET)(d=L(this,$))==null||d.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(v.LIVE_EDGE_OFFSET)?+this.getAttribute(v.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(v.SEEK_TO_LIVE_OFFSET)?void 0:+this.getAttribute(v.LIVE_EDGE_OFFSET)}});else if(e===v.SEEK_TO_LIVE_OFFSET)(u=L(this,$))==null||u.dispatch({type:"optionschangerequest",detail:{seekToLiveOffset:this.hasAttribute(v.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(v.SEEK_TO_LIVE_OFFSET):void 0}});else if(e===v.NO_AUTO_SEEK_TO_LIVE)(p=L(this,$))==null||p.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(v.NO_AUTO_SEEK_TO_LIVE)}});else if(e===v.FULLSCREEN_ELEMENT){let M=a?(T=this.getRootNode())==null?void 0:T.getElementById(a):void 0;Et(this,Ja,M),(_=L(this,$))==null||_.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===v.LANG&&a!==i?(_u(a),(E=L(this,$))==null||E.dispatch({type:"optionschangerequest",detail:{mediaLang:a}})):e===v.LOOP&&a!==i?(f=L(this,$))==null||f.dispatch({type:m.MEDIA_LOOP_REQUEST,detail:a!=null}):e===v.NO_VOLUME_PREF&&a!==i?(I=L(this,$))==null||I.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(v.NO_VOLUME_PREF)}}):e===v.NO_MUTED_PREF&&a!==i&&((b=L(this,$))==null||b.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(v.NO_MUTED_PREF)}}))}connectedCallback(){var e,i;!L(this,$)&&!this.hasAttribute(v.NO_DEFAULT_STORE)&&Ge(this,Oo,Ys).call(this),(e=L(this,$))==null||e.dispatch({type:"documentelementchangerequest",detail:V}),super.connectedCallback(),L(this,$)&&!L(this,Ke)&&Et(this,Ke,(i=L(this,$))==null?void 0:i.subscribe(L(this,ja))),this.hasAttribute(v.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,i,a,r;(e=super.disconnectedCallback)==null||e.call(this),L(this,$)&&((i=L(this,$))==null||i.dispatch({type:"documentelementchangerequest",detail:void 0}),(a=L(this,$))==null||a.dispatch({type:m.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})),L(this,Ke)&&((r=L(this,Ke))==null||r.call(this),Et(this,Ke,void 0))}mediaSetCallback(e){var i;super.mediaSetCallback(e),(i=L(this,$))==null||i.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var i;super.mediaUnsetCallback(e),(i=L(this,$))==null||i.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,i){ju(this.mediaStateReceivers,e,i)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:i}=this;if(i.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),o=up(e,a,r);Object.values(m).forEach(s=>{e.addEventListener(s,L(this,Do))}),i.set(e,o)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:i}=this;if(!i.has(e))return;i.get(e)(),i.delete(e),Object.values(m).forEach(r=>{e.removeEventListener(r,L(this,Do))})}registerMediaStateReceiver(e){if(!e)return;let i=this.mediaStateReceivers;i.indexOf(e)>-1||(i.push(e),L(this,$)&&Object.entries(L(this,$).getState()).forEach(([r,o])=>{ju([e],r,o)}))}unregisterMediaStateReceiver(e){let i=this.mediaStateReceivers,a=i.indexOf(e);a<0||i.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",Ge(this,Po,qs))}disableHotkeys(){this.removeEventListener("keydown",Ge(this,Po,qs)),this.removeEventListener("keyup",Ge(this,ii,Ui))}get hotkeys(){return w(this,v.HOTKEYS)}set hotkeys(e){R(this,v.HOTKEYS,e)}keyboardShortcutHandler(e){var i,a,r,o,s,d,u,p,T;let _=e.target;if(((r=(a=(i=_.getAttribute(v.KEYS_USED))==null?void 0:i.split(" "))!=null?a:_==null?void 0:_.keysUsed)!=null?r:[]).map(C=>C==="Space"?" ":C).filter(Boolean).includes(e.key))return;let f,I,b;if(!(L(this,Lt).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&L(this,Lt).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&L(this,Lt).contains("noshift+/")))switch(e.key){case" ":case"k":f=L(this,$).getState().mediaPaused?m.MEDIA_PLAY_REQUEST:m.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new l.CustomEvent(f,{composed:!0,bubbles:!0}));break;case"m":f=this.mediaStore.getState().mediaVolumeLevel==="off"?m.MEDIA_UNMUTE_REQUEST:m.MEDIA_MUTE_REQUEST,this.dispatchEvent(new l.CustomEvent(f,{composed:!0,bubbles:!0}));break;case"f":f=this.mediaStore.getState().mediaIsFullscreen?m.MEDIA_EXIT_FULLSCREEN_REQUEST:m.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new l.CustomEvent(f,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new l.CustomEvent(m.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":case"j":{let C=this.hasAttribute(v.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(v.KEYBOARD_BACKWARD_SEEK_OFFSET):Zu;I=Math.max(((o=this.mediaStore.getState().mediaCurrentTime)!=null?o:0)-C,0),b=new l.CustomEvent(m.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:I}),this.dispatchEvent(b);break}case"ArrowRight":case"l":{let C=this.hasAttribute(v.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(v.KEYBOARD_FORWARD_SEEK_OFFSET):Zu;I=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+C,0),b=new l.CustomEvent(m.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:I}),this.dispatchEvent(b);break}case"ArrowUp":{let C=this.hasAttribute(v.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(v.KEYBOARD_UP_VOLUME_STEP):Qu;I=Math.min(((d=this.mediaStore.getState().mediaVolume)!=null?d:1)+C,1),b=new l.CustomEvent(m.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:I}),this.dispatchEvent(b);break}case"ArrowDown":{let C=this.hasAttribute(v.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(v.KEYBOARD_DOWN_VOLUME_STEP):Qu;I=Math.max(((u=this.mediaStore.getState().mediaVolume)!=null?u:1)-C,0),b=new l.CustomEvent(m.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:I}),this.dispatchEvent(b);break}case"<":{let C=(p=this.mediaStore.getState().mediaPlaybackRate)!=null?p:1;I=Math.max(C-zu,ap).toFixed(2),b=new l.CustomEvent(m.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:I}),this.dispatchEvent(b);break}case">":{let C=(T=this.mediaStore.getState().mediaPlaybackRate)!=null?T:1;I=Math.min(C+zu,rp).toFixed(2),b=new l.CustomEvent(m.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:I}),this.dispatchEvent(b);break}case"/":case"?":{e.shiftKey&&Ge(this,Zs,ec).call(this);break}case"p":{f=this.mediaStore.getState().mediaIsPip?m.MEDIA_EXIT_PIP_REQUEST:m.MEDIA_ENTER_PIP_REQUEST,b=new l.CustomEvent(f,{composed:!0,bubbles:!0}),this.dispatchEvent(b);break}default:break}}};Lt=new WeakMap;Ja=new WeakMap;$=new WeakMap;ti=new WeakMap;ja=new WeakMap;Ke=new WeakMap;Do=new WeakMap;Oo=new WeakSet;Ys=function(){var t;this.mediaStore=qu({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(v.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(v.DEFAULT_DURATION)?+this.getAttribute(v.DEFAULT_DURATION):void 0,defaultStreamType:(t=this.getAttribute(v.DEFAULT_STREAM_TYPE))!=null?t:void 0,liveEdgeOffset:this.hasAttribute(v.LIVE_EDGE_OFFSET)?+this.getAttribute(v.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(v.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(v.SEEK_TO_LIVE_OFFSET):this.hasAttribute(v.LIVE_EDGE_OFFSET)?+this.getAttribute(v.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(v.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(v.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(v.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(v.NO_SUBTITLES_LANG_PREF)}})};ii=new WeakSet;Ui=function(t){let{key:e,shiftKey:i}=t;if(!(i&&(e==="/"||e==="?")||tc.includes(e))){this.removeEventListener("keyup",Ge(this,ii,Ui));return}this.keyboardShortcutHandler(t)};Po=new WeakSet;qs=function(t){var e;let{metaKey:i,altKey:a,key:r,shiftKey:o}=t,s=o&&(r==="/"||r==="?");if(s&&((e=L(this,ti))!=null&&e.open)){this.removeEventListener("keyup",Ge(this,ii,Ui));return}if(i||a||!s&&!tc.includes(r)){this.removeEventListener("keyup",Ge(this,ii,Ui));return}let d=t.target,u=d instanceof HTMLElement&&(d.tagName.toLowerCase()==="media-volume-range"||d.tagName.toLowerCase()==="media-time-range");[" ","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(r)&&!(L(this,Lt).contains(`no${r.toLowerCase()}`)||r===" "&&L(this,Lt).contains("nospace"))&&!u&&t.preventDefault(),this.addEventListener("keyup",Ge(this,ii,Ui),{once:!0})};Zs=new WeakSet;ec=function(){L(this,ti)||(Et(this,ti,V.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(L(this,ti))),L(this,ti).open=!0};var op=Object.values(n),np=Object.values(Rs),ic=t=>{var e,i,a,r;let{observedAttributes:o}=t.constructor;!o&&((e=t.nodeName)!=null&&e.includes("-"))&&(l.customElements.upgrade(t),{observedAttributes:o}=t.constructor);let s=(r=(a=(i=t==null?void 0:t.getAttribute)==null?void 0:i.call(t,x.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(o||s)?(o||s).filter(d=>op.includes(d)):[]},sp=t=>{var e,i;return(e=t.nodeName)!=null&&e.includes("-")&&l.customElements.get((i=t.nodeName)==null?void 0:i.toLowerCase())&&!(t instanceof l.customElements.get(t.nodeName.toLowerCase()))&&l.customElements.upgrade(t),np.some(a=>a in t)},Qs=t=>sp(t)||!!ic(t).length,Xu=t=>{var e;return(e=t==null?void 0:t.join)==null?void 0:e.call(t,":")},Ju={[n.MEDIA_SUBTITLES_LIST]:vt,[n.MEDIA_SUBTITLES_SHOWING]:vt,[n.MEDIA_SEEKABLE]:Xu,[n.MEDIA_BUFFERED]:t=>t==null?void 0:t.map(Xu).join(" "),[n.MEDIA_PREVIEW_COORDS]:t=>t==null?void 0:t.join(" "),[n.MEDIA_RENDITION_LIST]:mu,[n.MEDIA_AUDIO_TRACK_LIST]:pu},lp=async(t,e,i)=>{var a,r;if(t.isConnected||await uo(0),typeof i=="boolean"||i==null)return S(t,e,i);if(typeof i=="number")return N(t,e,i);if(typeof i=="string")return R(t,e,i);if(Array.isArray(i)&&!i.length)return t.removeAttribute(e);let o=(r=(a=Ju[e])==null?void 0:a.call(Ju,i))!=null?r:i;return t.setAttribute(e,o)},dp=t=>{var e;return!!((e=t.closest)!=null&&e.call(t,'*[slot="media"]'))},ei=(t,e)=>{if(dp(t))return;let i=(r,o)=>{var s,d;Qs(r)&&o(r);let{children:u=[]}=r!=null?r:{},p=(d=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?d:[];[...u,...p].forEach(_=>ei(_,o))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!Qs(t)){l.customElements.whenDefined(a).then(()=>{i(t,e)});return}i(t,e)},ju=(t,e,i)=>{t.forEach(a=>{if(e in a){a[e]=i;return}let r=ic(a),o=e.toLowerCase();r.includes(o)&&lp(a,o,i)})},up=(t,e,i)=>{ei(t,e);let a=T=>{var _;let E=(_=T==null?void 0:T.composedPath()[0])!=null?_:T.target;e(E)},r=T=>{var _;let E=(_=T==null?void 0:T.composedPath()[0])!=null?_:T.target;i(E)};t.addEventListener(m.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(m.UNREGISTER_MEDIA_STATE_RECEIVER,r);let o=T=>{T.forEach(_=>{let{addedNodes:E=[],removedNodes:f=[],type:I,target:b,attributeName:M}=_;I==="childList"?(Array.prototype.forEach.call(E,C=>ei(C,e)),Array.prototype.forEach.call(f,C=>ei(C,i))):I==="attributes"&&M===x.MEDIA_CHROME_ATTRIBUTES&&(Qs(b)?e(b):i(b))})},s=[],d=T=>{let _=T.target;_.name!=="media"&&(s.forEach(E=>ei(E,i)),s=[..._.assignedElements({flatten:!0})],s.forEach(E=>ei(E,e)))};t.addEventListener("slotchange",d);let u=new MutationObserver(o);return u.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{ei(t,i),t.removeEventListener("slotchange",d),u.disconnect(),t.removeEventListener(m.REGISTER_MEDIA_STATE_RECEIVER,a),t.removeEventListener(m.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};l.customElements.get("media-controller")||l.customElements.define("media-controller",No);var Xs=No;var Hi={PLACEMENT:"placement",BOUNDS:"bounds"};function cp(t){return`
|
|
160
160
|
<style>
|
|
161
161
|
:host {
|
|
162
162
|
--_tooltip-background-color: var(--media-tooltip-background-color, var(--media-secondary-color, rgba(20, 20, 30, .7)));
|
|
@@ -265,7 +265,7 @@
|
|
|
265
265
|
</style>
|
|
266
266
|
<slot></slot>
|
|
267
267
|
<div id="arrow"></div>
|
|
268
|
-
`}var
|
|
268
|
+
`}var Bi=class extends l.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Eo(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;let i=this.placement;if(i==="left"||i==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let a=getComputedStyle(this),r=(e=Ve(this,"#"+this.bounds))!=null?e:Y(this);if(!r)return;let{x:o,width:s}=r.getBoundingClientRect(),{x:d,width:u}=this.getBoundingClientRect(),p=d+u,T=o+s,_=a.getPropertyValue("--media-tooltip-offset-x"),E=_?parseFloat(_.replace("px","")):0,f=a.getPropertyValue("--media-tooltip-container-margin"),I=f?parseFloat(f.replace("px","")):0,b=d-o+E-I,M=p-T+E+I;if(b<0){this.style.setProperty("--media-tooltip-offset-x",`${b}px`);return}if(M>0){this.style.setProperty("--media-tooltip-offset-x",`${M}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}if(this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[Hi.PLACEMENT,Hi.BOUNDS]}get placement(){return w(this,Hi.PLACEMENT)}set placement(e){R(this,Hi.PLACEMENT,e)}get bounds(){return w(this,Hi.BOUNDS)}set bounds(e){R(this,Hi.BOUNDS,e)}};Bi.shadowRootOptions={mode:"open"};Bi.getTemplateHTML=cp;l.customElements.get("media-tooltip")||l.customElements.define("media-tooltip",Bi);var Uo=Bi;var js=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},te=(t,e,i)=>(js(t,e,"read from private field"),i?i.call(t):e.get(t)),$i=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Ho=(t,e,i,a)=>(js(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),mp=(t,e,i)=>(js(t,e,"access private method"),i),Ye,Fi,Rt,Wi,Bo,Js,ac,wt={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function hp(t,e={}){return`
|
|
269
269
|
<style>
|
|
270
270
|
:host {
|
|
271
271
|
position: relative;
|
|
@@ -339,20 +339,20 @@
|
|
|
339
339
|
|
|
340
340
|
<slot name="tooltip">
|
|
341
341
|
<media-tooltip part="tooltip" aria-hidden="true">
|
|
342
|
-
<template shadowrootmode="${
|
|
343
|
-
${
|
|
342
|
+
<template shadowrootmode="${Uo.shadowRootOptions.mode}">
|
|
343
|
+
${Uo.getTemplateHTML({})}
|
|
344
344
|
</template>
|
|
345
345
|
<slot name="tooltip-content">
|
|
346
346
|
${this.getTooltipContentHTML(t)}
|
|
347
347
|
</slot>
|
|
348
348
|
</media-tooltip>
|
|
349
349
|
</slot>
|
|
350
|
-
`}function
|
|
350
|
+
`}function pp(t,e){return`
|
|
351
351
|
<slot></slot>
|
|
352
|
-
`}function
|
|
352
|
+
`}function fp(){return""}var U=class extends l.HTMLElement{constructor(){if(super(),$i(this,Js),$i(this,Ye,void 0),this.preventClick=!1,this.tooltipEl=null,$i(this,Fi,e=>{this.preventClick||this.handleClick(e),setTimeout(te(this,Rt),0)}),$i(this,Rt,()=>{var e,i;(i=(e=this.tooltipEl)==null?void 0:e.updateXOffset)==null||i.call(e)}),$i(this,Wi,e=>{let{key:i}=e;if(!this.keysUsed.includes(i)){this.removeEventListener("keyup",te(this,Wi));return}this.preventClick||this.handleClick(e)}),$i(this,Bo,e=>{let{metaKey:i,altKey:a,key:r}=e;if(i||a||!this.keysUsed.includes(r)){this.removeEventListener("keyup",te(this,Wi));return}this.addEventListener("keyup",te(this,Wi),{once:!0})}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes),i=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(i):this.shadowRoot.innerHTML=i}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip")}static get observedAttributes(){return["disabled",wt.TOOLTIP_PLACEMENT,x.MEDIA_CONTROLLER,n.MEDIA_LANG]}enable(){this.addEventListener("click",te(this,Fi)),this.addEventListener("keydown",te(this,Bo)),this.tabIndex=0}disable(){this.removeEventListener("click",te(this,Fi)),this.removeEventListener("keydown",te(this,Bo)),this.removeEventListener("keyup",te(this,Wi)),this.tabIndex=-1}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===x.MEDIA_CONTROLLER?(i&&((o=(r=te(this,Ye))==null?void 0:r.unassociateElement)==null||o.call(r,this),Ho(this,Ye,null)),a&&this.isConnected&&(Ho(this,Ye,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=te(this,Ye))==null?void 0:d.associateElement)==null||u.call(d,this))):e==="disabled"&&a!==i?a==null?this.enable():this.disable():e===wt.TOOLTIP_PLACEMENT&&this.tooltipEl&&a!==i?this.tooltipEl.placement=a:e===n.MEDIA_LANG&&(this.shadowRoot.querySelector('slot[name="tooltip-content"]').innerHTML=this.constructor.getTooltipContentHTML()),te(this,Rt).call(this)}connectedCallback(){var e,i,a;let{style:r}=q(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")?this.disable():this.enable(),this.setAttribute("role","button");let o=this.getAttribute(x.MEDIA_CONTROLLER);o&&(Ho(this,Ye,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(a=(i=te(this,Ye))==null?void 0:i.associateElement)==null||a.call(i,this)),l.customElements.whenDefined("media-tooltip").then(()=>mp(this,Js,ac).call(this))}disconnectedCallback(){var e,i;this.disable(),(i=(e=te(this,Ye))==null?void 0:e.unassociateElement)==null||i.call(e,this),Ho(this,Ye,null),this.removeEventListener("mouseenter",te(this,Rt)),this.removeEventListener("focus",te(this,Rt)),this.removeEventListener("click",te(this,Fi))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return w(this,wt.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){R(this,wt.TOOLTIP_PLACEMENT,e)}get mediaController(){return w(this,x.MEDIA_CONTROLLER)}set mediaController(e){R(this,x.MEDIA_CONTROLLER,e)}get disabled(){return k(this,wt.DISABLED)}set disabled(e){S(this,wt.DISABLED,e)}get noTooltip(){return k(this,wt.NO_TOOLTIP)}set noTooltip(e){S(this,wt.NO_TOOLTIP,e)}handleClick(e){}};Ye=new WeakMap;Fi=new WeakMap;Rt=new WeakMap;Wi=new WeakMap;Bo=new WeakMap;Js=new WeakSet;ac=function(){this.addEventListener("mouseenter",te(this,Rt)),this.addEventListener("focus",te(this,Rt)),this.addEventListener("click",te(this,Fi));let t=this.tooltipPlacement;t&&this.tooltipEl&&(this.tooltipEl.placement=t)};U.shadowRootOptions={mode:"open"};U.getTemplateHTML=hp;U.getSlotTemplateHTML=pp;U.getTooltipContentHTML=fp;l.customElements.get("media-chrome-button")||l.customElements.define("media-chrome-button",U);var rc=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
353
353
|
<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"/>
|
|
354
354
|
</svg>
|
|
355
|
-
`;function
|
|
355
|
+
`;function vp(t){return`
|
|
356
356
|
<style>
|
|
357
357
|
:host([${n.MEDIA_IS_AIRPLAYING}]) slot[name=icon] slot:not([name=exit]) {
|
|
358
358
|
display: none !important;
|
|
@@ -370,17 +370,17 @@
|
|
|
370
370
|
</style>
|
|
371
371
|
|
|
372
372
|
<slot name="icon">
|
|
373
|
-
<slot name="enter">${
|
|
374
|
-
<slot name="exit">${
|
|
373
|
+
<slot name="enter">${rc}</slot>
|
|
374
|
+
<slot name="exit">${rc}</slot>
|
|
375
375
|
</slot>
|
|
376
|
-
`}function
|
|
377
|
-
<slot name="tooltip-enter">${
|
|
378
|
-
<slot name="tooltip-exit">${
|
|
379
|
-
`}var
|
|
376
|
+
`}function Ep(){return`
|
|
377
|
+
<slot name="tooltip-enter">${h("start airplay")}</slot>
|
|
378
|
+
<slot name="tooltip-exit">${h("stop airplay")}</slot>
|
|
379
|
+
`}var oc=t=>{let e=t.mediaIsAirplaying?h("stop airplay"):h("start airplay");t.setAttribute("aria-label",e)},er=class extends U{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_AIRPLAYING,n.MEDIA_AIRPLAY_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),oc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_AIRPLAYING&&oc(this)}get mediaIsAirplaying(){return k(this,n.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){S(this,n.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return w(this,n.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){R(this,n.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new l.CustomEvent(m.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};er.getSlotTemplateHTML=vp;er.getTooltipContentHTML=Ep;l.customElements.get("media-airplay-button")||l.customElements.define("media-airplay-button",er);var bp=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
380
380
|
<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"/>
|
|
381
|
-
</svg>`,
|
|
381
|
+
</svg>`,gp=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
382
382
|
<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"/>
|
|
383
|
-
</svg>`;function
|
|
383
|
+
</svg>`;function _p(t){return`
|
|
384
384
|
<style>
|
|
385
385
|
:host([aria-checked="true"]) slot[name=off] {
|
|
386
386
|
display: none !important;
|
|
@@ -398,13 +398,13 @@
|
|
|
398
398
|
</style>
|
|
399
399
|
|
|
400
400
|
<slot name="icon">
|
|
401
|
-
<slot name="on">${
|
|
402
|
-
<slot name="off">${
|
|
401
|
+
<slot name="on">${bp}</slot>
|
|
402
|
+
<slot name="off">${gp}</slot>
|
|
403
403
|
</slot>
|
|
404
|
-
`}function
|
|
405
|
-
<slot name="tooltip-enable">${
|
|
406
|
-
<slot name="tooltip-disable">${
|
|
407
|
-
`}var
|
|
404
|
+
`}function Ap(){return`
|
|
405
|
+
<slot name="tooltip-enable">${h("Enable captions")}</slot>
|
|
406
|
+
<slot name="tooltip-disable">${h("Disable captions")}</slot>
|
|
407
|
+
`}var nc=t=>{t.setAttribute("aria-checked",Co(t).toString())},tr=class extends U{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_SUBTITLES_LIST,n.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",h("closed captions")),nc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_SUBTITLES_SHOWING&&nc(this)}get mediaSubtitlesList(){return sc(this,n.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){lc(this,n.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return sc(this,n.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){lc(this,n.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new l.CustomEvent(m.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}};tr.getSlotTemplateHTML=_p;tr.getTooltipContentHTML=Ap;var sc=(t,e)=>{let i=t.getAttribute(e);return i?Xt(i):[]},lc=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=vt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};l.customElements.get("media-captions-button")||l.customElements.define("media-captions-button",tr);var Tp='<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>',yp='<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>';function kp(t){return`
|
|
408
408
|
<style>
|
|
409
409
|
:host([${n.MEDIA_IS_CASTING}]) slot[name=icon] slot:not([name=exit]) {
|
|
410
410
|
display: none !important;
|
|
@@ -422,13 +422,13 @@
|
|
|
422
422
|
</style>
|
|
423
423
|
|
|
424
424
|
<slot name="icon">
|
|
425
|
-
<slot name="enter">${
|
|
426
|
-
<slot name="exit">${
|
|
425
|
+
<slot name="enter">${Tp}</slot>
|
|
426
|
+
<slot name="exit">${yp}</slot>
|
|
427
427
|
</slot>
|
|
428
|
-
`}function
|
|
429
|
-
<slot name="tooltip-enter">${
|
|
430
|
-
<slot name="tooltip-exit">${
|
|
431
|
-
`}var
|
|
428
|
+
`}function Sp(){return`
|
|
429
|
+
<slot name="tooltip-enter">${h("Start casting")}</slot>
|
|
430
|
+
<slot name="tooltip-exit">${h("Stop casting")}</slot>
|
|
431
|
+
`}var dc=t=>{let e=t.mediaIsCasting?h("stop casting"):h("start casting");t.setAttribute("aria-label",e)},ir=class extends U{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_CASTING,n.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),dc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_CASTING&&dc(this)}get mediaIsCasting(){return k(this,n.MEDIA_IS_CASTING)}set mediaIsCasting(e){S(this,n.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return w(this,n.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){R(this,n.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?m.MEDIA_EXIT_CAST_REQUEST:m.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};ir.getSlotTemplateHTML=kp;ir.getTooltipContentHTML=Sp;l.customElements.get("media-cast-button")||l.customElements.define("media-cast-button",ir);var nl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ri=(t,e,i)=>(nl(t,e,"read from private field"),i?i.call(t):e.get(t)),bt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},sl=(t,e,i,a)=>(nl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ai=(t,e,i)=>(nl(t,e,"access private method"),i),Wo,rr,oi,$o,el,tl,uc,il,cc,al,mc,rl,hc,ol,pc;function Ip(t){return`
|
|
432
432
|
<style>
|
|
433
433
|
:host {
|
|
434
434
|
font: var(--media-font,
|
|
@@ -469,9 +469,9 @@
|
|
|
469
469
|
}
|
|
470
470
|
</style>
|
|
471
471
|
${this.getSlotTemplateHTML(t)}
|
|
472
|
-
`}function
|
|
472
|
+
`}function Mp(t){return`
|
|
473
473
|
<slot id="content"></slot>
|
|
474
|
-
`}var
|
|
474
|
+
`}var ar={OPEN:"open",ANCHOR:"anchor"},qe=class extends l.HTMLElement{constructor(){super(),bt(this,$o),bt(this,tl),bt(this,il),bt(this,al),bt(this,rl),bt(this,ol),bt(this,Wo,!1),bt(this,rr,null),bt(this,oi,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[ar.OPEN,ar.ANCHOR]}get open(){return k(this,ar.OPEN)}set open(e){S(this,ar.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":ai(this,al,mc).call(this,e);break;case"focusout":ai(this,rl,hc).call(this,e);break;case"keydown":ai(this,ol,pc).call(this,e);break}}connectedCallback(){ai(this,$o,el).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,i,a){ai(this,$o,el).call(this),e===ar.OPEN&&a!==i&&(this.open?ai(this,tl,uc).call(this):ai(this,il,cc).call(this))}focus(){sl(this,rr,Ka());let e=!this.dispatchEvent(new Event("focus",{composed:!0,cancelable:!0})),i=!this.dispatchEvent(new Event("focusin",{composed:!0,bubbles:!0,cancelable:!0}));if(e||i)return;let a=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');a==null||a.focus()}get keysUsed(){return["Escape","Tab"]}};Wo=new WeakMap;rr=new WeakMap;oi=new WeakMap;$o=new WeakSet;el=function(){if(!ri(this,Wo)&&(sl(this,Wo,!0),!this.shadowRoot)){this.attachShadow(this.constructor.shadowRootOptions);let t=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(t),queueMicrotask(()=>{let{style:e}=q(this.shadowRoot,":host");e.setProperty("transition","display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in")})}};tl=new WeakSet;uc=function(){var t;(t=ri(this,oi))==null||t.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};il=new WeakSet;cc=function(){var t;(t=ri(this,oi))==null||t.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};al=new WeakSet;mc=function(t){sl(this,oi,t.relatedTarget),ue(this,t.relatedTarget)||(this.open=!this.open)};rl=new WeakSet;hc=function(t){var e;ue(this,t.relatedTarget)||((e=ri(this,rr))==null||e.focus(),ri(this,oi)&&ri(this,oi)!==t.relatedTarget&&this.open&&(this.open=!1))};ol=new WeakSet;pc=function(t){var e,i,a,r,o;let{key:s,ctrlKey:d,altKey:u,metaKey:p}=t;d||u||p||this.keysUsed.includes(s)&&(t.preventDefault(),t.stopPropagation(),s==="Tab"?(t.shiftKey?(i=(e=this.previousElementSibling)==null?void 0:e.focus)==null||i.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()):s==="Escape"&&((o=ri(this,rr))==null||o.focus(),this.open=!1))};qe.shadowRootOptions={mode:"open"};qe.getTemplateHTML=Ip;qe.getSlotTemplateHTML=Mp;l.customElements.get("media-chrome-dialog")||l.customElements.define("media-chrome-dialog",qe);var pl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},z=(t,e,i)=>(pl(t,e,"read from private field"),i?i.call(t):e.get(t)),se=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},xt=(t,e,i,a)=>(pl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),He=(t,e,i)=>(pl(t,e,"access private method"),i),Ze,Xo,Fo,Vo,Be,Qo,Ko,Go,Yo,fl,fc,qo,ll,Zo,dl,zo,vl,ul,vc,cl,Ec,ml,bc,hl,gc;function Cp(t){return`
|
|
475
475
|
<style>
|
|
476
476
|
:host {
|
|
477
477
|
--_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
|
|
@@ -699,7 +699,7 @@
|
|
|
699
699
|
<input id="range" type="range" min="0" max="1" step="any" value="0">
|
|
700
700
|
</div>
|
|
701
701
|
<div id="rightgap"></div>
|
|
702
|
-
`}var
|
|
702
|
+
`}var Qe=class extends l.HTMLElement{constructor(){if(super(),se(this,fl),se(this,qo),se(this,Zo),se(this,zo),se(this,ul),se(this,cl),se(this,ml),se(this,hl),se(this,Ze,void 0),se(this,Xo,void 0),se(this,Fo,void 0),se(this,Vo,void 0),se(this,Be,{}),se(this,Qo,[]),se(this,Ko,()=>{if(this.range.matches(":focus-visible")){let{style:e}=q(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),se(this,Go,()=>{let{style:e}=q(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),se(this,Yo,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes),i=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(i):this.shadowRoot.innerHTML=i}this.container=this.shadowRoot.querySelector("#container"),xt(this,Fo,this.shadowRoot.querySelector("#startpoint")),xt(this,Vo,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",x.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===x.MEDIA_CONTROLLER?(i&&((o=(r=z(this,Ze))==null?void 0:r.unassociateElement)==null||o.call(r,this),xt(this,Ze,null)),a&&this.isConnected&&(xt(this,Ze,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=z(this,Ze))==null?void 0:d.associateElement)==null||u.call(d,this))):(e==="disabled"||e==="aria-disabled"&&i!==a)&&(a==null?(this.range.removeAttribute(e),He(this,qo,ll).call(this)):(this.range.setAttribute(e,a),He(this,Zo,dl).call(this)))}connectedCallback(){var e,i,a;let{style:r}=q(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),z(this,Be).pointer=q(this.shadowRoot,"#pointer"),z(this,Be).progress=q(this.shadowRoot,"#progress"),z(this,Be).thumb=q(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),z(this,Be).activeSegment=q(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let o=this.getAttribute(x.MEDIA_CONTROLLER);o&&(xt(this,Ze,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(a=(i=z(this,Ze))==null?void 0:i.associateElement)==null||a.call(i,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",z(this,Ko)),this.shadowRoot.addEventListener("focusout",z(this,Go)),He(this,qo,ll).call(this),ht(this.container,z(this,Yo))}disconnectedCallback(){var e,i;He(this,Zo,dl).call(this),(i=(e=z(this,Ze))==null?void 0:e.unassociateElement)==null||i.call(e,this),xt(this,Ze,null),this.shadowRoot.removeEventListener("focusin",z(this,Ko)),this.shadowRoot.removeEventListener("focusout",z(this,Go)),pt(this.container,z(this,Yo))}updatePointerBar(e){var i;(i=z(this,Be).pointer)==null||i.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,i;let a=this.range.valueAsNumber*100;(e=z(this,Be).progress)==null||e.style.setProperty("width",`${a}%`),(i=z(this,Be).thumb)==null||i.style.setProperty("left",`${a}%`)}updateSegments(e){let i=this.shadowRoot.querySelector("#segments-clipping");if(i.textContent="",this.container.classList.toggle("segments",!!(e!=null&&e.length)),!(e!=null&&e.length))return;let a=[...new Set([+this.range.min,...e.flatMap(o=>[o.start,o.end]),+this.range.max])];xt(this,Qo,[...a]);let r=a.pop();for(let[o,s]of a.entries()){let[d,u]=[o===0,o===a.length-1],p=d?"calc(var(--segments-gap) / -1)":`${s*100}%`,_=`calc(${((u?r:a[o+1])-s)*100}%${d||u?"":" - var(--segments-gap)"})`,E=V.createElementNS("http://www.w3.org/2000/svg","rect"),f=Ga(this.shadowRoot,`#segments-clipping rect:nth-child(${o+1})`);f.style.setProperty("x",p),f.style.setProperty("width",_),i.append(E)}}getPointerRatio(e){return Iu(e.clientX,e.clientY,z(this,Fo).getBoundingClientRect(),z(this,Vo).getBoundingClientRect())}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":He(this,hl,gc).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":He(this,ul,vc).call(this,e);break;case"pointerdown":He(this,zo,vl).call(this,e);break;case"pointerup":He(this,cl,Ec).call(this);break;case"pointerleave":He(this,ml,bc).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};Ze=new WeakMap;Xo=new WeakMap;Fo=new WeakMap;Vo=new WeakMap;Be=new WeakMap;Qo=new WeakMap;Ko=new WeakMap;Go=new WeakMap;Yo=new WeakMap;fl=new WeakSet;fc=function(t){let e=z(this,Be).activeSegment;if(!e)return;let i=this.getPointerRatio(t),r=`#segments-clipping rect:nth-child(${z(this,Qo).findIndex((o,s,d)=>{let u=d[s+1];return u!=null&&i>=o&&i<=u})+1})`;(e.selectorText!=r||!e.style.transform)&&(e.selectorText=r,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};qo=new WeakSet;ll=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};Zo=new WeakSet;dl=function(){var t,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(t=l.window)==null||t.removeEventListener("pointerup",this),(e=l.window)==null||e.removeEventListener("pointermove",this)};zo=new WeakSet;vl=function(t){var e;xt(this,Xo,t.composedPath().includes(this.range)),(e=l.window)==null||e.addEventListener("pointerup",this)};ul=new WeakSet;vc=function(t){var e;t.pointerType!=="mouse"&&He(this,zo,vl).call(this,t),this.addEventListener("pointerleave",this),(e=l.window)==null||e.addEventListener("pointermove",this)};cl=new WeakSet;Ec=function(){var t;(t=l.window)==null||t.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};ml=new WeakSet;bc=function(){var t,e;this.removeEventListener("pointerleave",this),(t=l.window)==null||t.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=z(this,Be).activeSegment)==null||e.style.removeProperty("transform")};hl=new WeakSet;gc=function(t){t.pointerType==="pen"&&t.buttons===0||(this.toggleAttribute("dragging",t.buttons===1||t.pointerType!=="mouse"),this.updatePointerBar(t),He(this,fl,fc).call(this,t),this.dragging&&(t.pointerType!=="mouse"||!z(this,Xo))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(t),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))))};Qe.shadowRootOptions={mode:"open"};Qe.getTemplateHTML=Cp;l.customElements.get("media-chrome-range")||l.customElements.define("media-chrome-range",Qe);var _c=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Jo=(t,e,i)=>(_c(t,e,"read from private field"),i?i.call(t):e.get(t)),Lp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},jo=(t,e,i,a)=>(_c(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ze;function wp(t){return`
|
|
703
703
|
<style>
|
|
704
704
|
:host {
|
|
705
705
|
|
|
@@ -725,7 +725,7 @@
|
|
|
725
725
|
</style>
|
|
726
726
|
|
|
727
727
|
<slot></slot>
|
|
728
|
-
`}var
|
|
728
|
+
`}var or=class extends l.HTMLElement{constructor(){if(super(),Lp(this,ze,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[x.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===x.MEDIA_CONTROLLER&&(i&&((o=(r=Jo(this,ze))==null?void 0:r.unassociateElement)==null||o.call(r,this),jo(this,ze,null)),a&&this.isConnected&&(jo(this,ze,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=Jo(this,ze))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(x.MEDIA_CONTROLLER);r&&(jo(this,ze,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=Jo(this,ze))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=Jo(this,ze))==null?void 0:e.unassociateElement)==null||i.call(e,this),jo(this,ze,null)}};ze=new WeakMap;or.shadowRootOptions={mode:"open"};or.getTemplateHTML=wp;l.customElements.get("media-control-bar")||l.customElements.define("media-control-bar",or);var Ac=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},en=(t,e,i)=>(Ac(t,e,"read from private field"),i?i.call(t):e.get(t)),Rp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},tn=(t,e,i,a)=>(Ac(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Xe;function xp(t,e={}){return`
|
|
729
729
|
<style>
|
|
730
730
|
:host {
|
|
731
731
|
font: var(--media-font,
|
|
@@ -759,11 +759,11 @@
|
|
|
759
759
|
</style>
|
|
760
760
|
|
|
761
761
|
${this.getSlotTemplateHTML(t,e)}
|
|
762
|
-
`}function
|
|
762
|
+
`}function Dp(t,e){return`
|
|
763
763
|
<slot></slot>
|
|
764
|
-
`}var
|
|
765
|
-
<slot>${
|
|
766
|
-
`}var
|
|
764
|
+
`}var be=class extends l.HTMLElement{constructor(){if(super(),Rp(this,Xe,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[x.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===x.MEDIA_CONTROLLER&&(i&&((o=(r=en(this,Xe))==null?void 0:r.unassociateElement)==null||o.call(r,this),tn(this,Xe,null)),a&&this.isConnected&&(tn(this,Xe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=en(this,Xe))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,i,a;let{style:r}=q(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let o=this.getAttribute(x.MEDIA_CONTROLLER);o&&(tn(this,Xe,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(a=(i=en(this,Xe))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=en(this,Xe))==null?void 0:e.unassociateElement)==null||i.call(e,this),tn(this,Xe,null)}};Xe=new WeakMap;be.shadowRootOptions={mode:"open"};be.getTemplateHTML=xp;be.getSlotTemplateHTML=Dp;l.customElements.get("media-text-display")||l.customElements.define("media-text-display",be);var yc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Tc=(t,e,i)=>(yc(t,e,"read from private field"),i?i.call(t):e.get(t)),Op=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Pp=(t,e,i,a)=>(yc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),nr;function Np(t,e){return`
|
|
765
|
+
<slot>${Ne(e.mediaDuration)}</slot>
|
|
766
|
+
`}var an=class extends be{constructor(){var e;super(),Op(this,nr,void 0),Pp(this,nr,this.shadowRoot.querySelector("slot")),Tc(this,nr).textContent=Ne((e=this.mediaDuration)!=null?e:0)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_DURATION]}attributeChangedCallback(e,i,a){e===n.MEDIA_DURATION&&(Tc(this,nr).textContent=Ne(+a)),super.attributeChangedCallback(e,i,a)}get mediaDuration(){return O(this,n.MEDIA_DURATION)}set mediaDuration(e){N(this,n.MEDIA_DURATION,e)}};nr=new WeakMap;an.getSlotTemplateHTML=Np;l.customElements.get("media-duration-display")||l.customElements.define("media-duration-display",an);var Up={2:h("Network Error"),3:h("Decode Error"),4:h("Source Not Supported"),5:h("Encryption Error")},Hp={2:h("A network error caused the media download to fail."),3:h("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:h("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:h("The media is encrypted and there are no keys to decrypt it.")},El=t=>{var e,i;return t.code===1?null:{title:(e=Up[t.code])!=null?e:`Error ${t.code}`,message:(i=Hp[t.code])!=null?i:t.message}};var Sc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Bp=(t,e,i)=>(Sc(t,e,"read from private field"),i?i.call(t):e.get(t)),$p=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Wp=(t,e,i,a)=>(Sc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),rn;function Fp(t){return`
|
|
767
767
|
<style>
|
|
768
768
|
:host {
|
|
769
769
|
background: rgb(20 20 30 / .8);
|
|
@@ -780,13 +780,110 @@
|
|
|
780
780
|
}
|
|
781
781
|
</style>
|
|
782
782
|
<slot name="error-${t.mediaerrorcode}" id="content">
|
|
783
|
-
${
|
|
783
|
+
${Ic({code:+t.mediaerrorcode,message:t.mediaerrormessage})}
|
|
784
784
|
</slot>
|
|
785
|
-
`}function
|
|
785
|
+
`}function Vp(t){return t.code&&El(t)!==null}function Ic(t){var e;let{title:i,message:a}=(e=El(t))!=null?e:{},r="";return i&&(r+=`<slot name="error-${t.code}-title"><h3>${i}</h3></slot>`),a&&(r+=`<slot name="error-${t.code}-message"><p>${a}</p></slot>`),r}var kc=[n.MEDIA_ERROR_CODE,n.MEDIA_ERROR_MESSAGE],Vi=class extends qe{constructor(){super(...arguments),$p(this,rn,null)}static get observedAttributes(){return[...super.observedAttributes,...kc]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,i,a){var r;if(super.attributeChangedCallback(e,i,a),!kc.includes(e))return;let o=(r=this.mediaError)!=null?r:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=Vp(o),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(o))}get mediaError(){return Bp(this,rn)}set mediaError(e){Wp(this,rn,e)}get mediaErrorCode(){return O(this,"mediaerrorcode")}set mediaErrorCode(e){N(this,"mediaerrorcode",e)}get mediaErrorMessage(){return w(this,"mediaerrormessage")}set mediaErrorMessage(e){R(this,"mediaerrormessage",e)}};rn=new WeakMap;Vi.getSlotTemplateHTML=Fp;Vi.formatErrorMessage=Ic;l.customElements.get("media-error-dialog")||l.customElements.define("media-error-dialog",Vi);var on=Vi;var Kp=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Dt=(t,e,i)=>(Kp(t,e,"read from private field"),i?i.call(t):e.get(t)),Mc=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Ki,Gi;function Gp(t){return`
|
|
786
|
+
<style>
|
|
787
|
+
:host {
|
|
788
|
+
position: fixed;
|
|
789
|
+
top: 0;
|
|
790
|
+
left: 0;
|
|
791
|
+
z-index: 9999;
|
|
792
|
+
background: rgb(20 20 30 / .8);
|
|
793
|
+
backdrop-filter: blur(10px);
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
#content {
|
|
797
|
+
display: block;
|
|
798
|
+
width: clamp(400px, 40vw, 700px);
|
|
799
|
+
max-width: 90vw;
|
|
800
|
+
text-align: left;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
h2 {
|
|
804
|
+
margin: 0 0 1.5rem 0;
|
|
805
|
+
font-size: 1.5rem;
|
|
806
|
+
font-weight: 500;
|
|
807
|
+
text-align: center;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
.shortcuts-table {
|
|
811
|
+
width: 100%;
|
|
812
|
+
border-collapse: collapse;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
.shortcuts-table tr {
|
|
816
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
.shortcuts-table tr:last-child {
|
|
820
|
+
border-bottom: none;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
.shortcuts-table td {
|
|
824
|
+
padding: 0.75rem 0.5rem;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
.shortcuts-table td:first-child {
|
|
828
|
+
text-align: right;
|
|
829
|
+
padding-right: 1rem;
|
|
830
|
+
width: 40%;
|
|
831
|
+
min-width: 120px;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
.shortcuts-table td:last-child {
|
|
835
|
+
padding-left: 1rem;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
.key {
|
|
839
|
+
display: inline-block;
|
|
840
|
+
background: rgba(255, 255, 255, 0.15);
|
|
841
|
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
842
|
+
border-radius: 4px;
|
|
843
|
+
padding: 0.25rem 0.5rem;
|
|
844
|
+
font-family: 'Courier New', monospace;
|
|
845
|
+
font-size: 0.9rem;
|
|
846
|
+
font-weight: 500;
|
|
847
|
+
min-width: 1.5rem;
|
|
848
|
+
text-align: center;
|
|
849
|
+
margin: 0 0.2rem;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
.description {
|
|
853
|
+
color: rgba(255, 255, 255, 0.9);
|
|
854
|
+
font-size: 0.95rem;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
.key-combo {
|
|
858
|
+
display: flex;
|
|
859
|
+
align-items: center;
|
|
860
|
+
justify-content: flex-end;
|
|
861
|
+
gap: 0.3rem;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
.key-separator {
|
|
865
|
+
color: rgba(255, 255, 255, 0.5);
|
|
866
|
+
font-size: 0.9rem;
|
|
867
|
+
}
|
|
868
|
+
</style>
|
|
869
|
+
<slot id="content">
|
|
870
|
+
${Yp()}
|
|
871
|
+
</slot>
|
|
872
|
+
`}function Yp(){return`
|
|
873
|
+
<h2>Keyboard Shortcuts</h2>
|
|
874
|
+
<table class="shortcuts-table">${[{keys:["Space","k"],description:"Toggle Playback"},{keys:["m"],description:"Toggle mute"},{keys:["f"],description:"Toggle fullscreen"},{keys:["c"],description:"Toggle captions or subtitles, if available"},{keys:["p"],description:"Toggle Picture in Picture"},{keys:["\u2190","j"],description:"Seek back 10s"},{keys:["\u2192","l"],description:"Seek forward 10s"},{keys:["\u2191"],description:"Turn volume up"},{keys:["\u2193"],description:"Turn volume down"},{keys:["< (SHIFT+,)"],description:"Decrease playback rate"},{keys:["> (SHIFT+.)"],description:"Increase playback rate"}].map(({keys:i,description:a})=>`
|
|
875
|
+
<tr>
|
|
876
|
+
<td>
|
|
877
|
+
<div class="key-combo">${i.map((o,s)=>s>0?`<span class="key-separator">or</span><span class="key">${o}</span>`:`<span class="key">${o}</span>`).join("")}</div>
|
|
878
|
+
</td>
|
|
879
|
+
<td class="description">${a}</td>
|
|
880
|
+
</tr>
|
|
881
|
+
`).join("")}</table>
|
|
882
|
+
`}var nn=class extends qe{constructor(){super(...arguments),Mc(this,Ki,e=>{var i;if(!this.open)return;let a=(i=this.shadowRoot)==null?void 0:i.querySelector("#content");if(!a)return;let r=e.composedPath(),o=r[0]===this||r.includes(this),s=r.includes(a);o&&!s&&(this.open=!1)}),Mc(this,Gi,e=>{if(!this.open)return;let i=e.shiftKey&&(e.key==="/"||e.key==="?");(e.key==="Escape"||i)&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&(this.open=!1,e.preventDefault(),e.stopPropagation())})}connectedCallback(){super.connectedCallback(),this.open&&(this.addEventListener("click",Dt(this,Ki)),document.addEventListener("keydown",Dt(this,Gi)))}disconnectedCallback(){this.removeEventListener("click",Dt(this,Ki)),document.removeEventListener("keydown",Dt(this,Gi))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e==="open"&&(this.open?(this.addEventListener("click",Dt(this,Ki)),document.addEventListener("keydown",Dt(this,Gi))):(this.removeEventListener("click",Dt(this,Ki)),document.removeEventListener("keydown",Dt(this,Gi))))}};Ki=new WeakMap;Gi=new WeakMap;nn.getSlotTemplateHTML=Gp;l.customElements.get("media-keyboard-shortcuts-dialog")||l.customElements.define("media-keyboard-shortcuts-dialog",nn);var Lc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},qp=(t,e,i)=>(Lc(t,e,"read from private field"),i?i.call(t):e.get(t)),Zp=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Qp=(t,e,i,a)=>(Lc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),sn,zp=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
786
883
|
<path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
|
|
787
|
-
</svg>`,
|
|
884
|
+
</svg>`,Xp=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
788
885
|
<path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
|
|
789
|
-
</svg>`;function
|
|
886
|
+
</svg>`;function Jp(t){return`
|
|
790
887
|
<style>
|
|
791
888
|
:host([${n.MEDIA_IS_FULLSCREEN}]) slot[name=icon] slot:not([name=exit]) {
|
|
792
889
|
display: none !important;
|
|
@@ -804,13 +901,13 @@
|
|
|
804
901
|
</style>
|
|
805
902
|
|
|
806
903
|
<slot name="icon">
|
|
807
|
-
<slot name="enter">${
|
|
808
|
-
<slot name="exit">${
|
|
904
|
+
<slot name="enter">${zp}</slot>
|
|
905
|
+
<slot name="exit">${Xp}</slot>
|
|
809
906
|
</slot>
|
|
810
|
-
`}function
|
|
811
|
-
<slot name="tooltip-enter">${
|
|
812
|
-
<slot name="tooltip-exit">${
|
|
813
|
-
`}var
|
|
907
|
+
`}function jp(){return`
|
|
908
|
+
<slot name="tooltip-enter">${h("Enter fullscreen mode")}</slot>
|
|
909
|
+
<slot name="tooltip-exit">${h("Exit fullscreen mode")}</slot>
|
|
910
|
+
`}var Cc=t=>{let e=t.mediaIsFullscreen?h("exit fullscreen mode"):h("enter fullscreen mode");t.setAttribute("aria-label",e)},sr=class extends U{constructor(){super(...arguments),Zp(this,sn,null)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_FULLSCREEN,n.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Cc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_FULLSCREEN&&Cc(this)}get mediaFullscreenUnavailable(){return w(this,n.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){R(this,n.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return k(this,n.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){S(this,n.MEDIA_IS_FULLSCREEN,e)}handleClick(e){Qp(this,sn,e);let i=qp(this,sn)instanceof PointerEvent,a=this.mediaIsFullscreen?new l.CustomEvent(m.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new l.CustomEvent(m.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:i});this.dispatchEvent(a)}};sn=new WeakMap;sr.getSlotTemplateHTML=Jp;sr.getTooltipContentHTML=jp;l.customElements.get("media-fullscreen-button")||l.customElements.define("media-fullscreen-button",sr);var{MEDIA_TIME_IS_LIVE:ln,MEDIA_PAUSED:lr}=n,{MEDIA_SEEK_TO_LIVE_REQUEST:ef,MEDIA_PLAY_REQUEST:tf}=m,af='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>';function rf(t){return`
|
|
814
911
|
<style>
|
|
815
912
|
:host { --media-tooltip-display: none; }
|
|
816
913
|
|
|
@@ -822,13 +919,13 @@
|
|
|
822
919
|
color: var(--media-live-button-icon-color, rgb(140, 140, 140));
|
|
823
920
|
}
|
|
824
921
|
|
|
825
|
-
:host([${
|
|
826
|
-
:host([${
|
|
922
|
+
:host([${ln}]:not([${lr}])) slot[name=indicator] > *,
|
|
923
|
+
:host([${ln}]:not([${lr}])) ::slotted([slot=indicator]) {
|
|
827
924
|
fill: var(--media-live-button-indicator-color, rgb(255, 0, 0));
|
|
828
925
|
color: var(--media-live-button-indicator-color, rgb(255, 0, 0));
|
|
829
926
|
}
|
|
830
927
|
|
|
831
|
-
:host([${
|
|
928
|
+
:host([${ln}]:not([${lr}])) {
|
|
832
929
|
cursor: var(--media-cursor, not-allowed);
|
|
833
930
|
}
|
|
834
931
|
|
|
@@ -838,10 +935,10 @@
|
|
|
838
935
|
|
|
839
936
|
</style>
|
|
840
937
|
|
|
841
|
-
<slot name="indicator">${
|
|
938
|
+
<slot name="indicator">${af}</slot>
|
|
842
939
|
|
|
843
|
-
<slot name="spacer"> </slot><slot name="text">${
|
|
844
|
-
`}var
|
|
940
|
+
<slot name="spacer"> </slot><slot name="text">${h("live")}</slot>
|
|
941
|
+
`}var wc=t=>{var e;let i=t.mediaPaused||!t.mediaTimeIsLive,a=i?h("seek to live"):h("playing live");t.setAttribute("aria-label",a);let r=(e=t.shadowRoot)==null?void 0:e.querySelector('slot[name="text"]');r&&(r.textContent=h("live")),i?t.removeAttribute("aria-disabled"):t.setAttribute("aria-disabled","true")},dn=class extends U{static get observedAttributes(){return[...super.observedAttributes,ln,lr]}connectedCallback(){super.connectedCallback(),wc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),wc(this)}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return k(this,n.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){S(this,n.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new l.CustomEvent(ef,{composed:!0,bubbles:!0})),this.hasAttribute(lr)&&this.dispatchEvent(new l.CustomEvent(tf,{composed:!0,bubbles:!0})))}};dn.getSlotTemplateHTML=rf;l.customElements.get("media-live-button")||l.customElements.define("media-live-button",dn);var xc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},dr=(t,e,i)=>(xc(t,e,"read from private field"),i?i.call(t):e.get(t)),Rc=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},ur=(t,e,i,a)=>(xc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Je,cn,un={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},Dc=500,of=`
|
|
845
942
|
<svg aria-hidden="true" viewBox="0 0 100 100">
|
|
846
943
|
<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">
|
|
847
944
|
<animateTransform
|
|
@@ -854,13 +951,13 @@
|
|
|
854
951
|
repeatCount="indefinite" />
|
|
855
952
|
</path>
|
|
856
953
|
</svg>
|
|
857
|
-
`;function
|
|
954
|
+
`;function nf(t){return`
|
|
858
955
|
<style>
|
|
859
956
|
:host {
|
|
860
957
|
display: var(--media-control-display, var(--media-loading-indicator-display, inline-block));
|
|
861
958
|
vertical-align: middle;
|
|
862
959
|
box-sizing: border-box;
|
|
863
|
-
--_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${
|
|
960
|
+
--_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${Dc}ms);
|
|
864
961
|
}
|
|
865
962
|
|
|
866
963
|
#status {
|
|
@@ -899,15 +996,15 @@
|
|
|
899
996
|
}
|
|
900
997
|
</style>
|
|
901
998
|
|
|
902
|
-
<slot name="icon">${
|
|
903
|
-
<div id="status" role="status" aria-live="polite">${
|
|
904
|
-
`}var
|
|
999
|
+
<slot name="icon">${of}</slot>
|
|
1000
|
+
<div id="status" role="status" aria-live="polite">${h("media loading")}</div>
|
|
1001
|
+
`}var cr=class extends l.HTMLElement{constructor(){if(super(),Rc(this,Je,void 0),Rc(this,cn,Dc),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[x.MEDIA_CONTROLLER,n.MEDIA_PAUSED,n.MEDIA_LOADING,un.LOADING_DELAY]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===un.LOADING_DELAY&&i!==a?this.loadingDelay=Number(a):e===x.MEDIA_CONTROLLER&&(i&&((o=(r=dr(this,Je))==null?void 0:r.unassociateElement)==null||o.call(r,this),ur(this,Je,null)),a&&this.isConnected&&(ur(this,Je,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=dr(this,Je))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(x.MEDIA_CONTROLLER);r&&(ur(this,Je,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=dr(this,Je))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=dr(this,Je))==null?void 0:e.unassociateElement)==null||i.call(e,this),ur(this,Je,null)}get loadingDelay(){return dr(this,cn)}set loadingDelay(e){ur(this,cn,e);let{style:i}=q(this.shadowRoot,":host");i.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}get mediaLoading(){return k(this,n.MEDIA_LOADING)}set mediaLoading(e){S(this,n.MEDIA_LOADING,e)}get mediaController(){return w(this,x.MEDIA_CONTROLLER)}set mediaController(e){R(this,x.MEDIA_CONTROLLER,e)}get noAutohide(){return k(this,un.NO_AUTOHIDE)}set noAutohide(e){S(this,un.NO_AUTOHIDE,e)}};Je=new WeakMap;cn=new WeakMap;cr.shadowRootOptions={mode:"open"};cr.getTemplateHTML=nf;l.customElements.get("media-loading-indicator")||l.customElements.define("media-loading-indicator",cr);var sf=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
905
1002
|
<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"/>
|
|
906
|
-
</svg>`,
|
|
1003
|
+
</svg>`,Oc=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
907
1004
|
<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"/>
|
|
908
|
-
</svg>`,
|
|
1005
|
+
</svg>`,lf=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
909
1006
|
<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"/>
|
|
910
|
-
</svg>`;function
|
|
1007
|
+
</svg>`;function df(t){return`
|
|
911
1008
|
<style>
|
|
912
1009
|
:host(:not([${n.MEDIA_VOLUME_LEVEL}])) slot[name=icon] slot:not([name=high]),
|
|
913
1010
|
:host([${n.MEDIA_VOLUME_LEVEL}=high]) slot[name=icon] slot:not([name=high]) {
|
|
@@ -933,17 +1030,17 @@
|
|
|
933
1030
|
</style>
|
|
934
1031
|
|
|
935
1032
|
<slot name="icon">
|
|
936
|
-
<slot name="off">${
|
|
937
|
-
<slot name="low">${
|
|
938
|
-
<slot name="medium">${
|
|
939
|
-
<slot name="high">${
|
|
1033
|
+
<slot name="off">${sf}</slot>
|
|
1034
|
+
<slot name="low">${Oc}</slot>
|
|
1035
|
+
<slot name="medium">${Oc}</slot>
|
|
1036
|
+
<slot name="high">${lf}</slot>
|
|
940
1037
|
</slot>
|
|
941
|
-
`}function
|
|
942
|
-
<slot name="tooltip-mute">${
|
|
943
|
-
<slot name="tooltip-unmute">${
|
|
944
|
-
`}var
|
|
1038
|
+
`}function uf(){return`
|
|
1039
|
+
<slot name="tooltip-mute">${h("Mute")}</slot>
|
|
1040
|
+
<slot name="tooltip-unmute">${h("Unmute")}</slot>
|
|
1041
|
+
`}var Pc=t=>{let i=t.mediaVolumeLevel==="off"?h("unmute"):h("mute");t.setAttribute("aria-label",i)},mr=class extends U{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),Pc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_VOLUME_LEVEL&&Pc(this)}get mediaVolumeLevel(){return w(this,n.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){R(this,n.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?m.MEDIA_UNMUTE_REQUEST:m.MEDIA_MUTE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};mr.getSlotTemplateHTML=df;mr.getTooltipContentHTML=uf;l.customElements.get("media-mute-button")||l.customElements.define("media-mute-button",mr);var Nc=`<svg aria-hidden="true" viewBox="0 0 28 24">
|
|
945
1042
|
<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"/>
|
|
946
|
-
</svg>`;function
|
|
1043
|
+
</svg>`;function cf(t){return`
|
|
947
1044
|
<style>
|
|
948
1045
|
:host([${n.MEDIA_IS_PIP}]) slot[name=icon] slot:not([name=exit]) {
|
|
949
1046
|
display: none !important;
|
|
@@ -960,25 +1057,25 @@
|
|
|
960
1057
|
</style>
|
|
961
1058
|
|
|
962
1059
|
<slot name="icon">
|
|
963
|
-
<slot name="enter">${
|
|
964
|
-
<slot name="exit">${
|
|
1060
|
+
<slot name="enter">${Nc}</slot>
|
|
1061
|
+
<slot name="exit">${Nc}</slot>
|
|
965
1062
|
</slot>
|
|
966
|
-
`}function
|
|
967
|
-
<slot name="tooltip-enter">${
|
|
968
|
-
<slot name="tooltip-exit">${
|
|
969
|
-
`}var
|
|
1063
|
+
`}function mf(){return`
|
|
1064
|
+
<slot name="tooltip-enter">${h("Enter picture in picture mode")}</slot>
|
|
1065
|
+
<slot name="tooltip-exit">${h("Exit picture in picture mode")}</slot>
|
|
1066
|
+
`}var Uc=t=>{let e=t.mediaIsPip?h("exit picture in picture mode"):h("enter picture in picture mode");t.setAttribute("aria-label",e)},hr=class extends U{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_PIP,n.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Uc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_PIP&&Uc(this)}get mediaPipUnavailable(){return w(this,n.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){R(this,n.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return k(this,n.MEDIA_IS_PIP)}set mediaIsPip(e){S(this,n.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?m.MEDIA_EXIT_PIP_REQUEST:m.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};hr.getSlotTemplateHTML=cf;hr.getTooltipContentHTML=mf;l.customElements.get("media-pip-button")||l.customElements.define("media-pip-button",hr);var hf=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Yi=(t,e,i)=>(hf(t,e,"read from private field"),i?i.call(t):e.get(t)),pf=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Ot,bl={RATES:"rates"},gl=[1,1.2,1.5,1.7,2],ni=1;function ff(t){return`
|
|
970
1067
|
<style>
|
|
971
1068
|
:host {
|
|
972
1069
|
min-width: 5ch;
|
|
973
1070
|
padding: var(--media-button-padding, var(--media-control-padding, 10px 5px));
|
|
974
1071
|
}
|
|
975
1072
|
</style>
|
|
976
|
-
<slot name="icon">${t.mediaplaybackrate||
|
|
977
|
-
`}function
|
|
1073
|
+
<slot name="icon">${t.mediaplaybackrate||ni}x</slot>
|
|
1074
|
+
`}function vf(){return h("Playback rate")}var pr=class extends U{constructor(){var e;super(),pf(this,Ot,new Ct(this,bl.RATES,{defaultValue:gl})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:ni}x`}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PLAYBACK_RATE,bl.RATES]}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===bl.RATES&&(Yi(this,Ot).value=a),e===n.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,o=Number.isNaN(r)?ni:r;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",h("Playback rate {playbackRate}",{playbackRate:o}))}}get rates(){return Yi(this,Ot)}set rates(e){e?Array.isArray(e)?Yi(this,Ot).value=e.join(" "):typeof e=="string"&&(Yi(this,Ot).value=e):Yi(this,Ot).value=""}get mediaPlaybackRate(){return O(this,n.MEDIA_PLAYBACK_RATE,ni)}set mediaPlaybackRate(e){N(this,n.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,i;let a=Array.from(Yi(this,Ot).values(),s=>+s).sort((s,d)=>s-d),r=(i=(e=a.find(s=>s>this.mediaPlaybackRate))!=null?e:a[0])!=null?i:ni,o=new l.CustomEvent(m.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(o)}};Ot=new WeakMap;pr.getSlotTemplateHTML=ff;pr.getTooltipContentHTML=vf;l.customElements.get("media-playback-rate-button")||l.customElements.define("media-playback-rate-button",pr);var Ef=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
978
1075
|
<path d="m6 21 15-9L6 3v18Z"/>
|
|
979
|
-
</svg>`,
|
|
1076
|
+
</svg>`,bf=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
980
1077
|
<path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
|
|
981
|
-
</svg>`;function
|
|
1078
|
+
</svg>`;function gf(t){return`
|
|
982
1079
|
<style>
|
|
983
1080
|
:host([${n.MEDIA_PAUSED}]) slot[name=pause],
|
|
984
1081
|
:host(:not([${n.MEDIA_PAUSED}])) slot[name=play] {
|
|
@@ -992,13 +1089,13 @@
|
|
|
992
1089
|
</style>
|
|
993
1090
|
|
|
994
1091
|
<slot name="icon">
|
|
995
|
-
<slot name="play">${
|
|
996
|
-
<slot name="pause">${
|
|
1092
|
+
<slot name="play">${Ef}</slot>
|
|
1093
|
+
<slot name="pause">${bf}</slot>
|
|
997
1094
|
</slot>
|
|
998
|
-
`}function
|
|
999
|
-
<slot name="tooltip-play">${
|
|
1000
|
-
<slot name="tooltip-pause">${
|
|
1001
|
-
`}var
|
|
1095
|
+
`}function _f(){return`
|
|
1096
|
+
<slot name="tooltip-play">${h("Play")}</slot>
|
|
1097
|
+
<slot name="tooltip-pause">${h("Pause")}</slot>
|
|
1098
|
+
`}var Hc=t=>{let e=t.mediaPaused?h("play"):h("pause");t.setAttribute("aria-label",e)},fr=class extends U{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PAUSED,n.MEDIA_ENDED]}connectedCallback(){super.connectedCallback(),Hc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===n.MEDIA_PAUSED||e===n.MEDIA_LANG)&&Hc(this)}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?m.MEDIA_PLAY_REQUEST:m.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};fr.getSlotTemplateHTML=gf;fr.getTooltipContentHTML=_f;l.customElements.get("media-play-button")||l.customElements.define("media-play-button",fr);var je={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"};function Af(t){return`
|
|
1002
1099
|
<style>
|
|
1003
1100
|
:host {
|
|
1004
1101
|
pointer-events: none;
|
|
@@ -1020,7 +1117,7 @@
|
|
|
1020
1117
|
</style>
|
|
1021
1118
|
|
|
1022
1119
|
<img part="poster img" aria-hidden="true" id="image"/>
|
|
1023
|
-
`}var
|
|
1120
|
+
`}var Tf=t=>{t.style.removeProperty("background-image")},yf=(t,e)=>{t.style["background-image"]=`url('${e}')`},vr=class extends l.HTMLElement{static get observedAttributes(){return[je.PLACEHOLDER_SRC,je.SRC]}constructor(){if(super(),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,i,a){e===je.SRC&&(a==null?this.image.removeAttribute(je.SRC):this.image.setAttribute(je.SRC,a)),e===je.PLACEHOLDER_SRC&&(a==null?Tf(this.image):yf(this.image,a))}get placeholderSrc(){return w(this,je.PLACEHOLDER_SRC)}set placeholderSrc(e){R(this,je.SRC,e)}get src(){return w(this,je.SRC)}set src(e){R(this,je.SRC,e)}};vr.shadowRootOptions={mode:"open"};vr.getTemplateHTML=Af;l.customElements.get("media-poster-image")||l.customElements.define("media-poster-image",vr);var Bc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},kf=(t,e,i)=>(Bc(t,e,"read from private field"),i?i.call(t):e.get(t)),Sf=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},If=(t,e,i,a)=>(Bc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),mn,_l=class extends be{constructor(){super(),Sf(this,mn,void 0),If(this,mn,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PREVIEW_CHAPTER,n.MEDIA_LANG]}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),(e===n.MEDIA_PREVIEW_CHAPTER||e===n.MEDIA_LANG)&&a!==i&&a!=null)if(kf(this,mn).textContent=a,a!==""){let r=h("chapter: {chapterName}",{chapterName:a});this.setAttribute("aria-valuetext",r)}else this.removeAttribute("aria-valuetext")}get mediaPreviewChapter(){return w(this,n.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){R(this,n.MEDIA_PREVIEW_CHAPTER,e)}};mn=new WeakMap;l.customElements.get("media-preview-chapter-display")||l.customElements.define("media-preview-chapter-display",_l);var $c=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},hn=(t,e,i)=>($c(t,e,"read from private field"),i?i.call(t):e.get(t)),Mf=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},pn=(t,e,i,a)=>($c(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),et;function Cf(t){return`
|
|
1024
1121
|
<style>
|
|
1025
1122
|
:host {
|
|
1026
1123
|
box-sizing: border-box;
|
|
@@ -1034,28 +1131,28 @@
|
|
|
1034
1131
|
}
|
|
1035
1132
|
</style>
|
|
1036
1133
|
<img crossorigin loading="eager" decoding="async">
|
|
1037
|
-
`}var
|
|
1134
|
+
`}var qi=class extends l.HTMLElement{constructor(){if(super(),Mf(this,et,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[x.MEDIA_CONTROLLER,n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,i,a;let r=this.getAttribute(x.MEDIA_CONTROLLER);r&&(pn(this,et,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=hn(this,et))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=hn(this,et))==null?void 0:e.unassociateElement)==null||i.call(e,this),pn(this,et,null)}attributeChangedCallback(e,i,a){var r,o,s,d,u;[n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===x.MEDIA_CONTROLLER&&(i&&((o=(r=hn(this,et))==null?void 0:r.unassociateElement)==null||o.call(r,this),pn(this,et,null)),a&&this.isConnected&&(pn(this,et,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=hn(this,et))==null?void 0:d.associateElement)==null||u.call(d,this)))}get mediaPreviewImage(){return w(this,n.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){R(this,n.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(n.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(i=>+i)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(n.MEDIA_PREVIEW_COORDS);return}this.setAttribute(n.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,i=this.mediaPreviewImage;if(!(e&&i))return;let[a,r,o,s]=e,d=i.split("#")[0],u=getComputedStyle(this),{maxWidth:p,maxHeight:T,minWidth:_,minHeight:E}=u,f=Math.min(parseInt(p)/o,parseInt(T)/s),I=Math.max(parseInt(_)/o,parseInt(E)/s),b=f<1,M=b?f:I>1?I:1,{style:C}=q(this.shadowRoot,":host"),ie=q(this.shadowRoot,"img").style,Ae=this.shadowRoot.querySelector("img"),kt=b?"min":"max";C.setProperty(`${kt}-width`,"initial","important"),C.setProperty(`${kt}-height`,"initial","important"),C.width=`${o*M}px`,C.height=`${s*M}px`;let ct=()=>{ie.width=`${this.imgWidth*M}px`,ie.height=`${this.imgHeight*M}px`,ie.display="block"};Ae.src!==d&&(Ae.onload=()=>{this.imgWidth=Ae.naturalWidth,this.imgHeight=Ae.naturalHeight,ct()},Ae.src=d,ct()),ct(),ie.transform=`translate(-${a*M}px, -${r*M}px)`}};et=new WeakMap;qi.shadowRootOptions={mode:"open"};qi.getTemplateHTML=Cf;l.customElements.get("media-preview-thumbnail")||l.customElements.define("media-preview-thumbnail",qi);var fn=qi;var Fc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Wc=(t,e,i)=>(Fc(t,e,"read from private field"),i?i.call(t):e.get(t)),Lf=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},wf=(t,e,i,a)=>(Fc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Er,Al=class extends be{constructor(){super(),Lf(this,Er,void 0),wf(this,Er,this.shadowRoot.querySelector("slot")),Wc(this,Er).textContent=Ne(0)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_PREVIEW_TIME&&a!=null&&(Wc(this,Er).textContent=Ne(parseFloat(a)))}get mediaPreviewTime(){return O(this,n.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){N(this,n.MEDIA_PREVIEW_TIME,e)}};Er=new WeakMap;l.customElements.get("media-preview-time-display")||l.customElements.define("media-preview-time-display",Al);var Zi={SEEK_OFFSET:"seekoffset"},Tl=30,Rf=t=>`
|
|
1038
1135
|
<svg aria-hidden="true" viewBox="0 0 20 24">
|
|
1039
1136
|
<defs>
|
|
1040
1137
|
<style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
|
|
1041
1138
|
</defs>
|
|
1042
1139
|
<text class="text value" transform="translate(2.18 19.87)">${t}</text>
|
|
1043
1140
|
<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"/>
|
|
1044
|
-
</svg>`;function
|
|
1045
|
-
<slot name="icon">${
|
|
1046
|
-
`}function
|
|
1141
|
+
</svg>`;function xf(t,e){return`
|
|
1142
|
+
<slot name="icon">${Rf(e.seekOffset)}</slot>
|
|
1143
|
+
`}function Df(){return h("Seek backward")}var Of=0,br=class extends U{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_CURRENT_TIME,Zi.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=O(this,Zi.SEEK_OFFSET,Tl)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===Zi.SEEK_OFFSET&&(this.seekOffset=O(this,Zi.SEEK_OFFSET,Tl))}get seekOffset(){return O(this,Zi.SEEK_OFFSET,Tl)}set seekOffset(e){N(this,Zi.SEEK_OFFSET,e),this.setAttribute("aria-label",h("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),fo(vo(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return O(this,n.MEDIA_CURRENT_TIME,Of)}set mediaCurrentTime(e){N(this,n.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),i=new l.CustomEvent(m.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};br.getSlotTemplateHTML=xf;br.getTooltipContentHTML=Df;l.customElements.get("media-seek-backward-button")||l.customElements.define("media-seek-backward-button",br);var Qi={SEEK_OFFSET:"seekoffset"},yl=30,Pf=t=>`
|
|
1047
1144
|
<svg aria-hidden="true" viewBox="0 0 20 24">
|
|
1048
1145
|
<defs>
|
|
1049
1146
|
<style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
|
|
1050
1147
|
</defs>
|
|
1051
1148
|
<text class="text value" transform="translate(8.9 19.87)">${t}</text>
|
|
1052
1149
|
<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"/>
|
|
1053
|
-
</svg>`;function
|
|
1054
|
-
<slot name="icon">${
|
|
1055
|
-
`}function
|
|
1056
|
-
<slot>${
|
|
1057
|
-
`}var
|
|
1058
|
-
${
|
|
1150
|
+
</svg>`;function Nf(t,e){return`
|
|
1151
|
+
<slot name="icon">${Pf(e.seekOffset)}</slot>
|
|
1152
|
+
`}function Uf(){return h("Seek forward")}var Hf=0,gr=class extends U{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_CURRENT_TIME,Qi.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=O(this,Qi.SEEK_OFFSET,yl)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===Qi.SEEK_OFFSET&&(this.seekOffset=O(this,Qi.SEEK_OFFSET,yl))}get seekOffset(){return O(this,Qi.SEEK_OFFSET,yl)}set seekOffset(e){N(this,Qi.SEEK_OFFSET,e),this.setAttribute("aria-label",h("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),fo(vo(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return O(this,n.MEDIA_CURRENT_TIME,Hf)}set mediaCurrentTime(e){N(this,n.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,i=new l.CustomEvent(m.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};gr.getSlotTemplateHTML=Nf;gr.getTooltipContentHTML=Uf;l.customElements.get("media-seek-forward-button")||l.customElements.define("media-seek-forward-button",gr);var Gc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},kl=(t,e,i)=>(Gc(t,e,"read from private field"),i?i.call(t):e.get(t)),Bf=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},$f=(t,e,i,a)=>(Gc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),zi,si={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Vc=[...Object.values(si),n.MEDIA_CURRENT_TIME,n.MEDIA_DURATION,n.MEDIA_SEEKABLE],Kc=["Enter"," "],Wf=" / ",Sl=(t,{timesSep:e=Wf}={})=>{var i,a;let r=(i=t.mediaCurrentTime)!=null?i:0,[,o]=(a=t.mediaSeekable)!=null?a:[],s=0;Number.isFinite(t.mediaDuration)?s=t.mediaDuration:Number.isFinite(o)&&(s=o);let d=t.remaining?Ne(0-(s-r)):Ne(r);return t.showDuration?`${d}${e}${Ne(s)}`:d},Ff="video not loaded, unknown time.",Vf=t=>{var e;let i=t.mediaCurrentTime,[,a]=(e=t.mediaSeekable)!=null?e:[],r=null;if(Number.isFinite(t.mediaDuration)?r=t.mediaDuration:Number.isFinite(a)&&(r=a),i==null||r===null){t.setAttribute("aria-valuetext",Ff);return}let o=t.remaining?Yt(0-(r-i)):Yt(i);if(!t.showDuration){t.setAttribute("aria-valuetext",o);return}let s=Yt(r),d=`${o} of ${s}`;t.setAttribute("aria-valuetext",d)};function Kf(t,e){return`
|
|
1153
|
+
<slot>${Sl(e)}</slot>
|
|
1154
|
+
`}var vn=class extends be{constructor(){super(),Bf(this,zi,void 0),$f(this,zi,this.shadowRoot.querySelector("slot")),kl(this,zi).innerHTML=`${Sl(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Vc,"disabled"]}connectedCallback(){let{style:e}=q(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","var(--media-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",h("playback time"));let i=a=>{let{key:r}=a;if(!Kc.includes(r)){this.removeEventListener("keyup",i);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:o,key:s}=a;if(r||o||!Kc.includes(s)){this.removeEventListener("keyup",i);return}this.addEventListener("keyup",i)}),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,i,a){Vc.includes(e)?this.update():e==="disabled"&&a!==i&&(a==null?this.enable():this.disable()),super.attributeChangedCallback(e,i,a)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return k(this,si.REMAINING)}set remaining(e){S(this,si.REMAINING,e)}get showDuration(){return k(this,si.SHOW_DURATION)}set showDuration(e){S(this,si.SHOW_DURATION,e)}get noToggle(){return k(this,si.NO_TOGGLE)}set noToggle(e){S(this,si.NO_TOGGLE,e)}get mediaDuration(){return O(this,n.MEDIA_DURATION)}set mediaDuration(e){N(this,n.MEDIA_DURATION,e)}get mediaCurrentTime(){return O(this,n.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){N(this,n.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(n.MEDIA_SEEKABLE);if(e)return e.split(":").map(i=>+i)}set mediaSeekable(e){if(e==null){this.removeAttribute(n.MEDIA_SEEKABLE);return}this.setAttribute(n.MEDIA_SEEKABLE,e.join(":"))}update(){let e=Sl(this);Vf(this),e!==kl(this,zi).innerHTML&&(kl(this,zi).innerHTML=e)}};zi=new WeakMap;vn.getSlotTemplateHTML=Kf;l.customElements.get("media-time-display")||l.customElements.define("media-time-display",vn);var Yc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ne=(t,e,i)=>(Yc(t,e,"read from private field"),i?i.call(t):e.get(t)),tt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Me=(t,e,i,a)=>(Yc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Gf=(t,e,i,a)=>({set _(r){Me(t,e,r,i)},get _(){return ne(t,e,a)}}),Xi,En,Ji,_r,bn,gn,_n,ji,li,An,Tn=class{constructor(e,i,a){tt(this,Xi,void 0),tt(this,En,void 0),tt(this,Ji,void 0),tt(this,_r,void 0),tt(this,bn,void 0),tt(this,gn,void 0),tt(this,_n,void 0),tt(this,ji,void 0),tt(this,li,0),tt(this,An,(r=performance.now())=>{Me(this,li,requestAnimationFrame(ne(this,An))),Me(this,_r,performance.now()-ne(this,Ji));let o=1e3/this.fps;if(ne(this,_r)>o){Me(this,Ji,r-ne(this,_r)%o);let s=1e3/((r-ne(this,En))/++Gf(this,bn)._),d=(r-ne(this,gn))/1e3/this.duration,u=ne(this,_n)+d*this.playbackRate;u-ne(this,Xi).valueAsNumber>0?Me(this,ji,this.playbackRate/this.duration/s):(Me(this,ji,.995*ne(this,ji)),u=ne(this,Xi).valueAsNumber+ne(this,ji)),this.callback(u)}}),Me(this,Xi,e),this.callback=i,this.fps=a}start(){ne(this,li)===0&&(Me(this,Ji,performance.now()),Me(this,En,ne(this,Ji)),Me(this,bn,0),ne(this,An).call(this))}stop(){ne(this,li)!==0&&(cancelAnimationFrame(ne(this,li)),Me(this,li,0))}update({start:e,duration:i,playbackRate:a}){let r=e-ne(this,Xi).valueAsNumber,o=Math.abs(i-this.duration);(r>0||r<-.03||o>=.5)&&this.callback(e),Me(this,_n,e),Me(this,gn,performance.now()),this.duration=i,this.playbackRate=a}};Xi=new WeakMap;En=new WeakMap;Ji=new WeakMap;_r=new WeakMap;bn=new WeakMap;gn=new WeakMap;_n=new WeakMap;ji=new WeakMap;li=new WeakMap;An=new WeakMap;var Ll=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},J=(t,e,i)=>(Ll(t,e,"read from private field"),i?i.call(t):e.get(t)),ae=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Re=(t,e,i,a)=>(Ll(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),de=(t,e,i)=>(Ll(t,e,"access private method"),i),ea,di,Sn,Tr,In,kn,yr,kr,ta,ia,aa,Ar,wl,qc,Il,Mn,Rl,Cn,xl,Ln,Dl,Ml,Zc,Sr,wn,Cl,Qc,Yf="video not loaded, unknown time.",qf=t=>{let e=t.range,i=Yt(+zc(t)),a=Yt(+t.mediaSeekableEnd),r=i&&a?`${i} of ${a}`:Yf;e.setAttribute("aria-valuetext",r)};function Zf(t){return`
|
|
1155
|
+
${Qe.getTemplateHTML(t)}
|
|
1059
1156
|
<style>
|
|
1060
1157
|
:host {
|
|
1061
1158
|
--media-box-border-radius: 4px;
|
|
@@ -1258,8 +1355,8 @@
|
|
|
1258
1355
|
<div id="preview-rail">
|
|
1259
1356
|
<slot name="preview" part="box preview-box">
|
|
1260
1357
|
<media-preview-thumbnail>
|
|
1261
|
-
<template shadowrootmode="${
|
|
1262
|
-
${
|
|
1358
|
+
<template shadowrootmode="${fn.shadowRootOptions.mode}">
|
|
1359
|
+
${fn.getTemplateHTML({})}
|
|
1263
1360
|
</template>
|
|
1264
1361
|
</media-preview-thumbnail>
|
|
1265
1362
|
<media-preview-chapter-display></media-preview-chapter-display>
|
|
@@ -1272,8 +1369,37 @@
|
|
|
1272
1369
|
|
|
1273
1370
|
</slot>
|
|
1274
1371
|
</div>
|
|
1275
|
-
`}var pn=(t,e=t.mediaCurrentTime)=>{let i=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,a=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;if(Number.isNaN(a))return 0;let r=(e-i)/(a-i);return Math.max(0,Math.min(r,1))},Bc=(t,e=t.range.valueAsNumber)=>{let i=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,a=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;return Number.isNaN(a)?0:e*(a-i)+i},gr=class extends Ye{constructor(){super(),ie(this,Ji),ie(this,gl),ie(this,bn),ie(this,gn),ie(this,_n),ie(this,vl),ie(this,br),ie(this,El),ie(this,Qi,void 0),ie(this,ni,void 0),ie(this,vn,void 0),ie(this,fr,void 0),ie(this,En,void 0),ie(this,fn,void 0),ie(this,vr,void 0),ie(this,Er,void 0),ie(this,zi,void 0),ie(this,Xi,void 0),ie(this,fl,a=>{this.dragging||(Si(a)&&(this.range.valueAsNumber=a),J(this,Xi)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),Re(this,vn,this.shadowRoot.querySelectorAll('[part~="box"]')),Re(this,En,this.shadowRoot.querySelector('[part~="preview-box"]')),Re(this,fn,this.shadowRoot.querySelector('[part~="current-box"]'));let i=getComputedStyle(this);Re(this,vr,parseInt(i.getPropertyValue("--media-box-padding-left"))),Re(this,Er,parseInt(i.getPropertyValue("--media-box-padding-right"))),Re(this,ni,new hn(this.range,J(this,fl),60))}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PAUSED,n.MEDIA_DURATION,n.MEDIA_SEEKABLE,n.MEDIA_CURRENT_TIME,n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_TIME,n.MEDIA_PREVIEW_CHAPTER,n.MEDIA_BUFFERED,n.MEDIA_PLAYBACK_RATE,n.MEDIA_LOADING,n.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",m("seek")),le(this,Ji,pr).call(this),Re(this,Qi,this.getRootNode()),(e=J(this,Qi))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),le(this,Ji,pr).call(this),(e=J(this,Qi))==null||e.removeEventListener("transitionstart",this),Re(this,Qi,null)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),i!=a&&(e===n.MEDIA_CURRENT_TIME||e===n.MEDIA_PAUSED||e===n.MEDIA_ENDED||e===n.MEDIA_LOADING||e===n.MEDIA_DURATION||e===n.MEDIA_SEEKABLE?(J(this,ni).update({start:pn(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),le(this,Ji,pr).call(this),xf(this)):e===n.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===n.MEDIA_DURATION||e===n.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=J(this,zi),this.updateBar()))}get mediaChaptersCues(){return J(this,zi)}set mediaChaptersCues(e){var i;Re(this,zi,e),this.updateSegments((i=J(this,zi))==null?void 0:i.map(a=>({start:pn(this,a.startTime),end:pn(this,a.endTime)})))}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}get mediaLoading(){return k(this,n.MEDIA_LOADING)}set mediaLoading(e){S(this,n.MEDIA_LOADING,e)}get mediaDuration(){return D(this,n.MEDIA_DURATION)}set mediaDuration(e){N(this,n.MEDIA_DURATION,e)}get mediaCurrentTime(){return D(this,n.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){N(this,n.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return D(this,n.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){N(this,n.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(n.MEDIA_BUFFERED);return e?e.split(" ").map(i=>i.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(n.MEDIA_BUFFERED);return}let i=e.map(a=>a.join(":")).join(" ");this.setAttribute(n.MEDIA_BUFFERED,i)}get mediaSeekable(){let e=this.getAttribute(n.MEDIA_SEEKABLE);if(e)return e.split(":").map(i=>+i)}set mediaSeekable(e){if(e==null){this.removeAttribute(n.MEDIA_SEEKABLE);return}this.setAttribute(n.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,i=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaSeekableStart(){var e;let[i=0]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaPreviewImage(){return M(this,n.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){C(this,n.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return D(this,n.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){N(this,n.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return k(this,n.MEDIA_ENDED)}set mediaEnded(e){S(this,n.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let i=this.mediaBuffered;if(!i.length)return;let a;if(this.mediaEnded)a=1;else{let o=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=i.find(([d,u])=>d<=o&&o<=u))!=null?e:[];a=pn(this,s)}let{style:r}=F(this.shadowRoot,"#buffered");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let i=F(this.shadowRoot,"#current-rail"),a=F(this.shadowRoot,'[part~="current-box"]'),r=le(this,bn,_l).call(this,J(this,fn)),o=le(this,gn,Al).call(this,r,this.range.valueAsNumber),s=le(this,_n,Tl).call(this,r,this.range.valueAsNumber);i.style.transform=`translateX(${o})`,i.style.setProperty("--_range-width",`${r.range.width}`),a.style.setProperty("--_box-shift",`${s}`),a.style.setProperty("--_box-width",`${r.box.width}px`),a.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":le(this,El,Hc).call(this);break;case"pointermove":le(this,vl,Uc).call(this,e);break;case"pointerup":J(this,Xi)&&Re(this,Xi,!1);break;case"pointerdown":Re(this,Xi,!0);break;case"pointerleave":le(this,br,An).call(this,null);break;case"transitionstart":de(e.target,this)&&setTimeout(()=>le(this,Ji,pr).call(this),0);break}}};Qi=new WeakMap;ni=new WeakMap;vn=new WeakMap;fr=new WeakMap;En=new WeakMap;fn=new WeakMap;vr=new WeakMap;Er=new WeakMap;zi=new WeakMap;Xi=new WeakMap;Ji=new WeakSet;pr=function(){le(this,gl,Pc).call(this)?J(this,ni).start():J(this,ni).stop()};gl=new WeakSet;Pc=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&lo(this)};fl=new WeakMap;bn=new WeakSet;_l=function(t){var e;let a=((e=this.getAttribute("bounds")?Fe(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),r=this.range.getBoundingClientRect(),o=t.offsetWidth,s=-(r.left-a.left-o/2),d=a.right-r.left-o/2;return{box:{width:o,min:s,max:d},bounds:a,range:r}};gn=new WeakSet;Al=function(t,e){let i=`${e*100}%`,{width:a,min:r,max:o}=t.box;if(!a)return i;if(Number.isNaN(r)||(i=`max(${`calc(1 / var(--_range-width) * 100 * ${r}% + var(--media-box-padding-left))`}, ${i})`),!Number.isNaN(o)){let d=`calc(1 / var(--_range-width) * 100 * ${o}% - var(--media-box-padding-right))`;i=`min(${i}, ${d})`}return i};_n=new WeakSet;Tl=function(t,e){let{width:i,min:a,max:r}=t.box,o=e*t.range.width;if(o<a+J(this,vr)){let s=t.range.left-t.bounds.left-J(this,vr);return`${o-i/2+s}px`}if(o>r-J(this,Er)){let s=t.bounds.right-t.range.right-J(this,Er);return`${o+i/2-s-t.range.width}px`}return 0};vl=new WeakSet;Uc=function(t){let e=[...J(this,vn)].some(T=>t.composedPath().includes(T));if(!this.dragging&&(e||!t.composedPath().includes(this))){le(this,br,An).call(this,null);return}let i=this.mediaSeekableEnd;if(!i)return;let a=F(this.shadowRoot,"#preview-rail"),r=F(this.shadowRoot,'[part~="preview-box"]'),o=le(this,bn,_l).call(this,J(this,En)),s=(t.clientX-o.range.left)/o.range.width;s=Math.max(0,Math.min(1,s));let d=le(this,gn,Al).call(this,o,s),u=le(this,_n,Tl).call(this,o,s);a.style.transform=`translateX(${d})`,a.style.setProperty("--_range-width",`${o.range.width}`),r.style.setProperty("--_box-shift",`${u}`),r.style.setProperty("--_box-width",`${o.box.width}px`);let h=Math.round(J(this,fr))-Math.round(s*i);Math.abs(h)<1&&s>.01&&s<.99||(Re(this,fr,s*i),le(this,br,An).call(this,J(this,fr)))};br=new WeakSet;An=function(t){this.dispatchEvent(new l.CustomEvent(f.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:t}))};El=new WeakSet;Hc=function(){J(this,ni).stop();let t=Bc(this);this.dispatchEvent(new l.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t}))};gr.shadowRootOptions={mode:"open"};gr.getTemplateHTML=Df;l.customElements.get("media-time-range")||l.customElements.define("media-time-range",gr);var Of=1,Nf=t=>t.mediaMuted?0:t.mediaVolume,Pf=t=>`${Math.round(t*100)}%`,yl=class extends Ye{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_VOLUME,n.MEDIA_MUTED,n.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,i=new l.CustomEvent(f.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",m("volume"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===n.MEDIA_VOLUME||e===n.MEDIA_MUTED)&&(this.range.valueAsNumber=Nf(this),this.range.setAttribute("aria-valuetext",Pf(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return D(this,n.MEDIA_VOLUME,Of)}set mediaVolume(e){N(this,n.MEDIA_VOLUME,e)}get mediaMuted(){return k(this,n.MEDIA_MUTED)}set mediaMuted(e){S(this,n.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return M(this,n.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){C(this,n.MEDIA_VOLUME_UNAVAILABLE,e)}};l.customElements.get("media-volume-range")||l.customElements.define("media-volume-range",yl);var b=require("@mux/mux-video/base"),R=require("@mux/playback-core");var Gc=require("@mux/playback-core");var di=require("@mux/playback-core");function $c(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${Tn(i)}: ${a}; `)}),e?e.trim():void 0}function Tn(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function yn(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function ue(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function kl(t){let e=Uf(t).toString();return e?"?"+e:""}function Uf(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var Sl=(t,e)=>!t||!e?!1:t.contains(e)?!0:Sl(t,e.getRootNode().host);var Wc="mux.com",Hf=()=>{try{return"3.9.1"}catch{}return"UNKNOWN"},Bf=Hf(),Sn=()=>Bf,Fc=(t,{token:e,customDomain:i=Wc,thumbnailTime:a,programTime:r}={})=>{var d;let o=e==null?a:void 0,{aud:s}=(d=(0,di.parseJwt)(e))!=null?d:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${kl({token:e,time:o,program_time:r})}`},Vc=(t,{token:e,customDomain:i=Wc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:o}=(s=(0,di.parseJwt)(e))!=null?s:{};if(!(e&&o!=="s"))return`https://image.${i}/${t}/storyboard.vtt${kl({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},_r=t=>{if(t){if([di.StreamTypes.LIVE,di.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return di.StreamTypes.LIVE}};var $f={crossorigin:"crossOrigin",playsinline:"playsInline"};function Kc(t){var e;return(e=$f[t])!=null?e:yn(t)}var si,li,ce,kn=class{constructor(e,i){he(this,si);he(this,li);he(this,ce,[]);ye(this,si,e),ye(this,li,i)}[Symbol.iterator](){return U(this,ce).values()}get length(){return U(this,ce).length}get value(){var e;return(e=U(this,ce).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(ye(this,ce,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return U(this,ce)[e]}values(){return U(this,ce).values()}keys(){return U(this,ce).keys()}forEach(e){U(this,ce).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||U(this,ce).push(r)}),!(this.value===""&&!((i=U(this,si))!=null&&i.hasAttribute(`${U(this,li)}`)))&&((a=U(this,si))==null||a.setAttribute(`${U(this,li)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{U(this,ce).splice(U(this,ce).indexOf(a),1)}),(i=U(this,si))==null||i.setAttribute(`${U(this,li)}`,`${this.value}`)}contains(e){return U(this,ce).includes(e)}toggle(e,i){return typeof i!="undefined"?i?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,i){this.remove(e),this.add(i)}};si=new WeakMap,li=new WeakMap,ce=new WeakMap;var Yc=`[mux-player ${Sn()}]`;function je(...t){console.warn(Yc,...t)}function be(...t){console.error(Yc,...t)}function Il(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,Gc.i18n)("Read more: ")}
|
|
1276
|
-
https://github.com/muxinc/elements/blob/main/errors/${t.file}`),je(e)}var se={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Dt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},w_={...se,...Dt},Zc=Object.freeze({length:0,start(t){let e=t>>>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(t){let e=t>>>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}}),Wf=Object.values(se).filter(t=>se.PLAYSINLINE!==t),Ff=Object.values(Dt),Vf=[...Wf,...Ff],Ml=class extends ke.HTMLElement{static get observedAttributes(){return Vf}constructor(){super()}attributeChangedCallback(e,i,a){var r,o;switch(e){case Dt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Dt.VOLUME:{let s=(r=ue(a))!=null?r:1;this.media&&(this.media.volume=s);return}case Dt.PLAYBACKRATE:{let s=(o=ue(a))!=null?o:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var e,i;return(i=(e=this.media)==null?void 0:e.play())!=null?i:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}load(){var e;(e=this.media)==null||e.load()}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,i;return(i=(e=this.media)==null?void 0:e.paused)!=null?i:!0}get duration(){var e,i;return(i=(e=this.media)==null?void 0:e.duration)!=null?i:NaN}get ended(){var e,i;return(i=(e=this.media)==null?void 0:e.ended)!=null?i:!1}get buffered(){var e,i;return(i=(e=this.media)==null?void 0:e.buffered)!=null?i:Zc}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:Zc}get readyState(){var e,i;return(i=(e=this.media)==null?void 0:e.readyState)!=null?i:0}get videoWidth(){var e,i;return(i=(e=this.media)==null?void 0:e.videoWidth)!=null?i:0}get videoHeight(){var e,i;return(i=(e=this.media)==null?void 0:e.videoHeight)!=null?i:0}get currentSrc(){var e,i;return(i=(e=this.media)==null?void 0:e.currentSrc)!=null?i:""}get currentTime(){var e,i;return(i=(e=this.media)==null?void 0:e.currentTime)!=null?i:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,i;return(i=(e=this.media)==null?void 0:e.volume)!=null?i:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,i;return(i=(e=this.media)==null?void 0:e.playbackRate)!=null?i:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=ue(this.getAttribute(Dt.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Dt.PLAYBACKRATE,`${e}`):this.removeAttribute(Dt.PLAYBACKRATE)}get crossOrigin(){return Ar(this,se.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(se.CROSSORIGIN,`${e}`)}get autoplay(){return Ar(this,se.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(se.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(se.AUTOPLAY)}get loop(){return Ar(this,se.LOOP)!=null}set loop(e){e?this.setAttribute(se.LOOP,""):this.removeAttribute(se.LOOP)}get muted(){var e,i;return(i=(e=this.media)==null?void 0:e.muted)!=null?i:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return Ar(this,se.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(se.MUTED,""):this.removeAttribute(se.MUTED)}get playsInline(){return Ar(this,se.PLAYSINLINE)!=null}set playsInline(e){be("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(se.PRELOAD,e):this.removeAttribute(se.PRELOAD)}};function Ar(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var Cl=Ml;var jc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},O=(t,e,i)=>(jc(t,e,"read from private field"),i?i.call(t):e.get(t)),et=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},vt=(t,e,i,a)=>(jc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ji,In,ui,Tr,Ot,Nt,Pt,ci,ea,Mn,Be,Qc=1,zc=0,Kf=1,Gf={processCallback(t,e,i){if(i){for(let[a,r]of e)if(a in i){let o=i[a];typeof o=="boolean"&&r instanceof me&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=o:typeof o=="function"&&r instanceof me?r.element[r.attributeName]=o:r.value=o}}}},Et=class extends l.DocumentFragment{constructor(e,i,a=Gf){var r;super(),et(this,ji,void 0),et(this,In,void 0),this.append(e.content.cloneNode(!0)),vt(this,ji,em(this)),vt(this,In,a),(r=a.createCallback)==null||r.call(a,this,O(this,ji),i),a.processCallback(this,O(this,ji),i)}update(e){O(this,In).processCallback(this,O(this,ji),e)}};ji=new WeakMap;In=new WeakMap;var em=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let o=new Ll;for([i,a]of Jc(r.value))if(!i)o.append(a);else{let s=new me(t,r.name,r.namespaceURI);o.append(s),e.push([a,s])}r.value=o.toString()}for(let r of t.childNodes)if(r.nodeType===Qc&&!(r instanceof HTMLTemplateElement))em(r,e);else{let o=r.data;if(r.nodeType===Qc||o.includes("{{")){let s=[];if(o)for([i,a]of Jc(o))if(!i)s.push(new Text(a));else{let d=new bt(t);s.push(d),e.push([a,d])}else if(r instanceof HTMLTemplateElement){let d=new yr(t,r);s.push(d),e.push([d.expression,d])}r.replaceWith(...s.flatMap(d=>d.replacementNodes||[d]))}}return e},Xc={},Jc=t=>{let e="",i=0,a=Xc[t],r=0,o;if(a)return a;for(a=[];o=t[r];r++)o==="{"&&t[r+1]==="{"&&t[r-1]!=="\\"&&t[r+2]&&++i==1?(e&&a.push([zc,e]),e="",r++):o==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([Kf,e.trim()]),e="",r++):e+=o||"";return e&&a.push([zc,(i>0?"{{":"")+e]),Xc[t]=a},Yf=11,Cn=class{get value(){return""}set value(e){}toString(){return this.value}},tm=new WeakMap,Ll=class{constructor(){et(this,ui,[])}[Symbol.iterator](){return O(this,ui).values()}get length(){return O(this,ui).length}item(e){return O(this,ui)[e]}append(...e){for(let i of e)i instanceof me&&tm.set(i,this),O(this,ui).push(i)}toString(){return O(this,ui).join("")}};ui=new WeakMap;var me=class extends Cn{constructor(e,i,a){super(),et(this,ci),et(this,Tr,""),et(this,Ot,void 0),et(this,Nt,void 0),et(this,Pt,void 0),vt(this,Ot,e),vt(this,Nt,i),vt(this,Pt,a)}get attributeName(){return O(this,Nt)}get attributeNamespace(){return O(this,Pt)}get element(){return O(this,Ot)}get value(){return O(this,Tr)}set value(e){O(this,Tr)!==e&&(vt(this,Tr,e),!O(this,ci,ea)||O(this,ci,ea).length===1?e==null?O(this,Ot).removeAttributeNS(O(this,Pt),O(this,Nt)):O(this,Ot).setAttributeNS(O(this,Pt),O(this,Nt),e):O(this,Ot).setAttributeNS(O(this,Pt),O(this,Nt),O(this,ci,ea).toString()))}get booleanValue(){return O(this,Ot).hasAttributeNS(O(this,Pt),O(this,Nt))}set booleanValue(e){if(!O(this,ci,ea)||O(this,ci,ea).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};Tr=new WeakMap;Ot=new WeakMap;Nt=new WeakMap;Pt=new WeakMap;ci=new WeakSet;ea=function(){return tm.get(this)};var bt=class extends Cn{constructor(e,i){super(),et(this,Mn,void 0),et(this,Be,void 0),vt(this,Mn,e),vt(this,Be,i?[...i]:[new Text])}get replacementNodes(){return O(this,Be)}get parentNode(){return O(this,Mn)}get nextSibling(){return O(this,Be)[O(this,Be).length-1].nextSibling}get previousSibling(){return O(this,Be)[0].previousSibling}get value(){return O(this,Be).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let i=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===Yf?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),vt(this,Be,qf(O(this,Be)[0].parentNode,O(this,Be),i,this.nextSibling))}};Mn=new WeakMap;Be=new WeakMap;var yr=class extends bt{constructor(e,i){let a=i.getAttribute("directive")||i.getAttribute("type"),r=i.getAttribute("expression")||i.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),this.expression=r,this.template=i,this.directive=a}};function qf(t,e,i,a=null){let r=0,o,s,d,u=i.length,h=e.length;for(;r<u&&r<h&&e[r]==i[r];)r++;for(;r<u&&r<h&&i[u-1]==e[h-1];)a=i[--h,--u];if(r==h)for(;r<u;)t.insertBefore(i[r++],a);if(r==u)for(;r<h;)t.removeChild(e[r++]);else{for(o=e[r];r<u;)d=i[r++],s=o?o.nextSibling:a,o==d?o=s:r<u&&i[r]==s?(t.replaceChild(d,o),o=s):t.insertBefore(d,o);for(;o!=a;)s=o.nextSibling,t.removeChild(o),o=s}return i}var im={string:t=>String(t)},wn=class{constructor(e){this.template=e,this.state=void 0}},mi=new WeakMap,hi=new WeakMap,wl={partial:(t,e)=>{e[t.expression]=new wn(t.template)},if:(t,e)=>{var i;if(rm(t.expression,e))if(mi.get(t)!==t.template){mi.set(t,t.template);let a=new Et(t.template,e,Rn);t.replace(a),hi.set(t,a)}else(i=hi.get(t))==null||i.update(e);else t.replace(""),mi.delete(t),hi.delete(t)}},Zf=Object.keys(wl),Rn={processCallback(t,e,i){var a,r;if(i)for(let[o,s]of e){if(s instanceof yr){if(!s.directive){let u=Zf.find(h=>s.template.hasAttribute(h));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=wl[s.directive])==null||a.call(wl,s,i);continue}let d=rm(o,i);if(d instanceof wn){mi.get(s)!==d.template?(mi.set(s,d.template),d=new Et(d.template,d.state,Rn),s.value=d,hi.set(s,d)):(r=hi.get(s))==null||r.update(d.state);continue}d?(s instanceof me&&s.attributeName.startsWith("aria-")&&(d=String(d)),s instanceof me?typeof d=="boolean"?s.booleanValue=d:typeof d=="function"?s.element[s.attributeName]=d:s.value=d:(s.value=d,mi.delete(s),hi.delete(s))):s instanceof me?s.value=void 0:(s.value=void 0,mi.delete(s),hi.delete(s))}}},am={"!":t=>!t,"!!":t=>!!t,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,">":(t,e)=>t>e,">=":(t,e)=>t>=e,"<":(t,e)=>t<e,"<=":(t,e)=>t<=e,"??":(t,e)=>t!=null?t:e,"|":(t,e)=>{var i;return(i=im[e])==null?void 0:i.call(im,t)}};function Qf(t){return zf(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function rm(t,e={}){var i,a,r,o,s,d,u;let h=Qf(t);if(h.length===0||h.some(({type:T})=>!T))return kr(t);if(((i=h[0])==null?void 0:i.token)===">"){let T=e[(a=h[1])==null?void 0:a.token];if(!T)return kr(t);let g={...e};T.state=g;let v=h.slice(2);for(let p=0;p<v.length;p+=3){let I=(r=v[p])==null?void 0:r.token,A=(o=v[p+1])==null?void 0:o.token,L=(s=v[p+2])==null?void 0:s.token;I&&A==="="&&(g[I]=Sr(L,e))}return T}if(h.length===1)return Ln(h[0])?Sr(h[0].token,e):kr(t);if(h.length===2){let T=(d=h[0])==null?void 0:d.token,g=am[T];if(!g||!Ln(h[1]))return kr(t);let v=Sr(h[1].token,e);return g(v)}if(h.length===3){let T=(u=h[1])==null?void 0:u.token,g=am[T];if(!g||!Ln(h[0])||!Ln(h[2]))return kr(t);let v=Sr(h[0].token,e);if(T==="|")return g(v,h[2].token);let p=Sr(h[2].token,e);return g(v,p)}}function kr(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function Ln({type:t}){return["number","boolean","string","param"].includes(t)}function Sr(t,e){let i=t[0],a=t.slice(-1);return t==="true"||t==="false"?t==="true":i===a&&["'",'"'].includes(i)?t.slice(1,-1):eo(t)?parseFloat(t):e[t]}function zf(t,e){let i,a,r,o=[];for(;t;){r=null,i=t.length;for(let s in e)a=e[s].exec(t),a&&a.index<i&&(r={token:a[0],type:s,matches:a.slice(1)},i=a.index);i&&o.push({token:t.substr(0,i),type:void 0}),r&&o.push(r),t=t.substr(i+(r?r.token.length:0))}return o}var Pl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Dl=(t,e,i)=>(Pl(t,e,"read from private field"),i?i.call(t):e.get(t)),Ir=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},pi=(t,e,i,a)=>(Pl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Rl=(t,e,i)=>(Pl(t,e,"access private method"),i),ta,xn,ia,Ol,om,Dn,Nl,xl={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},nm=Y.createElement("template");nm.innerHTML=`
|
|
1372
|
+
`}var yn=(t,e=t.mediaCurrentTime)=>{let i=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,a=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;if(Number.isNaN(a))return 0;let r=(e-i)/(a-i);return Math.max(0,Math.min(r,1))},zc=(t,e=t.range.valueAsNumber)=>{let i=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,a=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;return Number.isNaN(a)?0:e*(a-i)+i},Ir=class extends Qe{constructor(){super(),ae(this,aa),ae(this,wl),ae(this,Mn),ae(this,Cn),ae(this,Ln),ae(this,Ml),ae(this,Sr),ae(this,Cl),ae(this,ea,void 0),ae(this,di,void 0),ae(this,Sn,void 0),ae(this,Tr,void 0),ae(this,In,void 0),ae(this,kn,void 0),ae(this,yr,void 0),ae(this,kr,void 0),ae(this,ta,void 0),ae(this,ia,void 0),ae(this,Il,a=>{this.dragging||(Ci(a)&&(this.range.valueAsNumber=a),J(this,ia)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),Re(this,Sn,this.shadowRoot.querySelectorAll('[part~="box"]')),Re(this,In,this.shadowRoot.querySelector('[part~="preview-box"]')),Re(this,kn,this.shadowRoot.querySelector('[part~="current-box"]'));let i=getComputedStyle(this);Re(this,yr,parseInt(i.getPropertyValue("--media-box-padding-left"))),Re(this,kr,parseInt(i.getPropertyValue("--media-box-padding-right"))),Re(this,di,new Tn(this.range,J(this,Il),60))}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PAUSED,n.MEDIA_DURATION,n.MEDIA_SEEKABLE,n.MEDIA_CURRENT_TIME,n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_TIME,n.MEDIA_PREVIEW_CHAPTER,n.MEDIA_BUFFERED,n.MEDIA_PLAYBACK_RATE,n.MEDIA_LOADING,n.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",h("seek")),de(this,aa,Ar).call(this),Re(this,ea,this.getRootNode()),(e=J(this,ea))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),de(this,aa,Ar).call(this),(e=J(this,ea))==null||e.removeEventListener("transitionstart",this),Re(this,ea,null)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),i!=a&&(e===n.MEDIA_CURRENT_TIME||e===n.MEDIA_PAUSED||e===n.MEDIA_ENDED||e===n.MEDIA_LOADING||e===n.MEDIA_DURATION||e===n.MEDIA_SEEKABLE?(J(this,di).update({start:yn(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),de(this,aa,Ar).call(this),qf(this)):e===n.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===n.MEDIA_DURATION||e===n.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=J(this,ta),this.updateBar()))}get mediaChaptersCues(){return J(this,ta)}set mediaChaptersCues(e){var i;Re(this,ta,e),this.updateSegments((i=J(this,ta))==null?void 0:i.map(a=>({start:yn(this,a.startTime),end:yn(this,a.endTime)})))}get mediaPaused(){return k(this,n.MEDIA_PAUSED)}set mediaPaused(e){S(this,n.MEDIA_PAUSED,e)}get mediaLoading(){return k(this,n.MEDIA_LOADING)}set mediaLoading(e){S(this,n.MEDIA_LOADING,e)}get mediaDuration(){return O(this,n.MEDIA_DURATION)}set mediaDuration(e){N(this,n.MEDIA_DURATION,e)}get mediaCurrentTime(){return O(this,n.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){N(this,n.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return O(this,n.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){N(this,n.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(n.MEDIA_BUFFERED);return e?e.split(" ").map(i=>i.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(n.MEDIA_BUFFERED);return}let i=e.map(a=>a.join(":")).join(" ");this.setAttribute(n.MEDIA_BUFFERED,i)}get mediaSeekable(){let e=this.getAttribute(n.MEDIA_SEEKABLE);if(e)return e.split(":").map(i=>+i)}set mediaSeekable(e){if(e==null){this.removeAttribute(n.MEDIA_SEEKABLE);return}this.setAttribute(n.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,i=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaSeekableStart(){var e;let[i=0]=(e=this.mediaSeekable)!=null?e:[];return i}get mediaPreviewImage(){return w(this,n.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){R(this,n.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return O(this,n.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){N(this,n.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return k(this,n.MEDIA_ENDED)}set mediaEnded(e){S(this,n.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let i=this.mediaBuffered;if(!i.length)return;let a;if(this.mediaEnded)a=1;else{let o=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=i.find(([d,u])=>d<=o&&o<=u))!=null?e:[];a=yn(this,s)}let{style:r}=q(this.shadowRoot,"#buffered");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;let i=q(this.shadowRoot,"#current-rail"),a=q(this.shadowRoot,'[part~="current-box"]'),r=de(this,Mn,Rl).call(this,J(this,kn)),o=de(this,Cn,xl).call(this,r,this.range.valueAsNumber),s=de(this,Ln,Dl).call(this,r,this.range.valueAsNumber);i.style.transform=`translateX(${o})`,i.style.setProperty("--_range-width",`${r.range.width}`),a.style.setProperty("--_box-shift",`${s}`),a.style.setProperty("--_box-width",`${r.box.width}px`),a.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":de(this,Cl,Qc).call(this);break;case"pointermove":de(this,Ml,Zc).call(this,e);break;case"pointerup":J(this,ia)&&Re(this,ia,!1);break;case"pointerdown":Re(this,ia,!0);break;case"pointerleave":de(this,Sr,wn).call(this,null);break;case"transitionstart":ue(e.target,this)&&setTimeout(()=>de(this,aa,Ar).call(this),0);break}}};ea=new WeakMap;di=new WeakMap;Sn=new WeakMap;Tr=new WeakMap;In=new WeakMap;kn=new WeakMap;yr=new WeakMap;kr=new WeakMap;ta=new WeakMap;ia=new WeakMap;aa=new WeakSet;Ar=function(){de(this,wl,qc).call(this)?J(this,di).start():J(this,di).stop()};wl=new WeakSet;qc=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Eo(this)};Il=new WeakMap;Mn=new WeakSet;Rl=function(t){var e;let a=((e=this.getAttribute("bounds")?Ve(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),r=this.range.getBoundingClientRect(),o=t.offsetWidth,s=-(r.left-a.left-o/2),d=a.right-r.left-o/2;return{box:{width:o,min:s,max:d},bounds:a,range:r}};Cn=new WeakSet;xl=function(t,e){let i=`${e*100}%`,{width:a,min:r,max:o}=t.box;if(!a)return i;if(Number.isNaN(r)||(i=`max(${`calc(1 / var(--_range-width) * 100 * ${r}% + var(--media-box-padding-left))`}, ${i})`),!Number.isNaN(o)){let d=`calc(1 / var(--_range-width) * 100 * ${o}% - var(--media-box-padding-right))`;i=`min(${i}, ${d})`}return i};Ln=new WeakSet;Dl=function(t,e){let{width:i,min:a,max:r}=t.box,o=e*t.range.width;if(o<a+J(this,yr)){let s=t.range.left-t.bounds.left-J(this,yr);return`${o-i/2+s}px`}if(o>r-J(this,kr)){let s=t.bounds.right-t.range.right-J(this,kr);return`${o+i/2-s-t.range.width}px`}return 0};Ml=new WeakSet;Zc=function(t){let e=[...J(this,Sn)].some(T=>t.composedPath().includes(T));if(!this.dragging&&(e||!t.composedPath().includes(this))){de(this,Sr,wn).call(this,null);return}let i=this.mediaSeekableEnd;if(!i)return;let a=q(this.shadowRoot,"#preview-rail"),r=q(this.shadowRoot,'[part~="preview-box"]'),o=de(this,Mn,Rl).call(this,J(this,In)),s=(t.clientX-o.range.left)/o.range.width;s=Math.max(0,Math.min(1,s));let d=de(this,Cn,xl).call(this,o,s),u=de(this,Ln,Dl).call(this,o,s);a.style.transform=`translateX(${d})`,a.style.setProperty("--_range-width",`${o.range.width}`),r.style.setProperty("--_box-shift",`${u}`),r.style.setProperty("--_box-width",`${o.box.width}px`);let p=Math.round(J(this,Tr))-Math.round(s*i);Math.abs(p)<1&&s>.01&&s<.99||(Re(this,Tr,s*i),de(this,Sr,wn).call(this,J(this,Tr)))};Sr=new WeakSet;wn=function(t){this.dispatchEvent(new l.CustomEvent(m.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:t}))};Cl=new WeakSet;Qc=function(){J(this,di).stop();let t=zc(this);this.dispatchEvent(new l.CustomEvent(m.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t}))};Ir.shadowRootOptions={mode:"open"};Ir.getTemplateHTML=Zf;l.customElements.get("media-time-range")||l.customElements.define("media-time-range",Ir);var Qf=1,zf=t=>t.mediaMuted?0:t.mediaVolume,Xf=t=>`${Math.round(t*100)}%`,Ol=class extends Qe{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_VOLUME,n.MEDIA_MUTED,n.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,i=new l.CustomEvent(m.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",h("volume"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===n.MEDIA_VOLUME||e===n.MEDIA_MUTED)&&(this.range.valueAsNumber=zf(this),this.range.setAttribute("aria-valuetext",Xf(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return O(this,n.MEDIA_VOLUME,Qf)}set mediaVolume(e){N(this,n.MEDIA_VOLUME,e)}get mediaMuted(){return k(this,n.MEDIA_MUTED)}set mediaMuted(e){S(this,n.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return w(this,n.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){R(this,n.MEDIA_VOLUME_UNAVAILABLE,e)}};l.customElements.get("media-volume-range")||l.customElements.define("media-volume-range",Ol);function Jf(t){return`
|
|
1373
|
+
<style>
|
|
1374
|
+
:host {
|
|
1375
|
+
min-width: 4ch;
|
|
1376
|
+
padding: var(--media-button-padding, var(--media-control-padding, 10px 5px));
|
|
1377
|
+
width: 100%;
|
|
1378
|
+
display: grid;
|
|
1379
|
+
grid-template-columns: 1fr auto;
|
|
1380
|
+
gap: 1rem;
|
|
1381
|
+
font-weight: var(--media-button-font-weight, normal);
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
#checked-indicator {
|
|
1385
|
+
display: none;
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
:host([${n.MEDIA_LOOP}]) #checked-indicator {
|
|
1389
|
+
display: block;
|
|
1390
|
+
}
|
|
1391
|
+
</style>
|
|
1392
|
+
|
|
1393
|
+
<span id="icon">
|
|
1394
|
+
</span>
|
|
1395
|
+
|
|
1396
|
+
<div id="checked-indicator">
|
|
1397
|
+
<svg aria-hidden="true" viewBox="0 1 24 24" part="checked-indicator indicator">
|
|
1398
|
+
<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"/>
|
|
1399
|
+
</svg>
|
|
1400
|
+
</div>
|
|
1401
|
+
`}function jf(){return h("Loop")}var Mr=class extends U{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_LOOP]}connectedCallback(){var e;super.connectedCallback(),this.container=((e=this.shadowRoot)==null?void 0:e.querySelector("#icon"))||null,this.container&&(this.container.textContent=h("Loop"))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_LOOP&&this.container&&this.setAttribute("aria-checked",this.mediaLoop?"true":"false")}get mediaLoop(){return k(this,n.MEDIA_LOOP)}set mediaLoop(e){S(this,n.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,i=new l.CustomEvent(m.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};Mr.getSlotTemplateHTML=Jf;Mr.getTooltipContentHTML=jf;l.customElements.get("media-loop-button")||l.customElements.define("media-loop-button",Mr);var g=require("@mux/mux-video/base"),D=require("@mux/playback-core");var im=require("@mux/playback-core");var mi=require("@mux/playback-core");function Xc(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${Rn(i)}: ${a}; `)}),e?e.trim():void 0}function Rn(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function xn(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function ce(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function Pl(t){let e=ev(t).toString();return e?"?"+e:""}function ev(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var Nl=(t,e)=>!t||!e?!1:t.contains(e)?!0:Nl(t,e.getRootNode().host);var Jc="mux.com",tv=()=>{try{return"3.9.2"}catch{}return"UNKNOWN"},iv=tv(),On=()=>iv,jc=(t,{token:e,customDomain:i=Jc,thumbnailTime:a,programTime:r}={})=>{var d;let o=e==null?a:void 0,{aud:s}=(d=(0,mi.parseJwt)(e))!=null?d:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${Pl({token:e,time:o,program_time:r})}`},em=(t,{token:e,customDomain:i=Jc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:o}=(s=(0,mi.parseJwt)(e))!=null?s:{};if(!(e&&o!=="s"))return`https://image.${i}/${t}/storyboard.vtt${Pl({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Cr=t=>{if(t){if([mi.StreamTypes.LIVE,mi.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return mi.StreamTypes.LIVE}};var av={crossorigin:"crossOrigin",playsinline:"playsInline"};function tm(t){var e;return(e=av[t])!=null?e:xn(t)}var ui,ci,me,Dn=class{constructor(e,i){pe(this,ui);pe(this,ci);pe(this,me,[]);ye(this,ui,e),ye(this,ci,i)}[Symbol.iterator](){return H(this,me).values()}get length(){return H(this,me).length}get value(){var e;return(e=H(this,me).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(ye(this,me,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return H(this,me)[e]}values(){return H(this,me).values()}keys(){return H(this,me).keys()}forEach(e){H(this,me).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||H(this,me).push(r)}),!(this.value===""&&!((i=H(this,ui))!=null&&i.hasAttribute(`${H(this,ci)}`)))&&((a=H(this,ui))==null||a.setAttribute(`${H(this,ci)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{H(this,me).splice(H(this,me).indexOf(a),1)}),(i=H(this,ui))==null||i.setAttribute(`${H(this,ci)}`,`${this.value}`)}contains(e){return H(this,me).includes(e)}toggle(e,i){return typeof i!="undefined"?i?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,i){this.remove(e),this.add(i)}};ui=new WeakMap,ci=new WeakMap,me=new WeakMap;var am=`[mux-player ${On()}]`;function it(...t){console.warn(am,...t)}function ge(...t){console.error(am,...t)}function Ul(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,im.i18n)("Read more: ")}
|
|
1402
|
+
https://github.com/muxinc/elements/blob/main/errors/${t.file}`),it(e)}var le={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Pt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},nA={...le,...Pt},om=Object.freeze({length:0,start(t){let e=t>>>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(t){let e=t>>>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}}),rv=Object.values(le).filter(t=>le.PLAYSINLINE!==t),ov=Object.values(Pt),nv=[...rv,...ov],Hl=class extends ke.HTMLElement{static get observedAttributes(){return nv}constructor(){super()}attributeChangedCallback(e,i,a){var r,o;switch(e){case Pt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Pt.VOLUME:{let s=(r=ce(a))!=null?r:1;this.media&&(this.media.volume=s);return}case Pt.PLAYBACKRATE:{let s=(o=ce(a))!=null?o:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var e,i;return(i=(e=this.media)==null?void 0:e.play())!=null?i:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}load(){var e;(e=this.media)==null||e.load()}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,i;return(i=(e=this.media)==null?void 0:e.paused)!=null?i:!0}get duration(){var e,i;return(i=(e=this.media)==null?void 0:e.duration)!=null?i:NaN}get ended(){var e,i;return(i=(e=this.media)==null?void 0:e.ended)!=null?i:!1}get buffered(){var e,i;return(i=(e=this.media)==null?void 0:e.buffered)!=null?i:om}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:om}get readyState(){var e,i;return(i=(e=this.media)==null?void 0:e.readyState)!=null?i:0}get videoWidth(){var e,i;return(i=(e=this.media)==null?void 0:e.videoWidth)!=null?i:0}get videoHeight(){var e,i;return(i=(e=this.media)==null?void 0:e.videoHeight)!=null?i:0}get currentSrc(){var e,i;return(i=(e=this.media)==null?void 0:e.currentSrc)!=null?i:""}get currentTime(){var e,i;return(i=(e=this.media)==null?void 0:e.currentTime)!=null?i:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,i;return(i=(e=this.media)==null?void 0:e.volume)!=null?i:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,i;return(i=(e=this.media)==null?void 0:e.playbackRate)!=null?i:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=ce(this.getAttribute(Pt.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Pt.PLAYBACKRATE,`${e}`):this.removeAttribute(Pt.PLAYBACKRATE)}get crossOrigin(){return Lr(this,le.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(le.CROSSORIGIN,`${e}`)}get autoplay(){return Lr(this,le.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(le.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(le.AUTOPLAY)}get loop(){return Lr(this,le.LOOP)!=null}set loop(e){e?this.setAttribute(le.LOOP,""):this.removeAttribute(le.LOOP)}get muted(){var e,i;return(i=(e=this.media)==null?void 0:e.muted)!=null?i:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return Lr(this,le.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(le.MUTED,""):this.removeAttribute(le.MUTED)}get playsInline(){return Lr(this,le.PLAYSINLINE)!=null}set playsInline(e){ge("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(le.PRELOAD,e):this.removeAttribute(le.PRELOAD)}};function Lr(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var Bl=Hl;var um=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},P=(t,e,i)=>(um(t,e,"read from private field"),i?i.call(t):e.get(t)),at=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},gt=(t,e,i,a)=>(um(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ra,Pn,hi,wr,Nt,Ut,Ht,pi,oa,Nn,$e,nm=1,sm=0,sv=1,lv={processCallback(t,e,i){if(i){for(let[a,r]of e)if(a in i){let o=i[a];typeof o=="boolean"&&r instanceof he&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=o:typeof o=="function"&&r instanceof he?r.element[r.attributeName]=o:r.value=o}}}},_t=class extends l.DocumentFragment{constructor(e,i,a=lv){var r;super(),at(this,ra,void 0),at(this,Pn,void 0),this.append(e.content.cloneNode(!0)),gt(this,ra,cm(this)),gt(this,Pn,a),(r=a.createCallback)==null||r.call(a,this,P(this,ra),i),a.processCallback(this,P(this,ra),i)}update(e){P(this,Pn).processCallback(this,P(this,ra),e)}};ra=new WeakMap;Pn=new WeakMap;var cm=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let o=new $l;for([i,a]of dm(r.value))if(!i)o.append(a);else{let s=new he(t,r.name,r.namespaceURI);o.append(s),e.push([a,s])}r.value=o.toString()}for(let r of t.childNodes)if(r.nodeType===nm&&!(r instanceof HTMLTemplateElement))cm(r,e);else{let o=r.data;if(r.nodeType===nm||o.includes("{{")){let s=[];if(o)for([i,a]of dm(o))if(!i)s.push(new Text(a));else{let d=new At(t);s.push(d),e.push([a,d])}else if(r instanceof HTMLTemplateElement){let d=new Rr(t,r);s.push(d),e.push([d.expression,d])}r.replaceWith(...s.flatMap(d=>d.replacementNodes||[d]))}}return e},lm={},dm=t=>{let e="",i=0,a=lm[t],r=0,o;if(a)return a;for(a=[];o=t[r];r++)o==="{"&&t[r+1]==="{"&&t[r-1]!=="\\"&&t[r+2]&&++i==1?(e&&a.push([sm,e]),e="",r++):o==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([sv,e.trim()]),e="",r++):e+=o||"";return e&&a.push([sm,(i>0?"{{":"")+e]),lm[t]=a},dv=11,Un=class{get value(){return""}set value(e){}toString(){return this.value}},mm=new WeakMap,$l=class{constructor(){at(this,hi,[])}[Symbol.iterator](){return P(this,hi).values()}get length(){return P(this,hi).length}item(e){return P(this,hi)[e]}append(...e){for(let i of e)i instanceof he&&mm.set(i,this),P(this,hi).push(i)}toString(){return P(this,hi).join("")}};hi=new WeakMap;var he=class extends Un{constructor(e,i,a){super(),at(this,pi),at(this,wr,""),at(this,Nt,void 0),at(this,Ut,void 0),at(this,Ht,void 0),gt(this,Nt,e),gt(this,Ut,i),gt(this,Ht,a)}get attributeName(){return P(this,Ut)}get attributeNamespace(){return P(this,Ht)}get element(){return P(this,Nt)}get value(){return P(this,wr)}set value(e){P(this,wr)!==e&&(gt(this,wr,e),!P(this,pi,oa)||P(this,pi,oa).length===1?e==null?P(this,Nt).removeAttributeNS(P(this,Ht),P(this,Ut)):P(this,Nt).setAttributeNS(P(this,Ht),P(this,Ut),e):P(this,Nt).setAttributeNS(P(this,Ht),P(this,Ut),P(this,pi,oa).toString()))}get booleanValue(){return P(this,Nt).hasAttributeNS(P(this,Ht),P(this,Ut))}set booleanValue(e){if(!P(this,pi,oa)||P(this,pi,oa).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};wr=new WeakMap;Nt=new WeakMap;Ut=new WeakMap;Ht=new WeakMap;pi=new WeakSet;oa=function(){return mm.get(this)};var At=class extends Un{constructor(e,i){super(),at(this,Nn,void 0),at(this,$e,void 0),gt(this,Nn,e),gt(this,$e,i?[...i]:[new Text])}get replacementNodes(){return P(this,$e)}get parentNode(){return P(this,Nn)}get nextSibling(){return P(this,$e)[P(this,$e).length-1].nextSibling}get previousSibling(){return P(this,$e)[0].previousSibling}get value(){return P(this,$e).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let i=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===dv?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),gt(this,$e,uv(P(this,$e)[0].parentNode,P(this,$e),i,this.nextSibling))}};Nn=new WeakMap;$e=new WeakMap;var Rr=class extends At{constructor(e,i){let a=i.getAttribute("directive")||i.getAttribute("type"),r=i.getAttribute("expression")||i.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),this.expression=r,this.template=i,this.directive=a}};function uv(t,e,i,a=null){let r=0,o,s,d,u=i.length,p=e.length;for(;r<u&&r<p&&e[r]==i[r];)r++;for(;r<u&&r<p&&i[u-1]==e[p-1];)a=i[--p,--u];if(r==p)for(;r<u;)t.insertBefore(i[r++],a);if(r==u)for(;r<p;)t.removeChild(e[r++]);else{for(o=e[r];r<u;)d=i[r++],s=o?o.nextSibling:a,o==d?o=s:r<u&&i[r]==s?(t.replaceChild(d,o),o=s):t.insertBefore(d,o);for(;o!=a;)s=o.nextSibling,t.removeChild(o),o=s}return i}var hm={string:t=>String(t)},Bn=class{constructor(e){this.template=e,this.state=void 0}},fi=new WeakMap,vi=new WeakMap,Wl={partial:(t,e)=>{e[t.expression]=new Bn(t.template)},if:(t,e)=>{var i;if(fm(t.expression,e))if(fi.get(t)!==t.template){fi.set(t,t.template);let a=new _t(t.template,e,$n);t.replace(a),vi.set(t,a)}else(i=vi.get(t))==null||i.update(e);else t.replace(""),fi.delete(t),vi.delete(t)}},cv=Object.keys(Wl),$n={processCallback(t,e,i){var a,r;if(i)for(let[o,s]of e){if(s instanceof Rr){if(!s.directive){let u=cv.find(p=>s.template.hasAttribute(p));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=Wl[s.directive])==null||a.call(Wl,s,i);continue}let d=fm(o,i);if(d instanceof Bn){fi.get(s)!==d.template?(fi.set(s,d.template),d=new _t(d.template,d.state,$n),s.value=d,vi.set(s,d)):(r=vi.get(s))==null||r.update(d.state);continue}d?(s instanceof he&&s.attributeName.startsWith("aria-")&&(d=String(d)),s instanceof he?typeof d=="boolean"?s.booleanValue=d:typeof d=="function"?s.element[s.attributeName]=d:s.value=d:(s.value=d,fi.delete(s),vi.delete(s))):s instanceof he?s.value=void 0:(s.value=void 0,fi.delete(s),vi.delete(s))}}},pm={"!":t=>!t,"!!":t=>!!t,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,">":(t,e)=>t>e,">=":(t,e)=>t>=e,"<":(t,e)=>t<e,"<=":(t,e)=>t<=e,"??":(t,e)=>t!=null?t:e,"|":(t,e)=>{var i;return(i=hm[e])==null?void 0:i.call(hm,t)}};function mv(t){return hv(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function fm(t,e={}){var i,a,r,o,s,d,u;let p=mv(t);if(p.length===0||p.some(({type:T})=>!T))return xr(t);if(((i=p[0])==null?void 0:i.token)===">"){let T=e[(a=p[1])==null?void 0:a.token];if(!T)return xr(t);let _={...e};T.state=_;let E=p.slice(2);for(let f=0;f<E.length;f+=3){let I=(r=E[f])==null?void 0:r.token,b=(o=E[f+1])==null?void 0:o.token,M=(s=E[f+2])==null?void 0:s.token;I&&b==="="&&(_[I]=Dr(M,e))}return T}if(p.length===1)return Hn(p[0])?Dr(p[0].token,e):xr(t);if(p.length===2){let T=(d=p[0])==null?void 0:d.token,_=pm[T];if(!_||!Hn(p[1]))return xr(t);let E=Dr(p[1].token,e);return _(E)}if(p.length===3){let T=(u=p[1])==null?void 0:u.token,_=pm[T];if(!_||!Hn(p[0])||!Hn(p[2]))return xr(t);let E=Dr(p[0].token,e);if(T==="|")return _(E,p[2].token);let f=Dr(p[2].token,e);return _(E,f)}}function xr(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function Hn({type:t}){return["number","boolean","string","param"].includes(t)}function Dr(t,e){let i=t[0],a=t.slice(-1);return t==="true"||t==="false"?t==="true":i===a&&["'",'"'].includes(i)?t.slice(1,-1):lo(t)?parseFloat(t):e[t]}function hv(t,e){let i,a,r,o=[];for(;t;){r=null,i=t.length;for(let s in e)a=e[s].exec(t),a&&a.index<i&&(r={token:a[0],type:s,matches:a.slice(1)},i=a.index);i&&o.push({token:t.substr(0,i),type:void 0}),r&&o.push(r),t=t.substr(i+(r?r.token.length:0))}return o}var ql=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Kl=(t,e,i)=>(ql(t,e,"read from private field"),i?i.call(t):e.get(t)),Or=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Ei=(t,e,i,a)=>(ql(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Fl=(t,e,i)=>(ql(t,e,"access private method"),i),na,Wn,sa,Gl,vm,Fn,Yl,Vl={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Em=V.createElement("template");Em.innerHTML=`
|
|
1277
1403
|
<style>
|
|
1278
1404
|
:host {
|
|
1279
1405
|
display: inline-block;
|
|
@@ -1300,7 +1426,7 @@ https://github.com/muxinc/elements/blob/main/errors/${t.file}`),je(e)}var se={AU
|
|
|
1300
1426
|
display: none;
|
|
1301
1427
|
}
|
|
1302
1428
|
</style>
|
|
1303
|
-
`;var
|
|
1429
|
+
`;var bi=class extends l.HTMLElement{constructor(){super(),Or(this,Gl),Or(this,Fn),Or(this,na,void 0),Or(this,Wn,void 0),Or(this,sa,void 0),this.shadowRoot?this.renderRoot=this.shadowRoot:(this.renderRoot=this.attachShadow({mode:"open"}),this.createRenderer());let e=new MutationObserver(i=>{var a;this.mediaController&&!((a=this.mediaController)!=null&&a.breakpointsComputed)||i.some(r=>{let o=r.target;return o===this?!0:o.localName!=="media-controller"?!1:!!(Vl[r.attributeName]||r.attributeName.startsWith("breakpoint"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.addEventListener(Le.BREAKPOINTS_COMPUTED,this.render),Fl(this,Gl,vm).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=Kl(this,na))!=null?e:this.constructor.template}set template(e){if(e===null){this.removeAttribute("template");return}typeof e=="string"?this.setAttribute("template",e):e instanceof HTMLTemplateElement&&(Ei(this,na,e),Ei(this,sa,null),this.createRenderer())}get props(){var e,i,a;let r=[...Array.from((i=(e=this.mediaController)==null?void 0:e.attributes)!=null?i:[]).filter(({name:s})=>Vl[s]||s.startsWith("breakpoint")),...Array.from(this.attributes)],o={};for(let s of r){let d=(a=Vl[s.name])!=null?a:vu(s.name),{value:u}=s;u!=null?(lo(u)&&(u=parseFloat(u)),o[d]=u===""?!0:u):o[d]=!1}return o}attributeChangedCallback(e,i,a){e==="template"&&i!=a&&Fl(this,Fn,Yl).call(this)}connectedCallback(){Fl(this,Fn,Yl).call(this)}createRenderer(){this.template instanceof HTMLTemplateElement&&this.template!==Kl(this,Wn)&&(Ei(this,Wn,this.template),this.renderer=new _t(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(Em.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};na=new WeakMap;Wn=new WeakMap;sa=new WeakMap;Gl=new WeakSet;vm=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}};Fn=new WeakSet;Yl=function(){var t;let e=this.getAttribute("template");if(!e||e===Kl(this,sa))return;let i=this.getRootNode(),a=(t=i==null?void 0:i.getElementById)==null?void 0:t.call(i,e);if(a){Ei(this,sa,e),Ei(this,na,a),this.createRenderer();return}pv(e)&&(Ei(this,sa,e),fv(e).then(r=>{let o=V.createElement("template");o.innerHTML=r,Ei(this,na,o),this.createRenderer()}).catch(console.error))};bi.observedAttributes=["template"];bi.processor=$n;function pv(t){if(!/^(\/|\.\/|https?:\/\/)/.test(t))return!1;let e=/^https?:\/\//.test(t)?void 0:location.origin;try{new URL(t,e)}catch{return!1}return!0}async function fv(t){let e=await fetch(t);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",bi);var bm=`:host {
|
|
1304
1430
|
--media-control-display: var(--controls);
|
|
1305
1431
|
--media-loading-indicator-display: var(--loading-indicator);
|
|
1306
1432
|
--media-dialog-display: var(--dialog);
|
|
@@ -1450,69 +1576,69 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1450
1576
|
:host([no-tooltips]) {
|
|
1451
1577
|
--media-tooltip-display: none;
|
|
1452
1578
|
}
|
|
1453
|
-
`;var
|
|
1579
|
+
`;var Pr=new WeakMap,Ql=class t{constructor(e,i){this.element=e;this.type=i;this.element.addEventListener(this.type,this);let a=Pr.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 i=Pr.get(this.element);i&&i.delete(this.type)}}static for(e){Pr.has(e.element)||Pr.set(e.element,new Map);let i=e.attributeName.slice(2),a=Pr.get(e.element);return a&&a.has(i)?a.get(i):new t(e.element,i)}};function Ev(t,e){return t instanceof he&&t.attributeName.startsWith("on")?(Ql.for(t).set(e),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function bv(t,e){return e instanceof Vn&&t instanceof At?(e.renderInto(t),!0):!1}function gv(t,e){return e instanceof DocumentFragment&&t instanceof At?(e.childNodes.length&&t.replace(...e.childNodes),!0):!1}function _v(t,e){if(t instanceof he){let i=t.attributeNamespace,a=t.element.getAttributeNS(i,t.attributeName);return String(e)!==a&&(t.value=String(e)),!0}return t.value=String(e),!0}function Av(t,e){if(t instanceof he&&e instanceof Element){let i=t.element;return i[t.attributeName]!==e&&(t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),i[t.attributeName]=e),!0}return!1}function Tv(t,e){if(typeof e=="boolean"&&t instanceof he){let i=t.attributeNamespace,a=t.element.hasAttributeNS(i,t.attributeName);return e!==a&&(t.booleanValue=e),!0}return!1}function yv(t,e){return e===!1&&t instanceof At?(t.replace(""),!0):!1}function kv(t,e){Av(t,e)||Tv(t,e)||Ev(t,e)||yv(t,e)||bv(t,e)||gv(t,e)||_v(t,e)}var Zl=new Map,gm=new WeakMap,_m=new WeakMap,Vn=class{constructor(e,i,a){this.strings=e;this.values=i;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(Zl.has(this.stringsKey))return Zl.get(this.stringsKey);{let e=Gt.createElement("template"),i=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,o)=>a+r+(o<i?`{{ ${o} }}`:""),""),Zl.set(this.stringsKey,e),e}}renderInto(e){var r;let i=this.template;if(gm.get(e)!==i){gm.set(e,i);let o=new _t(i,this.values,this.processor);_m.set(e,o),e instanceof At?e.replace(...o.children):e.appendChild(o);return}let a=_m.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},Sv={processCallback(t,e,i){var a;if(i){for(let[r,o]of e)if(r in i){let s=(a=i[r])!=null?a:"";kv(o,s)}}}};function Nr(t,...e){return new Vn(t,e,Sv)}function Am(t,e){t.renderInto(e)}var Ur=require("@mux/playback-core"),Iv=t=>{let{tokens:e}=t;return e.drm?":host(:not([cast-receiver])) { --_cast-button-drm-display: none; }":""},Tm=t=>Nr`
|
|
1454
1580
|
<style>
|
|
1455
|
-
${
|
|
1456
|
-
${
|
|
1581
|
+
${Iv(t)}
|
|
1582
|
+
${bm}
|
|
1457
1583
|
</style>
|
|
1458
|
-
${
|
|
1459
|
-
`,
|
|
1584
|
+
${wv(t)}
|
|
1585
|
+
`,Mv=t=>{let e=t.hotKeys?`${t.hotKeys}`:"";return Cr(t.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},Cv={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",THUMB:"thumb",DISPLAY:"display",CONTROL_BAR:"control-bar",MENU_BUTTON:"menu-button",MENU:"menu",MENU_ITEM:"menu-item",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"},Lv=Object.values(Cv).join(", "),wv=t=>{var e,i,a,r,o,s,d,u,p,T,_,E,f,I,b,M,C,ie,Ae,kt,ct,Ia,Ma,Ca,La,wa,Ra,xa,Da,Oa,Pa,Na,oo,mt,Ua,Ha,Ba;return Nr`
|
|
1460
1586
|
<media-theme
|
|
1461
1587
|
template="${t.themeTemplate||!1}"
|
|
1462
1588
|
defaultstreamtype="${(e=t.defaultStreamType)!=null?e:!1}"
|
|
1463
|
-
hotkeys="${
|
|
1589
|
+
hotkeys="${Mv(t)||!1}"
|
|
1464
1590
|
nohotkeys="${t.noHotKeys||!t.hasSrc||!1}"
|
|
1465
|
-
noautoseektolive="${!!((i=t.streamType)!=null&&i.includes(
|
|
1591
|
+
noautoseektolive="${!!((i=t.streamType)!=null&&i.includes(Ur.StreamTypes.LIVE))&&t.targetLiveWindow!==0}"
|
|
1466
1592
|
novolumepref="${t.novolumepref||!1}"
|
|
1467
1593
|
nomutedpref="${t.nomutedpref||!1}"
|
|
1468
1594
|
disabled="${!t.hasSrc||t.isDialogOpen}"
|
|
1469
1595
|
audio="${(a=t.audio)!=null?a:!1}"
|
|
1470
|
-
style="${(r
|
|
1596
|
+
style="${(r=Xc({"--media-primary-color":t.primaryColor,"--media-secondary-color":t.secondaryColor,"--media-accent-color":t.accentColor}))!=null?r:!1}"
|
|
1471
1597
|
defaultsubtitles="${!t.defaultHiddenCaptions}"
|
|
1472
1598
|
forwardseekoffset="${(o=t.forwardSeekOffset)!=null?o:!1}"
|
|
1473
1599
|
backwardseekoffset="${(s=t.backwardSeekOffset)!=null?s:!1}"
|
|
1474
1600
|
playbackrates="${(d=t.playbackRates)!=null?d:!1}"
|
|
1475
1601
|
defaultshowremainingtime="${(u=t.defaultShowRemainingTime)!=null?u:!1}"
|
|
1476
|
-
defaultduration="${(
|
|
1602
|
+
defaultduration="${(p=t.defaultDuration)!=null?p:!1}"
|
|
1477
1603
|
hideduration="${(T=t.hideDuration)!=null?T:!1}"
|
|
1478
|
-
title="${(
|
|
1479
|
-
videotitle="${(
|
|
1480
|
-
proudlydisplaymuxbadge="${(
|
|
1481
|
-
exportparts="${
|
|
1604
|
+
title="${(_=t.title)!=null?_:!1}"
|
|
1605
|
+
videotitle="${(E=t.videoTitle)!=null?E:!1}"
|
|
1606
|
+
proudlydisplaymuxbadge="${(f=t.proudlyDisplayMuxBadge)!=null?f:!1}"
|
|
1607
|
+
exportparts="${Lv}"
|
|
1482
1608
|
onclose="${t.onCloseErrorDialog}"
|
|
1483
1609
|
onfocusin="${t.onFocusInErrorDialog}"
|
|
1484
1610
|
>
|
|
1485
1611
|
<mux-video
|
|
1486
1612
|
slot="media"
|
|
1487
1613
|
inert="${(I=t.noHotKeys)!=null?I:!1}"
|
|
1488
|
-
target-live-window="${(
|
|
1489
|
-
stream-type="${(
|
|
1490
|
-
crossorigin="${(
|
|
1614
|
+
target-live-window="${(b=t.targetLiveWindow)!=null?b:!1}"
|
|
1615
|
+
stream-type="${(M=Cr(t.streamType))!=null?M:!1}"
|
|
1616
|
+
crossorigin="${(C=t.crossOrigin)!=null?C:""}"
|
|
1491
1617
|
playsinline
|
|
1492
|
-
autoplay="${(
|
|
1493
|
-
muted="${(
|
|
1494
|
-
loop="${(
|
|
1495
|
-
preload="${(
|
|
1496
|
-
debug="${(
|
|
1497
|
-
prefer-cmcd="${(
|
|
1498
|
-
disable-tracking="${(
|
|
1499
|
-
disable-cookies="${(
|
|
1500
|
-
prefer-playback="${(
|
|
1618
|
+
autoplay="${(ie=t.autoplay)!=null?ie:!1}"
|
|
1619
|
+
muted="${(Ae=t.muted)!=null?Ae:!1}"
|
|
1620
|
+
loop="${(kt=t.loop)!=null?kt:!1}"
|
|
1621
|
+
preload="${(ct=t.preload)!=null?ct:!1}"
|
|
1622
|
+
debug="${(Ia=t.debug)!=null?Ia:!1}"
|
|
1623
|
+
prefer-cmcd="${(Ma=t.preferCmcd)!=null?Ma:!1}"
|
|
1624
|
+
disable-tracking="${(Ca=t.disableTracking)!=null?Ca:!1}"
|
|
1625
|
+
disable-cookies="${(La=t.disableCookies)!=null?La:!1}"
|
|
1626
|
+
prefer-playback="${(wa=t.preferPlayback)!=null?wa:!1}"
|
|
1501
1627
|
start-time="${t.startTime!=null?t.startTime:!1}"
|
|
1502
|
-
beacon-collection-domain="${(
|
|
1503
|
-
player-init-time="${(
|
|
1504
|
-
player-software-name="${(
|
|
1505
|
-
player-software-version="${(
|
|
1506
|
-
env-key="${(
|
|
1507
|
-
custom-domain="${(
|
|
1508
|
-
src="${t.src?t.src:t.playbackId?(0,
|
|
1509
|
-
cast-src="${t.src?t.src:t.playbackId?(0,
|
|
1510
|
-
cast-receiver="${(
|
|
1511
|
-
drm-token="${(
|
|
1628
|
+
beacon-collection-domain="${(Ra=t.beaconCollectionDomain)!=null?Ra:!1}"
|
|
1629
|
+
player-init-time="${(xa=t.playerInitTime)!=null?xa:!1}"
|
|
1630
|
+
player-software-name="${(Da=t.playerSoftwareName)!=null?Da:!1}"
|
|
1631
|
+
player-software-version="${(Oa=t.playerSoftwareVersion)!=null?Oa:!1}"
|
|
1632
|
+
env-key="${(Pa=t.envKey)!=null?Pa:!1}"
|
|
1633
|
+
custom-domain="${(Na=t.customDomain)!=null?Na:!1}"
|
|
1634
|
+
src="${t.src?t.src:t.playbackId?(0,Ur.toMuxVideoURL)(t):!1}"
|
|
1635
|
+
cast-src="${t.src?t.src:t.playbackId?(0,Ur.toMuxVideoURL)(t):!1}"
|
|
1636
|
+
cast-receiver="${(oo=t.castReceiver)!=null?oo:!1}"
|
|
1637
|
+
drm-token="${(Ua=(mt=t.tokens)==null?void 0:mt.drm)!=null?Ua:!1}"
|
|
1512
1638
|
exportparts="video"
|
|
1513
|
-
disable-pseudo-ended="${(
|
|
1639
|
+
disable-pseudo-ended="${(Ha=t.disablePseudoEnded)!=null?Ha:!1}"
|
|
1514
1640
|
>
|
|
1515
|
-
${t.storyboard?
|
|
1641
|
+
${t.storyboard?Nr`<track label="thumbnails" default kind="metadata" src="${t.storyboard}" />`:Nr``}
|
|
1516
1642
|
<slot></slot>
|
|
1517
1643
|
</mux-video>
|
|
1518
1644
|
<slot name="poster" slot="poster">
|
|
@@ -1520,11 +1646,11 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1520
1646
|
part="poster"
|
|
1521
1647
|
exportparts="poster, img"
|
|
1522
1648
|
src="${t.poster?t.poster:!1}"
|
|
1523
|
-
placeholdersrc="${(
|
|
1649
|
+
placeholdersrc="${(Ba=t.placeholder)!=null?Ba:!1}"
|
|
1524
1650
|
></media-poster-image>
|
|
1525
1651
|
</slot>
|
|
1526
1652
|
</media-theme>
|
|
1527
|
-
`};var
|
|
1653
|
+
`};var A=require("@mux/playback-core"),ym=t=>t.charAt(0).toUpperCase()+t.slice(1),Rv=(t,e=!1)=>{var i,a;if(t.muxCode){let r=ym((i=t.errorCategory)!=null?i:"video"),o=(0,A.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:A.MuxErrorCategory.VIDEO);if(t.muxCode===A.MuxErrorCode.NETWORK_OFFLINE)return(0,A.i18n)("Your device appears to be offline",e);if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return(0,A.i18n)("{category} URL has expired",e).format({category:r});if([A.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING,A.MuxErrorCode.NETWORK_TOKEN_MALFORMED].includes(t.muxCode))return(0,A.i18n)("{category} URL is formatted incorrectly",e).format({category:r});if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MISSING)return(0,A.i18n)("Invalid {categoryName} URL",e).format({categoryName:o});if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_FOUND)return(0,A.i18n)("{category} does not exist",e).format({category:r});if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_READY){let s=t.streamType==="live"?"Live stream":"Video";return(0,A.i18n)("{mediaType} is not currently available",e).format({mediaType:s})}}if(t.code){if(t.code===A.MediaError.MEDIA_ERR_NETWORK)return(0,A.i18n)("Network Error",e);if(t.code===A.MediaError.MEDIA_ERR_DECODE)return(0,A.i18n)("Media Error",e);if(t.code===A.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return(0,A.i18n)("Source Not Supported",e)}return(0,A.i18n)("Error",e)},xv=(t,e=!1)=>{var i,a;if(t.muxCode){let r=ym((i=t.errorCategory)!=null?i:"video"),o=(0,A.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:A.MuxErrorCategory.VIDEO);return t.muxCode===A.MuxErrorCode.NETWORK_OFFLINE?(0,A.i18n)("Check your internet connection and try reloading this video.",e):t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_EXPIRED?(0,A.i18n)("The video\u2019s secured {tokenNamePrefix}-token has expired.",e).format({tokenNamePrefix:o}):t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH?(0,A.i18n)("The video\u2019s playback ID does not match the one encoded in the {tokenNamePrefix}-token.",e).format({tokenNamePrefix:o}):t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MALFORMED?(0,A.i18n)("{category} URL is formatted incorrectly",e).format({category:r}):[A.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode)?(0,A.i18n)("The {tokenNamePrefix}-token is formatted with incorrect information.",e).format({tokenNamePrefix:o}):[A.MuxErrorCode.NETWORK_TOKEN_MISSING,A.MuxErrorCode.NETWORK_INVALID_URL].includes(t.muxCode)?(0,A.i18n)("The video URL or {tokenNamePrefix}-token are formatted with incorrect or incomplete information.",e).format({tokenNamePrefix:o}):t.muxCode===A.MuxErrorCode.NETWORK_NOT_FOUND?"":t.message}return t.code&&(t.code===A.MediaError.MEDIA_ERR_NETWORK||t.code===A.MediaError.MEDIA_ERR_DECODE||t.code===A.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED),t.message},km=(t,e=!1)=>{let i=Rv(t,e).toString(),a=xv(t,e).toString();return{title:i,message:a}},Dv=t=>{if(t.muxCode){if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return"403-expired-token.md";if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MALFORMED)return"403-malformatted-token.md";if([A.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,A.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode))return"403-incorrect-aud-value.md";if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH)return"403-playback-id-mismatch.md";if(t.muxCode===A.MuxErrorCode.NETWORK_TOKEN_MISSING)return"missing-signed-tokens.md";if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_FOUND)return"404-not-found.md";if(t.muxCode===A.MuxErrorCode.NETWORK_NOT_READY)return"412-not-playable.md"}if(t.code){if(t.code===A.MediaError.MEDIA_ERR_NETWORK)return"";if(t.code===A.MediaError.MEDIA_ERR_DECODE)return"media-decode-error.md";if(t.code===A.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return"media-src-not-supported.md"}return""},zl=(t,e)=>{let i=Dv(t);return{message:t.message,context:t.context,file:i}};var Sm=`<template id="media-theme-gerwig">
|
|
1528
1654
|
<style>
|
|
1529
1655
|
@keyframes pre-play-hide {
|
|
1530
1656
|
0% {
|
|
@@ -2656,7 +2782,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
2656
2782
|
<slot></slot>
|
|
2657
2783
|
</media-controller>
|
|
2658
2784
|
</template>
|
|
2659
|
-
`;function
|
|
2785
|
+
`;function Im({anchor:t,floating:e,placement:i}){let a=Pv({anchor:t,floating:e}),{x:r,y:o}=Uv(a,i);return{x:r,y:o}}function Pv({anchor:t,floating:e}){return{anchor:Nv(t,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function Nv(t,e){var i;let a=t.getBoundingClientRect(),r=(i=e==null?void 0:e.getBoundingClientRect())!=null?i:{x:0,y:0};return{x:a.x-r.x,y:a.y-r.y,width:a.width,height:a.height}}function Uv({anchor:t,floating:e},i){let a=Hv(i)==="x"?"y":"x",r=a==="y"?"height":"width",o=Mm(i),s=t.x+t.width/2-e.width/2,d=t.y+t.height/2-e.height/2,u=t[r]/2-e[r]/2,p;switch(o){case"top":p={x:s,y:t.y-e.height};break;case"bottom":p={x:s,y:t.y+t.height};break;case"right":p={x:t.x+t.width,y:d};break;case"left":p={x:t.x-e.width,y:d};break;default:p={x:t.x,y:t.y}}switch(i.split("-")[1]){case"start":p[a]-=u;break;case"end":p[a]+=u;break}return p}function Mm(t){return t.split("-")[0]}function Hv(t){return["top","bottom"].includes(Mm(t))?"y":"x"}var Bt=class extends Event{constructor({action:e="auto",relatedTarget:i,...a}){super("invoke",a),this.action=e,this.relatedTarget=i}},Kn=class extends Event{constructor({newState:e,oldState:i,...a}){super("toggle",a),this.newState=e,this.oldState=i}};var ld=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},B=(t,e,i)=>(ld(t,e,"read from private field"),i?i.call(t):e.get(t)),K=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},rt=(t,e,i,a)=>(ld(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),G=(t,e,i)=>(ld(t,e,"access private method"),i),ot,_i,$t,Gn,Yn,Ai,$r,Xl,Cm,Qn,dd,zn,qn,Jl,jl,Lm,ed,wm,td,Rm,la,da,ua,Wr,Xn,ud,id,xm,cd,Dm,ad,Om,md,Pm,rd,Nm,od,Um,Hr,Jn,nd,Hm,Br,jn,Zn,sd;function nt({type:t,text:e,value:i,checked:a}){let r=V.createElement("media-chrome-menu-item");r.type=t!=null?t:"",r.part.add("menu-item"),t&&r.part.add(t),r.value=i,r.checked=a;let o=V.createElement("span");return o.textContent=e,r.append(o),r}function We(t,e){let i=t.querySelector(`:scope > [slot="${e}"]`);if((i==null?void 0:i.nodeName)=="SLOT"&&(i=i.assignedElements({flatten:!0})[0]),i)return i=i.cloneNode(!0),i;let a=t.shadowRoot.querySelector(`[name="${e}"] > svg`);return a?a.cloneNode(!0):""}function Bv(t){return`
|
|
2660
2786
|
<style>
|
|
2661
2787
|
:host {
|
|
2662
2788
|
font: var(--media-font,
|
|
@@ -2831,7 +2957,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
2831
2957
|
<slot></slot>
|
|
2832
2958
|
</div>
|
|
2833
2959
|
<slot name="checked-indicator" hidden></slot>
|
|
2834
|
-
`}var vi={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},j=class extends l.HTMLElement{constructor(){if(super(),V(this,$l),V(this,$n),V(this,Hn),V(this,Fl),V(this,Vl),V(this,Kl),V(this,oa),V(this,Fn),V(this,Gl),V(this,ed),V(this,Yl),V(this,td),V(this,ql),V(this,Zl),V(this,wr),V(this,Ql),V(this,Rr),V(this,Bn),V(this,it,null),V(this,Ei,null),V(this,Ht,null),V(this,Pn,new Set),V(this,Un,void 0),V(this,bi,!1),V(this,xr,null),V(this,Wn,()=>{let e=H(this,Pn),i=new Set(this.items);for(let a of e)i.has(a)||this.dispatchEvent(new CustomEvent("removemenuitem",{detail:a}));for(let a of i)e.has(a)||this.dispatchEvent(new CustomEvent("addmenuitem",{detail:a}));tt(this,Pn,i)}),V(this,aa,()=>{K(this,oa,Dr).call(this),K(this,Fn,jl).call(this,!1)}),V(this,ra,()=>{K(this,oa,Dr).call(this)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),tt(this,Un,new MutationObserver(H(this,Wn))),H(this,Un).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[vi.DISABLED,vi.HIDDEN,vi.STYLE,vi.ANCHOR,w.MEDIA_CONTROLLER]}static formatMenuItemText(e,i){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":K(this,$l,Em).call(this,e);break;case"invoke":K(this,Fl,bm).call(this,e);break;case"click":K(this,Gl,Am).call(this,e);break;case"toggle":K(this,Yl,ym).call(this,e);break;case"focusout":K(this,ql,Sm).call(this,e);break;case"keydown":K(this,Zl,Im).call(this,e);break}}connectedCallback(){var e,i;tt(this,xr,Ss(this.shadowRoot,":host")),K(this,Hn,Wl).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),tt(this,it,oo(this)),(i=(e=H(this,it))==null?void 0:e.associateElement)==null||i.call(e,this),this.hidden||(ut(Or(this),H(this,aa)),ut(this,H(this,ra))),K(this,$n,Jl).call(this)}disconnectedCallback(){var e,i;ct(Or(this),H(this,aa)),ct(this,H(this,ra)),this.disable(),(i=(e=H(this,it))==null?void 0:e.unassociateElement)==null||i.call(e,this),tt(this,it,null)}attributeChangedCallback(e,i,a){var r,o,s,d;e===vi.HIDDEN&&a!==i?(H(this,bi)||tt(this,bi,!0),this.hidden?K(this,Kl,_m).call(this):K(this,Vl,gm).call(this),this.dispatchEvent(new Nn({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===w.MEDIA_CONTROLLER?(i&&((o=(r=H(this,it))==null?void 0:r.unassociateElement)==null||o.call(r,this),tt(this,it,null)),a&&this.isConnected&&(tt(this,it,oo(this)),(d=(s=H(this,it))==null?void 0:s.associateElement)==null||d.call(s,this))):e===vi.DISABLED&&a!==i?a==null?this.enable():this.disable():e===vi.STYLE&&a!==i&&K(this,Hn,Wl).call(this)}formatMenuItemText(e,i){return this.constructor.formatMenuItemText(e,i)}get anchor(){return this.getAttribute("anchor")}set anchor(e){this.setAttribute("anchor",`${e}`)}get anchorElement(){var e;return this.anchor?(e=Gt(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(yv)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,i;return(i=(e=this.checkedItems[0])==null?void 0:e.value)!=null?i:""}set value(e){let i=this.items.find(a=>a.value===e);i&&K(this,Bn,zl).call(this,i)}focus(){if(tt(this,Ei,Ua()),this.items.length){K(this,Rr,Kn).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 i;let a=K(this,wr,Vn).call(this,e);a&&(K(this,Bn,zl).call(this,a,a.type==="checkbox"),H(this,Ht)&&!this.hidden&&((i=H(this,Ei))==null||i.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var i,a;let{key:r}=e,o=this.items,s=(a=(i=K(this,wr,Vn).call(this,e))!=null?i:K(this,Ql,Mm).call(this))!=null?a:o[0],d=o.indexOf(s),u=Math.max(0,d);r==="ArrowDown"?u++:r==="ArrowUp"?u--:e.key==="Home"?u=0:e.key==="End"&&(u=o.length-1),u<0&&(u=o.length-1),u>o.length-1&&(u=0),K(this,Rr,Kn).call(this,o[u]),o[u].focus()}};it=new WeakMap;Ei=new WeakMap;Ht=new WeakMap;Pn=new WeakMap;Un=new WeakMap;bi=new WeakMap;xr=new WeakMap;$l=new WeakSet;Em=function(t){let e=t.target;for(let i of e.assignedNodes({flatten:!0}))i.nodeType===3&&i.textContent.trim()===""&&i.remove();["header","title"].includes(e.name)&&K(this,$n,Jl).call(this),e.name||H(this,Wn).call(this)};$n=new WeakSet;Jl=function(){let t=this.shadowRoot.querySelector('slot[name="header"]'),e=this.shadowRoot.querySelector('slot[name="title"]');t.hidden=e.assignedNodes().length===0&&t.assignedNodes().length===0};Wn=new WeakMap;Hn=new WeakSet;Wl=function(){var t;let e=this.shadowRoot.querySelector("#layout-row"),i=(t=getComputedStyle(this).getPropertyValue("--media-menu-layout"))==null?void 0:t.trim();e.setAttribute("media",i==="row"?"":"width:0")};Fl=new WeakSet;bm=function(t){tt(this,Ht,t.relatedTarget),de(this,t.relatedTarget)||(this.hidden=!this.hidden)};Vl=new WeakSet;gm=function(){var t;(t=H(this,Ht))==null||t.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),ut(Or(this),H(this,aa)),ut(this,H(this,ra))};Kl=new WeakSet;_m=function(){var t;(t=H(this,Ht))==null||t.setAttribute("aria-expanded","false"),ct(Or(this),H(this,aa)),ct(this,H(this,ra))};aa=new WeakMap;ra=new WeakMap;oa=new WeakSet;Dr=function(t){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:i}=fm({anchor:this.anchorElement,floating:this,placement:"top-start"});t!=null||(t=this.offsetWidth);let r=Or(this).getBoundingClientRect(),o=r.width-e-t,s=r.height-i-this.offsetHeight,{style:d}=H(this,xr);d.setProperty("position","absolute"),d.setProperty("right",`${Math.max(0,o)}px`),d.setProperty("--_menu-bottom",`${s}px`);let u=getComputedStyle(this),T=d.getPropertyValue("--_menu-bottom")===u.bottom?s:parseFloat(u.bottom),g=r.height-T-parseFloat(u.marginBottom);this.style.setProperty("--_menu-max-height",`${g}px`)};Fn=new WeakSet;jl=function(t){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),i=e==null?void 0:e.querySelector('[role="menu"]'),{style:a}=H(this,xr);if(t||a.setProperty("--media-menu-transition-in","none"),i){let r=i.offsetHeight,o=Math.max(i.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${o}px`),this.style.setProperty("min-height",`${r}px`),K(this,oa,Dr).call(this,o)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),K(this,oa,Dr).call(this);a.removeProperty("--media-menu-transition-in")};Gl=new WeakSet;Am=function(t){var e;if(t.stopPropagation(),t.composedPath().includes(H(this,ed,Tm))){(e=H(this,Ei))==null||e.focus(),this.hidden=!0;return}let i=K(this,wr,Vn).call(this,t);!i||i.hasAttribute("disabled")||(K(this,Rr,Kn).call(this,i),this.handleSelect(t))};ed=new WeakSet;Tm=function(){var t;return(t=this.shadowRoot.querySelector('slot[name="header"]').assignedElements({flatten:!0}))==null?void 0:t.find(i=>i.matches('button[part~="back"]'))};Yl=new WeakSet;ym=function(t){if(t.target===this)return;K(this,td,km).call(this);let e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]'));for(let i of e)i.invokeTargetElement!=t.target&&t.newState=="open"&&i.getAttribute("aria-expanded")=="true"&&!i.invokeTargetElement.hidden&&i.invokeTargetElement.dispatchEvent(new Ut({relatedTarget:i}));for(let i of e)i.setAttribute("aria-expanded",`${!i.submenuElement.hidden}`);K(this,Fn,jl).call(this,!0)};td=new WeakSet;km=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};ql=new WeakSet;Sm=function(t){var e;de(this,t.relatedTarget)||(H(this,bi)&&((e=H(this,Ei))==null||e.focus()),H(this,Ht)&&H(this,Ht)!==t.relatedTarget&&!this.hidden&&(this.hidden=!0))};Zl=new WeakSet;Im=function(t){var e,i,a,r,o;let{key:s,ctrlKey:d,altKey:u,metaKey:h}=t;if(!(d||u||h)&&this.keysUsed.includes(s))if(t.preventDefault(),t.stopPropagation(),s==="Tab"){if(H(this,bi)){this.hidden=!0;return}t.shiftKey?(i=(e=this.previousElementSibling)==null?void 0:e.focus)==null||i.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()}else s==="Escape"?((o=H(this,Ei))==null||o.focus(),H(this,bi)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(t):this.handleMove(t)};wr=new WeakSet;Vn=function(t){return t.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};Ql=new WeakSet;Mm=function(){return this.items.find(t=>t.tabIndex===0)};Rr=new WeakSet;Kn=function(t){for(let e of this.items)e.tabIndex=e===t?0:-1};Bn=new WeakSet;zl=function(t,e){let i=[...this.checkedItems];t.type==="radio"&&this.radioGroupItems.forEach(a=>a.checked=!1),e?t.checked=!t.checked:t.checked=!0,this.checkedItems.some((a,r)=>a!=i[r])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};j.shadowRootOptions={mode:"open"};j.getTemplateHTML=Tv;function yv(t){return["menuitem","menuitemradio","menuitemcheckbox"].includes(t==null?void 0:t.role)}function Or(t){var e;return(e=t.getAttribute("bounds")?Fe(t,`#${t.getAttribute("bounds")}`):q(t)||t.parentElement)!=null?e:t}l.customElements.get("media-chrome-menu")||l.customElements.define("media-chrome-menu",j);var sd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},rt=(t,e,i)=>(sd(t,e,"read from private field"),i?i.call(t):e.get(t)),gt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},id=(t,e,i,a)=>(sd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),We=(t,e,i)=>(sd(t,e,"access private method"),i),Gn,Pr,ad,Cm,qn,ld,dd,Lm,ot,na,Ur,rd,wm,Yn,od;function kv(t){return`
|
|
2960
|
+
`}var gi={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},j=class extends l.HTMLElement{constructor(){if(super(),K(this,Xl),K(this,Qn),K(this,qn),K(this,jl),K(this,ed),K(this,td),K(this,ua),K(this,Xn),K(this,id),K(this,cd),K(this,ad),K(this,md),K(this,rd),K(this,od),K(this,Hr),K(this,nd),K(this,Br),K(this,Zn),K(this,ot,null),K(this,_i,null),K(this,$t,null),K(this,Gn,new Set),K(this,Yn,void 0),K(this,Ai,!1),K(this,$r,null),K(this,zn,()=>{let e=B(this,Gn),i=new Set(this.items);for(let a of e)i.has(a)||this.dispatchEvent(new CustomEvent("removemenuitem",{detail:a}));for(let a of i)e.has(a)||this.dispatchEvent(new CustomEvent("addmenuitem",{detail:a}));rt(this,Gn,i)}),K(this,la,()=>{G(this,ua,Wr).call(this),G(this,Xn,ud).call(this,!1)}),K(this,da,()=>{G(this,ua,Wr).call(this)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.container=this.shadowRoot.querySelector("#container"),this.defaultSlot=this.shadowRoot.querySelector("slot:not([name])"),this.shadowRoot.addEventListener("slotchange",this),rt(this,Yn,new MutationObserver(B(this,zn))),B(this,Yn).observe(this.defaultSlot,{childList:!0})}static get observedAttributes(){return[gi.DISABLED,gi.HIDDEN,gi.STYLE,gi.ANCHOR,x.MEDIA_CONTROLLER]}static formatMenuItemText(e,i){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":G(this,Xl,Cm).call(this,e);break;case"invoke":G(this,jl,Lm).call(this,e);break;case"click":G(this,id,xm).call(this,e);break;case"toggle":G(this,ad,Om).call(this,e);break;case"focusout":G(this,rd,Nm).call(this,e);break;case"keydown":G(this,od,Um).call(this,e);break}}connectedCallback(){var e,i;rt(this,$r,Ga(this.shadowRoot,":host")),G(this,qn,Jl).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),rt(this,ot,po(this)),(i=(e=B(this,ot))==null?void 0:e.associateElement)==null||i.call(e,this),this.hidden||(ht(Fr(this),B(this,la)),ht(this,B(this,da))),G(this,Qn,dd).call(this)}disconnectedCallback(){var e,i;pt(Fr(this),B(this,la)),pt(this,B(this,da)),this.disable(),(i=(e=B(this,ot))==null?void 0:e.unassociateElement)==null||i.call(e,this),rt(this,ot,null)}attributeChangedCallback(e,i,a){var r,o,s,d;e===gi.HIDDEN&&a!==i?(B(this,Ai)||rt(this,Ai,!0),this.hidden?G(this,td,Rm).call(this):G(this,ed,wm).call(this),this.dispatchEvent(new Kn({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===x.MEDIA_CONTROLLER?(i&&((o=(r=B(this,ot))==null?void 0:r.unassociateElement)==null||o.call(r,this),rt(this,ot,null)),a&&this.isConnected&&(rt(this,ot,po(this)),(d=(s=B(this,ot))==null?void 0:s.associateElement)==null||d.call(s,this))):e===gi.DISABLED&&a!==i?a==null?this.enable():this.disable():e===gi.STYLE&&a!==i&&G(this,qn,Jl).call(this)}formatMenuItemText(e,i){return this.constructor.formatMenuItemText(e,i)}get anchor(){return this.getAttribute("anchor")}set anchor(e){this.setAttribute("anchor",`${e}`)}get anchorElement(){var e;return this.anchor?(e=qt(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter($v)}get radioGroupItems(){return this.items.filter(e=>e.role==="menuitemradio")}get checkedItems(){return this.items.filter(e=>e.checked)}get value(){var e,i;return(i=(e=this.checkedItems[0])==null?void 0:e.value)!=null?i:""}set value(e){let i=this.items.find(a=>a.value===e);i&&G(this,Zn,sd).call(this,i)}focus(){if(rt(this,_i,Ka()),this.items.length){G(this,Br,jn).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 i;let a=G(this,Hr,Jn).call(this,e);a&&(G(this,Zn,sd).call(this,a,a.type==="checkbox"),B(this,$t)&&!this.hidden&&((i=B(this,_i))==null||i.focus(),this.hidden=!0))}get keysUsed(){return["Enter","Escape","Tab"," ","ArrowDown","ArrowUp","Home","End"]}handleMove(e){var i,a;let{key:r}=e,o=this.items,s=(a=(i=G(this,Hr,Jn).call(this,e))!=null?i:G(this,nd,Hm).call(this))!=null?a:o[0],d=o.indexOf(s),u=Math.max(0,d);r==="ArrowDown"?u++:r==="ArrowUp"?u--:e.key==="Home"?u=0:e.key==="End"&&(u=o.length-1),u<0&&(u=o.length-1),u>o.length-1&&(u=0),G(this,Br,jn).call(this,o[u]),o[u].focus()}};ot=new WeakMap;_i=new WeakMap;$t=new WeakMap;Gn=new WeakMap;Yn=new WeakMap;Ai=new WeakMap;$r=new WeakMap;Xl=new WeakSet;Cm=function(t){let e=t.target;for(let i of e.assignedNodes({flatten:!0}))i.nodeType===3&&i.textContent.trim()===""&&i.remove();["header","title"].includes(e.name)&&G(this,Qn,dd).call(this),e.name||B(this,zn).call(this)};Qn=new WeakSet;dd=function(){let t=this.shadowRoot.querySelector('slot[name="header"]'),e=this.shadowRoot.querySelector('slot[name="title"]');t.hidden=e.assignedNodes().length===0&&t.assignedNodes().length===0};zn=new WeakMap;qn=new WeakSet;Jl=function(){var t;let e=this.shadowRoot.querySelector("#layout-row"),i=(t=getComputedStyle(this).getPropertyValue("--media-menu-layout"))==null?void 0:t.trim();e.setAttribute("media",i==="row"?"":"width:0")};jl=new WeakSet;Lm=function(t){rt(this,$t,t.relatedTarget),ue(this,t.relatedTarget)||(this.hidden=!this.hidden)};ed=new WeakSet;wm=function(){var t;(t=B(this,$t))==null||t.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),ht(Fr(this),B(this,la)),ht(this,B(this,da))};td=new WeakSet;Rm=function(){var t;(t=B(this,$t))==null||t.setAttribute("aria-expanded","false"),pt(Fr(this),B(this,la)),pt(this,B(this,da))};la=new WeakMap;da=new WeakMap;ua=new WeakSet;Wr=function(t){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:i}=Im({anchor:this.anchorElement,floating:this,placement:"top-start"});t!=null||(t=this.offsetWidth);let r=Fr(this).getBoundingClientRect(),o=r.width-e-t,s=r.height-i-this.offsetHeight,{style:d}=B(this,$r);d.setProperty("position","absolute"),d.setProperty("right",`${Math.max(0,o)}px`),d.setProperty("--_menu-bottom",`${s}px`);let u=getComputedStyle(this),T=d.getPropertyValue("--_menu-bottom")===u.bottom?s:parseFloat(u.bottom),_=r.height-T-parseFloat(u.marginBottom);this.style.setProperty("--_menu-max-height",`${_}px`)};Xn=new WeakSet;ud=function(t){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),i=e==null?void 0:e.querySelector('[role="menu"]'),{style:a}=B(this,$r);if(t||a.setProperty("--media-menu-transition-in","none"),i){let r=i.offsetHeight,o=Math.max(i.offsetWidth,e.offsetWidth);this.style.setProperty("min-width",`${o}px`),this.style.setProperty("min-height",`${r}px`),G(this,ua,Wr).call(this,o)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),G(this,ua,Wr).call(this);a.removeProperty("--media-menu-transition-in")};id=new WeakSet;xm=function(t){var e;if(t.stopPropagation(),t.composedPath().includes(B(this,cd,Dm))){(e=B(this,_i))==null||e.focus(),this.hidden=!0;return}let i=G(this,Hr,Jn).call(this,t);!i||i.hasAttribute("disabled")||(G(this,Br,jn).call(this,i),this.handleSelect(t))};cd=new WeakSet;Dm=function(){var t;return(t=this.shadowRoot.querySelector('slot[name="header"]').assignedElements({flatten:!0}))==null?void 0:t.find(i=>i.matches('button[part~="back"]'))};ad=new WeakSet;Om=function(t){if(t.target===this)return;G(this,md,Pm).call(this);let e=Array.from(this.querySelectorAll('[role="menuitem"][aria-haspopup]'));for(let i of e)i.invokeTargetElement!=t.target&&t.newState=="open"&&i.getAttribute("aria-expanded")=="true"&&!i.invokeTargetElement.hidden&&i.invokeTargetElement.dispatchEvent(new Bt({relatedTarget:i}));for(let i of e)i.setAttribute("aria-expanded",`${!i.submenuElement.hidden}`);G(this,Xn,ud).call(this,!0)};md=new WeakSet;Pm=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};rd=new WeakSet;Nm=function(t){var e;ue(this,t.relatedTarget)||(B(this,Ai)&&((e=B(this,_i))==null||e.focus()),B(this,$t)&&B(this,$t)!==t.relatedTarget&&!this.hidden&&(this.hidden=!0))};od=new WeakSet;Um=function(t){var e,i,a,r,o;let{key:s,ctrlKey:d,altKey:u,metaKey:p}=t;if(!(d||u||p)&&this.keysUsed.includes(s))if(t.preventDefault(),t.stopPropagation(),s==="Tab"){if(B(this,Ai)){this.hidden=!0;return}t.shiftKey?(i=(e=this.previousElementSibling)==null?void 0:e.focus)==null||i.call(e):(r=(a=this.nextElementSibling)==null?void 0:a.focus)==null||r.call(a),this.blur()}else s==="Escape"?((o=B(this,_i))==null||o.focus(),B(this,Ai)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(t):this.handleMove(t)};Hr=new WeakSet;Jn=function(t){return t.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};nd=new WeakSet;Hm=function(){return this.items.find(t=>t.tabIndex===0)};Br=new WeakSet;jn=function(t){for(let e of this.items)e.tabIndex=e===t?0:-1};Zn=new WeakSet;sd=function(t,e){let i=[...this.checkedItems];t.type==="radio"&&this.radioGroupItems.forEach(a=>a.checked=!1),e?t.checked=!t.checked:t.checked=!0,this.checkedItems.some((a,r)=>a!=i[r])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};j.shadowRootOptions={mode:"open"};j.getTemplateHTML=Bv;function $v(t){return["menuitem","menuitemradio","menuitemcheckbox"].includes(t==null?void 0:t.role)}function Fr(t){var e;return(e=t.getAttribute("bounds")?Ve(t,`#${t.getAttribute("bounds")}`):Y(t)||t.parentElement)!=null?e:t}l.customElements.get("media-chrome-menu")||l.customElements.define("media-chrome-menu",j);var bd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},st=(t,e,i)=>(bd(t,e,"read from private field"),i?i.call(t):e.get(t)),Tt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},hd=(t,e,i,a)=>(bd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Fe=(t,e,i)=>(bd(t,e,"access private method"),i),es,Kr,pd,Bm,is,gd,_d,$m,lt,ca,Gr,fd,Wm,ts,vd;function Wv(t){return`
|
|
2835
2961
|
<style>
|
|
2836
2962
|
:host {
|
|
2837
2963
|
transition: var(--media-menu-item-transition,
|
|
@@ -2949,7 +3075,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
2949
3075
|
${this.getSuffixSlotInnerHTML(t)}
|
|
2950
3076
|
</slot>
|
|
2951
3077
|
<slot name="submenu"></slot>
|
|
2952
|
-
`}function
|
|
3078
|
+
`}function Fv(t){return""}var xe={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Ce=class extends l.HTMLElement{constructor(){if(super(),Tt(this,pd),Tt(this,is),Tt(this,_d),Tt(this,ca),Tt(this,fd),Tt(this,ts),Tt(this,es,!1),Tt(this,Kr,void 0),Tt(this,lt,()=>{var e,i;this.submenuElement.items&&this.setAttribute("submenusize",`${this.submenuElement.items.length}`);let a=this.shadowRoot.querySelector('slot[name="description"]'),r=(e=this.submenuElement.checkedItems)==null?void 0:e[0],o=(i=r==null?void 0:r.dataset.description)!=null?i:r==null?void 0:r.text,s=V.createElement("span");s.textContent=o!=null?o:"",a.replaceChildren(s)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}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"),Vr(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":Fe(this,pd,Bm).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":Fe(this,fd,Wm).call(this,e);break;case"keyup":Fe(this,ca,Gr).call(this,e);break}}attributeChangedCallback(e,i,a){e===xe.CHECKED&&Vr(this)&&!st(this,es)?this.setAttribute("aria-checked",a!=null?"true":"false"):e===xe.TYPE&&a!==i?this.role="menuitem"+a:e===xe.DISABLED&&a!==i&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(xe.DISABLED)||this.enable(),this.role="menuitem"+this.type,hd(this,Kr,Ed(this,this.parentNode)),Fe(this,ts,vd).call(this),this.submenuElement&&Fe(this,is,gd).call(this)}disconnectedCallback(){this.disable(),Fe(this,ts,vd).call(this),hd(this,Kr,null)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=qt(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(Vr(this))return this.getAttribute("aria-checked")==="true"}set checked(e){Vr(this)&&(hd(this,es,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){Vr(this)||this.invokeTargetElement&&ue(this,e.target)&&this.invokeTargetElement.dispatchEvent(new Bt({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};es=new WeakMap;Kr=new WeakMap;pd=new WeakSet;Bm=function(t){let e=t.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?Fe(this,is,gd).call(this):Fe(this,_d,$m).call(this))};is=new WeakSet;gd=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",st(this,lt)),this.submenuElement.addEventListener("addmenuitem",st(this,lt)),this.submenuElement.addEventListener("removemenuitem",st(this,lt)),st(this,lt).call(this)};_d=new WeakSet;$m=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",st(this,lt)),this.submenuElement.removeEventListener("addmenuitem",st(this,lt)),this.submenuElement.removeEventListener("removemenuitem",st(this,lt)),st(this,lt).call(this)};lt=new WeakMap;ca=new WeakSet;Gr=function(t){let{key:e}=t;if(!this.keysUsed.includes(e)){this.removeEventListener("keyup",Fe(this,ca,Gr));return}this.handleClick(t)};fd=new WeakSet;Wm=function(t){let{metaKey:e,altKey:i,key:a}=t;if(e||i||!this.keysUsed.includes(a)){this.removeEventListener("keyup",Fe(this,ca,Gr));return}this.addEventListener("keyup",Fe(this,ca,Gr),{once:!0})};ts=new WeakSet;vd=function(){var t;let e=(t=st(this,Kr))==null?void 0:t.radioGroupItems;if(!e)return;let i=e.filter(a=>a.getAttribute("aria-checked")==="true").pop();i||(i=e[0]);for(let a of e)a.setAttribute("aria-checked","false");i==null||i.setAttribute("aria-checked","true")};Ce.shadowRootOptions={mode:"open"};Ce.getTemplateHTML=Wv;Ce.getSuffixSlotInnerHTML=Fv;function Vr(t){return t.type==="radio"||t.type==="checkbox"}function Ed(t,e){if(!t)return null;let{host:i}=t.getRootNode();return!e&&i?Ed(t,i):e!=null&&e.items?e:Ed(e,e==null?void 0:e.parentNode)}l.customElements.get("media-chrome-menu-item")||l.customElements.define("media-chrome-menu-item",Ce);function Vv(t){return`
|
|
2953
3079
|
${j.getTemplateHTML(t)}
|
|
2954
3080
|
<style>
|
|
2955
3081
|
:host {
|
|
@@ -2984,7 +3110,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
2984
3110
|
--media-settings-menu-item-opacity: 0;
|
|
2985
3111
|
}
|
|
2986
3112
|
</style>
|
|
2987
|
-
`}var
|
|
3113
|
+
`}var Yr=class extends j{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Y(this).querySelector("media-settings-menu-button")}};Yr.getTemplateHTML=Vv;l.customElements.get("media-settings-menu")||l.customElements.define("media-settings-menu",Yr);function Kv(t){return`
|
|
2988
3114
|
${Ce.getTemplateHTML.call(this,t)}
|
|
2989
3115
|
<style>
|
|
2990
3116
|
slot:not([name="submenu"]) {
|
|
@@ -2995,11 +3121,11 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
2995
3121
|
background: transparent;
|
|
2996
3122
|
}
|
|
2997
3123
|
</style>
|
|
2998
|
-
`}function
|
|
3124
|
+
`}function Gv(t){return`
|
|
2999
3125
|
<svg aria-hidden="true" viewBox="0 0 20 24">
|
|
3000
3126
|
<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"/>
|
|
3001
3127
|
</svg>
|
|
3002
|
-
`}var
|
|
3128
|
+
`}var Ti=class extends Ce{};Ti.shadowRootOptions={mode:"open"};Ti.getTemplateHTML=Kv;Ti.getSuffixSlotInnerHTML=Gv;l.customElements.get("media-settings-menu-item")||l.customElements.define("media-settings-menu-item",Ti);var _e=class extends U{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=qt(this))==null?void 0:e.querySelector(`#${this.invokeTarget}`):null}handleClick(){var e;(e=this.invokeTargetElement)==null||e.dispatchEvent(new Bt({relatedTarget:this}))}};l.customElements.get("media-chrome-menu-button")||l.customElements.define("media-chrome-menu-button",_e);function Yv(){return`
|
|
3003
3129
|
<style>
|
|
3004
3130
|
:host([aria-expanded="true"]) slot[name=tooltip] {
|
|
3005
3131
|
display: none;
|
|
@@ -3010,27 +3136,27 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3010
3136
|
<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"/>
|
|
3011
3137
|
</svg>
|
|
3012
3138
|
</slot>
|
|
3013
|
-
`}function
|
|
3139
|
+
`}function qv(){return h("Settings")}var ma=class extends _e{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",h("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Y(this).querySelector("media-settings-menu")}};ma.getSlotTemplateHTML=Yv;ma.getTooltipContentHTML=qv;l.customElements.get("media-settings-menu-button")||l.customElements.define("media-settings-menu-button",ma);var kd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Fm=(t,e,i)=>(kd(t,e,"read from private field"),i?i.call(t):e.get(t)),as=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Ad=(t,e,i,a)=>(kd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),rs=(t,e,i)=>(kd(t,e,"access private method"),i),qr,ss,os,Td,ns,yd,ls=class extends j{constructor(){super(...arguments),as(this,os),as(this,ns),as(this,qr,[]),as(this,ss,void 0)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_AUDIO_TRACK_LIST,n.MEDIA_AUDIO_TRACK_ENABLED,n.MEDIA_AUDIO_TRACK_UNAVAILABLE]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_AUDIO_TRACK_ENABLED&&i!==a?this.value=a:e===n.MEDIA_AUDIO_TRACK_LIST&&i!==a&&(Ad(this,qr,fu(a!=null?a:"")),rs(this,os,Td).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",rs(this,ns,yd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",rs(this,ns,yd))}get anchorElement(){var e;return this.anchor!=="auto"?super.anchorElement:(e=Y(this))==null?void 0:e.querySelector("media-audio-track-menu-button")}get mediaAudioTrackList(){return Fm(this,qr)}set mediaAudioTrackList(e){Ad(this,qr,e),rs(this,os,Td).call(this)}get mediaAudioTrackEnabled(){var e;return(e=w(this,n.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){R(this,n.MEDIA_AUDIO_TRACK_ENABLED,e)}};qr=new WeakMap;ss=new WeakMap;os=new WeakSet;Td=function(){if(Fm(this,ss)===JSON.stringify(this.mediaAudioTrackList))return;Ad(this,ss,JSON.stringify(this.mediaAudioTrackList));let t=this.mediaAudioTrackList;this.defaultSlot.textContent="",t.sort((e,i)=>e.id.localeCompare(i.id,void 0,{numeric:!0}));for(let e of t){let i=this.formatMenuItemText(e.label,e),a=nt({type:"radio",text:i,value:`${e.id}`,checked:e.enabled});a.prepend(We(this,"checked-indicator")),this.defaultSlot.append(a)}};ns=new WeakSet;yd=function(){if(this.value==null)return;let t=new l.CustomEvent(m.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};l.customElements.get("media-audio-track-menu")||l.customElements.define("media-audio-track-menu",ls);var Zv=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
3014
3140
|
<path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
|
|
3015
3141
|
<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"/>
|
|
3016
|
-
</svg>`;function
|
|
3142
|
+
</svg>`;function Qv(){return`
|
|
3017
3143
|
<style>
|
|
3018
3144
|
:host([aria-expanded="true"]) slot[name=tooltip] {
|
|
3019
3145
|
display: none;
|
|
3020
3146
|
}
|
|
3021
3147
|
</style>
|
|
3022
|
-
<slot name="icon">${
|
|
3023
|
-
`}function
|
|
3148
|
+
<slot name="icon">${Zv}</slot>
|
|
3149
|
+
`}function zv(){return h("Audio")}var Vm=t=>{let e=h("Audio");t.setAttribute("aria-label",e)},ha=class extends _e{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_AUDIO_TRACK_ENABLED,n.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Vm(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_LANG&&Vm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=Y(this))==null?void 0:e.querySelector("media-audio-track-menu")}get mediaAudioTrackEnabled(){var e;return(e=w(this,n.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){R(this,n.MEDIA_AUDIO_TRACK_ENABLED,e)}};ha.getSlotTemplateHTML=Qv;ha.getTooltipContentHTML=zv;l.customElements.get("media-audio-track-menu-button")||l.customElements.define("media-audio-track-menu-button",ha);var Cd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Xv=(t,e,i)=>(Cd(t,e,"read from private field"),i?i.call(t):e.get(t)),Sd=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Jv=(t,e,i,a)=>(Cd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ds=(t,e,i)=>(Cd(t,e,"access private method"),i),ms,us,Id,cs,Md,jv=`
|
|
3024
3150
|
<svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
|
|
3025
3151
|
<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"/>
|
|
3026
|
-
</svg>`;function
|
|
3152
|
+
</svg>`;function eE(t){return`
|
|
3027
3153
|
${j.getTemplateHTML(t)}
|
|
3028
|
-
<slot name="captions-indicator" hidden>${
|
|
3029
|
-
`}var
|
|
3154
|
+
<slot name="captions-indicator" hidden>${jv}</slot>
|
|
3155
|
+
`}var Zr=class extends j{constructor(){super(...arguments),Sd(this,us),Sd(this,cs),Sd(this,ms,void 0)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_SUBTITLES_LIST,n.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_SUBTITLES_LIST&&i!==a?ds(this,us,Id).call(this):e===n.MEDIA_SUBTITLES_SHOWING&&i!==a&&(this.value=a||"",ds(this,us,Id).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",ds(this,cs,Md))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",ds(this,cs,Md))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Y(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return Km(this,n.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Gm(this,n.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Km(this,n.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Gm(this,n.MEDIA_SUBTITLES_SHOWING,e)}};ms=new WeakMap;us=new WeakSet;Id=function(){var t;let e=Xv(this,ms)!==JSON.stringify(this.mediaSubtitlesList),i=this.value!==this.getAttribute(n.MEDIA_SUBTITLES_SHOWING);if(!e&&!i)return;Jv(this,ms,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let a=!this.value,r=nt({type:"radio",text:this.formatMenuItemText(h("Off")),value:"off",checked:a});r.prepend(We(this,"checked-indicator")),this.defaultSlot.append(r);let o=this.mediaSubtitlesList;for(let s of o){let d=nt({type:"radio",text:this.formatMenuItemText(s.label,s),value:Mo(s),checked:this.value==Mo(s)});d.prepend(We(this,"checked-indicator")),((t=s.kind)!=null?t:"subs")==="captions"&&d.append(We(this,"captions-indicator")),this.defaultSlot.append(d)}};cs=new WeakSet;Md=function(){let t=this.mediaSubtitlesShowing,e=this.getAttribute(n.MEDIA_SUBTITLES_SHOWING),i=this.value!==e;if(t!=null&&t.length&&i&&this.dispatchEvent(new l.CustomEvent(m.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:t})),!this.value||!i)return;let a=new l.CustomEvent(m.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(a)};Zr.getTemplateHTML=eE;var Km=(t,e)=>{let i=t.getAttribute(e);return i?Xt(i):[]},Gm=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=vt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};l.customElements.get("media-captions-menu")||l.customElements.define("media-captions-menu",Zr);var tE=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
3030
3156
|
<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"/>
|
|
3031
|
-
</svg>`,
|
|
3157
|
+
</svg>`,iE=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
3032
3158
|
<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"/>
|
|
3033
|
-
</svg>`;function
|
|
3159
|
+
</svg>`;function aE(){return`
|
|
3034
3160
|
<style>
|
|
3035
3161
|
:host([data-captions-enabled="true"]) slot[name=off] {
|
|
3036
3162
|
display: none !important;
|
|
@@ -3047,10 +3173,10 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3047
3173
|
</style>
|
|
3048
3174
|
|
|
3049
3175
|
<slot name="icon">
|
|
3050
|
-
<slot name="on">${
|
|
3051
|
-
<slot name="off">${
|
|
3176
|
+
<slot name="on">${tE}</slot>
|
|
3177
|
+
<slot name="off">${iE}</slot>
|
|
3052
3178
|
</slot>
|
|
3053
|
-
`}function
|
|
3179
|
+
`}function rE(){return h("Captions")}var Ym=t=>{t.setAttribute("data-captions-enabled",Co(t).toString())},qm=t=>{t.setAttribute("aria-label",h("closed captions"))},pa=class extends _e{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_SUBTITLES_LIST,n.MEDIA_SUBTITLES_SHOWING,n.MEDIA_LANG]}connectedCallback(){super.connectedCallback(),qm(this),Ym(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_SUBTITLES_SHOWING?Ym(this):e===n.MEDIA_LANG&&qm(this)}get invokeTargetElement(){var e;return this.invokeTarget!=null?super.invokeTargetElement:(e=Y(this))==null?void 0:e.querySelector("media-captions-menu")}get mediaSubtitlesList(){return Zm(this,n.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Qm(this,n.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Zm(this,n.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Qm(this,n.MEDIA_SUBTITLES_SHOWING,e)}};pa.getSlotTemplateHTML=aE;pa.getTooltipContentHTML=rE;var Zm=(t,e)=>{let i=t.getAttribute(e);return i?Xt(i):[]},Qm=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=vt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};l.customElements.get("media-captions-menu-button")||l.customElements.define("media-captions-menu-button",pa);var zm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},va=(t,e,i)=>(zm(t,e,"read from private field"),i?i.call(t):e.get(t)),Ld=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},fa=(t,e,i)=>(zm(t,e,"access private method"),i),Wt,Ea,Qr,hs,Rd,wd={RATES:"rates"},ps=class extends j{constructor(){super(),Ld(this,Ea),Ld(this,hs),Ld(this,Wt,new Ct(this,wd.RATES,{defaultValue:gl})),fa(this,Ea,Qr).call(this)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PLAYBACK_RATE,wd.RATES]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_PLAYBACK_RATE&&i!=a?(this.value=a,fa(this,Ea,Qr).call(this)):e===wd.RATES&&i!=a&&(va(this,Wt).value=a,fa(this,Ea,Qr).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",fa(this,hs,Rd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",fa(this,hs,Rd))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Y(this).querySelector("media-playback-rate-menu-button")}get rates(){return va(this,Wt)}set rates(e){e?Array.isArray(e)?va(this,Wt).value=e.join(" "):typeof e=="string"&&(va(this,Wt).value=e):va(this,Wt).value="",fa(this,Ea,Qr).call(this)}get mediaPlaybackRate(){return O(this,n.MEDIA_PLAYBACK_RATE,ni)}set mediaPlaybackRate(e){N(this,n.MEDIA_PLAYBACK_RATE,e)}};Wt=new WeakMap;Ea=new WeakSet;Qr=function(){this.defaultSlot.textContent="";let t=this.mediaPlaybackRate,e=new Set(Array.from(va(this,Wt)).map(a=>Number(a)));t>0&&!e.has(t)&&e.add(t);let i=Array.from(e).sort((a,r)=>a-r);for(let a of i){let r=nt({type:"radio",text:this.formatMenuItemText(`${a}x`,a),value:a.toString(),checked:t===a});r.prepend(We(this,"checked-indicator")),this.defaultSlot.append(r)}};hs=new WeakSet;Rd=function(){if(!this.value)return;let t=new l.CustomEvent(m.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};l.customElements.get("media-playback-rate-menu")||l.customElements.define("media-playback-rate-menu",ps);var fs=1;function oE(t){return`
|
|
3054
3180
|
<style>
|
|
3055
3181
|
:host {
|
|
3056
3182
|
min-width: 5ch;
|
|
@@ -3061,17 +3187,17 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3061
3187
|
display: none;
|
|
3062
3188
|
}
|
|
3063
3189
|
</style>
|
|
3064
|
-
<slot name="icon">${t.mediaplaybackrate||
|
|
3065
|
-
`}function
|
|
3190
|
+
<slot name="icon">${t.mediaplaybackrate||fs}x</slot>
|
|
3191
|
+
`}function nE(){return h("Playback rate")}var ba=class extends _e{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PLAYBACK_RATE]}constructor(){var e;super(),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:fs}x`}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===n.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,o=Number.isNaN(r)?fs:r;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",h("Playback rate {playbackRate}",{playbackRate:o}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Y(this).querySelector("media-playback-rate-menu")}get mediaPlaybackRate(){return O(this,n.MEDIA_PLAYBACK_RATE,fs)}set mediaPlaybackRate(e){N(this,n.MEDIA_PLAYBACK_RATE,e)}};ba.getSlotTemplateHTML=oE;ba.getTooltipContentHTML=nE;l.customElements.get("media-playback-rate-menu-button")||l.customElements.define("media-playback-rate-menu-button",ba);var Dd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},zr=(t,e,i)=>(Dd(t,e,"read from private field"),i?i.call(t):e.get(t)),vs=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Xm=(t,e,i,a)=>(Dd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ga=(t,e,i)=>(Dd(t,e,"access private method"),i),Xr,Aa,_a,Jr,Es,xd,bs=class extends j{constructor(){super(...arguments),vs(this,_a),vs(this,Es),vs(this,Xr,[]),vs(this,Aa,{})}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_RENDITION_LIST,n.MEDIA_RENDITION_SELECTED,n.MEDIA_RENDITION_UNAVAILABLE,n.MEDIA_HEIGHT]}static formatMenuItemText(e,i){return super.formatMenuItemText(e,i)}static formatRendition(e,{showBitrate:i=!1}={}){let a=`${Math.min(e.width,e.height)}p`;if(i&&e.bitrate){let r=e.bitrate/1e6,o=`${r.toFixed(r<1?1:0)} Mbps`;return`${a} (${o})`}return this.formatMenuItemText(a,e)}static compareRendition(e,i){var a,r;return i.height===e.height?((a=i.bitrate)!=null?a:0)-((r=e.bitrate)!=null?r:0):i.height-e.height}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_RENDITION_SELECTED&&i!==a?(this.value=a!=null?a:"auto",ga(this,_a,Jr).call(this)):e===n.MEDIA_RENDITION_LIST&&i!==a?(Xm(this,Xr,hu(a)),ga(this,_a,Jr).call(this)):e===n.MEDIA_HEIGHT&&i!==a&&ga(this,_a,Jr).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",ga(this,Es,xd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",ga(this,Es,xd))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Y(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return zr(this,Xr)}set mediaRenditionList(e){Xm(this,Xr,e),ga(this,_a,Jr).call(this)}get mediaRenditionSelected(){return w(this,n.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){R(this,n.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return O(this,n.MEDIA_HEIGHT)}set mediaHeight(e){N(this,n.MEDIA_HEIGHT,e)}compareRendition(e,i){return this.constructor.compareRendition(e,i)}formatMenuItemText(e,i){return this.constructor.formatMenuItemText(e,i)}formatRendition(e,i){return this.constructor.formatRendition(e,i)}showRenditionBitrate(e){return this.mediaRenditionList.some(i=>i!==e&&i.height===e.height&&i.bitrate!==e.bitrate)}};Xr=new WeakMap;Aa=new WeakMap;_a=new WeakSet;Jr=function(){if(zr(this,Aa).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&zr(this,Aa).mediaHeight===this.mediaHeight)return;zr(this,Aa).mediaRenditionList=JSON.stringify(this.mediaRenditionList),zr(this,Aa).mediaHeight=this.mediaHeight;let t=this.mediaRenditionList.sort(this.compareRendition.bind(this)),e=t.find(s=>s.id===this.mediaRenditionSelected);for(let s of t)s.selected=s===e;this.defaultSlot.textContent="";let i=!this.mediaRenditionSelected;for(let s of t){let d=this.formatRendition(s,{showBitrate:this.showRenditionBitrate(s)}),u=nt({type:"radio",text:d,value:`${s.id}`,checked:s.selected&&!i});u.prepend(We(this,"checked-indicator")),this.defaultSlot.append(u)}let a=e&&this.showRenditionBitrate(e),r=i?e?this.formatMenuItemText(`${h("Auto")} \u2022 ${this.formatRendition(e,{showBitrate:a})}`,e):this.formatMenuItemText(`${h("Auto")} (${this.mediaHeight}p)`):this.formatMenuItemText(h("Auto")),o=nt({type:"radio",text:r,value:"auto",checked:i});o.dataset.description=r,o.prepend(We(this,"checked-indicator")),this.defaultSlot.append(o)};Es=new WeakSet;xd=function(){if(this.value==null)return;let t=new l.CustomEvent(m.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(t)};l.customElements.get("media-rendition-menu")||l.customElements.define("media-rendition-menu",bs);var sE=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
3066
3192
|
<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" />
|
|
3067
|
-
</svg>`;function
|
|
3193
|
+
</svg>`;function lE(){return`
|
|
3068
3194
|
<style>
|
|
3069
3195
|
:host([aria-expanded="true"]) slot[name=tooltip] {
|
|
3070
3196
|
display: none;
|
|
3071
3197
|
}
|
|
3072
3198
|
</style>
|
|
3073
|
-
<slot name="icon">${
|
|
3074
|
-
`}function
|
|
3199
|
+
<slot name="icon">${sE}</slot>
|
|
3200
|
+
`}function dE(){return h("Quality")}var Ta=class extends _e{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_RENDITION_SELECTED,n.MEDIA_RENDITION_UNAVAILABLE,n.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",h("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Y(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return w(this,n.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){R(this,n.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return O(this,n.MEDIA_HEIGHT)}set mediaHeight(e){N(this,n.MEDIA_HEIGHT,e)}};Ta.getSlotTemplateHTML=lE;Ta.getTooltipContentHTML=dE;l.customElements.get("media-rendition-menu-button")||l.customElements.define("media-rendition-menu-button",Ta);var Nd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ut=(t,e,i)=>(Nd(t,e,"read from private field"),i?i.call(t):e.get(t)),dt=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},Jm=(t,e,i,a)=>(Nd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),De=(t,e,i)=>(Nd(t,e,"access private method"),i),ka,jr,ks,yi,ya,Ud,jm,gs,Od,_s,Pd,eh,Ts,ys,As;function uE(t){return`
|
|
3075
3201
|
${j.getTemplateHTML(t)}
|
|
3076
3202
|
<style>
|
|
3077
3203
|
:host {
|
|
@@ -3085,7 +3211,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3085
3211
|
overflow: hidden;
|
|
3086
3212
|
}
|
|
3087
3213
|
</style>
|
|
3088
|
-
`}var
|
|
3214
|
+
`}var eo=class extends j{constructor(){super(),dt(this,jr),dt(this,yi),dt(this,Ud),dt(this,gs),dt(this,Pd),dt(this,ka,!1),dt(this,_s,e=>{let i=e.target,a=(i==null?void 0:i.nodeName)==="VIDEO",r=De(this,gs,Od).call(this,i);(a||r)&&(ut(this,ka)?De(this,yi,ya).call(this):De(this,Pd,eh).call(this,e))}),dt(this,Ts,e=>{let i=e.target,a=this.contains(i),r=e.button===2,o=(i==null?void 0:i.nodeName)==="VIDEO",s=De(this,gs,Od).call(this,i);a||r&&(o||s)||De(this,yi,ya).call(this)}),dt(this,ys,e=>{e.key==="Escape"&&De(this,yi,ya).call(this)}),dt(this,As,e=>{var i,a;let r=e.target;if((i=r.matches)!=null&&i.call(r,'button[invoke="copy"]')){let o=(a=r.closest("media-context-menu-item"))==null?void 0:a.querySelector('input[slot="copy"]');o&&navigator.clipboard.writeText(o.value)}De(this,yi,ya).call(this)}),this.setAttribute("noautohide",""),De(this,jr,ks).call(this)}connectedCallback(){super.connectedCallback(),Y(this).addEventListener("contextmenu",ut(this,_s)),this.addEventListener("click",ut(this,As))}disconnectedCallback(){super.disconnectedCallback(),Y(this).removeEventListener("contextmenu",ut(this,_s)),this.removeEventListener("click",ut(this,As)),document.removeEventListener("mousedown",ut(this,Ts)),document.removeEventListener("keydown",ut(this,ys))}};ka=new WeakMap;jr=new WeakSet;ks=function(){this.hidden=!ut(this,ka)};yi=new WeakSet;ya=function(){Jm(this,ka,!1),De(this,jr,ks).call(this)};Ud=new WeakSet;jm=function(){document.querySelectorAll("media-context-menu").forEach(e=>{var i;e!==this&&De(i=e,yi,ya).call(i)})};gs=new WeakSet;Od=function(t){return t?t.hasAttribute("slot")&&t.getAttribute("slot")==="media"?!0:t.nodeName.includes("-")&&t.tagName.includes("-")?t.hasAttribute("src")||t.hasAttribute("poster")||t.hasAttribute("preload")||t.hasAttribute("playsinline"):!1:!1};_s=new WeakMap;Pd=new WeakSet;eh=function(t){t.preventDefault(),De(this,Ud,jm).call(this),Jm(this,ka,!0),this.style.position="fixed",this.style.left=`${t.clientX}px`,this.style.top=`${t.clientY}px`,De(this,jr,ks).call(this),document.addEventListener("mousedown",ut(this,Ts),{once:!0}),document.addEventListener("keydown",ut(this,ys),{once:!0})};Ts=new WeakMap;ys=new WeakMap;As=new WeakMap;eo.getTemplateHTML=uE;l.customElements.get("media-context-menu")||l.customElements.define("media-context-menu",eo);function cE(t){return`
|
|
3089
3215
|
${Ce.getTemplateHTML.call(this,t)}
|
|
3090
3216
|
<style>
|
|
3091
3217
|
::slotted(*) {
|
|
@@ -3098,7 +3224,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3098
3224
|
min-height: var(--media-control-height, 24px);
|
|
3099
3225
|
}
|
|
3100
3226
|
</style>
|
|
3101
|
-
`}var
|
|
3227
|
+
`}var Sa=class extends Ce{};Sa.shadowRootOptions={mode:"open"};Sa.getTemplateHTML=cE;l.customElements.get("media-context-menu-item")||l.customElements.define("media-context-menu-item",Sa);var Hd=Gt.createElement("template");"innerHTML"in Hd&&(Hd.innerHTML=Sm);var th,ih,Ss=class extends bi{};Ss.template=(ih=(th=Hd.content)==null?void 0:th.children)==null?void 0:ih[0];ke.customElements.get("media-theme-gerwig")||ke.customElements.define("media-theme-gerwig",Ss);var mE="gerwig",yt={SRC:"src",POSTER:"poster"},c={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",FULLSCREEN_ELEMENT:"fullscreen-element",DRM_TOKEN:"drm-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",VIDEO_TITLE:"video-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",NO_MUTED_PREF:"no-muted-pref",CAST_RECEIVER:"cast-receiver",NO_TOOLTIPS:"no-tooltips",PROUDLY_DISPLAY_MUX_BADGE:"proudly-display-mux-badge",DISABLE_PSEUDO_ENDED:"disable-pseudo-ended"},Bd=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","videotitle","novolumepref","nomutedpref","proudlydisplaymuxbadge"];function hE(t,e){var a,r;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src||!!t.currentSrc,poster:t.poster,storyboard:t.storyboard,storyboardSrc:t.getAttribute(c.STORYBOARD_SRC),fullscreenElement:t.getAttribute(c.FULLSCREEN_ELEMENT),placeholder:t.getAttribute("placeholder"),themeTemplate:fE(t),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(c.NOHOTKEYS),hotKeys:t.getAttribute(c.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,preferCmcd:t.preferCmcd,debug:t.debug,disableTracking:t.disableTracking,disableCookies:t.disableCookies,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,maxResolution:t.maxResolution,minResolution:t.minResolution,programStartTime:t.programStartTime,programEndTime:t.programEndTime,assetStartTime:t.assetStartTime,assetEndTime:t.assetEndTime,renditionOrder:t.renditionOrder,metadata:t.metadata,playerInitTime:t.playerInitTime,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferPlayback:t.preferPlayback,audio:t.audio,defaultStreamType:t.defaultStreamType,targetLiveWindow:t.getAttribute(g.Attributes.TARGET_LIVE_WINDOW),streamType:Cr(t.getAttribute(g.Attributes.STREAM_TYPE)),primaryColor:t.getAttribute(c.PRIMARY_COLOR),secondaryColor:t.getAttribute(c.SECONDARY_COLOR),accentColor:t.getAttribute(c.ACCENT_COLOR),forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultDuration:t.defaultDuration,defaultShowRemainingTime:t.defaultShowRemainingTime,hideDuration:vE(t),playbackRates:t.getAttribute(c.PLAYBACK_RATES),customDomain:(a=t.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:t.getAttribute(c.TITLE),videoTitle:(r=t.getAttribute(c.VIDEO_TITLE))!=null?r:t.getAttribute(c.TITLE),novolumepref:t.hasAttribute(c.NO_VOLUME_PREF),nomutedpref:t.hasAttribute(c.NO_MUTED_PREF),proudlyDisplayMuxBadge:t.hasAttribute(c.PROUDLY_DISPLAY_MUX_BADGE),castReceiver:t.castReceiver,disablePseudoEnded:t.hasAttribute(c.DISABLE_PSEUDO_ENDED),...e,extraSourceParams:t.extraSourceParams}}var pE=on.formatErrorMessage;on.formatErrorMessage=t=>{var e,i;if(t instanceof g.MediaError){let a=km(t,!1);return`
|
|
3102
3228
|
${a!=null&&a.title?`<h3>${a.title}</h3>`:""}
|
|
3103
3229
|
${a!=null&&a.message||a!=null&&a.linkUrl?`<p>
|
|
3104
3230
|
${a==null?void 0:a.message}
|
|
@@ -3106,9 +3232,9 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3106
3232
|
href="${a.linkUrl}"
|
|
3107
3233
|
target="_blank"
|
|
3108
3234
|
rel="external noopener"
|
|
3109
|
-
aria-label="${(e=a.linkText)!=null?e:""} ${(0,
|
|
3235
|
+
aria-label="${(e=a.linkText)!=null?e:""} ${(0,D.i18n)("(opens in a new window)")}"
|
|
3110
3236
|
>${(i=a.linkText)!=null?i:a.linkUrl}</a
|
|
3111
3237
|
>`:""}
|
|
3112
3238
|
</p>`:""}
|
|
3113
|
-
`}return Xv(t)};function Jv(t){var i,a;let e=t.theme;if(e){let r=(a=(i=t.getRootNode())==null?void 0:i.getElementById)==null?void 0:a.call(i,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let o=ke.customElements.get(e);if(o!=null&&o.template)return o.template}}function jv(t){var i;let e=(i=t.mediaController)==null?void 0:i.querySelector("media-time-display");return e&&getComputedStyle(e).getPropertyValue("--media-duration-display-display").trim()==="none"}function qm(t){let e=t.videoTitle?{video_title:t.videoTitle}:{};return t.getAttributeNames().filter(i=>i.startsWith("metadata-")).reduce((i,a)=>{let r=t.getAttribute(a);return r!==null&&(i[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),i},e)}var eE=Object.values(b.Attributes),tE=Object.values(_t),iE=Object.values(c),wd=Sn(),Rd="mux-player",Zm={isDialogOpen:!1},aE={redundant_streams:!0},Zr,Qr,zr,Ft,Xr,Ti,W,$t,Qm,Dd,Ai,zm,Xm,Jm,jm,xd=class extends Cl{constructor(){super();he(this,W);he(this,Zr);he(this,Qr,!1);he(this,zr,{});he(this,Ft,!0);he(this,Xr,new kn(this,"hotkeys"));he(this,Ti,{...Zm,onCloseErrorDialog:i=>{var r;((r=i.composedPath()[0])==null?void 0:r.localName)==="media-error-dialog"&&X(this,W,Dd).call(this,{isDialogOpen:!1})},onFocusInErrorDialog:i=>{var o;if(((o=i.composedPath()[0])==null?void 0:o.localName)!=="media-error-dialog")return;Sl(this,Vt.activeElement)||i.preventDefault()}});ye(this,Zr,(0,R.generatePlayerInitTime)()),this.attachShadow({mode:"open"}),X(this,W,Qm).call(this),this.isConnected&&X(this,W,$t).call(this)}static get NAME(){return Rd}static get VERSION(){return wd}static get observedAttributes(){var i;return[...(i=Cl.observedAttributes)!=null?i:[],...tE,...eE,...iE]}get mediaTheme(){var i;return(i=this.shadowRoot)==null?void 0:i.querySelector("media-theme")}get mediaController(){var i,a;return(a=(i=this.mediaTheme)==null?void 0:i.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){let i=this.media;i&&(i.metadata=qm(this))}attributeChangedCallback(i,a,r){switch(X(this,W,$t).call(this),super.attributeChangedCallback(i,a,r),i){case c.HOTKEYS:U(this,Xr).value=r;break;case c.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&je((0,R.i18n)("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").toString());break}case c.THUMBNAIL_TOKEN:{if(r){let s=(0,R.parseJwt)(r);if(s){let{aud:d}=s,u=R.MuxJWTAud.THUMBNAIL;d!==u&&je((0,R.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"thumbnail"}))}}break}case c.STORYBOARD_TOKEN:{if(r){let s=(0,R.parseJwt)(r);if(s){let{aud:d}=s,u=R.MuxJWTAud.STORYBOARD;d!==u&&je((0,R.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"storyboard"}))}}break}case c.DRM_TOKEN:{if(r){let s=(0,R.parseJwt)(r);if(s){let{aud:d}=s,u=R.MuxJWTAud.DRM;d!==u&&je((0,R.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"drm"}))}}break}case b.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&be((0,R.i18n)("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case b.Attributes.STREAM_TYPE:{r&&![R.StreamTypes.LIVE,R.StreamTypes.ON_DEMAND,R.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:Il({file:"invalid-stream-type.md",message:(0,R.i18n)("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===R.StreamTypes.LIVE?this.getAttribute(c.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN;break}case c.FULLSCREEN_ELEMENT:{if(r!=null||r!==a){let s=Vt.getElementById(r),d=s==null?void 0:s.querySelector("mux-player");this.mediaController&&s&&d&&(this.mediaController.fullscreenElement=s)}break}}[b.Attributes.PLAYBACK_ID,_t.SRC,c.PLAYBACK_TOKEN].includes(i)&&a!==r&&ye(this,Ti,{...U(this,Ti),...Zm}),X(this,W,Ai).call(this,{[Kc(i)]:r})}async requestFullscreen(i){var a;if(!(!this.mediaController||this.mediaController.hasAttribute(n.MEDIA_IS_FULLSCREEN)))return(a=this.mediaController)==null||a.dispatchEvent(new ke.CustomEvent(f.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((r,o)=>{var s;(s=this.mediaController)==null||s.addEventListener(Le.MEDIA_IS_FULLSCREEN,()=>r(),{once:!0})})}async exitFullscreen(){var i;if(!(!this.mediaController||!this.mediaController.hasAttribute(n.MEDIA_IS_FULLSCREEN)))return(i=this.mediaController)==null||i.dispatchEvent(new ke.CustomEvent(f.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((a,r)=>{var o;(o=this.mediaController)==null||o.addEventListener(Le.MEDIA_IS_FULLSCREEN,()=>a(),{once:!0})})}get preferCmcd(){var i;return(i=this.getAttribute(b.Attributes.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?R.CmcdTypeValues.includes(i)?this.setAttribute(b.Attributes.PREFER_CMCD,i):je(`Invalid value for preferCmcd. Must be one of ${R.CmcdTypeValues.join()}`):this.removeAttribute(b.Attributes.PREFER_CMCD))}get hasPlayed(){var i,a;return(a=(i=this.mediaController)==null?void 0:i.hasAttribute(n.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var i;return(i=this.mediaController)==null?void 0:i.hasAttribute(n.MEDIA_TIME_IS_LIVE)}get _hls(){var i;return(i=this.media)==null?void 0:i._hls}get mux(){var i;return(i=this.media)==null?void 0:i.mux}get theme(){var i;return(i=this.getAttribute(c.THEME))!=null?i:Qv}set theme(i){this.setAttribute(c.THEME,`${i}`)}get themeProps(){let i=this.mediaTheme;if(!i)return;let a={};for(let r of i.getAttributeNames()){if(Ld.includes(r))continue;let o=i.getAttribute(r);a[yn(r)]=o===""?!0:o}return a}set themeProps(i){var r,o;X(this,W,$t).call(this);let a={...this.themeProps,...i};for(let s in a){if(Ld.includes(s))continue;let d=i==null?void 0:i[s];typeof d=="boolean"||d==null?(r=this.mediaTheme)==null||r.toggleAttribute(Tn(s),!!d):(o=this.mediaTheme)==null||o.setAttribute(Tn(s),d)}}get playbackId(){var i;return(i=this.getAttribute(b.Attributes.PLAYBACK_ID))!=null?i:void 0}set playbackId(i){i?this.setAttribute(b.Attributes.PLAYBACK_ID,i):this.removeAttribute(b.Attributes.PLAYBACK_ID)}get src(){var i,a;return this.playbackId?(i=Wt(this,_t.SRC))!=null?i:void 0:(a=this.getAttribute(_t.SRC))!=null?a:void 0}set src(i){i?this.setAttribute(_t.SRC,i):this.removeAttribute(_t.SRC)}get poster(){var r;let i=this.getAttribute(_t.POSTER);if(i!=null)return i;let{tokens:a}=this;if(a.playback&&!a.thumbnail){je("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return Fc(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(r=this.thumbnailTime)!=null?r:this.startTime,programTime:this.programStartTime,token:a.thumbnail})}set poster(i){i||i===""?this.setAttribute(_t.POSTER,i):this.removeAttribute(_t.POSTER)}get storyboardSrc(){var i;return(i=this.getAttribute(c.STORYBOARD_SRC))!=null?i:void 0}set storyboardSrc(i){i?this.setAttribute(c.STORYBOARD_SRC,i):this.removeAttribute(c.STORYBOARD_SRC)}get storyboard(){let{tokens:i}=this;if(this.storyboardSrc&&!i.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[R.StreamTypes.LIVE,R.StreamTypes.UNKNOWN].includes(this.streamType)||i.playback&&!i.storyboard))return Vc(this.playbackId,{customDomain:this.customDomain,token:i.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(c.AUDIO)}set audio(i){if(!i){this.removeAttribute(c.AUDIO);return}this.setAttribute(c.AUDIO,"")}get hotkeys(){return U(this,Xr)}get nohotkeys(){return this.hasAttribute(c.NOHOTKEYS)}set nohotkeys(i){if(!i){this.removeAttribute(c.NOHOTKEYS);return}this.setAttribute(c.NOHOTKEYS,"")}get thumbnailTime(){return ue(this.getAttribute(c.THUMBNAIL_TIME))}set thumbnailTime(i){this.setAttribute(c.THUMBNAIL_TIME,`${i}`)}get videoTitle(){var i,a;return(a=(i=this.getAttribute(c.VIDEO_TITLE))!=null?i:this.getAttribute(c.TITLE))!=null?a:""}set videoTitle(i){i!==this.videoTitle&&(i?this.setAttribute(c.VIDEO_TITLE,i):this.removeAttribute(c.VIDEO_TITLE))}get placeholder(){var i;return(i=Wt(this,c.PLACEHOLDER))!=null?i:""}set placeholder(i){this.setAttribute(c.PLACEHOLDER,`${i}`)}get primaryColor(){var a,r;let i=this.getAttribute(c.PRIMARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=ke.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),i))return i}set primaryColor(i){this.setAttribute(c.PRIMARY_COLOR,`${i}`)}get secondaryColor(){var a,r;let i=this.getAttribute(c.SECONDARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=ke.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),i))return i}set secondaryColor(i){this.setAttribute(c.SECONDARY_COLOR,`${i}`)}get accentColor(){var a,r;let i=this.getAttribute(c.ACCENT_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=ke.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),i))return i}set accentColor(i){this.setAttribute(c.ACCENT_COLOR,`${i}`)}get defaultShowRemainingTime(){return this.hasAttribute(c.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(i){i?this.setAttribute(c.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(c.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(c.PLAYBACK_RATES))return this.getAttribute(c.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(i=>Number(i)).filter(i=>!Number.isNaN(i)).sort((i,a)=>i-a)}set playbackRates(i){if(!i){this.removeAttribute(c.PLAYBACK_RATES);return}this.setAttribute(c.PLAYBACK_RATES,i.join(" "))}get forwardSeekOffset(){var i;return(i=ue(this.getAttribute(c.FORWARD_SEEK_OFFSET)))!=null?i:10}set forwardSeekOffset(i){this.setAttribute(c.FORWARD_SEEK_OFFSET,`${i}`)}get backwardSeekOffset(){var i;return(i=ue(this.getAttribute(c.BACKWARD_SEEK_OFFSET)))!=null?i:10}set backwardSeekOffset(i){this.setAttribute(c.BACKWARD_SEEK_OFFSET,`${i}`)}get defaultHiddenCaptions(){return this.hasAttribute(c.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(i){i?this.setAttribute(c.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(c.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return ue(this.getAttribute(c.DEFAULT_DURATION))}set defaultDuration(i){i==null?this.removeAttribute(c.DEFAULT_DURATION):this.setAttribute(c.DEFAULT_DURATION,`${i}`)}get playerInitTime(){return this.hasAttribute(b.Attributes.PLAYER_INIT_TIME)?ue(this.getAttribute(b.Attributes.PLAYER_INIT_TIME)):U(this,Zr)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(b.Attributes.PLAYER_INIT_TIME):this.setAttribute(b.Attributes.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=this.getAttribute(b.Attributes.PLAYER_SOFTWARE_NAME))!=null?i:Rd}get playerSoftwareVersion(){var i;return(i=this.getAttribute(b.Attributes.PLAYER_SOFTWARE_VERSION))!=null?i:wd}get beaconCollectionDomain(){var i;return(i=this.getAttribute(b.Attributes.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(b.Attributes.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(b.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var i;return(i=this.getAttribute(b.Attributes.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(b.Attributes.MAX_RESOLUTION,i):this.removeAttribute(b.Attributes.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(b.Attributes.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(b.Attributes.MIN_RESOLUTION,i):this.removeAttribute(b.Attributes.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(b.Attributes.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(b.Attributes.RENDITION_ORDER,i):this.removeAttribute(b.Attributes.RENDITION_ORDER))}get programStartTime(){return ue(this.getAttribute(b.Attributes.PROGRAM_START_TIME))}set programStartTime(i){i==null?this.removeAttribute(b.Attributes.PROGRAM_START_TIME):this.setAttribute(b.Attributes.PROGRAM_START_TIME,`${i}`)}get programEndTime(){return ue(this.getAttribute(b.Attributes.PROGRAM_END_TIME))}set programEndTime(i){i==null?this.removeAttribute(b.Attributes.PROGRAM_END_TIME):this.setAttribute(b.Attributes.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){return ue(this.getAttribute(b.Attributes.ASSET_START_TIME))}set assetStartTime(i){i==null?this.removeAttribute(b.Attributes.ASSET_START_TIME):this.setAttribute(b.Attributes.ASSET_START_TIME,`${i}`)}get assetEndTime(){return ue(this.getAttribute(b.Attributes.ASSET_END_TIME))}set assetEndTime(i){i==null?this.removeAttribute(b.Attributes.ASSET_END_TIME):this.setAttribute(b.Attributes.ASSET_END_TIME,`${i}`)}get extraSourceParams(){return this.hasAttribute(c.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(c.EXTRA_SOURCE_PARAMS)).entries()].reduce((i,[a,r])=>(i[a]=r,i),{}):aE}set extraSourceParams(i){i==null?this.removeAttribute(c.EXTRA_SOURCE_PARAMS):this.setAttribute(c.EXTRA_SOURCE_PARAMS,new URLSearchParams(i).toString())}get customDomain(){var i;return(i=this.getAttribute(b.Attributes.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(b.Attributes.CUSTOM_DOMAIN,i):this.removeAttribute(b.Attributes.CUSTOM_DOMAIN))}get envKey(){var i;return(i=Wt(this,b.Attributes.ENV_KEY))!=null?i:void 0}set envKey(i){this.setAttribute(b.Attributes.ENV_KEY,`${i}`)}get noVolumePref(){return this.hasAttribute(c.NO_VOLUME_PREF)}set noVolumePref(i){i?this.setAttribute(c.NO_VOLUME_PREF,""):this.removeAttribute(c.NO_VOLUME_PREF)}get noMutedPref(){return this.hasAttribute(c.NO_MUTED_PREF)}set noMutedPref(i){i?this.setAttribute(c.NO_MUTED_PREF,""):this.removeAttribute(c.NO_MUTED_PREF)}get debug(){return Wt(this,b.Attributes.DEBUG)!=null}set debug(i){i?this.setAttribute(b.Attributes.DEBUG,""):this.removeAttribute(b.Attributes.DEBUG)}get disableTracking(){return Wt(this,b.Attributes.DISABLE_TRACKING)!=null}set disableTracking(i){this.toggleAttribute(b.Attributes.DISABLE_TRACKING,!!i)}get disableCookies(){return Wt(this,b.Attributes.DISABLE_COOKIES)!=null}set disableCookies(i){i?this.setAttribute(b.Attributes.DISABLE_COOKIES,""):this.removeAttribute(b.Attributes.DISABLE_COOKIES)}get streamType(){var i,a,r;return(r=(a=this.getAttribute(b.Attributes.STREAM_TYPE))!=null?a:(i=this.media)==null?void 0:i.streamType)!=null?r:R.StreamTypes.UNKNOWN}set streamType(i){this.setAttribute(b.Attributes.STREAM_TYPE,`${i}`)}get defaultStreamType(){var i,a,r;return(r=(a=this.getAttribute(c.DEFAULT_STREAM_TYPE))!=null?a:(i=this.mediaController)==null?void 0:i.getAttribute(c.DEFAULT_STREAM_TYPE))!=null?r:R.StreamTypes.ON_DEMAND}set defaultStreamType(i){i?this.setAttribute(c.DEFAULT_STREAM_TYPE,i):this.removeAttribute(c.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var i,a;return this.hasAttribute(c.TARGET_LIVE_WINDOW)?+this.getAttribute(c.TARGET_LIVE_WINDOW):(a=(i=this.media)==null?void 0:i.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(i){i==this.targetLiveWindow||Number.isNaN(i)&&Number.isNaN(this.targetLiveWindow)||(i==null?this.removeAttribute(c.TARGET_LIVE_WINDOW):this.setAttribute(c.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i;return(i=this.media)==null?void 0:i.liveEdgeStart}get startTime(){return ue(Wt(this,b.Attributes.START_TIME))}set startTime(i){this.setAttribute(b.Attributes.START_TIME,`${i}`)}get preferPlayback(){let i=this.getAttribute(b.Attributes.PREFER_PLAYBACK);if(i===R.PlaybackTypes.MSE||i===R.PlaybackTypes.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===R.PlaybackTypes.MSE||i===R.PlaybackTypes.NATIVE?this.setAttribute(b.Attributes.PREFER_PLAYBACK,i):this.removeAttribute(b.Attributes.PREFER_PLAYBACK))}get metadata(){var i;return(i=this.media)==null?void 0:i.metadata}set metadata(i){if(X(this,W,$t).call(this),!this.media){be("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...qm(this),...i}}get _hlsConfig(){var i;return(i=this.media)==null?void 0:i._hlsConfig}set _hlsConfig(i){if(X(this,W,$t).call(this),!this.media){be("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=i}async addCuePoints(i){var a;if(X(this,W,$t).call(this),!this.media){be("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(i)}get activeCuePoint(){var i;return(i=this.media)==null?void 0:i.activeCuePoint}get cuePoints(){var i,a;return(a=(i=this.media)==null?void 0:i.cuePoints)!=null?a:[]}addChapters(i){var a;if(X(this,W,$t).call(this),!this.media){be("underlying media element missing when trying to addChapters. chapters will not be added.");return}return(a=this.media)==null?void 0:a.addChapters(i)}get activeChapter(){var i;return(i=this.media)==null?void 0:i.activeChapter}get chapters(){var i,a;return(a=(i=this.media)==null?void 0:i.chapters)!=null?a:[]}getStartDate(){var i;return(i=this.media)==null?void 0:i.getStartDate()}get currentPdt(){var i;return(i=this.media)==null?void 0:i.currentPdt}get tokens(){let i=this.getAttribute(c.PLAYBACK_TOKEN),a=this.getAttribute(c.DRM_TOKEN),r=this.getAttribute(c.THUMBNAIL_TOKEN),o=this.getAttribute(c.STORYBOARD_TOKEN);return{...U(this,zr),...i!=null?{playback:i}:{},...a!=null?{drm:a}:{},...r!=null?{thumbnail:r}:{},...o!=null?{storyboard:o}:{}}}set tokens(i){ye(this,zr,i!=null?i:{})}get playbackToken(){var i;return(i=this.getAttribute(c.PLAYBACK_TOKEN))!=null?i:void 0}set playbackToken(i){this.setAttribute(c.PLAYBACK_TOKEN,`${i}`)}get drmToken(){var i;return(i=this.getAttribute(c.DRM_TOKEN))!=null?i:void 0}set drmToken(i){this.setAttribute(c.DRM_TOKEN,`${i}`)}get thumbnailToken(){var i;return(i=this.getAttribute(c.THUMBNAIL_TOKEN))!=null?i:void 0}set thumbnailToken(i){this.setAttribute(c.THUMBNAIL_TOKEN,`${i}`)}get storyboardToken(){var i;return(i=this.getAttribute(c.STORYBOARD_TOKEN))!=null?i:void 0}set storyboardToken(i){this.setAttribute(c.STORYBOARD_TOKEN,`${i}`)}addTextTrack(i,a,r,o){var d;let s=(d=this.media)==null?void 0:d.nativeEl;if(s)return(0,R.addTextTrack)(s,i,a,r,o)}removeTextTrack(i){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,R.removeTextTrack)(a,i)}get textTracks(){var i;return(i=this.media)==null?void 0:i.textTracks}get castReceiver(){var i;return(i=this.getAttribute(c.CAST_RECEIVER))!=null?i:void 0}set castReceiver(i){i!==this.castReceiver&&(i?this.setAttribute(c.CAST_RECEIVER,i):this.removeAttribute(c.CAST_RECEIVER))}get castCustomData(){var i;return(i=this.media)==null?void 0:i.castCustomData}set castCustomData(i){if(!this.media){be("underlying media element missing when trying to set castCustomData. castCustomData will not be set.");return}this.media.castCustomData=i}get noTooltips(){return this.hasAttribute(c.NO_TOOLTIPS)}set noTooltips(i){if(!i){this.removeAttribute(c.NO_TOOLTIPS);return}this.setAttribute(c.NO_TOOLTIPS,"")}get proudlyDisplayMuxBadge(){return this.hasAttribute(c.PROUDLY_DISPLAY_MUX_BADGE)}set proudlyDisplayMuxBadge(i){i?this.setAttribute(c.PROUDLY_DISPLAY_MUX_BADGE,""):this.removeAttribute(c.PROUDLY_DISPLAY_MUX_BADGE)}};Zr=new WeakMap,Qr=new WeakMap,zr=new WeakMap,Ft=new WeakMap,Xr=new WeakMap,Ti=new WeakMap,W=new WeakSet,$t=function(){var i,a,r,o;if(!U(this,Qr)){ye(this,Qr,!0),X(this,W,Ai).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof ke.HTMLElement))throw""}catch{be("<media-theme> failed to upgrade!")}try{customElements.upgrade(this.media)}catch{be("underlying media element failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof $s))throw""}catch{be("<media-controller> failed to upgrade!")}X(this,W,zm).call(this),X(this,W,Xm).call(this),X(this,W,Jm).call(this),ye(this,Ft,(a=(i=this.mediaController)==null?void 0:i.hasAttribute(y.USER_INACTIVE))!=null?a:!0),X(this,W,jm).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>X(this,W,Ai).call(this)),(o=this.media)==null||o.addEventListener("loadstart",()=>X(this,W,Ai).call(this))}},Qm=function(){var i,a;try{(i=window==null?void 0:window.CSS)==null||i.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{}},Dd=function(i){Object.assign(U(this,Ti),i),X(this,W,Ai).call(this)},Ai=function(i={}){um(cm(zv(this,{...U(this,Ti),...i})),this.shadowRoot)},zm=function(){let i=r=>{var d,u;if(!(r!=null&&r.startsWith("theme-")))return;let o=r.replace(/^theme-/,"");if(Ld.includes(o))return;let s=this.getAttribute(r);s!=null?(d=this.mediaTheme)==null||d.setAttribute(o,s):(u=this.mediaTheme)==null||u.removeAttribute(o)};new MutationObserver(r=>{for(let{attributeName:o}of r)i(o)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(i)},Xm=function(){let i=a=>{var s;let r=(s=this.media)==null?void 0:s.error;if(!(r instanceof b.MediaError)){let{message:d,code:u}=r!=null?r:{};r=new b.MediaError(d,u)}if(!(r!=null&&r.fatal)){je(r),r.data&&je(`${r.name} data:`,r.data);return}let o=Bl(r,!1);o.message&&Il(o),be(r),r.data&&be(`${r.name} data:`,r.data),X(this,W,Dd).call(this,{isDialogOpen:!0})};this.addEventListener("error",i),this.media&&(this.media.errorTranslator=(a={})=>{var o,s,d;if(!(((o=this.media)==null?void 0:o.error)instanceof b.MediaError))return a;let r=Bl((s=this.media)==null?void 0:s.error,!1);return{player_error_code:(d=this.media)==null?void 0:d.error.code,player_error_message:r.message?String(r.message):a.player_error_message,player_error_context:r.context?String(r.context):a.player_error_context}})},Jm=function(){var a,r,o,s;let i=()=>X(this,W,Ai).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",i),(s=(o=this.media)==null?void 0:o.textTracks)==null||s.addEventListener("removetrack",i)},jm=function(){var h,T;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,o=()=>this.streamType===R.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(g,v,p=!1)=>{if(o())return;Array.from(g&&g.activeCues||[]).forEach(A=>{if(!(!A.snapToLines||A.line<-5||A.line>=0&&A.line<10))if(!v||this.paused){let L=A.text.split(`
|
|
3114
|
-
`).length,
|
|
3239
|
+
`}return pE(t)};function fE(t){var i,a;let e=t.theme;if(e){let r=(a=(i=t.getRootNode())==null?void 0:i.getElementById)==null?void 0:a.call(i,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let o=ke.customElements.get(e);if(o!=null&&o.template)return o.template}}function vE(t){var i;let e=(i=t.mediaController)==null?void 0:i.querySelector("media-time-display");return e&&getComputedStyle(e).getPropertyValue("--media-duration-display-display").trim()==="none"}function ah(t){let e=t.videoTitle?{video_title:t.videoTitle}:{};return t.getAttributeNames().filter(i=>i.startsWith("metadata-")).reduce((i,a)=>{let r=t.getAttribute(a);return r!==null&&(i[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),i},e)}var EE=Object.values(g.Attributes),bE=Object.values(yt),gE=Object.values(c),$d=On(),Wd="mux-player",rh={isDialogOpen:!1},_E={redundant_streams:!0},to,io,ao,Kt,ro,Si,W,Ft,oh,Vd,ki,nh,sh,lh,dh,Fd=class extends Bl{constructor(){super();pe(this,W);pe(this,to);pe(this,io,!1);pe(this,ao,{});pe(this,Kt,!0);pe(this,ro,new Dn(this,"hotkeys"));pe(this,Si,{...rh,onCloseErrorDialog:i=>{var r;((r=i.composedPath()[0])==null?void 0:r.localName)==="media-error-dialog"&&X(this,W,Vd).call(this,{isDialogOpen:!1})},onFocusInErrorDialog:i=>{var o;if(((o=i.composedPath()[0])==null?void 0:o.localName)!=="media-error-dialog")return;Nl(this,Gt.activeElement)||i.preventDefault()}});ye(this,to,(0,D.generatePlayerInitTime)()),this.attachShadow({mode:"open"}),X(this,W,oh).call(this),this.isConnected&&X(this,W,Ft).call(this)}static get NAME(){return Wd}static get VERSION(){return $d}static get observedAttributes(){var i;return[...(i=Bl.observedAttributes)!=null?i:[],...bE,...EE,...gE]}get mediaTheme(){var i;return(i=this.shadowRoot)==null?void 0:i.querySelector("media-theme")}get mediaController(){var i,a;return(a=(i=this.mediaTheme)==null?void 0:i.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){let i=this.media;i&&(i.metadata=ah(this))}attributeChangedCallback(i,a,r){switch(X(this,W,Ft).call(this),super.attributeChangedCallback(i,a,r),i){case c.HOTKEYS:H(this,ro).value=r;break;case c.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&it((0,D.i18n)("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").toString());break}case c.THUMBNAIL_TOKEN:{if(r){let s=(0,D.parseJwt)(r);if(s){let{aud:d}=s,u=D.MuxJWTAud.THUMBNAIL;d!==u&&it((0,D.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"thumbnail"}))}}break}case c.STORYBOARD_TOKEN:{if(r){let s=(0,D.parseJwt)(r);if(s){let{aud:d}=s,u=D.MuxJWTAud.STORYBOARD;d!==u&&it((0,D.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"storyboard"}))}}break}case c.DRM_TOKEN:{if(r){let s=(0,D.parseJwt)(r);if(s){let{aud:d}=s,u=D.MuxJWTAud.DRM;d!==u&&it((0,D.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"drm"}))}}break}case g.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&ge((0,D.i18n)("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&&![D.StreamTypes.LIVE,D.StreamTypes.ON_DEMAND,D.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:Ul({file:"invalid-stream-type.md",message:(0,D.i18n)("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===D.StreamTypes.LIVE?this.getAttribute(c.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN;break}case c.FULLSCREEN_ELEMENT:{if(r!=null||r!==a){let s=Gt.getElementById(r),d=s==null?void 0:s.querySelector("mux-player");this.mediaController&&s&&d&&(this.mediaController.fullscreenElement=s)}break}}[g.Attributes.PLAYBACK_ID,yt.SRC,c.PLAYBACK_TOKEN].includes(i)&&a!==r&&ye(this,Si,{...H(this,Si),...rh}),X(this,W,ki).call(this,{[tm(i)]:r})}async requestFullscreen(i){var a;if(!(!this.mediaController||this.mediaController.hasAttribute(n.MEDIA_IS_FULLSCREEN)))return(a=this.mediaController)==null||a.dispatchEvent(new ke.CustomEvent(m.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((r,o)=>{var s;(s=this.mediaController)==null||s.addEventListener(Le.MEDIA_IS_FULLSCREEN,()=>r(),{once:!0})})}async exitFullscreen(){var i;if(!(!this.mediaController||!this.mediaController.hasAttribute(n.MEDIA_IS_FULLSCREEN)))return(i=this.mediaController)==null||i.dispatchEvent(new ke.CustomEvent(m.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((a,r)=>{var o;(o=this.mediaController)==null||o.addEventListener(Le.MEDIA_IS_FULLSCREEN,()=>a(),{once:!0})})}get preferCmcd(){var i;return(i=this.getAttribute(g.Attributes.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?D.CmcdTypeValues.includes(i)?this.setAttribute(g.Attributes.PREFER_CMCD,i):it(`Invalid value for preferCmcd. Must be one of ${D.CmcdTypeValues.join()}`):this.removeAttribute(g.Attributes.PREFER_CMCD))}get hasPlayed(){var i,a;return(a=(i=this.mediaController)==null?void 0:i.hasAttribute(n.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var i;return(i=this.mediaController)==null?void 0:i.hasAttribute(n.MEDIA_TIME_IS_LIVE)}get _hls(){var i;return(i=this.media)==null?void 0:i._hls}get mux(){var i;return(i=this.media)==null?void 0:i.mux}get theme(){var i;return(i=this.getAttribute(c.THEME))!=null?i:mE}set theme(i){this.setAttribute(c.THEME,`${i}`)}get themeProps(){let i=this.mediaTheme;if(!i)return;let a={};for(let r of i.getAttributeNames()){if(Bd.includes(r))continue;let o=i.getAttribute(r);a[xn(r)]=o===""?!0:o}return a}set themeProps(i){var r,o;X(this,W,Ft).call(this);let a={...this.themeProps,...i};for(let s in a){if(Bd.includes(s))continue;let d=i==null?void 0:i[s];typeof d=="boolean"||d==null?(r=this.mediaTheme)==null||r.toggleAttribute(Rn(s),!!d):(o=this.mediaTheme)==null||o.setAttribute(Rn(s),d)}}get playbackId(){var i;return(i=this.getAttribute(g.Attributes.PLAYBACK_ID))!=null?i:void 0}set playbackId(i){i?this.setAttribute(g.Attributes.PLAYBACK_ID,i):this.removeAttribute(g.Attributes.PLAYBACK_ID)}get src(){var i,a;return this.playbackId?(i=Vt(this,yt.SRC))!=null?i:void 0:(a=this.getAttribute(yt.SRC))!=null?a:void 0}set src(i){i?this.setAttribute(yt.SRC,i):this.removeAttribute(yt.SRC)}get poster(){var r;let i=this.getAttribute(yt.POSTER);if(i!=null)return i;let{tokens:a}=this;if(a.playback&&!a.thumbnail){it("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return jc(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(r=this.thumbnailTime)!=null?r:this.startTime,programTime:this.programStartTime,token:a.thumbnail})}set poster(i){i||i===""?this.setAttribute(yt.POSTER,i):this.removeAttribute(yt.POSTER)}get storyboardSrc(){var i;return(i=this.getAttribute(c.STORYBOARD_SRC))!=null?i:void 0}set storyboardSrc(i){i?this.setAttribute(c.STORYBOARD_SRC,i):this.removeAttribute(c.STORYBOARD_SRC)}get storyboard(){let{tokens:i}=this;if(this.storyboardSrc&&!i.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[D.StreamTypes.LIVE,D.StreamTypes.UNKNOWN].includes(this.streamType)||i.playback&&!i.storyboard))return em(this.playbackId,{customDomain:this.customDomain,token:i.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(c.AUDIO)}set audio(i){if(!i){this.removeAttribute(c.AUDIO);return}this.setAttribute(c.AUDIO,"")}get hotkeys(){return H(this,ro)}get nohotkeys(){return this.hasAttribute(c.NOHOTKEYS)}set nohotkeys(i){if(!i){this.removeAttribute(c.NOHOTKEYS);return}this.setAttribute(c.NOHOTKEYS,"")}get thumbnailTime(){return ce(this.getAttribute(c.THUMBNAIL_TIME))}set thumbnailTime(i){this.setAttribute(c.THUMBNAIL_TIME,`${i}`)}get videoTitle(){var i,a;return(a=(i=this.getAttribute(c.VIDEO_TITLE))!=null?i:this.getAttribute(c.TITLE))!=null?a:""}set videoTitle(i){i!==this.videoTitle&&(i?this.setAttribute(c.VIDEO_TITLE,i):this.removeAttribute(c.VIDEO_TITLE))}get placeholder(){var i;return(i=Vt(this,c.PLACEHOLDER))!=null?i:""}set placeholder(i){this.setAttribute(c.PLACEHOLDER,`${i}`)}get primaryColor(){var a,r;let i=this.getAttribute(c.PRIMARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=ke.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),i))return i}set primaryColor(i){this.setAttribute(c.PRIMARY_COLOR,`${i}`)}get secondaryColor(){var a,r;let i=this.getAttribute(c.SECONDARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=ke.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),i))return i}set secondaryColor(i){this.setAttribute(c.SECONDARY_COLOR,`${i}`)}get accentColor(){var a,r;let i=this.getAttribute(c.ACCENT_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=ke.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),i))return i}set accentColor(i){this.setAttribute(c.ACCENT_COLOR,`${i}`)}get defaultShowRemainingTime(){return this.hasAttribute(c.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(i){i?this.setAttribute(c.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(c.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(c.PLAYBACK_RATES))return this.getAttribute(c.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(i=>Number(i)).filter(i=>!Number.isNaN(i)).sort((i,a)=>i-a)}set playbackRates(i){if(!i){this.removeAttribute(c.PLAYBACK_RATES);return}this.setAttribute(c.PLAYBACK_RATES,i.join(" "))}get forwardSeekOffset(){var i;return(i=ce(this.getAttribute(c.FORWARD_SEEK_OFFSET)))!=null?i:10}set forwardSeekOffset(i){this.setAttribute(c.FORWARD_SEEK_OFFSET,`${i}`)}get backwardSeekOffset(){var i;return(i=ce(this.getAttribute(c.BACKWARD_SEEK_OFFSET)))!=null?i:10}set backwardSeekOffset(i){this.setAttribute(c.BACKWARD_SEEK_OFFSET,`${i}`)}get defaultHiddenCaptions(){return this.hasAttribute(c.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(i){i?this.setAttribute(c.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(c.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return ce(this.getAttribute(c.DEFAULT_DURATION))}set defaultDuration(i){i==null?this.removeAttribute(c.DEFAULT_DURATION):this.setAttribute(c.DEFAULT_DURATION,`${i}`)}get playerInitTime(){return this.hasAttribute(g.Attributes.PLAYER_INIT_TIME)?ce(this.getAttribute(g.Attributes.PLAYER_INIT_TIME)):H(this,to)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(g.Attributes.PLAYER_INIT_TIME):this.setAttribute(g.Attributes.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_NAME))!=null?i:Wd}get playerSoftwareVersion(){var i;return(i=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_VERSION))!=null?i:$d}get beaconCollectionDomain(){var i;return(i=this.getAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var i;return(i=this.getAttribute(g.Attributes.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(g.Attributes.MAX_RESOLUTION,i):this.removeAttribute(g.Attributes.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(g.Attributes.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(g.Attributes.MIN_RESOLUTION,i):this.removeAttribute(g.Attributes.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(g.Attributes.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(g.Attributes.RENDITION_ORDER,i):this.removeAttribute(g.Attributes.RENDITION_ORDER))}get programStartTime(){return ce(this.getAttribute(g.Attributes.PROGRAM_START_TIME))}set programStartTime(i){i==null?this.removeAttribute(g.Attributes.PROGRAM_START_TIME):this.setAttribute(g.Attributes.PROGRAM_START_TIME,`${i}`)}get programEndTime(){return ce(this.getAttribute(g.Attributes.PROGRAM_END_TIME))}set programEndTime(i){i==null?this.removeAttribute(g.Attributes.PROGRAM_END_TIME):this.setAttribute(g.Attributes.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){return ce(this.getAttribute(g.Attributes.ASSET_START_TIME))}set assetStartTime(i){i==null?this.removeAttribute(g.Attributes.ASSET_START_TIME):this.setAttribute(g.Attributes.ASSET_START_TIME,`${i}`)}get assetEndTime(){return ce(this.getAttribute(g.Attributes.ASSET_END_TIME))}set assetEndTime(i){i==null?this.removeAttribute(g.Attributes.ASSET_END_TIME):this.setAttribute(g.Attributes.ASSET_END_TIME,`${i}`)}get extraSourceParams(){return this.hasAttribute(c.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(c.EXTRA_SOURCE_PARAMS)).entries()].reduce((i,[a,r])=>(i[a]=r,i),{}):_E}set extraSourceParams(i){i==null?this.removeAttribute(c.EXTRA_SOURCE_PARAMS):this.setAttribute(c.EXTRA_SOURCE_PARAMS,new URLSearchParams(i).toString())}get customDomain(){var i;return(i=this.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(g.Attributes.CUSTOM_DOMAIN,i):this.removeAttribute(g.Attributes.CUSTOM_DOMAIN))}get envKey(){var i;return(i=Vt(this,g.Attributes.ENV_KEY))!=null?i:void 0}set envKey(i){this.setAttribute(g.Attributes.ENV_KEY,`${i}`)}get noVolumePref(){return this.hasAttribute(c.NO_VOLUME_PREF)}set noVolumePref(i){i?this.setAttribute(c.NO_VOLUME_PREF,""):this.removeAttribute(c.NO_VOLUME_PREF)}get noMutedPref(){return this.hasAttribute(c.NO_MUTED_PREF)}set noMutedPref(i){i?this.setAttribute(c.NO_MUTED_PREF,""):this.removeAttribute(c.NO_MUTED_PREF)}get debug(){return Vt(this,g.Attributes.DEBUG)!=null}set debug(i){i?this.setAttribute(g.Attributes.DEBUG,""):this.removeAttribute(g.Attributes.DEBUG)}get disableTracking(){return Vt(this,g.Attributes.DISABLE_TRACKING)!=null}set disableTracking(i){this.toggleAttribute(g.Attributes.DISABLE_TRACKING,!!i)}get disableCookies(){return Vt(this,g.Attributes.DISABLE_COOKIES)!=null}set disableCookies(i){i?this.setAttribute(g.Attributes.DISABLE_COOKIES,""):this.removeAttribute(g.Attributes.DISABLE_COOKIES)}get streamType(){var i,a,r;return(r=(a=this.getAttribute(g.Attributes.STREAM_TYPE))!=null?a:(i=this.media)==null?void 0:i.streamType)!=null?r:D.StreamTypes.UNKNOWN}set streamType(i){this.setAttribute(g.Attributes.STREAM_TYPE,`${i}`)}get defaultStreamType(){var i,a,r;return(r=(a=this.getAttribute(c.DEFAULT_STREAM_TYPE))!=null?a:(i=this.mediaController)==null?void 0:i.getAttribute(c.DEFAULT_STREAM_TYPE))!=null?r:D.StreamTypes.ON_DEMAND}set defaultStreamType(i){i?this.setAttribute(c.DEFAULT_STREAM_TYPE,i):this.removeAttribute(c.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var i,a;return this.hasAttribute(c.TARGET_LIVE_WINDOW)?+this.getAttribute(c.TARGET_LIVE_WINDOW):(a=(i=this.media)==null?void 0:i.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(i){i==this.targetLiveWindow||Number.isNaN(i)&&Number.isNaN(this.targetLiveWindow)||(i==null?this.removeAttribute(c.TARGET_LIVE_WINDOW):this.setAttribute(c.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i;return(i=this.media)==null?void 0:i.liveEdgeStart}get startTime(){return ce(Vt(this,g.Attributes.START_TIME))}set startTime(i){this.setAttribute(g.Attributes.START_TIME,`${i}`)}get preferPlayback(){let i=this.getAttribute(g.Attributes.PREFER_PLAYBACK);if(i===D.PlaybackTypes.MSE||i===D.PlaybackTypes.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===D.PlaybackTypes.MSE||i===D.PlaybackTypes.NATIVE?this.setAttribute(g.Attributes.PREFER_PLAYBACK,i):this.removeAttribute(g.Attributes.PREFER_PLAYBACK))}get metadata(){var i;return(i=this.media)==null?void 0:i.metadata}set metadata(i){if(X(this,W,Ft).call(this),!this.media){ge("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...ah(this),...i}}get _hlsConfig(){var i;return(i=this.media)==null?void 0:i._hlsConfig}set _hlsConfig(i){if(X(this,W,Ft).call(this),!this.media){ge("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=i}async addCuePoints(i){var a;if(X(this,W,Ft).call(this),!this.media){ge("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(i)}get activeCuePoint(){var i;return(i=this.media)==null?void 0:i.activeCuePoint}get cuePoints(){var i,a;return(a=(i=this.media)==null?void 0:i.cuePoints)!=null?a:[]}addChapters(i){var a;if(X(this,W,Ft).call(this),!this.media){ge("underlying media element missing when trying to addChapters. chapters will not be added.");return}return(a=this.media)==null?void 0:a.addChapters(i)}get activeChapter(){var i;return(i=this.media)==null?void 0:i.activeChapter}get chapters(){var i,a;return(a=(i=this.media)==null?void 0:i.chapters)!=null?a:[]}getStartDate(){var i;return(i=this.media)==null?void 0:i.getStartDate()}get currentPdt(){var i;return(i=this.media)==null?void 0:i.currentPdt}get tokens(){let i=this.getAttribute(c.PLAYBACK_TOKEN),a=this.getAttribute(c.DRM_TOKEN),r=this.getAttribute(c.THUMBNAIL_TOKEN),o=this.getAttribute(c.STORYBOARD_TOKEN);return{...H(this,ao),...i!=null?{playback:i}:{},...a!=null?{drm:a}:{},...r!=null?{thumbnail:r}:{},...o!=null?{storyboard:o}:{}}}set tokens(i){ye(this,ao,i!=null?i:{})}get playbackToken(){var i;return(i=this.getAttribute(c.PLAYBACK_TOKEN))!=null?i:void 0}set playbackToken(i){this.setAttribute(c.PLAYBACK_TOKEN,`${i}`)}get drmToken(){var i;return(i=this.getAttribute(c.DRM_TOKEN))!=null?i:void 0}set drmToken(i){this.setAttribute(c.DRM_TOKEN,`${i}`)}get thumbnailToken(){var i;return(i=this.getAttribute(c.THUMBNAIL_TOKEN))!=null?i:void 0}set thumbnailToken(i){this.setAttribute(c.THUMBNAIL_TOKEN,`${i}`)}get storyboardToken(){var i;return(i=this.getAttribute(c.STORYBOARD_TOKEN))!=null?i:void 0}set storyboardToken(i){this.setAttribute(c.STORYBOARD_TOKEN,`${i}`)}addTextTrack(i,a,r,o){var d;let s=(d=this.media)==null?void 0:d.nativeEl;if(s)return(0,D.addTextTrack)(s,i,a,r,o)}removeTextTrack(i){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,D.removeTextTrack)(a,i)}get textTracks(){var i;return(i=this.media)==null?void 0:i.textTracks}get castReceiver(){var i;return(i=this.getAttribute(c.CAST_RECEIVER))!=null?i:void 0}set castReceiver(i){i!==this.castReceiver&&(i?this.setAttribute(c.CAST_RECEIVER,i):this.removeAttribute(c.CAST_RECEIVER))}get castCustomData(){var i;return(i=this.media)==null?void 0:i.castCustomData}set castCustomData(i){if(!this.media){ge("underlying media element missing when trying to set castCustomData. castCustomData will not be set.");return}this.media.castCustomData=i}get noTooltips(){return this.hasAttribute(c.NO_TOOLTIPS)}set noTooltips(i){if(!i){this.removeAttribute(c.NO_TOOLTIPS);return}this.setAttribute(c.NO_TOOLTIPS,"")}get proudlyDisplayMuxBadge(){return this.hasAttribute(c.PROUDLY_DISPLAY_MUX_BADGE)}set proudlyDisplayMuxBadge(i){i?this.setAttribute(c.PROUDLY_DISPLAY_MUX_BADGE,""):this.removeAttribute(c.PROUDLY_DISPLAY_MUX_BADGE)}};to=new WeakMap,io=new WeakMap,ao=new WeakMap,Kt=new WeakMap,ro=new WeakMap,Si=new WeakMap,W=new WeakSet,Ft=function(){var i,a,r,o;if(!H(this,io)){ye(this,io,!0),X(this,W,ki).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof ke.HTMLElement))throw""}catch{ge("<media-theme> failed to upgrade!")}try{customElements.upgrade(this.media)}catch{ge("underlying media element failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof Xs))throw""}catch{ge("<media-controller> failed to upgrade!")}X(this,W,nh).call(this),X(this,W,sh).call(this),X(this,W,lh).call(this),ye(this,Kt,(a=(i=this.mediaController)==null?void 0:i.hasAttribute(y.USER_INACTIVE))!=null?a:!0),X(this,W,dh).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>X(this,W,ki).call(this)),(o=this.media)==null||o.addEventListener("loadstart",()=>X(this,W,ki).call(this))}},oh=function(){var i,a;try{(i=window==null?void 0:window.CSS)==null||i.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{}},Vd=function(i){Object.assign(H(this,Si),i),X(this,W,ki).call(this)},ki=function(i={}){Am(Tm(hE(this,{...H(this,Si),...i})),this.shadowRoot)},nh=function(){let i=r=>{var d,u;if(!(r!=null&&r.startsWith("theme-")))return;let o=r.replace(/^theme-/,"");if(Bd.includes(o))return;let s=this.getAttribute(r);s!=null?(d=this.mediaTheme)==null||d.setAttribute(o,s):(u=this.mediaTheme)==null||u.removeAttribute(o)};new MutationObserver(r=>{for(let{attributeName:o}of r)i(o)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(i)},sh=function(){let i=a=>{var s;let r=(s=this.media)==null?void 0:s.error;if(!(r instanceof g.MediaError)){let{message:d,code:u}=r!=null?r:{};r=new g.MediaError(d,u)}if(!(r!=null&&r.fatal)){it(r),r.data&&it(`${r.name} data:`,r.data);return}let o=zl(r,!1);o.message&&Ul(o),ge(r),r.data&&ge(`${r.name} data:`,r.data),X(this,W,Vd).call(this,{isDialogOpen:!0})};this.addEventListener("error",i),this.media&&(this.media.errorTranslator=(a={})=>{var o,s,d;if(!(((o=this.media)==null?void 0:o.error)instanceof g.MediaError))return a;let r=zl((s=this.media)==null?void 0:s.error,!1);return{player_error_code:(d=this.media)==null?void 0:d.error.code,player_error_message:r.message?String(r.message):a.player_error_message,player_error_context:r.context?String(r.context):a.player_error_context}})},lh=function(){var a,r,o,s;let i=()=>X(this,W,ki).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",i),(s=(o=this.media)==null?void 0:o.textTracks)==null||s.addEventListener("removetrack",i)},dh=function(){var p,T;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,o=()=>this.streamType===D.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(_,E,f=!1)=>{if(o())return;Array.from(_&&_.activeCues||[]).forEach(b=>{if(!(!b.snapToLines||b.line<-5||b.line>=0&&b.line<10))if(!E||this.paused){let M=b.text.split(`
|
|
3240
|
+
`).length,C=-3;this.streamType===D.StreamTypes.LIVE&&(C=-2);let ie=C-M;if(b.line===ie&&!f)return;r.has(b)||r.set(b,b.line),b.line=ie}else setTimeout(()=>{b.line=r.get(b)||"auto"},500)})},d=()=>{var _,E;s(a,(E=(_=this.mediaController)==null?void 0:_.hasAttribute(y.USER_INACTIVE))!=null?E:!1)},u=()=>{var f,I;let E=Array.from(((I=(f=this.mediaController)==null?void 0:f.media)==null?void 0:I.textTracks)||[]).filter(b=>["subtitles","captions"].includes(b.kind)&&b.mode==="showing")[0];E!==a&&(a==null||a.removeEventListener("cuechange",d)),a=E,a==null||a.addEventListener("cuechange",d),s(a,H(this,Kt))};u(),(p=this.textTracks)==null||p.addEventListener("change",u),(T=this.textTracks)==null||T.addEventListener("addtrack",u),this.addEventListener("userinactivechange",()=>{var E,f;let _=(f=(E=this.mediaController)==null?void 0:E.hasAttribute(y.USER_INACTIVE))!=null?f:!0;H(this,Kt)!==_&&(ye(this,Kt,_),s(a,H(this,Kt)))})};function Vt(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var AE=Fd;
|