@mux/mux-player 3.11.7 → 3.11.8-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base.cjs.js +70 -69
- package/dist/base.mjs +22 -21
- package/dist/mux-player.js +42 -41
- package/dist/mux-player.mjs +42 -41
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/base.cjs.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";var zs=Object.defineProperty;var Hh=Object.getOwnPropertyDescriptor;var Bh=Object.getOwnPropertyNames;var $h=Object.prototype.hasOwnProperty;var Lu=t=>{throw TypeError(t)};var Wh=(t,e)=>{for(var i in e)zs(t,i,{get:e[i],enumerable:!0})},Fh=(t,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Bh(e))!$h.call(t,r)&&r!==i&&zs(t,r,{get:()=>e[r],enumerable:!(a=Hh(e,r))||a.enumerable});return t};var Vh=t=>Fh(zs({},"__esModule",{value:!0}),t);var Qs=(t,e,i)=>e.has(t)||Lu("Cannot "+i);var R=(t,e,i)=>(Qs(t,e,"read from private field"),i?i.call(t):e.get(t)),ae=(t,e,i)=>e.has(t)?Lu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),de=(t,e,i,a)=>(Qs(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),J=(t,e,i)=>(Qs(t,e,"access private method"),i);var GE={};Wh(GE,{MediaError:()=>b.MediaError,default:()=>KE,generatePlayerInitTime:()=>O.generatePlayerInitTime,getVideoAttribute:()=>ii,playerSoftwareName:()=>cu,playerSoftwareVersion:()=>uu});module.exports=Vh(GE);var Ui=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Ui{}globalThis.DocumentFragment=t}var er=class extends Ui{},Xs=class extends Ui{},Kh={get(t){},define(t,e,i){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(er)}},tr,Js=class{constructor(e,i={}){ae(this,tr);de(this,tr,i==null?void 0:i.detail)}get detail(){return R(this,tr)}initCustomEvent(){}};tr=new WeakMap;function Gh(t,e){return new er}var Cu={document:{createElement:Gh},DocumentFragment,customElements:Kh,CustomEvent:Js,EventTarget:Ui,HTMLElement:er,HTMLVideoElement:Xs},wu=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Se=wu?Cu:globalThis,ri=wu?Cu.document:globalThis.document;var h={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"},D={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},js={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"},Ru=Object.entries(js),n=Ru.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{}),Yh={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Ie=Ru.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{...Yh}),QE=Object.entries(Ie).reduce((t,[e,i])=>{let a=n[e];return a&&(t[i]=a),t},{userinactivechange:"userinactive"}),xu=Object.entries(n).reduce((t,[e,i])=>{let a=Ie[e];return a&&(t[i]=a),t},{userinactive:"userinactivechange"}),_e={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Nt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var So={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Ae={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Be={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Du={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function Ou(t){return t==null?void 0:t.map(Zh).join(" ")}function Pu(t){return t==null?void 0:t.split(/\s+/).map(zh)}function Zh(t){if(t){let{id:e,width:i,height:a}=t;return[e,i,a].filter(r=>r!=null).join(":")}}function zh(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(Qh).join(" ")}function Uu(t){return t==null?void 0:t.split(/\s+/).map(Xh)}function Qh(t){if(t){let{id:e,kind:i,language:a,label:r}=t;return[e,i,a,r].filter(o=>o!=null).join(":")}}function Xh(t){if(t){let[e,i,a,r]=t.split(":");return{id:e,kind:i,language:a,label:r}}}function Hu(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function Hi(t){return typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t)}function Io(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))}var Mo=t=>new Promise(e=>setTimeout(e,t));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.",hour:"hour",hours:"hours",minute:"minute",minutes:"minutes",second:"second",seconds:"seconds","{time} remaining":"{time} remaining","{currentTime} of {totalTime}":"{currentTime} of {totalTime}","video not loaded, unknown time.":"video not loaded, unknown time."};var $u,el={en:Bu},tl=(($u=globalThis.navigator)==null?void 0:$u.language)||"en",Wu=t=>{tl=t};var Jh=t=>{var e,i,a;let[r]=tl.split("-");return((e=el[tl])==null?void 0:e[t])||((i=el[r])==null?void 0:i[t])||((a=el.en)==null?void 0:a[t])||t},c=(t,e={})=>Jh(t).replace(/\{(\w+)\}/g,(i,a)=>a in e?String(e[a]):`{${a}}`);var Fu=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],jh=(t,e)=>{let i=t===1?c(Fu[e].singular):c(Fu[e].plural);return`${t} ${i}`},oi=t=>{if(!Hi(t))return"";let e=Math.abs(t),i=e!==t,a=new Date(0,0,0,0,0,e,0),o=[a.getHours(),a.getMinutes(),a.getSeconds()].map((s,d)=>s&&jh(s,d)).filter(s=>s).join(", ");return i?c("{time} remaining",{time:o}):o};function $e(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 ab=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 Lo=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Co=class extends Lo{},wo=class extends Co{constructor(){super(...arguments),this.role=null}},il=class{observe(){}unobserve(){}disconnect(){}},Vu={createElement:function(){return new ir.HTMLElement},createElementNS:function(){return new ir.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(t){return!1}},ir={ResizeObserver:il,document:Vu,Node:Co,Element:wo,HTMLElement:class extends wo{constructor(){super(...arguments),this.innerHTML=""}get content(){return new ir.DocumentFragment}},DocumentFragment:class extends Lo{},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}}}}},Ku="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window=="undefined"||typeof window.customElements=="undefined",Gu=Object.keys(ir).every(t=>t in globalThis),l=Ku&&!Gu?ir:globalThis,V=Ku&&!Gu?Vu:globalThis.document;var Yu=new WeakMap,al=t=>{let e=Yu.get(t);return e||Yu.set(t,e=new Set),e},qu=new l.ResizeObserver(t=>{for(let e of t)for(let i of al(e.target))i(e)});function _t(t,e){al(t).add(e),qu.observe(t)}function At(t,e){let i=al(t);i.delete(e),i.size||qu.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=Ro(t))!=null?e:Xe(t,"media-controller")}function Ro(t){var e;let{MEDIA_CONTROLLER:i}=D,a=t.getAttribute(i);if(a)return(e=ni(t))==null?void 0:e.getElementById(a)}var xo=(t,e,i=".value")=>{let a=t.querySelector(i);a&&(a.textContent=e)},tp=(t,e)=>{let i=`slot[name="${e}"]`,a=t.shadowRoot.querySelector(i);return a?a.children:[]},Do=(t,e)=>tp(t,e)[0],he=(t,e)=>!t||!e?!1:t!=null&&t.contains(e)?!0:he(t,e.getRootNode().host),Xe=(t,e)=>{if(!t)return null;let i=t.closest(e);return i||Xe(t.getRootNode().host,e)};function ar(t=document){var e;let i=t==null?void 0:t.activeElement;return i?(e=ar(i.shadowRoot))!=null?e:i:null}function ni(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 Oo(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 Zu(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=ip(t,a=>a===e);return i||rr(t,e)}function ip(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 rr(t,e){var i,a;let r=(i=t.querySelectorAll("style:not([media])"))!=null?i:[],o=r==null?void 0:r[r.length-1];if(!(o!=null&&o.sheet))return console.warn("Media Chrome: No style sheet found on style tag of",t),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}};let s=o==null?void 0:o.sheet.insertRule(`${e}{}`,o.sheet.cssRules.length);return(a=o.sheet.cssRules)==null?void 0:a[s]}function P(t,e,i=Number.NaN){let a=t.getAttribute(e);return a!=null?+a:i}function U(t,e,i){let a=+i;if(i==null||Number.isNaN(a)){t.hasAttribute(e)&&t.removeAttribute(e);return}P(t,e,void 0)!==a&&t.setAttribute(e,`${a}`)}function M(t,e){return t.hasAttribute(e)}function L(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}M(t,e)!=i&&t.toggleAttribute(e,i)}function x(t,e,i=null){var a;return(a=t.getAttribute(e))!=null?a:i}function w(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}let a=`${i}`;x(t,e,void 0)!==a&&t.setAttribute(e,a)}var zu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},We=(t,e,i)=>(zu(t,e,"read from private field"),i?i.call(t):e.get(t)),ap=(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)},Po=(t,e,i,a)=>(zu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ue;function rp(t){return`
|
|
1
|
+
"use strict";var Xs=Object.defineProperty;var Hh=Object.getOwnPropertyDescriptor;var Bh=Object.getOwnPropertyNames;var $h=Object.prototype.hasOwnProperty;var Lu=t=>{throw TypeError(t)};var Wh=(t,e)=>{for(var i in e)Xs(t,i,{get:e[i],enumerable:!0})},Fh=(t,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Bh(e))!$h.call(t,r)&&r!==i&&Xs(t,r,{get:()=>e[r],enumerable:!(a=Hh(e,r))||a.enumerable});return t};var Vh=t=>Fh(Xs({},"__esModule",{value:!0}),t);var Js=(t,e,i)=>e.has(t)||Lu("Cannot "+i);var R=(t,e,i)=>(Js(t,e,"read from private field"),i?i.call(t):e.get(t)),ae=(t,e,i)=>e.has(t)?Lu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),de=(t,e,i,a)=>(Js(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),J=(t,e,i)=>(Js(t,e,"access private method"),i);var GE={};Wh(GE,{MediaError:()=>b.MediaError,default:()=>KE,generatePlayerInitTime:()=>O.generatePlayerInitTime,getVideoAttribute:()=>ii,playerSoftwareName:()=>hu,playerSoftwareVersion:()=>mu});module.exports=Vh(GE);var Ui=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Ui{}globalThis.DocumentFragment=t}var ir=class extends Ui{},js=class extends Ui{},Kh={get(t){},define(t,e,i){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(ir)}},ar,el=class{constructor(e,i={}){ae(this,ar);de(this,ar,i==null?void 0:i.detail)}get detail(){return R(this,ar)}initCustomEvent(){}};ar=new WeakMap;function Gh(t,e){return new ir}var Cu={document:{createElement:Gh},DocumentFragment,customElements:Kh,CustomEvent:el,EventTarget:Ui,HTMLElement:ir,HTMLVideoElement:js},wu=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Se=wu?Cu:globalThis,ri=wu?Cu.document:globalThis.document;var h={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"},D={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},tl={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"},Ru=Object.entries(tl),n=Ru.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{}),Yh={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Ie=Ru.reduce((t,[e,i])=>(t[e]=i.toLowerCase(),t),{...Yh}),QE=Object.entries(Ie).reduce((t,[e,i])=>{let a=n[e];return a&&(t[i]=a),t},{userinactivechange:"userinactive"}),xu=Object.entries(n).reduce((t,[e,i])=>{let a=Ie[e];return a&&(t[i]=a),t},{userinactive:"userinactivechange"}),_e={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Nt={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Mo={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Ae={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Be={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Du={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function Ou(t){return t==null?void 0:t.map(Zh).join(" ")}function Pu(t){return t==null?void 0:t.split(/\s+/).map(zh)}function Zh(t){if(t){let{id:e,width:i,height:a}=t;return[e,i,a].filter(r=>r!=null).join(":")}}function zh(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(Qh).join(" ")}function Uu(t){return t==null?void 0:t.split(/\s+/).map(Xh)}function Qh(t){if(t){let{id:e,kind:i,language:a,label:r}=t;return[e,i,a,r].filter(o=>o!=null).join(":")}}function Xh(t){if(t){let[e,i,a,r]=t.split(":");return{id:e,kind:i,language:a,label:r}}}function Hu(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function Hi(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 Co=t=>new Promise(e=>setTimeout(e,t));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.",hour:"hour",hours:"hours",minute:"minute",minutes:"minutes",second:"second",seconds:"seconds","{time} remaining":"{time} remaining","{currentTime} of {totalTime}":"{currentTime} of {totalTime}","video not loaded, unknown time.":"video not loaded, unknown time."};var $u,il={en:Bu},al=(($u=globalThis.navigator)==null?void 0:$u.language)||"en",Wu=t=>{al=t};var Jh=t=>{var e,i,a;let[r]=al.split("-");return((e=il[al])==null?void 0:e[t])||((i=il[r])==null?void 0:i[t])||((a=il.en)==null?void 0:a[t])||t},c=(t,e={})=>Jh(t).replace(/\{(\w+)\}/g,(i,a)=>a in e?String(e[a]):`{${a}}`);var Fu=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],jh=(t,e)=>{let i=t===1?c(Fu[e].singular):c(Fu[e].plural);return`${t} ${i}`},oi=t=>{if(!Hi(t))return"";let e=Math.abs(t),i=e!==t,a=new Date(0,0,0,0,0,e,0),o=[a.getHours(),a.getMinutes(),a.getSeconds()].map((s,d)=>s&&jh(s,d)).filter(s=>s).join(", ");return i?c("{time} remaining",{time:o}):o};function $e(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 ab=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 wo=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Ro=class extends wo{},xo=class extends Ro{constructor(){super(...arguments),this.role=null}},rl=class{observe(){}unobserve(){}disconnect(){}},Vu={createElement:function(){return new rr.HTMLElement},createElementNS:function(){return new rr.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(t){return!1}},rr={ResizeObserver:rl,document:Vu,Node:Ro,Element:xo,HTMLElement:class extends xo{constructor(){super(...arguments),this.innerHTML=""}get content(){return new rr.DocumentFragment}},DocumentFragment:class extends wo{},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}}}}},Ku="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window=="undefined"||typeof window.customElements=="undefined",Gu=Object.keys(rr).every(t=>t in globalThis),l=Ku&&!Gu?rr:globalThis,V=Ku&&!Gu?Vu:globalThis.document;var Yu=new WeakMap,ol=t=>{let e=Yu.get(t);return e||Yu.set(t,e=new Set),e},qu=new l.ResizeObserver(t=>{for(let e of t)for(let i of ol(e.target))i(e)});function _t(t,e){ol(t).add(e),qu.observe(t)}function At(t,e){let i=ol(t);i.delete(e),i.size||qu.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=Do(t))!=null?e:Xe(t,"media-controller")}function Do(t){var e;let{MEDIA_CONTROLLER:i}=D,a=t.getAttribute(i);if(a)return(e=ni(t))==null?void 0:e.getElementById(a)}var Oo=(t,e,i=".value")=>{let a=t.querySelector(i);a&&(a.textContent=e)},tp=(t,e)=>{let i=`slot[name="${e}"]`,a=t.shadowRoot.querySelector(i);return a?a.children:[]},Po=(t,e)=>tp(t,e)[0],he=(t,e)=>!t||!e?!1:t!=null&&t.contains(e)?!0:he(t,e.getRootNode().host),Xe=(t,e)=>{if(!t)return null;let i=t.closest(e);return i||Xe(t.getRootNode().host,e)};function or(t=document){var e;let i=t==null?void 0:t.activeElement;return i?(e=or(i.shadowRoot))!=null?e:i:null}function ni(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 No(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 Zu(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=ip(t,a=>a===e);return i||nr(t,e)}function ip(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 nr(t,e){var i,a;let r=(i=t.querySelectorAll("style:not([media])"))!=null?i:[],o=r==null?void 0:r[r.length-1];if(!(o!=null&&o.sheet))return console.warn("Media Chrome: No style sheet found on style tag of",t),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}};let s=o==null?void 0:o.sheet.insertRule(`${e}{}`,o.sheet.cssRules.length);return(a=o.sheet.cssRules)==null?void 0:a[s]}function P(t,e,i=Number.NaN){let a=t.getAttribute(e);return a!=null?+a:i}function U(t,e,i){let a=+i;if(i==null||Number.isNaN(a)){t.hasAttribute(e)&&t.removeAttribute(e);return}P(t,e,void 0)!==a&&t.setAttribute(e,`${a}`)}function M(t,e){return t.hasAttribute(e)}function L(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}M(t,e)!=i&&t.toggleAttribute(e,i)}function x(t,e,i=null){var a;return(a=t.getAttribute(e))!=null?a:i}function w(t,e,i){if(i==null){t.hasAttribute(e)&&t.removeAttribute(e);return}let a=`${i}`;x(t,e,void 0)!==a&&t.setAttribute(e,a)}var zu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},We=(t,e,i)=>(zu(t,e,"read from private field"),i?i.call(t):e.get(t)),ap=(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)=>(zu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ue;function rp(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 Bi=class extends l.HTMLElement{constructor(){if(super(),ap(this,ue,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[D.MEDIA_CONTROLLER,n.MEDIA_PAUSED]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===D.MEDIA_CONTROLLER&&(i&&((o=(r=We(this,ue))==null?void 0:r.unassociateElement)==null||o.call(r,this),
|
|
8
|
+
`}var Bi=class extends l.HTMLElement{constructor(){if(super(),ap(this,ue,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[D.MEDIA_CONTROLLER,n.MEDIA_PAUSED]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===D.MEDIA_CONTROLLER&&(i&&((o=(r=We(this,ue))==null?void 0:r.unassociateElement)==null||o.call(r,this),Uo(this,ue,null)),a&&this.isConnected&&(Uo(this,ue,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=We(this,ue))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,i;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Uo(this,ue,op(this)),this.getAttribute(D.MEDIA_CONTROLLER)&&((i=(e=We(this,ue))==null?void 0:e.associateElement)==null||i.call(e,this)),We(this,ue)&&(We(this,ue).addEventListener("pointerdown",this),We(this,ue).addEventListener("click",this),We(this,ue).hasAttribute("tabindex")||(We(this,ue).tabIndex=0))}disconnectedCallback(){var e,i,a,r;this.getAttribute(D.MEDIA_CONTROLLER)&&((i=(e=We(this,ue))==null?void 0:e.unassociateElement)==null||i.call(e,this)),(a=We(this,ue))==null||a.removeEventListener("pointerdown",this),(r=We(this,ue))==null||r.removeEventListener("click",this),Uo(this,ue,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:f,height:y}=this.getBoundingClientRect(),A=o-d,E=s-u;if(A<0||E<0||A>f||E>y||f===0&&y===0)return;let p=this._pointerType||"mouse";if(this._pointerType=void 0,p===Mo.TOUCH){this.handleTap(e);return}else if(p===Mo.MOUSE||p===Mo.PEN){this.handleMouseClick(e);return}}}}get mediaPaused(){return M(this,n.MEDIA_PAUSED)}set mediaPaused(e){L(this,n.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let i=this.mediaPaused?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(i,{composed:!0,bubbles:!0}))}};ue=new WeakMap;Bi.shadowRootOptions={mode:"open"};Bi.getTemplateHTML=rp;function op(t){var e;let i=t.getAttribute(D.MEDIA_CONTROLLER);return i?(e=t.getRootNode())==null?void 0:e.getElementById(i):Xe(t,"media-controller")}l.customElements.get("media-gesture-receiver")||l.customElements.define("media-gesture-receiver",Bi);var Ho=Bi;var dl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ee=(t,e,i)=>(dl(t,e,"read from private field"),i?i.call(t):e.get(t)),pe=(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)},Fe=(t,e,i,a)=>(dl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ve=(t,e,i)=>(dl(t,e,"access private method"),i),sr,Wo,$i,Vi,Fi,nl,Wi,Bo,sl,Qu,ll,Xu,lr,Fo,Vo,ul,Ki,dr,Ut,$o,I={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive",AUTOHIDE_OVER_CONTROLS:"autohideovercontrols"};function np(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="${Ho.shadowRootOptions.mode}">
|
|
147
|
+
${Ho.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 sp=Object.values(n),lp="sm:384 md:576 lg:768 xl:960";function dp(t){Ju(t.target,t.contentRect.width)}function Ju(t,e){var i;if(!t.isConnected)return;let a=(i=t.getAttribute(I.BREAKPOINTS))!=null?i:lp,r=up(a),o=cp(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(Ie.BREAKPOINTS_CHANGE,{detail:o});t.dispatchEvent(d)}t.breakpointsComputed||(t.breakpointsComputed=!0,t.dispatchEvent(new CustomEvent(Ie.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function up(t){let e=t.split(/\s+/);return Object.fromEntries(e.map(i=>i.split(":")))}function cp(t,e){return Object.keys(t).filter(i=>e>=parseInt(t[i]))}var si=class extends l.HTMLElement{constructor(){if(super(),pe(this,ol),pe(this,nl),pe(this,nr),pe(this,Wo),pe(this,Ki),pe(this,or,void 0),pe(this,Bo,0),pe(this,$i,null),pe(this,Vi,null),pe(this,Fi,void 0),this.breakpointsComputed=!1,pe(this,rl,e=>{let i=this.media;for(let a of e){if(a.type!=="childList")continue;let r=a.removedNodes;for(let o of r){if(o.slot!="media"||a.target!=this)continue;let s=a.previousSibling&&a.previousSibling.previousElementSibling;if(!s||!i)this.mediaUnsetCallback(o);else{let d=s.slot!=="media";for(;(s=s.previousSibling)!==null;)s.slot=="media"&&(d=!1);d&&this.mediaUnsetCallback(o)}}if(i)for(let o of a.addedNodes)o===i&&this.handleMediaUpdated(i)}}),pe(this,Wi,!1),pe(this,Uo,e=>{ee(this,Wi)||(setTimeout(()=>{dp(e),Fe(this,Wi,!1)},0),Fe(this,Wi,!0))}),pe(this,Ut,void 0),pe(this,Ho,()=>{if(!ee(this,Ut).assignedElements({flatten:!0}).length){ee(this,$i)&&this.mediaUnsetCallback(ee(this,$i));return}this.handleMediaUpdated(this.media)}),!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}Fe(this,or,new MutationObserver(ee(this,rl)))}static get observedAttributes(){return[I.AUTOHIDE,I.GESTURES_DISABLED].concat(sp).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()==I.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&&(Fe(this,$i,e),e.localName.includes("-")&&await l.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;ee(this,or).observe(this,{childList:!0,subtree:!0}),_t(this,ee(this,Uo));let a=this.getAttribute(I.AUDIO)!=null?c("audio player"):c("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.handleMediaUpdated(this.media),this.setAttribute(I.USER_INACTIVE,""),Ju(this,this.getBoundingClientRect().width);let r=this.querySelector(":scope > slot[slot=media]");r&&(Fe(this,Ut,r),ee(this,Ut).addEventListener("slotchange",ee(this,Ho))),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;At(this,ee(this,Uo)),clearTimeout(ee(this,Vi)),ee(this,or).disconnect(),this.media&&this.mediaUnsetCallback(this.media),(e=l.window)==null||e.removeEventListener("mouseup",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointermove",this),this.removeEventListener("pointerup",this),this.removeEventListener("mouseleave",this),this.removeEventListener("keyup",this),ee(this,Ut)&&(ee(this,Ut).removeEventListener("slotchange",ee(this,Ho)),Fe(this,Ut,null)),Fe(this,Wi,!1)}mediaSetCallback(e){}mediaUnsetCallback(e){Fe(this,$i,null)}handleEvent(e){switch(e.type){case"pointerdown":Fe(this,Bo,e.timeStamp);break;case"pointermove":Ve(this,ol,Qu).call(this,e);break;case"pointerup":Ve(this,nl,Xu).call(this,e);break;case"mouseleave":Ve(this,nr,$o).call(this);break;case"mouseup":this.removeAttribute(I.KEYBOARD_CONTROL);break;case"keyup":Ve(this,Ki,sr).call(this),this.setAttribute(I.KEYBOARD_CONTROL,"");break}}set autohide(e){let i=Number(e);Fe(this,Fi,isNaN(i)?0:i)}get autohide(){return(ee(this,Fi)===void 0?2:ee(this,Fi)).toString()}get breakpoints(){return x(this,I.BREAKPOINTS)}set breakpoints(e){w(this,I.BREAKPOINTS,e)}get audio(){return M(this,I.AUDIO)}set audio(e){L(this,I.AUDIO,e)}get gesturesDisabled(){return M(this,I.GESTURES_DISABLED)}set gesturesDisabled(e){L(this,I.GESTURES_DISABLED,e)}get keyboardControl(){return M(this,I.KEYBOARD_CONTROL)}set keyboardControl(e){L(this,I.KEYBOARD_CONTROL,e)}get noAutohide(){return M(this,I.NO_AUTOHIDE)}set noAutohide(e){L(this,I.NO_AUTOHIDE,e)}get autohideOverControls(){return M(this,I.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){L(this,I.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return M(this,I.USER_INACTIVE)}set userInteractive(e){L(this,I.USER_INACTIVE,e)}};or=new WeakMap;Bo=new WeakMap;$i=new WeakMap;Vi=new WeakMap;Fi=new WeakMap;rl=new WeakMap;Wi=new WeakMap;Uo=new WeakMap;ol=new WeakSet;Qu=function(t){if(t.pointerType!=="mouse"&&t.timeStamp-ee(this,Bo)<250)return;Ve(this,Wo,ll).call(this),clearTimeout(ee(this,Vi));let e=this.hasAttribute(I.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(t.target)||e)&&Ve(this,Ki,sr).call(this)};nl=new WeakSet;Xu=function(t){if(t.pointerType==="touch"){let e=!this.hasAttribute(I.USER_INACTIVE);[this,this.media].includes(t.target)&&e?Ve(this,nr,$o).call(this):Ve(this,Ki,sr).call(this)}else t.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Ve(this,Ki,sr).call(this)};nr=new WeakSet;$o=function(){if(ee(this,Fi)<0||this.hasAttribute(I.USER_INACTIVE))return;this.setAttribute(I.USER_INACTIVE,"");let t=new l.CustomEvent(Ie.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(t)};Wo=new WeakSet;ll=function(){if(!this.hasAttribute(I.USER_INACTIVE))return;this.removeAttribute(I.USER_INACTIVE);let t=new l.CustomEvent(Ie.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(t)};Ki=new WeakSet;sr=function(){Ve(this,Wo,ll).call(this),clearTimeout(ee(this,Vi));let t=parseInt(this.autohide);t<0||Fe(this,Vi,setTimeout(()=>{Ve(this,nr,$o).call(this)},t*1e3))};Ut=new WeakMap;Ho=new WeakMap;si.shadowRootOptions={mode:"open"};si.getTemplateHTML=np;l.customElements.get("media-container")||l.customElements.define("media-container",si);var ju=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},se=(t,e,i)=>(ju(t,e,"read from private field"),i?i.call(t):e.get(t)),lr=(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)},Fo=(t,e,i,a)=>(ju(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Gi,Yi,Vo,li,Tt,Ht,Bt=class{constructor(e,i,{defaultValue:a}={defaultValue:void 0}){lr(this,Tt),lr(this,Gi,void 0),lr(this,Yi,void 0),lr(this,Vo,void 0),lr(this,li,new Set),Fo(this,Gi,e),Fo(this,Yi,i),Fo(this,Vo,new Set(a))}[Symbol.iterator](){return se(this,Tt,Ht).values()}get length(){return se(this,Tt,Ht).size}get value(){var e;return(e=[...se(this,Tt,Ht)].join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Fo(this,li,new Set),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return[...se(this,Tt,Ht)][e]}values(){return se(this,Tt,Ht).values()}forEach(e,i){se(this,Tt,Ht).forEach(e,i)}add(...e){var i,a;e.forEach(r=>se(this,li).add(r)),!(this.value===""&&!((i=se(this,Gi))!=null&&i.hasAttribute(`${se(this,Yi)}`)))&&((a=se(this,Gi))==null||a.setAttribute(`${se(this,Yi)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>se(this,li).delete(a)),(i=se(this,Gi))==null||i.setAttribute(`${se(this,Yi)}`,`${this.value}`)}contains(e){return se(this,Tt,Ht).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}};Gi=new WeakMap;Yi=new WeakMap;Vo=new WeakMap;li=new WeakMap;Tt=new WeakSet;Ht=function(){return se(this,li).size?se(this,li):se(this,Vo)};var mp=(t="")=>t.split(/\s+/),ec=(t="")=>{let[e,i,a]=t.split(":"),r=a?decodeURIComponent(a):void 0;return{kind:e==="cc"?_e.CAPTIONS:_e.SUBTITLES,language:i,label:r}},di=(t="",e={})=>mp(t).map(i=>{let a=ec(i);return{...e,...a}}),dl=t=>t?Array.isArray(t)?t.map(e=>typeof e=="string"?ec(e):e):typeof t=="string"?di(t):[t]:[],Ko=({kind:t,label:e,language:i}={kind:"subtitles"})=>e?`${t==="captions"?"cc":"sb"}:${i}:${encodeURIComponent(e)}`:i,yt=(t=[])=>Array.prototype.map.call(t,Ko).join(" "),hp=(t,e)=>i=>i[t]===e,tc=t=>{let e=Object.entries(t).map(([i,a])=>hp(i,a));return i=>e.every(a=>a(i))},ui=(t,e=[],i=[])=>{let a=dl(i).map(tc),r=o=>a.some(s=>s(o));Array.from(e).filter(r).forEach(o=>{o.mode=t})},ci=(t,e=()=>!0)=>{if(!(t!=null&&t.textTracks))return[];let i=typeof e=="function"?e:tc(e);return Array.from(t.textTracks).filter(i)},Go=t=>{var e;return!!((e=t.mediaSubtitlesShowing)!=null&&e.length)||t.hasAttribute(n.MEDIA_SUBTITLES_SHOWING)};var ac=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)}},ic="exitFullscreen"in V?"exitFullscreen":"webkitExitFullscreen"in V?"webkitExitFullscreen":"webkitCancelFullScreen"in V?"webkitCancelFullScreen":void 0,rc=t=>{var e;let{documentElement:i}=t;if(ic){let a=(e=i==null?void 0:i[ic])==null?void 0:e.call(i);if(a instanceof Promise)return a.catch(()=>{})}},dr="fullscreenElement"in V?"fullscreenElement":"webkitFullscreenElement"in V?"webkitFullscreenElement":void 0,pp=t=>{let{documentElement:e,media:i}=t,a=e==null?void 0:e[dr];return!a&&"webkitDisplayingFullscreen"in i&&"webkitPresentationMode"in i&&i.webkitDisplayingFullscreen&&i.webkitPresentationMode===Du.FULLSCREEN?i:a},oc=t=>{var e;let{media:i,documentElement:a,fullscreenElement:r=i}=t;if(!i||!a)return!1;let o=pp(t);if(!o)return!1;if(o===r||o===i)return!0;if(o.localName.includes("-")){let s=o.shadowRoot;if(!(dr in s))return he(o,r);for(;s!=null&&s[dr];){if(s[dr]===r)return!0;s=(e=s[dr])==null?void 0:e.shadowRoot}}return!1},fp="fullscreenEnabled"in V?"fullscreenEnabled":"webkitFullscreenEnabled"in V?"webkitFullscreenEnabled":void 0,nc=t=>{let{documentElement:e,media:i}=t;return!!(e!=null&&e[fp])||i&&"webkitSupportsFullscreen"in i};var Yo,ul=()=>{var t,e;return Yo||(Yo=(e=(t=V)==null?void 0:t.createElement)==null?void 0:e.call(t,"video"),Yo)},sc=async(t=ul())=>{if(!t)return!1;let e=t.volume;t.volume=e/2+.1;let i=new AbortController,a=await Promise.race([vp(t,i.signal),Ep(t,e)]);return i.abort(),a},vp=(t,e)=>new Promise(i=>{t.addEventListener("volumechange",()=>i(!0),{signal:e})}),Ep=async(t,e)=>{for(let i=0;i<10;i++){if(t.volume===e)return!1;await Mo(10)}return t.volume!==e},bp=/.*Version\/.*Safari\/.*/.test(l.navigator.userAgent),cl=(t=ul())=>l.matchMedia("(display-mode: standalone)").matches&&bp?!1:typeof(t==null?void 0:t.requestPictureInPicture)=="function",ml=(t=ul())=>nc({documentElement:V,media:t}),lc=ml(),dc=cl(),uc=!!l.WebKitPlaybackTargetAvailabilityEvent,cc=!!l.chrome;var qi=t=>ci(t.media,e=>[_e.SUBTITLES,_e.CAPTIONS].includes(e.kind)).sort((e,i)=>e.kind>=i.kind?1:-1),hl=t=>ci(t.media,e=>e.mode===Nt.SHOWING&&[_e.SUBTITLES,_e.CAPTIONS].includes(e.kind)),qo=(t,e)=>{let i=qi(t),a=hl(t),r=!!a.length;if(i.length){if(e===!1||r&&e!==!0)ui(Nt.DISABLED,i,a);else if(e===!0||!r&&e!==!1){let o=i[0],{options:s}=t;if(!(s!=null&&s.noSubtitlesLangPref)){let y=l.localStorage.getItem("media-chrome-pref-subtitles-lang"),A=y?[y,...l.navigator.languages]:l.navigator.languages,E=i.filter(p=>A.some(k=>p.language.toLowerCase().startsWith(k.split("-")[0]))).sort((p,k)=>{let g=A.findIndex(C=>p.language.toLowerCase().startsWith(C.split("-")[0])),S=A.findIndex(C=>k.language.toLowerCase().startsWith(C.split("-")[0]));return g-S});E[0]&&(o=E[0])}let{language:d,label:u,kind:f}=o;ui(Nt.DISABLED,i,a),ui(Nt.SHOWING,i,[{language:d,label:u,kind:f}])}}},Zo=(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)?gp(t,e):Object.entries(t).every(([i,a])=>i in e&&Zo(a,e[i])),gp=(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)=>Zo(r,e[o])):!0};var _p=Object.values(Be),zo,Ap=sc().then(t=>(zo=t,zo)),mc=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,yp=t=>t&&(Tp.parseFromString(t,"text/html").body.textContent||t),Zi={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";Zi.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;Zi.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||!Hi(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=[Be.LIVE,Be.ON_DEMAND].includes(i)?i:void 0;if(!e)return a;let{streamType:r}=e;if(_p.includes(r))return r===Be.UNKNOWN?a:r;let o=e.duration;return o===1/0?Be.LIVE:Number.isFinite(o)?Be.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=Zi.mediaStreamType.get(t);return(i==null||Number.isNaN(i))&&a===Be.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(!(Zi.mediaStreamType.get(t)===Be.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 qi(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(t){return hl(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&&![_e.CAPTIONS,_e.SUBTITLES].includes((u=d==null?void 0:d.track)==null?void 0:u.kind)||qo(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]=ci(i,{kind:_e.CHAPTERS});return Array.from((e=a==null?void 0:a.cues)!=null?e:[]).map(({text:r,startTime:o,endTime:s})=>({text:yp(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("-")?he(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 oc(t)},set(t,e,i){var a,r;t?(ac(e),i.detail&&!((a=e.media)!=null&&a.inert)&&((r=e.media)==null||r.focus())):rc(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(!lc||!ml(e))return Ae.UNSUPPORTED}},mediaPipUnavailable:{get(t){let{media:e}=t;if(!dc||!cl(e))return Ae.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return Ae.UNAVAILABLE}},mediaVolumeUnavailable:{get(t){let{media:e}=t;if(zo===!1||(e==null?void 0:e.volume)==null)return Ae.UNSUPPORTED},stateOwnersUpdateHandlers:[t=>{zo==null&&Ap.then(e=>t(e?void 0:Ae.UNSUPPORTED))}]},mediaCastUnavailable:{get(t,{availability:e="not-available"}={}){var i;let{media:a}=t;if(!cc||!((i=a==null?void 0:a.remote)!=null&&i.state))return Ae.UNSUPPORTED;if(!(e==null||e==="available"))return Ae.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(!uc)return Ae.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return Ae.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 Ae.UNSUPPORTED;if(!((e=i.videoRenditions)!=null&&e.length))return Ae.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(t){var e,i;let{media:a}=t;if(!(a!=null&&a.audioTracks))return Ae.UNSUPPORTED;if(((i=(e=a.audioTracks)==null?void 0:e.length)!=null?i:0)<=1)return Ae.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(t){let{options:{mediaLang:e}={}}=t;return e!=null?e:"en"}}};var hc={[h.MEDIA_PREVIEW_REQUEST](t,e,{detail:i}){var a,r,o;let{media:s}=e,d=i!=null?i:void 0,u,f;if(s&&d!=null){let[p]=ci(s,{kind:_e.METADATA,label:"thumbnails"}),k=Array.prototype.find.call((a=p==null?void 0:p.cues)!=null?a:[],(g,S,C)=>S===0?g.endTime>d:S===C.length-1?g.startTime<=d:g.startTime<=d&&g.endTime>d);if(k){let g=/'^(?:[a-z]+:)?\/\//i.test(k.text)||(r=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:r.src,S=new URL(k.text,g);f=new URLSearchParams(S.hash).get("#xywh").split(",").map(j=>+j),u=S.href}}let y=t.mediaDuration.get(e),E=(o=t.mediaChaptersCues.get(e).find((p,k,g)=>k===g.length-1&&y===p.endTime?p.startTime<=d&&p.endTime>=d:p.startTime<=d&&p.endTime>d))==null?void 0:o.text;return i!=null&&E==null&&(E=""),{mediaPreviewTime:d,mediaPreviewImage:u,mediaPreviewCoords:f,mediaPreviewChapter:E}},[h.MEDIA_PAUSE_REQUEST](t,e){t["mediaPaused"].set(!0,e)},[h.MEDIA_PLAY_REQUEST](t,e){var i,a,r,o;let s="mediaPaused",u=t.mediaStreamType.get(e)===Be.LIVE,f=!((i=e.options)!=null&&i.noAutoSeekToLive),y=t.mediaTargetLiveWindow.get(e)>0;if(u&&f&&!y){let A=(a=t.mediaSeekable.get(e))==null?void 0:a[1];if(A){let E=(o=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?o:0,p=A-E;t.mediaCurrentTime.set(p,e)}}t[s].set(!1,e)},[h.MEDIA_PLAYBACK_RATE_REQUEST](t,e,{detail:i}){let a="mediaPlaybackRate",r=i;t[a].set(r,e)},[h.MEDIA_MUTE_REQUEST](t,e){t["mediaMuted"].set(!0,e)},[h.MEDIA_UNMUTE_REQUEST](t,e){let i="mediaMuted";t.mediaVolume.get(e)||t.mediaVolume.set(.25,e),t[i].set(!1,e)},[h.MEDIA_LOOP_REQUEST](t,e,{detail:i}){let a="mediaLoop",r=!!i;return t[a].set(r,e),{mediaLoop:r}},[h.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)},[h.MEDIA_SEEK_REQUEST](t,e,{detail:i}){let a="mediaCurrentTime",r=i;t[a].set(r,e)},[h.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)},[h.MEDIA_SHOW_SUBTITLES_REQUEST](t,e,{detail:i}){var a;let{options:r}=e,o=qi(e),s=dl(i),d=(a=s[0])==null?void 0:a.language;d&&!r.noSubtitlesLangPref&&l.localStorage.setItem("media-chrome-pref-subtitles-lang",d),ui(Nt.SHOWING,o,s)},[h.MEDIA_DISABLE_SUBTITLES_REQUEST](t,e,{detail:i}){let a=qi(e),r=i!=null?i:[];ui(Nt.DISABLED,a,r)},[h.MEDIA_TOGGLE_SUBTITLES_REQUEST](t,e,{detail:i}){qo(e,i)},[h.MEDIA_RENDITION_REQUEST](t,e,{detail:i}){let a="mediaRenditionSelected",r=i;t[a].set(r,e)},[h.MEDIA_AUDIO_TRACK_REQUEST](t,e,{detail:i}){let a="mediaAudioTrackEnabled",r=i;t[a].set(r,e)},[h.MEDIA_ENTER_PIP_REQUEST](t,e){let i="mediaIsPip";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[h.MEDIA_EXIT_PIP_REQUEST](t,e){t["mediaIsPip"].set(!1,e)},[h.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)},[h.MEDIA_EXIT_FULLSCREEN_REQUEST](t,e){t["mediaIsFullscreen"].set(!1,e)},[h.MEDIA_ENTER_CAST_REQUEST](t,e){let i="mediaIsCasting";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[h.MEDIA_EXIT_CAST_REQUEST](t,e){t["mediaIsCasting"].set(!1,e)},[h.MEDIA_AIRPLAY_REQUEST](t,e){t["mediaIsAirplaying"].set(!0,e)}};var pc=({media:t,fullscreenElement:e,documentElement:i,stateMediator:a=Zi,requestMap:r=hc,options:o={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let d=[],u={options:{...o}},f=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),y=g=>{g!=null&&(Zo(g,f)||(f=Object.freeze({...f,...g}),d.forEach(S=>S(f))))},A=()=>{let g=Object.entries(a).reduce((S,[C,{get:j}])=>(S[C]=j(u),S),{});y(g)},E={},p,k=async(g,S)=>{var C,j,Ue,Ot,bt,Ce,we,Pt,Qe,Wa,Fa,Va,Ka,Ga,Ya,qa;let yo=!!p;if(p={...u,...p!=null?p:{},...g},yo)return;await mc(...Object.values(g));let gt=d.length>0&&S===0&&s,Za=u.media!==p.media,za=((C=u.media)==null?void 0:C.textTracks)!==((j=p.media)==null?void 0:j.textTracks),Qa=((Ue=u.media)==null?void 0:Ue.videoRenditions)!==((Ot=p.media)==null?void 0:Ot.videoRenditions),Xa=((bt=u.media)==null?void 0:bt.audioTracks)!==((Ce=p.media)==null?void 0:Ce.audioTracks),Ja=((we=u.media)==null?void 0:we.remote)!==((Pt=p.media)==null?void 0:Pt.remote),pu=u.documentElement!==p.documentElement,fu=!!u.media&&(Za||gt),vu=!!((Qe=u.media)!=null&&Qe.textTracks)&&(za||gt),Eu=!!((Wa=u.media)!=null&&Wa.videoRenditions)&&(Qa||gt),bu=!!((Fa=u.media)!=null&&Fa.audioTracks)&&(Xa||gt),gu=!!((Va=u.media)!=null&&Va.remote)&&(Ja||gt),_u=!!u.documentElement&&(pu||gt),Zs=fu||vu||Eu||bu||gu||_u,Ni=d.length===0&&S===1&&s,Au=!!p.media&&(Za||Ni),Tu=!!((Ka=p.media)!=null&&Ka.textTracks)&&(za||Ni),yu=!!((Ga=p.media)!=null&&Ga.videoRenditions)&&(Qa||Ni),ku=!!((Ya=p.media)!=null&&Ya.audioTracks)&&(Xa||Ni),Su=!!((qa=p.media)!=null&&qa.remote)&&(Ja||Ni),Iu=!!p.documentElement&&(pu||Ni),Mu=Au||Tu||yu||ku||Su||Iu;if(!(Zs||Mu)){Object.entries(p).forEach(([F,ja])=>{u[F]=ja}),A(),p=void 0;return}Object.entries(a).forEach(([F,{get:ja,mediaEvents:Rh=[],textTracksEvents:xh=[],videoRenditionsEvents:Dh=[],audioTracksEvents:Oh=[],remoteEvents:Ph=[],rootEvents:Nh=[],stateOwnersUpdateHandlers:Uh=[]}])=>{E[F]||(E[F]={});let ke=Q=>{let ie=ja(u,Q);y({[F]:ie})},ne;ne=E[F].mediaEvents,Rh.forEach(Q=>{ne&&fu&&(u.media.removeEventListener(Q,ne),E[F].mediaEvents=void 0),Au&&(p.media.addEventListener(Q,ke),E[F].mediaEvents=ke)}),ne=E[F].textTracksEvents,xh.forEach(Q=>{var ie,He;ne&&vu&&((ie=u.media.textTracks)==null||ie.removeEventListener(Q,ne),E[F].textTracksEvents=void 0),Tu&&((He=p.media.textTracks)==null||He.addEventListener(Q,ke),E[F].textTracksEvents=ke)}),ne=E[F].videoRenditionsEvents,Dh.forEach(Q=>{var ie,He;ne&&Eu&&((ie=u.media.videoRenditions)==null||ie.removeEventListener(Q,ne),E[F].videoRenditionsEvents=void 0),yu&&((He=p.media.videoRenditions)==null||He.addEventListener(Q,ke),E[F].videoRenditionsEvents=ke)}),ne=E[F].audioTracksEvents,Oh.forEach(Q=>{var ie,He;ne&&bu&&((ie=u.media.audioTracks)==null||ie.removeEventListener(Q,ne),E[F].audioTracksEvents=void 0),ku&&((He=p.media.audioTracks)==null||He.addEventListener(Q,ke),E[F].audioTracksEvents=ke)}),ne=E[F].remoteEvents,Ph.forEach(Q=>{var ie,He;ne&&gu&&((ie=u.media.remote)==null||ie.removeEventListener(Q,ne),E[F].remoteEvents=void 0),Su&&((He=p.media.remote)==null||He.addEventListener(Q,ke),E[F].remoteEvents=ke)}),ne=E[F].rootEvents,Nh.forEach(Q=>{ne&&_u&&(u.documentElement.removeEventListener(Q,ne),E[F].rootEvents=void 0),Iu&&(p.documentElement.addEventListener(Q,ke),E[F].rootEvents=ke)});let ko=E[F].stateOwnersUpdateHandlers;if(ko&&Zs&&(Array.isArray(ko)?ko:[ko]).forEach(ie=>{typeof ie=="function"&&ie()}),Mu){let Q=Uh.map(ie=>ie(ke,p)).filter(ie=>typeof ie=="function");E[F].stateOwnersUpdateHandlers=Q.length===1?Q[0]:Q}else Zs&&(E[F].stateOwnersUpdateHandlers=void 0)}),Object.entries(p).forEach(([F,ja])=>{u[F]=ja}),A(),p=void 0};return k({media:t,fullscreenElement:e,documentElement:i,options:o}),{dispatch(g){let{type:S,detail:C}=g;if(r[S]&&f.mediaErrorCode==null){y(r[S](a,u,g));return}S==="mediaelementchangerequest"?k({media:C}):S==="fullscreenelementchangerequest"?k({fullscreenElement:C}):S==="documentelementchangerequest"?k({documentElement:C}):S==="optionschangerequest"&&(Object.entries(C!=null?C:{}).forEach(([j,Ue])=>{u.options[j]=Ue}),A())},getState(){return f},subscribe(g){return k({},d.length+1),d.push(g),g(f),()=>{let S=d.indexOf(g);S>=0&&(k({},d.length-1),d.splice(S,1))}}}};var bl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},_=(t,e,i)=>(bl(t,e,"read from private field"),i?i.call(t):e.get(t)),Re=(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)},Ke=(t,e,i,a)=>(bl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ur=(t,e,i)=>(bl(t,e,"access private method"),i),kt,cr,H,je,mr,Je,Qo,hr,Xo,pl,hi,Jo,fl,vl,Ac,Tc=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],fc=10,vc=.025,Ec=.25,kp=.25,Sp=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"},jo=class extends si{constructor(){super(),Re(this,Xo),Re(this,Jo),Re(this,vl),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,Re(this,kt,new Bt(this,v.HOTKEYS)),Re(this,cr,void 0),Re(this,H,void 0),Re(this,je,null),Re(this,mr,void 0),Re(this,Je,void 0),Re(this,Qo,i=>{var a;(a=_(this,H))==null||a.dispatch(i)}),Re(this,hr,void 0),Re(this,hi,i=>{let{key:a,shiftKey:r}=i;if(!(r&&(a==="/"||a==="?")||Tc.includes(a))){this.removeEventListener("keyup",_(this,hi));return}this.keyboardShortcutHandler(i)}),this.associateElement(this);let e={};Ke(this,mr,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(xu[o],{composed:!0,detail:r});this.dispatchEvent(s)}),e=i})}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,v.LIVE_EDGE_OFFSET,v.SEEK_TO_LIVE_OFFSET,v.NO_AUTO_SEEK_TO_LIVE)}get mediaStore(){return _(this,H)}set mediaStore(e){var i,a;if(_(this,H)&&((i=_(this,Je))==null||i.call(this),Ke(this,Je,void 0)),Ke(this,H,e),!_(this,H)&&!this.hasAttribute(v.NO_DEFAULT_STORE)){ur(this,Xo,pl).call(this);return}Ke(this,Je,(a=_(this,H))==null?void 0:a.subscribe(_(this,mr)))}get fullscreenElement(){var e;return(e=_(this,cr))!=null?e:this}set fullscreenElement(e){var i;this.hasAttribute(v.FULLSCREEN_ELEMENT)&&this.removeAttribute(v.FULLSCREEN_ELEMENT),Ke(this,cr,e),(i=_(this,H))==null||i.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return M(this,v.DEFAULT_SUBTITLES)}set defaultSubtitles(e){L(this,v.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return x(this,v.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){w(this,v.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return P(this,v.DEFAULT_DURATION)}set defaultDuration(e){U(this,v.DEFAULT_DURATION,e)}get noHotkeys(){return M(this,v.NO_HOTKEYS)}set noHotkeys(e){L(this,v.NO_HOTKEYS,e)}get keysUsed(){return x(this,v.KEYS_USED)}set keysUsed(e){w(this,v.KEYS_USED,e)}get liveEdgeOffset(){return P(this,v.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){U(this,v.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return M(this,v.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){L(this,v.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return M(this,v.NO_VOLUME_PREF)}set noVolumePref(e){L(this,v.NO_VOLUME_PREF,e)}get noMutedPref(){return M(this,v.NO_MUTED_PREF)}set noMutedPref(e){L(this,v.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return M(this,v.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){L(this,v.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return M(this,v.NO_DEFAULT_STORE)}set noDefaultStore(e){L(this,v.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,i,a){var r,o,s,d,u,f,y,A,E,p,k,g;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)_(this,kt).value=a;else if(e===v.DEFAULT_SUBTITLES&&a!==i)(r=_(this,H))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(v.DEFAULT_SUBTITLES)}});else if(e===v.DEFAULT_STREAM_TYPE)(s=_(this,H))==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&&a!==i)(d=_(this,H))==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)?+this.getAttribute(v.SEEK_TO_LIVE_OFFSET):this.hasAttribute(v.LIVE_EDGE_OFFSET)?+this.getAttribute(v.LIVE_EDGE_OFFSET):void 0}});else if(e===v.SEEK_TO_LIVE_OFFSET&&a!==i)(u=_(this,H))==null||u.dispatch({type:"optionschangerequest",detail:{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}});else if(e===v.NO_AUTO_SEEK_TO_LIVE)(f=_(this,H))==null||f.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(v.NO_AUTO_SEEK_TO_LIVE)}});else if(e===v.FULLSCREEN_ELEMENT){let S=a?(y=this.getRootNode())==null?void 0:y.getElementById(a):void 0;Ke(this,cr,S),(A=_(this,H))==null||A.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===v.LANG&&a!==i?(Wu(a),(E=_(this,H))==null||E.dispatch({type:"optionschangerequest",detail:{mediaLang:a}})):e===v.LOOP&&a!==i?(p=_(this,H))==null||p.dispatch({type:h.MEDIA_LOOP_REQUEST,detail:a!=null}):e===v.NO_VOLUME_PREF&&a!==i?(k=_(this,H))==null||k.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(v.NO_VOLUME_PREF)}}):e===v.NO_MUTED_PREF&&a!==i&&((g=_(this,H))==null||g.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(v.NO_MUTED_PREF)}}))}connectedCallback(){var e,i,a;this.associateElement(this),!_(this,H)&&!this.hasAttribute(v.NO_DEFAULT_STORE)&&ur(this,Xo,pl).call(this),(e=_(this,H))==null||e.dispatch({type:"documentelementchangerequest",detail:V}),(i=_(this,H))==null||i.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement}),super.connectedCallback(),_(this,H)&&!_(this,Je)&&Ke(this,Je,(a=_(this,H))==null?void 0:a.subscribe(_(this,mr))),_(this,hr)!==void 0&&_(this,H)&&this.media&&setTimeout(()=>{var r,o,s;(o=(r=this.media)==null?void 0:r.textTracks)!=null&&o.length&&((s=_(this,H))==null||s.dispatch({type:h.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:_(this,hr)}))},0),this.hasAttribute(v.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,i,a,r,o,s;if((e=super.disconnectedCallback)==null||e.call(this),this.disableHotkeys(),_(this,H)){let d=_(this,H).getState();Ke(this,hr,!!((i=d.mediaSubtitlesShowing)!=null&&i.length)),(a=_(this,H))==null||a.dispatch({type:"fullscreenelementchangerequest",detail:void 0}),(r=_(this,H))==null||r.dispatch({type:"documentelementchangerequest",detail:void 0}),(o=_(this,H))==null||o.dispatch({type:h.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}_(this,Je)&&((s=_(this,Je))==null||s.call(this),Ke(this,Je,void 0)),this.unassociateElement(this),_(this,je)&&(_(this,je).remove(),Ke(this,je,null))}mediaSetCallback(e){var i;super.mediaSetCallback(e),(i=_(this,H))==null||i.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var i;super.mediaUnsetCallback(e),(i=_(this,H))==null||i.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,i){_c(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=Rp(e,a,r);Object.values(h).forEach(s=>{e.addEventListener(s,_(this,Qo))}),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(h).forEach(r=>{e.removeEventListener(r,_(this,Qo))})}registerMediaStateReceiver(e){if(!e)return;let i=this.mediaStateReceivers;i.indexOf(e)>-1||(i.push(e),_(this,H)&&Object.entries(_(this,H).getState()).forEach(([r,o])=>{_c([e],r,o)}))}unregisterMediaStateReceiver(e){let i=this.mediaStateReceivers,a=i.indexOf(e);a<0||i.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",ur(this,Jo,fl))}disableHotkeys(){this.removeEventListener("keydown",ur(this,Jo,fl)),this.removeEventListener("keyup",_(this,hi))}get hotkeys(){return _(this,kt)}set hotkeys(e){w(this,v.HOTKEYS,e)}keyboardShortcutHandler(e){var i,a,r,o,s,d,u,f,y;let A=e.target;if(((r=(a=(i=A.getAttribute(v.KEYS_USED))==null?void 0:i.split(" "))!=null?a:A==null?void 0:A.keysUsed)!=null?r:[]).map(C=>C==="Space"?" ":C).filter(Boolean).includes(e.key))return;let p,k,g;if(!(_(this,kt).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&_(this,kt).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&_(this,kt).contains("noshift+/")))switch(e.key){case" ":case"k":p=_(this,H).getState().mediaPaused?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new l.CustomEvent(p,{composed:!0,bubbles:!0}));break;case"m":p=this.mediaStore.getState().mediaVolumeLevel==="off"?h.MEDIA_UNMUTE_REQUEST:h.MEDIA_MUTE_REQUEST,this.dispatchEvent(new l.CustomEvent(p,{composed:!0,bubbles:!0}));break;case"f":p=this.mediaStore.getState().mediaIsFullscreen?h.MEDIA_EXIT_FULLSCREEN_REQUEST:h.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new l.CustomEvent(p,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new l.CustomEvent(h.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):fc;k=Math.max(((o=this.mediaStore.getState().mediaCurrentTime)!=null?o:0)-C,0),g=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:k}),this.dispatchEvent(g);break}case"ArrowRight":case"l":{let C=this.hasAttribute(v.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(v.KEYBOARD_FORWARD_SEEK_OFFSET):fc;k=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+C,0),g=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:k}),this.dispatchEvent(g);break}case"ArrowUp":{let C=this.hasAttribute(v.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(v.KEYBOARD_UP_VOLUME_STEP):vc;k=Math.min(((d=this.mediaStore.getState().mediaVolume)!=null?d:1)+C,1),g=new l.CustomEvent(h.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:k}),this.dispatchEvent(g);break}case"ArrowDown":{let C=this.hasAttribute(v.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(v.KEYBOARD_DOWN_VOLUME_STEP):vc;k=Math.max(((u=this.mediaStore.getState().mediaVolume)!=null?u:1)-C,0),g=new l.CustomEvent(h.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:k}),this.dispatchEvent(g);break}case"<":{let C=(f=this.mediaStore.getState().mediaPlaybackRate)!=null?f:1;k=Math.max(C-Ec,kp).toFixed(2),g=new l.CustomEvent(h.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:k}),this.dispatchEvent(g);break}case">":{let C=(y=this.mediaStore.getState().mediaPlaybackRate)!=null?y:1;k=Math.min(C+Ec,Sp).toFixed(2),g=new l.CustomEvent(h.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:k}),this.dispatchEvent(g);break}case"/":case"?":{e.shiftKey&&ur(this,vl,Ac).call(this);break}case"p":{p=this.mediaStore.getState().mediaIsPip?h.MEDIA_EXIT_PIP_REQUEST:h.MEDIA_ENTER_PIP_REQUEST,g=new l.CustomEvent(p,{composed:!0,bubbles:!0}),this.dispatchEvent(g);break}default:break}}};kt=new WeakMap;cr=new WeakMap;H=new WeakMap;je=new WeakMap;mr=new WeakMap;Je=new WeakMap;Qo=new WeakMap;hr=new WeakMap;Xo=new WeakSet;pl=function(){var t;this.mediaStore=pc({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)}})};hi=new WeakMap;Jo=new WeakSet;fl=function(t){var e;let{metaKey:i,altKey:a,key:r,shiftKey:o}=t,s=o&&(r==="/"||r==="?");if(s&&((e=_(this,je))!=null&&e.open)){this.removeEventListener("keyup",_(this,hi));return}if(i||a||!s&&!Tc.includes(r)){this.removeEventListener("keyup",_(this,hi));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)&&!(_(this,kt).contains(`no${r.toLowerCase()}`)||r===" "&&_(this,kt).contains("nospace"))&&!u&&t.preventDefault(),this.addEventListener("keyup",_(this,hi),{once:!0})};vl=new WeakSet;Ac=function(){_(this,je)||(Ke(this,je,V.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(_(this,je))),_(this,je).open=!0};var Ip=Object.values(n),Mp=Object.values(js),yc=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,D.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(o||s)?(o||s).filter(d=>Ip.includes(d)):[]},Lp=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),Mp.some(a=>a in t)},El=t=>Lp(t)||!!yc(t).length,bc=t=>{var e;return(e=t==null?void 0:t.join)==null?void 0:e.call(t,":")},gc={[n.MEDIA_SUBTITLES_LIST]:yt,[n.MEDIA_SUBTITLES_SHOWING]:yt,[n.MEDIA_SEEKABLE]:bc,[n.MEDIA_BUFFERED]:t=>t==null?void 0:t.map(bc).join(" "),[n.MEDIA_PREVIEW_COORDS]:t=>t==null?void 0:t.join(" "),[n.MEDIA_RENDITION_LIST]:Ou,[n.MEDIA_AUDIO_TRACK_LIST]:Nu},Cp=async(t,e,i)=>{var a,r;if(t.isConnected||await Mo(0),typeof i=="boolean"||i==null)return L(t,e,i);if(typeof i=="number")return U(t,e,i);if(typeof i=="string")return w(t,e,i);if(Array.isArray(i)&&!i.length)return t.removeAttribute(e);let o=(r=(a=gc[e])==null?void 0:a.call(gc,i))!=null?r:i;return t.setAttribute(e,o)},wp=t=>{var e;return!!((e=t.closest)!=null&&e.call(t,'*[slot="media"]'))},mi=(t,e)=>{if(wp(t))return;let i=(r,o)=>{var s,d;El(r)&&o(r);let{children:u=[]}=r!=null?r:{},f=(d=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?d:[];[...u,...f].forEach(A=>mi(A,o))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!El(t)){l.customElements.whenDefined(a).then(()=>{i(t,e)});return}i(t,e)},_c=(t,e,i)=>{t.forEach(a=>{if(e in a){a[e]=i;return}let r=yc(a),o=e.toLowerCase();r.includes(o)&&Cp(a,o,i)})},Rp=(t,e,i)=>{mi(t,e);let a=y=>{var A;let E=(A=y==null?void 0:y.composedPath()[0])!=null?A:y.target;e(E)},r=y=>{var A;let E=(A=y==null?void 0:y.composedPath()[0])!=null?A:y.target;i(E)};t.addEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r);let o=y=>{y.forEach(A=>{let{addedNodes:E=[],removedNodes:p=[],type:k,target:g,attributeName:S}=A;k==="childList"?(Array.prototype.forEach.call(E,C=>mi(C,e)),Array.prototype.forEach.call(p,C=>mi(C,i))):k==="attributes"&&S===D.MEDIA_CHROME_ATTRIBUTES&&(El(g)?e(g):i(g))})},s=[],d=y=>{let A=y.target;A.name!=="media"&&(s.forEach(E=>mi(E,i)),s=[...A.assignedElements({flatten:!0})],s.forEach(E=>mi(E,e)))};t.addEventListener("slotchange",d);let u=new MutationObserver(o);return u.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{mi(t,i),t.removeEventListener("slotchange",d),u.disconnect(),t.removeEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),t.removeEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};l.customElements.get("media-controller")||l.customElements.define("media-controller",jo);var gl=jo;var zi={PLACEMENT:"placement",BOUNDS:"bounds"};function xp(t){return`
|
|
159
|
+
`}var sp=Object.values(n),lp="sm:384 md:576 lg:768 xl:960";function dp(t){Ju(t.target,t.contentRect.width)}function Ju(t,e){var i;if(!t.isConnected)return;let a=(i=t.getAttribute(I.BREAKPOINTS))!=null?i:lp,r=up(a),o=cp(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(Ie.BREAKPOINTS_CHANGE,{detail:o});t.dispatchEvent(d)}t.breakpointsComputed||(t.breakpointsComputed=!0,t.dispatchEvent(new CustomEvent(Ie.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function up(t){let e=t.split(/\s+/);return Object.fromEntries(e.map(i=>i.split(":")))}function cp(t,e){return Object.keys(t).filter(i=>e>=parseInt(t[i]))}var si=class extends l.HTMLElement{constructor(){if(super(),pe(this,sl),pe(this,ll),pe(this,lr),pe(this,Vo),pe(this,Ki),pe(this,sr,void 0),pe(this,Wo,0),pe(this,$i,null),pe(this,Vi,null),pe(this,Fi,void 0),this.breakpointsComputed=!1,pe(this,nl,e=>{let i=this.media;for(let a of e){if(a.type!=="childList")continue;let r=a.removedNodes;for(let o of r){if(o.slot!="media"||a.target!=this)continue;let s=a.previousSibling&&a.previousSibling.previousElementSibling;if(!s||!i)this.mediaUnsetCallback(o);else{let d=s.slot!=="media";for(;(s=s.previousSibling)!==null;)s.slot=="media"&&(d=!1);d&&this.mediaUnsetCallback(o)}}if(i)for(let o of a.addedNodes)o===i&&this.handleMediaUpdated(i)}}),pe(this,Wi,!1),pe(this,Bo,e=>{ee(this,Wi)||(setTimeout(()=>{dp(e),Fe(this,Wi,!1)},0),Fe(this,Wi,!0))}),pe(this,Ut,void 0),pe(this,$o,()=>{if(!ee(this,Ut).assignedElements({flatten:!0}).length){ee(this,$i)&&this.mediaUnsetCallback(ee(this,$i));return}this.handleMediaUpdated(this.media)}),!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}Fe(this,sr,new MutationObserver(ee(this,nl)))}static get observedAttributes(){return[I.AUTOHIDE,I.GESTURES_DISABLED].concat(sp).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()==I.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&&(Fe(this,$i,e),e.localName.includes("-")&&await l.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;ee(this,sr).observe(this,{childList:!0,subtree:!0}),_t(this,ee(this,Bo));let a=this.getAttribute(I.AUDIO)!=null?c("audio player"):c("video player");this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.handleMediaUpdated(this.media),this.setAttribute(I.USER_INACTIVE,""),Ju(this,this.getBoundingClientRect().width);let r=this.querySelector(":scope > slot[slot=media]");r&&(Fe(this,Ut,r),ee(this,Ut).addEventListener("slotchange",ee(this,$o))),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;At(this,ee(this,Bo)),clearTimeout(ee(this,Vi)),ee(this,sr).disconnect(),this.media&&this.mediaUnsetCallback(this.media),(e=l.window)==null||e.removeEventListener("mouseup",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointermove",this),this.removeEventListener("pointerup",this),this.removeEventListener("mouseleave",this),this.removeEventListener("keyup",this),ee(this,Ut)&&(ee(this,Ut).removeEventListener("slotchange",ee(this,$o)),Fe(this,Ut,null)),Fe(this,Wi,!1)}mediaSetCallback(e){}mediaUnsetCallback(e){Fe(this,$i,null)}handleEvent(e){switch(e.type){case"pointerdown":Fe(this,Wo,e.timeStamp);break;case"pointermove":Ve(this,sl,Qu).call(this,e);break;case"pointerup":Ve(this,ll,Xu).call(this,e);break;case"mouseleave":Ve(this,lr,Fo).call(this);break;case"mouseup":this.removeAttribute(I.KEYBOARD_CONTROL);break;case"keyup":Ve(this,Ki,dr).call(this),this.setAttribute(I.KEYBOARD_CONTROL,"");break}}set autohide(e){let i=Number(e);Fe(this,Fi,isNaN(i)?0:i)}get autohide(){return(ee(this,Fi)===void 0?2:ee(this,Fi)).toString()}get breakpoints(){return x(this,I.BREAKPOINTS)}set breakpoints(e){w(this,I.BREAKPOINTS,e)}get audio(){return M(this,I.AUDIO)}set audio(e){L(this,I.AUDIO,e)}get gesturesDisabled(){return M(this,I.GESTURES_DISABLED)}set gesturesDisabled(e){L(this,I.GESTURES_DISABLED,e)}get keyboardControl(){return M(this,I.KEYBOARD_CONTROL)}set keyboardControl(e){L(this,I.KEYBOARD_CONTROL,e)}get noAutohide(){return M(this,I.NO_AUTOHIDE)}set noAutohide(e){L(this,I.NO_AUTOHIDE,e)}get autohideOverControls(){return M(this,I.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){L(this,I.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return M(this,I.USER_INACTIVE)}set userInteractive(e){L(this,I.USER_INACTIVE,e)}};sr=new WeakMap;Wo=new WeakMap;$i=new WeakMap;Vi=new WeakMap;Fi=new WeakMap;nl=new WeakMap;Wi=new WeakMap;Bo=new WeakMap;sl=new WeakSet;Qu=function(t){if(t.pointerType!=="mouse"&&t.timeStamp-ee(this,Wo)<250)return;Ve(this,Vo,ul).call(this),clearTimeout(ee(this,Vi));let e=this.hasAttribute(I.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(t.target)||e)&&Ve(this,Ki,dr).call(this)};ll=new WeakSet;Xu=function(t){if(t.pointerType==="touch"){let e=!this.hasAttribute(I.USER_INACTIVE);[this,this.media].includes(t.target)&&e?Ve(this,lr,Fo).call(this):Ve(this,Ki,dr).call(this)}else t.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&Ve(this,Ki,dr).call(this)};lr=new WeakSet;Fo=function(){if(ee(this,Fi)<0||this.hasAttribute(I.USER_INACTIVE))return;this.setAttribute(I.USER_INACTIVE,"");let t=new l.CustomEvent(Ie.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(t)};Vo=new WeakSet;ul=function(){if(!this.hasAttribute(I.USER_INACTIVE))return;this.removeAttribute(I.USER_INACTIVE);let t=new l.CustomEvent(Ie.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(t)};Ki=new WeakSet;dr=function(){Ve(this,Vo,ul).call(this),clearTimeout(ee(this,Vi));let t=parseInt(this.autohide);t<0||Fe(this,Vi,setTimeout(()=>{Ve(this,lr,Fo).call(this)},t*1e3))};Ut=new WeakMap;$o=new WeakMap;si.shadowRootOptions={mode:"open"};si.getTemplateHTML=np;l.customElements.get("media-container")||l.customElements.define("media-container",si);var ju=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},se=(t,e,i)=>(ju(t,e,"read from private field"),i?i.call(t):e.get(t)),ur=(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)},Ko=(t,e,i,a)=>(ju(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Gi,Yi,Go,li,Tt,Ht,Bt=class{constructor(e,i,{defaultValue:a}={defaultValue:void 0}){ur(this,Tt),ur(this,Gi,void 0),ur(this,Yi,void 0),ur(this,Go,void 0),ur(this,li,new Set),Ko(this,Gi,e),Ko(this,Yi,i),Ko(this,Go,new Set(a))}[Symbol.iterator](){return se(this,Tt,Ht).values()}get length(){return se(this,Tt,Ht).size}get value(){var e;return(e=[...se(this,Tt,Ht)].join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Ko(this,li,new Set),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return[...se(this,Tt,Ht)][e]}values(){return se(this,Tt,Ht).values()}forEach(e,i){se(this,Tt,Ht).forEach(e,i)}add(...e){var i,a;e.forEach(r=>se(this,li).add(r)),!(this.value===""&&!((i=se(this,Gi))!=null&&i.hasAttribute(`${se(this,Yi)}`)))&&((a=se(this,Gi))==null||a.setAttribute(`${se(this,Yi)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>se(this,li).delete(a)),(i=se(this,Gi))==null||i.setAttribute(`${se(this,Yi)}`,`${this.value}`)}contains(e){return se(this,Tt,Ht).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}};Gi=new WeakMap;Yi=new WeakMap;Go=new WeakMap;li=new WeakMap;Tt=new WeakSet;Ht=function(){return se(this,li).size?se(this,li):se(this,Go)};var mp=(t="")=>t.split(/\s+/),ec=(t="")=>{let[e,i,a]=t.split(":"),r=a?decodeURIComponent(a):void 0;return{kind:e==="cc"?_e.CAPTIONS:_e.SUBTITLES,language:i,label:r}},di=(t="",e={})=>mp(t).map(i=>{let a=ec(i);return{...e,...a}}),cl=t=>t?Array.isArray(t)?t.map(e=>typeof e=="string"?ec(e):e):typeof t=="string"?di(t):[t]:[],Yo=({kind:t,label:e,language:i}={kind:"subtitles"})=>e?`${t==="captions"?"cc":"sb"}:${i}:${encodeURIComponent(e)}`:i,yt=(t=[])=>Array.prototype.map.call(t,Yo).join(" "),hp=(t,e)=>i=>i[t]===e,tc=t=>{let e=Object.entries(t).map(([i,a])=>hp(i,a));return i=>e.every(a=>a(i))},ui=(t,e=[],i=[])=>{let a=cl(i).map(tc),r=o=>a.some(s=>s(o));Array.from(e).filter(r).forEach(o=>{o.mode=t})},ci=(t,e=()=>!0)=>{if(!(t!=null&&t.textTracks))return[];let i=typeof e=="function"?e:tc(e);return Array.from(t.textTracks).filter(i)},qo=t=>{var e;return!!((e=t.mediaSubtitlesShowing)!=null&&e.length)||t.hasAttribute(n.MEDIA_SUBTITLES_SHOWING)};var ac=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)}},ic="exitFullscreen"in V?"exitFullscreen":"webkitExitFullscreen"in V?"webkitExitFullscreen":"webkitCancelFullScreen"in V?"webkitCancelFullScreen":void 0,rc=t=>{var e;let{documentElement:i}=t;if(ic){let a=(e=i==null?void 0:i[ic])==null?void 0:e.call(i);if(a instanceof Promise)return a.catch(()=>{})}},cr="fullscreenElement"in V?"fullscreenElement":"webkitFullscreenElement"in V?"webkitFullscreenElement":void 0,pp=t=>{let{documentElement:e,media:i}=t,a=e==null?void 0:e[cr];return!a&&"webkitDisplayingFullscreen"in i&&"webkitPresentationMode"in i&&i.webkitDisplayingFullscreen&&i.webkitPresentationMode===Du.FULLSCREEN?i:a},oc=t=>{var e;let{media:i,documentElement:a,fullscreenElement:r=i}=t;if(!i||!a)return!1;let o=pp(t);if(!o)return!1;if(o===r||o===i)return!0;if(o.localName.includes("-")){let s=o.shadowRoot;if(!(cr in s))return he(o,r);for(;s!=null&&s[cr];){if(s[cr]===r)return!0;s=(e=s[cr])==null?void 0:e.shadowRoot}}return!1},fp="fullscreenEnabled"in V?"fullscreenEnabled":"webkitFullscreenEnabled"in V?"webkitFullscreenEnabled":void 0,nc=t=>{let{documentElement:e,media:i}=t;return!!(e!=null&&e[fp])||i&&"webkitSupportsFullscreen"in i};var Zo,ml=()=>{var t,e;return Zo||(Zo=(e=(t=V)==null?void 0:t.createElement)==null?void 0:e.call(t,"video"),Zo)},sc=async(t=ml())=>{if(!t)return!1;let e=t.volume;t.volume=e/2+.1;let i=new AbortController,a=await Promise.race([vp(t,i.signal),Ep(t,e)]);return i.abort(),a},vp=(t,e)=>new Promise(i=>{t.addEventListener("volumechange",()=>i(!0),{signal:e})}),Ep=async(t,e)=>{for(let i=0;i<10;i++){if(t.volume===e)return!1;await Co(10)}return t.volume!==e},bp=/.*Version\/.*Safari\/.*/.test(l.navigator.userAgent),hl=(t=ml())=>l.matchMedia("(display-mode: standalone)").matches&&bp?!1:typeof(t==null?void 0:t.requestPictureInPicture)=="function",pl=(t=ml())=>nc({documentElement:V,media:t}),lc=pl(),dc=hl(),uc=!!l.WebKitPlaybackTargetAvailabilityEvent,cc=!!l.chrome;var qi=t=>ci(t.media,e=>[_e.SUBTITLES,_e.CAPTIONS].includes(e.kind)).sort((e,i)=>e.kind>=i.kind?1:-1),fl=t=>ci(t.media,e=>e.mode===Nt.SHOWING&&[_e.SUBTITLES,_e.CAPTIONS].includes(e.kind)),zo=(t,e)=>{let i=qi(t),a=fl(t),r=!!a.length;if(i.length){if(e===!1||r&&e!==!0)ui(Nt.DISABLED,i,a);else if(e===!0||!r&&e!==!1){let o=i[0],{options:s}=t;if(!(s!=null&&s.noSubtitlesLangPref)){let y=l.localStorage.getItem("media-chrome-pref-subtitles-lang"),A=y?[y,...l.navigator.languages]:l.navigator.languages,E=i.filter(p=>A.some(k=>p.language.toLowerCase().startsWith(k.split("-")[0]))).sort((p,k)=>{let g=A.findIndex(C=>p.language.toLowerCase().startsWith(C.split("-")[0])),S=A.findIndex(C=>k.language.toLowerCase().startsWith(C.split("-")[0]));return g-S});E[0]&&(o=E[0])}let{language:d,label:u,kind:f}=o;ui(Nt.DISABLED,i,a),ui(Nt.SHOWING,i,[{language:d,label:u,kind:f}])}}},Qo=(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)?gp(t,e):Object.entries(t).every(([i,a])=>i in e&&Qo(a,e[i])),gp=(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)=>Qo(r,e[o])):!0};var _p=Object.values(Be),Xo,Ap=sc().then(t=>(Xo=t,Xo)),mc=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,yp=t=>t&&(Tp.parseFromString(t,"text/html").body.textContent||t),Zi={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";Zi.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;Zi.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||!Hi(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=[Be.LIVE,Be.ON_DEMAND].includes(i)?i:void 0;if(!e)return a;let{streamType:r}=e;if(_p.includes(r))return r===Be.UNKNOWN?a:r;let o=e.duration;return o===1/0?Be.LIVE:Number.isFinite(o)?Be.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=Zi.mediaStreamType.get(t);return(i==null||Number.isNaN(i))&&a===Be.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(!(Zi.mediaStreamType.get(t)===Be.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 qi(t).map(({kind:e,label:i,language:a})=>({kind:e,label:i,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(t){return fl(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&&![_e.CAPTIONS,_e.SUBTITLES].includes((u=d==null?void 0:d.track)==null?void 0:u.kind)||zo(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]=ci(i,{kind:_e.CHAPTERS});return Array.from((e=a==null?void 0:a.cues)!=null?e:[]).map(({text:r,startTime:o,endTime:s})=>({text:yp(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("-")?he(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 oc(t)},set(t,e,i){var a,r;t?(ac(e),i.detail&&!((a=e.media)!=null&&a.inert)&&((r=e.media)==null||r.focus())):rc(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(!lc||!pl(e))return Ae.UNSUPPORTED}},mediaPipUnavailable:{get(t){let{media:e}=t;if(!dc||!hl(e))return Ae.UNSUPPORTED;if(e!=null&&e.disablePictureInPicture)return Ae.UNAVAILABLE}},mediaVolumeUnavailable:{get(t){let{media:e}=t;if(Xo===!1||(e==null?void 0:e.volume)==null)return Ae.UNSUPPORTED},stateOwnersUpdateHandlers:[t=>{Xo==null&&Ap.then(e=>t(e?void 0:Ae.UNSUPPORTED))}]},mediaCastUnavailable:{get(t,{availability:e="not-available"}={}){var i;let{media:a}=t;if(!cc||!((i=a==null?void 0:a.remote)!=null&&i.state))return Ae.UNSUPPORTED;if(!(e==null||e==="available"))return Ae.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(!uc)return Ae.UNSUPPORTED;if((e==null?void 0:e.availability)==="not-available")return Ae.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 Ae.UNSUPPORTED;if(!((e=i.videoRenditions)!=null&&e.length))return Ae.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(t){var e,i;let{media:a}=t;if(!(a!=null&&a.audioTracks))return Ae.UNSUPPORTED;if(((i=(e=a.audioTracks)==null?void 0:e.length)!=null?i:0)<=1)return Ae.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaLang:{get(t){let{options:{mediaLang:e}={}}=t;return e!=null?e:"en"}}};var hc={[h.MEDIA_PREVIEW_REQUEST](t,e,{detail:i}){var a,r,o;let{media:s}=e,d=i!=null?i:void 0,u,f;if(s&&d!=null){let[p]=ci(s,{kind:_e.METADATA,label:"thumbnails"}),k=Array.prototype.find.call((a=p==null?void 0:p.cues)!=null?a:[],(g,S,C)=>S===0?g.endTime>d:S===C.length-1?g.startTime<=d:g.startTime<=d&&g.endTime>d);if(k){let g=/'^(?:[a-z]+:)?\/\//i.test(k.text)||(r=s==null?void 0:s.querySelector('track[label="thumbnails"]'))==null?void 0:r.src,S=new URL(k.text,g);f=new URLSearchParams(S.hash).get("#xywh").split(",").map(j=>+j),u=S.href}}let y=t.mediaDuration.get(e),E=(o=t.mediaChaptersCues.get(e).find((p,k,g)=>k===g.length-1&&y===p.endTime?p.startTime<=d&&p.endTime>=d:p.startTime<=d&&p.endTime>d))==null?void 0:o.text;return i!=null&&E==null&&(E=""),{mediaPreviewTime:d,mediaPreviewImage:u,mediaPreviewCoords:f,mediaPreviewChapter:E}},[h.MEDIA_PAUSE_REQUEST](t,e){t["mediaPaused"].set(!0,e)},[h.MEDIA_PLAY_REQUEST](t,e){var i,a,r,o;let s="mediaPaused",u=t.mediaStreamType.get(e)===Be.LIVE,f=!((i=e.options)!=null&&i.noAutoSeekToLive),y=t.mediaTargetLiveWindow.get(e)>0;if(u&&f&&!y){let A=(a=t.mediaSeekable.get(e))==null?void 0:a[1];if(A){let E=(o=(r=e.options)==null?void 0:r.seekToLiveOffset)!=null?o:0,p=A-E;t.mediaCurrentTime.set(p,e)}}t[s].set(!1,e)},[h.MEDIA_PLAYBACK_RATE_REQUEST](t,e,{detail:i}){let a="mediaPlaybackRate",r=i;t[a].set(r,e)},[h.MEDIA_MUTE_REQUEST](t,e){t["mediaMuted"].set(!0,e)},[h.MEDIA_UNMUTE_REQUEST](t,e){let i="mediaMuted";t.mediaVolume.get(e)||t.mediaVolume.set(.25,e),t[i].set(!1,e)},[h.MEDIA_LOOP_REQUEST](t,e,{detail:i}){let a="mediaLoop",r=!!i;return t[a].set(r,e),{mediaLoop:r}},[h.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)},[h.MEDIA_SEEK_REQUEST](t,e,{detail:i}){let a="mediaCurrentTime",r=i;t[a].set(r,e)},[h.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)},[h.MEDIA_SHOW_SUBTITLES_REQUEST](t,e,{detail:i}){var a;let{options:r}=e,o=qi(e),s=cl(i),d=(a=s[0])==null?void 0:a.language;d&&!r.noSubtitlesLangPref&&l.localStorage.setItem("media-chrome-pref-subtitles-lang",d),ui(Nt.SHOWING,o,s)},[h.MEDIA_DISABLE_SUBTITLES_REQUEST](t,e,{detail:i}){let a=qi(e),r=i!=null?i:[];ui(Nt.DISABLED,a,r)},[h.MEDIA_TOGGLE_SUBTITLES_REQUEST](t,e,{detail:i}){zo(e,i)},[h.MEDIA_RENDITION_REQUEST](t,e,{detail:i}){let a="mediaRenditionSelected",r=i;t[a].set(r,e)},[h.MEDIA_AUDIO_TRACK_REQUEST](t,e,{detail:i}){let a="mediaAudioTrackEnabled",r=i;t[a].set(r,e)},[h.MEDIA_ENTER_PIP_REQUEST](t,e){let i="mediaIsPip";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[h.MEDIA_EXIT_PIP_REQUEST](t,e){t["mediaIsPip"].set(!1,e)},[h.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)},[h.MEDIA_EXIT_FULLSCREEN_REQUEST](t,e){t["mediaIsFullscreen"].set(!1,e)},[h.MEDIA_ENTER_CAST_REQUEST](t,e){let i="mediaIsCasting";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[i].set(!0,e)},[h.MEDIA_EXIT_CAST_REQUEST](t,e){t["mediaIsCasting"].set(!1,e)},[h.MEDIA_AIRPLAY_REQUEST](t,e){t["mediaIsAirplaying"].set(!0,e)}};var pc=({media:t,fullscreenElement:e,documentElement:i,stateMediator:a=Zi,requestMap:r=hc,options:o={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{let d=[],u={options:{...o}},f=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),y=g=>{g!=null&&(Qo(g,f)||(f=Object.freeze({...f,...g}),d.forEach(S=>S(f))))},A=()=>{let g=Object.entries(a).reduce((S,[C,{get:j}])=>(S[C]=j(u),S),{});y(g)},E={},p,k=async(g,S)=>{var C,j,Ue,Ot,bt,Ce,we,Pt,Qe,Wa,Fa,Va,Ka,Ga,Ya,qa;let So=!!p;if(p={...u,...p!=null?p:{},...g},So)return;await mc(...Object.values(g));let gt=d.length>0&&S===0&&s,Za=u.media!==p.media,za=((C=u.media)==null?void 0:C.textTracks)!==((j=p.media)==null?void 0:j.textTracks),Qa=((Ue=u.media)==null?void 0:Ue.videoRenditions)!==((Ot=p.media)==null?void 0:Ot.videoRenditions),Xa=((bt=u.media)==null?void 0:bt.audioTracks)!==((Ce=p.media)==null?void 0:Ce.audioTracks),Ja=((we=u.media)==null?void 0:we.remote)!==((Pt=p.media)==null?void 0:Pt.remote),ja=u.documentElement!==p.documentElement,er=!!u.media&&(Za||gt),vu=!!((Qe=u.media)!=null&&Qe.textTracks)&&(za||gt),Eu=!!((Wa=u.media)!=null&&Wa.videoRenditions)&&(Qa||gt),bu=!!((Fa=u.media)!=null&&Fa.audioTracks)&&(Xa||gt),gu=!!((Va=u.media)!=null&&Va.remote)&&(Ja||gt),_u=!!u.documentElement&&(ja||gt),Qs=er||vu||Eu||bu||gu||_u,Ni=d.length===0&&S===1&&s,Au=!!p.media&&(Za||Ni),Tu=!!((Ka=p.media)!=null&&Ka.textTracks)&&(za||Ni),yu=!!((Ga=p.media)!=null&&Ga.videoRenditions)&&(Qa||Ni),ku=!!((Ya=p.media)!=null&&Ya.audioTracks)&&(Xa||Ni),Su=!!((qa=p.media)!=null&&qa.remote)&&(Ja||Ni),Iu=!!p.documentElement&&(ja||Ni),Mu=Au||Tu||yu||ku||Su||Iu;if(!(Qs||Mu)){Object.entries(p).forEach(([F,tr])=>{u[F]=tr}),A(),p=void 0;return}Object.entries(a).forEach(([F,{get:tr,mediaEvents:Rh=[],textTracksEvents:xh=[],videoRenditionsEvents:Dh=[],audioTracksEvents:Oh=[],remoteEvents:Ph=[],rootEvents:Nh=[],stateOwnersUpdateHandlers:Uh=[]}])=>{E[F]||(E[F]={});let ke=Q=>{let ie=tr(u,Q);y({[F]:ie})},ne;ne=E[F].mediaEvents,Rh.forEach(Q=>{ne&&er&&(u.media.removeEventListener(Q,ne),E[F].mediaEvents=void 0),Au&&(p.media.addEventListener(Q,ke),E[F].mediaEvents=ke)}),ne=E[F].textTracksEvents,xh.forEach(Q=>{var ie,He;ne&&vu&&((ie=u.media.textTracks)==null||ie.removeEventListener(Q,ne),E[F].textTracksEvents=void 0),Tu&&((He=p.media.textTracks)==null||He.addEventListener(Q,ke),E[F].textTracksEvents=ke)}),ne=E[F].videoRenditionsEvents,Dh.forEach(Q=>{var ie,He;ne&&Eu&&((ie=u.media.videoRenditions)==null||ie.removeEventListener(Q,ne),E[F].videoRenditionsEvents=void 0),yu&&((He=p.media.videoRenditions)==null||He.addEventListener(Q,ke),E[F].videoRenditionsEvents=ke)}),ne=E[F].audioTracksEvents,Oh.forEach(Q=>{var ie,He;ne&&bu&&((ie=u.media.audioTracks)==null||ie.removeEventListener(Q,ne),E[F].audioTracksEvents=void 0),ku&&((He=p.media.audioTracks)==null||He.addEventListener(Q,ke),E[F].audioTracksEvents=ke)}),ne=E[F].remoteEvents,Ph.forEach(Q=>{var ie,He;ne&&gu&&((ie=u.media.remote)==null||ie.removeEventListener(Q,ne),E[F].remoteEvents=void 0),Su&&((He=p.media.remote)==null||He.addEventListener(Q,ke),E[F].remoteEvents=ke)}),ne=E[F].rootEvents,Nh.forEach(Q=>{ne&&_u&&(u.documentElement.removeEventListener(Q,ne),E[F].rootEvents=void 0),Iu&&(p.documentElement.addEventListener(Q,ke),E[F].rootEvents=ke)});let Io=E[F].stateOwnersUpdateHandlers;if(Io&&Qs&&(Array.isArray(Io)?Io:[Io]).forEach(ie=>{typeof ie=="function"&&ie()}),Mu){let Q=Uh.map(ie=>ie(ke,p)).filter(ie=>typeof ie=="function");E[F].stateOwnersUpdateHandlers=Q.length===1?Q[0]:Q}else Qs&&(E[F].stateOwnersUpdateHandlers=void 0)}),Object.entries(p).forEach(([F,tr])=>{u[F]=tr}),A(),p=void 0};return k({media:t,fullscreenElement:e,documentElement:i,options:o}),{dispatch(g){let{type:S,detail:C}=g;if(r[S]&&f.mediaErrorCode==null){y(r[S](a,u,g));return}S==="mediaelementchangerequest"?k({media:C}):S==="fullscreenelementchangerequest"?k({fullscreenElement:C}):S==="documentelementchangerequest"?k({documentElement:C}):S==="optionschangerequest"&&(Object.entries(C!=null?C:{}).forEach(([j,Ue])=>{u.options[j]=Ue}),A())},getState(){return f},subscribe(g){return k({},d.length+1),d.push(g),g(f),()=>{let S=d.indexOf(g);S>=0&&(k({},d.length-1),d.splice(S,1))}}}};var _l=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},_=(t,e,i)=>(_l(t,e,"read from private field"),i?i.call(t):e.get(t)),Re=(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)},Ke=(t,e,i,a)=>(_l(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),mr=(t,e,i)=>(_l(t,e,"access private method"),i),kt,hr,H,je,pr,Je,Jo,fr,jo,vl,hi,en,El,bl,Ac,Tc=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," ","f","m","k","c","l","j",">","<","p"],fc=10,vc=.025,Ec=.25,kp=.25,Sp=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"},tn=class extends si{constructor(){super(),Re(this,jo),Re(this,en),Re(this,bl),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,Re(this,kt,new Bt(this,v.HOTKEYS)),Re(this,hr,void 0),Re(this,H,void 0),Re(this,je,null),Re(this,pr,void 0),Re(this,Je,void 0),Re(this,Jo,i=>{var a;(a=_(this,H))==null||a.dispatch(i)}),Re(this,fr,void 0),Re(this,hi,i=>{let{key:a,shiftKey:r}=i;if(!(r&&(a==="/"||a==="?")||Tc.includes(a))){this.removeEventListener("keyup",_(this,hi));return}this.keyboardShortcutHandler(i)}),this.associateElement(this);let e={};Ke(this,pr,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(xu[o],{composed:!0,detail:r});this.dispatchEvent(s)}),e=i})}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,v.LIVE_EDGE_OFFSET,v.SEEK_TO_LIVE_OFFSET,v.NO_AUTO_SEEK_TO_LIVE)}get mediaStore(){return _(this,H)}set mediaStore(e){var i,a;if(_(this,H)&&((i=_(this,Je))==null||i.call(this),Ke(this,Je,void 0)),Ke(this,H,e),!_(this,H)&&!this.hasAttribute(v.NO_DEFAULT_STORE)){mr(this,jo,vl).call(this);return}Ke(this,Je,(a=_(this,H))==null?void 0:a.subscribe(_(this,pr)))}get fullscreenElement(){var e;return(e=_(this,hr))!=null?e:this}set fullscreenElement(e){var i;this.hasAttribute(v.FULLSCREEN_ELEMENT)&&this.removeAttribute(v.FULLSCREEN_ELEMENT),Ke(this,hr,e),(i=_(this,H))==null||i.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}get defaultSubtitles(){return M(this,v.DEFAULT_SUBTITLES)}set defaultSubtitles(e){L(this,v.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return x(this,v.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){w(this,v.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return P(this,v.DEFAULT_DURATION)}set defaultDuration(e){U(this,v.DEFAULT_DURATION,e)}get noHotkeys(){return M(this,v.NO_HOTKEYS)}set noHotkeys(e){L(this,v.NO_HOTKEYS,e)}get keysUsed(){return x(this,v.KEYS_USED)}set keysUsed(e){w(this,v.KEYS_USED,e)}get liveEdgeOffset(){return P(this,v.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){U(this,v.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return M(this,v.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){L(this,v.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return M(this,v.NO_VOLUME_PREF)}set noVolumePref(e){L(this,v.NO_VOLUME_PREF,e)}get noMutedPref(){return M(this,v.NO_MUTED_PREF)}set noMutedPref(e){L(this,v.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return M(this,v.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){L(this,v.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return M(this,v.NO_DEFAULT_STORE)}set noDefaultStore(e){L(this,v.NO_DEFAULT_STORE,e)}attributeChangedCallback(e,i,a){var r,o,s,d,u,f,y,A,E,p,k,g;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)_(this,kt).value=a;else if(e===v.DEFAULT_SUBTITLES&&a!==i)(r=_(this,H))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(v.DEFAULT_SUBTITLES)}});else if(e===v.DEFAULT_STREAM_TYPE)(s=_(this,H))==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&&a!==i)(d=_(this,H))==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)?+this.getAttribute(v.SEEK_TO_LIVE_OFFSET):this.hasAttribute(v.LIVE_EDGE_OFFSET)?+this.getAttribute(v.LIVE_EDGE_OFFSET):void 0}});else if(e===v.SEEK_TO_LIVE_OFFSET&&a!==i)(u=_(this,H))==null||u.dispatch({type:"optionschangerequest",detail:{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}});else if(e===v.NO_AUTO_SEEK_TO_LIVE)(f=_(this,H))==null||f.dispatch({type:"optionschangerequest",detail:{noAutoSeekToLive:this.hasAttribute(v.NO_AUTO_SEEK_TO_LIVE)}});else if(e===v.FULLSCREEN_ELEMENT){let S=a?(y=this.getRootNode())==null?void 0:y.getElementById(a):void 0;Ke(this,hr,S),(A=_(this,H))==null||A.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}else e===v.LANG&&a!==i?(Wu(a),(E=_(this,H))==null||E.dispatch({type:"optionschangerequest",detail:{mediaLang:a}})):e===v.LOOP&&a!==i?(p=_(this,H))==null||p.dispatch({type:h.MEDIA_LOOP_REQUEST,detail:a!=null}):e===v.NO_VOLUME_PREF&&a!==i?(k=_(this,H))==null||k.dispatch({type:"optionschangerequest",detail:{noVolumePref:this.hasAttribute(v.NO_VOLUME_PREF)}}):e===v.NO_MUTED_PREF&&a!==i&&((g=_(this,H))==null||g.dispatch({type:"optionschangerequest",detail:{noMutedPref:this.hasAttribute(v.NO_MUTED_PREF)}}))}connectedCallback(){var e,i,a;this.associateElement(this),!_(this,H)&&!this.hasAttribute(v.NO_DEFAULT_STORE)&&mr(this,jo,vl).call(this),(e=_(this,H))==null||e.dispatch({type:"documentelementchangerequest",detail:V}),(i=_(this,H))==null||i.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement}),super.connectedCallback(),_(this,H)&&!_(this,Je)&&Ke(this,Je,(a=_(this,H))==null?void 0:a.subscribe(_(this,pr))),_(this,fr)!==void 0&&_(this,H)&&this.media&&setTimeout(()=>{var r,o,s;(o=(r=this.media)==null?void 0:r.textTracks)!=null&&o.length&&((s=_(this,H))==null||s.dispatch({type:h.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:_(this,fr)}))},0),this.hasAttribute(v.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,i,a,r,o,s;if((e=super.disconnectedCallback)==null||e.call(this),this.disableHotkeys(),_(this,H)){let d=_(this,H).getState();Ke(this,fr,!!((i=d.mediaSubtitlesShowing)!=null&&i.length)),(a=_(this,H))==null||a.dispatch({type:"fullscreenelementchangerequest",detail:void 0}),(r=_(this,H))==null||r.dispatch({type:"documentelementchangerequest",detail:void 0}),(o=_(this,H))==null||o.dispatch({type:h.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}_(this,Je)&&((s=_(this,Je))==null||s.call(this),Ke(this,Je,void 0)),this.unassociateElement(this),_(this,je)&&(_(this,je).remove(),Ke(this,je,null))}mediaSetCallback(e){var i;super.mediaSetCallback(e),(i=_(this,H))==null||i.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var i;super.mediaUnsetCallback(e),(i=_(this,H))==null||i.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,i){_c(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=Rp(e,a,r);Object.values(h).forEach(s=>{e.addEventListener(s,_(this,Jo))}),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(h).forEach(r=>{e.removeEventListener(r,_(this,Jo))})}registerMediaStateReceiver(e){if(!e)return;let i=this.mediaStateReceivers;i.indexOf(e)>-1||(i.push(e),_(this,H)&&Object.entries(_(this,H).getState()).forEach(([r,o])=>{_c([e],r,o)}))}unregisterMediaStateReceiver(e){let i=this.mediaStateReceivers,a=i.indexOf(e);a<0||i.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",mr(this,en,El))}disableHotkeys(){this.removeEventListener("keydown",mr(this,en,El)),this.removeEventListener("keyup",_(this,hi))}get hotkeys(){return _(this,kt)}set hotkeys(e){w(this,v.HOTKEYS,e)}keyboardShortcutHandler(e){var i,a,r,o,s,d,u,f,y;let A=e.target;if(((r=(a=(i=A.getAttribute(v.KEYS_USED))==null?void 0:i.split(" "))!=null?a:A==null?void 0:A.keysUsed)!=null?r:[]).map(C=>C==="Space"?" ":C).filter(Boolean).includes(e.key))return;let p,k,g;if(!(_(this,kt).contains(`no${e.key.toLowerCase()}`)||e.key===" "&&_(this,kt).contains("nospace")||e.shiftKey&&(e.key==="/"||e.key==="?")&&_(this,kt).contains("noshift+/")))switch(e.key){case" ":case"k":p=_(this,H).getState().mediaPaused?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new l.CustomEvent(p,{composed:!0,bubbles:!0}));break;case"m":p=this.mediaStore.getState().mediaVolumeLevel==="off"?h.MEDIA_UNMUTE_REQUEST:h.MEDIA_MUTE_REQUEST,this.dispatchEvent(new l.CustomEvent(p,{composed:!0,bubbles:!0}));break;case"f":p=this.mediaStore.getState().mediaIsFullscreen?h.MEDIA_EXIT_FULLSCREEN_REQUEST:h.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new l.CustomEvent(p,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new l.CustomEvent(h.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):fc;k=Math.max(((o=this.mediaStore.getState().mediaCurrentTime)!=null?o:0)-C,0),g=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:k}),this.dispatchEvent(g);break}case"ArrowRight":case"l":{let C=this.hasAttribute(v.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(v.KEYBOARD_FORWARD_SEEK_OFFSET):fc;k=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+C,0),g=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:k}),this.dispatchEvent(g);break}case"ArrowUp":{let C=this.hasAttribute(v.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(v.KEYBOARD_UP_VOLUME_STEP):vc;k=Math.min(((d=this.mediaStore.getState().mediaVolume)!=null?d:1)+C,1),g=new l.CustomEvent(h.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:k}),this.dispatchEvent(g);break}case"ArrowDown":{let C=this.hasAttribute(v.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(v.KEYBOARD_DOWN_VOLUME_STEP):vc;k=Math.max(((u=this.mediaStore.getState().mediaVolume)!=null?u:1)-C,0),g=new l.CustomEvent(h.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:k}),this.dispatchEvent(g);break}case"<":{let C=(f=this.mediaStore.getState().mediaPlaybackRate)!=null?f:1;k=Math.max(C-Ec,kp).toFixed(2),g=new l.CustomEvent(h.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:k}),this.dispatchEvent(g);break}case">":{let C=(y=this.mediaStore.getState().mediaPlaybackRate)!=null?y:1;k=Math.min(C+Ec,Sp).toFixed(2),g=new l.CustomEvent(h.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:k}),this.dispatchEvent(g);break}case"/":case"?":{e.shiftKey&&mr(this,bl,Ac).call(this);break}case"p":{p=this.mediaStore.getState().mediaIsPip?h.MEDIA_EXIT_PIP_REQUEST:h.MEDIA_ENTER_PIP_REQUEST,g=new l.CustomEvent(p,{composed:!0,bubbles:!0}),this.dispatchEvent(g);break}default:break}}};kt=new WeakMap;hr=new WeakMap;H=new WeakMap;je=new WeakMap;pr=new WeakMap;Je=new WeakMap;Jo=new WeakMap;fr=new WeakMap;jo=new WeakSet;vl=function(){var t;this.mediaStore=pc({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)}})};hi=new WeakMap;en=new WeakSet;El=function(t){var e;let{metaKey:i,altKey:a,key:r,shiftKey:o}=t,s=o&&(r==="/"||r==="?");if(s&&((e=_(this,je))!=null&&e.open)){this.removeEventListener("keyup",_(this,hi));return}if(i||a||!s&&!Tc.includes(r)){this.removeEventListener("keyup",_(this,hi));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)&&!(_(this,kt).contains(`no${r.toLowerCase()}`)||r===" "&&_(this,kt).contains("nospace"))&&!u&&t.preventDefault(),this.addEventListener("keyup",_(this,hi),{once:!0})};bl=new WeakSet;Ac=function(){_(this,je)||(Ke(this,je,V.createElement("media-keyboard-shortcuts-dialog")),this.appendChild(_(this,je))),_(this,je).open=!0};var Ip=Object.values(n),Mp=Object.values(tl),yc=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,D.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(o||s)?(o||s).filter(d=>Ip.includes(d)):[]},Lp=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),Mp.some(a=>a in t)},gl=t=>Lp(t)||!!yc(t).length,bc=t=>{var e;return(e=t==null?void 0:t.join)==null?void 0:e.call(t,":")},gc={[n.MEDIA_SUBTITLES_LIST]:yt,[n.MEDIA_SUBTITLES_SHOWING]:yt,[n.MEDIA_SEEKABLE]:bc,[n.MEDIA_BUFFERED]:t=>t==null?void 0:t.map(bc).join(" "),[n.MEDIA_PREVIEW_COORDS]:t=>t==null?void 0:t.join(" "),[n.MEDIA_RENDITION_LIST]:Ou,[n.MEDIA_AUDIO_TRACK_LIST]:Nu},Cp=async(t,e,i)=>{var a,r;if(t.isConnected||await Co(0),typeof i=="boolean"||i==null)return L(t,e,i);if(typeof i=="number")return U(t,e,i);if(typeof i=="string")return w(t,e,i);if(Array.isArray(i)&&!i.length)return t.removeAttribute(e);let o=(r=(a=gc[e])==null?void 0:a.call(gc,i))!=null?r:i;return t.setAttribute(e,o)},wp=t=>{var e;return!!((e=t.closest)!=null&&e.call(t,'*[slot="media"]'))},mi=(t,e)=>{if(wp(t))return;let i=(r,o)=>{var s,d;gl(r)&&o(r);let{children:u=[]}=r!=null?r:{},f=(d=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?d:[];[...u,...f].forEach(A=>mi(A,o))},a=t==null?void 0:t.nodeName.toLowerCase();if(a.includes("-")&&!gl(t)){l.customElements.whenDefined(a).then(()=>{i(t,e)});return}i(t,e)},_c=(t,e,i)=>{t.forEach(a=>{if(e in a){a[e]=i;return}let r=yc(a),o=e.toLowerCase();r.includes(o)&&Cp(a,o,i)})},Rp=(t,e,i)=>{mi(t,e);let a=y=>{var A;let E=(A=y==null?void 0:y.composedPath()[0])!=null?A:y.target;e(E)},r=y=>{var A;let E=(A=y==null?void 0:y.composedPath()[0])!=null?A:y.target;i(E)};t.addEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),t.addEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r);let o=y=>{y.forEach(A=>{let{addedNodes:E=[],removedNodes:p=[],type:k,target:g,attributeName:S}=A;k==="childList"?(Array.prototype.forEach.call(E,C=>mi(C,e)),Array.prototype.forEach.call(p,C=>mi(C,i))):k==="attributes"&&S===D.MEDIA_CHROME_ATTRIBUTES&&(gl(g)?e(g):i(g))})},s=[],d=y=>{let A=y.target;A.name!=="media"&&(s.forEach(E=>mi(E,i)),s=[...A.assignedElements({flatten:!0})],s.forEach(E=>mi(E,e)))};t.addEventListener("slotchange",d);let u=new MutationObserver(o);return u.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{mi(t,i),t.removeEventListener("slotchange",d),u.disconnect(),t.removeEventListener(h.REGISTER_MEDIA_STATE_RECEIVER,a),t.removeEventListener(h.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};l.customElements.get("media-controller")||l.customElements.define("media-controller",tn);var Al=tn;var zi={PLACEMENT:"placement",BOUNDS:"bounds"};function xp(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 Qi=class extends l.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!
|
|
268
|
+
`}var Qi=class extends l.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!No(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=Xe(this,"#"+this.bounds))!=null?e:Y(this);if(!r)return;let{x:o,width:s}=r.getBoundingClientRect(),{x:d,width:u}=this.getBoundingClientRect(),f=d+u,y=o+s,A=a.getPropertyValue("--media-tooltip-offset-x"),E=A?parseFloat(A.replace("px","")):0,p=a.getPropertyValue("--media-tooltip-container-margin"),k=p?parseFloat(p.replace("px","")):0,g=d-o+E-k,S=f-y+E+k;if(g<0){this.style.setProperty("--media-tooltip-offset-x",`${g}px`);return}if(S>0){this.style.setProperty("--media-tooltip-offset-x",`${S}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[zi.PLACEMENT,zi.BOUNDS]}get placement(){return x(this,zi.PLACEMENT)}set placement(e){w(this,zi.PLACEMENT,e)}get bounds(){return x(this,zi.BOUNDS)}set bounds(e){w(this,zi.BOUNDS,e)}};Qi.shadowRootOptions={mode:"open"};Qi.getTemplateHTML=xp;l.customElements.get("media-tooltip")||l.customElements.define("media-tooltip",Qi);var an=Qi;var yl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},re=(t,e,i)=>(yl(t,e,"read from private field"),i?i.call(t):e.get(t)),Xi=(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)},rn=(t,e,i,a)=>(yl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Dp=(t,e,i)=>(yl(t,e,"access private method"),i),et,ji,Wt,Ji,on,Tl,kc,$t={TOOLTIP_PLACEMENT:"tooltipplacement",DISABLED:"disabled",NO_TOOLTIP:"notooltip"};function Op(t,e={}){return`
|
|
269
269
|
<style>
|
|
270
270
|
:host {
|
|
271
271
|
position: relative;
|
|
@@ -339,8 +339,8 @@
|
|
|
339
339
|
|
|
340
340
|
<slot name="tooltip">
|
|
341
341
|
<media-tooltip part="tooltip" aria-hidden="true">
|
|
342
|
-
<template shadowrootmode="${
|
|
343
|
-
${
|
|
342
|
+
<template shadowrootmode="${an.shadowRootOptions.mode}">
|
|
343
|
+
${an.getTemplateHTML({})}
|
|
344
344
|
</template>
|
|
345
345
|
<slot name="tooltip-content">
|
|
346
346
|
${this.getTooltipContentHTML(t)}
|
|
@@ -349,7 +349,7 @@
|
|
|
349
349
|
</slot>
|
|
350
350
|
`}function Pp(t,e){return`
|
|
351
351
|
<slot></slot>
|
|
352
|
-
`}function Np(){return""}var B=class extends l.HTMLElement{constructor(){if(super(),Xi(this,
|
|
352
|
+
`}function Np(){return""}var B=class extends l.HTMLElement{constructor(){if(super(),Xi(this,Tl),Xi(this,et,void 0),this.preventClick=!1,this.tooltipEl=null,Xi(this,ji,e=>{this.preventClick||this.handleClick(e),setTimeout(re(this,Wt),0)}),Xi(this,Wt,()=>{var e,i;(i=(e=this.tooltipEl)==null?void 0:e.updateXOffset)==null||i.call(e)}),Xi(this,Ji,e=>{let{key:i}=e;if(!this.keysUsed.includes(i)){this.removeEventListener("keyup",re(this,Ji));return}this.preventClick||this.handleClick(e)}),Xi(this,on,e=>{let{metaKey:i,altKey:a,key:r}=e;if(i||a||!this.keysUsed.includes(r)){this.removeEventListener("keyup",re(this,Ji));return}this.addEventListener("keyup",re(this,Ji),{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",$t.TOOLTIP_PLACEMENT,D.MEDIA_CONTROLLER,n.MEDIA_LANG]}enable(){this.addEventListener("click",re(this,ji)),this.addEventListener("keydown",re(this,on)),this.tabIndex=0}disable(){this.removeEventListener("click",re(this,ji)),this.removeEventListener("keydown",re(this,on)),this.removeEventListener("keyup",re(this,Ji)),this.tabIndex=-1}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===D.MEDIA_CONTROLLER?(i&&((o=(r=re(this,et))==null?void 0:r.unassociateElement)==null||o.call(r,this),rn(this,et,null)),a&&this.isConnected&&(rn(this,et,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=re(this,et))==null?void 0:d.associateElement)==null||u.call(d,this))):e==="disabled"&&a!==i?a==null?this.enable():this.disable():e===$t.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()),re(this,Wt).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(D.MEDIA_CONTROLLER);o&&(rn(this,et,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(a=(i=re(this,et))==null?void 0:i.associateElement)==null||a.call(i,this)),l.customElements.whenDefined("media-tooltip").then(()=>Dp(this,Tl,kc).call(this))}disconnectedCallback(){var e,i;this.disable(),(i=(e=re(this,et))==null?void 0:e.unassociateElement)==null||i.call(e,this),rn(this,et,null),this.removeEventListener("mouseenter",re(this,Wt)),this.removeEventListener("focus",re(this,Wt)),this.removeEventListener("click",re(this,ji))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return x(this,$t.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){w(this,$t.TOOLTIP_PLACEMENT,e)}get mediaController(){return x(this,D.MEDIA_CONTROLLER)}set mediaController(e){w(this,D.MEDIA_CONTROLLER,e)}get disabled(){return M(this,$t.DISABLED)}set disabled(e){L(this,$t.DISABLED,e)}get noTooltip(){return M(this,$t.NO_TOOLTIP)}set noTooltip(e){L(this,$t.NO_TOOLTIP,e)}handleClick(e){}};et=new WeakMap;ji=new WeakMap;Wt=new WeakMap;Ji=new WeakMap;on=new WeakMap;Tl=new WeakSet;kc=function(){this.addEventListener("mouseenter",re(this,Wt)),this.addEventListener("focus",re(this,Wt)),this.addEventListener("click",re(this,ji));let t=this.tooltipPlacement;t&&this.tooltipEl&&(this.tooltipEl.placement=t)};B.shadowRootOptions={mode:"open"};B.getTemplateHTML=Op;B.getSlotTemplateHTML=Pp;B.getTooltipContentHTML=Np;l.customElements.get("media-chrome-button")||l.customElements.define("media-chrome-button",B);var Sc=`<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
355
|
`;function Up(t){return`
|
|
@@ -376,7 +376,7 @@
|
|
|
376
376
|
`}function Hp(){return`
|
|
377
377
|
<slot name="tooltip-enter">${c("start airplay")}</slot>
|
|
378
378
|
<slot name="tooltip-exit">${c("stop airplay")}</slot>
|
|
379
|
-
`}var Ic=t=>{let e=t.mediaIsAirplaying?c("stop airplay"):c("start airplay");t.setAttribute("aria-label",e)},
|
|
379
|
+
`}var Ic=t=>{let e=t.mediaIsAirplaying?c("stop airplay"):c("start airplay");t.setAttribute("aria-label",e)},vr=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_AIRPLAYING,n.MEDIA_AIRPLAY_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Ic(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_AIRPLAYING&&Ic(this)}get mediaIsAirplaying(){return M(this,n.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){L(this,n.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return x(this,n.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){w(this,n.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new l.CustomEvent(h.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};vr.getSlotTemplateHTML=Up;vr.getTooltipContentHTML=Hp;l.customElements.get("media-airplay-button")||l.customElements.define("media-airplay-button",vr);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
381
|
</svg>`,$p=`<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"/>
|
|
@@ -404,7 +404,7 @@
|
|
|
404
404
|
`}function Fp(){return`
|
|
405
405
|
<slot name="tooltip-enable">${c("Enable captions")}</slot>
|
|
406
406
|
<slot name="tooltip-disable">${c("Disable captions")}</slot>
|
|
407
|
-
`}var Mc=t=>{t.setAttribute("aria-checked",
|
|
407
|
+
`}var Mc=t=>{t.setAttribute("aria-checked",qo(t).toString())},Er=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_SUBTITLES_LIST,n.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","button"),this.setAttribute("aria-label",c("closed captions")),Mc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_SUBTITLES_SHOWING&&Mc(this)}get mediaSubtitlesList(){return Lc(this,n.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Cc(this,n.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Lc(this,n.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Cc(this,n.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new l.CustomEvent(h.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}};Er.getSlotTemplateHTML=Wp;Er.getTooltipContentHTML=Fp;var Lc=(t,e)=>{let i=t.getAttribute(e);return i?di(i):[]},Cc=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=yt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};l.customElements.get("media-captions-button")||l.customElements.define("media-captions-button",Er);var Vp='<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>',Kp='<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 Gp(t){return`
|
|
408
408
|
<style>
|
|
409
409
|
:host([${n.MEDIA_IS_CASTING}]) slot[name=icon] slot:not([name=exit]) {
|
|
410
410
|
display: none !important;
|
|
@@ -428,7 +428,7 @@
|
|
|
428
428
|
`}function Yp(){return`
|
|
429
429
|
<slot name="tooltip-enter">${c("Start casting")}</slot>
|
|
430
430
|
<slot name="tooltip-exit">${c("Stop casting")}</slot>
|
|
431
|
-
`}var wc=t=>{let e=t.mediaIsCasting?c("stop casting"):c("start casting");t.setAttribute("aria-label",e)},
|
|
431
|
+
`}var wc=t=>{let e=t.mediaIsCasting?c("stop casting"):c("start casting");t.setAttribute("aria-label",e)},br=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_CASTING,n.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),wc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_CASTING&&wc(this)}get mediaIsCasting(){return M(this,n.MEDIA_IS_CASTING)}set mediaIsCasting(e){L(this,n.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return x(this,n.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){w(this,n.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?h.MEDIA_EXIT_CAST_REQUEST:h.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};br.getSlotTemplateHTML=Gp;br.getTooltipContentHTML=Yp;l.customElements.get("media-cast-button")||l.customElements.define("media-cast-button",br);var wl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},fi=(t,e,i)=>(wl(t,e,"read from private field"),i?i.call(t):e.get(t)),St=(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)},Rl=(t,e,i,a)=>(wl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),pi=(t,e,i)=>(wl(t,e,"access private method"),i),sn,_r,vi,nn,kl,Sl,Rc,Il,xc,Ml,Dc,Ll,Oc,Cl,Pc;function qp(t){return`
|
|
432
432
|
<style>
|
|
433
433
|
:host {
|
|
434
434
|
font: var(--media-font,
|
|
@@ -471,7 +471,7 @@
|
|
|
471
471
|
${this.getSlotTemplateHTML(t)}
|
|
472
472
|
`}function Zp(t){return`
|
|
473
473
|
<slot id="content"></slot>
|
|
474
|
-
`}var
|
|
474
|
+
`}var gr={OPEN:"open",ANCHOR:"anchor"},tt=class extends l.HTMLElement{constructor(){super(),St(this,nn),St(this,Sl),St(this,Il),St(this,Ml),St(this,Ll),St(this,Cl),St(this,sn,!1),St(this,_r,null),St(this,vi,null)}static get observedAttributes(){return[gr.OPEN,gr.ANCHOR]}get open(){return M(this,gr.OPEN)}set open(e){L(this,gr.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":pi(this,Ml,Dc).call(this,e);break;case"focusout":pi(this,Ll,Oc).call(this,e);break;case"keydown":pi(this,Cl,Pc).call(this,e);break}}connectedCallback(){pi(this,nn,kl).call(this),this.role||(this.role="dialog"),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}disconnectedCallback(){this.removeEventListener("invoke",this),this.removeEventListener("focusout",this),this.removeEventListener("keydown",this)}attributeChangedCallback(e,i,a){pi(this,nn,kl).call(this),e===gr.OPEN&&a!==i&&(this.open?pi(this,Sl,Rc).call(this):pi(this,Il,xc).call(this))}focus(){Rl(this,_r,or());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"]}};sn=new WeakMap;_r=new WeakMap;vi=new WeakMap;nn=new WeakSet;kl=function(){if(!fi(this,sn)&&(Rl(this,sn,!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")})}};Sl=new WeakSet;Rc=function(){var t;(t=fi(this,vi))==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;xc=function(){var t;(t=fi(this,vi))==null||t.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};Ml=new WeakSet;Dc=function(t){Rl(this,vi,t.relatedTarget),he(this,t.relatedTarget)||(this.open=!this.open)};Ll=new WeakSet;Oc=function(t){var e;he(this,t.relatedTarget)||((e=fi(this,_r))==null||e.focus(),fi(this,vi)&&fi(this,vi)!==t.relatedTarget&&this.open&&(this.open=!1))};Cl=new WeakSet;Pc=function(t){var e,i,a,r,o;let{key:s,ctrlKey:d,altKey:u,metaKey:f}=t;d||u||f||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=fi(this,_r))==null||o.focus(),this.open=!1))};tt.shadowRootOptions={mode:"open"};tt.getTemplateHTML=qp;tt.getSlotTemplateHTML=Zp;l.customElements.get("media-chrome-dialog")||l.customElements.define("media-chrome-dialog",tt);var Hl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},X=(t,e,i)=>(Hl(t,e,"read from private field"),i?i.call(t):e.get(t)),ce=(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)},Ft=(t,e,i,a)=>(Hl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ge=(t,e,i)=>(Hl(t,e,"access private method"),i),it,En,ln,dn,Ye,fn,un,cn,mn,Bl,Nc,hn,xl,pn,Dl,vn,$l,Ol,Uc,Pl,Hc,Nl,Bc,Ul,$c;function zp(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));
|
|
@@ -710,7 +710,7 @@
|
|
|
710
710
|
${this.getContainerTemplateHTML(t)}
|
|
711
711
|
</div>
|
|
712
712
|
<div id="rightgap"></div>
|
|
713
|
-
`}function Qp(t){return""}var at=class extends l.HTMLElement{constructor(){if(super(),ce(this,
|
|
713
|
+
`}function Qp(t){return""}var at=class extends l.HTMLElement{constructor(){if(super(),ce(this,Bl),ce(this,hn),ce(this,pn),ce(this,vn),ce(this,Ol),ce(this,Pl),ce(this,Nl),ce(this,Ul),ce(this,it,void 0),ce(this,En,void 0),ce(this,ln,void 0),ce(this,dn,void 0),ce(this,Ye,{}),ce(this,fn,[]),ce(this,un,()=>{if(this.range.matches(":focus-visible")){let{style:e}=q(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),ce(this,cn,()=>{let{style:e}=q(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),ce(this,mn,()=>{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"),Ft(this,ln,this.shadowRoot.querySelector("#startpoint")),Ft(this,dn,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",D.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===D.MEDIA_CONTROLLER?(i&&((o=(r=X(this,it))==null?void 0:r.unassociateElement)==null||o.call(r,this),Ft(this,it,null)),a&&this.isConnected&&(Ft(this,it,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=X(this,it))==null?void 0:d.associateElement)==null||u.call(d,this))):(e==="disabled"||e==="aria-disabled"&&i!==a)&&(a==null?(this.range.removeAttribute(e),Ge(this,hn,xl).call(this)):(this.range.setAttribute(e,a),Ge(this,pn,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))`),X(this,Ye).pointer=q(this.shadowRoot,"#pointer"),X(this,Ye).progress=q(this.shadowRoot,"#progress"),X(this,Ye).thumb=q(this.shadowRoot,'#thumb, ::slotted([slot="thumb"])'),X(this,Ye).activeSegment=q(this.shadowRoot,"#segments-clipping rect:nth-child(0)");let o=this.getAttribute(D.MEDIA_CONTROLLER);o&&(Ft(this,it,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(a=(i=X(this,it))==null?void 0:i.associateElement)==null||a.call(i,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",X(this,un)),this.shadowRoot.addEventListener("focusout",X(this,cn)),Ge(this,hn,xl).call(this),_t(this.container,X(this,mn))}disconnectedCallback(){var e,i;Ge(this,pn,Dl).call(this),(i=(e=X(this,it))==null?void 0:e.unassociateElement)==null||i.call(e,this),Ft(this,it,null),this.shadowRoot.removeEventListener("focusin",X(this,un)),this.shadowRoot.removeEventListener("focusout",X(this,cn)),At(this.container,X(this,mn))}updatePointerBar(e){var i;(i=X(this,Ye).pointer)==null||i.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,i;let a=this.range.valueAsNumber*100;(e=X(this,Ye).progress)==null||e.style.setProperty("width",`${a}%`),(i=X(this,Ye).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])];Ft(this,fn,[...a]);let r=a.pop();for(let[o,s]of a.entries()){let[d,u]=[o===0,o===a.length-1],f=d?"calc(var(--segments-gap) / -1)":`${s*100}%`,A=`calc(${((u?r:a[o+1])-s)*100}%${d||u?"":" - var(--segments-gap)"})`,E=V.createElementNS("http://www.w3.org/2000/svg","rect"),p=nr(this.shadowRoot,`#segments-clipping rect:nth-child(${o+1})`);p.style.setProperty("x",f),p.style.setProperty("width",A),i.append(E)}}getPointerRatio(e){return Zu(e.clientX,e.clientY,X(this,ln).getBoundingClientRect(),X(this,dn).getBoundingClientRect())}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":Ge(this,Ul,$c).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":Ge(this,Ol,Uc).call(this,e);break;case"pointerdown":Ge(this,vn,$l).call(this,e);break;case"pointerup":Ge(this,Pl,Hc).call(this);break;case"pointerleave":Ge(this,Nl,Bc).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};it=new WeakMap;En=new WeakMap;ln=new WeakMap;dn=new WeakMap;Ye=new WeakMap;fn=new WeakMap;un=new WeakMap;cn=new WeakMap;mn=new WeakMap;Bl=new WeakSet;Nc=function(t){let e=X(this,Ye).activeSegment;if(!e)return;let i=this.getPointerRatio(t),r=`#segments-clipping rect:nth-child(${X(this,fn).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))"))};hn=new WeakSet;xl=function(){this.hasAttribute("disabled")||!this.isConnected||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};pn=new WeakSet;Dl=function(){var t,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),this.removeEventListener("pointerleave",this),(t=l.window)==null||t.removeEventListener("pointerup",this),(e=l.window)==null||e.removeEventListener("pointermove",this)};vn=new WeakSet;$l=function(t){var e;Ft(this,En,t.composedPath().includes(this.range)),(e=l.window)==null||e.addEventListener("pointerup",this,{once:!0})};Ol=new WeakSet;Uc=function(t){var e;t.pointerType!=="mouse"&&Ge(this,vn,$l).call(this,t),this.addEventListener("pointerleave",this,{once:!0}),(e=l.window)==null||e.addEventListener("pointermove",this)};Pl=new WeakSet;Hc=function(){var t;(t=l.window)==null||t.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};Nl=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=X(this,Ye).activeSegment)==null||e.style.removeProperty("transform")};Ul=new WeakSet;$c=function(t){t.pointerType==="pen"&&t.buttons===0||(this.toggleAttribute("dragging",t.buttons===1||t.pointerType!=="mouse"),this.updatePointerBar(t),Ge(this,Bl,Nc).call(this,t),this.dragging&&(t.pointerType!=="mouse"||!X(this,En))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(t),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))))};at.shadowRootOptions={mode:"open"};at.getTemplateHTML=zp;at.getContainerTemplateHTML=Qp;l.customElements.get("media-chrome-range")||l.customElements.define("media-chrome-range",at);var Wc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},bn=(t,e,i)=>(Wc(t,e,"read from private field"),i?i.call(t):e.get(t)),Xp=(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)},gn=(t,e,i,a)=>(Wc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),rt;function Jp(t){return`
|
|
714
714
|
<style>
|
|
715
715
|
:host {
|
|
716
716
|
|
|
@@ -736,7 +736,7 @@
|
|
|
736
736
|
</style>
|
|
737
737
|
|
|
738
738
|
<slot></slot>
|
|
739
|
-
`}var
|
|
739
|
+
`}var Ar=class extends l.HTMLElement{constructor(){if(super(),Xp(this,rt,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[D.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===D.MEDIA_CONTROLLER&&(i&&((o=(r=bn(this,rt))==null?void 0:r.unassociateElement)==null||o.call(r,this),gn(this,rt,null)),a&&this.isConnected&&(gn(this,rt,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=bn(this,rt))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(D.MEDIA_CONTROLLER);r&&(gn(this,rt,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=bn(this,rt))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=bn(this,rt))==null?void 0:e.unassociateElement)==null||i.call(e,this),gn(this,rt,null)}};rt=new WeakMap;Ar.shadowRootOptions={mode:"open"};Ar.getTemplateHTML=Jp;l.customElements.get("media-control-bar")||l.customElements.define("media-control-bar",Ar);var Fc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},_n=(t,e,i)=>(Fc(t,e,"read from private field"),i?i.call(t):e.get(t)),jp=(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)},An=(t,e,i,a)=>(Fc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ot;function ef(t,e={}){return`
|
|
740
740
|
<style>
|
|
741
741
|
:host {
|
|
742
742
|
font: var(--media-font,
|
|
@@ -772,9 +772,9 @@
|
|
|
772
772
|
${this.getSlotTemplateHTML(t,e)}
|
|
773
773
|
`}function tf(t,e){return`
|
|
774
774
|
<slot></slot>
|
|
775
|
-
`}var Te=class extends l.HTMLElement{constructor(){if(super(),jp(this,ot,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[D.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===D.MEDIA_CONTROLLER&&(i&&((o=(r=
|
|
775
|
+
`}var Te=class extends l.HTMLElement{constructor(){if(super(),jp(this,ot,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[D.MEDIA_CONTROLLER]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===D.MEDIA_CONTROLLER&&(i&&((o=(r=_n(this,ot))==null?void 0:r.unassociateElement)==null||o.call(r,this),An(this,ot,null)),a&&this.isConnected&&(An(this,ot,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=_n(this,ot))==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(D.MEDIA_CONTROLLER);o&&(An(this,ot,(e=this.getRootNode())==null?void 0:e.getElementById(o)),(a=(i=_n(this,ot))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=_n(this,ot))==null?void 0:e.unassociateElement)==null||i.call(e,this),An(this,ot,null)}};ot=new WeakMap;Te.shadowRootOptions={mode:"open"};Te.getTemplateHTML=ef;Te.getSlotTemplateHTML=tf;l.customElements.get("media-text-display")||l.customElements.define("media-text-display",Te);var Kc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Vc=(t,e,i)=>(Kc(t,e,"read from private field"),i?i.call(t):e.get(t)),af=(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)},rf=(t,e,i,a)=>(Kc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Tr;function of(t,e){return`
|
|
776
776
|
<slot>${$e(e.mediaDuration)}</slot>
|
|
777
|
-
`}var
|
|
777
|
+
`}var Tn=class extends Te{constructor(){var e;super(),af(this,Tr,void 0),rf(this,Tr,this.shadowRoot.querySelector("slot")),Vc(this,Tr).textContent=$e((e=this.mediaDuration)!=null?e:0)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_DURATION]}attributeChangedCallback(e,i,a){e===n.MEDIA_DURATION&&(Vc(this,Tr).textContent=$e(+a)),super.attributeChangedCallback(e,i,a)}get mediaDuration(){return P(this,n.MEDIA_DURATION)}set mediaDuration(e){U(this,n.MEDIA_DURATION,e)}};Tr=new WeakMap;Tn.getSlotTemplateHTML=of;l.customElements.get("media-duration-display")||l.customElements.define("media-duration-display",Tn);var nf={2:c("Network Error"),3:c("Decode Error"),4:c("Source Not Supported"),5:c("Encryption Error")},sf={2:c("A network error caused the media download to fail."),3:c("A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format."),4:c("An unsupported error occurred. The server or network failed, or your browser does not support this format."),5:c("The media is encrypted and there are no keys to decrypt it.")},yn=t=>{var e,i;return t.code===1?null:{title:(e=nf[t.code])!=null?e:`Error ${t.code}`,message:(i=sf[t.code])!=null?i:t.message}};var Yc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},lf=(t,e,i)=>(Yc(t,e,"read from private field"),i?i.call(t):e.get(t)),df=(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)},uf=(t,e,i,a)=>(Yc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),kn;function cf(t){return`
|
|
778
778
|
<style>
|
|
779
779
|
:host {
|
|
780
780
|
background: rgb(20 20 30 / .8);
|
|
@@ -793,7 +793,7 @@
|
|
|
793
793
|
<slot name="error-${t.mediaerrorcode}" id="content">
|
|
794
794
|
${qc({code:+t.mediaerrorcode,message:t.mediaerrormessage})}
|
|
795
795
|
</slot>
|
|
796
|
-
`}function mf(t){return t.code&&
|
|
796
|
+
`}function mf(t){return t.code&&yn(t)!==null}function qc(t){var e;let{title:i,message:a}=(e=yn(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 Gc=[n.MEDIA_ERROR_CODE,n.MEDIA_ERROR_MESSAGE],ea=class extends tt{constructor(){super(...arguments),df(this,kn,null)}static get observedAttributes(){return[...super.observedAttributes,...Gc]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,i,a){var r;if(super.attributeChangedCallback(e,i,a),!Gc.includes(e))return;let o=(r=this.mediaError)!=null?r:{code:this.mediaErrorCode,message:this.mediaErrorMessage};if(this.open=mf(o),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(o),!this.hasAttribute("aria-label"))){let{title:s}=yn(o);s&&this.setAttribute("aria-label",s)}}get mediaError(){return lf(this,kn)}set mediaError(e){uf(this,kn,e)}get mediaErrorCode(){return P(this,"mediaerrorcode")}set mediaErrorCode(e){U(this,"mediaerrorcode",e)}get mediaErrorMessage(){return x(this,"mediaerrormessage")}set mediaErrorMessage(e){w(this,"mediaerrormessage",e)}};kn=new WeakMap;ea.getSlotTemplateHTML=cf;ea.formatErrorMessage=qc;l.customElements.get("media-error-dialog")||l.customElements.define("media-error-dialog",ea);var Sn=ea;var hf=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Vt=(t,e,i)=>(hf(t,e,"read from private field"),i?i.call(t):e.get(t)),Zc=(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)},ta,ia;function pf(t){return`
|
|
797
797
|
<style>
|
|
798
798
|
:host {
|
|
799
799
|
position: fixed;
|
|
@@ -890,7 +890,7 @@
|
|
|
890
890
|
<td class="description">${a}</td>
|
|
891
891
|
</tr>
|
|
892
892
|
`).join("")}</table>
|
|
893
|
-
`}var
|
|
893
|
+
`}var In=class extends tt{constructor(){super(...arguments),Zc(this,ta,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)}),Zc(this,ia,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",Vt(this,ta)),document.addEventListener("keydown",Vt(this,ia)))}disconnectedCallback(){this.removeEventListener("click",Vt(this,ta)),document.removeEventListener("keydown",Vt(this,ia))}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e==="open"&&(this.open?(this.addEventListener("click",Vt(this,ta)),document.addEventListener("keydown",Vt(this,ia))):(this.removeEventListener("click",Vt(this,ta)),document.removeEventListener("keydown",Vt(this,ia))))}};ta=new WeakMap;ia=new WeakMap;In.getSlotTemplateHTML=pf;l.customElements.get("media-keyboard-shortcuts-dialog")||l.customElements.define("media-keyboard-shortcuts-dialog",In);var Qc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},vf=(t,e,i)=>(Qc(t,e,"read from private field"),i?i.call(t):e.get(t)),Ef=(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)},bf=(t,e,i,a)=>(Qc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Mn,gf=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
894
894
|
<path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
|
|
895
895
|
</svg>`,_f=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
896
896
|
<path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
|
|
@@ -918,7 +918,7 @@
|
|
|
918
918
|
`}function Tf(){return`
|
|
919
919
|
<slot name="tooltip-enter">${c("Enter fullscreen mode")}</slot>
|
|
920
920
|
<slot name="tooltip-exit">${c("Exit fullscreen mode")}</slot>
|
|
921
|
-
`}var zc=t=>{let e=t.mediaIsFullscreen?c("exit fullscreen mode"):c("enter fullscreen mode");t.setAttribute("aria-label",e)},
|
|
921
|
+
`}var zc=t=>{let e=t.mediaIsFullscreen?c("exit fullscreen mode"):c("enter fullscreen mode");t.setAttribute("aria-label",e)},yr=class extends B{constructor(){super(...arguments),Ef(this,Mn,null)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_FULLSCREEN,n.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),zc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_FULLSCREEN&&zc(this)}get mediaFullscreenUnavailable(){return x(this,n.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){w(this,n.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return M(this,n.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){L(this,n.MEDIA_IS_FULLSCREEN,e)}handleClick(e){bf(this,Mn,e);let i=vf(this,Mn)instanceof PointerEvent,a=this.mediaIsFullscreen?new l.CustomEvent(h.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new l.CustomEvent(h.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:i});this.dispatchEvent(a)}};Mn=new WeakMap;yr.getSlotTemplateHTML=Af;yr.getTooltipContentHTML=Tf;l.customElements.get("media-fullscreen-button")||l.customElements.define("media-fullscreen-button",yr);var{MEDIA_TIME_IS_LIVE:Ln,MEDIA_PAUSED:kr}=n,{MEDIA_SEEK_TO_LIVE_REQUEST:yf,MEDIA_PLAY_REQUEST:kf}=h,Sf='<svg viewBox="0 0 6 12" aria-hidden="true"><circle cx="3" cy="6" r="2"></circle></svg>';function If(t){return`
|
|
922
922
|
<style>
|
|
923
923
|
:host { --media-tooltip-display: none; }
|
|
924
924
|
|
|
@@ -930,13 +930,13 @@
|
|
|
930
930
|
color: var(--media-live-button-icon-color, rgb(140, 140, 140));
|
|
931
931
|
}
|
|
932
932
|
|
|
933
|
-
:host([${
|
|
934
|
-
:host([${
|
|
933
|
+
:host([${Ln}]:not([${kr}])) slot[name=indicator] > *,
|
|
934
|
+
:host([${Ln}]:not([${kr}])) ::slotted([slot=indicator]) {
|
|
935
935
|
fill: var(--media-live-button-indicator-color, rgb(255, 0, 0));
|
|
936
936
|
color: var(--media-live-button-indicator-color, rgb(255, 0, 0));
|
|
937
937
|
}
|
|
938
938
|
|
|
939
|
-
:host([${
|
|
939
|
+
:host([${Ln}]:not([${kr}])) {
|
|
940
940
|
cursor: var(--media-cursor, not-allowed);
|
|
941
941
|
}
|
|
942
942
|
|
|
@@ -949,7 +949,7 @@
|
|
|
949
949
|
<slot name="indicator">${Sf}</slot>
|
|
950
950
|
|
|
951
951
|
<slot name="spacer"> </slot><slot name="text">${c("live")}</slot>
|
|
952
|
-
`}var Xc=t=>{var e;let i=t.mediaPaused||!t.mediaTimeIsLive,a=i?c("seek to live"):c("playing live");t.setAttribute("aria-label",a);let r=(e=t.shadowRoot)==null?void 0:e.querySelector('slot[name="text"]');r&&(r.textContent=c("live")),i?t.removeAttribute("aria-disabled"):t.setAttribute("aria-disabled","true")},
|
|
952
|
+
`}var Xc=t=>{var e;let i=t.mediaPaused||!t.mediaTimeIsLive,a=i?c("seek to live"):c("playing live");t.setAttribute("aria-label",a);let r=(e=t.shadowRoot)==null?void 0:e.querySelector('slot[name="text"]');r&&(r.textContent=c("live")),i?t.removeAttribute("aria-disabled"):t.setAttribute("aria-disabled","true")},Cn=class extends B{static get observedAttributes(){return[...super.observedAttributes,Ln,kr]}connectedCallback(){super.connectedCallback(),Xc(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),Xc(this)}get mediaPaused(){return M(this,n.MEDIA_PAUSED)}set mediaPaused(e){L(this,n.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return M(this,n.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){L(this,n.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new l.CustomEvent(yf,{composed:!0,bubbles:!0})),this.hasAttribute(kr)&&this.dispatchEvent(new l.CustomEvent(kf,{composed:!0,bubbles:!0})))}};Cn.getSlotTemplateHTML=If;l.customElements.get("media-live-button")||l.customElements.define("media-live-button",Cn);var jc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Sr=(t,e,i)=>(jc(t,e,"read from private field"),i?i.call(t):e.get(t)),Jc=(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)},Ir=(t,e,i,a)=>(jc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),nt,Rn,wn={LOADING_DELAY:"loadingdelay",NO_AUTOHIDE:"noautohide"},em=500,Mf=`
|
|
953
953
|
<svg aria-hidden="true" viewBox="0 0 100 100">
|
|
954
954
|
<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">
|
|
955
955
|
<animateTransform
|
|
@@ -1009,7 +1009,7 @@
|
|
|
1009
1009
|
|
|
1010
1010
|
<slot name="icon">${Mf}</slot>
|
|
1011
1011
|
<div id="status" role="status" aria-live="polite">${c("media loading")}</div>
|
|
1012
|
-
`}var
|
|
1012
|
+
`}var Mr=class extends l.HTMLElement{constructor(){if(super(),Jc(this,nt,void 0),Jc(this,Rn,em),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[D.MEDIA_CONTROLLER,n.MEDIA_PAUSED,n.MEDIA_LOADING,wn.LOADING_DELAY]}attributeChangedCallback(e,i,a){var r,o,s,d,u;e===wn.LOADING_DELAY&&i!==a?this.loadingDelay=Number(a):e===D.MEDIA_CONTROLLER&&(i&&((o=(r=Sr(this,nt))==null?void 0:r.unassociateElement)==null||o.call(r,this),Ir(this,nt,null)),a&&this.isConnected&&(Ir(this,nt,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=Sr(this,nt))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,i,a;let r=this.getAttribute(D.MEDIA_CONTROLLER);r&&(Ir(this,nt,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=Sr(this,nt))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=Sr(this,nt))==null?void 0:e.unassociateElement)==null||i.call(e,this),Ir(this,nt,null)}get loadingDelay(){return Sr(this,Rn)}set loadingDelay(e){Ir(this,Rn,e);let{style:i}=q(this.shadowRoot,":host");i.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return M(this,n.MEDIA_PAUSED)}set mediaPaused(e){L(this,n.MEDIA_PAUSED,e)}get mediaLoading(){return M(this,n.MEDIA_LOADING)}set mediaLoading(e){L(this,n.MEDIA_LOADING,e)}get mediaController(){return x(this,D.MEDIA_CONTROLLER)}set mediaController(e){w(this,D.MEDIA_CONTROLLER,e)}get noAutohide(){return M(this,wn.NO_AUTOHIDE)}set noAutohide(e){L(this,wn.NO_AUTOHIDE,e)}};nt=new WeakMap;Rn=new WeakMap;Mr.shadowRootOptions={mode:"open"};Mr.getTemplateHTML=Lf;l.customElements.get("media-loading-indicator")||l.customElements.define("media-loading-indicator",Mr);var Cf=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1013
1013
|
<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"/>
|
|
1014
1014
|
</svg>`,tm=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1015
1015
|
<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"/>
|
|
@@ -1049,7 +1049,7 @@
|
|
|
1049
1049
|
`}function xf(){return`
|
|
1050
1050
|
<slot name="tooltip-mute">${c("Mute")}</slot>
|
|
1051
1051
|
<slot name="tooltip-unmute">${c("Unmute")}</slot>
|
|
1052
|
-
`}var im=t=>{let i=t.mediaVolumeLevel==="off"?c("unmute"):c("mute");t.setAttribute("aria-label",i)},
|
|
1052
|
+
`}var im=t=>{let i=t.mediaVolumeLevel==="off"?c("unmute"):c("mute");t.setAttribute("aria-label",i)},Lr=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),im(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_VOLUME_LEVEL&&im(this)}get mediaVolumeLevel(){return x(this,n.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){w(this,n.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?h.MEDIA_UNMUTE_REQUEST:h.MEDIA_MUTE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};Lr.getSlotTemplateHTML=Rf;Lr.getTooltipContentHTML=xf;l.customElements.get("media-mute-button")||l.customElements.define("media-mute-button",Lr);var am=`<svg aria-hidden="true" viewBox="0 0 28 24">
|
|
1053
1053
|
<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"/>
|
|
1054
1054
|
</svg>`;function Df(t){return`
|
|
1055
1055
|
<style>
|
|
@@ -1074,7 +1074,7 @@
|
|
|
1074
1074
|
`}function Of(){return`
|
|
1075
1075
|
<slot name="tooltip-enter">${c("Enter picture in picture mode")}</slot>
|
|
1076
1076
|
<slot name="tooltip-exit">${c("Exit picture in picture mode")}</slot>
|
|
1077
|
-
`}var rm=t=>{let e=t.mediaIsPip?c("exit picture in picture mode"):c("enter picture in picture mode");t.setAttribute("aria-label",e)},
|
|
1077
|
+
`}var rm=t=>{let e=t.mediaIsPip?c("exit picture in picture mode"):c("enter picture in picture mode");t.setAttribute("aria-label",e)},Cr=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_IS_PIP,n.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),rm(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_IS_PIP&&rm(this)}get mediaPipUnavailable(){return x(this,n.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){w(this,n.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return M(this,n.MEDIA_IS_PIP)}set mediaIsPip(e){L(this,n.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?h.MEDIA_EXIT_PIP_REQUEST:h.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};Cr.getSlotTemplateHTML=Df;Cr.getTooltipContentHTML=Of;l.customElements.get("media-pip-button")||l.customElements.define("media-pip-button",Cr);var Pf=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},aa=(t,e,i)=>(Pf(t,e,"read from private field"),i?i.call(t):e.get(t)),Nf=(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)},Kt,Wl={RATES:"rates"},Fl=[1,1.2,1.5,1.7,2],Ei=1;function Uf(t){return`
|
|
1078
1078
|
<style>
|
|
1079
1079
|
:host {
|
|
1080
1080
|
min-width: 5ch;
|
|
@@ -1082,7 +1082,7 @@
|
|
|
1082
1082
|
}
|
|
1083
1083
|
</style>
|
|
1084
1084
|
<slot name="icon">${t.mediaplaybackrate||Ei}x</slot>
|
|
1085
|
-
`}function Hf(){return c("Playback rate")}var
|
|
1085
|
+
`}function Hf(){return c("Playback rate")}var wr=class extends B{constructor(){var e;super(),Nf(this,Kt,new Bt(this,Wl.RATES,{defaultValue:Fl})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${(e=this.mediaPlaybackRate)!=null?e:Ei}x`}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PLAYBACK_RATE,Wl.RATES]}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===Wl.RATES&&(aa(this,Kt).value=a),e===n.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,o=Number.isNaN(r)?Ei:r;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",c("Playback rate {playbackRate}",{playbackRate:o}))}}get rates(){return aa(this,Kt)}set rates(e){e?Array.isArray(e)?aa(this,Kt).value=e.join(" "):typeof e=="string"&&(aa(this,Kt).value=e):aa(this,Kt).value=""}get mediaPlaybackRate(){return P(this,n.MEDIA_PLAYBACK_RATE,Ei)}set mediaPlaybackRate(e){U(this,n.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,i;let a=Array.from(aa(this,Kt).values(),s=>+s).sort((s,d)=>s-d),r=(i=(e=a.find(s=>s>this.mediaPlaybackRate))!=null?e:a[0])!=null?i:Ei,o=new l.CustomEvent(h.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(o)}};Kt=new WeakMap;wr.getSlotTemplateHTML=Uf;wr.getTooltipContentHTML=Hf;l.customElements.get("media-playback-rate-button")||l.customElements.define("media-playback-rate-button",wr);var Bf=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1086
1086
|
<path d="m6 21 15-9L6 3v18Z"/>
|
|
1087
1087
|
</svg>`,$f=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1088
1088
|
<path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
|
|
@@ -1106,7 +1106,7 @@
|
|
|
1106
1106
|
`}function Ff(){return`
|
|
1107
1107
|
<slot name="tooltip-play">${c("Play")}</slot>
|
|
1108
1108
|
<slot name="tooltip-pause">${c("Pause")}</slot>
|
|
1109
|
-
`}var om=t=>{let e=t.mediaPaused?c("play"):c("pause");t.setAttribute("aria-label",e)},
|
|
1109
|
+
`}var om=t=>{let e=t.mediaPaused?c("play"):c("pause");t.setAttribute("aria-label",e)},Rr=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PAUSED,n.MEDIA_ENDED]}connectedCallback(){super.connectedCallback(),om(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===n.MEDIA_PAUSED||e===n.MEDIA_LANG)&&om(this)}get mediaPaused(){return M(this,n.MEDIA_PAUSED)}set mediaPaused(e){L(this,n.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?h.MEDIA_PLAY_REQUEST:h.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};Rr.getSlotTemplateHTML=Wf;Rr.getTooltipContentHTML=Ff;l.customElements.get("media-play-button")||l.customElements.define("media-play-button",Rr);var st={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"};function Vf(t){return`
|
|
1110
1110
|
<style>
|
|
1111
1111
|
:host {
|
|
1112
1112
|
pointer-events: none;
|
|
@@ -1128,7 +1128,7 @@
|
|
|
1128
1128
|
</style>
|
|
1129
1129
|
|
|
1130
1130
|
<img part="poster img" aria-hidden="true" id="image"/>
|
|
1131
|
-
`}var Kf=t=>{t.style.removeProperty("background-image")},Gf=(t,e)=>{t.style["background-image"]=`url('${e}')`},
|
|
1131
|
+
`}var Kf=t=>{t.style.removeProperty("background-image")},Gf=(t,e)=>{t.style["background-image"]=`url('${e}')`},xr=class extends l.HTMLElement{static get observedAttributes(){return[st.PLACEHOLDER_SRC,st.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===st.SRC&&(a==null?this.image.removeAttribute(st.SRC):this.image.setAttribute(st.SRC,a)),e===st.PLACEHOLDER_SRC&&(a==null?Kf(this.image):Gf(this.image,a))}get placeholderSrc(){return x(this,st.PLACEHOLDER_SRC)}set placeholderSrc(e){w(this,st.SRC,e)}get src(){return x(this,st.SRC)}set src(e){w(this,st.SRC,e)}};xr.shadowRootOptions={mode:"open"};xr.getTemplateHTML=Vf;l.customElements.get("media-poster-image")||l.customElements.define("media-poster-image",xr);var nm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Yf=(t,e,i)=>(nm(t,e,"read from private field"),i?i.call(t):e.get(t)),qf=(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)},Zf=(t,e,i,a)=>(nm(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),xn,Vl=class extends Te{constructor(){super(),qf(this,xn,void 0),Zf(this,xn,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(Yf(this,xn).textContent=a,a!==""){let r=c("chapter: {chapterName}",{chapterName:a});this.setAttribute("aria-valuetext",r)}else this.removeAttribute("aria-valuetext")}get mediaPreviewChapter(){return x(this,n.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){w(this,n.MEDIA_PREVIEW_CHAPTER,e)}};xn=new WeakMap;l.customElements.get("media-preview-chapter-display")||l.customElements.define("media-preview-chapter-display",Vl);var sm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Dn=(t,e,i)=>(sm(t,e,"read from private field"),i?i.call(t):e.get(t)),zf=(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)},On=(t,e,i,a)=>(sm(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),lt;function Qf(t){return`
|
|
1132
1132
|
<style>
|
|
1133
1133
|
:host {
|
|
1134
1134
|
box-sizing: border-box;
|
|
@@ -1142,7 +1142,7 @@
|
|
|
1142
1142
|
}
|
|
1143
1143
|
</style>
|
|
1144
1144
|
<img crossorigin loading="eager" decoding="async">
|
|
1145
|
-
`}var ra=class extends l.HTMLElement{constructor(){if(super(),zf(this,lt,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[D.MEDIA_CONTROLLER,n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,i,a;let r=this.getAttribute(D.MEDIA_CONTROLLER);r&&(
|
|
1145
|
+
`}var ra=class extends l.HTMLElement{constructor(){if(super(),zf(this,lt,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[D.MEDIA_CONTROLLER,n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,i,a;let r=this.getAttribute(D.MEDIA_CONTROLLER);r&&(On(this,lt,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(i=Dn(this,lt))==null?void 0:i.associateElement)==null||a.call(i,this))}disconnectedCallback(){var e,i;(i=(e=Dn(this,lt))==null?void 0:e.unassociateElement)==null||i.call(e,this),On(this,lt,null)}attributeChangedCallback(e,i,a){var r,o,s,d,u;[n.MEDIA_PREVIEW_IMAGE,n.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===D.MEDIA_CONTROLLER&&(i&&((o=(r=Dn(this,lt))==null?void 0:r.unassociateElement)==null||o.call(r,this),On(this,lt,null)),a&&this.isConnected&&(On(this,lt,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=Dn(this,lt))==null?void 0:d.associateElement)==null||u.call(d,this)))}get mediaPreviewImage(){return x(this,n.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){w(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:f,maxHeight:y,minWidth:A,minHeight:E}=u,p=u.getPropertyValue("--media-preview-thumbnail-object-fit").trim()||"contain",k,g;if(p==="fill"){let Ce=parseInt(f)/o,we=parseInt(y)/s,Pt=parseInt(A)/o,Qe=parseInt(E)/s;k=Ce<1?Ce:Math.max(Ce,Pt),g=we<1?we:Math.max(we,Qe)}else{let Ce=Math.min(parseInt(f)/o,parseInt(y)/s),we=Math.max(parseInt(A)/o,parseInt(E)/s),Qe=Ce<1?Ce:we>1?we:1;k=Qe,g=Qe}let{style:S}=q(this.shadowRoot,":host"),C=q(this.shadowRoot,"img").style,j=this.shadowRoot.querySelector("img"),Ot=Math.min(k,g)<1?"min":"max";S.setProperty(`${Ot}-width`,"initial","important"),S.setProperty(`${Ot}-height`,"initial","important"),S.width=`${o*k}px`,S.height=`${s*g}px`;let bt=()=>{C.width=`${this.imgWidth*k}px`,C.height=`${this.imgHeight*g}px`,C.display="block"};j.src!==d&&(j.onload=()=>{this.imgWidth=j.naturalWidth,this.imgHeight=j.naturalHeight,bt(),j.onload=null},j.src=d,bt()),bt(),C.transform=`translate(-${a*k}px, -${r*g}px)`}};lt=new WeakMap;ra.shadowRootOptions={mode:"open"};ra.getTemplateHTML=Qf;l.customElements.get("media-preview-thumbnail")||l.customElements.define("media-preview-thumbnail",ra);var Pn=ra;var dm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},lm=(t,e,i)=>(dm(t,e,"read from private field"),i?i.call(t):e.get(t)),Xf=(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)},Jf=(t,e,i,a)=>(dm(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Dr,Kl=class extends Te{constructor(){super(),Xf(this,Dr,void 0),Jf(this,Dr,this.shadowRoot.querySelector("slot")),lm(this,Dr).textContent=$e(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&&(lm(this,Dr).textContent=$e(parseFloat(a)))}get mediaPreviewTime(){return P(this,n.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){U(this,n.MEDIA_PREVIEW_TIME,e)}};Dr=new WeakMap;l.customElements.get("media-preview-time-display")||l.customElements.define("media-preview-time-display",Kl);var oa={SEEK_OFFSET:"seekoffset"},Gl=30,jf=t=>`
|
|
1146
1146
|
<svg aria-hidden="true" viewBox="0 0 20 24">
|
|
1147
1147
|
<defs>
|
|
1148
1148
|
<style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
|
|
@@ -1151,7 +1151,7 @@
|
|
|
1151
1151
|
<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"/>
|
|
1152
1152
|
</svg>`;function ev(t,e){return`
|
|
1153
1153
|
<slot name="icon">${jf(e.seekOffset)}</slot>
|
|
1154
|
-
`}var tv=(t,e)=>{t.setAttribute("aria-label",c("seek back {seekOffset} seconds",{seekOffset:e}))};function iv(){return c("Seek backward")}var av=0,
|
|
1154
|
+
`}var tv=(t,e)=>{t.setAttribute("aria-label",c("seek back {seekOffset} seconds",{seekOffset:e}))};function iv(){return c("Seek backward")}var av=0,Or=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_CURRENT_TIME,oa.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=P(this,oa.SEEK_OFFSET,Gl)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),tv(this,this.seekOffset),e===oa.SEEK_OFFSET&&(this.seekOffset=P(this,oa.SEEK_OFFSET,Gl))}get seekOffset(){return P(this,oa.SEEK_OFFSET,Gl)}set seekOffset(e){U(this,oa.SEEK_OFFSET,e),this.setAttribute("aria-label",c("seek back {seekOffset} seconds",{seekOffset:this.seekOffset})),Oo(Po(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return P(this,n.MEDIA_CURRENT_TIME,av)}set mediaCurrentTime(e){U(this,n.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),i=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};Or.getSlotTemplateHTML=ev;Or.getTooltipContentHTML=iv;l.customElements.get("media-seek-backward-button")||l.customElements.define("media-seek-backward-button",Or);var na={SEEK_OFFSET:"seekoffset"},Yl=30,rv=t=>`
|
|
1155
1155
|
<svg aria-hidden="true" viewBox="0 0 20 24">
|
|
1156
1156
|
<defs>
|
|
1157
1157
|
<style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
|
|
@@ -1160,9 +1160,9 @@
|
|
|
1160
1160
|
<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"/>
|
|
1161
1161
|
</svg>`;function ov(t,e){return`
|
|
1162
1162
|
<slot name="icon">${rv(e.seekOffset)}</slot>
|
|
1163
|
-
`}var nv=(t,e)=>{t.setAttribute("aria-label",c("seek forward {seekOffset} seconds",{seekOffset:e}))};function sv(){return c("Seek forward")}var lv=0,
|
|
1164
|
-
<slot>${
|
|
1165
|
-
`}var mv=t=>{t.setAttribute("aria-label",c("playback time"))},
|
|
1163
|
+
`}var nv=(t,e)=>{t.setAttribute("aria-label",c("seek forward {seekOffset} seconds",{seekOffset:e}))};function sv(){return c("Seek forward")}var lv=0,Pr=class extends B{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_CURRENT_TIME,na.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=P(this,na.SEEK_OFFSET,Yl)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),nv(this,this.seekOffset),e===na.SEEK_OFFSET&&(this.seekOffset=P(this,na.SEEK_OFFSET,Yl))}get seekOffset(){return P(this,na.SEEK_OFFSET,Yl)}set seekOffset(e){U(this,na.SEEK_OFFSET,e),this.setAttribute("aria-label",c("seek forward {seekOffset} seconds",{seekOffset:this.seekOffset})),Oo(Po(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return P(this,n.MEDIA_CURRENT_TIME,lv)}set mediaCurrentTime(e){U(this,n.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,i=new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};Pr.getSlotTemplateHTML=ov;Pr.getTooltipContentHTML=sv;l.customElements.get("media-seek-forward-button")||l.customElements.define("media-seek-forward-button",Pr);var zl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},qe=(t,e,i)=>(zl(t,e,"read from private field"),i?i.call(t):e.get(t)),bi=(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)},Ql=(t,e,i,a)=>(zl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Yt=(t,e,i)=>(zl(t,e,"access private method"),i),sa,dt,$n,Xl,cm,Hn,Jl,Nr,Nn,Un,ql,Gt={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},um=[...Object.values(Gt),n.MEDIA_CURRENT_TIME,n.MEDIA_DURATION,n.MEDIA_SEEKABLE],mm=["Enter"," "],dv=" / ",Zl=(t,{timesSep:e=dv}={})=>{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?$e(0-(s-r)):$e(r);return t.showDuration?`${d}${e}${$e(s)}`:d},uv=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",c("video not loaded, unknown time."));return}let o=t.remaining?oi(0-(r-i)):oi(i);if(!t.showDuration){t.setAttribute("aria-valuetext",o);return}let s=oi(r),d=c("{currentTime} of {totalTime}",{currentTime:o,totalTime:s});t.setAttribute("aria-valuetext",d)};function cv(t,e){return`
|
|
1164
|
+
<slot>${Zl(e)}</slot>
|
|
1165
|
+
`}var mv=t=>{t.setAttribute("aria-label",c("playback time"))},Bn=class extends Te{constructor(){super(),bi(this,Xl),bi(this,Hn),bi(this,Nr),bi(this,Un),bi(this,sa,void 0),bi(this,dt,null),bi(this,$n,e=>{let{metaKey:i,altKey:a,key:r}=e;if(i||a||!mm.includes(r)){this.removeEventListener("keyup",qe(this,dt));return}this.addEventListener("keyup",qe(this,dt))}),Ql(this,sa,this.shadowRoot.querySelector("slot")),qe(this,sa).innerHTML=`${Zl(this)}`}static get observedAttributes(){return[...super.observedAttributes,...um,"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.setAttribute("aria-label",c("playback time")),Yt(this,Nr,Nn).call(this),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),Yt(this,Hn,Jl).call(this),super.disconnectedCallback()}attributeChangedCallback(e,i,a){mv(this),um.includes(e)?this.update():e==="disabled"&&a!==i?a==null?Yt(this,Nr,Nn).call(this):Yt(this,Un,ql).call(this):e===Gt.NO_TOGGLE&&a!==i&&(this.noToggle?Yt(this,Un,ql).call(this):Yt(this,Nr,Nn).call(this)),super.attributeChangedCallback(e,i,a)}enable(){this.noToggle||(this.tabIndex=0)}disable(){this.tabIndex=-1}get remaining(){return M(this,Gt.REMAINING)}set remaining(e){L(this,Gt.REMAINING,e)}get showDuration(){return M(this,Gt.SHOW_DURATION)}set showDuration(e){L(this,Gt.SHOW_DURATION,e)}get noToggle(){return M(this,Gt.NO_TOGGLE)}set noToggle(e){L(this,Gt.NO_TOGGLE,e)}get mediaDuration(){return P(this,n.MEDIA_DURATION)}set mediaDuration(e){U(this,n.MEDIA_DURATION,e)}get mediaCurrentTime(){return P(this,n.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){U(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=Zl(this);uv(this),e!==qe(this,sa).innerHTML&&(qe(this,sa).innerHTML=e)}};sa=new WeakMap;dt=new WeakMap;$n=new WeakMap;Xl=new WeakSet;cm=function(){qe(this,dt)||(Ql(this,dt,t=>{let{key:e}=t;if(!mm.includes(e)){this.removeEventListener("keyup",qe(this,dt));return}this.toggleTimeDisplay()}),this.addEventListener("keydown",qe(this,$n)),this.addEventListener("click",this.toggleTimeDisplay))};Hn=new WeakSet;Jl=function(){qe(this,dt)&&(this.removeEventListener("keyup",qe(this,dt)),this.removeEventListener("keydown",qe(this,$n)),this.removeEventListener("click",this.toggleTimeDisplay),Ql(this,dt,null))};Nr=new WeakSet;Nn=function(){!this.noToggle&&!this.hasAttribute("disabled")&&(this.setAttribute("role","button"),this.enable(),Yt(this,Xl,cm).call(this))};Un=new WeakSet;ql=function(){this.removeAttribute("role"),this.disable(),Yt(this,Hn,Jl).call(this)};Bn.getSlotTemplateHTML=cv;l.customElements.get("media-time-display")||l.customElements.define("media-time-display",Bn);var hm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},le=(t,e,i)=>(hm(t,e,"read from private field"),i?i.call(t):e.get(t)),ut=(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)=>(hm(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),hv=(t,e,i,a)=>({set _(r){Me(t,e,r,i)},get _(){return le(t,e,a)}}),la,Wn,da,Ur,Fn,Vn,Kn,ua,gi,Gn,Yn=class{constructor(e,i,a){ut(this,la,void 0),ut(this,Wn,void 0),ut(this,da,void 0),ut(this,Ur,void 0),ut(this,Fn,void 0),ut(this,Vn,void 0),ut(this,Kn,void 0),ut(this,ua,void 0),ut(this,gi,0),ut(this,Gn,(r=performance.now())=>{Me(this,gi,requestAnimationFrame(le(this,Gn))),Me(this,Ur,performance.now()-le(this,da));let o=1e3/this.fps;if(le(this,Ur)>o){Me(this,da,r-le(this,Ur)%o);let s=1e3/((r-le(this,Wn))/++hv(this,Fn)._),d=(r-le(this,Vn))/1e3/this.duration,u=le(this,Kn)+d*this.playbackRate;u-le(this,la).valueAsNumber>0?Me(this,ua,this.playbackRate/this.duration/s):(Me(this,ua,.995*le(this,ua)),u=le(this,la).valueAsNumber+le(this,ua)),this.callback(u)}}),Me(this,la,e),this.callback=i,this.fps=a}start(){le(this,gi)===0&&(Me(this,da,performance.now()),Me(this,Wn,le(this,da)),Me(this,Fn,0),le(this,Gn).call(this))}stop(){le(this,gi)!==0&&(cancelAnimationFrame(le(this,gi)),Me(this,gi,0))}update({start:e,duration:i,playbackRate:a}){let r=e-le(this,la).valueAsNumber,o=Math.abs(i-this.duration);(r>0||r<-.03||o>=.5)&&this.callback(e),Me(this,Kn,e),Me(this,Vn,performance.now()),this.duration=i,this.playbackRate=a}};la=new WeakMap;Wn=new WeakMap;da=new WeakMap;Ur=new WeakMap;Fn=new WeakMap;Vn=new WeakMap;Kn=new WeakMap;ua=new WeakMap;gi=new WeakMap;Gn=new WeakMap;var ad=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},z=(t,e,i)=>(ad(t,e,"read from private field"),i?i.call(t):e.get(t)),oe=(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)},xe=(t,e,i,a)=>(ad(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),De=(t,e,i)=>(ad(t,e,"access private method"),i),ca,qt,zn,Br,Qn,Zn,$r,Wr,ma,ha,Hr,jl,pm,ed,Xn,rd,Jn,od,jn,nd,td,fm,Fr,es,id,vm,pv=t=>{let e=t.range,i=oi(+Em(t)),a=oi(+t.mediaSeekableEnd),r=i&&a?c("{currentTime} of {totalTime}",{currentTime:i,totalTime:a}):c("video not loaded, unknown time.");e.setAttribute("aria-valuetext",r)};function fv(t){return`
|
|
1166
1166
|
<style>
|
|
1167
1167
|
:host {
|
|
1168
1168
|
--media-box-border-radius: 4px;
|
|
@@ -1365,8 +1365,8 @@
|
|
|
1365
1365
|
<div id="preview-rail">
|
|
1366
1366
|
<slot name="preview" part="box preview-box">
|
|
1367
1367
|
<media-preview-thumbnail>
|
|
1368
|
-
<template shadowrootmode="${
|
|
1369
|
-
${
|
|
1368
|
+
<template shadowrootmode="${Pn.shadowRootOptions.mode}">
|
|
1369
|
+
${Pn.getTemplateHTML({})}
|
|
1370
1370
|
</template>
|
|
1371
1371
|
</media-preview-thumbnail>
|
|
1372
1372
|
<media-preview-chapter-display></media-preview-chapter-display>
|
|
@@ -1379,7 +1379,7 @@
|
|
|
1379
1379
|
|
|
1380
1380
|
</slot>
|
|
1381
1381
|
</div>
|
|
1382
|
-
`}var
|
|
1382
|
+
`}var qn=(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))},Em=(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},Vr=class extends at{constructor(){super(),oe(this,jl),oe(this,Xn),oe(this,Jn),oe(this,jn),oe(this,td),oe(this,Fr),oe(this,id),oe(this,ca,null),oe(this,qt,void 0),oe(this,zn,void 0),oe(this,Br,void 0),oe(this,Qn,void 0),oe(this,Zn,void 0),oe(this,$r,void 0),oe(this,Wr,void 0),oe(this,ma,void 0),oe(this,ha,void 0),oe(this,Hr,()=>{De(this,jl,pm).call(this)?z(this,qt).start():z(this,qt).stop()}),oe(this,ed,a=>{this.dragging||(Hi(a)&&(this.range.valueAsNumber=a),z(this,ha)||this.updateBar())}),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'<div id="buffered" part="buffered"></div>'),xe(this,zn,this.shadowRoot.querySelectorAll('[part~="box"]')),xe(this,Qn,this.shadowRoot.querySelector('[part~="preview-box"]')),xe(this,Zn,this.shadowRoot.querySelector('[part~="current-box"]'));let i=getComputedStyle(this);xe(this,$r,parseInt(i.getPropertyValue("--media-box-padding-left"))),xe(this,Wr,parseInt(i.getPropertyValue("--media-box-padding-right"))),xe(this,qt,new Yn(this.range,z(this,ed),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",c("seek")),z(this,Hr).call(this),xe(this,ca,this.getRootNode()),(e=z(this,ca))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),z(this,qt).stop(),(e=z(this,ca))==null||e.removeEventListener("transitionstart",this),xe(this,ca,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?(z(this,qt).update({start:qn(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),z(this,Hr).call(this),pv(this)):e===n.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===n.MEDIA_DURATION||e===n.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=z(this,ma),this.updateBar()))}get mediaChaptersCues(){return z(this,ma)}set mediaChaptersCues(e){var i;xe(this,ma,e),this.updateSegments((i=z(this,ma))==null?void 0:i.map(a=>({start:qn(this,a.startTime),end:qn(this,a.endTime)})))}get mediaPaused(){return M(this,n.MEDIA_PAUSED)}set mediaPaused(e){L(this,n.MEDIA_PAUSED,e)}get mediaLoading(){return M(this,n.MEDIA_LOADING)}set mediaLoading(e){L(this,n.MEDIA_LOADING,e)}get mediaDuration(){return P(this,n.MEDIA_DURATION)}set mediaDuration(e){U(this,n.MEDIA_DURATION,e)}get mediaCurrentTime(){return P(this,n.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){U(this,n.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return P(this,n.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){U(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 x(this,n.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){w(this,n.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return P(this,n.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){U(this,n.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return M(this,n.MEDIA_ENDED)}set mediaEnded(e){L(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=qn(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,Xn,rd).call(this,z(this,Zn)),o=De(this,Jn,od).call(this,r,this.range.valueAsNumber),s=De(this,jn,nd).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,id,vm).call(this);break;case"pointermove":De(this,td,fm).call(this,e);break;case"pointerup":z(this,ha)&&xe(this,ha,!1);break;case"pointerdown":xe(this,ha,!0);break;case"pointerleave":De(this,Fr,es).call(this,null);break;case"transitionstart":he(e.target,this)&&setTimeout(()=>z(this,Hr).call(this),0);break}}};ca=new WeakMap;qt=new WeakMap;zn=new WeakMap;Br=new WeakMap;Qn=new WeakMap;Zn=new WeakMap;$r=new WeakMap;Wr=new WeakMap;ma=new WeakMap;ha=new WeakMap;Hr=new WeakMap;jl=new WeakSet;pm=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&No(this)};ed=new WeakMap;Xn=new WeakSet;rd=function(t){var e;let a=((e=this.getAttribute("bounds")?Xe(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}};Jn=new WeakSet;od=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};jn=new WeakSet;nd=function(t,e){let{width:i,min:a,max:r}=t.box,o=e*t.range.width;if(o<a+z(this,$r)){let s=t.range.left-t.bounds.left-z(this,$r);return`${o-i/2+s}px`}if(o>r-z(this,Wr)){let s=t.bounds.right-t.range.right-z(this,Wr);return`${o+i/2-s-t.range.width}px`}return 0};td=new WeakSet;fm=function(t){let e=[...z(this,zn)].some(y=>t.composedPath().includes(y));if(!this.dragging&&(e||!t.composedPath().includes(this))){De(this,Fr,es).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,Xn,rd).call(this,z(this,Qn)),s=(t.clientX-o.range.left)/o.range.width;s=Math.max(0,Math.min(1,s));let d=De(this,Jn,od).call(this,o,s),u=De(this,jn,nd).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 f=Math.round(z(this,Br))-Math.round(s*i);Math.abs(f)<1&&s>.01&&s<.99||(xe(this,Br,s*i),De(this,Fr,es).call(this,z(this,Br)))};Fr=new WeakSet;es=function(t){this.dispatchEvent(new l.CustomEvent(h.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:t}))};id=new WeakSet;vm=function(){z(this,qt).stop();let t=Em(this);this.dispatchEvent(new l.CustomEvent(h.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t}))};Vr.shadowRootOptions={mode:"open"};Vr.getContainerTemplateHTML=fv;l.customElements.get("media-time-range")||l.customElements.define("media-time-range",Vr);var vv=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},bm=(t,e,i)=>(vv(t,e,"read from private field"),i?i.call(t):e.get(t)),Ev=(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)},ts,bv=1,gv=t=>t.mediaMuted?0:t.mediaVolume,_v=t=>`${Math.round(t*100)}%`,sd=class extends at{constructor(){super(...arguments),Ev(this,ts,()=>{let e=this.range.value,i=new l.CustomEvent(h.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)})}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_VOLUME,n.MEDIA_MUTED,n.MEDIA_VOLUME_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",c("volume")),this.range.addEventListener("input",bm(this,ts))}disconnectedCallback(){this.range.removeEventListener("input",bm(this,ts)),super.disconnectedCallback()}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===n.MEDIA_VOLUME||e===n.MEDIA_MUTED)&&(this.range.valueAsNumber=gv(this),this.range.setAttribute("aria-valuetext",_v(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return P(this,n.MEDIA_VOLUME,bv)}set mediaVolume(e){U(this,n.MEDIA_VOLUME,e)}get mediaMuted(){return M(this,n.MEDIA_MUTED)}set mediaMuted(e){L(this,n.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return x(this,n.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){w(this,n.MEDIA_VOLUME_UNAVAILABLE,e)}};ts=new WeakMap;l.customElements.get("media-volume-range")||l.customElements.define("media-volume-range",sd);function Av(t){return`
|
|
1383
1383
|
<style>
|
|
1384
1384
|
:host {
|
|
1385
1385
|
min-width: 4ch;
|
|
@@ -1408,8 +1408,8 @@
|
|
|
1408
1408
|
<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"/>
|
|
1409
1409
|
</svg>
|
|
1410
1410
|
</div>
|
|
1411
|
-
`}function Tv(){return c("Loop")}var
|
|
1412
|
-
https://github.com/muxinc/elements/blob/main/errors/${t.file}`),ct(e)}var me={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Zt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},RA={...me,...Zt},Mm=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}}),Mv=Object.values(me).filter(t=>me.PLAYSINLINE!==t),Lv=Object.values(Zt),Cv=[...Mv,...Lv],dd=class extends Se.HTMLElement{static get observedAttributes(){return Cv}constructor(){super()}attributeChangedCallback(e,i,a){var r,o;switch(e){case Zt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Zt.VOLUME:{let s=(r=fe(a))!=null?r:1;this.media&&(this.media.volume=s);return}case Zt.PLAYBACKRATE:{let s=(o=fe(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:Mm}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:Mm}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=fe(this.getAttribute(Zt.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Zt.PLAYBACKRATE,`${e}`):this.removeAttribute(Zt.PLAYBACKRATE)}get crossOrigin(){return Kr(this,me.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(me.CROSSORIGIN,`${e}`)}get autoplay(){return Kr(this,me.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(me.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(me.AUTOPLAY)}get loop(){return Kr(this,me.LOOP)!=null}set loop(e){e?this.setAttribute(me.LOOP,""):this.removeAttribute(me.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 Kr(this,me.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(me.MUTED,""):this.removeAttribute(me.MUTED)}get playsInline(){return Kr(this,me.PLAYSINLINE)!=null}set playsInline(e){Ee("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(me.PRELOAD,e):this.removeAttribute(me.PRELOAD)}};function Kr(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var ud=dd;var xm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},N=(t,e,i)=>(xm(t,e,"read from private field"),i?i.call(t):e.get(t)),mt=(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)=>(xm(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),pa,rs,yi,Gr,zt,Qt,Xt,ki,fa,os,Ze,Lm=1,Cm=0,wv=1,Rv={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 be&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=o:typeof o=="function"&&r instanceof be?r.element[r.attributeName]=o:r.value=o}}}},Mt=class extends l.DocumentFragment{constructor(e,i,a=Rv){var r;super(),mt(this,pa,void 0),mt(this,rs,void 0),this.append(e.content.cloneNode(!0)),It(this,pa,Dm(this)),It(this,rs,a),(r=a.createCallback)==null||r.call(a,this,N(this,pa),i),a.processCallback(this,N(this,pa),i)}update(e){N(this,rs).processCallback(this,N(this,pa),e)}};pa=new WeakMap;rs=new WeakMap;var Dm=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let o=new cd;for([i,a]of Rm(r.value))if(!i)o.append(a);else{let s=new be(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===Lm&&!(r instanceof HTMLTemplateElement))Dm(r,e);else{let o=r.data;if(r.nodeType===Lm||o.includes("{{")){let s=[];if(o)for([i,a]of Rm(o))if(!i)s.push(new Text(a));else{let d=new Lt(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},wm={},Rm=t=>{let e="",i=0,a=wm[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([Cm,e]),e="",r++):o==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([wv,e.trim()]),e="",r++):e+=o||"";return e&&a.push([Cm,(i>0?"{{":"")+e]),wm[t]=a},xv=11,ns=class{get value(){return""}set value(e){}toString(){return this.value}},Om=new WeakMap,cd=class{constructor(){mt(this,yi,[])}[Symbol.iterator](){return N(this,yi).values()}get length(){return N(this,yi).length}item(e){return N(this,yi)[e]}append(...e){for(let i of e)i instanceof be&&Om.set(i,this),N(this,yi).push(i)}toString(){return N(this,yi).join("")}};yi=new WeakMap;var be=class extends ns{constructor(e,i,a){super(),mt(this,ki),mt(this,Gr,""),mt(this,zt,void 0),mt(this,Qt,void 0),mt(this,Xt,void 0),It(this,zt,e),It(this,Qt,i),It(this,Xt,a)}get attributeName(){return N(this,Qt)}get attributeNamespace(){return N(this,Xt)}get element(){return N(this,zt)}get value(){return N(this,Gr)}set value(e){N(this,Gr)!==e&&(It(this,Gr,e),!N(this,ki,fa)||N(this,ki,fa).length===1?e==null?N(this,zt).removeAttributeNS(N(this,Xt),N(this,Qt)):N(this,zt).setAttributeNS(N(this,Xt),N(this,Qt),e):N(this,zt).setAttributeNS(N(this,Xt),N(this,Qt),N(this,ki,fa).toString()))}get booleanValue(){return N(this,zt).hasAttributeNS(N(this,Xt),N(this,Qt))}set booleanValue(e){if(!N(this,ki,fa)||N(this,ki,fa).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};Gr=new WeakMap;zt=new WeakMap;Qt=new WeakMap;Xt=new WeakMap;ki=new WeakSet;fa=function(){return Om.get(this)};var Lt=class extends ns{constructor(e,i){super(),mt(this,os,void 0),mt(this,Ze,void 0),It(this,os,e),It(this,Ze,i?[...i]:[new Text])}get replacementNodes(){return N(this,Ze)}get parentNode(){return N(this,os)}get nextSibling(){return N(this,Ze)[N(this,Ze).length-1].nextSibling}get previousSibling(){return N(this,Ze)[0].previousSibling}get value(){return N(this,Ze).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===xv?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),It(this,Ze,Dv(N(this,Ze)[0].parentNode,N(this,Ze),i,this.nextSibling))}};os=new WeakMap;Ze=new WeakMap;var Yr=class extends Lt{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 Dv(t,e,i,a=null){let r=0,o,s,d,u=i.length,f=e.length;for(;r<u&&r<f&&e[r]==i[r];)r++;for(;r<u&&r<f&&i[u-1]==e[f-1];)a=i[--f,--u];if(r==f)for(;r<u;)t.insertBefore(i[r++],a);if(r==u)for(;r<f;)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 Pm={string:t=>String(t)},ls=class{constructor(e){this.template=e,this.state=void 0}},Si=new WeakMap,Ii=new WeakMap,md={partial:(t,e)=>{e[t.expression]=new ls(t.template)},if:(t,e)=>{var i;if(Um(t.expression,e))if(Si.get(t)!==t.template){Si.set(t,t.template);let a=new Mt(t.template,e,ds);t.replace(a),Ii.set(t,a)}else(i=Ii.get(t))==null||i.update(e);else t.replace(""),Si.delete(t),Ii.delete(t)}},Ov=Object.keys(md),ds={processCallback(t,e,i){var a,r;if(i)for(let[o,s]of e){if(s instanceof Yr){if(!s.directive){let u=Ov.find(f=>s.template.hasAttribute(f));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=md[s.directive])==null||a.call(md,s,i);continue}let d=Um(o,i);if(d instanceof ls){Si.get(s)!==d.template?(Si.set(s,d.template),d=new Mt(d.template,d.state,ds),s.value=d,Ii.set(s,d)):(r=Ii.get(s))==null||r.update(d.state);continue}d?(s instanceof be&&s.attributeName.startsWith("aria-")&&(d=String(d)),s instanceof be?typeof d=="boolean"?s.booleanValue=d:typeof d=="function"?s.element[s.attributeName]=d:s.value=d:(s.value=d,Si.delete(s),Ii.delete(s))):s instanceof be?s.value=void 0:(s.value=void 0,Si.delete(s),Ii.delete(s))}}},Nm={"!":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=Pm[e])==null?void 0:i.call(Pm,t)}};function Pv(t){return Nv(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function Um(t,e={}){var i,a,r,o,s,d,u;let f=Pv(t);if(f.length===0||f.some(({type:y})=>!y))return qr(t);if(((i=f[0])==null?void 0:i.token)===">"){let y=e[(a=f[1])==null?void 0:a.token];if(!y)return qr(t);let A={...e};y.state=A;let E=f.slice(2);for(let p=0;p<E.length;p+=3){let k=(r=E[p])==null?void 0:r.token,g=(o=E[p+1])==null?void 0:o.token,S=(s=E[p+2])==null?void 0:s.token;k&&g==="="&&(A[k]=Zr(S,e))}return y}if(f.length===1)return ss(f[0])?Zr(f[0].token,e):qr(t);if(f.length===2){let y=(d=f[0])==null?void 0:d.token,A=Nm[y];if(!A||!ss(f[1]))return qr(t);let E=Zr(f[1].token,e);return A(E)}if(f.length===3){let y=(u=f[1])==null?void 0:u.token,A=Nm[y];if(!A||!ss(f[0])||!ss(f[2]))return qr(t);let E=Zr(f[0].token,e);if(y==="|")return A(E,f[2].token);let p=Zr(f[2].token,e);return A(E,p)}}function qr(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function ss({type:t}){return["number","boolean","string","param"].includes(t)}function Zr(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):Io(t)?parseFloat(t):e[t]}function Nv(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 Ed=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Jt=(t,e,i)=>(Ed(t,e,"read from private field"),i?i.call(t):e.get(t)),Mi=(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)},Ct=(t,e,i,a)=>(Ed(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),hd=(t,e,i)=>(Ed(t,e,"access private method"),i),Ea,us,ba,va,fd,Hm,cs,vd,zr,pd={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Bm=V.createElement("template");Bm.innerHTML=`
|
|
1411
|
+
`}function Tv(){return c("Loop")}var Kr=class extends B{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=c("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 M(this,n.MEDIA_LOOP)}set mediaLoop(e){L(this,n.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,i=new l.CustomEvent(h.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)}};Kr.getSlotTemplateHTML=Av;Kr.getTooltipContentHTML=Tv;l.customElements.get("media-loop-button")||l.customElements.define("media-loop-button",Kr);var b=require("@mux/mux-video/base"),O=require("@mux/playback-core");var km=require("@mux/playback-core");var Ti=require("@mux/playback-core");function gm(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${is(i)}: ${a}; `)}),e?e.trim():void 0}function is(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function as(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function fe(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function ld(t){let e=yv(t).toString();return e?"?"+e:""}function yv(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var dd=(t,e)=>!t||!e?!1:t.contains(e)?!0:dd(t,e.getRootNode().host);var _m="mux.com",kv=()=>{try{return"3.11.7"}catch{}return"UNKNOWN"},Sv=kv(),os=()=>Sv,Am=(t,{token:e,customDomain:i=_m,thumbnailTime:a,programTime:r}={})=>{var d;let o=e==null?a:void 0,{aud:s}=(d=(0,Ti.parseJwt)(e))!=null?d:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${ld({token:e,time:o,program_time:r})}`},Tm=(t,{token:e,customDomain:i=_m,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:o}=(s=(0,Ti.parseJwt)(e))!=null?s:{};if(!(e&&o!=="s"))return`https://image.${i}/${t}/storyboard.vtt${ld({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Gr=t=>{if(t){if([Ti.StreamTypes.LIVE,Ti.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return Ti.StreamTypes.LIVE}};var Iv={crossorigin:"crossOrigin",playsinline:"playsInline"};function ym(t){var e;return(e=Iv[t])!=null?e:as(t)}var _i,Ai,ve,rs=class{constructor(e,i){ae(this,_i);ae(this,Ai);ae(this,ve,[]);de(this,_i,e),de(this,Ai,i)}[Symbol.iterator](){return R(this,ve).values()}get length(){return R(this,ve).length}get value(){var e;return(e=R(this,ve).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(de(this,ve,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return R(this,ve)[e]}values(){return R(this,ve).values()}keys(){return R(this,ve).keys()}forEach(e){R(this,ve).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||R(this,ve).push(r)}),!(this.value===""&&!((i=R(this,_i))!=null&&i.hasAttribute(`${R(this,Ai)}`)))&&((a=R(this,_i))==null||a.setAttribute(`${R(this,Ai)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{R(this,ve).splice(R(this,ve).indexOf(a),1)}),(i=R(this,_i))==null||i.setAttribute(`${R(this,Ai)}`,`${this.value}`)}contains(e){return R(this,ve).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)}};_i=new WeakMap,Ai=new WeakMap,ve=new WeakMap;var Sm=`[mux-player ${os()}]`;function ct(...t){console.warn(Sm,...t)}function Ee(...t){console.error(Sm,...t)}function ud(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,km.i18n)("Read more: ")}
|
|
1412
|
+
https://github.com/muxinc/elements/blob/main/errors/${t.file}`),ct(e)}var me={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Zt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},RA={...me,...Zt},Mm=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}}),Mv=Object.values(me).filter(t=>me.PLAYSINLINE!==t),Lv=Object.values(Zt),Cv=[...Mv,...Lv],cd=class extends Se.HTMLElement{static get observedAttributes(){return Cv}constructor(){super()}attributeChangedCallback(e,i,a){var r,o;switch(e){case Zt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Zt.VOLUME:{let s=(r=fe(a))!=null?r:1;this.media&&(this.media.volume=s);return}case Zt.PLAYBACKRATE:{let s=(o=fe(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:Mm}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:Mm}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=fe(this.getAttribute(Zt.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Zt.PLAYBACKRATE,`${e}`):this.removeAttribute(Zt.PLAYBACKRATE)}get crossOrigin(){return Yr(this,me.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(me.CROSSORIGIN,`${e}`)}get autoplay(){return Yr(this,me.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(me.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(me.AUTOPLAY)}get loop(){return Yr(this,me.LOOP)!=null}set loop(e){e?this.setAttribute(me.LOOP,""):this.removeAttribute(me.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 Yr(this,me.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(me.MUTED,""):this.removeAttribute(me.MUTED)}get playsInline(){return Yr(this,me.PLAYSINLINE)!=null}set playsInline(e){Ee("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(me.PRELOAD,e):this.removeAttribute(me.PRELOAD)}};function Yr(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var md=cd;var xm=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},N=(t,e,i)=>(xm(t,e,"read from private field"),i?i.call(t):e.get(t)),mt=(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)=>(xm(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),pa,ns,yi,qr,zt,Qt,Xt,ki,fa,ss,Ze,Lm=1,Cm=0,wv=1,Rv={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 be&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=o:typeof o=="function"&&r instanceof be?r.element[r.attributeName]=o:r.value=o}}}},Mt=class extends l.DocumentFragment{constructor(e,i,a=Rv){var r;super(),mt(this,pa,void 0),mt(this,ns,void 0),this.append(e.content.cloneNode(!0)),It(this,pa,Dm(this)),It(this,ns,a),(r=a.createCallback)==null||r.call(a,this,N(this,pa),i),a.processCallback(this,N(this,pa),i)}update(e){N(this,ns).processCallback(this,N(this,pa),e)}};pa=new WeakMap;ns=new WeakMap;var Dm=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let o=new hd;for([i,a]of Rm(r.value))if(!i)o.append(a);else{let s=new be(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===Lm&&!(r instanceof HTMLTemplateElement))Dm(r,e);else{let o=r.data;if(r.nodeType===Lm||o.includes("{{")){let s=[];if(o)for([i,a]of Rm(o))if(!i)s.push(new Text(a));else{let d=new Lt(t);s.push(d),e.push([a,d])}else if(r instanceof HTMLTemplateElement){let d=new Zr(t,r);s.push(d),e.push([d.expression,d])}r.replaceWith(...s.flatMap(d=>d.replacementNodes||[d]))}}return e},wm={},Rm=t=>{let e="",i=0,a=wm[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([Cm,e]),e="",r++):o==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([wv,e.trim()]),e="",r++):e+=o||"";return e&&a.push([Cm,(i>0?"{{":"")+e]),wm[t]=a},xv=11,ls=class{get value(){return""}set value(e){}toString(){return this.value}},Om=new WeakMap,hd=class{constructor(){mt(this,yi,[])}[Symbol.iterator](){return N(this,yi).values()}get length(){return N(this,yi).length}item(e){return N(this,yi)[e]}append(...e){for(let i of e)i instanceof be&&Om.set(i,this),N(this,yi).push(i)}toString(){return N(this,yi).join("")}};yi=new WeakMap;var be=class extends ls{constructor(e,i,a){super(),mt(this,ki),mt(this,qr,""),mt(this,zt,void 0),mt(this,Qt,void 0),mt(this,Xt,void 0),It(this,zt,e),It(this,Qt,i),It(this,Xt,a)}get attributeName(){return N(this,Qt)}get attributeNamespace(){return N(this,Xt)}get element(){return N(this,zt)}get value(){return N(this,qr)}set value(e){N(this,qr)!==e&&(It(this,qr,e),!N(this,ki,fa)||N(this,ki,fa).length===1?e==null?N(this,zt).removeAttributeNS(N(this,Xt),N(this,Qt)):N(this,zt).setAttributeNS(N(this,Xt),N(this,Qt),e):N(this,zt).setAttributeNS(N(this,Xt),N(this,Qt),N(this,ki,fa).toString()))}get booleanValue(){return N(this,zt).hasAttributeNS(N(this,Xt),N(this,Qt))}set booleanValue(e){if(!N(this,ki,fa)||N(this,ki,fa).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};qr=new WeakMap;zt=new WeakMap;Qt=new WeakMap;Xt=new WeakMap;ki=new WeakSet;fa=function(){return Om.get(this)};var Lt=class extends ls{constructor(e,i){super(),mt(this,ss,void 0),mt(this,Ze,void 0),It(this,ss,e),It(this,Ze,i?[...i]:[new Text])}get replacementNodes(){return N(this,Ze)}get parentNode(){return N(this,ss)}get nextSibling(){return N(this,Ze)[N(this,Ze).length-1].nextSibling}get previousSibling(){return N(this,Ze)[0].previousSibling}get value(){return N(this,Ze).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===xv?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),It(this,Ze,Dv(N(this,Ze)[0].parentNode,N(this,Ze),i,this.nextSibling))}};ss=new WeakMap;Ze=new WeakMap;var Zr=class extends Lt{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 Dv(t,e,i,a=null){let r=0,o,s,d,u=i.length,f=e.length;for(;r<u&&r<f&&e[r]==i[r];)r++;for(;r<u&&r<f&&i[u-1]==e[f-1];)a=i[--f,--u];if(r==f)for(;r<u;)t.insertBefore(i[r++],a);if(r==u)for(;r<f;)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 Pm={string:t=>String(t)},us=class{constructor(e){this.template=e,this.state=void 0}},Si=new WeakMap,Ii=new WeakMap,pd={partial:(t,e)=>{e[t.expression]=new us(t.template)},if:(t,e)=>{var i;if(Um(t.expression,e))if(Si.get(t)!==t.template){Si.set(t,t.template);let a=new Mt(t.template,e,cs);t.replace(a),Ii.set(t,a)}else(i=Ii.get(t))==null||i.update(e);else t.replace(""),Si.delete(t),Ii.delete(t)}},Ov=Object.keys(pd),cs={processCallback(t,e,i){var a,r;if(i)for(let[o,s]of e){if(s instanceof Zr){if(!s.directive){let u=Ov.find(f=>s.template.hasAttribute(f));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=pd[s.directive])==null||a.call(pd,s,i);continue}let d=Um(o,i);if(d instanceof us){Si.get(s)!==d.template?(Si.set(s,d.template),d=new Mt(d.template,d.state,cs),s.value=d,Ii.set(s,d)):(r=Ii.get(s))==null||r.update(d.state);continue}d?(s instanceof be&&s.attributeName.startsWith("aria-")&&(d=String(d)),s instanceof be?typeof d=="boolean"?s.booleanValue=d:typeof d=="function"?s.element[s.attributeName]=d:s.value=d:(s.value=d,Si.delete(s),Ii.delete(s))):s instanceof be?s.value=void 0:(s.value=void 0,Si.delete(s),Ii.delete(s))}}},Nm={"!":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=Pm[e])==null?void 0:i.call(Pm,t)}};function Pv(t){return Nv(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function Um(t,e={}){var i,a,r,o,s,d,u;let f=Pv(t);if(f.length===0||f.some(({type:y})=>!y))return zr(t);if(((i=f[0])==null?void 0:i.token)===">"){let y=e[(a=f[1])==null?void 0:a.token];if(!y)return zr(t);let A={...e};y.state=A;let E=f.slice(2);for(let p=0;p<E.length;p+=3){let k=(r=E[p])==null?void 0:r.token,g=(o=E[p+1])==null?void 0:o.token,S=(s=E[p+2])==null?void 0:s.token;k&&g==="="&&(A[k]=Qr(S,e))}return y}if(f.length===1)return ds(f[0])?Qr(f[0].token,e):zr(t);if(f.length===2){let y=(d=f[0])==null?void 0:d.token,A=Nm[y];if(!A||!ds(f[1]))return zr(t);let E=Qr(f[1].token,e);return A(E)}if(f.length===3){let y=(u=f[1])==null?void 0:u.token,A=Nm[y];if(!A||!ds(f[0])||!ds(f[2]))return zr(t);let E=Qr(f[0].token,e);if(y==="|")return A(E,f[2].token);let p=Qr(f[2].token,e);return A(E,p)}}function zr(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function ds({type:t}){return["number","boolean","string","param"].includes(t)}function Qr(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 Nv(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 gd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Jt=(t,e,i)=>(gd(t,e,"read from private field"),i?i.call(t):e.get(t)),Mi=(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)},Ct=(t,e,i,a)=>(gd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),fd=(t,e,i)=>(gd(t,e,"access private method"),i),Ea,ms,ba,va,Ed,Hm,hs,bd,Xr,vd={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Bm=V.createElement("template");Bm.innerHTML=`
|
|
1413
1413
|
<style>
|
|
1414
1414
|
:host {
|
|
1415
1415
|
display: inline-block;
|
|
@@ -1436,7 +1436,7 @@ https://github.com/muxinc/elements/blob/main/errors/${t.file}`),ct(e)}var me={AU
|
|
|
1436
1436
|
display: none;
|
|
1437
1437
|
}
|
|
1438
1438
|
</style>
|
|
1439
|
-
`;var Li=class extends l.HTMLElement{constructor(){super(),Mi(this,
|
|
1439
|
+
`;var Li=class extends l.HTMLElement{constructor(){super(),Mi(this,Ed),Mi(this,hs),Mi(this,Ea,void 0),Mi(this,ms,void 0),Mi(this,ba,void 0),Mi(this,va,void 0),Mi(this,Xr,void 0),this.shadowRoot?this.renderRoot=this.shadowRoot:(this.renderRoot=this.attachShadow({mode:"open"}),this.createRenderer()),Ct(this,va,new MutationObserver(e=>{var i;this.mediaController&&!((i=this.mediaController)!=null&&i.breakpointsComputed)||e.some(a=>{let r=a.target;return r===this?!0:r.localName!=="media-controller"?!1:!!(vd[a.attributeName]||a.attributeName.startsWith("breakpoint"))})&&this.render()})),Ct(this,Xr,this.render.bind(this)),fd(this,Ed,Hm).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=Jt(this,Ea))!=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&&(Ct(this,Ea,e),Ct(this,ba,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})=>vd[s]||s.startsWith("breakpoint")),...Array.from(this.attributes)],o={};for(let s of r){let d=(a=vd[s.name])!=null?a:Hu(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&&fd(this,hs,bd).call(this)}connectedCallback(){this.addEventListener(Ie.BREAKPOINTS_COMPUTED,Jt(this,Xr)),Jt(this,va).observe(this,{attributes:!0}),Jt(this,va).observe(this.renderRoot,{attributes:!0,subtree:!0}),fd(this,hs,bd).call(this)}disconnectedCallback(){this.removeEventListener(Ie.BREAKPOINTS_COMPUTED,Jt(this,Xr)),Jt(this,va).disconnect()}createRenderer(){this.template instanceof HTMLTemplateElement&&this.template!==Jt(this,ms)&&(Ct(this,ms,this.template),this.renderer=new Mt(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(Bm.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};Ea=new WeakMap;ms=new WeakMap;ba=new WeakMap;va=new WeakMap;Ed=new WeakSet;Hm=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}};hs=new WeakSet;bd=function(){var t;let e=this.getAttribute("template");if(!e||e===Jt(this,ba))return;let i=this.getRootNode(),a=(t=i==null?void 0:i.getElementById)==null?void 0:t.call(i,e);if(a){Ct(this,ba,e),Ct(this,Ea,a),this.createRenderer();return}Uv(e)&&(Ct(this,ba,e),Hv(e).then(r=>{let o=V.createElement("template");o.innerHTML=r,Ct(this,Ea,o),this.createRenderer()}).catch(console.error))};Xr=new WeakMap;Li.observedAttributes=["template"];Li.processor=cs;function Uv(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 Hv(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",Li);var $m=`:host {
|
|
1440
1440
|
--media-control-display: var(--controls);
|
|
1441
1441
|
--media-loading-indicator-display: var(--loading-indicator);
|
|
1442
1442
|
--media-dialog-display: var(--dialog);
|
|
@@ -1586,19 +1586,19 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1586
1586
|
:host([no-tooltips]) {
|
|
1587
1587
|
--media-tooltip-display: none;
|
|
1588
1588
|
}
|
|
1589
|
-
`;var
|
|
1589
|
+
`;var Jr=new WeakMap,Ad=class t{constructor(e,i){this.element=e;this.type=i;this.element.addEventListener(this.type,this);let a=Jr.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=Jr.get(this.element);i&&i.delete(this.type)}}static for(e){Jr.has(e.element)||Jr.set(e.element,new Map);let i=e.attributeName.slice(2),a=Jr.get(e.element);return a&&a.has(i)?a.get(i):new t(e.element,i)}};function $v(t,e){return t instanceof be&&t.attributeName.startsWith("on")?(Ad.for(t).set(e),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function Wv(t,e){return e instanceof ps&&t instanceof Lt?(e.renderInto(t),!0):!1}function Fv(t,e){return e instanceof DocumentFragment&&t instanceof Lt?(e.childNodes.length&&t.replace(...e.childNodes),!0):!1}function Vv(t,e){if(t instanceof be){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 Kv(t,e){if(t instanceof be&&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 Gv(t,e){if(typeof e=="boolean"&&t instanceof be){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 Lt?(t.replace(""),!0):!1}function qv(t,e){Kv(t,e)||Gv(t,e)||$v(t,e)||Yv(t,e)||Wv(t,e)||Fv(t,e)||Vv(t,e)}var _d=new Map,Wm=new WeakMap,Fm=new WeakMap,ps=class{constructor(e,i,a){this.strings=e;this.values=i;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(_d.has(this.stringsKey))return _d.get(this.stringsKey);{let e=ri.createElement("template"),i=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,o)=>a+r+(o<i?`{{ ${o} }}`:""),""),_d.set(this.stringsKey,e),e}}renderInto(e){var r;let i=this.template;if(Wm.get(e)!==i){Wm.set(e,i);let o=new Mt(i,this.values,this.processor);Fm.set(e,o),e instanceof Lt?e.replace(...o.children):e.appendChild(o);return}let a=Fm.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},Zv={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:"";qv(o,s)}}}};function jr(t,...e){return new ps(t,e,Zv)}function Vm(t,e){t.renderInto(e)}var eo=require("@mux/playback-core"),zv=t=>{let{tokens:e}=t;return e.drm?":host(:not([cast-receiver])) { --_cast-button-drm-display: none; }":""},Km=t=>jr`
|
|
1590
1590
|
<style>
|
|
1591
1591
|
${zv(t)}
|
|
1592
1592
|
${$m}
|
|
1593
1593
|
</style>
|
|
1594
1594
|
${jv(t)}
|
|
1595
|
-
`,Qv=t=>{let e=t.hotKeys?`${t.hotKeys}`:"";return
|
|
1595
|
+
`,Qv=t=>{let e=t.hotKeys?`${t.hotKeys}`:"";return Gr(t.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},Xv={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"},Jv=Object.values(Xv).join(", "),jv=t=>{var e,i,a,r,o,s,d,u,f,y,A,E,p,k,g,S,C,j,Ue,Ot,bt,Ce,we,Pt,Qe,Wa,Fa,Va,Ka,Ga,Ya,qa,So,gt,Za,za,Qa,Xa,Ja,ja,er;return jr`
|
|
1596
1596
|
<media-theme
|
|
1597
1597
|
template="${t.themeTemplate||!1}"
|
|
1598
1598
|
defaultstreamtype="${(e=t.defaultStreamType)!=null?e:!1}"
|
|
1599
1599
|
hotkeys="${Qv(t)||!1}"
|
|
1600
1600
|
nohotkeys="${t.noHotKeys||!t.hasSrc||!1}"
|
|
1601
|
-
noautoseektolive="${!!((i=t.streamType)!=null&&i.includes(
|
|
1601
|
+
noautoseektolive="${!!((i=t.streamType)!=null&&i.includes(eo.StreamTypes.LIVE))&&t.targetLiveWindow!==0}"
|
|
1602
1602
|
novolumepref="${t.novolumepref||!1}"
|
|
1603
1603
|
nomutedpref="${t.nomutedpref||!1}"
|
|
1604
1604
|
disabled="${!t.hasSrc||t.isDialogOpen}"
|
|
@@ -1622,7 +1622,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1622
1622
|
slot="media"
|
|
1623
1623
|
inert="${(k=t.noHotKeys)!=null?k:!1}"
|
|
1624
1624
|
target-live-window="${(g=t.targetLiveWindow)!=null?g:!1}"
|
|
1625
|
-
stream-type="${(S=
|
|
1625
|
+
stream-type="${(S=Gr(t.streamType))!=null?S:!1}"
|
|
1626
1626
|
crossorigin="${(C=t.crossOrigin)!=null?C:""}"
|
|
1627
1627
|
playsinline
|
|
1628
1628
|
autoplay="${(j=t.autoplay)!=null?j:!1}"
|
|
@@ -1641,16 +1641,17 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1641
1641
|
player-software-version="${(Ga=t.playerSoftwareVersion)!=null?Ga:!1}"
|
|
1642
1642
|
env-key="${(Ya=t.envKey)!=null?Ya:!1}"
|
|
1643
1643
|
custom-domain="${(qa=t.customDomain)!=null?qa:!1}"
|
|
1644
|
-
src="${t.src?t.src:t.playbackId?(0,
|
|
1645
|
-
cast-src="${t.src?t.src:t.playbackId?(0,
|
|
1646
|
-
cast-receiver="${(
|
|
1644
|
+
src="${t.src?t.src:t.playbackId?(0,eo.toMuxVideoURL)(t):!1}"
|
|
1645
|
+
cast-src="${t.src?t.src:t.playbackId?(0,eo.toMuxVideoURL)(t):!1}"
|
|
1646
|
+
cast-receiver="${(So=t.castReceiver)!=null?So:!1}"
|
|
1647
1647
|
drm-token="${(Za=(gt=t.tokens)==null?void 0:gt.drm)!=null?Za:!1}"
|
|
1648
|
+
playback-token="${(Qa=(za=t.tokens)==null?void 0:za.playback)!=null?Qa:!1}"
|
|
1648
1649
|
exportparts="video"
|
|
1649
|
-
disable-pseudo-ended="${(
|
|
1650
|
-
max-auto-resolution="${(
|
|
1651
|
-
cap-rendition-to-player-size="${(
|
|
1650
|
+
disable-pseudo-ended="${(Xa=t.disablePseudoEnded)!=null?Xa:!1}"
|
|
1651
|
+
max-auto-resolution="${(Ja=t.maxAutoResolution)!=null?Ja:!1}"
|
|
1652
|
+
cap-rendition-to-player-size="${(ja=t.capRenditionToPlayerSize)!=null?ja:!1}"
|
|
1652
1653
|
>
|
|
1653
|
-
${t.storyboard?
|
|
1654
|
+
${t.storyboard?jr`<track label="thumbnails" default kind="metadata" src="${t.storyboard}" />`:jr``}
|
|
1654
1655
|
<slot></slot>
|
|
1655
1656
|
</mux-video>
|
|
1656
1657
|
<slot name="poster" slot="poster">
|
|
@@ -1658,11 +1659,11 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1658
1659
|
part="poster"
|
|
1659
1660
|
exportparts="poster, img"
|
|
1660
1661
|
src="${t.poster?t.poster:!1}"
|
|
1661
|
-
placeholdersrc="${(
|
|
1662
|
+
placeholdersrc="${(er=t.placeholder)!=null?er:!1}"
|
|
1662
1663
|
></media-poster-image>
|
|
1663
1664
|
</slot>
|
|
1664
1665
|
</media-theme>
|
|
1665
|
-
`};var T=require("@mux/playback-core"),Gm=t=>t.charAt(0).toUpperCase()+t.slice(1),eE=(t,e=!1)=>{var i,a;if(t.muxCode){let r=Gm((i=t.errorCategory)!=null?i:"video"),o=(0,T.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:T.MuxErrorCategory.VIDEO);if(t.muxCode===T.MuxErrorCode.NETWORK_OFFLINE)return(0,T.i18n)("Your device appears to be offline",e);if(t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return(0,T.i18n)("{category} URL has expired",e).format({category:r});if([T.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH,T.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,T.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING,T.MuxErrorCode.NETWORK_TOKEN_MALFORMED].includes(t.muxCode))return(0,T.i18n)("{category} URL is formatted incorrectly",e).format({category:r});if(t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_MISSING)return(0,T.i18n)("Invalid {categoryName} URL",e).format({categoryName:o});if(t.muxCode===T.MuxErrorCode.NETWORK_NOT_FOUND)return(0,T.i18n)("{category} does not exist",e).format({category:r});if(t.muxCode===T.MuxErrorCode.NETWORK_NOT_READY){let s=t.streamType==="live"?"Live stream":"Video";return(0,T.i18n)("{mediaType} is not currently available",e).format({mediaType:s})}}if(t.code){if(t.code===T.MediaError.MEDIA_ERR_NETWORK)return(0,T.i18n)("Network Error",e);if(t.code===T.MediaError.MEDIA_ERR_DECODE)return(0,T.i18n)("Media Error",e);if(t.code===T.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return(0,T.i18n)("Source Not Supported",e)}return(0,T.i18n)("Error",e)},tE=(t,e=!1)=>{var i,a;if(t.muxCode){let r=Gm((i=t.errorCategory)!=null?i:"video"),o=(0,T.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:T.MuxErrorCategory.VIDEO);return t.muxCode===T.MuxErrorCode.NETWORK_OFFLINE?(0,T.i18n)("Check your internet connection and try reloading this video.",e):t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_EXPIRED?(0,T.i18n)("The video\u2019s secured {tokenNamePrefix}-token has expired.",e).format({tokenNamePrefix:o}):t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH?(0,T.i18n)("The video\u2019s playback ID does not match the one encoded in the {tokenNamePrefix}-token.",e).format({tokenNamePrefix:o}):t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_MALFORMED?(0,T.i18n)("{category} URL is formatted incorrectly",e).format({category:r}):[T.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,T.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode)?(0,T.i18n)("The {tokenNamePrefix}-token is formatted with incorrect information.",e).format({tokenNamePrefix:o}):[T.MuxErrorCode.NETWORK_TOKEN_MISSING,T.MuxErrorCode.NETWORK_INVALID_URL].includes(t.muxCode)?(0,T.i18n)("The video URL or {tokenNamePrefix}-token are formatted with incorrect or incomplete information.",e).format({tokenNamePrefix:o}):t.muxCode===T.MuxErrorCode.NETWORK_NOT_FOUND?"":t.message}return t.code&&(t.code===T.MediaError.MEDIA_ERR_NETWORK||t.code===T.MediaError.MEDIA_ERR_DECODE||t.code===T.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED),t.message},Ym=(t,e=!1)=>{let i=eE(t,e).toString(),a=tE(t,e).toString();return{title:i,message:a}},iE=t=>{if(t.muxCode){if(t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return"403-expired-token.md";if(t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_MALFORMED)return"403-malformatted-token.md";if([T.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,T.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode))return"403-incorrect-aud-value.md";if(t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH)return"403-playback-id-mismatch.md";if(t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_MISSING)return"missing-signed-tokens.md";if(t.muxCode===T.MuxErrorCode.NETWORK_NOT_FOUND)return"404-not-found.md";if(t.muxCode===T.MuxErrorCode.NETWORK_NOT_READY)return"412-not-playable.md"}if(t.code){if(t.code===T.MediaError.MEDIA_ERR_NETWORK)return"";if(t.code===T.MediaError.MEDIA_ERR_DECODE)return"media-decode-error.md";if(t.code===T.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return"media-src-not-supported.md"}return""},
|
|
1666
|
+
`};var T=require("@mux/playback-core"),Gm=t=>t.charAt(0).toUpperCase()+t.slice(1),eE=(t,e=!1)=>{var i,a;if(t.muxCode){let r=Gm((i=t.errorCategory)!=null?i:"video"),o=(0,T.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:T.MuxErrorCategory.VIDEO);if(t.muxCode===T.MuxErrorCode.NETWORK_OFFLINE)return(0,T.i18n)("Your device appears to be offline",e);if(t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return(0,T.i18n)("{category} URL has expired",e).format({category:r});if([T.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH,T.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,T.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING,T.MuxErrorCode.NETWORK_TOKEN_MALFORMED].includes(t.muxCode))return(0,T.i18n)("{category} URL is formatted incorrectly",e).format({category:r});if(t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_MISSING)return(0,T.i18n)("Invalid {categoryName} URL",e).format({categoryName:o});if(t.muxCode===T.MuxErrorCode.NETWORK_NOT_FOUND)return(0,T.i18n)("{category} does not exist",e).format({category:r});if(t.muxCode===T.MuxErrorCode.NETWORK_NOT_READY){let s=t.streamType==="live"?"Live stream":"Video";return(0,T.i18n)("{mediaType} is not currently available",e).format({mediaType:s})}}if(t.code){if(t.code===T.MediaError.MEDIA_ERR_NETWORK)return(0,T.i18n)("Network Error",e);if(t.code===T.MediaError.MEDIA_ERR_DECODE)return(0,T.i18n)("Media Error",e);if(t.code===T.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return(0,T.i18n)("Source Not Supported",e)}return(0,T.i18n)("Error",e)},tE=(t,e=!1)=>{var i,a;if(t.muxCode){let r=Gm((i=t.errorCategory)!=null?i:"video"),o=(0,T.errorCategoryToTokenNameOrPrefix)((a=t.errorCategory)!=null?a:T.MuxErrorCategory.VIDEO);return t.muxCode===T.MuxErrorCode.NETWORK_OFFLINE?(0,T.i18n)("Check your internet connection and try reloading this video.",e):t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_EXPIRED?(0,T.i18n)("The video\u2019s secured {tokenNamePrefix}-token has expired.",e).format({tokenNamePrefix:o}):t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH?(0,T.i18n)("The video\u2019s playback ID does not match the one encoded in the {tokenNamePrefix}-token.",e).format({tokenNamePrefix:o}):t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_MALFORMED?(0,T.i18n)("{category} URL is formatted incorrectly",e).format({category:r}):[T.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,T.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode)?(0,T.i18n)("The {tokenNamePrefix}-token is formatted with incorrect information.",e).format({tokenNamePrefix:o}):[T.MuxErrorCode.NETWORK_TOKEN_MISSING,T.MuxErrorCode.NETWORK_INVALID_URL].includes(t.muxCode)?(0,T.i18n)("The video URL or {tokenNamePrefix}-token are formatted with incorrect or incomplete information.",e).format({tokenNamePrefix:o}):t.muxCode===T.MuxErrorCode.NETWORK_NOT_FOUND?"":t.message}return t.code&&(t.code===T.MediaError.MEDIA_ERR_NETWORK||t.code===T.MediaError.MEDIA_ERR_DECODE||t.code===T.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED),t.message},Ym=(t,e=!1)=>{let i=eE(t,e).toString(),a=tE(t,e).toString();return{title:i,message:a}},iE=t=>{if(t.muxCode){if(t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_EXPIRED)return"403-expired-token.md";if(t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_MALFORMED)return"403-malformatted-token.md";if([T.MuxErrorCode.NETWORK_TOKEN_AUD_MISMATCH,T.MuxErrorCode.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode))return"403-incorrect-aud-value.md";if(t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_SUB_MISMATCH)return"403-playback-id-mismatch.md";if(t.muxCode===T.MuxErrorCode.NETWORK_TOKEN_MISSING)return"missing-signed-tokens.md";if(t.muxCode===T.MuxErrorCode.NETWORK_NOT_FOUND)return"404-not-found.md";if(t.muxCode===T.MuxErrorCode.NETWORK_NOT_READY)return"412-not-playable.md"}if(t.code){if(t.code===T.MediaError.MEDIA_ERR_NETWORK)return"";if(t.code===T.MediaError.MEDIA_ERR_DECODE)return"media-decode-error.md";if(t.code===T.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)return"media-src-not-supported.md"}return""},Td=(t,e)=>{let i=iE(t);return{message:t.message,context:t.context,file:i}};var qm=`<template id="media-theme-gerwig">
|
|
1666
1667
|
<style>
|
|
1667
1668
|
@keyframes pre-play-hide {
|
|
1668
1669
|
0% {
|
|
@@ -2794,7 +2795,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
2794
2795
|
<slot></slot>
|
|
2795
2796
|
</media-controller>
|
|
2796
2797
|
</template>
|
|
2797
|
-
`;function Zm({anchor:t,floating:e,placement:i}){let a=rE({anchor:t,floating:e}),{x:r,y:o}=nE(a,i);return{x:r,y:o}}function rE({anchor:t,floating:e}){return{anchor:oE(t,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function oE(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 nE({anchor:t,floating:e},i){let a=sE(i)==="x"?"y":"x",r=a==="y"?"height":"width",o=zm(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,f;switch(o){case"top":f={x:s,y:t.y-e.height};break;case"bottom":f={x:s,y:t.y+t.height};break;case"right":f={x:t.x+t.width,y:d};break;case"left":f={x:t.x-e.width,y:d};break;default:f={x:t.x,y:t.y}}switch(i.split("-")[1]){case"start":f[a]-=u;break;case"end":f[a]+=u;break}return f}function zm(t){return t.split("-")[0]}function sE(t){return["top","bottom"].includes(zm(t))?"y":"x"}var jt=class extends Event{constructor({action:e="auto",relatedTarget:i,...a}){super("invoke",a),this.action=e,this.relatedTarget=i}},
|
|
2798
|
+
`;function Zm({anchor:t,floating:e,placement:i}){let a=rE({anchor:t,floating:e}),{x:r,y:o}=nE(a,i);return{x:r,y:o}}function rE({anchor:t,floating:e}){return{anchor:oE(t,e.offsetParent),floating:{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}}}function oE(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 nE({anchor:t,floating:e},i){let a=sE(i)==="x"?"y":"x",r=a==="y"?"height":"width",o=zm(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,f;switch(o){case"top":f={x:s,y:t.y-e.height};break;case"bottom":f={x:s,y:t.y+t.height};break;case"right":f={x:t.x+t.width,y:d};break;case"left":f={x:t.x-e.width,y:d};break;default:f={x:t.x,y:t.y}}switch(i.split("-")[1]){case"start":f[a]-=u;break;case"end":f[a]+=u;break}return f}function zm(t){return t.split("-")[0]}function sE(t){return["top","bottom"].includes(zm(t))?"y":"x"}var jt=class extends Event{constructor({action:e="auto",relatedTarget:i,...a}){super("invoke",a),this.action=e,this.relatedTarget=i}},fs=class extends Event{constructor({newState:e,oldState:i,...a}){super("toggle",a),this.newState=e,this.oldState=i}};var Od=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},$=(t,e,i)=>(Od(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)},Oe=(t,e,i,a)=>(Od(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),G=(t,e,i)=>(Od(t,e,"access private method"),i),ht,ei,wt,vs,to,wi,ro,yd,Qm,gs,Pd,_s,Es,kd,Sd,Xm,Id,Jm,Md,jm,ga,_a,Aa,oo,As,Nd,Ld,eh,Ud,th,Cd,ih,Hd,ah,wd,rh,Rd,oh,io,Ts,xd,nh,ao,ys,bs,Dd;function pt({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 ze(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 lE(t){return`
|
|
2798
2799
|
<style>
|
|
2799
2800
|
:host {
|
|
2800
2801
|
font: var(--media-font,
|
|
@@ -2969,7 +2970,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
2969
2970
|
<slot></slot>
|
|
2970
2971
|
</div>
|
|
2971
2972
|
<slot name="checked-indicator" hidden></slot>
|
|
2972
|
-
`}var Ci={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},te=class extends l.HTMLElement{constructor(){if(super(),K(this,Ad),K(this,Es),K(this,fs),K(this,yd),K(this,kd),K(this,Sd),K(this,Aa),K(this,gs),K(this,Id),K(this,Pd),K(this,Md),K(this,Nd),K(this,Ld),K(this,Cd),K(this,eo),K(this,wd),K(this,to),K(this,vs),K(this,ht,null),K(this,ei,null),K(this,wt,null),K(this,ps,new Set),K(this,jr,void 0),K(this,wi,!1),K(this,io,null),K(this,bs,()=>{let e=$(this,ps),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}));Oe(this,ps,i)}),K(this,ga,()=>{G(this,Aa,ao).call(this),G(this,gs,Od).call(this,!1)}),K(this,_a,()=>{G(this,Aa,ao).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])"),Oe(this,jr,new MutationObserver($(this,bs)))}static get observedAttributes(){return[Ci.DISABLED,Ci.HIDDEN,Ci.STYLE,Ci.ANCHOR,D.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,Ad,Qm).call(this,e);break;case"invoke":G(this,yd,Xm).call(this,e);break;case"click":G(this,Id,eh).call(this,e);break;case"toggle":G(this,Md,ih).call(this,e);break;case"focusout":G(this,Ld,rh).call(this,e);break;case"keydown":G(this,Cd,oh).call(this,e);break}}connectedCallback(){var e,i;$(this,jr).observe(this.defaultSlot,{childList:!0}),Oe(this,io,rr(this.shadowRoot,":host")),G(this,fs,Td).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),Oe(this,ht,Ro(this)),(i=(e=$(this,ht))==null?void 0:e.associateElement)==null||i.call(e,this),this.hidden||(_t(ro(this),$(this,ga)),_t(this,$(this,_a))),G(this,Es,Dd).call(this),this.shadowRoot.addEventListener("slotchange",this)}disconnectedCallback(){var e,i;$(this,jr).disconnect(),At(ro(this),$(this,ga)),At(this,$(this,_a)),this.disable(),(i=(e=$(this,ht))==null?void 0:e.unassociateElement)==null||i.call(e,this),Oe(this,ht,null),Oe(this,ei,null),Oe(this,wt,null),this.shadowRoot.removeEventListener("slotchange",this)}attributeChangedCallback(e,i,a){var r,o,s,d;e===Ci.HIDDEN&&a!==i?($(this,wi)||Oe(this,wi,!0),this.hidden?G(this,Sd,jm).call(this):G(this,kd,Jm).call(this),this.dispatchEvent(new hs({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===D.MEDIA_CONTROLLER?(i&&((o=(r=$(this,ht))==null?void 0:r.unassociateElement)==null||o.call(r,this),Oe(this,ht,null)),a&&this.isConnected&&(Oe(this,ht,Ro(this)),(d=(s=$(this,ht))==null?void 0:s.associateElement)==null||d.call(s,this))):e===Ci.DISABLED&&a!==i?a==null?this.enable():this.disable():e===Ci.STYLE&&a!==i&&G(this,fs,Td).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=ni(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(dE)}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,vs,Rd).call(this,i)}focus(){if(Oe(this,ei,ar()),this.items.length){G(this,to,As).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,eo,_s).call(this,e);a&&(G(this,vs,Rd).call(this,a,a.type==="checkbox"),$(this,wt)&&!this.hidden&&((i=$(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=G(this,eo,_s).call(this,e))!=null?i:G(this,wd,nh).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,to,As).call(this,o[u]),o[u].focus()}};ht=new WeakMap;ei=new WeakMap;wt=new WeakMap;ps=new WeakMap;jr=new WeakMap;wi=new WeakMap;io=new WeakMap;Ad=new WeakSet;Qm=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,Es,Dd).call(this),e.name||$(this,bs).call(this)};Es=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};bs=new WeakMap;fs=new WeakSet;Td=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")};yd=new WeakSet;Xm=function(t){Oe(this,wt,t.relatedTarget),he(this,t.relatedTarget)||(this.hidden=!this.hidden)};kd=new WeakSet;Jm=function(){var t;(t=$(this,wt))==null||t.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),_t(ro(this),$(this,ga)),_t(this,$(this,_a))};Sd=new WeakSet;jm=function(){var t;(t=$(this,wt))==null||t.setAttribute("aria-expanded","false"),At(ro(this),$(this,ga)),At(this,$(this,_a))};ga=new WeakMap;_a=new WeakMap;Aa=new WeakSet;ao=function(t){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:i}=Zm({anchor:this.anchorElement,floating:this,placement:"top-start"});t!=null||(t=this.offsetWidth);let r=ro(this).getBoundingClientRect(),o=r.width-e-t,s=r.height-i-this.offsetHeight,{style:d}=$(this,io);d.setProperty("position","absolute"),d.setProperty("right",`${Math.max(0,o)}px`),d.setProperty("--_menu-bottom",`${s}px`);let u=getComputedStyle(this),y=d.getPropertyValue("--_menu-bottom")===u.bottom?s:parseFloat(u.bottom),A=r.height-y-parseFloat(u.marginBottom);this.style.setProperty("--_menu-max-height",`${A}px`)};gs=new WeakSet;Od=function(t){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),i=e==null?void 0:e.querySelector('[role="menu"]'),{style:a}=$(this,io);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,Aa,ao).call(this,o)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),G(this,Aa,ao).call(this);a.removeProperty("--media-menu-transition-in")};Id=new WeakSet;eh=function(t){var e;if(t.stopPropagation(),t.composedPath().includes($(this,Pd,th))){(e=$(this,ei))==null||e.focus(),this.hidden=!0;return}let i=G(this,eo,_s).call(this,t);!i||i.hasAttribute("disabled")||(G(this,to,As).call(this,i),this.handleSelect(t))};Pd=new WeakSet;th=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"]'))};Md=new WeakSet;ih=function(t){if(t.target===this)return;G(this,Nd,ah).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 jt({relatedTarget:i}));for(let i of e)i.setAttribute("aria-expanded",`${!i.submenuElement.hidden}`);G(this,gs,Od).call(this,!0)};Nd=new WeakSet;ah=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};Ld=new WeakSet;rh=function(t){var e;he(this,t.relatedTarget)||($(this,wi)&&((e=$(this,ei))==null||e.focus()),$(this,wt)&&$(this,wt)!==t.relatedTarget&&!this.hidden&&(this.hidden=!0))};Cd=new WeakSet;oh=function(t){var e,i,a,r,o;let{key:s,ctrlKey:d,altKey:u,metaKey:f}=t;if(!(d||u||f)&&this.keysUsed.includes(s))if(t.preventDefault(),t.stopPropagation(),s==="Tab"){if($(this,wi)){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=$(this,ei))==null||o.focus(),$(this,wi)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(t):this.handleMove(t)};eo=new WeakSet;_s=function(t){return t.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};wd=new WeakSet;nh=function(){return this.items.find(t=>t.tabIndex===0)};to=new WeakSet;As=function(t){for(let e of this.items)e.tabIndex=e===t?0:-1};vs=new WeakSet;Rd=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}))};te.shadowRootOptions={mode:"open"};te.getTemplateHTML=lE;function dE(t){return["menuitem","menuitemradio","menuitemcheckbox"].includes(t==null?void 0:t.role)}function ro(t){var e;return(e=t.getAttribute("bounds")?Xe(t,`#${t.getAttribute("bounds")}`):Y(t)||t.parentElement)!=null?e:t}l.customElements.get("media-chrome-menu")||l.customElements.define("media-chrome-menu",te);var Fd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ge=(t,e,i)=>(Fd(t,e,"read from private field"),i?i.call(t):e.get(t)),Rt=(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)},Ud=(t,e,i,a)=>(Fd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ya=(t,e,i)=>(Fd(t,e,"access private method"),i),Ts,no,Hd,sh,ks,Vd,Kd,lh,ft,Ta,Bd,ys,$d;function uE(t){return`
|
|
2973
|
+
`}var Ci={STYLE:"style",HIDDEN:"hidden",DISABLED:"disabled",ANCHOR:"anchor"},te=class extends l.HTMLElement{constructor(){if(super(),K(this,yd),K(this,gs),K(this,Es),K(this,Sd),K(this,Id),K(this,Md),K(this,Aa),K(this,As),K(this,Ld),K(this,Ud),K(this,Cd),K(this,Hd),K(this,wd),K(this,Rd),K(this,io),K(this,xd),K(this,ao),K(this,bs),K(this,ht,null),K(this,ei,null),K(this,wt,null),K(this,vs,new Set),K(this,to,void 0),K(this,wi,!1),K(this,ro,null),K(this,_s,()=>{let e=$(this,vs),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}));Oe(this,vs,i)}),K(this,ga,()=>{G(this,Aa,oo).call(this),G(this,As,Nd).call(this,!1)}),K(this,_a,()=>{G(this,Aa,oo).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])"),Oe(this,to,new MutationObserver($(this,_s)))}static get observedAttributes(){return[Ci.DISABLED,Ci.HIDDEN,Ci.STYLE,Ci.ANCHOR,D.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,yd,Qm).call(this,e);break;case"invoke":G(this,Sd,Xm).call(this,e);break;case"click":G(this,Ld,eh).call(this,e);break;case"toggle":G(this,Cd,ih).call(this,e);break;case"focusout":G(this,wd,rh).call(this,e);break;case"keydown":G(this,Rd,oh).call(this,e);break}}connectedCallback(){var e,i;$(this,to).observe(this.defaultSlot,{childList:!0}),Oe(this,ro,nr(this.shadowRoot,":host")),G(this,Es,kd).call(this),this.hasAttribute("disabled")||this.enable(),this.role||(this.role="menu"),Oe(this,ht,Do(this)),(i=(e=$(this,ht))==null?void 0:e.associateElement)==null||i.call(e,this),this.hidden||(_t(no(this),$(this,ga)),_t(this,$(this,_a))),G(this,gs,Pd).call(this),this.shadowRoot.addEventListener("slotchange",this)}disconnectedCallback(){var e,i;$(this,to).disconnect(),At(no(this),$(this,ga)),At(this,$(this,_a)),this.disable(),(i=(e=$(this,ht))==null?void 0:e.unassociateElement)==null||i.call(e,this),Oe(this,ht,null),Oe(this,ei,null),Oe(this,wt,null),this.shadowRoot.removeEventListener("slotchange",this)}attributeChangedCallback(e,i,a){var r,o,s,d;e===Ci.HIDDEN&&a!==i?($(this,wi)||Oe(this,wi,!0),this.hidden?G(this,Md,jm).call(this):G(this,Id,Jm).call(this),this.dispatchEvent(new fs({oldState:this.hidden?"open":"closed",newState:this.hidden?"closed":"open",bubbles:!0}))):e===D.MEDIA_CONTROLLER?(i&&((o=(r=$(this,ht))==null?void 0:r.unassociateElement)==null||o.call(r,this),Oe(this,ht,null)),a&&this.isConnected&&(Oe(this,ht,Do(this)),(d=(s=$(this,ht))==null?void 0:s.associateElement)==null||d.call(s,this))):e===Ci.DISABLED&&a!==i?a==null?this.enable():this.disable():e===Ci.STYLE&&a!==i&&G(this,Es,kd).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=ni(this))==null?void 0:e.querySelector(`#${this.anchor}`):null}get items(){return this.defaultSlot.assignedElements({flatten:!0}).filter(dE)}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,bs,Dd).call(this,i)}focus(){if(Oe(this,ei,or()),this.items.length){G(this,ao,ys).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,io,Ts).call(this,e);a&&(G(this,bs,Dd).call(this,a,a.type==="checkbox"),$(this,wt)&&!this.hidden&&((i=$(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=G(this,io,Ts).call(this,e))!=null?i:G(this,xd,nh).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,ao,ys).call(this,o[u]),o[u].focus()}};ht=new WeakMap;ei=new WeakMap;wt=new WeakMap;vs=new WeakMap;to=new WeakMap;wi=new WeakMap;ro=new WeakMap;yd=new WeakSet;Qm=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,gs,Pd).call(this),e.name||$(this,_s).call(this)};gs=new WeakSet;Pd=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};_s=new WeakMap;Es=new WeakSet;kd=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")};Sd=new WeakSet;Xm=function(t){Oe(this,wt,t.relatedTarget),he(this,t.relatedTarget)||(this.hidden=!this.hidden)};Id=new WeakSet;Jm=function(){var t;(t=$(this,wt))==null||t.setAttribute("aria-expanded","true"),this.addEventListener("transitionend",()=>this.focus(),{once:!0}),_t(no(this),$(this,ga)),_t(this,$(this,_a))};Md=new WeakSet;jm=function(){var t;(t=$(this,wt))==null||t.setAttribute("aria-expanded","false"),At(no(this),$(this,ga)),At(this,$(this,_a))};ga=new WeakMap;_a=new WeakMap;Aa=new WeakSet;oo=function(t){if(this.hasAttribute("mediacontroller")&&!this.anchor||this.hidden||!this.anchorElement)return;let{x:e,y:i}=Zm({anchor:this.anchorElement,floating:this,placement:"top-start"});t!=null||(t=this.offsetWidth);let r=no(this).getBoundingClientRect(),o=r.width-e-t,s=r.height-i-this.offsetHeight,{style:d}=$(this,ro);d.setProperty("position","absolute"),d.setProperty("right",`${Math.max(0,o)}px`),d.setProperty("--_menu-bottom",`${s}px`);let u=getComputedStyle(this),y=d.getPropertyValue("--_menu-bottom")===u.bottom?s:parseFloat(u.bottom),A=r.height-y-parseFloat(u.marginBottom);this.style.setProperty("--_menu-max-height",`${A}px`)};As=new WeakSet;Nd=function(t){let e=this.querySelector('[role="menuitem"][aria-haspopup][aria-expanded="true"]'),i=e==null?void 0:e.querySelector('[role="menu"]'),{style:a}=$(this,ro);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,Aa,oo).call(this,o)}else this.style.removeProperty("min-width"),this.style.removeProperty("min-height"),G(this,Aa,oo).call(this);a.removeProperty("--media-menu-transition-in")};Ld=new WeakSet;eh=function(t){var e;if(t.stopPropagation(),t.composedPath().includes($(this,Ud,th))){(e=$(this,ei))==null||e.focus(),this.hidden=!0;return}let i=G(this,io,Ts).call(this,t);!i||i.hasAttribute("disabled")||(G(this,ao,ys).call(this,i),this.handleSelect(t))};Ud=new WeakSet;th=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"]'))};Cd=new WeakSet;ih=function(t){if(t.target===this)return;G(this,Hd,ah).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 jt({relatedTarget:i}));for(let i of e)i.setAttribute("aria-expanded",`${!i.submenuElement.hidden}`);G(this,As,Nd).call(this,!0)};Hd=new WeakSet;ah=function(){let e=this.querySelector('[role="menuitem"] > [role="menu"]:not([hidden])');this.container.classList.toggle("has-expanded",!!e)};wd=new WeakSet;rh=function(t){var e;he(this,t.relatedTarget)||($(this,wi)&&((e=$(this,ei))==null||e.focus()),$(this,wt)&&$(this,wt)!==t.relatedTarget&&!this.hidden&&(this.hidden=!0))};Rd=new WeakSet;oh=function(t){var e,i,a,r,o;let{key:s,ctrlKey:d,altKey:u,metaKey:f}=t;if(!(d||u||f)&&this.keysUsed.includes(s))if(t.preventDefault(),t.stopPropagation(),s==="Tab"){if($(this,wi)){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=$(this,ei))==null||o.focus(),$(this,wi)&&(this.hidden=!0)):s==="Enter"||s===" "?this.handleSelect(t):this.handleMove(t)};io=new WeakSet;Ts=function(t){return t.composedPath().find(e=>["menuitemradio","menuitemcheckbox"].includes(e.role))};xd=new WeakSet;nh=function(){return this.items.find(t=>t.tabIndex===0)};ao=new WeakSet;ys=function(t){for(let e of this.items)e.tabIndex=e===t?0:-1};bs=new WeakSet;Dd=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}))};te.shadowRootOptions={mode:"open"};te.getTemplateHTML=lE;function dE(t){return["menuitem","menuitemradio","menuitemcheckbox"].includes(t==null?void 0:t.role)}function no(t){var e;return(e=t.getAttribute("bounds")?Xe(t,`#${t.getAttribute("bounds")}`):Y(t)||t.parentElement)!=null?e:t}l.customElements.get("media-chrome-menu")||l.customElements.define("media-chrome-menu",te);var Kd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},ge=(t,e,i)=>(Kd(t,e,"read from private field"),i?i.call(t):e.get(t)),Rt=(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)},Bd=(t,e,i,a)=>(Kd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),ya=(t,e,i)=>(Kd(t,e,"access private method"),i),ks,lo,$d,sh,Is,Gd,Yd,lh,ft,Ta,Wd,Ss,Fd;function uE(t){return`
|
|
2973
2974
|
<style>
|
|
2974
2975
|
:host {
|
|
2975
2976
|
transition: var(--media-menu-item-transition,
|
|
@@ -3087,7 +3088,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3087
3088
|
${this.getSuffixSlotInnerHTML(t)}
|
|
3088
3089
|
</slot>
|
|
3089
3090
|
<slot name="submenu"></slot>
|
|
3090
|
-
`}function cE(t){return""}var Pe={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Le=class extends l.HTMLElement{constructor(){if(super(),Rt(this
|
|
3091
|
+
`}function cE(t){return""}var Pe={TYPE:"type",VALUE:"value",CHECKED:"checked",DISABLED:"disabled"},Le=class extends l.HTMLElement{constructor(){if(super(),Rt(this,$d),Rt(this,Is),Rt(this,Yd),Rt(this,Ss),Rt(this,ks,!1),Rt(this,lo,void 0),Rt(this,ft,()=>{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)}),Rt(this,Ta,e=>{let{key:i}=e;if(!this.keysUsed.includes(i)){this.removeEventListener("keyup",ge(this,Ta));return}this.handleClick(e)}),Rt(this,Wd,e=>{let{metaKey:i,altKey:a,key:r}=e;if(i||a||!this.keysUsed.includes(r)){this.removeEventListener("keyup",ge(this,Ta));return}this.addEventListener("keyup",ge(this,Ta),{once:!0})}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Z(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[Pe.TYPE,Pe.DISABLED,Pe.CHECKED,Pe.VALUE]}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),so(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":ya(this,$d,sh).call(this,e);break;case"click":this.handleClick(e);break;case"keydown":ge(this,Wd).call(this,e);break;case"keyup":ge(this,Ta).call(this,e);break}}attributeChangedCallback(e,i,a){e===Pe.CHECKED&&so(this)&&!ge(this,ks)?this.setAttribute("aria-checked",a!=null?"true":"false"):e===Pe.TYPE&&a!==i?this.role="menuitem"+a:e===Pe.DISABLED&&a!==i&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(Pe.DISABLED)||this.enable(),this.role="menuitem"+this.type,Bd(this,lo,Vd(this,this.parentNode)),ya(this,Ss,Fd).call(this),this.submenuElement&&ya(this,Is,Gd).call(this),this.shadowRoot.addEventListener("slotchange",this)}disconnectedCallback(){this.disable(),ya(this,Ss,Fd).call(this),Bd(this,lo,null),this.shadowRoot.removeEventListener("slotchange",this)}get invokeTarget(){return this.getAttribute("invoketarget")}set invokeTarget(e){this.setAttribute("invoketarget",`${e}`)}get invokeTargetElement(){var e;return this.invokeTarget?(e=ni(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(Pe.TYPE))!=null?e:""}set type(e){this.setAttribute(Pe.TYPE,`${e}`)}get value(){var e;return(e=this.getAttribute(Pe.VALUE))!=null?e:this.text}set value(e){this.setAttribute(Pe.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get checked(){if(so(this))return this.getAttribute("aria-checked")==="true"}set checked(e){so(this)&&(Bd(this,ks,!0),this.setAttribute("aria-checked",e?"true":"false"),e?this.part.add("checked"):this.part.remove("checked"))}handleClick(e){so(this)||this.invokeTargetElement&&he(this,e.target)&&this.invokeTargetElement.dispatchEvent(new jt({relatedTarget:this}))}get keysUsed(){return["Enter"," "]}};ks=new WeakMap;lo=new WeakMap;$d=new WeakSet;sh=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?ya(this,Is,Gd).call(this):ya(this,Yd,lh).call(this))};Is=new WeakSet;Gd=async function(){this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",`${!this.submenuElement.hidden}`),this.submenuElement.addEventListener("change",ge(this,ft)),this.submenuElement.addEventListener("addmenuitem",ge(this,ft)),this.submenuElement.addEventListener("removemenuitem",ge(this,ft)),ge(this,ft).call(this)};Yd=new WeakSet;lh=function(){this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.submenuElement.removeEventListener("change",ge(this,ft)),this.submenuElement.removeEventListener("addmenuitem",ge(this,ft)),this.submenuElement.removeEventListener("removemenuitem",ge(this,ft)),ge(this,ft).call(this)};ft=new WeakMap;Ta=new WeakMap;Wd=new WeakMap;Ss=new WeakSet;Fd=function(){var t;let e=(t=ge(this,lo))==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")};Le.shadowRootOptions={mode:"open"};Le.getTemplateHTML=uE;Le.getSuffixSlotInnerHTML=cE;function so(t){return t.type==="radio"||t.type==="checkbox"}function Vd(t,e){if(!t)return null;let{host:i}=t.getRootNode();return!e&&i?Vd(t,i):e!=null&&e.items?e:Vd(e,e==null?void 0:e.parentNode)}l.customElements.get("media-chrome-menu-item")||l.customElements.define("media-chrome-menu-item",Le);function mE(t){return`
|
|
3091
3092
|
${te.getTemplateHTML(t)}
|
|
3092
3093
|
<style>
|
|
3093
3094
|
:host {
|
|
@@ -3122,7 +3123,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3122
3123
|
--media-settings-menu-item-opacity: 0;
|
|
3123
3124
|
}
|
|
3124
3125
|
</style>
|
|
3125
|
-
`}var
|
|
3126
|
+
`}var uo=class extends te{get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Y(this).querySelector("media-settings-menu-button")}};uo.getTemplateHTML=mE;l.customElements.get("media-settings-menu")||l.customElements.define("media-settings-menu",uo);function hE(t){return`
|
|
3126
3127
|
${Le.getTemplateHTML.call(this,t)}
|
|
3127
3128
|
<style>
|
|
3128
3129
|
slot:not([name="submenu"]) {
|
|
@@ -3148,7 +3149,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3148
3149
|
<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"/>
|
|
3149
3150
|
</svg>
|
|
3150
3151
|
</slot>
|
|
3151
|
-
`}function vE(){return c("Settings")}var ka=class extends ye{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",c("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Y(this).querySelector("media-settings-menu")}};ka.getSlotTemplateHTML=fE;ka.getTooltipContentHTML=vE;l.customElements.get("media-settings-menu-button")||l.customElements.define("media-settings-menu-button",ka);var
|
|
3152
|
+
`}function vE(){return c("Settings")}var ka=class extends ye{static get observedAttributes(){return[...super.observedAttributes,"target"]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",c("settings"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Y(this).querySelector("media-settings-menu")}};ka.getSlotTemplateHTML=fE;ka.getTooltipContentHTML=vE;l.customElements.get("media-settings-menu-button")||l.customElements.define("media-settings-menu-button",ka);var Qd=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},dh=(t,e,i)=>(Qd(t,e,"read from private field"),i?i.call(t):e.get(t)),Ms=(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)},qd=(t,e,i,a)=>(Qd(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ls=(t,e,i)=>(Qd(t,e,"access private method"),i),co,Rs,Cs,Zd,ws,zd,xs=class extends te{constructor(){super(...arguments),Ms(this,Cs),Ms(this,ws),Ms(this,co,[]),Ms(this,Rs,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&&(qd(this,co,Uu(a!=null?a:"")),Ls(this,Cs,Zd).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Ls(this,ws,zd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Ls(this,ws,zd))}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 dh(this,co)}set mediaAudioTrackList(e){qd(this,co,e),Ls(this,Cs,Zd).call(this)}get mediaAudioTrackEnabled(){var e;return(e=x(this,n.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){w(this,n.MEDIA_AUDIO_TRACK_ENABLED,e)}};co=new WeakMap;Rs=new WeakMap;Cs=new WeakSet;Zd=function(){if(dh(this,Rs)===JSON.stringify(this.mediaAudioTrackList))return;qd(this,Rs,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=pt({type:"radio",text:i,value:`${e.id}`,checked:e.enabled});a.prepend(ze(this,"checked-indicator")),this.defaultSlot.append(a)}};ws=new WeakSet;zd=function(){if(this.value==null)return;let t=new l.CustomEvent(h.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",xs);var EE=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
3152
3153
|
<path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
|
|
3153
3154
|
<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"/>
|
|
3154
3155
|
</svg>`;function bE(){return`
|
|
@@ -3158,13 +3159,13 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3158
3159
|
}
|
|
3159
3160
|
</style>
|
|
3160
3161
|
<slot name="icon">${EE}</slot>
|
|
3161
|
-
`}function gE(){return c("Audio")}var uh=t=>{let e=c("Audio");t.setAttribute("aria-label",e)},Sa=class extends ye{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_AUDIO_TRACK_ENABLED,n.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),uh(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_LANG&&uh(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=x(this,n.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){w(this,n.MEDIA_AUDIO_TRACK_ENABLED,e)}};Sa.getSlotTemplateHTML=bE;Sa.getTooltipContentHTML=gE;l.customElements.get("media-audio-track-menu-button")||l.customElements.define("media-audio-track-menu-button",Sa);var
|
|
3162
|
+
`}function gE(){return c("Audio")}var uh=t=>{let e=c("Audio");t.setAttribute("aria-label",e)},Sa=class extends ye{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_AUDIO_TRACK_ENABLED,n.MEDIA_AUDIO_TRACK_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),uh(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_LANG&&uh(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=x(this,n.MEDIA_AUDIO_TRACK_ENABLED))!=null?e:""}set mediaAudioTrackEnabled(e){w(this,n.MEDIA_AUDIO_TRACK_ENABLED,e)}};Sa.getSlotTemplateHTML=bE;Sa.getTooltipContentHTML=gE;l.customElements.get("media-audio-track-menu-button")||l.customElements.define("media-audio-track-menu-button",Sa);var eu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},_E=(t,e,i)=>(eu(t,e,"read from private field"),i?i.call(t):e.get(t)),Xd=(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)},AE=(t,e,i,a)=>(eu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ds=(t,e,i)=>(eu(t,e,"access private method"),i),Ns,Os,Jd,Ps,jd,TE=`
|
|
3162
3163
|
<svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
|
|
3163
3164
|
<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"/>
|
|
3164
3165
|
</svg>`;function yE(t){return`
|
|
3165
3166
|
${te.getTemplateHTML(t)}
|
|
3166
3167
|
<slot name="captions-indicator" hidden>${TE}</slot>
|
|
3167
|
-
`}var
|
|
3168
|
+
`}var mo=class extends te{constructor(){super(...arguments),Xd(this,Os),Xd(this,Ps),Xd(this,Ns,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,Os,Jd).call(this):e===n.MEDIA_SUBTITLES_SHOWING&&i!==a&&(this.value=a||"",Ds(this,Os,Jd).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Ds(this,Ps,jd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Ds(this,Ps,jd))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Y(this).querySelector("media-captions-menu-button")}get mediaSubtitlesList(){return ch(this,n.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){mh(this,n.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return ch(this,n.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){mh(this,n.MEDIA_SUBTITLES_SHOWING,e)}};Ns=new WeakMap;Os=new WeakSet;Jd=function(){var t;let e=_E(this,Ns)!==JSON.stringify(this.mediaSubtitlesList),i=this.value!==this.getAttribute(n.MEDIA_SUBTITLES_SHOWING);if(!e&&!i)return;AE(this,Ns,JSON.stringify(this.mediaSubtitlesList)),this.defaultSlot.textContent="";let a=!this.value,r=pt({type:"radio",text:this.formatMenuItemText(c("Off")),value:"off",checked:a});r.prepend(ze(this,"checked-indicator")),this.defaultSlot.append(r);let o=this.mediaSubtitlesList;for(let s of o){let d=pt({type:"radio",text:this.formatMenuItemText(s.label,s),value:Yo(s),checked:this.value==Yo(s)});d.prepend(ze(this,"checked-indicator")),((t=s.kind)!=null?t:"subs")==="captions"&&d.append(ze(this,"captions-indicator")),this.defaultSlot.append(d)}};Ps=new WeakSet;jd=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(h.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:t})),!this.value||!i)return;let a=new l.CustomEvent(h.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(a)};mo.getTemplateHTML=yE;var ch=(t,e)=>{let i=t.getAttribute(e);return i?di(i):[]},mh=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=yt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};l.customElements.get("media-captions-menu")||l.customElements.define("media-captions-menu",mo);var kE=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
3168
3169
|
<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"/>
|
|
3169
3170
|
</svg>`,SE=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
3170
3171
|
<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"/>
|
|
@@ -3188,7 +3189,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3188
3189
|
<slot name="on">${kE}</slot>
|
|
3189
3190
|
<slot name="off">${SE}</slot>
|
|
3190
3191
|
</slot>
|
|
3191
|
-
`}function ME(){return c("Captions")}var hh=t=>{t.setAttribute("data-captions-enabled",
|
|
3192
|
+
`}function ME(){return c("Captions")}var hh=t=>{t.setAttribute("data-captions-enabled",qo(t).toString())},ph=t=>{t.setAttribute("aria-label",c("closed captions"))},Ia=class extends ye{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_SUBTITLES_LIST,n.MEDIA_SUBTITLES_SHOWING,n.MEDIA_LANG]}connectedCallback(){super.connectedCallback(),ph(this),hh(this)}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_SUBTITLES_SHOWING?hh(this):e===n.MEDIA_LANG&&ph(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 fh(this,n.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){vh(this,n.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return fh(this,n.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){vh(this,n.MEDIA_SUBTITLES_SHOWING,e)}};Ia.getSlotTemplateHTML=IE;Ia.getTooltipContentHTML=ME;var fh=(t,e)=>{let i=t.getAttribute(e);return i?di(i):[]},vh=(t,e,i)=>{if(!(i!=null&&i.length)){t.removeAttribute(e);return}let a=yt(i);t.getAttribute(e)!==a&&t.setAttribute(e,a)};l.customElements.get("media-captions-menu-button")||l.customElements.define("media-captions-menu-button",Ia);var Eh=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},La=(t,e,i)=>(Eh(t,e,"read from private field"),i?i.call(t):e.get(t)),tu=(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)},Ma=(t,e,i)=>(Eh(t,e,"access private method"),i),ti,Ca,ho,Us,au,iu={RATES:"rates"},Hs=class extends te{constructor(){super(),tu(this,Ca),tu(this,Us),tu(this,ti,new Bt(this,iu.RATES,{defaultValue:Fl})),Ma(this,Ca,ho).call(this)}static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_PLAYBACK_RATE,iu.RATES]}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),e===n.MEDIA_PLAYBACK_RATE&&i!=a?(this.value=a,Ma(this,Ca,ho).call(this)):e===iu.RATES&&i!=a&&(La(this,ti).value=a,Ma(this,Ca,ho).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Ma(this,Us,au))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Ma(this,Us,au))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Y(this).querySelector("media-playback-rate-menu-button")}get rates(){return La(this,ti)}set rates(e){e?Array.isArray(e)?La(this,ti).value=e.join(" "):typeof e=="string"&&(La(this,ti).value=e):La(this,ti).value="",Ma(this,Ca,ho).call(this)}get mediaPlaybackRate(){return P(this,n.MEDIA_PLAYBACK_RATE,Ei)}set mediaPlaybackRate(e){U(this,n.MEDIA_PLAYBACK_RATE,e)}};ti=new WeakMap;Ca=new WeakSet;ho=function(){this.defaultSlot.textContent="";let t=this.mediaPlaybackRate,e=new Set(Array.from(La(this,ti)).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=pt({type:"radio",text:this.formatMenuItemText(`${a}x`,a),value:a.toString(),checked:t===a});r.prepend(ze(this,"checked-indicator")),this.defaultSlot.append(r)}};Us=new WeakSet;au=function(){if(!this.value)return;let t=new l.CustomEvent(h.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",Hs);var Bs=1;function LE(t){return`
|
|
3192
3193
|
<style>
|
|
3193
3194
|
:host {
|
|
3194
3195
|
min-width: 5ch;
|
|
@@ -3203,8 +3204,8 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3203
3204
|
display: none;
|
|
3204
3205
|
}
|
|
3205
3206
|
</style>
|
|
3206
|
-
<slot name="icon">${t.mediaplaybackrate||
|
|
3207
|
-
`}function CE(){return c("Playback rate")}var wa=class extends ye{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:
|
|
3207
|
+
<slot name="icon">${t.mediaplaybackrate||Bs}x</slot>
|
|
3208
|
+
`}function CE(){return c("Playback rate")}var wa=class extends ye{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:Bs}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)?Bs:r;this.container.innerHTML=`${o}x`,this.setAttribute("aria-label",c("Playback rate {playbackRate}",{playbackRate:o}))}}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Y(this).querySelector("media-playback-rate-menu")}get mediaPlaybackRate(){return P(this,n.MEDIA_PLAYBACK_RATE,Bs)}set mediaPlaybackRate(e){U(this,n.MEDIA_PLAYBACK_RATE,e)}};wa.getSlotTemplateHTML=LE;wa.getTooltipContentHTML=CE;l.customElements.get("media-playback-rate-menu-button")||l.customElements.define("media-playback-rate-menu-button",wa);var ou=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},po=(t,e,i)=>(ou(t,e,"read from private field"),i?i.call(t):e.get(t)),$s=(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)},bh=(t,e,i,a)=>(ou(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ra=(t,e,i)=>(ou(t,e,"access private method"),i),fo,Da,xa,vo,Ws,ru,Fs=class extends te{constructor(){super(...arguments),$s(this,xa),$s(this,Ws),$s(this,fo,[]),$s(this,Da,{})}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",Ra(this,xa,vo).call(this)):e===n.MEDIA_RENDITION_LIST&&i!==a?(bh(this,fo,Pu(a)),Ra(this,xa,vo).call(this)):e===n.MEDIA_HEIGHT&&i!==a&&Ra(this,xa,vo).call(this)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Ra(this,Ws,ru))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Ra(this,Ws,ru))}get anchorElement(){return this.anchor!=="auto"?super.anchorElement:Y(this).querySelector("media-rendition-menu-button")}get mediaRenditionList(){return po(this,fo)}set mediaRenditionList(e){bh(this,fo,e),Ra(this,xa,vo).call(this)}get mediaRenditionSelected(){return x(this,n.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){w(this,n.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return P(this,n.MEDIA_HEIGHT)}set mediaHeight(e){U(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)}};fo=new WeakMap;Da=new WeakMap;xa=new WeakSet;vo=function(){if(po(this,Da).mediaRenditionList===JSON.stringify(this.mediaRenditionList)&&po(this,Da).mediaHeight===this.mediaHeight)return;po(this,Da).mediaRenditionList=JSON.stringify(this.mediaRenditionList),po(this,Da).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=pt({type:"radio",text:d,value:`${s.id}`,checked:s.selected&&!i});u.prepend(ze(this,"checked-indicator")),this.defaultSlot.append(u)}let a=e&&this.showRenditionBitrate(e),r=i?e?this.formatMenuItemText(`${c("Auto")} \u2022 ${this.formatRendition(e,{showBitrate:a})}`,e):this.formatMenuItemText(`${c("Auto")} (${this.mediaHeight}p)`):this.formatMenuItemText(c("Auto")),o=pt({type:"radio",text:r,value:"auto",checked:i});o.dataset.description=r,o.prepend(ze(this,"checked-indicator")),this.defaultSlot.append(o)};Ws=new WeakSet;ru=function(){if(this.value==null)return;let t=new l.CustomEvent(h.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",Fs);var wE=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
3208
3209
|
<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" />
|
|
3209
3210
|
</svg>`;function RE(){return`
|
|
3210
3211
|
<style>
|
|
@@ -3213,7 +3214,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3213
3214
|
}
|
|
3214
3215
|
</style>
|
|
3215
3216
|
<slot name="icon">${wE}</slot>
|
|
3216
|
-
`}function xE(){return c("Quality")}var Oa=class extends ye{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_RENDITION_SELECTED,n.MEDIA_RENDITION_UNAVAILABLE,n.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",c("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Y(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return x(this,n.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){w(this,n.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return P(this,n.MEDIA_HEIGHT)}set mediaHeight(e){U(this,n.MEDIA_HEIGHT,e)}};Oa.getSlotTemplateHTML=RE;Oa.getTooltipContentHTML=xE;l.customElements.get("media-rendition-menu-button")||l.customElements.define("media-rendition-menu-button",Oa);var
|
|
3217
|
+
`}function xE(){return c("Quality")}var Oa=class extends ye{static get observedAttributes(){return[...super.observedAttributes,n.MEDIA_RENDITION_SELECTED,n.MEDIA_RENDITION_UNAVAILABLE,n.MEDIA_HEIGHT]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-label",c("quality"))}get invokeTargetElement(){return this.invokeTarget!=null?super.invokeTargetElement:Y(this).querySelector("media-rendition-menu")}get mediaRenditionSelected(){return x(this,n.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){w(this,n.MEDIA_RENDITION_SELECTED,e)}get mediaHeight(){return P(this,n.MEDIA_HEIGHT)}set mediaHeight(e){U(this,n.MEDIA_HEIGHT,e)}};Oa.getSlotTemplateHTML=RE;Oa.getTooltipContentHTML=xE;l.customElements.get("media-rendition-menu-button")||l.customElements.define("media-rendition-menu-button",Oa);var lu=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},Et=(t,e,i)=>(lu(t,e,"read from private field"),i?i.call(t):e.get(t)),vt=(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)},gh=(t,e,i,a)=>(lu(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Ne=(t,e,i)=>(lu(t,e,"access private method"),i),Na,Eo,Zs,xi,Pa,du,_h,Vs,nu,Ks,su,Ah,Ys,qs,Gs;function DE(t){return`
|
|
3217
3218
|
${te.getTemplateHTML(t)}
|
|
3218
3219
|
<style>
|
|
3219
3220
|
:host {
|
|
@@ -3227,7 +3228,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3227
3228
|
overflow: hidden;
|
|
3228
3229
|
}
|
|
3229
3230
|
</style>
|
|
3230
|
-
`}var
|
|
3231
|
+
`}var bo=class extends te{constructor(){super(),vt(this,Eo),vt(this,xi),vt(this,du),vt(this,Vs),vt(this,su),vt(this,Na,!1),vt(this,Ks,e=>{let i=e.target,a=(i==null?void 0:i.nodeName)==="VIDEO",r=Ne(this,Vs,nu).call(this,i);(a||r)&&(Et(this,Na)?Ne(this,xi,Pa).call(this):Ne(this,su,Ah).call(this,e))}),vt(this,Ys,e=>{let i=e.target,a=this.contains(i),r=e.button===2,o=(i==null?void 0:i.nodeName)==="VIDEO",s=Ne(this,Vs,nu).call(this,i);a||r&&(o||s)||Ne(this,xi,Pa).call(this)}),vt(this,qs,e=>{e.key==="Escape"&&Ne(this,xi,Pa).call(this)}),vt(this,Gs,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)}Ne(this,xi,Pa).call(this)}),this.setAttribute("noautohide",""),Ne(this,Eo,Zs).call(this)}connectedCallback(){super.connectedCallback(),Y(this).addEventListener("contextmenu",Et(this,Ks)),this.addEventListener("click",Et(this,Gs))}disconnectedCallback(){super.disconnectedCallback(),Y(this).removeEventListener("contextmenu",Et(this,Ks)),this.removeEventListener("click",Et(this,Gs)),document.removeEventListener("mousedown",Et(this,Ys)),document.removeEventListener("keydown",Et(this,qs))}};Na=new WeakMap;Eo=new WeakSet;Zs=function(){this.hidden=!Et(this,Na)};xi=new WeakSet;Pa=function(){gh(this,Na,!1),Ne(this,Eo,Zs).call(this)};du=new WeakSet;_h=function(){document.querySelectorAll("media-context-menu").forEach(e=>{var i;e!==this&&Ne(i=e,xi,Pa).call(i)})};Vs=new WeakSet;nu=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};Ks=new WeakMap;su=new WeakSet;Ah=function(t){t.preventDefault(),Ne(this,du,_h).call(this),gh(this,Na,!0),this.style.position="fixed",this.style.left=`${t.clientX}px`,this.style.top=`${t.clientY}px`,Ne(this,Eo,Zs).call(this),document.addEventListener("mousedown",Et(this,Ys),{once:!0}),document.addEventListener("keydown",Et(this,qs),{once:!0})};Ys=new WeakMap;qs=new WeakMap;Gs=new WeakMap;bo.getTemplateHTML=DE;l.customElements.get("media-context-menu")||l.customElements.define("media-context-menu",bo);function OE(t){return`
|
|
3231
3232
|
${Le.getTemplateHTML.call(this,t)}
|
|
3232
3233
|
<style>
|
|
3233
3234
|
::slotted(*) {
|
|
@@ -3240,7 +3241,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3240
3241
|
min-height: var(--media-control-height, 24px);
|
|
3241
3242
|
}
|
|
3242
3243
|
</style>
|
|
3243
|
-
`}var Ua=class extends Le{};Ua.shadowRootOptions={mode:"open"};Ua.getTemplateHTML=OE;l.customElements.get("media-context-menu-item")||l.customElements.define("media-context-menu-item",Ua);var
|
|
3244
|
+
`}var Ua=class extends Le{};Ua.shadowRootOptions={mode:"open"};Ua.getTemplateHTML=OE;l.customElements.get("media-context-menu-item")||l.customElements.define("media-context-menu-item",Ua);var uu=ri.createElement("template");"innerHTML"in uu&&(uu.innerHTML=qm);var Th,yh,zs=class extends Li{};zs.template=(yh=(Th=uu.content)==null?void 0:Th.children)==null?void 0:yh[0];Se.customElements.get("media-theme-gerwig")||Se.customElements.define("media-theme-gerwig",zs);var PE="gerwig",xt={SRC:"src",POSTER:"poster"},m={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"},cu=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","videotitle","novolumepref","nomutedpref","proudlydisplaymuxbadge"];function NE(t,e){var a,r,o;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src||!!t.currentSrc,poster:t.poster,storyboard:((a=t.media)==null?void 0:a.currentSrc)&&t.storyboard,storyboardSrc:t.getAttribute(m.STORYBOARD_SRC),fullscreenElement:t.getAttribute(m.FULLSCREEN_ELEMENT),placeholder:t.getAttribute("placeholder"),themeTemplate:HE(t),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(m.NOHOTKEYS),hotKeys:t.getAttribute(m.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,maxAutoResolution:t.maxAutoResolution,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(b.Attributes.TARGET_LIVE_WINDOW),streamType:Gr(t.getAttribute(b.Attributes.STREAM_TYPE)),primaryColor:t.getAttribute(m.PRIMARY_COLOR),secondaryColor:t.getAttribute(m.SECONDARY_COLOR),accentColor:t.getAttribute(m.ACCENT_COLOR),forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultDuration:t.defaultDuration,defaultShowRemainingTime:t.defaultShowRemainingTime,hideDuration:BE(t),playbackRates:t.getAttribute(m.PLAYBACK_RATES),customDomain:(r=t.getAttribute(b.Attributes.CUSTOM_DOMAIN))!=null?r:void 0,title:t.getAttribute(m.TITLE),videoTitle:(o=t.getAttribute(m.VIDEO_TITLE))!=null?o:t.getAttribute(m.TITLE),novolumepref:t.hasAttribute(m.NO_VOLUME_PREF),nomutedpref:t.hasAttribute(m.NO_MUTED_PREF),proudlyDisplayMuxBadge:t.hasAttribute(m.PROUDLY_DISPLAY_MUX_BADGE),castReceiver:t.castReceiver,disablePseudoEnded:t.hasAttribute(m.DISABLE_PSEUDO_ENDED),capRenditionToPlayerSize:t.capRenditionToPlayerSize,...e,extraSourceParams:t.extraSourceParams}}var UE=Sn.formatErrorMessage;Sn.formatErrorMessage=t=>{var e,i;if(t instanceof b.MediaError){let a=Ym(t,!1);return`
|
|
3244
3245
|
${a!=null&&a.title?`<h3>${a.title}</h3>`:""}
|
|
3245
3246
|
${a!=null&&a.message||a!=null&&a.linkUrl?`<p>
|
|
3246
3247
|
${a==null?void 0:a.message}
|
|
@@ -3252,5 +3253,5 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
3252
3253
|
>${(i=a.linkText)!=null?i:a.linkUrl}</a
|
|
3253
3254
|
>`:""}
|
|
3254
3255
|
</p>`:""}
|
|
3255
|
-
`}return UE(t)};function HE(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=Se.customElements.get(e);if(o!=null&&o.template)return o.template}}function BE(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 kh(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 $E=Object.values(b.Attributes),WE=Object.values(xt),FE=Object.values(m),uu=as(),cu="mux-player",Sh={isDialogOpen:!1},VE={redundant_streams:!0},Eo,Ha,bo,ai,go,Ba,_o,Ao,Oi,$a,Pi,To,W,Dt,Ih,hu,Di,Mh,Lh,Ch,wh,mu=class extends ud{constructor(){super();ae(this,W);ae(this,Eo);ae(this,Ha,!1);ae(this,bo,{});ae(this,ai,!0);ae(this,go,new is(this,"hotkeys"));ae(this,Ba);ae(this,_o,()=>J(this,W,Di).call(this));ae(this,Ao,()=>J(this,W,Di).call(this));ae(this,Oi,()=>J(this,W,Di).call(this));ae(this,$a);ae(this,Pi,{...Sh,onCloseErrorDialog:i=>{var r;((r=i.composedPath()[0])==null?void 0:r.localName)==="media-error-dialog"&&J(this,W,hu).call(this,{isDialogOpen:!1})},onFocusInErrorDialog:i=>{var o;if(((o=i.composedPath()[0])==null?void 0:o.localName)!=="media-error-dialog")return;sd(this,ri.activeElement)||i.preventDefault()}});ae(this,To,i=>{var o;let a=(o=this.media)==null?void 0:o.error;if(!(a instanceof b.MediaError)){let{message:s,code:d}=a!=null?a:{};a=new b.MediaError(s,d)}if(!(a!=null&&a.fatal)){ct(a),a.data&&ct(`${a.name} data:`,a.data);return}let r=_d(a,!1);r.message&&ld(r),Ee(a),a.data&&Ee(`${a.name} data:`,a.data),J(this,W,hu).call(this,{isDialogOpen:!0})});de(this,Eo,(0,O.generatePlayerInitTime)()),this.attachShadow({mode:"open"}),J(this,W,Ih).call(this),this.isConnected&&J(this,W,Dt).call(this)}static get NAME(){return cu}static get VERSION(){return uu}static get observedAttributes(){var i;return[...(i=ud.observedAttributes)!=null?i:[],...WE,...$E,...FE]}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(){J(this,W,Dt).call(this);let i=this.media;i&&(i.metadata=kh(this))}disconnectedCallback(){var i,a,r,o,s,d,u,f;(i=R(this,Ba))==null||i.disconnect(),(a=this.media)==null||a.removeEventListener("streamtypechange",R(this,_o)),(r=this.media)==null||r.removeEventListener("loadstart",R(this,Ao)),this.removeEventListener("error",R(this,To)),this.media&&(this.media.errorTranslator=void 0),(s=(o=this.media)==null?void 0:o.textTracks)==null||s.removeEventListener("addtrack",R(this,Oi)),(u=(d=this.media)==null?void 0:d.textTracks)==null||u.removeEventListener("removetrack",R(this,Oi)),(f=R(this,$a))==null||f.call(this),de(this,$a,void 0),de(this,Ha,!1)}attributeChangedCallback(i,a,r){switch(J(this,W,Dt).call(this),super.attributeChangedCallback(i,a,r),i){case m.HOTKEYS:R(this,go).value=r;break;case m.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&ct((0,O.i18n)("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").toString());break}case m.THUMBNAIL_TOKEN:{if(r){let s=(0,O.parseJwt)(r);if(s){let{aud:d}=s,u=O.MuxJWTAud.THUMBNAIL;d!==u&&ct((0,O.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"thumbnail"}))}}break}case m.STORYBOARD_TOKEN:{if(r){let s=(0,O.parseJwt)(r);if(s){let{aud:d}=s,u=O.MuxJWTAud.STORYBOARD;d!==u&&ct((0,O.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"storyboard"}))}}break}case m.DRM_TOKEN:{if(r){let s=(0,O.parseJwt)(r);if(s){let{aud:d}=s,u=O.MuxJWTAud.DRM;d!==u&&ct((0,O.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")&&Ee((0,O.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&&![O.StreamTypes.LIVE,O.StreamTypes.ON_DEMAND,O.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:ld({file:"invalid-stream-type.md",message:(0,O.i18n)("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===O.StreamTypes.LIVE?this.getAttribute(m.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN;break}case m.FULLSCREEN_ELEMENT:{if(r!=null||r!==a){let s=ri.getElementById(r),d=s==null?void 0:s.querySelector("mux-player");this.mediaController&&s&&d&&(this.mediaController.fullscreenElement=s)}break}case b.Attributes.CAP_RENDITION_TO_PLAYER_SIZE:{(r==null||r!==a)&&(this.capRenditionToPlayerSize=r!=null?!0:void 0);break}}[b.Attributes.PLAYBACK_ID,xt.SRC,m.PLAYBACK_TOKEN].includes(i)&&a!==r&&de(this,Pi,{...R(this,Pi),...Sh}),J(this,W,Di).call(this,{[ym(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 Se.CustomEvent(h.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((r,o)=>{var s;(s=this.mediaController)==null||s.addEventListener(Ie.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 Se.CustomEvent(h.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((a,r)=>{var o;(o=this.mediaController)==null||o.addEventListener(Ie.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?O.CmcdTypeValues.includes(i)?this.setAttribute(b.Attributes.PREFER_CMCD,i):ct(`Invalid value for preferCmcd. Must be one of ${O.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(m.THEME))!=null?i:PE}set theme(i){this.setAttribute(m.THEME,`${i}`)}get themeProps(){let i=this.mediaTheme;if(!i)return;let a={};for(let r of i.getAttributeNames()){if(du.includes(r))continue;let o=i.getAttribute(r);a[ts(r)]=o===""?!0:o}return a}set themeProps(i){var r,o;J(this,W,Dt).call(this);let a={...this.themeProps,...i};for(let s in a){if(du.includes(s))continue;let d=i==null?void 0:i[s];typeof d=="boolean"||d==null?(r=this.mediaTheme)==null||r.toggleAttribute(es(s),!!d):(o=this.mediaTheme)==null||o.setAttribute(es(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=ii(this,xt.SRC))!=null?i:void 0:(a=this.getAttribute(xt.SRC))!=null?a:void 0}set src(i){i?this.setAttribute(xt.SRC,i):this.removeAttribute(xt.SRC)}get poster(){var r;let i=this.getAttribute(xt.POSTER);if(i!=null)return i;let{tokens:a}=this;if(a.playback&&!a.thumbnail){ct("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return Am(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(xt.POSTER,i):this.removeAttribute(xt.POSTER)}get storyboardSrc(){var i;return(i=this.getAttribute(m.STORYBOARD_SRC))!=null?i:void 0}set storyboardSrc(i){i?this.setAttribute(m.STORYBOARD_SRC,i):this.removeAttribute(m.STORYBOARD_SRC)}get storyboard(){let{tokens:i}=this;if(this.storyboardSrc&&!i.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[O.StreamTypes.LIVE,O.StreamTypes.UNKNOWN].includes(this.streamType)||i.playback&&!i.storyboard))return Tm(this.playbackId,{customDomain:this.customDomain,token:i.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(m.AUDIO)}set audio(i){if(!i){this.removeAttribute(m.AUDIO);return}this.setAttribute(m.AUDIO,"")}get hotkeys(){return R(this,go)}get nohotkeys(){return this.hasAttribute(m.NOHOTKEYS)}set nohotkeys(i){if(!i){this.removeAttribute(m.NOHOTKEYS);return}this.setAttribute(m.NOHOTKEYS,"")}get thumbnailTime(){return fe(this.getAttribute(m.THUMBNAIL_TIME))}set thumbnailTime(i){this.setAttribute(m.THUMBNAIL_TIME,`${i}`)}get videoTitle(){var i,a;return(a=(i=this.getAttribute(m.VIDEO_TITLE))!=null?i:this.getAttribute(m.TITLE))!=null?a:""}set videoTitle(i){i!==this.videoTitle&&(i?this.setAttribute(m.VIDEO_TITLE,i):this.removeAttribute(m.VIDEO_TITLE))}get placeholder(){var i;return(i=ii(this,m.PLACEHOLDER))!=null?i:""}set placeholder(i){this.setAttribute(m.PLACEHOLDER,`${i}`)}get primaryColor(){var a,r;let i=this.getAttribute(m.PRIMARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=Se.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),i))return i}set primaryColor(i){this.setAttribute(m.PRIMARY_COLOR,`${i}`)}get secondaryColor(){var a,r;let i=this.getAttribute(m.SECONDARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=Se.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),i))return i}set secondaryColor(i){this.setAttribute(m.SECONDARY_COLOR,`${i}`)}get accentColor(){var a,r;let i=this.getAttribute(m.ACCENT_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=Se.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),i))return i}set accentColor(i){this.setAttribute(m.ACCENT_COLOR,`${i}`)}get defaultShowRemainingTime(){return this.hasAttribute(m.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(i){i?this.setAttribute(m.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(m.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(m.PLAYBACK_RATES))return this.getAttribute(m.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(m.PLAYBACK_RATES);return}this.setAttribute(m.PLAYBACK_RATES,i.join(" "))}get forwardSeekOffset(){var i;return(i=fe(this.getAttribute(m.FORWARD_SEEK_OFFSET)))!=null?i:10}set forwardSeekOffset(i){this.setAttribute(m.FORWARD_SEEK_OFFSET,`${i}`)}get backwardSeekOffset(){var i;return(i=fe(this.getAttribute(m.BACKWARD_SEEK_OFFSET)))!=null?i:10}set backwardSeekOffset(i){this.setAttribute(m.BACKWARD_SEEK_OFFSET,`${i}`)}get defaultHiddenCaptions(){return this.hasAttribute(m.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(i){i?this.setAttribute(m.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(m.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return fe(this.getAttribute(m.DEFAULT_DURATION))}set defaultDuration(i){i==null?this.removeAttribute(m.DEFAULT_DURATION):this.setAttribute(m.DEFAULT_DURATION,`${i}`)}get playerInitTime(){return this.hasAttribute(b.Attributes.PLAYER_INIT_TIME)?fe(this.getAttribute(b.Attributes.PLAYER_INIT_TIME)):R(this,Eo)}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:cu}get playerSoftwareVersion(){var i;return(i=this.getAttribute(b.Attributes.PLAYER_SOFTWARE_VERSION))!=null?i:uu}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 maxAutoResolution(){var i;return(i=this.getAttribute(b.Attributes.MAX_AUTO_RESOLUTION))!=null?i:void 0}set maxAutoResolution(i){i==null?this.removeAttribute(b.Attributes.MAX_AUTO_RESOLUTION):this.setAttribute(b.Attributes.MAX_AUTO_RESOLUTION,i)}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 fe(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 fe(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 fe(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 fe(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(m.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(m.EXTRA_SOURCE_PARAMS)).entries()].reduce((i,[a,r])=>(i[a]=r,i),{}):VE}set extraSourceParams(i){i==null?this.removeAttribute(m.EXTRA_SOURCE_PARAMS):this.setAttribute(m.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=ii(this,b.Attributes.ENV_KEY))!=null?i:void 0}set envKey(i){this.setAttribute(b.Attributes.ENV_KEY,`${i}`)}get noVolumePref(){return this.hasAttribute(m.NO_VOLUME_PREF)}set noVolumePref(i){i?this.setAttribute(m.NO_VOLUME_PREF,""):this.removeAttribute(m.NO_VOLUME_PREF)}get noMutedPref(){return this.hasAttribute(m.NO_MUTED_PREF)}set noMutedPref(i){i?this.setAttribute(m.NO_MUTED_PREF,""):this.removeAttribute(m.NO_MUTED_PREF)}get debug(){return ii(this,b.Attributes.DEBUG)!=null}set debug(i){i?this.setAttribute(b.Attributes.DEBUG,""):this.removeAttribute(b.Attributes.DEBUG)}get disableTracking(){return ii(this,b.Attributes.DISABLE_TRACKING)!=null}set disableTracking(i){this.toggleAttribute(b.Attributes.DISABLE_TRACKING,!!i)}get disableCookies(){return ii(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:O.StreamTypes.UNKNOWN}set streamType(i){this.setAttribute(b.Attributes.STREAM_TYPE,`${i}`)}get defaultStreamType(){var i,a,r;return(r=(a=this.getAttribute(m.DEFAULT_STREAM_TYPE))!=null?a:(i=this.mediaController)==null?void 0:i.getAttribute(m.DEFAULT_STREAM_TYPE))!=null?r:O.StreamTypes.ON_DEMAND}set defaultStreamType(i){i?this.setAttribute(m.DEFAULT_STREAM_TYPE,i):this.removeAttribute(m.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var i,a;return this.hasAttribute(m.TARGET_LIVE_WINDOW)?+this.getAttribute(m.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(m.TARGET_LIVE_WINDOW):this.setAttribute(m.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i;return(i=this.media)==null?void 0:i.liveEdgeStart}get startTime(){return fe(ii(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===O.PlaybackTypes.MSE||i===O.PlaybackTypes.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===O.PlaybackTypes.MSE||i===O.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(J(this,W,Dt).call(this),!this.media){Ee("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...kh(this),...i}}get _hlsConfig(){var i;return(i=this.media)==null?void 0:i._hlsConfig}set _hlsConfig(i){if(J(this,W,Dt).call(this),!this.media){Ee("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(J(this,W,Dt).call(this),!this.media){Ee("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(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(J(this,W,Dt).call(this),!this.media){Ee("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(m.PLAYBACK_TOKEN),a=this.getAttribute(m.DRM_TOKEN),r=this.getAttribute(m.THUMBNAIL_TOKEN),o=this.getAttribute(m.STORYBOARD_TOKEN);return{...R(this,bo),...i!=null?{playback:i}:{},...a!=null?{drm:a}:{},...r!=null?{thumbnail:r}:{},...o!=null?{storyboard:o}:{}}}set tokens(i){de(this,bo,i!=null?i:{})}get playbackToken(){var i;return(i=this.getAttribute(m.PLAYBACK_TOKEN))!=null?i:void 0}set playbackToken(i){this.setAttribute(m.PLAYBACK_TOKEN,`${i}`)}get drmToken(){var i;return(i=this.getAttribute(m.DRM_TOKEN))!=null?i:void 0}set drmToken(i){this.setAttribute(m.DRM_TOKEN,`${i}`)}get thumbnailToken(){var i;return(i=this.getAttribute(m.THUMBNAIL_TOKEN))!=null?i:void 0}set thumbnailToken(i){this.setAttribute(m.THUMBNAIL_TOKEN,`${i}`)}get storyboardToken(){var i;return(i=this.getAttribute(m.STORYBOARD_TOKEN))!=null?i:void 0}set storyboardToken(i){this.setAttribute(m.STORYBOARD_TOKEN,`${i}`)}addTextTrack(i,a,r,o){var d;let s=(d=this.media)==null?void 0:d.nativeEl;if(s)return(0,O.addTextTrack)(s,i,a,r,o)}removeTextTrack(i){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,O.removeTextTrack)(a,i)}get textTracks(){var i;return(i=this.media)==null?void 0:i.textTracks}get castReceiver(){var i;return(i=this.getAttribute(m.CAST_RECEIVER))!=null?i:void 0}set castReceiver(i){i!==this.castReceiver&&(i?this.setAttribute(m.CAST_RECEIVER,i):this.removeAttribute(m.CAST_RECEIVER))}get castCustomData(){var i;return(i=this.media)==null?void 0:i.castCustomData}set castCustomData(i){if(!this.media){Ee("underlying media element missing when trying to set castCustomData. castCustomData will not be set.");return}this.media.castCustomData=i}get noTooltips(){return this.hasAttribute(m.NO_TOOLTIPS)}set noTooltips(i){if(!i){this.removeAttribute(m.NO_TOOLTIPS);return}this.setAttribute(m.NO_TOOLTIPS,"")}get proudlyDisplayMuxBadge(){return this.hasAttribute(m.PROUDLY_DISPLAY_MUX_BADGE)}set proudlyDisplayMuxBadge(i){i?this.setAttribute(m.PROUDLY_DISPLAY_MUX_BADGE,""):this.removeAttribute(m.PROUDLY_DISPLAY_MUX_BADGE)}get capRenditionToPlayerSize(){var i;return(i=this.media)==null?void 0:i.capRenditionToPlayerSize}set capRenditionToPlayerSize(i){if(!this.media){Ee("underlying media element missing when trying to set capRenditionToPlayerSize");return}this.media.capRenditionToPlayerSize=i}};Eo=new WeakMap,Ha=new WeakMap,bo=new WeakMap,ai=new WeakMap,go=new WeakMap,Ba=new WeakMap,_o=new WeakMap,Ao=new WeakMap,Oi=new WeakMap,$a=new WeakMap,Pi=new WeakMap,To=new WeakMap,W=new WeakSet,Dt=function(){var i,a,r,o;if(!R(this,Ha)){de(this,Ha,!0),J(this,W,Di).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof Se.HTMLElement))throw""}catch{Ee("<media-theme> failed to upgrade!")}try{customElements.upgrade(this.media)}catch{Ee("underlying media element failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof gl))throw""}catch{Ee("<media-controller> failed to upgrade!")}J(this,W,Mh).call(this),J(this,W,Lh).call(this),J(this,W,Ch).call(this),de(this,ai,(a=(i=this.mediaController)==null?void 0:i.hasAttribute(I.USER_INACTIVE))!=null?a:!0),J(this,W,wh).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",R(this,_o)),(o=this.media)==null||o.addEventListener("loadstart",R(this,Ao))}},Ih=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{}},hu=function(i){Object.assign(R(this,Pi),i),J(this,W,Di).call(this)},Di=function(i={}){Vm(Km(NE(this,{...R(this,Pi),...i})),this.shadowRoot)},Mh=function(){let i=a=>{var s,d;if(!(a!=null&&a.startsWith("theme-")))return;let r=a.replace(/^theme-/,"");if(du.includes(r))return;let o=this.getAttribute(a);o!=null?(s=this.mediaTheme)==null||s.setAttribute(r,o):(d=this.mediaTheme)==null||d.removeAttribute(r)};de(this,Ba,new MutationObserver(a=>{for(let{attributeName:r}of a)i(r)})),R(this,Ba).observe(this,{attributes:!0}),this.getAttributeNames().forEach(i)},Lh=function(){this.addEventListener("error",R(this,To)),this.media&&(this.media.errorTranslator=(i={})=>{var r,o,s;if(!(((r=this.media)==null?void 0:r.error)instanceof b.MediaError))return i;let a=_d((o=this.media)==null?void 0:o.error,!1);return{player_error_code:(s=this.media)==null?void 0:s.error.code,player_error_message:a.message?String(a.message):i.player_error_message,player_error_context:a.context?String(a.context):i.player_error_context}})},Ch=function(){var i,a,r,o;(a=(i=this.media)==null?void 0:i.textTracks)==null||a.addEventListener("addtrack",R(this,Oi)),(o=(r=this.media)==null?void 0:r.textTracks)==null||o.addEventListener("removetrack",R(this,Oi))},wh=function(){var y,A;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,o=()=>this.streamType===O.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(E,p,k=!1)=>{if(o())return;Array.from(E&&E.activeCues||[]).forEach(S=>{if(!(!S.snapToLines||S.line<-5||S.line>=0&&S.line<10))if(!p||this.paused){let C=S.text.split(`
|
|
3256
|
-
`).length,j=-3;this.streamType===O.StreamTypes.LIVE&&(j=-2);let Ue=j-C;if(S.line===Ue&&!k)return;r.has(S)||r.set(S,S.line),S.line=Ue}else setTimeout(()=>{S.line=r.get(S)||"auto"},500)})},d=()=>{var E,p;s(a,(p=(E=this.mediaController)==null?void 0:E.hasAttribute(I.USER_INACTIVE))!=null?p:!1)},u=()=>{var k,g;let p=Array.from(((g=(k=this.mediaController)==null?void 0:k.media)==null?void 0:g.textTracks)||[]).filter(S=>["subtitles","captions"].includes(S.kind)&&S.mode==="showing")[0];p!==a&&(a==null||a.removeEventListener("cuechange",d)),a=p,a==null||a.addEventListener("cuechange",d),s(a,R(this,ai))};u(),(y=this.textTracks)==null||y.addEventListener("change",u),(A=this.textTracks)==null||A.addEventListener("addtrack",u);let f=()=>{var p,k;let E=(k=(p=this.mediaController)==null?void 0:p.hasAttribute(I.USER_INACTIVE))!=null?k:!0;R(this,ai)!==E&&(de(this,ai,E),s(a,R(this,ai)))};this.addEventListener("userinactivechange",f),de(this,$a,()=>{var E,p;a==null||a.removeEventListener("cuechange",d),(E=this.textTracks)==null||E.removeEventListener("change",u),(p=this.textTracks)==null||p.removeEventListener("addtrack",u),this.removeEventListener("userinactivechange",f)})};function ii(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var KE=
|
|
3256
|
+
`}return UE(t)};function HE(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=Se.customElements.get(e);if(o!=null&&o.template)return o.template}}function BE(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 kh(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 $E=Object.values(b.Attributes),WE=Object.values(xt),FE=Object.values(m),mu=os(),hu="mux-player",Sh={isDialogOpen:!1},VE={redundant_streams:!0},go,Ha,_o,ai,Ao,Ba,To,yo,Oi,$a,Pi,ko,W,Dt,Ih,fu,Di,Mh,Lh,Ch,wh,pu=class extends md{constructor(){super();ae(this,W);ae(this,go);ae(this,Ha,!1);ae(this,_o,{});ae(this,ai,!0);ae(this,Ao,new rs(this,"hotkeys"));ae(this,Ba);ae(this,To,()=>J(this,W,Di).call(this));ae(this,yo,()=>J(this,W,Di).call(this));ae(this,Oi,()=>J(this,W,Di).call(this));ae(this,$a);ae(this,Pi,{...Sh,onCloseErrorDialog:i=>{var r;((r=i.composedPath()[0])==null?void 0:r.localName)==="media-error-dialog"&&J(this,W,fu).call(this,{isDialogOpen:!1})},onFocusInErrorDialog:i=>{var o;if(((o=i.composedPath()[0])==null?void 0:o.localName)!=="media-error-dialog")return;dd(this,ri.activeElement)||i.preventDefault()}});ae(this,ko,i=>{var o;let a=(o=this.media)==null?void 0:o.error;if(!(a instanceof b.MediaError)){let{message:s,code:d}=a!=null?a:{};a=new b.MediaError(s,d)}if(!(a!=null&&a.fatal)){ct(a),a.data&&ct(`${a.name} data:`,a.data);return}let r=Td(a,!1);r.message&&ud(r),Ee(a),a.data&&Ee(`${a.name} data:`,a.data),J(this,W,fu).call(this,{isDialogOpen:!0})});de(this,go,(0,O.generatePlayerInitTime)()),this.attachShadow({mode:"open"}),J(this,W,Ih).call(this),this.isConnected&&J(this,W,Dt).call(this)}static get NAME(){return hu}static get VERSION(){return mu}static get observedAttributes(){var i;return[...(i=md.observedAttributes)!=null?i:[],...WE,...$E,...FE]}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(){J(this,W,Dt).call(this);let i=this.media;i&&(i.metadata=kh(this))}disconnectedCallback(){var i,a,r,o,s,d,u,f;(i=R(this,Ba))==null||i.disconnect(),(a=this.media)==null||a.removeEventListener("streamtypechange",R(this,To)),(r=this.media)==null||r.removeEventListener("loadstart",R(this,yo)),this.removeEventListener("error",R(this,ko)),this.media&&(this.media.errorTranslator=void 0),(s=(o=this.media)==null?void 0:o.textTracks)==null||s.removeEventListener("addtrack",R(this,Oi)),(u=(d=this.media)==null?void 0:d.textTracks)==null||u.removeEventListener("removetrack",R(this,Oi)),(f=R(this,$a))==null||f.call(this),de(this,$a,void 0),de(this,Ha,!1)}attributeChangedCallback(i,a,r){switch(J(this,W,Dt).call(this),super.attributeChangedCallback(i,a,r),i){case m.HOTKEYS:R(this,Ao).value=r;break;case m.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&ct((0,O.i18n)("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").toString());break}case m.THUMBNAIL_TOKEN:{if(r){let s=(0,O.parseJwt)(r);if(s){let{aud:d}=s,u=O.MuxJWTAud.THUMBNAIL;d!==u&&ct((0,O.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"thumbnail"}))}}break}case m.STORYBOARD_TOKEN:{if(r){let s=(0,O.parseJwt)(r);if(s){let{aud:d}=s,u=O.MuxJWTAud.STORYBOARD;d!==u&&ct((0,O.i18n)("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:d,expectedAud:u,tokenNamePrefix:"storyboard"}))}}break}case m.DRM_TOKEN:{if(r){let s=(0,O.parseJwt)(r);if(s){let{aud:d}=s,u=O.MuxJWTAud.DRM;d!==u&&ct((0,O.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")&&Ee((0,O.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&&![O.StreamTypes.LIVE,O.StreamTypes.ON_DEMAND,O.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:ud({file:"invalid-stream-type.md",message:(0,O.i18n)("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===O.StreamTypes.LIVE?this.getAttribute(m.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN;break}case m.FULLSCREEN_ELEMENT:{if(r!=null||r!==a){let s=ri.getElementById(r),d=s==null?void 0:s.querySelector("mux-player");this.mediaController&&s&&d&&(this.mediaController.fullscreenElement=s)}break}case b.Attributes.CAP_RENDITION_TO_PLAYER_SIZE:{(r==null||r!==a)&&(this.capRenditionToPlayerSize=r!=null?!0:void 0);break}}[b.Attributes.PLAYBACK_ID,xt.SRC,m.PLAYBACK_TOKEN].includes(i)&&a!==r&&de(this,Pi,{...R(this,Pi),...Sh}),J(this,W,Di).call(this,{[ym(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 Se.CustomEvent(h.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((r,o)=>{var s;(s=this.mediaController)==null||s.addEventListener(Ie.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 Se.CustomEvent(h.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((a,r)=>{var o;(o=this.mediaController)==null||o.addEventListener(Ie.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?O.CmcdTypeValues.includes(i)?this.setAttribute(b.Attributes.PREFER_CMCD,i):ct(`Invalid value for preferCmcd. Must be one of ${O.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(m.THEME))!=null?i:PE}set theme(i){this.setAttribute(m.THEME,`${i}`)}get themeProps(){let i=this.mediaTheme;if(!i)return;let a={};for(let r of i.getAttributeNames()){if(cu.includes(r))continue;let o=i.getAttribute(r);a[as(r)]=o===""?!0:o}return a}set themeProps(i){var r,o;J(this,W,Dt).call(this);let a={...this.themeProps,...i};for(let s in a){if(cu.includes(s))continue;let d=i==null?void 0:i[s];typeof d=="boolean"||d==null?(r=this.mediaTheme)==null||r.toggleAttribute(is(s),!!d):(o=this.mediaTheme)==null||o.setAttribute(is(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=ii(this,xt.SRC))!=null?i:void 0:(a=this.getAttribute(xt.SRC))!=null?a:void 0}set src(i){i?this.setAttribute(xt.SRC,i):this.removeAttribute(xt.SRC)}get poster(){var r;let i=this.getAttribute(xt.POSTER);if(i!=null)return i;let{tokens:a}=this;if(a.playback&&!a.thumbnail){ct("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return Am(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(xt.POSTER,i):this.removeAttribute(xt.POSTER)}get storyboardSrc(){var i;return(i=this.getAttribute(m.STORYBOARD_SRC))!=null?i:void 0}set storyboardSrc(i){i?this.setAttribute(m.STORYBOARD_SRC,i):this.removeAttribute(m.STORYBOARD_SRC)}get storyboard(){let{tokens:i}=this;if(this.storyboardSrc&&!i.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[O.StreamTypes.LIVE,O.StreamTypes.UNKNOWN].includes(this.streamType)||i.playback&&!i.storyboard))return Tm(this.playbackId,{customDomain:this.customDomain,token:i.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(m.AUDIO)}set audio(i){if(!i){this.removeAttribute(m.AUDIO);return}this.setAttribute(m.AUDIO,"")}get hotkeys(){return R(this,Ao)}get nohotkeys(){return this.hasAttribute(m.NOHOTKEYS)}set nohotkeys(i){if(!i){this.removeAttribute(m.NOHOTKEYS);return}this.setAttribute(m.NOHOTKEYS,"")}get thumbnailTime(){return fe(this.getAttribute(m.THUMBNAIL_TIME))}set thumbnailTime(i){this.setAttribute(m.THUMBNAIL_TIME,`${i}`)}get videoTitle(){var i,a;return(a=(i=this.getAttribute(m.VIDEO_TITLE))!=null?i:this.getAttribute(m.TITLE))!=null?a:""}set videoTitle(i){i!==this.videoTitle&&(i?this.setAttribute(m.VIDEO_TITLE,i):this.removeAttribute(m.VIDEO_TITLE))}get placeholder(){var i;return(i=ii(this,m.PLACEHOLDER))!=null?i:""}set placeholder(i){this.setAttribute(m.PLACEHOLDER,`${i}`)}get primaryColor(){var a,r;let i=this.getAttribute(m.PRIMARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=Se.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),i))return i}set primaryColor(i){this.setAttribute(m.PRIMARY_COLOR,`${i}`)}get secondaryColor(){var a,r;let i=this.getAttribute(m.SECONDARY_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=Se.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),i))return i}set secondaryColor(i){this.setAttribute(m.SECONDARY_COLOR,`${i}`)}get accentColor(){var a,r;let i=this.getAttribute(m.ACCENT_COLOR);if(i!=null||this.mediaTheme&&(i=(r=(a=Se.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),i))return i}set accentColor(i){this.setAttribute(m.ACCENT_COLOR,`${i}`)}get defaultShowRemainingTime(){return this.hasAttribute(m.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(i){i?this.setAttribute(m.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(m.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(m.PLAYBACK_RATES))return this.getAttribute(m.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(m.PLAYBACK_RATES);return}this.setAttribute(m.PLAYBACK_RATES,i.join(" "))}get forwardSeekOffset(){var i;return(i=fe(this.getAttribute(m.FORWARD_SEEK_OFFSET)))!=null?i:10}set forwardSeekOffset(i){this.setAttribute(m.FORWARD_SEEK_OFFSET,`${i}`)}get backwardSeekOffset(){var i;return(i=fe(this.getAttribute(m.BACKWARD_SEEK_OFFSET)))!=null?i:10}set backwardSeekOffset(i){this.setAttribute(m.BACKWARD_SEEK_OFFSET,`${i}`)}get defaultHiddenCaptions(){return this.hasAttribute(m.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(i){i?this.setAttribute(m.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(m.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return fe(this.getAttribute(m.DEFAULT_DURATION))}set defaultDuration(i){i==null?this.removeAttribute(m.DEFAULT_DURATION):this.setAttribute(m.DEFAULT_DURATION,`${i}`)}get playerInitTime(){return this.hasAttribute(b.Attributes.PLAYER_INIT_TIME)?fe(this.getAttribute(b.Attributes.PLAYER_INIT_TIME)):R(this,go)}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:hu}get playerSoftwareVersion(){var i;return(i=this.getAttribute(b.Attributes.PLAYER_SOFTWARE_VERSION))!=null?i:mu}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 maxAutoResolution(){var i;return(i=this.getAttribute(b.Attributes.MAX_AUTO_RESOLUTION))!=null?i:void 0}set maxAutoResolution(i){i==null?this.removeAttribute(b.Attributes.MAX_AUTO_RESOLUTION):this.setAttribute(b.Attributes.MAX_AUTO_RESOLUTION,i)}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 fe(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 fe(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 fe(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 fe(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(m.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(m.EXTRA_SOURCE_PARAMS)).entries()].reduce((i,[a,r])=>(i[a]=r,i),{}):VE}set extraSourceParams(i){i==null?this.removeAttribute(m.EXTRA_SOURCE_PARAMS):this.setAttribute(m.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=ii(this,b.Attributes.ENV_KEY))!=null?i:void 0}set envKey(i){this.setAttribute(b.Attributes.ENV_KEY,`${i}`)}get noVolumePref(){return this.hasAttribute(m.NO_VOLUME_PREF)}set noVolumePref(i){i?this.setAttribute(m.NO_VOLUME_PREF,""):this.removeAttribute(m.NO_VOLUME_PREF)}get noMutedPref(){return this.hasAttribute(m.NO_MUTED_PREF)}set noMutedPref(i){i?this.setAttribute(m.NO_MUTED_PREF,""):this.removeAttribute(m.NO_MUTED_PREF)}get debug(){return ii(this,b.Attributes.DEBUG)!=null}set debug(i){i?this.setAttribute(b.Attributes.DEBUG,""):this.removeAttribute(b.Attributes.DEBUG)}get disableTracking(){return ii(this,b.Attributes.DISABLE_TRACKING)!=null}set disableTracking(i){this.toggleAttribute(b.Attributes.DISABLE_TRACKING,!!i)}get disableCookies(){return ii(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:O.StreamTypes.UNKNOWN}set streamType(i){this.setAttribute(b.Attributes.STREAM_TYPE,`${i}`)}get defaultStreamType(){var i,a,r;return(r=(a=this.getAttribute(m.DEFAULT_STREAM_TYPE))!=null?a:(i=this.mediaController)==null?void 0:i.getAttribute(m.DEFAULT_STREAM_TYPE))!=null?r:O.StreamTypes.ON_DEMAND}set defaultStreamType(i){i?this.setAttribute(m.DEFAULT_STREAM_TYPE,i):this.removeAttribute(m.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var i,a;return this.hasAttribute(m.TARGET_LIVE_WINDOW)?+this.getAttribute(m.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(m.TARGET_LIVE_WINDOW):this.setAttribute(m.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i;return(i=this.media)==null?void 0:i.liveEdgeStart}get startTime(){return fe(ii(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===O.PlaybackTypes.MSE||i===O.PlaybackTypes.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===O.PlaybackTypes.MSE||i===O.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(J(this,W,Dt).call(this),!this.media){Ee("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...kh(this),...i}}get _hlsConfig(){var i;return(i=this.media)==null?void 0:i._hlsConfig}set _hlsConfig(i){if(J(this,W,Dt).call(this),!this.media){Ee("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(J(this,W,Dt).call(this),!this.media){Ee("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(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(J(this,W,Dt).call(this),!this.media){Ee("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(m.PLAYBACK_TOKEN),a=this.getAttribute(m.DRM_TOKEN),r=this.getAttribute(m.THUMBNAIL_TOKEN),o=this.getAttribute(m.STORYBOARD_TOKEN);return{...R(this,_o),...i!=null?{playback:i}:{},...a!=null?{drm:a}:{},...r!=null?{thumbnail:r}:{},...o!=null?{storyboard:o}:{}}}set tokens(i){de(this,_o,i!=null?i:{})}get playbackToken(){var i;return(i=this.getAttribute(m.PLAYBACK_TOKEN))!=null?i:void 0}set playbackToken(i){this.setAttribute(m.PLAYBACK_TOKEN,`${i}`)}get drmToken(){var i;return(i=this.getAttribute(m.DRM_TOKEN))!=null?i:void 0}set drmToken(i){this.setAttribute(m.DRM_TOKEN,`${i}`)}get thumbnailToken(){var i;return(i=this.getAttribute(m.THUMBNAIL_TOKEN))!=null?i:void 0}set thumbnailToken(i){this.setAttribute(m.THUMBNAIL_TOKEN,`${i}`)}get storyboardToken(){var i;return(i=this.getAttribute(m.STORYBOARD_TOKEN))!=null?i:void 0}set storyboardToken(i){this.setAttribute(m.STORYBOARD_TOKEN,`${i}`)}addTextTrack(i,a,r,o){var d;let s=(d=this.media)==null?void 0:d.nativeEl;if(s)return(0,O.addTextTrack)(s,i,a,r,o)}removeTextTrack(i){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,O.removeTextTrack)(a,i)}get textTracks(){var i;return(i=this.media)==null?void 0:i.textTracks}get castReceiver(){var i;return(i=this.getAttribute(m.CAST_RECEIVER))!=null?i:void 0}set castReceiver(i){i!==this.castReceiver&&(i?this.setAttribute(m.CAST_RECEIVER,i):this.removeAttribute(m.CAST_RECEIVER))}get castCustomData(){var i;return(i=this.media)==null?void 0:i.castCustomData}set castCustomData(i){if(!this.media){Ee("underlying media element missing when trying to set castCustomData. castCustomData will not be set.");return}this.media.castCustomData=i}get noTooltips(){return this.hasAttribute(m.NO_TOOLTIPS)}set noTooltips(i){if(!i){this.removeAttribute(m.NO_TOOLTIPS);return}this.setAttribute(m.NO_TOOLTIPS,"")}get proudlyDisplayMuxBadge(){return this.hasAttribute(m.PROUDLY_DISPLAY_MUX_BADGE)}set proudlyDisplayMuxBadge(i){i?this.setAttribute(m.PROUDLY_DISPLAY_MUX_BADGE,""):this.removeAttribute(m.PROUDLY_DISPLAY_MUX_BADGE)}get capRenditionToPlayerSize(){var i;return(i=this.media)==null?void 0:i.capRenditionToPlayerSize}set capRenditionToPlayerSize(i){if(!this.media){Ee("underlying media element missing when trying to set capRenditionToPlayerSize");return}this.media.capRenditionToPlayerSize=i}};go=new WeakMap,Ha=new WeakMap,_o=new WeakMap,ai=new WeakMap,Ao=new WeakMap,Ba=new WeakMap,To=new WeakMap,yo=new WeakMap,Oi=new WeakMap,$a=new WeakMap,Pi=new WeakMap,ko=new WeakMap,W=new WeakSet,Dt=function(){var i,a,r,o;if(!R(this,Ha)){de(this,Ha,!0),J(this,W,Di).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof Se.HTMLElement))throw""}catch{Ee("<media-theme> failed to upgrade!")}try{customElements.upgrade(this.media)}catch{Ee("underlying media element failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof Al))throw""}catch{Ee("<media-controller> failed to upgrade!")}J(this,W,Mh).call(this),J(this,W,Lh).call(this),J(this,W,Ch).call(this),de(this,ai,(a=(i=this.mediaController)==null?void 0:i.hasAttribute(I.USER_INACTIVE))!=null?a:!0),J(this,W,wh).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",R(this,To)),(o=this.media)==null||o.addEventListener("loadstart",R(this,yo))}},Ih=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{}},fu=function(i){Object.assign(R(this,Pi),i),J(this,W,Di).call(this)},Di=function(i={}){Vm(Km(NE(this,{...R(this,Pi),...i})),this.shadowRoot)},Mh=function(){let i=a=>{var s,d;if(!(a!=null&&a.startsWith("theme-")))return;let r=a.replace(/^theme-/,"");if(cu.includes(r))return;let o=this.getAttribute(a);o!=null?(s=this.mediaTheme)==null||s.setAttribute(r,o):(d=this.mediaTheme)==null||d.removeAttribute(r)};de(this,Ba,new MutationObserver(a=>{for(let{attributeName:r}of a)i(r)})),R(this,Ba).observe(this,{attributes:!0}),this.getAttributeNames().forEach(i)},Lh=function(){this.addEventListener("error",R(this,ko)),this.media&&(this.media.errorTranslator=(i={})=>{var r,o,s;if(!(((r=this.media)==null?void 0:r.error)instanceof b.MediaError))return i;let a=Td((o=this.media)==null?void 0:o.error,!1);return{player_error_code:(s=this.media)==null?void 0:s.error.code,player_error_message:a.message?String(a.message):i.player_error_message,player_error_context:a.context?String(a.context):i.player_error_context}})},Ch=function(){var i,a,r,o;(a=(i=this.media)==null?void 0:i.textTracks)==null||a.addEventListener("addtrack",R(this,Oi)),(o=(r=this.media)==null?void 0:r.textTracks)==null||o.addEventListener("removetrack",R(this,Oi))},wh=function(){var y,A;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,o=()=>this.streamType===O.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(E,p,k=!1)=>{if(o())return;Array.from(E&&E.activeCues||[]).forEach(S=>{if(!(!S.snapToLines||S.line<-5||S.line>=0&&S.line<10))if(!p||this.paused){let C=S.text.split(`
|
|
3257
|
+
`).length,j=-3;this.streamType===O.StreamTypes.LIVE&&(j=-2);let Ue=j-C;if(S.line===Ue&&!k)return;r.has(S)||r.set(S,S.line),S.line=Ue}else setTimeout(()=>{S.line=r.get(S)||"auto"},500)})},d=()=>{var E,p;s(a,(p=(E=this.mediaController)==null?void 0:E.hasAttribute(I.USER_INACTIVE))!=null?p:!1)},u=()=>{var k,g;let p=Array.from(((g=(k=this.mediaController)==null?void 0:k.media)==null?void 0:g.textTracks)||[]).filter(S=>["subtitles","captions"].includes(S.kind)&&S.mode==="showing")[0];p!==a&&(a==null||a.removeEventListener("cuechange",d)),a=p,a==null||a.addEventListener("cuechange",d),s(a,R(this,ai))};u(),(y=this.textTracks)==null||y.addEventListener("change",u),(A=this.textTracks)==null||A.addEventListener("addtrack",u);let f=()=>{var p,k;let E=(k=(p=this.mediaController)==null?void 0:p.hasAttribute(I.USER_INACTIVE))!=null?k:!0;R(this,ai)!==E&&(de(this,ai,E),s(a,R(this,ai)))};this.addEventListener("userinactivechange",f),de(this,$a,()=>{var E,p;a==null||a.removeEventListener("cuechange",d),(E=this.textTracks)==null||E.removeEventListener("change",u),(p=this.textTracks)==null||p.removeEventListener("addtrack",u),this.removeEventListener("userinactivechange",f)})};function ii(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var KE=pu;
|