@mux/mux-player 1.14.1 → 1.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +30 -30
- package/dist/index.mjs +1 -1
- package/dist/mux-player.js +70 -70
- package/dist/mux-player.mjs +70 -70
- package/dist/themes/2023/index.cjs.js +80 -1
- package/dist/themes/2023/index.js +80 -1
- package/dist/themes/2023/index.mjs +80 -1
- package/dist/themes/classic/index.cjs.js +80 -1
- package/dist/themes/classic/index.js +80 -1
- package/dist/themes/classic/index.mjs +80 -1
- package/dist/themes/microvideo/index.cjs.js +80 -1
- package/dist/themes/microvideo/index.js +80 -1
- package/dist/themes/microvideo/index.mjs +80 -1
- package/dist/themes/minimal/index.cjs.js +80 -1
- package/dist/themes/minimal/index.js +80 -1
- package/dist/themes/minimal/index.mjs +80 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -4
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Pd=Object.create;var qi=Object.defineProperty;var Bd=Object.getOwnPropertyDescriptor;var $d=Object.getOwnPropertyNames;var Vd=Object.getPrototypeOf,Hd=Object.prototype.hasOwnProperty;var Wd=(i,e)=>{for(var t in e)qi(i,t,{get:e[t],enumerable:!0})},eo=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of $d(e))!Hd.call(i,r)&&r!==t&&qi(i,r,{get:()=>e[r],enumerable:!(a=Bd(e,r))||a.enumerable});return i};var Fd=(i,e,t)=>(t=i!=null?Pd(Vd(i)):{},eo(e||!i||!i.__esModule?qi(t,"default",{value:i,enumerable:!0}):t,i)),Kd=i=>eo(qi({},"__esModule",{value:!0}),i);var Wr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var k=(i,e,t)=>(Wr(i,e,"read from private field"),t?t.call(i):e.get(i)),W=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},le=(i,e,t,a)=>(Wr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var K=(i,e,t)=>(Wr(i,e,"access private method"),t);var vm={};Wd(vm,{MediaError:()=>g.MediaError,default:()=>Em,getVideoAttribute:()=>St});module.exports=Kd(vm);var Ct=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Ct{}globalThis.DocumentFragment=i}var si=class extends Ct{},Fr=class extends Ct{},Yd={get(i){},define(i,e,t){},upgrade(i){},whenDefined(i){return Promise.resolve(si)}},oi,Kr=class{constructor(e,t={}){W(this,oi,void 0);le(this,oi,t==null?void 0:t.detail)}get detail(){return k(this,oi)}initCustomEvent(){}};oi=new WeakMap;function Gd(i,e){return new si}var to={document:{createElement:Gd},DocumentFragment,customElements:Yd,CustomEvent:Kr,EventTarget:Ct,HTMLElement:si,HTMLVideoElement:Fr},io=typeof window=="undefined"||typeof globalThis.customElements=="undefined",B=io?to:globalThis,ne=io?to.document:globalThis.document;var v={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},A={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},lt={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_PAUSED:"mediaPaused",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_ENDED:"mediaEnded",MEDIA_MUTED:"mediaMuted",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_IS_PIP:"mediaIsPip",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_LOADING:"mediaLoading",MEDIA_BUFFERED:"mediaBuffered",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled"},ao=Object.entries(lt),s=ao.reduce((i,[e,t])=>(i[e]=`${t.toLowerCase()}`,i),{}),Rt=ao.reduce((i,[e,t])=>(i[e]=`${t.toLowerCase()}`,i),{USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange"}),Am=Object.entries(Rt).reduce((i,[e,t])=>{let a=s[e];return a&&(i[t]=a),i},{userinactivechange:"userinactive"}),ro=Object.entries(s).reduce((i,[e,t])=>{let a=Rt[e];return a&&(i[t]=a),i},{userinactive:"userinactivechange"}),wt={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Qi={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Yr={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},se={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},he={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Q={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:i=1}={})=>`current playback rate ${i}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading"},O={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",AIRPLAY:()=>"air play",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:i=30}={})=>`seek forward ${i} seconds`,SEEK_BACK_N_SECS:({seekOffset:i=30}={})=>`seek back ${i} seconds`,SEEK_LIVE:()=>"seek to live",PLAYING_LIVE:()=>"playing live"},qd={...Q,...O};function no(i){return i==null?void 0:i.map(Qd).join(" ")}function so(i){return i==null?void 0:i.split(/\s+/).map(zd)}function Qd(i){if(i){let{id:e,width:t,height:a}=i;return[e,t,a].filter(r=>r!=null).join(":")}}function zd(i){if(i){let[e,t,a]=i.split(":");return{id:e,width:t,height:a}}}function oo(i){return i==null?void 0:i.map(Xd).join(" ")}function lo(i){return i==null?void 0:i.split(/\s+/).map(Jd)}function Xd(i){if(i){let{id:e,kind:t,language:a,label:r}=i;return[e,t,a,r].filter(n=>n!=null).join(":")}}function Jd(i){if(i){let[e,t,a,r]=i.split(":");return{id:e,kind:t,language:a,label:r}}}function zi(i,e=!1){return i.split("_").map(function(t,a){return(a||e?t[0].toUpperCase():t[0].toLowerCase())+t.slice(1).toLowerCase()}).join("")}function uo(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function co(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function Xi(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var Ji=i=>new Promise(e=>setTimeout(e,i));var mo=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],jd=(i,e)=>{let t=i===1?mo[e].singular:mo[e].plural;return`${i} ${t}`},dt=i=>{if(!co(i))return"";let e=Math.abs(i),t=e!==i,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((d,u)=>d&&jd(d,u)).filter(d=>d).join(", ")}${t?" remaining":""}`};function Ae(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let a=Math.floor(i%60),r=Math.floor(i/60%60),n=Math.floor(i/3600),o=Math.floor(e/60%60),d=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=a="0"),n=n>0||d>0?n+":":"",r=((n||o>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+n+r+a}var Im=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});var ji=(i,e,t=".value")=>{let a=i.querySelector(t);!a||(a.textContent=e)},tu=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},ea=(i,e)=>tu(i,e)[0],li=(i,e)=>!i||!e?!1:i.contains(e)?!0:li(i,e.getRootNode().host),ut=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||ut(i.getRootNode().host,e)};function N(i,e){var t;let a;for(a of i.querySelectorAll("style")){let r;try{r=(t=a.sheet)==null?void 0:t.cssRules}catch{continue}for(let n of r!=null?r:[])if(n.selectorText===e)return n}return a!=null&&a.sheet?(a.sheet.insertRule(`${e}{}`,a.sheet.cssRules.length),a.sheet.cssRules[a.sheet.cssRules.length-1]):{style:{setProperty:()=>{},removeProperty:()=>{}}}}function S(i,e,t=Number.NaN){let a=i.getAttribute(e);return a!=null?+a:t}function x(i,e,t){let a=+t;if(t==null||Number.isNaN(a)){i.hasAttribute(e)&&i.removeAttribute(e);return}S(i,e,void 0)!==a&&i.setAttribute(e,`${a}`)}function D(i,e){return i.hasAttribute(e)}function R(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}D(i,e)!=t&&i.toggleAttribute(e,t)}function w(i,e,t=null){var a;return(a=i.getAttribute(e))!=null?a:t}function M(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let a=`${t}`;w(i,e,void 0)!==a&&i.setAttribute(e,a)}var ta=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Gr=class{observe(){}},ho={createElement:function(){return new Zr.HTMLElement},addEventListener(){},removeEventListener(){}},Zr={ResizeObserver:Gr,document:ho,HTMLElement:class extends ta{},DocumentFragment:class extends ta{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){},getComputedStyle:function(){}},po=typeof window=="undefined"||typeof window.customElements=="undefined",Eo=Object.keys(Zr).every(i=>i in globalThis),l=po&&!Eo?Zr:globalThis,m=po&&!Eo?ho:globalThis.document;var iu=Object.defineProperty,au=(i,e,t)=>e in i?iu(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,ru=(i,e,t)=>(au(i,typeof e!="symbol"?e+"":e,t),t),vo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},de=(i,e,t)=>(vo(i,e,"read from private field"),t?t.call(i):e.get(i)),ia=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},aa=(i,e,t,a)=>(vo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),_e,ra,Dt,na,bo=m.createElement("template");bo.innerHTML=`
|
|
1
|
+
"use strict";var Pd=Object.create;var qi=Object.defineProperty;var Bd=Object.getOwnPropertyDescriptor;var $d=Object.getOwnPropertyNames;var Vd=Object.getPrototypeOf,Hd=Object.prototype.hasOwnProperty;var Wd=(i,e)=>{for(var t in e)qi(i,t,{get:e[t],enumerable:!0})},eo=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of $d(e))!Hd.call(i,r)&&r!==t&&qi(i,r,{get:()=>e[r],enumerable:!(a=Bd(e,r))||a.enumerable});return i};var Fd=(i,e,t)=>(t=i!=null?Pd(Vd(i)):{},eo(e||!i||!i.__esModule?qi(t,"default",{value:i,enumerable:!0}):t,i)),Kd=i=>eo(qi({},"__esModule",{value:!0}),i);var Wr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var k=(i,e,t)=>(Wr(i,e,"read from private field"),t?t.call(i):e.get(i)),W=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},le=(i,e,t,a)=>(Wr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var K=(i,e,t)=>(Wr(i,e,"access private method"),t);var vm={};Wd(vm,{MediaError:()=>g.MediaError,default:()=>Em,getVideoAttribute:()=>Mt});module.exports=Kd(vm);var Rt=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Rt{}globalThis.DocumentFragment=i}var si=class extends Rt{},Fr=class extends Rt{},Yd={get(i){},define(i,e,t){},upgrade(i){},whenDefined(i){return Promise.resolve(si)}},oi,Kr=class{constructor(e,t={}){W(this,oi,void 0);le(this,oi,t==null?void 0:t.detail)}get detail(){return k(this,oi)}initCustomEvent(){}};oi=new WeakMap;function Gd(i,e){return new si}var to={document:{createElement:Gd},DocumentFragment,customElements:Yd,CustomEvent:Kr,EventTarget:Rt,HTMLElement:si,HTMLVideoElement:Fr},io=typeof window=="undefined"||typeof globalThis.customElements=="undefined",B=io?to:globalThis,ne=io?to.document:globalThis.document;var v={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},A={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},dt={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_PAUSED:"mediaPaused",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_ENDED:"mediaEnded",MEDIA_MUTED:"mediaMuted",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_IS_PIP:"mediaIsPip",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_LOADING:"mediaLoading",MEDIA_BUFFERED:"mediaBuffered",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled"},ao=Object.entries(dt),s=ao.reduce((i,[e,t])=>(i[e]=`${t.toLowerCase()}`,i),{}),xe=ao.reduce((i,[e,t])=>(i[e]=`${t.toLowerCase()}`,i),{USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"}),Am=Object.entries(xe).reduce((i,[e,t])=>{let a=s[e];return a&&(i[t]=a),i},{userinactivechange:"userinactive"}),ro=Object.entries(s).reduce((i,[e,t])=>{let a=xe[e];return a&&(i[t]=a),i},{userinactive:"userinactivechange"}),wt={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Qi={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Yr={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},se={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},he={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Q={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:i=1}={})=>`current playback rate ${i}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading"},O={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",AIRPLAY:()=>"air play",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:i=30}={})=>`seek forward ${i} seconds`,SEEK_BACK_N_SECS:({seekOffset:i=30}={})=>`seek back ${i} seconds`,SEEK_LIVE:()=>"seek to live",PLAYING_LIVE:()=>"playing live"},qd={...Q,...O};function no(i){return i==null?void 0:i.map(Qd).join(" ")}function so(i){return i==null?void 0:i.split(/\s+/).map(zd)}function Qd(i){if(i){let{id:e,width:t,height:a}=i;return[e,t,a].filter(r=>r!=null).join(":")}}function zd(i){if(i){let[e,t,a]=i.split(":");return{id:e,width:t,height:a}}}function oo(i){return i==null?void 0:i.map(Xd).join(" ")}function lo(i){return i==null?void 0:i.split(/\s+/).map(Jd)}function Xd(i){if(i){let{id:e,kind:t,language:a,label:r}=i;return[e,t,a,r].filter(n=>n!=null).join(":")}}function Jd(i){if(i){let[e,t,a,r]=i.split(":");return{id:e,kind:t,language:a,label:r}}}function zi(i,e=!1){return i.split("_").map(function(t,a){return(a||e?t[0].toUpperCase():t[0].toLowerCase())+t.slice(1).toLowerCase()}).join("")}function uo(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function co(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function Xi(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var Ji=i=>new Promise(e=>setTimeout(e,i));var mo=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],jd=(i,e)=>{let t=i===1?mo[e].singular:mo[e].plural;return`${i} ${t}`},ut=i=>{if(!co(i))return"";let e=Math.abs(i),t=e!==i,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((d,u)=>d&&jd(d,u)).filter(d=>d).join(", ")}${t?" remaining":""}`};function Ae(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let a=Math.floor(i%60),r=Math.floor(i/60%60),n=Math.floor(i/3600),o=Math.floor(e/60%60),d=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=a="0"),n=n>0||d>0?n+":":"",r=((n||o>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+n+r+a}var Im=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});var ji=(i,e,t=".value")=>{let a=i.querySelector(t);!a||(a.textContent=e)},tu=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},ea=(i,e)=>tu(i,e)[0],li=(i,e)=>!i||!e?!1:i.contains(e)?!0:li(i,e.getRootNode().host),ct=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||ct(i.getRootNode().host,e)};function N(i,e){var t;let a;for(a of i.querySelectorAll("style")){let r;try{r=(t=a.sheet)==null?void 0:t.cssRules}catch{continue}for(let n of r!=null?r:[])if(n.selectorText===e)return n}return a!=null&&a.sheet?(a.sheet.insertRule(`${e}{}`,a.sheet.cssRules.length),a.sheet.cssRules[a.sheet.cssRules.length-1]):{style:{setProperty:()=>{},removeProperty:()=>{}}}}function S(i,e,t=Number.NaN){let a=i.getAttribute(e);return a!=null?+a:t}function x(i,e,t){let a=+t;if(t==null||Number.isNaN(a)){i.hasAttribute(e)&&i.removeAttribute(e);return}S(i,e,void 0)!==a&&i.setAttribute(e,`${a}`)}function D(i,e){return i.hasAttribute(e)}function R(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}D(i,e)!=t&&i.toggleAttribute(e,t)}function w(i,e,t=null){var a;return(a=i.getAttribute(e))!=null?a:t}function M(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let a=`${t}`;w(i,e,void 0)!==a&&i.setAttribute(e,a)}var ta=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Gr=class{observe(){}},ho={createElement:function(){return new Zr.HTMLElement},addEventListener(){},removeEventListener(){}},Zr={ResizeObserver:Gr,document:ho,HTMLElement:class extends ta{},DocumentFragment:class extends ta{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){},getComputedStyle:function(){}},po=typeof window=="undefined"||typeof window.customElements=="undefined",Eo=Object.keys(Zr).every(i=>i in globalThis),l=po&&!Eo?Zr:globalThis,m=po&&!Eo?ho:globalThis.document;var iu=Object.defineProperty,au=(i,e,t)=>e in i?iu(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,ru=(i,e,t)=>(au(i,typeof e!="symbol"?e+"":e,t),t),vo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},de=(i,e,t)=>(vo(i,e,"read from private field"),t?t.call(i):e.get(i)),ia=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},aa=(i,e,t,a)=>(vo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),_e,ra,Dt,na,bo=m.createElement("template");bo.innerHTML=`
|
|
2
2
|
<style>
|
|
3
3
|
:host {
|
|
4
4
|
font: var(--media-font,
|
|
@@ -67,14 +67,14 @@
|
|
|
67
67
|
<slot name="enter">${su}</slot>
|
|
68
68
|
<slot name="exit">${ou}</slot>
|
|
69
69
|
</slot>
|
|
70
|
-
`;var go=i=>{let t=i.getAttribute(s.MEDIA_IS_CASTING)!=null?O.EXIT_CAST():O.ENTER_CAST();i.setAttribute("aria-label",t)},Qr=class extends L{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_CASTING,s.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Ao,...e})}connectedCallback(){go(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===s.MEDIA_IS_CASTING&&go(this),super.attributeChangedCallback(e,t,a)}get mediaIsCasting(){return D(this,s.MEDIA_IS_CASTING)}set mediaIsCasting(e){R(this,s.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return w(this,s.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){M(this,s.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?v.MEDIA_EXIT_CAST_REQUEST:v.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-cast-button")||l.customElements.define("media-cast-button",Qr);var _o=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},
|
|
70
|
+
`;var go=i=>{let t=i.getAttribute(s.MEDIA_IS_CASTING)!=null?O.EXIT_CAST():O.ENTER_CAST();i.setAttribute("aria-label",t)},Qr=class extends L{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_IS_CASTING,s.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Ao,...e})}connectedCallback(){go(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===s.MEDIA_IS_CASTING&&go(this),super.attributeChangedCallback(e,t,a)}get mediaIsCasting(){return D(this,s.MEDIA_IS_CASTING)}set mediaIsCasting(e){R(this,s.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return w(this,s.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){M(this,s.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?v.MEDIA_EXIT_CAST_REQUEST:v.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-cast-button")||l.customElements.define("media-cast-button",Qr);var _o=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ge=(i,e,t)=>(_o(i,e,"read from private field"),t?t.call(i):e.get(i)),lu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},sa=(i,e,t,a)=>(_o(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),te,yo=m.createElement("template");yo.innerHTML=`
|
|
71
71
|
<style>
|
|
72
72
|
:host {
|
|
73
73
|
display: var(--media-control-display, var(--media-gesture-receiver-display, inline-block));
|
|
74
74
|
box-sizing: border-box;
|
|
75
75
|
}
|
|
76
76
|
</style>
|
|
77
|
-
`;var zr=class extends l.HTMLElement{constructor(e={}){if(super(),lu(this,te,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=yo.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=m.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a)}}static get observedAttributes(){return[A.MEDIA_CONTROLLER,s.MEDIA_PAUSED]}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===A.MEDIA_CONTROLLER&&(t&&((n=(r=
|
|
77
|
+
`;var zr=class extends l.HTMLElement{constructor(e={}){if(super(),lu(this,te,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=yo.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=m.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a)}}static get observedAttributes(){return[A.MEDIA_CONTROLLER,s.MEDIA_PAUSED]}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===A.MEDIA_CONTROLLER&&(t&&((n=(r=Ge(this,te))==null?void 0:r.unassociateElement)==null||n.call(r,this),sa(this,te,null)),a&&(sa(this,te,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=Ge(this,te))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),sa(this,te,du(this)),this.getAttribute(A.MEDIA_CONTROLLER)&&((t=(e=Ge(this,te))==null?void 0:e.associateElement)==null||t.call(e,this)),(a=Ge(this,te))==null||a.addEventListener("pointerdown",this),(r=Ge(this,te))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,t,a,r;this.getAttribute(A.MEDIA_CONTROLLER)&&((t=(e=Ge(this,te))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(a=Ge(this,te))==null||a.removeEventListener("pointerdown",this),(r=Ge(this,te))==null||r.removeEventListener("click",this),sa(this,te,null)}handleEvent(e){var t;let a=(t=e.composedPath())==null?void 0:t[0];if(!!["video","media-controller"].includes(a==null?void 0:a.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:n,clientY:o}=e,{left:d,top:u,width:c,height:h}=this.getBoundingClientRect(),f=n-d,b=o-u;if(f<0||b<0||f>c||b>h||c===0&&h===0)return;let{pointerType:T=this._pointerType}=e;if(this._pointerType=void 0,T===Yr.TOUCH){this.handleTap(e);return}else if(T===Yr.MOUSE){this.handleMouseClick(e);return}}}}get mediaPaused(){return D(this,s.MEDIA_PAUSED)}set mediaPaused(e){R(this,s.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?v.MEDIA_PLAY_REQUEST:v.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(t,{composed:!0,bubbles:!0}))}};te=new WeakMap;function du(i){var e;let t=i.getAttribute(A.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):ct(i,"media-controller")}l.customElements.get("media-gesture-receiver")||l.customElements.define("media-gesture-receiver",zr);var uu=Object.defineProperty,cu=(i,e,t)=>e in i?uu(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,mu=(i,e,t)=>(cu(i,typeof e!="symbol"?e+"":e,t),t),C={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive"},To=m.createElement("template");To.innerHTML=`
|
|
78
78
|
<style>
|
|
79
79
|
|
|
80
80
|
:host([${s.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
|
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
|
|
200
200
|
<slot part="bottom chrome"></slot>
|
|
201
201
|
</span>
|
|
202
|
-
`;var hu=Object.values(s),pu="sm:384 md:576 lg:768 xl:960";function Eu(i){for(let e of i)vu(e.target,e.contentRect.width)}function vu(i,e){var t;if(!i.isConnected)return;let a=(t=i.getAttribute(C.BREAKPOINTS))!=null?t:pu,r=bu(a),n=fu(r,e),o=!1;if(Object.keys(r).forEach(d=>{if(n.includes(d)){i.hasAttribute(`breakpoint${d}`)||(i.setAttribute(`breakpoint${d}`,""),o=!0);return}i.hasAttribute(`breakpoint${d}`)&&(i.removeAttribute(`breakpoint${d}`),o=!0)}),o){let d=new CustomEvent(Rt.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(d)}}function bu(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function fu(i,e){return Object.keys(i).filter(t=>e>=i[t])}var oa=class extends l.HTMLElement{constructor(){super(),mu(this,"breakpointsUncomputed",!0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(To.content.cloneNode(!0)));let e=u=>{let c=this.media;for(let h of u)h.type==="childList"&&(h.removedNodes.forEach(f=>{if(f.slot=="media"&&h.target==this){let b=h.previousSibling&&h.previousSibling.previousElementSibling;if(!b||!c)this.mediaUnsetCallback(f);else{let T=b.slot!=="media";for(;(b=b.previousSibling)!==null;)b.slot=="media"&&(T=!1);T&&this.mediaUnsetCallback(f)}}}),c&&h.addedNodes.forEach(f=>{f==c&&this.handleMediaUpdated(c).then(b=>this.mediaSetCallback(b))}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let a=!1,r=u=>{a||(setTimeout(()=>{Eu(u),a=!1,this.breakpointsUncomputed=!1},0),a=!0)},n=new ResizeObserver(r);this.resizeObserver=n,n.observe(this);let o=this.media,d=this.querySelector(":scope > slot[slot=media]");d&&d.addEventListener("slotchange",()=>{if(!d.assignedElements({flatten:!0}).length){this.mediaUnsetCallback(o);return}this.media&&(o=this.media,this.handleMediaUpdated(this.media).then(c=>this.mediaSetCallback(c)))})}static get observedAttributes(){return[C.AUTOHIDE,C.GESTURES_DISABLED].concat(hu).filter(e=>![s.MEDIA_RENDITION_LIST,s.MEDIA_AUDIO_TRACK_LIST].includes(e))}attributeChangedCallback(e,t,a){e.toLowerCase()==C.AUTOHIDE&&(this.autohide=a)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}mediaSetCallback(e){this._mediaClickPlayToggle=()=>{let t=e.paused?v.MEDIA_PLAY_REQUEST:v.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(t,{composed:!0,bubbles:!0}))}}handleMediaUpdated(e){let t=n=>Promise.resolve(n),a=n=>(console.error('<media-chrome>: Media element set with slot="media" does not appear to be compatible.',n),Promise.reject(n));if(!e)return a(e);let r=e.nodeName.toLowerCase();return r.includes("-")?l.customElements.whenDefined(r).then(()=>t(e)):t(e)}mediaUnsetCallback(e){}connectedCallback(){var e;let a=this.getAttribute(C.AUDIO)!=null?Q.AUDIO_PLAYER():Q.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.media&&this.handleMediaUpdated(this.media).then(d=>this.mediaSetCallback(d)),this.setAttribute(C.USER_INACTIVE,"");let r=()=>{if(this.autohide<0||this.hasAttribute(C.USER_INACTIVE))return;this.setAttribute(C.USER_INACTIVE,"");let d=new l.CustomEvent(Rt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(d)},n=()=>{if(!this.hasAttribute(C.USER_INACTIVE))return;this.removeAttribute(C.USER_INACTIVE);let d=new l.CustomEvent(Rt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(d)},o=()=>{n(),clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=setTimeout(()=>{r()},this.autohide*1e3))};this.addEventListener("keyup",()=>{o()}),this.addEventListener("pointerup",d=>{d.pointerType==="touch"?[this,this.media].includes(d.target)&&!this.hasAttribute(C.USER_INACTIVE)?r():o():d.composedPath().some(u=>{var c;return["media-play-button","media-fullscreen-button"].includes((c=u==null?void 0:u.nodeName)==null?void 0:c.toLowerCase())})&&o()}),this.addEventListener("pointermove",d=>{d.pointerType==="mouse"&&(n(),clearTimeout(this._inactiveTimeout),[this,this.media].includes(d.target)&&o())}),this.addEventListener("mouseleave",()=>{r()}),this.addEventListener("keyup",()=>{this.setAttribute(C.KEYBOARD_CONTROL,"")}),(e=l.window)==null||e.addEventListener("mouseup",()=>{this.removeAttribute(C.KEYBOARD_CONTROL)})}set autohide(e){e=Number(e),this._autohide=isNaN(e)?0:e}get autohide(){return this._autohide===void 0?2:this._autohide}};var Io=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Y=(i,e,t)=>(Io(i,e,"read from private field"),t?t.call(i):e.get(i)),di=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},la=(i,e,t,a)=>(Io(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),xt,Ot,da,ct,xe,Ge,Ze=class{constructor(e,t,{defaultValue:a}={defaultValue:void 0}){di(this,xe),di(this,xt,void 0),di(this,Ot,void 0),di(this,da,void 0),di(this,ct,new Set),la(this,xt,e),la(this,Ot,t),la(this,da,new Set(a))}[Symbol.iterator](){return Y(this,xe,Ge).values()}get length(){return Y(this,xe,Ge).size}get value(){var e;return(e=[...Y(this,xe,Ge)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(la(this,ct,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...Y(this,xe,Ge)][e]}values(){return Y(this,xe,Ge).values()}forEach(e){Y(this,xe,Ge).forEach(e)}add(...e){var t,a;e.forEach(r=>Y(this,ct).add(r)),!(this.value===""&&!((t=Y(this,xt))!=null&&t.hasAttribute(`${Y(this,Ot)}`)))&&((a=Y(this,xt))==null||a.setAttribute(`${Y(this,Ot)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>Y(this,ct).delete(a)),(t=Y(this,xt))==null||t.setAttribute(`${Y(this,Ot)}`,`${this.value}`)}contains(e){return Y(this,xe,Ge).has(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){return this.remove(e),this.add(t),e===t}};xt=new WeakMap;Ot=new WeakMap;da=new WeakMap;ct=new WeakMap;xe=new WeakSet;Ge=function(){return Y(this,ct).size?Y(this,ct):Y(this,da)};var ko=(i="")=>i.split(/\s+/),So=(i="")=>{let[e,t,a]=i.split(":"),r=a?decodeURIComponent(a):void 0;return e=e==="cc"?"captions":"subtitles",{kind:e,language:t,label:r}},ui=(i="",e={})=>ko(i).map(t=>{let a=So(t);return{...e,...a}}),gu=i=>Array.isArray(i)?i.map(e=>typeof e=="string"?So(e):e):typeof i=="string"?ui(i):[i],ua=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,mt=(i=[])=>Array.prototype.map.call(i,ua).join(" "),Au=(i,e)=>t=>t[i]===e,Mo=i=>{let e=Object.entries(i).map(([t,a])=>Au(t,a));return t=>e.every(a=>a(t))},Xr=(i,e=[],t=[])=>{let a=gu(t).map(Mo),r=n=>a.some(o=>o(n));Array.from(e).filter(r).forEach(n=>{n.mode=i})},ca=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:Mo(e);return Array.from(i.textTracks).filter(t)},Jr=i=>!!i.getAttribute(s.MEDIA_SUBTITLES_SHOWING),Oe=(i,e)=>{var t,a;let r=Jr(i);if(r||e===!1){let n=i.getAttribute(s.MEDIA_SUBTITLES_SHOWING);if(n){let o=new l.CustomEvent(v.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:n});i.dispatchEvent(o)}}else if(!r||e===!0){let[n]=(a=ko((t=i.getAttribute(s.MEDIA_SUBTITLES_LIST))!=null?t:""))!=null?a:[];if(n){let o=new l.CustomEvent(v.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:n});i.dispatchEvent(o)}}else console.error("Attempting to enable captions or subtitles but none are available! Please verify your media content if this is unexpected.")};var $={enter:"requestFullscreen",exit:"exitFullscreen",rootEvents:["fullscreenchange"],mediaEvents:[],element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};m.fullscreenElement===void 0&&($.enter="webkitRequestFullScreen",$.exit=m.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",$.rootEvents=["webkitfullscreenchange"],$.mediaEvents=["webkitbeginfullscreen","webkitendfullscreen"],$.element="webkitFullscreenElement",$.error="webkitfullscreenerror",$.enabled="webkitFullscreenEnabled");var ma,jr=()=>{var i,e;return ma||(ma=(e=(i=m)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),ma)},Lo=async(i=jr())=>{if(!i)return!1;let e=i.volume;return i.volume=e/2+.1,await Ji(0),i.volume!==e},_u=(i=jr())=>typeof(i==null?void 0:i.requestPictureInPicture)=="function",yu=(i=jr())=>{let e=m[$.enabled];return!e&&i&&(e="webkitSupportsFullscreen"in i),e},en=yu(),Co=_u(),Ro=!!l.WebKitPlaybackTargetAvailabilityEvent,wo=!!l.chrome;var ha,Do=Lo().then(i=>(ha=i,ha)),Tu=Object.values(he),tn=i=>ca(i.media,e=>[wt.SUBTITLES,wt.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),Iu=i=>ca(i.media,e=>e.mode===Qi.SHOWING&&[wt.SUBTITLES,wt.CAPTIONS].includes(e.kind)),ie={MEDIA_PAUSED:{get:function(i){let{media:e}=i;return e?e.paused:!0},mediaEvents:["play","playing","pause","emptied"]},MEDIA_HAS_PLAYED:{get:function(i){let{media:e}=i;return e?!e.paused:!1},mediaEvents:["playing","emptied"]},MEDIA_ENDED:{get:function(i){let{media:e}=i;return e?e.ended:!1},mediaEvents:["seeked","ended","emptied"]},MEDIA_PLAYBACK_RATE:{get:function(i){let{media:e}=i;return!e||typeof e.playbackRate=="undefined"?1:e.playbackRate},mediaEvents:["ratechange","loadstart"]},MEDIA_MUTED:{get:function(i){let{media:e}=i;return!e||typeof e.muted=="undefined"?!1:e.muted},mediaEvents:["volumechange"]},MEDIA_VOLUME:{get:function(i){let{media:e}=i;return!e||typeof e.volume=="undefined"?1:Number(e.volume)},mediaEvents:["volumechange"]},MEDIA_VOLUME_LEVEL:{get:function(i){let{media:e}=i,t="high";if(!e||typeof e.volume=="undefined")return t;let{muted:a,volume:r}=e;return r===0||a?t="off":r<.5?t="low":r<.75&&(t="medium"),t},mediaEvents:["volumechange"]},MEDIA_CURRENT_TIME:{get:function(i){let{media:e}=i;return!e||typeof e.currentTime=="undefined"?0:e.currentTime},mediaEvents:["timeupdate","loadedmetadata"]},MEDIA_DURATION:{get:function(i){let{media:e}=i;return!e||!Number.isFinite(e.duration)?NaN:e.duration},mediaEvents:["durationchange","loadedmetadata","emptied"]},MEDIA_SEEKABLE:{get:function(i){var e;let{media:t}=i;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let a=t.seekable.start(0),r=t.seekable.end(t.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress"]},MEDIA_LOADING:{get:function(i){var e;return((e=i.media)==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},MEDIA_BUFFERED:{get:function(i){var e,t,a;let r=(e=i.media)==null?void 0:e.buffered;return Array.from((a=(t=i.media)==null?void 0:t.buffered)!=null?a:[]).map((n,o)=>[Number(r.start(o)).toFixed(3),Number(r.end(o)).toFixed(3)])},mediaEvents:["progress","emptied"]},MEDIA_STREAM_TYPE:{get:function(i){let{media:e}=i;if(!e)return;let{streamType:t}=e;if(Tu.includes(t)){if(t===he.UNKNOWN){let r=i.getAttribute("defaultstreamtype");return[he.LIVE,he.ON_DEMAND].includes(r)?r:void 0}return t}let a=e.duration;if(a===1/0)return he.LIVE;if(Number.isFinite(a))return he.ON_DEMAND;{let r=i.getAttribute("defaultstreamtype");if([he.LIVE,he.ON_DEMAND].includes(r))return r}},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},MEDIA_TARGET_LIVE_WINDOW:{get:function(i){let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e,a=ie.MEDIA_STREAM_TYPE.get(i);return(t==null||Number.isNaN(t))&&a===he.LIVE?0:t},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},MEDIA_TIME_IS_LIVE:{get:function(i){let{media:e}=i;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(ie.MEDIA_STREAM_TYPE.get(i)==="live"))return!1;let a=e.seekable;if(!a)return!0;if(!a.length)return!1;let r=i.hasAttribute("liveedgeoffset")?Number(i.getAttribute("liveedgeoffset")):10,n=a.end(a.length-1)-r;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},MEDIA_IS_FULLSCREEN:{get:function(i,e){var t;let a=i.media;if(a&&m[$.element]===void 0&&"webkitDisplayingFullscreen"in a)return a.webkitDisplayingFullscreen&&a.webkitPresentationMode==="fullscreen";let r;return e?r=m[$.element]?e.target:null:r=(t=i.getRootNode().fullscreenElement)!=null?t:m[$.element],li(i.fullscreenElement,r)},rootEvents:$.rootEvents,mediaEvents:$.mediaEvents},MEDIA_IS_PIP:{get:function(i,e){var t;let a=i.media;if(!a)return!1;if(e)return e.type=="enterpictureinpicture";{let r=(t=i.getRootNode().pictureInPictureElement)!=null?t:m.pictureInPictureElement;return li(a,r)}},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},MEDIA_IS_CASTING:{get:function(i,e){var t;let{media:a}=i;if(!a)return!1;let r=(t=l.CastableVideoElement)==null?void 0:t.castElement,n=li(a,r);return(e==null?void 0:e.type)==="castchange"&&(e==null?void 0:e.detail)==="CONNECTING"&&(n="connecting"),n},mediaEvents:["entercast","leavecast","castchange"]},MEDIA_AIRPLAY_UNAVAILABLE:{get:function(i,e){if(!Ro)return se.UNSUPPORTED;if(!!e&&e.availability!=="available"&&e.availability==="not-available")return se.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"]},MEDIA_CAST_UNAVAILABLE:{get:function(){var i;let e=(i=l.CastableVideoElement)==null?void 0:i.castState;if(!wo||!e)return se.UNSUPPORTED;if(!e.includes("CONNECT"))return se.UNAVAILABLE},mediaEvents:["castchange"]},MEDIA_FULLSCREEN_UNAVAILABLE:{get:function(){return en?void 0:se.UNAVAILABLE}},MEDIA_PIP_UNAVAILABLE:{get:function(){return Co?void 0:se.UNSUPPORTED}},MEDIA_RENDITION_UNAVAILABLE:{get:function(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return se.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return se.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},MEDIA_AUDIO_TRACK_UNAVAILABLE:{get:function(i){var e,t;let{media:a}=i;if(!(a!=null&&a.audioTracks))return se.UNSUPPORTED;if(((t=(e=a.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return se.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},MEDIA_VOLUME_UNAVAILABLE:{get:function(i){if(ha!==void 0&&!ha)return se.UNSUPPORTED;let{media:e}=i;if(e&&typeof e.volume=="undefined")return se.UNAVAILABLE},mediaEvents:["loadstart"]},MEDIA_SUBTITLES_LIST:{get:function(i){return tn(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},MEDIA_SUBTITLES_SHOWING:{get:function(i){return i.hasAttribute("defaultsubtitles")&&!i.hasAttribute(s.MEDIA_HAS_PLAYED)&&!i.hasAttribute(s.MEDIA_SUBTITLES_SHOWING)&&Oe(i,!0),Iu(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"]},MEDIA_RENDITION_LIST:{get:function(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]]},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},MEDIA_RENDITION_SELECTED:{get:function(i){var e,t,a;let{media:r}=i;return(a=(t=r==null?void 0:r.videoRenditions)==null?void 0:t[(e=r.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:a.id},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},MEDIA_AUDIO_TRACK_LIST:{get:function(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},MEDIA_AUDIO_TRACK_ENABLED:{get:function(i){var e,t;let{media:a}=i;return(t=[...(e=a==null?void 0:a.audioTracks)!=null?e:[]].find(r=>r.enabled))==null?void 0:t.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]}},pa={MEDIA_PLAY_REQUEST:(i,e,t)=>{var a;let r=ie.MEDIA_STREAM_TYPE.get(t),n=t.getAttribute("noautoseektolive")===null;r==he.LIVE&&n&&pa.MEDIA_SEEK_TO_LIVE_REQUEST(i),(a=i.play())==null||a.catch(()=>{})},MEDIA_PAUSE_REQUEST:i=>i.pause(),MEDIA_MUTE_REQUEST:i=>i.muted=!0,MEDIA_UNMUTE_REQUEST:i=>{i.muted=!1,i.volume===0&&(i.volume=.25)},MEDIA_VOLUME_REQUEST:(i,e,t)=>{let a=e.detail;if(i.volume=a,a>0&&i.muted&&(i.muted=!1),!t.hasAttribute("novolumepref"))try{l.localStorage.setItem("media-chrome-pref-volume",a.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:(i,e,t)=>{if(!en){console.warn("Fullscreen support is unavailable; not entering fullscreen");return}m.pictureInPictureElement&&m.exitPictureInPicture(),t[$.enter]?t.fullscreenElement[$.enter]():i.webkitEnterFullscreen?i.webkitEnterFullscreen():i.requestFullscreen?i.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{m[$.exit]()},MEDIA_ENTER_PIP_REQUEST:i=>{if(!m.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!i.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}m[$.element]&&m[$.exit]();let e=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};i.requestPictureInPicture().catch(t=>{if(t.code===11)if(i.readyState===0&&i.preload==="none"){let a=()=>{i.removeEventListener("loadedmetadata",r),i.preload="none"},r=()=>{i.requestPictureInPicture().catch(e),a()};i.addEventListener("loadedmetadata",r),i.preload="metadata",setTimeout(()=>{i.readyState===0&&e(),a()},1e3)}else throw t;else throw t})},MEDIA_EXIT_PIP_REQUEST:()=>{m.pictureInPictureElement&&m.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:i=>{var e;!((e=l.CastableVideoElement)!=null&&e.castEnabled)||(m[$.element]&&m[$.exit](),i.requestCast())},MEDIA_EXIT_CAST_REQUEST:async()=>{var i;(i=l.CastableVideoElement)!=null&&i.castElement&&l.CastableVideoElement.exitCast()},MEDIA_SEEK_REQUEST:(i,e)=>{let t=e.detail;(i.readyState>0||i.readyState===void 0)&&(i.currentTime=t)},MEDIA_PLAYBACK_RATE_REQUEST:(i,e)=>{i.playbackRate=e.detail},MEDIA_PREVIEW_REQUEST:(i,e,t)=>{var a;if(!i)return;let r=e.detail;r===null&&t.propagateMediaState(s.MEDIA_PREVIEW_TIME,void 0),t.propagateMediaState(s.MEDIA_PREVIEW_TIME,r);let[n]=ca(i,{kind:wt.METADATA,label:"thumbnails"});if(!(n&&n.cues))return;if(r===null){t.propagateMediaState(s.MEDIA_PREVIEW_IMAGE,void 0),t.propagateMediaState(s.MEDIA_PREVIEW_COORDS,void 0);return}let o=Array.prototype.find.call(n.cues,h=>h.startTime>=r);if(!o)return;let d=/'^(?:[a-z]+:)?\/\//i.test(o.text)||(a=i.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,u=new URL(o.text,d),c=new URLSearchParams(u.hash).get("#xywh");t.propagateMediaState(s.MEDIA_PREVIEW_IMAGE,u.href),t.propagateMediaState(s.MEDIA_PREVIEW_COORDS,c.split(","))},MEDIA_SHOW_SUBTITLES_REQUEST:(i,e,t)=>{let a=tn(t),{detail:r=[]}=e;Xr(Qi.SHOWING,a,r)},MEDIA_DISABLE_SUBTITLES_REQUEST:(i,e,t)=>{let a=tn(t),{detail:r=[]}=e;Xr(Qi.DISABLED,a,r)},MEDIA_AIRPLAY_REQUEST:i=>{if(!!i){if(!(i.webkitShowPlaybackTargetPicker&&l.WebKitPlaybackTargetAvailabilityEvent)){console.warn("received a request to select AirPlay but AirPlay is not supported in this environment");return}i.webkitShowPlaybackTargetPicker()}},MEDIA_SEEK_TO_LIVE_REQUEST:i=>{let e=i.seekable;if(!e){console.warn("MediaController: Media element does not support seeking to live.");return}if(!e.length){console.warn("MediaController: Media is unable to seek to live.");return}i.currentTime=e.end(e.length-1)},MEDIA_RENDITION_REQUEST:(i,e)=>{if(!(i!=null&&i.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let t=e.detail,a=[...i.videoRenditions].findIndex(r=>r.id==t);i.videoRenditions.selectedIndex!=a&&(i.videoRenditions.selectedIndex=a)},MEDIA_AUDIO_TRACK_REQUEST:(i,e)=>{if(!(i!=null&&i.audioTracks)){console.warn("MediaController: Audio track selection not supported by this media.");return}let t=e.detail;for(let a of i.audioTracks)a.enabled=t==a.id}};var nn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},pt=(i,e,t)=>(nn(i,e,"read from private field"),t?t.call(i):e.get(i)),Ea=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},xo=(i,e,t,a)=>(nn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Nt=(i,e,t)=>(nn(i,e,"access private method"),t),qe,ci,Ut,mi,va,an,$o=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],ku=10,Oo=0,ae={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYS_USED:"keysused",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_HOTKEYS:"nohotkeys"},ba=class extends oa{constructor(){super(),Ea(this,Ut),Ea(this,va),Ea(this,qe,new Ze(this,ae.HOTKEYS)),Ea(this,ci,void 0),ie.MEDIA_VOLUME_UNAVAILABLE.get(this)===void 0&&Do.then(()=>{this.propagateMediaState(s.MEDIA_VOLUME_UNAVAILABLE,ie.MEDIA_VOLUME_UNAVAILABLE.get(this))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associateElement(this),Object.keys(pa).forEach(e=>{let t=`_handle${zi(e,!0)}`;this[t]=a=>{if(a.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}pa[e](this.media,a,this)},this.addEventListener(v[e],this[t])}),this._mediaStatePropagators={},Object.keys(ie).forEach(e=>{this._mediaStatePropagators[e]=t=>{this.propagateMediaState(lt[e],ie[e].get(this,t))}}),this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(ae.NO_HOTKEYS,ae.HOTKEYS,ae.DEFAULT_STREAM_TYPE,ae.DEFAULT_SUBTITLES)}get fullscreenElement(){var e;return(e=pt(this,ci))!=null?e:this}set fullscreenElement(e){this.hasAttribute(ae.FULLSCREEN_ELEMENT)&&this.removeAttribute(ae.FULLSCREEN_ELEMENT),xo(this,ci,e)}attributeChangedCallback(e,t,a){var r;if(e===ae.NO_HOTKEYS)a!==t&&a===""?(this.hasAttribute(ae.HOTKEYS)&&console.warn("Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==t&&a===null&&this.enableHotkeys();else if(e===ae.HOTKEYS)pt(this,qe).value=a;else if(e===ae.DEFAULT_SUBTITLES&&a!==t&&a==="")Oe(this,!0);else if(e===ae.DEFAULT_STREAM_TYPE)this.propagateMediaState(lt.MEDIA_STREAM_TYPE);else if(e===ae.FULLSCREEN_ELEMENT){let n=a?(r=this.getRootNode())==null?void 0:r.getElementById(a):void 0;xo(this,ci,n)}super.attributeChangedCallback(e,t,a)}mediaSetCallback(e){if(super.mediaSetCallback(e),e.hasAttribute("tabindex")||(e.tabIndex=-1),Object.keys(ie).forEach(t=>{let{mediaEvents:a,rootEvents:r,textTracksEvents:n,videoRenditionsEvents:o,audioTracksEvents:d}=ie[t],u=this._mediaStatePropagators[t];a==null||a.forEach(c=>{e.addEventListener(c,u),u()}),r==null||r.forEach(c=>{this.getRootNode().addEventListener(c,u),u()}),n==null||n.forEach(c=>{var h;(h=e.textTracks)==null||h.addEventListener(c,u),u()}),o==null||o.forEach(c=>{var h;(h=e.videoRenditions)==null||h.addEventListener(c,u),u()}),d==null||d.forEach(c=>{var h;(h=e.audioTracks)==null||h.addEventListener(c,u),u()})}),!this.hasAttribute("novolumepref"))try{let t=l.localStorage.getItem("media-chrome-pref-volume");t!==null&&(e.volume=t)}catch(t){console.debug("Error getting volume pref",t)}}mediaUnsetCallback(e){super.mediaUnsetCallback(e),Object.keys(ie).forEach(t=>{let{mediaEvents:a,rootEvents:r,textTracksEvents:n,videoRenditionsEvents:o,audioTracksEvents:d}=ie[t],u=this._mediaStatePropagators[t];a==null||a.forEach(c=>{e.removeEventListener(c,u)}),r==null||r.forEach(c=>{this.getRootNode().removeEventListener(c,u)}),n==null||n.forEach(c=>{var h;(h=e.textTracks)==null||h.removeEventListener(c,u)}),o==null||o.forEach(c=>{var h;(h=e.videoRenditions)==null||h.removeEventListener(c,u),u()}),d==null||d.forEach(c=>{var h;(h=e.audioTracks)==null||h.removeEventListener(c,u),u()})}),this.propagateMediaState(lt.MEDIA_PAUSED,!0)}propagateMediaState(e,t){let a=Bo(this.mediaStateReceivers,e);if(Po(this.mediaStateReceivers,e,t),a===Bo(this.mediaStateReceivers,e))return;let r=e.toLowerCase(),n=new l.CustomEvent(ro[r],{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(n)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),n=wu(e,a,r);Object.keys(v).forEach(o=>{e.addEventListener(v[o],this[`_handle${zi(o,!0)}`])}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.keys(v).forEach(r=>{e.removeEventListener(v[r],this[`_handle${zi(r,!0)}`])})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),Object.keys(ie).forEach(r=>{let n=ie[r];Po([e],lt[r],n.get(this))}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",Nt(this,va,an))}disableHotkeys(){this.removeEventListener("keydown",Nt(this,va,an)),this.removeEventListener("keyup",Nt(this,Ut,mi))}get hotkeys(){return pt(this,qe)}keyboardShortcutHandler(e){var t,a,r,n;if(((n=(r=(t=e.target.getAttribute(ae.KEYS_USED))==null?void 0:t.split(" "))!=null?r:(a=e.target)==null?void 0:a.keysUsed)!=null?n:[]).map(T=>T==="Space"?" ":T).filter(Boolean).includes(e.key))return;let d,u,c,h,f,b=ku;if(!pt(this,qe).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&pt(this,qe).contains("nospace")))switch(e.key){case" ":case"k":d=this.getAttribute(s.MEDIA_PAUSED)!=null?v.MEDIA_PLAY_REQUEST:v.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"m":d=this.getAttribute(s.MEDIA_VOLUME_LEVEL)==="off"?v.MEDIA_UNMUTE_REQUEST:v.MEDIA_MUTE_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"f":d=this.getAttribute(s.MEDIA_IS_FULLSCREEN)!=null?v.MEDIA_EXIT_FULLSCREEN_REQUEST:v.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"c":Oe(this);break;case"ArrowLeft":u=this.getAttribute(s.MEDIA_CURRENT_TIME),c=u&&!Number.isNaN(+u)?+u:Oo,h=Math.max(c-b,0),f=new l.CustomEvent(v.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:h}),this.dispatchEvent(f);break;case"ArrowRight":u=this.getAttribute(s.MEDIA_CURRENT_TIME),c=u&&!Number.isNaN(+u)?+u:Oo,h=Math.max(c+b,0),f=new l.CustomEvent(v.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:h}),this.dispatchEvent(f);break;default:break}}};qe=new WeakMap;ci=new WeakMap;Ut=new WeakSet;mi=function(i){let{key:e}=i;if(!$o.includes(e)){this.removeEventListener("keyup",Nt(this,Ut,mi));return}this.keyboardShortcutHandler(i)};va=new WeakSet;an=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!$o.includes(a)){this.removeEventListener("keyup",Nt(this,Ut,mi));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(pt(this,qe).contains(`no${a.toLowerCase()}`)||a===" "&&pt(this,qe).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",Nt(this,Ut,mi),{once:!0})};var Su=Object.values(s),Mu=Object.values(lt),sn=i=>{var e,t,a,r;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)==null?void 0:e.includes("-"))&&(l.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let o=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,A.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||o)?(n||o).filter(d=>Su.includes(d)):[]},Lu=i=>{var e,t;return((e=i.nodeName)==null?void 0:e.includes("-"))&&!!l.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof l.customElements.get(i.nodeName.toLowerCase()))&&l.customElements.upgrade(i),Mu.some(a=>a in i)},rn=i=>Lu(i)||!!sn(i).length,No=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},Uo={[s.MEDIA_SUBTITLES_LIST]:mt,[s.MEDIA_SUBTITLES_SHOWING]:mt,[s.MEDIA_SEEKABLE]:No,[s.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(No).join(" "),[s.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[s.MEDIA_RENDITION_LIST]:no,[s.MEDIA_AUDIO_TRACK_LIST]:oo},Cu=async(i,e,t)=>{var a,r;if(i.isConnected||await Ji(0),typeof t=="boolean"||t==null)return R(i,e,t);if(typeof t=="number")return x(i,e,t);if(typeof t=="string")return M(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(r=(a=Uo[e])==null?void 0:a.call(Uo,t))!=null?r:t;return i.setAttribute(e,n)},Ru=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},ht=(i,e)=>{if(Ru(i))return;let t=(r,n)=>{var o,d;rn(r)&&n(r);let{children:u=[]}=r!=null?r:{},c=(d=(o=r==null?void 0:r.shadowRoot)==null?void 0:o.children)!=null?d:[];[...u,...c].forEach(f=>ht(f,n))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!rn(i)){l.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},Po=(i,e,t)=>{i.forEach(a=>{if(e in a){a[e]=t;return}let r=sn(a),n=e.toLowerCase();!r.includes(n)||Cu(a,n,t)})},Bo=(i,e)=>{for(let t of i){if(e in t)return t[e];let a=sn(t),r=e.toLowerCase();if(!!a.includes(r))return t.getAttribute(r)}},wu=(i,e,t)=>{ht(i,e);let a=h=>{var f;let b=(f=h==null?void 0:h.composedPath()[0])!=null?f:h.target;e(b)},r=h=>{var f;let b=(f=h==null?void 0:h.composedPath()[0])!=null?f:h.target;t(b)};i.addEventListener(v.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(v.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=h=>{h.forEach(f=>{let{addedNodes:b=[],removedNodes:T=[],type:V,target:G,attributeName:I}=f;V==="childList"?(Array.prototype.forEach.call(b,re=>ht(re,e)),Array.prototype.forEach.call(T,re=>ht(re,t))):V==="attributes"&&I===A.MEDIA_CHROME_ATTRIBUTES&&(rn(G)?e(G):t(G))})},o=[],d=h=>{let f=h.target;f.name!=="media"&&(o.forEach(b=>ht(b,t)),o=[...f.assignedElements({flatten:!0})],o.forEach(b=>ht(b,e)))};i.addEventListener("slotchange",d);let u=new MutationObserver(n);return u.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{ht(i,t),i.removeEventListener("slotchange",d),u.disconnect(),i.removeEventListener(v.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(v.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};l.customElements.get("media-controller")||l.customElements.define("media-controller",ba);var on=ba;var Du=Object.defineProperty,xu=(i,e,t)=>e in i?Du(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ou=(i,e,t)=>(xu(i,typeof e!="symbol"?e+"":e,t),t),Ho=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Qe=(i,e,t)=>(Ho(i,e,"read from private field"),t?t.call(i):e.get(i)),ln=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},fa=(i,e,t,a)=>(Ho(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ye,ga,Aa,Wo=m.createElement("template"),Vo=`
|
|
202
|
+
`;var hu=Object.values(s),pu="sm:384 md:576 lg:768 xl:960";function Eu(i){for(let e of i)vu(e.target,e.contentRect.width)}function vu(i,e){var t;if(!i.isConnected)return;let a=(t=i.getAttribute(C.BREAKPOINTS))!=null?t:pu,r=bu(a),n=fu(r,e),o=!1;if(Object.keys(r).forEach(d=>{if(n.includes(d)){i.hasAttribute(`breakpoint${d}`)||(i.setAttribute(`breakpoint${d}`,""),o=!0);return}i.hasAttribute(`breakpoint${d}`)&&(i.removeAttribute(`breakpoint${d}`),o=!0)}),o){let d=new CustomEvent(xe.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(d)}}function bu(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function fu(i,e){return Object.keys(i).filter(t=>e>=i[t])}var oa=class extends l.HTMLElement{constructor(){super(),mu(this,"breakpointsComputed",!1),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(To.content.cloneNode(!0)));let e=u=>{let c=this.media;for(let h of u)h.type==="childList"&&(h.removedNodes.forEach(f=>{if(f.slot=="media"&&h.target==this){let b=h.previousSibling&&h.previousSibling.previousElementSibling;if(!b||!c)this.mediaUnsetCallback(f);else{let T=b.slot!=="media";for(;(b=b.previousSibling)!==null;)b.slot=="media"&&(T=!1);T&&this.mediaUnsetCallback(f)}}}),c&&h.addedNodes.forEach(f=>{f==c&&this.handleMediaUpdated(c).then(b=>this.mediaSetCallback(b))}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let a=!1,r=u=>{a||(setTimeout(()=>{Eu(u),a=!1,this.breakpointsComputed||(this.breakpointsComputed=!0,this.dispatchEvent(new CustomEvent(xe.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))},0),a=!0)},n=new ResizeObserver(r);this.resizeObserver=n,n.observe(this);let o=this.media,d=this.querySelector(":scope > slot[slot=media]");d&&d.addEventListener("slotchange",()=>{if(!d.assignedElements({flatten:!0}).length){this.mediaUnsetCallback(o);return}this.media&&(o=this.media,this.handleMediaUpdated(this.media).then(c=>this.mediaSetCallback(c)))})}static get observedAttributes(){return[C.AUTOHIDE,C.GESTURES_DISABLED].concat(hu).filter(e=>![s.MEDIA_RENDITION_LIST,s.MEDIA_AUDIO_TRACK_LIST].includes(e))}attributeChangedCallback(e,t,a){e.toLowerCase()==C.AUTOHIDE&&(this.autohide=a)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}mediaSetCallback(e){this._mediaClickPlayToggle=()=>{let t=e.paused?v.MEDIA_PLAY_REQUEST:v.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(t,{composed:!0,bubbles:!0}))}}handleMediaUpdated(e){let t=n=>Promise.resolve(n),a=n=>(console.error('<media-chrome>: Media element set with slot="media" does not appear to be compatible.',n),Promise.reject(n));if(!e)return a(e);let r=e.nodeName.toLowerCase();return r.includes("-")?l.customElements.whenDefined(r).then(()=>t(e)):t(e)}mediaUnsetCallback(e){}connectedCallback(){var e;let a=this.getAttribute(C.AUDIO)!=null?Q.AUDIO_PLAYER():Q.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.media&&this.handleMediaUpdated(this.media).then(d=>this.mediaSetCallback(d)),this.setAttribute(C.USER_INACTIVE,"");let r=()=>{if(this.autohide<0||this.hasAttribute(C.USER_INACTIVE))return;this.setAttribute(C.USER_INACTIVE,"");let d=new l.CustomEvent(xe.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(d)},n=()=>{if(!this.hasAttribute(C.USER_INACTIVE))return;this.removeAttribute(C.USER_INACTIVE);let d=new l.CustomEvent(xe.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(d)},o=()=>{n(),clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=setTimeout(()=>{r()},this.autohide*1e3))};this.addEventListener("keyup",()=>{o()}),this.addEventListener("pointerup",d=>{d.pointerType==="touch"?[this,this.media].includes(d.target)&&!this.hasAttribute(C.USER_INACTIVE)?r():o():d.composedPath().some(u=>{var c;return["media-play-button","media-fullscreen-button"].includes((c=u==null?void 0:u.nodeName)==null?void 0:c.toLowerCase())})&&o()}),this.addEventListener("pointermove",d=>{d.pointerType==="mouse"&&(n(),clearTimeout(this._inactiveTimeout),[this,this.media].includes(d.target)&&o())}),this.addEventListener("mouseleave",()=>{r()}),this.addEventListener("keyup",()=>{this.setAttribute(C.KEYBOARD_CONTROL,"")}),(e=l.window)==null||e.addEventListener("mouseup",()=>{this.removeAttribute(C.KEYBOARD_CONTROL)})}set autohide(e){e=Number(e),this._autohide=isNaN(e)?0:e}get autohide(){return this._autohide===void 0?2:this._autohide}};var Io=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Y=(i,e,t)=>(Io(i,e,"read from private field"),t?t.call(i):e.get(i)),di=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},la=(i,e,t,a)=>(Io(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),xt,Ot,da,mt,Oe,Ze,qe=class{constructor(e,t,{defaultValue:a}={defaultValue:void 0}){di(this,Oe),di(this,xt,void 0),di(this,Ot,void 0),di(this,da,void 0),di(this,mt,new Set),la(this,xt,e),la(this,Ot,t),la(this,da,new Set(a))}[Symbol.iterator](){return Y(this,Oe,Ze).values()}get length(){return Y(this,Oe,Ze).size}get value(){var e;return(e=[...Y(this,Oe,Ze)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(la(this,mt,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...Y(this,Oe,Ze)][e]}values(){return Y(this,Oe,Ze).values()}forEach(e){Y(this,Oe,Ze).forEach(e)}add(...e){var t,a;e.forEach(r=>Y(this,mt).add(r)),!(this.value===""&&!((t=Y(this,xt))!=null&&t.hasAttribute(`${Y(this,Ot)}`)))&&((a=Y(this,xt))==null||a.setAttribute(`${Y(this,Ot)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>Y(this,mt).delete(a)),(t=Y(this,xt))==null||t.setAttribute(`${Y(this,Ot)}`,`${this.value}`)}contains(e){return Y(this,Oe,Ze).has(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){return this.remove(e),this.add(t),e===t}};xt=new WeakMap;Ot=new WeakMap;da=new WeakMap;mt=new WeakMap;Oe=new WeakSet;Ze=function(){return Y(this,mt).size?Y(this,mt):Y(this,da)};var ko=(i="")=>i.split(/\s+/),So=(i="")=>{let[e,t,a]=i.split(":"),r=a?decodeURIComponent(a):void 0;return e=e==="cc"?"captions":"subtitles",{kind:e,language:t,label:r}},ui=(i="",e={})=>ko(i).map(t=>{let a=So(t);return{...e,...a}}),gu=i=>Array.isArray(i)?i.map(e=>typeof e=="string"?So(e):e):typeof i=="string"?ui(i):[i],ua=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,ht=(i=[])=>Array.prototype.map.call(i,ua).join(" "),Au=(i,e)=>t=>t[i]===e,Mo=i=>{let e=Object.entries(i).map(([t,a])=>Au(t,a));return t=>e.every(a=>a(t))},Xr=(i,e=[],t=[])=>{let a=gu(t).map(Mo),r=n=>a.some(o=>o(n));Array.from(e).filter(r).forEach(n=>{n.mode=i})},ca=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:Mo(e);return Array.from(i.textTracks).filter(t)},Jr=i=>!!i.getAttribute(s.MEDIA_SUBTITLES_SHOWING),Ne=(i,e)=>{var t,a;let r=Jr(i);if(r||e===!1){let n=i.getAttribute(s.MEDIA_SUBTITLES_SHOWING);if(n){let o=new l.CustomEvent(v.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:n});i.dispatchEvent(o)}}else if(!r||e===!0){let[n]=(a=ko((t=i.getAttribute(s.MEDIA_SUBTITLES_LIST))!=null?t:""))!=null?a:[];if(n){let o=new l.CustomEvent(v.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:n});i.dispatchEvent(o)}}else console.error("Attempting to enable captions or subtitles but none are available! Please verify your media content if this is unexpected.")};var $={enter:"requestFullscreen",exit:"exitFullscreen",rootEvents:["fullscreenchange"],mediaEvents:[],element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};m.fullscreenElement===void 0&&($.enter="webkitRequestFullScreen",$.exit=m.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",$.rootEvents=["webkitfullscreenchange"],$.mediaEvents=["webkitbeginfullscreen","webkitendfullscreen"],$.element="webkitFullscreenElement",$.error="webkitfullscreenerror",$.enabled="webkitFullscreenEnabled");var ma,jr=()=>{var i,e;return ma||(ma=(e=(i=m)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),ma)},Lo=async(i=jr())=>{if(!i)return!1;let e=i.volume;return i.volume=e/2+.1,await Ji(0),i.volume!==e},_u=(i=jr())=>typeof(i==null?void 0:i.requestPictureInPicture)=="function",yu=(i=jr())=>{let e=m[$.enabled];return!e&&i&&(e="webkitSupportsFullscreen"in i),e},en=yu(),Co=_u(),Ro=!!l.WebKitPlaybackTargetAvailabilityEvent,wo=!!l.chrome;var ha,Do=Lo().then(i=>(ha=i,ha)),Tu=Object.values(he),tn=i=>ca(i.media,e=>[wt.SUBTITLES,wt.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),Iu=i=>ca(i.media,e=>e.mode===Qi.SHOWING&&[wt.SUBTITLES,wt.CAPTIONS].includes(e.kind)),ie={MEDIA_PAUSED:{get:function(i){let{media:e}=i;return e?e.paused:!0},mediaEvents:["play","playing","pause","emptied"]},MEDIA_HAS_PLAYED:{get:function(i){let{media:e}=i;return e?!e.paused:!1},mediaEvents:["playing","emptied"]},MEDIA_ENDED:{get:function(i){let{media:e}=i;return e?e.ended:!1},mediaEvents:["seeked","ended","emptied"]},MEDIA_PLAYBACK_RATE:{get:function(i){let{media:e}=i;return!e||typeof e.playbackRate=="undefined"?1:e.playbackRate},mediaEvents:["ratechange","loadstart"]},MEDIA_MUTED:{get:function(i){let{media:e}=i;return!e||typeof e.muted=="undefined"?!1:e.muted},mediaEvents:["volumechange"]},MEDIA_VOLUME:{get:function(i){let{media:e}=i;return!e||typeof e.volume=="undefined"?1:Number(e.volume)},mediaEvents:["volumechange"]},MEDIA_VOLUME_LEVEL:{get:function(i){let{media:e}=i,t="high";if(!e||typeof e.volume=="undefined")return t;let{muted:a,volume:r}=e;return r===0||a?t="off":r<.5?t="low":r<.75&&(t="medium"),t},mediaEvents:["volumechange"]},MEDIA_CURRENT_TIME:{get:function(i){let{media:e}=i;return!e||typeof e.currentTime=="undefined"?0:e.currentTime},mediaEvents:["timeupdate","loadedmetadata"]},MEDIA_DURATION:{get:function(i){let{media:e}=i;return!e||!Number.isFinite(e.duration)?NaN:e.duration},mediaEvents:["durationchange","loadedmetadata","emptied"]},MEDIA_SEEKABLE:{get:function(i){var e;let{media:t}=i;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let a=t.seekable.start(0),r=t.seekable.end(t.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress"]},MEDIA_LOADING:{get:function(i){var e;return((e=i.media)==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},MEDIA_BUFFERED:{get:function(i){var e,t,a;let r=(e=i.media)==null?void 0:e.buffered;return Array.from((a=(t=i.media)==null?void 0:t.buffered)!=null?a:[]).map((n,o)=>[Number(r.start(o)).toFixed(3),Number(r.end(o)).toFixed(3)])},mediaEvents:["progress","emptied"]},MEDIA_STREAM_TYPE:{get:function(i){let{media:e}=i;if(!e)return;let{streamType:t}=e;if(Tu.includes(t)){if(t===he.UNKNOWN){let r=i.getAttribute("defaultstreamtype");return[he.LIVE,he.ON_DEMAND].includes(r)?r:void 0}return t}let a=e.duration;if(a===1/0)return he.LIVE;if(Number.isFinite(a))return he.ON_DEMAND;{let r=i.getAttribute("defaultstreamtype");if([he.LIVE,he.ON_DEMAND].includes(r))return r}},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},MEDIA_TARGET_LIVE_WINDOW:{get:function(i){let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e,a=ie.MEDIA_STREAM_TYPE.get(i);return(t==null||Number.isNaN(t))&&a===he.LIVE?0:t},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},MEDIA_TIME_IS_LIVE:{get:function(i){let{media:e}=i;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(ie.MEDIA_STREAM_TYPE.get(i)==="live"))return!1;let a=e.seekable;if(!a)return!0;if(!a.length)return!1;let r=i.hasAttribute("liveedgeoffset")?Number(i.getAttribute("liveedgeoffset")):10,n=a.end(a.length-1)-r;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},MEDIA_IS_FULLSCREEN:{get:function(i,e){var t;let a=i.media;if(a&&m[$.element]===void 0&&"webkitDisplayingFullscreen"in a)return a.webkitDisplayingFullscreen&&a.webkitPresentationMode==="fullscreen";let r;return e?r=m[$.element]?e.target:null:r=(t=i.getRootNode().fullscreenElement)!=null?t:m[$.element],li(i.fullscreenElement,r)},rootEvents:$.rootEvents,mediaEvents:$.mediaEvents},MEDIA_IS_PIP:{get:function(i,e){var t;let a=i.media;if(!a)return!1;if(e)return e.type=="enterpictureinpicture";{let r=(t=i.getRootNode().pictureInPictureElement)!=null?t:m.pictureInPictureElement;return li(a,r)}},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},MEDIA_IS_CASTING:{get:function(i,e){var t;let{media:a}=i;if(!a)return!1;let r=(t=l.CastableVideoElement)==null?void 0:t.castElement,n=li(a,r);return(e==null?void 0:e.type)==="castchange"&&(e==null?void 0:e.detail)==="CONNECTING"&&(n="connecting"),n},mediaEvents:["entercast","leavecast","castchange"]},MEDIA_AIRPLAY_UNAVAILABLE:{get:function(i,e){if(!Ro)return se.UNSUPPORTED;if(!!e&&e.availability!=="available"&&e.availability==="not-available")return se.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"]},MEDIA_CAST_UNAVAILABLE:{get:function(){var i;let e=(i=l.CastableVideoElement)==null?void 0:i.castState;if(!wo||!e)return se.UNSUPPORTED;if(!e.includes("CONNECT"))return se.UNAVAILABLE},mediaEvents:["castchange"]},MEDIA_FULLSCREEN_UNAVAILABLE:{get:function(){return en?void 0:se.UNAVAILABLE}},MEDIA_PIP_UNAVAILABLE:{get:function(){return Co?void 0:se.UNSUPPORTED}},MEDIA_RENDITION_UNAVAILABLE:{get:function(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return se.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return se.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},MEDIA_AUDIO_TRACK_UNAVAILABLE:{get:function(i){var e,t;let{media:a}=i;if(!(a!=null&&a.audioTracks))return se.UNSUPPORTED;if(((t=(e=a.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return se.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},MEDIA_VOLUME_UNAVAILABLE:{get:function(i){if(ha!==void 0&&!ha)return se.UNSUPPORTED;let{media:e}=i;if(e&&typeof e.volume=="undefined")return se.UNAVAILABLE},mediaEvents:["loadstart"]},MEDIA_SUBTITLES_LIST:{get:function(i){return tn(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},MEDIA_SUBTITLES_SHOWING:{get:function(i){return i.hasAttribute("defaultsubtitles")&&!i.hasAttribute(s.MEDIA_HAS_PLAYED)&&!i.hasAttribute(s.MEDIA_SUBTITLES_SHOWING)&&Ne(i,!0),Iu(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"]},MEDIA_RENDITION_LIST:{get:function(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]]},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},MEDIA_RENDITION_SELECTED:{get:function(i){var e,t,a;let{media:r}=i;return(a=(t=r==null?void 0:r.videoRenditions)==null?void 0:t[(e=r.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:a.id},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},MEDIA_AUDIO_TRACK_LIST:{get:function(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},MEDIA_AUDIO_TRACK_ENABLED:{get:function(i){var e,t;let{media:a}=i;return(t=[...(e=a==null?void 0:a.audioTracks)!=null?e:[]].find(r=>r.enabled))==null?void 0:t.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]}},pa={MEDIA_PLAY_REQUEST:(i,e,t)=>{var a;let r=ie.MEDIA_STREAM_TYPE.get(t),n=t.getAttribute("noautoseektolive")===null;r==he.LIVE&&n&&pa.MEDIA_SEEK_TO_LIVE_REQUEST(i),(a=i.play())==null||a.catch(()=>{})},MEDIA_PAUSE_REQUEST:i=>i.pause(),MEDIA_MUTE_REQUEST:i=>i.muted=!0,MEDIA_UNMUTE_REQUEST:i=>{i.muted=!1,i.volume===0&&(i.volume=.25)},MEDIA_VOLUME_REQUEST:(i,e,t)=>{let a=e.detail;if(i.volume=a,a>0&&i.muted&&(i.muted=!1),!t.hasAttribute("novolumepref"))try{l.localStorage.setItem("media-chrome-pref-volume",a.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:(i,e,t)=>{if(!en){console.warn("Fullscreen support is unavailable; not entering fullscreen");return}m.pictureInPictureElement&&m.exitPictureInPicture(),t[$.enter]?t.fullscreenElement[$.enter]():i.webkitEnterFullscreen?i.webkitEnterFullscreen():i.requestFullscreen?i.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{m[$.exit]()},MEDIA_ENTER_PIP_REQUEST:i=>{if(!m.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!i.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}m[$.element]&&m[$.exit]();let e=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};i.requestPictureInPicture().catch(t=>{if(t.code===11)if(i.readyState===0&&i.preload==="none"){let a=()=>{i.removeEventListener("loadedmetadata",r),i.preload="none"},r=()=>{i.requestPictureInPicture().catch(e),a()};i.addEventListener("loadedmetadata",r),i.preload="metadata",setTimeout(()=>{i.readyState===0&&e(),a()},1e3)}else throw t;else throw t})},MEDIA_EXIT_PIP_REQUEST:()=>{m.pictureInPictureElement&&m.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:i=>{var e;!((e=l.CastableVideoElement)!=null&&e.castEnabled)||(m[$.element]&&m[$.exit](),i.requestCast())},MEDIA_EXIT_CAST_REQUEST:async()=>{var i;(i=l.CastableVideoElement)!=null&&i.castElement&&l.CastableVideoElement.exitCast()},MEDIA_SEEK_REQUEST:(i,e)=>{let t=e.detail;(i.readyState>0||i.readyState===void 0)&&(i.currentTime=t)},MEDIA_PLAYBACK_RATE_REQUEST:(i,e)=>{i.playbackRate=e.detail},MEDIA_PREVIEW_REQUEST:(i,e,t)=>{var a;if(!i)return;let r=e.detail;r===null&&t.propagateMediaState(s.MEDIA_PREVIEW_TIME,void 0),t.propagateMediaState(s.MEDIA_PREVIEW_TIME,r);let[n]=ca(i,{kind:wt.METADATA,label:"thumbnails"});if(!(n&&n.cues))return;if(r===null){t.propagateMediaState(s.MEDIA_PREVIEW_IMAGE,void 0),t.propagateMediaState(s.MEDIA_PREVIEW_COORDS,void 0);return}let o=Array.prototype.find.call(n.cues,h=>h.startTime>=r);if(!o)return;let d=/'^(?:[a-z]+:)?\/\//i.test(o.text)||(a=i.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,u=new URL(o.text,d),c=new URLSearchParams(u.hash).get("#xywh");t.propagateMediaState(s.MEDIA_PREVIEW_IMAGE,u.href),t.propagateMediaState(s.MEDIA_PREVIEW_COORDS,c.split(","))},MEDIA_SHOW_SUBTITLES_REQUEST:(i,e,t)=>{let a=tn(t),{detail:r=[]}=e;Xr(Qi.SHOWING,a,r)},MEDIA_DISABLE_SUBTITLES_REQUEST:(i,e,t)=>{let a=tn(t),{detail:r=[]}=e;Xr(Qi.DISABLED,a,r)},MEDIA_AIRPLAY_REQUEST:i=>{if(!!i){if(!(i.webkitShowPlaybackTargetPicker&&l.WebKitPlaybackTargetAvailabilityEvent)){console.warn("received a request to select AirPlay but AirPlay is not supported in this environment");return}i.webkitShowPlaybackTargetPicker()}},MEDIA_SEEK_TO_LIVE_REQUEST:i=>{let e=i.seekable;if(!e){console.warn("MediaController: Media element does not support seeking to live.");return}if(!e.length){console.warn("MediaController: Media is unable to seek to live.");return}i.currentTime=e.end(e.length-1)},MEDIA_RENDITION_REQUEST:(i,e)=>{if(!(i!=null&&i.videoRenditions)){console.warn("MediaController: Rendition selection not supported by this media.");return}let t=e.detail,a=[...i.videoRenditions].findIndex(r=>r.id==t);i.videoRenditions.selectedIndex!=a&&(i.videoRenditions.selectedIndex=a)},MEDIA_AUDIO_TRACK_REQUEST:(i,e)=>{if(!(i!=null&&i.audioTracks)){console.warn("MediaController: Audio track selection not supported by this media.");return}let t=e.detail;for(let a of i.audioTracks)a.enabled=t==a.id}};var nn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Et=(i,e,t)=>(nn(i,e,"read from private field"),t?t.call(i):e.get(i)),Ea=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},xo=(i,e,t,a)=>(nn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Nt=(i,e,t)=>(nn(i,e,"access private method"),t),Qe,ci,Ut,mi,va,an,$o=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],ku=10,Oo=0,ae={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYS_USED:"keysused",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_HOTKEYS:"nohotkeys"},ba=class extends oa{constructor(){super(),Ea(this,Ut),Ea(this,va),Ea(this,Qe,new qe(this,ae.HOTKEYS)),Ea(this,ci,void 0),ie.MEDIA_VOLUME_UNAVAILABLE.get(this)===void 0&&Do.then(()=>{this.propagateMediaState(s.MEDIA_VOLUME_UNAVAILABLE,ie.MEDIA_VOLUME_UNAVAILABLE.get(this))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associateElement(this),Object.keys(pa).forEach(e=>{let t=`_handle${zi(e,!0)}`;this[t]=a=>{if(a.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}pa[e](this.media,a,this)},this.addEventListener(v[e],this[t])}),this._mediaStatePropagators={},Object.keys(ie).forEach(e=>{this._mediaStatePropagators[e]=t=>{this.propagateMediaState(dt[e],ie[e].get(this,t))}}),this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(ae.NO_HOTKEYS,ae.HOTKEYS,ae.DEFAULT_STREAM_TYPE,ae.DEFAULT_SUBTITLES)}get fullscreenElement(){var e;return(e=Et(this,ci))!=null?e:this}set fullscreenElement(e){this.hasAttribute(ae.FULLSCREEN_ELEMENT)&&this.removeAttribute(ae.FULLSCREEN_ELEMENT),xo(this,ci,e)}attributeChangedCallback(e,t,a){var r;if(e===ae.NO_HOTKEYS)a!==t&&a===""?(this.hasAttribute(ae.HOTKEYS)&&console.warn("Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==t&&a===null&&this.enableHotkeys();else if(e===ae.HOTKEYS)Et(this,Qe).value=a;else if(e===ae.DEFAULT_SUBTITLES&&a!==t&&a==="")Ne(this,!0);else if(e===ae.DEFAULT_STREAM_TYPE)this.propagateMediaState(dt.MEDIA_STREAM_TYPE);else if(e===ae.FULLSCREEN_ELEMENT){let n=a?(r=this.getRootNode())==null?void 0:r.getElementById(a):void 0;xo(this,ci,n)}super.attributeChangedCallback(e,t,a)}mediaSetCallback(e){if(super.mediaSetCallback(e),e.hasAttribute("tabindex")||(e.tabIndex=-1),Object.keys(ie).forEach(t=>{let{mediaEvents:a,rootEvents:r,textTracksEvents:n,videoRenditionsEvents:o,audioTracksEvents:d}=ie[t],u=this._mediaStatePropagators[t];a==null||a.forEach(c=>{e.addEventListener(c,u),u()}),r==null||r.forEach(c=>{this.getRootNode().addEventListener(c,u),u()}),n==null||n.forEach(c=>{var h;(h=e.textTracks)==null||h.addEventListener(c,u),u()}),o==null||o.forEach(c=>{var h;(h=e.videoRenditions)==null||h.addEventListener(c,u),u()}),d==null||d.forEach(c=>{var h;(h=e.audioTracks)==null||h.addEventListener(c,u),u()})}),!this.hasAttribute("novolumepref"))try{let t=l.localStorage.getItem("media-chrome-pref-volume");t!==null&&(e.volume=t)}catch(t){console.debug("Error getting volume pref",t)}}mediaUnsetCallback(e){super.mediaUnsetCallback(e),Object.keys(ie).forEach(t=>{let{mediaEvents:a,rootEvents:r,textTracksEvents:n,videoRenditionsEvents:o,audioTracksEvents:d}=ie[t],u=this._mediaStatePropagators[t];a==null||a.forEach(c=>{e.removeEventListener(c,u)}),r==null||r.forEach(c=>{this.getRootNode().removeEventListener(c,u)}),n==null||n.forEach(c=>{var h;(h=e.textTracks)==null||h.removeEventListener(c,u)}),o==null||o.forEach(c=>{var h;(h=e.videoRenditions)==null||h.removeEventListener(c,u),u()}),d==null||d.forEach(c=>{var h;(h=e.audioTracks)==null||h.removeEventListener(c,u),u()})}),this.propagateMediaState(dt.MEDIA_PAUSED,!0)}propagateMediaState(e,t){let a=Bo(this.mediaStateReceivers,e);if(Po(this.mediaStateReceivers,e,t),a===Bo(this.mediaStateReceivers,e))return;let r=e.toLowerCase(),n=new l.CustomEvent(ro[r],{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(n)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),n=wu(e,a,r);Object.keys(v).forEach(o=>{e.addEventListener(v[o],this[`_handle${zi(o,!0)}`])}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.keys(v).forEach(r=>{e.removeEventListener(v[r],this[`_handle${zi(r,!0)}`])})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),Object.keys(ie).forEach(r=>{let n=ie[r];Po([e],dt[r],n.get(this))}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",Nt(this,va,an))}disableHotkeys(){this.removeEventListener("keydown",Nt(this,va,an)),this.removeEventListener("keyup",Nt(this,Ut,mi))}get hotkeys(){return Et(this,Qe)}keyboardShortcutHandler(e){var t,a,r,n;if(((n=(r=(t=e.target.getAttribute(ae.KEYS_USED))==null?void 0:t.split(" "))!=null?r:(a=e.target)==null?void 0:a.keysUsed)!=null?n:[]).map(T=>T==="Space"?" ":T).filter(Boolean).includes(e.key))return;let d,u,c,h,f,b=ku;if(!Et(this,Qe).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&Et(this,Qe).contains("nospace")))switch(e.key){case" ":case"k":d=this.getAttribute(s.MEDIA_PAUSED)!=null?v.MEDIA_PLAY_REQUEST:v.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"m":d=this.getAttribute(s.MEDIA_VOLUME_LEVEL)==="off"?v.MEDIA_UNMUTE_REQUEST:v.MEDIA_MUTE_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"f":d=this.getAttribute(s.MEDIA_IS_FULLSCREEN)!=null?v.MEDIA_EXIT_FULLSCREEN_REQUEST:v.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"c":Ne(this);break;case"ArrowLeft":u=this.getAttribute(s.MEDIA_CURRENT_TIME),c=u&&!Number.isNaN(+u)?+u:Oo,h=Math.max(c-b,0),f=new l.CustomEvent(v.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:h}),this.dispatchEvent(f);break;case"ArrowRight":u=this.getAttribute(s.MEDIA_CURRENT_TIME),c=u&&!Number.isNaN(+u)?+u:Oo,h=Math.max(c+b,0),f=new l.CustomEvent(v.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:h}),this.dispatchEvent(f);break;default:break}}};Qe=new WeakMap;ci=new WeakMap;Ut=new WeakSet;mi=function(i){let{key:e}=i;if(!$o.includes(e)){this.removeEventListener("keyup",Nt(this,Ut,mi));return}this.keyboardShortcutHandler(i)};va=new WeakSet;an=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!$o.includes(a)){this.removeEventListener("keyup",Nt(this,Ut,mi));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(Et(this,Qe).contains(`no${a.toLowerCase()}`)||a===" "&&Et(this,Qe).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",Nt(this,Ut,mi),{once:!0})};var Su=Object.values(s),Mu=Object.values(dt),sn=i=>{var e,t,a,r;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)==null?void 0:e.includes("-"))&&(l.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let o=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,A.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||o)?(n||o).filter(d=>Su.includes(d)):[]},Lu=i=>{var e,t;return((e=i.nodeName)==null?void 0:e.includes("-"))&&!!l.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof l.customElements.get(i.nodeName.toLowerCase()))&&l.customElements.upgrade(i),Mu.some(a=>a in i)},rn=i=>Lu(i)||!!sn(i).length,No=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},Uo={[s.MEDIA_SUBTITLES_LIST]:ht,[s.MEDIA_SUBTITLES_SHOWING]:ht,[s.MEDIA_SEEKABLE]:No,[s.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(No).join(" "),[s.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[s.MEDIA_RENDITION_LIST]:no,[s.MEDIA_AUDIO_TRACK_LIST]:oo},Cu=async(i,e,t)=>{var a,r;if(i.isConnected||await Ji(0),typeof t=="boolean"||t==null)return R(i,e,t);if(typeof t=="number")return x(i,e,t);if(typeof t=="string")return M(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(r=(a=Uo[e])==null?void 0:a.call(Uo,t))!=null?r:t;return i.setAttribute(e,n)},Ru=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},pt=(i,e)=>{if(Ru(i))return;let t=(r,n)=>{var o,d;rn(r)&&n(r);let{children:u=[]}=r!=null?r:{},c=(d=(o=r==null?void 0:r.shadowRoot)==null?void 0:o.children)!=null?d:[];[...u,...c].forEach(f=>pt(f,n))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!rn(i)){l.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},Po=(i,e,t)=>{i.forEach(a=>{if(e in a){a[e]=t;return}let r=sn(a),n=e.toLowerCase();!r.includes(n)||Cu(a,n,t)})},Bo=(i,e)=>{for(let t of i){if(e in t)return t[e];let a=sn(t),r=e.toLowerCase();if(!!a.includes(r))return t.getAttribute(r)}},wu=(i,e,t)=>{pt(i,e);let a=h=>{var f;let b=(f=h==null?void 0:h.composedPath()[0])!=null?f:h.target;e(b)},r=h=>{var f;let b=(f=h==null?void 0:h.composedPath()[0])!=null?f:h.target;t(b)};i.addEventListener(v.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(v.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=h=>{h.forEach(f=>{let{addedNodes:b=[],removedNodes:T=[],type:V,target:G,attributeName:I}=f;V==="childList"?(Array.prototype.forEach.call(b,re=>pt(re,e)),Array.prototype.forEach.call(T,re=>pt(re,t))):V==="attributes"&&I===A.MEDIA_CHROME_ATTRIBUTES&&(rn(G)?e(G):t(G))})},o=[],d=h=>{let f=h.target;f.name!=="media"&&(o.forEach(b=>pt(b,t)),o=[...f.assignedElements({flatten:!0})],o.forEach(b=>pt(b,e)))};i.addEventListener("slotchange",d);let u=new MutationObserver(n);return u.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{pt(i,t),i.removeEventListener("slotchange",d),u.disconnect(),i.removeEventListener(v.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(v.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};l.customElements.get("media-controller")||l.customElements.define("media-controller",ba);var on=ba;var Du=Object.defineProperty,xu=(i,e,t)=>e in i?Du(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ou=(i,e,t)=>(xu(i,typeof e!="symbol"?e+"":e,t),t),Ho=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ze=(i,e,t)=>(Ho(i,e,"read from private field"),t?t.call(i):e.get(i)),ln=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},fa=(i,e,t,a)=>(Ho(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ye,ga,Aa,Wo=m.createElement("template"),Vo=`
|
|
203
203
|
height: var(--thumb-height);
|
|
204
204
|
width: var(--media-range-thumb-width, 10px);
|
|
205
205
|
border: var(--media-range-thumb-border, none);
|
|
@@ -366,7 +366,7 @@
|
|
|
366
366
|
<div id="hoverzone"></div>
|
|
367
367
|
<input id="range" type="range" min="0" max="1000" step="any" value="0">
|
|
368
368
|
</div>
|
|
369
|
-
`;var
|
|
369
|
+
`;var vt=class extends l.HTMLElement{constructor(){super(),Ou(this,"thumbWidth"),ln(this,ye,void 0),ln(this,ga,()=>{if(this.range.matches(":focus-visible")){let{style:t}=N(this.shadowRoot,":host");t.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),ln(this,Aa,()=>{let{style:t}=N(this.shadowRoot,":host");t.removeProperty("--_focus-visible-box-shadow")}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Wo.content.cloneNode(!0)));let{style:e}=N(this.shadowRoot,":host");e.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-block))`),this.container=this.shadowRoot.querySelector("#container"),this.range=this.shadowRoot.querySelector("#range"),this.range.addEventListener("input",this.updateBar.bind(this)),this.thumbWidth=parseInt(getComputedStyle(this).getPropertyValue("--media-range-thumb-width")||"10",10)}static get observedAttributes(){return["disabled","aria-disabled",A.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===A.MEDIA_CONTROLLER?(t&&((n=(r=ze(this,ye))==null?void 0:r.unassociateElement)==null||n.call(r,this),fa(this,ye,null)),a&&(fa(this,ye,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=ze(this,ye))==null?void 0:d.associateElement)==null||u.call(d,this))):(e==="disabled"||e==="aria-disabled"&&t!==a)&&(a==null?this.range.removeAttribute(e):this.range.setAttribute(e,a))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(fa(this,ye,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ze(this,ye))==null?void 0:t.associateElement)==null||a.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",ze(this,ga)),this.shadowRoot.addEventListener("focusout",ze(this,Aa))}disconnectedCallback(){var e,t;(t=(e=ze(this,ye))==null?void 0:e.unassociateElement)==null||t.call(e,this),fa(this,ye,null),this.shadowRoot.removeEventListener("focusin",ze(this,ga)),this.shadowRoot.removeEventListener("focusout",ze(this,Aa))}updatePointerBar(e){let t=this.range.getBoundingClientRect(),a=(e.clientX-t.left)/t.width;a=Math.max(0,Math.min(1,a));let{style:r}=N(this.shadowRoot,"#pointer");r.setProperty("width",`${a*t.width}px`)}updateBar(){let e=this.getBarColors(),t="linear-gradient(to right, ",a=0;e.forEach(n=>{n[1]<a||(t=t+`${n[0]} ${a}%, ${n[0]} ${n[1]}%,`,a=n[1])}),t=t.slice(0,t.length-1)+")";let{style:r}=N(this.shadowRoot,"#range");r.setProperty("--media-range-track-progress-internal",t)}getRelativeValues(){let{range:e}=this;return{relativeValue:e.value-e.min,relativeMax:e.max-e.min}}getBarColors(){let e=this.range,{relativeValue:t,relativeMax:a}=this.getRelativeValues(),r=t/a*100,n=0;return!!t&&t<a&&(n=this.thumbWidth*(.5-r/100)/e.offsetWidth*100),[["var(--media-range-bar-color, var(--media-primary-color, rgb(238 238 238)))",r+n],["var(--media-range-track-color, transparent)",100]]}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};ye=new WeakMap;ga=new WeakMap;Aa=new WeakMap;l.customElements.get("media-chrome-range")||l.customElements.define("media-chrome-range",vt);var Fo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_a=(i,e,t)=>(Fo(i,e,"read from private field"),t?t.call(i):e.get(i)),Nu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ya=(i,e,t,a)=>(Fo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Te,Ko=m.createElement("template");Ko.innerHTML=`
|
|
370
370
|
<style>
|
|
371
371
|
:host {
|
|
372
372
|
|
|
@@ -425,7 +425,7 @@
|
|
|
425
425
|
}
|
|
426
426
|
</style>
|
|
427
427
|
<slot></slot>
|
|
428
|
-
`;var
|
|
428
|
+
`;var Ue=class extends l.HTMLElement{constructor(){super(),Uu(this,Ie,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Go.content.cloneNode(!0)));let{style:e}=N(this.shadowRoot,":host");e.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`)}static get observedAttributes(){return[A.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===A.MEDIA_CONTROLLER&&(t&&((n=(r=Ta(this,Ie))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ia(this,Ie,null)),a&&(Ia(this,Ie,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=Ta(this,Ie))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(Ia(this,Ie,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Ta(this,Ie))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Ta(this,Ie))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ia(this,Ie,null)}};Ie=new WeakMap;l.customElements.get("media-text-display")||l.customElements.define("media-text-display",Ue);var qo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Zo=(i,e,t)=>(qo(i,e,"read from private field"),t?t.call(i):e.get(i)),Pu=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Bu=(i,e,t,a)=>(qo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),hi,cn=class extends Ue{constructor(){super(),Pu(this,hi,void 0),Bu(this,hi,this.shadowRoot.querySelector("slot")),Zo(this,hi).textContent=Ae(0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_DURATION]}attributeChangedCallback(e,t,a){e===s.MEDIA_DURATION&&(Zo(this,hi).textContent=Ae(a)),super.attributeChangedCallback(e,t,a)}get mediaDuration(){return S(this,s.MEDIA_DURATION)}set mediaDuration(e){x(this,s.MEDIA_DURATION,e)}};hi=new WeakMap;l.customElements.get("media-duration-display")||l.customElements.define("media-duration-display",cn);var Jo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},mn=(i,e,t)=>(Jo(i,e,"read from private field"),t?t.call(i):e.get(i)),$u=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Vu=(i,e,t,a)=>(Jo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Pt,pe={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Qo=[...Object.values(pe),s.MEDIA_CURRENT_TIME,s.MEDIA_DURATION,s.MEDIA_SEEKABLE],zo=["Enter"," "],Hu=" / ",Xo=(i,{timesSep:e=Hu}={})=>{var t,a,r,n;let o=i.hasAttribute(pe.REMAINING),d=i.hasAttribute(pe.SHOW_DURATION),u=(t=i.mediaCurrentTime)!=null?t:0,[,c]=(a=i.mediaSeekable)!=null?a:[],h=(n=(r=i.mediaDuration)!=null?r:c)!=null?n:0,f=o?Ae(0-(h-u)):Ae(u);return d?`${f}${e}${Ae(h)}`:f},Wu="video not loaded, unknown time.",Fu=i=>{var e;let t=i.mediaCurrentTime,[,a]=(e=i.mediaSeekable)!=null?e:[],r=i.mediaDuration||a;if(t==null||r==null){i.setAttribute("aria-valuetext",Wu);return}let n=i.hasAttribute(pe.REMAINING),o=i.hasAttribute(pe.SHOW_DURATION),d=n?ut(0-(r-t)):ut(t);if(!o){i.setAttribute("aria-valuetext",d);return}let u=ut(r),c=`${d} of ${u}`;i.setAttribute("aria-valuetext",c)},hn=class extends Ue{constructor(){super(),$u(this,Pt,void 0),Vu(this,Pt,this.shadowRoot.querySelector("slot")),mn(this,Pt).innerHTML=`${Xo(this)}`;let{style:e}=N(this.shadowRoot,":host:not([notoggle])");e.setProperty("cursor","pointer");let{style:t}=N(this.shadowRoot,":host(:hover:not([notoggle]))");t.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))")}static get observedAttributes(){return[...super.observedAttributes,...Qo,"disabled"]}connectedCallback(){this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",Q.PLAYBACK_TIME());let e=t=>{let{key:a}=t;if(!zo.includes(a)){this.removeEventListener("keyup",e);return}this.toggleTimeDisplay()};this.addEventListener("keydown",t=>{let{metaKey:a,altKey:r,key:n}=t;if(a||r||!zo.includes(n)){this.removeEventListener("keyup",e);return}this.addEventListener("keyup",e)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,a){Qo.includes(e)?this.update():e==="disabled"&&a!==t&&(a==null?this.enable():this.disable()),super.attributeChangedCallback(e,t,a)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return D(this,pe.REMAINING)}set remaining(e){R(this,pe.REMAINING,e)}get showDuration(){return D(this,pe.SHOW_DURATION)}set showDuration(e){R(this,pe.SHOW_DURATION,e)}get noToggle(){return D(this,pe.NO_TOGGLE)}set noToggle(e){R(this,pe.NO_TOGGLE,e)}get mediaDuration(){return S(this,s.MEDIA_DURATION)}set mediaDuration(e){x(this,s.MEDIA_DURATION,e)}get mediaCurrentTime(){return S(this,s.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){x(this,s.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(s.MEDIA_SEEKABLE);if(!!e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(s.MEDIA_SEEKABLE);return}this.setAttribute(s.MEDIA_SEEKABLE,e.join(":"))}update(){let e=Xo(this);Fu(this),e!==mn(this,Pt).innerHTML&&(mn(this,Pt).innerHTML=e)}};Pt=new WeakMap;l.customElements.get("media-time-display")||l.customElements.define("media-time-display",hn);var Ku=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
429
429
|
<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"/>
|
|
430
430
|
</svg>`,Yu=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
431
431
|
<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"/>
|
|
@@ -445,7 +445,7 @@
|
|
|
445
445
|
<slot name="on">${Ku}</slot>
|
|
446
446
|
<slot name="off">${Yu}</slot>
|
|
447
447
|
</slot>
|
|
448
|
-
`;var jo=i=>{i.setAttribute("aria-checked",Jr(i))},pn=class extends L{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:il,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",Q.CLOSED_CAPTIONS()),jo(this)}attributeChangedCallback(e,t,a){e===s.MEDIA_SUBTITLES_SHOWING&&jo(this),super.attributeChangedCallback(e,t,a)}get mediaSubtitlesList(){return el(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){tl(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return el(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){tl(this,s.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){
|
|
448
|
+
`;var jo=i=>{i.setAttribute("aria-checked",Jr(i))},pn=class extends L{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:il,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",Q.CLOSED_CAPTIONS()),jo(this)}attributeChangedCallback(e,t,a){e===s.MEDIA_SUBTITLES_SHOWING&&jo(this),super.attributeChangedCallback(e,t,a)}get mediaSubtitlesList(){return el(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){tl(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return el(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){tl(this,s.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){Ne(this)}},el=(i,e)=>{let t=i.getAttribute(e);return t?ui(t):[]},tl=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=ht(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};l.customElements.get("media-captions-button")||l.customElements.define("media-captions-button",pn);var Bt={SEEK_OFFSET:"seekoffset"},ka=30,Gu=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(8.9 19.87)">${ka}</text><path d="M10 6V3l5.61 4L10 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 10 6Z"/></svg>`,al=m.createElement("template");al.innerHTML=`
|
|
449
449
|
<slot name="icon">${Gu}</slot>
|
|
450
450
|
`;var Zu=0,En=class extends L{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_CURRENT_TIME,Bt.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:al,...e})}connectedCallback(){this.seekOffset=S(this,Bt.SEEK_OFFSET,ka),super.connectedCallback()}attributeChangedCallback(e,t,a){e===Bt.SEEK_OFFSET&&(this.seekOffset=S(this,Bt.SEEK_OFFSET,ka)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return S(this,Bt.SEEK_OFFSET,ka)}set seekOffset(e){x(this,Bt.SEEK_OFFSET,e),this.setAttribute("aria-label",O.SEEK_FORWARD_N_SECS({seekOffset:this.seekOffset})),ji(ea(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return S(this,s.MEDIA_CURRENT_TIME,Zu)}set mediaCurrentTime(e){x(this,s.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new l.CustomEvent(v.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};l.customElements.get("media-seek-forward-button")||l.customElements.define("media-seek-forward-button",En);var qu=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
451
451
|
<path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
|
|
@@ -565,7 +565,7 @@
|
|
|
565
565
|
</slot>
|
|
566
566
|
`;var pl=i=>{let e=i.mediaPaused?O.PLAY():O.PAUSE();i.setAttribute("aria-label",e)},An=class extends L{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PAUSED,s.MEDIA_ENDED]}constructor(e={}){super({slotTemplate:El,...e})}connectedCallback(){pl(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===s.MEDIA_PAUSED&&pl(this),super.attributeChangedCallback(e,t,a)}get mediaPaused(){return D(this,s.MEDIA_PAUSED)}set mediaPaused(e){R(this,s.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?v.MEDIA_PLAY_REQUEST:v.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-play-button")||l.customElements.define("media-play-button",An);var ac=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ma=(i,e,t)=>(ac(i,e,"read from private field"),t?t.call(i):e.get(i)),rc=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},$t,_n={RATES:"rates"},Tn=[1,1.25,1.5,1.75,2],Vt=1,vl=m.createElement("template");vl.innerHTML=`
|
|
567
567
|
<span id="container"></span>
|
|
568
|
-
`;var yn=class extends L{constructor(e={}){super({slotTemplate:vl,...e}),rc(this,$t,new
|
|
568
|
+
`;var yn=class extends L{constructor(e={}){super({slotTemplate:vl,...e}),rc(this,$t,new qe(this,_n.RATES,{defaultValue:Tn})),this.container=this.shadowRoot.querySelector("#container"),this.container.innerHTML=`${Vt}x`}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PLAYBACK_RATE,_n.RATES]}attributeChangedCallback(e,t,a){if(e===_n.RATES&&(Ma(this,$t).value=a),e===s.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?Vt:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",Q.PLAYBACK_RATE({playbackRate:n}));return}super.attributeChangedCallback(e,t,a)}get rates(){return Ma(this,$t)}set rates(e){e?Array.isArray(e)&&(Ma(this,$t).value=e.join(" ")):Ma(this,$t).value=""}get mediaPlaybackRate(){return S(this,s.MEDIA_PLAYBACK_RATE,Vt)}set mediaPlaybackRate(e){x(this,s.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let a=Array.from(this.rates.values(),o=>+o).sort((o,d)=>o-d),r=(t=(e=a.find(o=>o>this.mediaPlaybackRate))!=null?e:a[0])!=null?t:Vt,n=new l.CustomEvent(v.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};$t=new WeakMap;l.customElements.get("media-playback-rate-button")||l.customElements.define("media-playback-rate-button",yn);var ke={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"},bl=m.createElement("template");bl.innerHTML=`
|
|
569
569
|
<style>
|
|
570
570
|
:host {
|
|
571
571
|
pointer-events: none;
|
|
@@ -589,7 +589,7 @@
|
|
|
589
589
|
<img part="poster img" aria-hidden="true" id="image"/>
|
|
590
590
|
`;var nc=i=>{i.style.removeProperty("background-image")},sc=(i,e)=>{i.style["background-image"]=`url('${e}')`},In=class extends l.HTMLElement{static get observedAttributes(){return[ke.PLACEHOLDER_SRC,ke.SRC]}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(bl.content.cloneNode(!0))),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,a){e===ke.SRC&&(a==null?this.image.removeAttribute(ke.SRC):this.image.setAttribute(ke.SRC,a)),e===ke.PLACEHOLDER_SRC&&(a==null?nc(this.image):sc(this.image,a))}get placeholderSrc(){return w(this,ke.PLACEHOLDER_SRC)}set placeholderSrc(e){M(this,ke.SRC,e)}get src(){return w(this,ke.SRC)}set src(e){M(this,ke.SRC,e)}};l.customElements.get("media-poster-image")||l.customElements.define("media-poster-image",In);var Ht={SEEK_OFFSET:"seekoffset"},La=30,oc=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(2.18 19.87)">${La}</text><path d="M10 6V3L4.37 7 10 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 10 6Z"/></svg>`,fl=m.createElement("template");fl.innerHTML=`
|
|
591
591
|
<slot name="icon">${oc}</slot>
|
|
592
|
-
`;var lc=0,kn=class extends L{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_CURRENT_TIME,Ht.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:fl,...e})}connectedCallback(){this.seekOffset=S(this,Ht.SEEK_OFFSET,La),super.connectedCallback()}attributeChangedCallback(e,t,a){e===Ht.SEEK_OFFSET&&(this.seekOffset=S(this,Ht.SEEK_OFFSET,La)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return S(this,Ht.SEEK_OFFSET,La)}set seekOffset(e){x(this,Ht.SEEK_OFFSET,e),this.setAttribute("aria-label",O.SEEK_BACK_N_SECS({seekOffset:this.seekOffset})),ji(ea(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return S(this,s.MEDIA_CURRENT_TIME,lc)}set mediaCurrentTime(e){x(this,s.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new l.CustomEvent(v.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};l.customElements.get("media-seek-backward-button")||l.customElements.define("media-seek-backward-button",kn);var Al=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},gl=(i,e,t)=>(Al(i,e,"read from private field"),t?t.call(i):e.get(i)),dc=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},uc=(i,e,t,a)=>(Al(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),vi,Sn=class extends
|
|
592
|
+
`;var lc=0,kn=class extends L{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_CURRENT_TIME,Ht.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:fl,...e})}connectedCallback(){this.seekOffset=S(this,Ht.SEEK_OFFSET,La),super.connectedCallback()}attributeChangedCallback(e,t,a){e===Ht.SEEK_OFFSET&&(this.seekOffset=S(this,Ht.SEEK_OFFSET,La)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return S(this,Ht.SEEK_OFFSET,La)}set seekOffset(e){x(this,Ht.SEEK_OFFSET,e),this.setAttribute("aria-label",O.SEEK_BACK_N_SECS({seekOffset:this.seekOffset})),ji(ea(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return S(this,s.MEDIA_CURRENT_TIME,lc)}set mediaCurrentTime(e){x(this,s.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new l.CustomEvent(v.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};l.customElements.get("media-seek-backward-button")||l.customElements.define("media-seek-backward-button",kn);var Al=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},gl=(i,e,t)=>(Al(i,e,"read from private field"),t?t.call(i):e.get(i)),dc=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},uc=(i,e,t,a)=>(Al(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),vi,Sn=class extends Ue{constructor(){super(),dc(this,vi,void 0),uc(this,vi,this.shadowRoot.querySelector("slot")),gl(this,vi).textContent=Ae(0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,a){e===s.MEDIA_PREVIEW_TIME&&a!=null&&(gl(this,vi).textContent=Ae(a)),super.attributeChangedCallback(e,t,a)}get mediaPreviewTime(){return S(this,s.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){x(this,s.MEDIA_PREVIEW_TIME,e)}};vi=new WeakMap;l.customElements.get("media-preview-time-display")||l.customElements.define("media-preview-time-display",Sn);var _l=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ca=(i,e,t)=>(_l(i,e,"read from private field"),t?t.call(i):e.get(i)),cc=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ra=(i,e,t,a)=>(_l(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Se,yl=m.createElement("template");yl.innerHTML=`
|
|
593
593
|
<style>
|
|
594
594
|
:host {
|
|
595
595
|
box-sizing: border-box;
|
|
@@ -603,7 +603,7 @@
|
|
|
603
603
|
}
|
|
604
604
|
</style>
|
|
605
605
|
<img crossorigin loading="eager" decoding="async">
|
|
606
|
-
`;var Mn=class extends l.HTMLElement{constructor(){super(),cc(this,Se,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(yl.content.cloneNode(!0)))}static get observedAttributes(){return[A.MEDIA_CONTROLLER,s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(Ra(this,Se,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Ca(this,Se))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Ca(this,Se))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ra(this,Se,null)}attributeChangedCallback(e,t,a){var r,n,o,d,u;[s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===A.MEDIA_CONTROLLER&&(t&&((n=(r=Ca(this,Se))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ra(this,Se,null)),a&&(Ra(this,Se,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=Ca(this,Se))==null?void 0:d.associateElement)==null||u.call(d,this)))}get mediaPreviewImage(){return w(this,s.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){M(this,s.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(s.MEDIA_PREVIEW_COORDS);if(!!e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(s.MEDIA_PREVIEW_COORDS);return}this.setAttribute(s.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[a,r,n,o]=e,d=t.split("#")[0],u=getComputedStyle(this),{maxWidth:c,maxHeight:h,minWidth:f,minHeight:b}=u,T=Math.min(parseInt(c)/n,parseInt(h)/o),V=Math.max(parseInt(f)/n,parseInt(b)/o),G=T<1,I=G?T:V>1?V:1,{style:re}=N(this.shadowRoot,":host"),ge=N(this.shadowRoot,"img").style,oe=this.shadowRoot.querySelector("img"),ni=G?"min":"max";re.setProperty(`${ni}-width`,"initial","important"),re.setProperty(`${ni}-height`,"initial","important"),re.width=`${n*I}px`,re.height=`${o*I}px`;let
|
|
606
|
+
`;var Mn=class extends l.HTMLElement{constructor(){super(),cc(this,Se,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(yl.content.cloneNode(!0)))}static get observedAttributes(){return[A.MEDIA_CONTROLLER,s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(Ra(this,Se,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Ca(this,Se))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Ca(this,Se))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ra(this,Se,null)}attributeChangedCallback(e,t,a){var r,n,o,d,u;[s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===A.MEDIA_CONTROLLER&&(t&&((n=(r=Ca(this,Se))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ra(this,Se,null)),a&&(Ra(this,Se,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=Ca(this,Se))==null?void 0:d.associateElement)==null||u.call(d,this)))}get mediaPreviewImage(){return w(this,s.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){M(this,s.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(s.MEDIA_PREVIEW_COORDS);if(!!e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(s.MEDIA_PREVIEW_COORDS);return}this.setAttribute(s.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[a,r,n,o]=e,d=t.split("#")[0],u=getComputedStyle(this),{maxWidth:c,maxHeight:h,minWidth:f,minHeight:b}=u,T=Math.min(parseInt(c)/n,parseInt(h)/o),V=Math.max(parseInt(f)/n,parseInt(b)/o),G=T<1,I=G?T:V>1?V:1,{style:re}=N(this.shadowRoot,":host"),ge=N(this.shadowRoot,"img").style,oe=this.shadowRoot.querySelector("img"),ni=G?"min":"max";re.setProperty(`${ni}-width`,"initial","important"),re.setProperty(`${ni}-height`,"initial","important"),re.width=`${n*I}px`,re.height=`${o*I}px`;let Ct=()=>{ge.width=`${this.imgWidth*I}px`,ge.height=`${this.imgHeight*I}px`,ge.display="block"};oe.src!==d&&(oe.onload=()=>{this.imgWidth=oe.naturalWidth,this.imgHeight=oe.naturalHeight,Ct()},oe.src=d,Ct()),Ct(),ge.transform=`translate(-${a*I}px, -${r*I}px)`}};Se=new WeakMap;l.customElements.get("media-preview-thumbnail")||l.customElements.define("media-preview-thumbnail",Mn);var Un=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},H=(i,e,t)=>(Un(i,e,"read from private field"),t?t.call(i):e.get(i)),z=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Xe=(i,e,t,a)=>(Un(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),bi=(i,e,t)=>(Un(i,e,"access private method"),t),fi,wa,gi,Ua,Pa,Da,Cn,Rn,Tl,xa,wn,Oa,Wt,Ai,Dn,Ba,$a,Na,xn,On,Il,mc="video not loaded, unknown time.",Ln=i=>{let e=i.range,t=ut(+e.value),a=ut(+e.max),r=t&&a?`${t} of ${a}`:mc;e.setAttribute("aria-valuetext",r)},kl=m.createElement("template");kl.innerHTML=`
|
|
607
607
|
<style>
|
|
608
608
|
:host {
|
|
609
609
|
--media-preview-border-radius: 3px;
|
|
@@ -708,7 +708,7 @@
|
|
|
708
708
|
|
|
709
709
|
</slot>
|
|
710
710
|
</div>
|
|
711
|
-
`;var Nn=class extends
|
|
711
|
+
`;var Nn=class extends vt{constructor(){super(),z(this,Da),z(this,Rn),z(this,xa),z(this,Na),z(this,On),z(this,fi,void 0),z(this,wa,void 0),z(this,gi,void 0),z(this,Ua,void 0),z(this,Pa,void 0),z(this,Oa,t=>{if([...H(this,fi)].some(h=>t.composedPath().includes(h)))return;this.updatePointerBar(t);let a=this.mediaDuration;if(!a)return;let r=this.range.getBoundingClientRect(),n=(t.clientX-r.left-this.thumbWidth/2)/(r.width-this.thumbWidth);n=Math.max(0,Math.min(1,n));let o=bi(this,xa,wn).call(this,H(this,wa),n),{style:d}=N(this.shadowRoot,"#preview-rail");d.transform=`translateX(${o})`;let u=n*a,c=new l.CustomEvent(v.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:u});this.dispatchEvent(c)}),z(this,Wt,!1),z(this,Ai,t=>{var a;(!t.composedPath().includes(this)||[...H(this,fi)].some(r=>t.composedPath().includes(r)))&&((a=l.window)==null||a.removeEventListener("pointermove",H(this,Ai)),Xe(this,Wt,!1),H(this,Ba).call(this))}),z(this,Dn,()=>{var t;(t=l.window)==null||t.addEventListener("pointermove",H(this,Oa),!1)}),z(this,Ba,()=>{var t;(t=l.window)==null||t.removeEventListener("pointermove",H(this,Oa));let a=new l.CustomEvent(v.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:null});this.dispatchEvent(a)}),z(this,$a,()=>{var t;let a=this.getAttribute(s.MEDIA_DURATION);!H(this,Wt)&&a&&(Xe(this,Wt,!0),H(this,Dn).call(this),(t=l.window)==null||t.addEventListener("pointermove",H(this,Ai),!1))}),this.container.appendChild(kl.content.cloneNode(!0)),this.range.addEventListener("input",()=>{cancelAnimationFrame(this._refreshId);let a=this.range.value,r=new l.CustomEvent(v.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:a});this.dispatchEvent(r)}),this._refreshBar=()=>{let t=(performance.now()-this._updateTimestamp)/1e3;this.range.value=this.mediaCurrentTime+t*this.mediaPlaybackRate,this.updateBar(),this.updateCurrentBox(),this._refreshId=requestAnimationFrame(this._refreshBar)},Xe(this,fi,this.shadowRoot.querySelectorAll('[part~="box"]')),Xe(this,wa,this.shadowRoot.querySelector('[part~="preview-box"]')),Xe(this,gi,this.shadowRoot.querySelector('[part~="current-box"]'));let e=getComputedStyle(this);Xe(this,Ua,parseInt(e.getPropertyValue("--media-box-padding-left"))),Xe(this,Pa,parseInt(e.getPropertyValue("--media-box-padding-right"))),bi(this,Na,xn).call(this)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_PAUSED,s.MEDIA_DURATION,s.MEDIA_SEEKABLE,s.MEDIA_CURRENT_TIME,s.MEDIA_PREVIEW_IMAGE,s.MEDIA_PREVIEW_TIME,s.MEDIA_BUFFERED,s.MEDIA_PLAYBACK_RATE,s.MEDIA_LOADING,s.MEDIA_ENDED]}connectedCallback(){this.range.setAttribute("aria-label",Q.SEEK()),super.connectedCallback()}disconnectedCallback(){cancelAnimationFrame(this._refreshId),super.disconnectedCallback()}attributeChangedCallback(e,t,a){var r,n,o,d,u;(e===s.MEDIA_CURRENT_TIME||e===s.MEDIA_PAUSED||e===s.MEDIA_ENDED||e===s.MEDIA_LOADING)&&(this._updateTimestamp=performance.now(),this.range.value=this.mediaCurrentTime,Ln(this),this.updateBar(),this.updateCurrentBox(),cancelAnimationFrame(this._refreshId),!this.mediaPaused&&!this.mediaLoading&&(this._refreshId=requestAnimationFrame(this._refreshBar))),e===s.MEDIA_DURATION&&(this.range.max=(n=(r=H(this,Da,Cn))!=null?r:this.mediaDuration)!=null?n:1e3,Ln(this),this.updateBar(),this.updateCurrentBox()),e===s.MEDIA_SEEKABLE&&(this.range.min=(o=H(this,Rn,Tl))!=null?o:0,this.range.max=(u=(d=H(this,Da,Cn))!=null?d:this.mediaDuration)!=null?u:1e3,Ln(this),this.updateBar()),e===s.MEDIA_BUFFERED&&this.updateBar(),e==="disabled"&&(a==null?bi(this,Na,xn).call(this):bi(this,On,Il).call(this)),super.attributeChangedCallback(e,t,a)}get mediaPaused(){return D(this,s.MEDIA_PAUSED)}set mediaPaused(e){R(this,s.MEDIA_PAUSED,e)}get mediaLoading(){return D(this,s.MEDIA_LOADING)}set mediaLoading(e){R(this,s.MEDIA_LOADING,e)}get mediaDuration(){return S(this,s.MEDIA_DURATION)}set mediaDuration(e){x(this,s.MEDIA_DURATION,e)}get mediaCurrentTime(){return S(this,s.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){x(this,s.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return S(this,s.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){x(this,s.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(s.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(s.MEDIA_BUFFERED);return}let t=e.map(a=>a.join(":")).join(" ");this.setAttribute(s.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(s.MEDIA_SEEKABLE);if(!!e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(s.MEDIA_SEEKABLE);return}this.setAttribute(s.MEDIA_SEEKABLE,e.join(":"))}get mediaPreviewImage(){return w(this,s.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){M(this,s.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return S(this,s.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){x(this,s.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return D(this,s.MEDIA_ENDED)}set mediaEnded(e){R(this,s.MEDIA_ENDED,e)}getRelativeValues(){let e=super.getRelativeValues();return this.mediaEnded?{...e,relativeValue:e.relativeMax}:e}getBarColors(){var e;let t=super.getBarColors(),{range:a}=this,r=a.max-a.min,n=this.mediaBuffered;if(!n.length||!Number.isFinite(r)||r<=0)return t;let o;if(this.mediaEnded)o=r;else{let u=this.mediaCurrentTime,[,c=a.min]=(e=n.find(([h,f])=>h<=u&&u<=f))!=null?e:[];o=c-a.min}let d=o/r*100;return t.splice(1,0,["var(--media-time-range-buffered-color, rgb(255 255 255 / .4))",d]),t}updateCurrentBox(){if(!H(this,gi).assignedElements().length)return;let e=this.range.value/(this.range.max-this.range.min),t=bi(this,xa,wn).call(this,H(this,gi),e),{style:a}=N(this.shadowRoot,"#current-rail");a.transform=`translateX(${t})`}};fi=new WeakMap;wa=new WeakMap;gi=new WeakMap;Ua=new WeakMap;Pa=new WeakMap;Da=new WeakSet;Cn=function(){var i;let[,e]=(i=this.mediaSeekable)!=null?i:[];return e};Rn=new WeakSet;Tl=function(){var i;let[e]=(i=this.mediaSeekable)!=null?i:[];return e};xa=new WeakSet;wn=function(i,e){var t;let a=`${e*100*100}%`,r=i.offsetWidth;if(!r)return a;let n=(t=this.getAttribute("bounds")?ct(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?t:this,o=this.range.getBoundingClientRect(),d=n.getBoundingClientRect(),u=(H(this,Ua)-(o.left-d.left-r/2))/o.width*100,c=(d.right-o.left-r/2-H(this,Pa))/o.width*100;return Number.isNaN(u)||(a=`max(${u*100}%, ${a})`),Number.isNaN(c)||(a=`min(${a}, ${c*100}%)`),a};Oa=new WeakMap;Wt=new WeakMap;Ai=new WeakMap;Dn=new WeakMap;Ba=new WeakMap;$a=new WeakMap;Na=new WeakSet;xn=function(){this.addEventListener("pointermove",H(this,$a),!1)};On=new WeakSet;Il=function(){var i;(i=l.window)==null||i.removeEventListener("pointermove",H(this,Ai)),this.removeEventListener("pointermove",H(this,$a)),Xe(this,Wt,!1),H(this,Ba).call(this)};l.customElements.get("media-time-range")||l.customElements.define("media-time-range",Nn);var Ml=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ft=(i,e,t)=>(Ml(i,e,"read from private field"),t?t.call(i):e.get(i)),Pn=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Kt=(i,e,t,a)=>(Ml(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Me,Va,Ha,Sl={LOADING_DELAY:"loadingdelay"},Ll=500,Cl=m.createElement("template"),hc=`
|
|
712
712
|
<svg aria-hidden="true" viewBox="0 0 100 100">
|
|
713
713
|
<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">
|
|
714
714
|
<animateTransform
|
|
@@ -768,7 +768,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
|
|
|
768
768
|
|
|
769
769
|
<slot name="icon">${hc}</slot>
|
|
770
770
|
<div id="status" role="status" aria-live="polite">${Q.MEDIA_LOADING()}</div>
|
|
771
|
-
`;var Bn=class extends l.HTMLElement{constructor(){if(super(),Pn(this,Me,void 0),Pn(this,Va,Ll),Pn(this,Ha,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=Cl.content.cloneNode(!0);t.appendChild(a)}let{style:e}=N(this.shadowRoot,":host");Kt(this,Ha,e)}static get observedAttributes(){return[A.MEDIA_CONTROLLER,s.MEDIA_PAUSED,s.MEDIA_LOADING,Sl.LOADING_DELAY]}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===Sl.LOADING_DELAY&&t!==a?this.loadingDelay=Number(a):e===A.MEDIA_CONTROLLER&&(t&&((n=(r=Ft(this,Me))==null?void 0:r.unassociateElement)==null||n.call(r,this),Kt(this,Me,null)),a&&(Kt(this,Me,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=Ft(this,Me))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(Kt(this,Me,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Ft(this,Me))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Ft(this,Me))==null?void 0:e.unassociateElement)==null||t.call(e,this),Kt(this,Me,null)}get loadingDelay(){return Ft(this,Va)}set loadingDelay(e){Kt(this,Va,e),Ft(this,Ha).setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return D(this,s.MEDIA_PAUSED)}set mediaPaused(e){R(this,s.MEDIA_PAUSED,e)}get mediaLoading(){return D(this,s.MEDIA_LOADING)}set mediaLoading(e){R(this,s.MEDIA_LOADING,e)}};Me=new WeakMap;Va=new WeakMap;Ha=new WeakMap;l.customElements.get("media-loading-indicator")||l.customElements.define("media-loading-indicator",Bn);var pc=100,Ec=1,vc=i=>i.mediaMuted?0:Math.round(i.mediaVolume*i.range.max),bc=({value:i,max:e})=>`${Math.round(i/e*100)}%`,$n=class extends
|
|
771
|
+
`;var Bn=class extends l.HTMLElement{constructor(){if(super(),Pn(this,Me,void 0),Pn(this,Va,Ll),Pn(this,Ha,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=Cl.content.cloneNode(!0);t.appendChild(a)}let{style:e}=N(this.shadowRoot,":host");Kt(this,Ha,e)}static get observedAttributes(){return[A.MEDIA_CONTROLLER,s.MEDIA_PAUSED,s.MEDIA_LOADING,Sl.LOADING_DELAY]}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===Sl.LOADING_DELAY&&t!==a?this.loadingDelay=Number(a):e===A.MEDIA_CONTROLLER&&(t&&((n=(r=Ft(this,Me))==null?void 0:r.unassociateElement)==null||n.call(r,this),Kt(this,Me,null)),a&&(Kt(this,Me,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=Ft(this,Me))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(Kt(this,Me,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Ft(this,Me))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Ft(this,Me))==null?void 0:e.unassociateElement)==null||t.call(e,this),Kt(this,Me,null)}get loadingDelay(){return Ft(this,Va)}set loadingDelay(e){Kt(this,Va,e),Ft(this,Ha).setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return D(this,s.MEDIA_PAUSED)}set mediaPaused(e){R(this,s.MEDIA_PAUSED,e)}get mediaLoading(){return D(this,s.MEDIA_LOADING)}set mediaLoading(e){R(this,s.MEDIA_LOADING,e)}};Me=new WeakMap;Va=new WeakMap;Ha=new WeakMap;l.customElements.get("media-loading-indicator")||l.customElements.define("media-loading-indicator",Bn);var pc=100,Ec=1,vc=i=>i.mediaMuted?0:Math.round(i.mediaVolume*i.range.max),bc=({value:i,max:e})=>`${Math.round(i/e*100)}%`,$n=class extends vt{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_VOLUME,s.MEDIA_MUTED,s.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.max=pc,this.range.addEventListener("input",()=>{let t=this.range.value/this.range.max,a=new l.CustomEvent(v.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(a)})}connectedCallback(){this.range.setAttribute("aria-label",Q.VOLUME()),super.connectedCallback()}attributeChangedCallback(e,t,a){if(e===s.MEDIA_VOLUME||e===s.MEDIA_MUTED){let r=vc(this);this.range.value=r,this.range.setAttribute("aria-valuetext",bc(this.range)),this.updateBar()}super.attributeChangedCallback(e,t,a)}get mediaVolume(){return S(this,s.MEDIA_VOLUME,Ec)}set mediaVolume(e){x(this,s.MEDIA_VOLUME,e)}get mediaMuted(){return D(this,s.MEDIA_MUTED)}set mediaMuted(e){R(this,s.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return w(this,s.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){M(this,s.MEDIA_VOLUME_UNAVAILABLE,e)}};l.customElements.get("media-volume-range")||l.customElements.define("media-volume-range",$n);var Kn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Z=(i,e,t)=>(Kn(i,e,"read from private field"),t?t.call(i):e.get(i)),ue=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ee=(i,e,t,a)=>(Kn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Pe=(i,e,t)=>(Kn(i,e,"access private method"),t),Le,Je,Gt,_i,Wa,Fa,Vn,Yt,Hn,yi,Ka,Ya,Wn,Fn,Rl,Yn,wl,fc=`
|
|
772
772
|
<svg aria-hidden="true" viewBox="0 1 24 24" part="select-indicator indicator">
|
|
773
773
|
<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"/>
|
|
774
774
|
</svg>`;function Ce(i,e,t){let a=m.createElement("media-chrome-option");a.part.add("option"),a.value=e,a.selected=t;let r=m.createElement("span");return r.textContent=i,a.append(r),a}function ve(i,e){let t=i.querySelector(`:scope > [slot="${e}"]`);return(t==null?void 0:t.nodeName)=="SLOT"&&(t=t.assignedElements({flatten:!0})[0]),t?(t=t.cloneNode(!0),t.removeAttribute("slot"),t):i.shadowRoot.querySelector(`[name="${e}"] > svg`).cloneNode(!0)}var Dl=m.createElement("template");Dl.innerHTML=`
|
|
@@ -817,7 +817,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
|
|
|
817
817
|
<slot name="header"></slot>
|
|
818
818
|
<slot id="container"></slot>
|
|
819
819
|
<slot name="select-indicator" hidden>${fc}</slot>
|
|
820
|
-
`;var ce=class extends l.HTMLElement{constructor(e={}){super(),ue(this,Fa),ue(this,yi),ue(this,Ya),ue(this,Fn),ue(this,Yn),ue(this,Le,void 0),ue(this,
|
|
820
|
+
`;var ce=class extends l.HTMLElement{constructor(e={}){super(),ue(this,Fa),ue(this,yi),ue(this,Ya),ue(this,Fn),ue(this,Yn),ue(this,Le,void 0),ue(this,Je,""),ue(this,Gt,null),ue(this,_i,!1),ue(this,Wa,t=>{this.handleClick(t)}),ue(this,Yt,t=>{let{key:a}=t;if(a==="Escape"){this.removeEventListener("keyup",Z(this,Yt));return}if(a==="Meta"){Ee(this,_i,!1);return}Pe(this,Fa,Vn).call(this,t)}),ue(this,Hn,t=>{let{key:a,altKey:r}=t;if(r){this.removeEventListener("keyup",Z(this,Yt));return}if(a==="Meta"){Ee(this,_i,!0);return}if(this.keysUsed.includes(a)&&t.preventDefault(),Z(this,_i)&&this.keysUsed.includes(a)){Pe(this,Fa,Vn).call(this,t);return}this.addEventListener("keyup",Z(this,Yt),{once:!0})}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.nativeEl=Dl.content.cloneNode(!0),e.slotTemplate&&this.nativeEl.append(e.slotTemplate.content.cloneNode(!0)),this.shadowRoot.append(this.nativeEl)),this.container=this.shadowRoot.querySelector("#container"),this.container.addEventListener("slotchange",t=>{for(let a of t.target.assignedNodes({flatten:!0}))a.nodeType===3&&a.textContent.trim()===""&&a.remove()})}static get observedAttributes(){return["disabled",A.MEDIA_CONTROLLER]}static formatOptionText(e){return e}formatOptionText(e,t){return this.constructor.formatOptionText(e,t)}get options(){var e;let t=this.querySelectorAll("media-chrome-option");return t.length||(t=(e=this.container)==null?void 0:e.querySelectorAll("media-chrome-option")),Array.from(t)}get selectedOptions(){return this.options.filter(e=>e.selected)}get value(){var e,t;return(t=(e=this.selectedOptions[0])==null?void 0:e.value)!=null?t:""}set value(e){let t=this.options.find(a=>a.value===e);!t||Pe(this,Ya,Wn).call(this,t)}focus(){var e;(e=this.selectedOptions[0])==null||e.focus()}enable(){this.addEventListener("click",Z(this,Wa)),this.addEventListener("keydown",Z(this,Hn))}disable(){this.removeEventListener("click",Z(this,Wa)),this.removeEventListener("keyup",Z(this,Yt))}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===A.MEDIA_CONTROLLER?(t&&((n=(r=Z(this,Le))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ee(this,Le,null)),a&&(Ee(this,Le,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=Z(this,Le))==null?void 0:d.associateElement)==null||u.call(d,this))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;this.hasAttribute("disabled")||this.enable(),this.hasAttribute("role")||this.setAttribute("role","listbox");let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(Ee(this,Le,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Z(this,Le))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=Z(this,Le))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ee(this,Le,null)}get keysUsed(){return["Enter"," ","ArrowDown","ArrowUp","Home","End"]}handleSelection(e,t){let a=Pe(this,yi,Ka).call(this,e);!a||Pe(this,Ya,Wn).call(this,a,t)}handleMovement(e){let{key:t}=e,a=this.options,r=Pe(this,yi,Ka).call(this,e);r||(r=a.filter(o=>o.getAttribute("tabindex")==="0")[0]);let n;switch(t){case"ArrowDown":n=r.nextElementSibling,n!=null&&n.hasAttribute("disabled")&&(n=n.nextElementSibling);break;case"ArrowUp":n=r.previousElementSibling,n!=null&&n.hasAttribute("disabled")&&(n=n.previousElementSibling);break;case"Home":n=a[0];break;case"End":n=a[a.length-1];break;default:n=Pe(this,Fn,Rl).call(this,t);break}n&&(a.forEach(o=>o.setAttribute("tabindex","-1")),n.setAttribute("tabindex","0"),n.focus())}handleClick(e){let t=Pe(this,yi,Ka).call(this,e);!t||t.hasAttribute("disabled")||(this.options.forEach(a=>a.setAttribute("tabindex","-1")),t.setAttribute("tabindex","0"),this.handleSelection(e,this.hasAttribute("aria-multiselectable")&&this.getAttribute("aria-multiselectable")==="true"))}};Le=new WeakMap;Je=new WeakMap;Gt=new WeakMap;_i=new WeakMap;Wa=new WeakMap;Fa=new WeakSet;Vn=function(i){let{key:e}=i;e==="Enter"||e===" "?this.handleSelection(i,this.hasAttribute("aria-multiselectable")&&this.getAttribute("aria-multiselectable")==="true"):this.handleMovement(i)};Yt=new WeakMap;Hn=new WeakMap;yi=new WeakSet;Ka=function(i){let e=i.composedPath(),t=e.findIndex(a=>a.nodeName==="MEDIA-CHROME-OPTION");return e[t]};Ya=new WeakSet;Wn=function(i,e){let t=[...this.selectedOptions];(!this.hasAttribute("aria-multiselectable")||this.getAttribute("aria-multiselectable")!=="true")&&this.options.forEach(a=>a.selected=!1),e?i.selected=!i.selected:i.selected=!0,this.selectedOptions.some((a,r)=>a!=t[r])&&this.dispatchEvent(new Event("change"))};Fn=new WeakSet;Rl=function(i){Pe(this,Yn,wl).call(this);let e=this.options,t=e.findIndex(c=>c.getAttribute("tabindex")==="0");Ee(this,Je,Z(this,Je)+i);let a=Z(this,Je).split("").every(c=>c===i),r=e.slice(t+(a?1:0)).filter(c=>c.textContent.toLowerCase().startsWith(Z(this,Je))),n=e.slice(0,t-(a?1:0)).filter(c=>c.textContent.toLowerCase().startsWith(Z(this,Je))),o=[],d=[];return a&&(o=e.slice(t+(a?1:0)).filter(c=>c.textContent.startsWith(i)),d=e.slice(0,t-(a?1:0)).filter(c=>c.textContent.startsWith(i))),[...r,...n,...o,...d][0]};Yn=new WeakSet;wl=function(){clearTimeout(Z(this,Gt)),Ee(this,Gt,null),Ee(this,Gt,setTimeout(()=>{Ee(this,Je,""),Ee(this,Gt,null)},500))};l.customElements.get("media-chrome-listbox")||l.customElements.define("media-chrome-listbox",ce);var Xn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},qn=(i,e,t)=>(Xn(i,e,"read from private field"),t?t.call(i):e.get(i)),Gn=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Zn=(i,e,t,a)=>(Xn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),xl=(i,e,t)=>(Xn(i,e,"access private method"),t),Ga,Zt,Za,Qn,Ol=m.createElement("template");Ol.innerHTML=`
|
|
821
821
|
<style>
|
|
822
822
|
:host {
|
|
823
823
|
cursor: pointer;
|
|
@@ -856,7 +856,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
|
|
|
856
856
|
}
|
|
857
857
|
</style>
|
|
858
858
|
<slot></slot>
|
|
859
|
-
`;var
|
|
859
|
+
`;var je={VALUE:"value",SELECTED:"selected",DISABLED:"disabled"},qa=class extends l.HTMLElement{constructor(){super(),Gn(this,Za),Gn(this,Ga,!1),Gn(this,Zt,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ol.content.cloneNode(!0)))}static get observedAttributes(){return[je.DISABLED,je.SELECTED,je.VALUE]}get value(){var e;return(e=this.getAttribute(je.VALUE))!=null?e:this.text}set value(e){this.setAttribute(je.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get selected(){return this.getAttribute("aria-selected")==="true"}set selected(e){Zn(this,Ga,!0),this.setAttribute("aria-selected",e?"true":"false"),e?this.part.add("option-selected"):this.part.remove("option-selected")}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex",-1),this.hasAttribute("aria-selected")||this.setAttribute("aria-selected","false")}disable(){this.removeAttribute("tabindex")}attributeChangedCallback(e,t,a){e===je.SELECTED&&!qn(this,Ga)?this.setAttribute("aria-selected",a!=null?"true":"false"):e===je.DISABLED&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(je.DISABLED)||this.enable(),this.setAttribute("role","option"),Zn(this,Zt,zn(this,this.parentNode)),xl(this,Za,Qn).call(this)}disconnectedCallback(){this.disable(),xl(this,Za,Qn).call(this),Zn(this,Zt,null)}handleClick(){}};Ga=new WeakMap;Zt=new WeakMap;Za=new WeakSet;Qn=function(){var i;let e=(i=qn(this,Zt))==null?void 0:i.options;if(!e)return;let t=e.filter(a=>a.getAttribute("aria-selected")==="true").pop();t||(t=e[0]),qn(this,Zt).getAttribute("aria-multiselectable")!=="true"&&e.forEach(a=>{a.setAttribute("tabindex","-1"),a.setAttribute("aria-selected","false")}),t==null||t.setAttribute("tabindex","0"),t==null||t.setAttribute("aria-selected","true")};function zn(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?zn(i,t):e!=null&&e.options?e:zn(e,e==null?void 0:e.parentNode)}l.customElements.get("media-chrome-option")||l.customElements.define("media-chrome-option",qa);var es=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},E=(i,e,t)=>(es(i,e,"read from private field"),t?t.call(i):e.get(i)),q=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},X=(i,e,t,a)=>(es(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Be=(i,e,t)=>(es(i,e,"access private method"),t),Re,qt,Ti,Qt,F,Ii,U,we,ki,bt,zt,Qa,Jn,Nl,jn,Ul,Xt,Si,ts,Pl,za,is,Bl=m.createElement("template");Bl.innerHTML=`
|
|
860
860
|
<style>
|
|
861
861
|
:host {
|
|
862
862
|
font: var(--media-font,
|
|
@@ -909,12 +909,12 @@ svg, img, ::slotted(svg), ::slotted(img) {
|
|
|
909
909
|
<slot></slot>
|
|
910
910
|
</media-chrome-listbox>
|
|
911
911
|
</slot>
|
|
912
|
-
`;var me=class extends l.HTMLElement{constructor(){var e;super(),q(this,Jn),q(this,jn),q(this,Xt),q(this,ts),q(this,za),q(this,Re,void 0),q(this,qt,void 0),q(this,Ti,void 0),q(this,Qt,!0),q(this,F,void 0),q(this,Ii,void 0),q(this,U,void 0),q(this,we,void 0),q(this,ki,!1),q(this,
|
|
912
|
+
`;var me=class extends l.HTMLElement{constructor(){var e;super(),q(this,Jn),q(this,jn),q(this,Xt),q(this,ts),q(this,za),q(this,Re,void 0),q(this,qt,void 0),q(this,Ti,void 0),q(this,Qt,!0),q(this,F,void 0),q(this,Ii,void 0),q(this,U,void 0),q(this,we,void 0),q(this,ki,!1),q(this,bt,a=>{let{key:r}=a;if(!this.keysUsed.includes(r)){this.removeEventListener("keyup",E(this,bt));return}a.composedPath().includes(E(this,F))&&(r==="Enter"||r===" ")?E(this,qt).call(this):r==="Escape"&&!E(this,we).hidden&&Be(this,Xt,Si).call(this)}),q(this,zt,a=>{let{metaKey:r,altKey:n,key:o}=a;if(r||n||!this.keysUsed.includes(o)){this.removeEventListener("keyup",E(this,bt));return}a.preventDefault(),this.addEventListener("keyup",E(this,bt),{once:!0})}),q(this,Qa,a=>{a.composedPath().includes(this)||E(this,we).hidden||Be(this,Xt,Si).call(this)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Bl.content.cloneNode(!0)));let{style:t}=N(this.shadowRoot,":host");t.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),X(this,qt,Be(this,Jn,Nl).bind(this)),X(this,Ti,Be(this,jn,Ul).bind(this)),(e=this.init)==null||e.call(this),X(this,F,this.shadowRoot.querySelector("[part=button]")),X(this,U,this.shadowRoot.querySelector("[part=listbox]")),X(this,Ii,this.shadowRoot.querySelector("slot[name=button]")),E(this,Ii).addEventListener("slotchange",()=>{let a=E(this,Ii).assignedElements()[0];!a||(this.disable(),X(this,F,a),E(this,F).preventClick=!0,E(this,F).hasAttribute("disabled")&&X(this,Qt,!1),E(this,Qt)?(this.enable(),E(this,F).setAttribute("aria-haspopup","listbox")):this.disable())}),X(this,we,this.shadowRoot.querySelector("slot[name=listbox]")),E(this,we).addEventListener("slotchange",()=>{this.disable(),X(this,U,E(this,we).assignedElements()[0]||E(this,U)),this.enable()})}static get observedAttributes(){return["disabled",A.MEDIA_CONTROLLER]}enable(){E(this,F).removeAttribute("disabled"),E(this,F).addEventListener("click",E(this,qt)),E(this,F).addEventListener("keydown",E(this,zt)),E(this,U).addEventListener("keydown",E(this,zt)),Be(this,za,is).call(this),E(this,U).addEventListener("change",E(this,Ti)),m.addEventListener("click",E(this,Qa))}disable(){E(this,F).setAttribute("disabled",""),E(this,F).removeEventListener("click",E(this,qt)),E(this,F).removeEventListener("keydown",E(this,zt)),E(this,F).removeEventListener("keyup",E(this,bt)),E(this,U).removeEventListener("keydown",E(this,zt)),E(this,U).removeEventListener("keyup",E(this,bt)),E(this,U).addEventListener("change",E(this,Ti)),m.removeEventListener("click",E(this,Qa))}attributeChangedCallback(e,t,a){var r,n,o,d,u;e===A.MEDIA_CONTROLLER?(t&&((n=(r=E(this,Re))==null?void 0:r.unassociateElement)==null||n.call(r,this),X(this,Re,null),E(this,U).removeAttribute(A.MEDIA_CONTROLLER)),a&&(X(this,Re,(o=this.getRootNode())==null?void 0:o.getElementById(a)),(u=(d=E(this,Re))==null?void 0:d.associateElement)==null||u.call(d,this),E(this,U).setAttribute(A.MEDIA_CONTROLLER,a))):e==="disabled"&&a!==t&&(a==null?(X(this,Qt,!0),this.enable()):(X(this,Qt,!1),this.disable()))}connectedCallback(){var e,t,a;this.hasAttribute("disabled")||this.enable();let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(X(this,Re,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=E(this,Re))==null?void 0:t.associateElement)==null||a.call(t,this),E(this,U).setAttribute(A.MEDIA_CONTROLLER,r))}disconnectedCallback(){var e,t;this.disable(),(t=(e=E(this,Re))==null?void 0:e.unassociateElement)==null||t.call(e,this),X(this,Re,null),E(this,U).removeAttribute(A.MEDIA_CONTROLLER)}get keysUsed(){return["Enter","Escape"," ","ArrowUp","ArrowDown","f","c","k","m"]}};Re=new WeakMap;qt=new WeakMap;Ti=new WeakMap;Qt=new WeakMap;F=new WeakMap;Ii=new WeakMap;U=new WeakMap;we=new WeakMap;ki=new WeakMap;bt=new WeakMap;zt=new WeakMap;Qa=new WeakMap;Jn=new WeakSet;Nl=function(){Be(this,Xt,Si).call(this)};jn=new WeakSet;Ul=function(){Be(this,Xt,Si).call(this,!0)};Xt=new WeakSet;Si=function(i){E(this,we).hidden=!E(this,we).hidden||i,Be(this,za,is).call(this,i),E(this,we).hidden?(this.shadowRoot.activeElement===E(this,U)||E(this,U).contains(this.shadowRoot.activeElement))&&E(this,F).focus():(E(this,U).focus(),Be(this,ts,Pl).call(this))};ts=new WeakSet;Pl=function(){var i;if(E(this,U).offsetWidth===0)return;let e=E(this,F).getBoundingClientRect();if(this.hasAttribute("mediacontroller")||E(this,F).hasAttribute("mediacontroller")||E(this,U).hasAttribute("mediacontroller")){E(this,U).style.zIndex="1",E(this,U).style.bottom="unset",E(this,U).style.top=e.height+"px";return}let t=(i=this.getAttribute("bounds")?ct(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?i:this,a=E(this,U).offsetWidth,r=t.getBoundingClientRect(),n=-Math.max(e.x+a-r.right,0);E(this,U).style.left=`${n}px`};za=new WeakSet;is=function(i=!1){X(this,ki,!E(this,ki)||i),E(this,F).setAttribute("aria-expanded",E(this,ki))};l.customElements.get("media-chrome-selectmenu")||l.customElements.define("media-chrome-selectmenu",me);var os=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},gc=(i,e,t)=>(os(i,e,"read from private field"),t?t.call(i):e.get(i)),as=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ac=(i,e,t,a)=>(os(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),rs=(i,e,t)=>(os(i,e,"access private method"),t),Ja,ns,Hl,Xa,ss,_c=`
|
|
913
913
|
<svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
|
|
914
914
|
<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"/>
|
|
915
915
|
</svg>`,Wl=m.createElement("template");Wl.innerHTML=`
|
|
916
916
|
<slot name="captions-indicator" hidden>${_c}</slot>
|
|
917
|
-
`;var ja=class extends ce{constructor(){super({slotTemplate:Wl}),as(this,ns),as(this,Xa),as(this,Ja,void 0)}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_SUBTITLES_LIST&&t!==a?rs(this,ns,Hl).call(this):e===s.MEDIA_SUBTITLES_SHOWING&&t!==a?this.value=a:e==="aria-multiselectable"&&(this.removeAttribute("aria-multiselectable"),console.warn("Captions List doesn't currently support multiple selections. You can enable multiple items via the media.textTrack API."))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",rs(this,Xa,ss))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",rs(this,Xa,ss))}get mediaSubtitlesList(){return $l(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Vl(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return $l(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Vl(this,s.MEDIA_SUBTITLES_SHOWING,e)}};Ja=new WeakMap;ns=new WeakSet;Hl=function(){var i;if(gc(this,Ja)===JSON.stringify(this.mediaSubtitlesList))return;Ac(this,Ja,JSON.stringify(this.mediaSubtitlesList));let e=this.shadowRoot.querySelector("#container");e.textContent="";let t=!this.value,a=Ce(this.formatOptionText("Off"),"off",t);a.prepend(ve(this,"select-indicator")),e.append(a);let r=this.mediaSubtitlesList;for(let n of r){let o=Ce(this.formatOptionText(n.label,n),ua(n),this.value==ua(n));o.prepend(ve(this,"select-indicator")),((i=n.kind)!=null?i:"subs")==="captions"&&o.append(ve(this,"captions-indicator")),e.append(o)}};Xa=new WeakSet;ss=function(){if(
|
|
917
|
+
`;var ja=class extends ce{constructor(){super({slotTemplate:Wl}),as(this,ns),as(this,Xa),as(this,Ja,void 0)}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",s.MEDIA_SUBTITLES_LIST,s.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_SUBTITLES_LIST&&t!==a?rs(this,ns,Hl).call(this):e===s.MEDIA_SUBTITLES_SHOWING&&t!==a?this.value=a:e==="aria-multiselectable"&&(this.removeAttribute("aria-multiselectable"),console.warn("Captions List doesn't currently support multiple selections. You can enable multiple items via the media.textTrack API."))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",rs(this,Xa,ss))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",rs(this,Xa,ss))}get mediaSubtitlesList(){return $l(this,s.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Vl(this,s.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return $l(this,s.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Vl(this,s.MEDIA_SUBTITLES_SHOWING,e)}};Ja=new WeakMap;ns=new WeakSet;Hl=function(){var i;if(gc(this,Ja)===JSON.stringify(this.mediaSubtitlesList))return;Ac(this,Ja,JSON.stringify(this.mediaSubtitlesList));let e=this.shadowRoot.querySelector("#container");e.textContent="";let t=!this.value,a=Ce(this.formatOptionText("Off"),"off",t);a.prepend(ve(this,"select-indicator")),e.append(a);let r=this.mediaSubtitlesList;for(let n of r){let o=Ce(this.formatOptionText(n.label,n),ua(n),this.value==ua(n));o.prepend(ve(this,"select-indicator")),((i=n.kind)!=null?i:"subs")==="captions"&&o.append(ve(this,"captions-indicator")),e.append(o)}};Xa=new WeakSet;ss=function(){if(Ne(this,!1),!this.value)return;let i=new l.CustomEvent(v.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};var $l=(i,e)=>{let t=i.getAttribute(e);return t?ui(t):[]},Vl=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=ht(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};l.customElements.get("media-captions-listbox")||l.customElements.define("media-captions-listbox",ja);var er=class extends me{init(){let e=m.createElement("media-captions-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-captions-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-captions-selectmenu")||l.customElements.define("media-captions-selectmenu",er);var Fl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},tr=(i,e,t)=>(Fl(i,e,"read from private field"),t?t.call(i):e.get(i)),ls=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Mi=(i,e,t)=>(Fl(i,e,"access private method"),t),Jt,Li,ir,ar,us,ds={RATES:"rates"},rr=class extends ce{constructor(){super(),ls(this,Li),ls(this,ar),ls(this,Jt,new qe(this,ds.RATES,{defaultValue:Tn})),Mi(this,Li,ir).call(this)}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",s.MEDIA_PLAYBACK_RATE,ds.RATES]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_PLAYBACK_RATE&&t!=a?this.value=a:e===ds.RATES&&t!=a&&(tr(this,Jt).value=a,Mi(this,Li,ir).call(this))}get rates(){return tr(this,Jt)}set rates(e){e?Array.isArray(e)&&(tr(this,Jt).value=e.join(" ")):tr(this,Jt).value="",Mi(this,Li,ir).call(this)}get mediaPlaybackRate(){return S(this,s.MEDIA_PLAYBACK_RATE,Vt)}set mediaPlaybackRate(e){x(this,s.MEDIA_PLAYBACK_RATE,e)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Mi(this,ar,us))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Mi(this,ar,us))}};Jt=new WeakMap;Li=new WeakSet;ir=function(){let i=this.shadowRoot.querySelector("#container");i.textContent="";for(let e of this.rates){let t=Ce(this.formatOptionText(`${e}x`,e),e,this.mediaPlaybackRate==e);t.prepend(ve(this,"select-indicator")),i.append(t)}};ar=new WeakSet;us=function(){if(!this.value)return;let i=new l.CustomEvent(v.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-playback-rate-listbox")||l.customElements.define("media-playback-rate-listbox",rr);var nr=class extends me{init(){let e=m.createElement("media-playback-rate-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-playback-rate-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-playback-rate-selectmenu")||l.customElements.define("media-playback-rate-selectmenu",nr);var ps=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Kl=(i,e,t)=>(ps(i,e,"read from private field"),t?t.call(i):e.get(i)),sr=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},cs=(i,e,t,a)=>(ps(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),or=(i,e,t)=>(ps(i,e,"access private method"),t),Ci,ur,lr,ms,dr,hs,cr=class extends ce{constructor(){super(...arguments),sr(this,lr),sr(this,dr),sr(this,Ci,[]),sr(this,ur,void 0)}static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_RENDITION_LIST,s.MEDIA_RENDITION_SELECTED]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===s.MEDIA_RENDITION_SELECTED&&t!==a?this.value=a!=null?a:"auto":e===s.MEDIA_RENDITION_LIST&&t!==a&&(cs(this,Ci,so(a)),or(this,lr,ms).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",or(this,dr,hs))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",or(this,dr,hs))}get mediaRenditionList(){return Kl(this,Ci)}set mediaRenditionList(e){cs(this,Ci,e),or(this,lr,ms).call(this)}get mediaRenditionSelected(){return w(this,s.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){M(this,s.MEDIA_RENDITION_SELECTED,e)}};Ci=new WeakMap;ur=new WeakMap;lr=new WeakSet;ms=function(){if(Kl(this,ur)===JSON.stringify(this.mediaRenditionList))return;cs(this,ur,JSON.stringify(this.mediaRenditionList));let i=this.mediaRenditionList.sort((r,n)=>n.height-r.height),e=this.shadowRoot.querySelector("#container");e.textContent="";let t=!this.mediaRenditionSelected;for(let r of i){let n=this.formatOptionText(`${Math.min(r.width,r.height)}p`,r),o=Ce(n,`${r.id}`,r.selected&&!t);o.prepend(ve(this,"select-indicator")),e.append(o)}let a=Ce(this.formatOptionText("Auto"),"auto",t);a.prepend(ve(this,"select-indicator")),e.append(a)};dr=new WeakSet;hs=function(){if(this.value==null)return;let i=new l.CustomEvent(v.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-rendition-listbox")||l.customElements.define("media-rendition-listbox",cr);var yc=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
918
918
|
<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" />
|
|
919
919
|
</svg>`,Yl=m.createElement("template");Yl.innerHTML=`
|
|
920
920
|
<slot name="icon">${yc}</slot>
|
|
@@ -923,8 +923,8 @@ svg, img, ::slotted(svg), ::slotted(img) {
|
|
|
923
923
|
<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"/>
|
|
924
924
|
</svg>`,Zl=m.createElement("template");Zl.innerHTML=`
|
|
925
925
|
<slot name="icon">${Tc}</slot>
|
|
926
|
-
`;var As=class extends L{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}constructor(){super({slotTemplate:Zl})}get mediaAudioTrackEnabled(){return w(this,s.MEDIA_AUDIO_TRACK_ENABLED)}set mediaAudioTrackEnabled(e){M(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};l.customElements.get("media-audio-track-button")||l.customElements.define("media-audio-track-button",As);var gr=class extends me{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}init(){let e=m.createElement("media-audio-track-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-audio-track-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-audio-track-selectmenu")||l.customElements.define("media-audio-track-selectmenu",gr);var g=Fd(require("@mux/mux-video")),P=require("@mux/playback-core");var id=require("@mux/mux-video");var Ic="en",
|
|
927
|
-
${a}${i.file}`}et(e)}var J={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},At={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},td=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),Cc=id.VideoEvents.filter(i=>i!=="error"),Rc=Object.values(J).filter(i=>![J.PLAYSINLINE].includes(i)),wc=Object.values(At);function ad(i){i.querySelectorAll(":scope > track").forEach(e=>{var t;(t=i.media)==null||t.append(e.cloneNode())}),Cc.forEach(e=>{var t;(t=i.media)==null||t.addEventListener(e,a=>{i.dispatchEvent(new Event(a.type))})})}var Ss=class extends B.HTMLElement{static get observedAttributes(){return[...Rc,...wc]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var r;(r=this.media)==null||r.append(a.cloneNode())});let e=a=>{for(let r of a)r.type==="childList"&&(r.removedNodes.forEach(n=>{var d,u;let o=(d=this.media)==null?void 0:d.querySelector(`track[src="${n.src}"]`);o&&((u=this.media)==null||u.removeChild(o))}),r.addedNodes.forEach(n=>{var o;(o=this.media)==null||o.append(n.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,a){var r,n;switch(e){case At.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case At.VOLUME:{let o=(r=Be(a))!=null?r:1;this.media&&(this.media.volume=o);return}case At.PLAYBACKRATE:{let o=(n=Be(a))!=null?n:1;this.media&&(this.media.playbackRate=o,this.media.defaultPlaybackRate=o);return}}}play(){var e,t;return(t=(e=this.media)==null?void 0:e.play())!=null?t:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e,t;return(t=(e=this.media)==null?void 0:e.buffered)!=null?t:td}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:td}get readyState(){var e,t;return(t=(e=this.media)==null?void 0:e.readyState)!=null?t:0}get videoWidth(){var e,t;return(t=(e=this.media)==null?void 0:e.videoWidth)!=null?t:0}get videoHeight(){var e,t;return(t=(e=this.media)==null?void 0:e.videoHeight)!=null?t:0}get currentTime(){var e,t;return(t=(e=this.media)==null?void 0:e.currentTime)!=null?t:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,t;return(t=(e=this.media)==null?void 0:e.volume)!=null?t:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,t;return(t=(e=this.media)==null?void 0:e.playbackRate)!=null?t:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=Be(this.getAttribute(At.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(At.PLAYBACKRATE,`${e}`):this.removeAttribute(At.PLAYBACKRATE)}get crossOrigin(){return Di(this,J.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(J.CROSSORIGIN,`${e}`)}get autoplay(){return Di(this,J.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(J.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(J.AUTOPLAY)}get loop(){return Di(this,J.LOOP)!=null}set loop(e){e?this.setAttribute(J.LOOP,""):this.removeAttribute(J.LOOP)}get muted(){var e,t;return(t=(e=this.media)==null?void 0:e.muted)!=null?t:!1}set muted(e){this.media&&(this.media.muted=Boolean(e))}get defaultMuted(){return Di(this,J.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(J.MUTED,""):this.removeAttribute(J.MUTED)}get playsInline(){return Di(this,J.PLAYSINLINE)!=null}set playsInline(e){be("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(J.PRELOAD,e):this.removeAttribute(J.PRELOAD)}};function Di(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var Ms=Ss;var Dc=Object.defineProperty,xc=(i,e,t)=>e in i?Dc(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Oc=(i,e,t)=>(xc(i,typeof e!="symbol"?e+"":e,t),t),ld=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_=(i,e,t)=>(ld(i,e,"read from private field"),t?t.call(i):e.get(i)),De=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},$e=(i,e,t,a)=>(ld(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),jt,Sr,_t,xi,tt,it,at,yt,ei,Mr,fe,rd=1,nd=0,Nc=1,Uc={processCallback(i,e,t){if(!!t){for(let[a,r]of e)if(a in t){let n=t[a];typeof n=="boolean"&&r instanceof ee&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof ee?r.element[r.attributeName]=n:r.value=n}}}},Ve=class extends l.DocumentFragment{constructor(e,t,a=Uc){var r;super(),De(this,jt,void 0),De(this,Sr,void 0),this.append(e.content.cloneNode(!0)),$e(this,jt,dd(this)),$e(this,Sr,a),(r=a.createCallback)==null||r.call(a,this,_(this,jt),t),a.processCallback(this,_(this,jt),t)}update(e){_(this,Sr).processCallback(this,_(this,jt),e)}};jt=new WeakMap;Sr=new WeakMap;var dd=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new Ls;for([t,a]of od(r.value))if(!t)n.append(a);else{let o=new ee(i,r.name,r.namespaceURI);n.append(o),e.push([a,o])}r.value=n.toString()}for(let r of i.childNodes)if(r.nodeType===rd&&!(r instanceof HTMLTemplateElement))dd(r,e);else if(r.nodeType===rd||r.data.includes("{{")){let n=[];if(r.data)for([t,a]of od(r.data))if(!t)n.push(new Text(a));else{let o=new He(i);n.push(o),e.push([a,o])}else if(r instanceof HTMLTemplateElement){let o=new Oi(i,r);n.push(o),e.push([o.expression,o])}r.replaceWith(...n.flatMap(o=>o.replacementNodes||[o]))}return e},sd={},od=i=>{let e="",t=0,a=sd[i],r=0,n;if(a)return a;for(a=[];n=i[r];r++)n==="{"&&i[r+1]==="{"&&i[r-1]!=="\\"&&i[r+2]&&++t==1?(e&&a.push([nd,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([Nc,e.trim()]),e="",r++):e+=n||"";return e&&a.push([nd,(t>0?"{{":"")+e]),sd[i]=a},Pc=11,Lr=class{get value(){return""}set value(e){}toString(){return this.value}},ud=new WeakMap,Ls=class{constructor(){De(this,_t,[])}[Symbol.iterator](){return _(this,_t).values()}get length(){return _(this,_t).length}item(e){return _(this,_t)[e]}append(...e){for(let t of e)t instanceof ee&&ud.set(t,this),_(this,_t).push(t)}toString(){return _(this,_t).join("")}};_t=new WeakMap;var ee=class extends Lr{constructor(e,t,a){super(),De(this,yt),De(this,xi,""),De(this,tt,void 0),De(this,it,void 0),De(this,at,void 0),$e(this,tt,e),$e(this,it,t),$e(this,at,a)}get attributeName(){return _(this,it)}get attributeNamespace(){return _(this,at)}get element(){return _(this,tt)}get value(){return _(this,xi)}set value(e){_(this,xi)!==e&&($e(this,xi,e),!_(this,yt,ei)||_(this,yt,ei).length===1?e==null?_(this,tt).removeAttributeNS(_(this,at),_(this,it)):_(this,tt).setAttributeNS(_(this,at),_(this,it),e):_(this,tt).setAttributeNS(_(this,at),_(this,it),_(this,yt,ei)))}get booleanValue(){return _(this,tt).hasAttributeNS(_(this,at),_(this,it))}set booleanValue(e){if(!_(this,yt,ei)||_(this,yt,ei).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};xi=new WeakMap;tt=new WeakMap;it=new WeakMap;at=new WeakMap;yt=new WeakSet;ei=function(){return ud.get(this)};var He=class extends Lr{constructor(e,t){super(),De(this,Mr,void 0),De(this,fe,void 0),$e(this,Mr,e),$e(this,fe,t?[...t]:[new Text])}get replacementNodes(){return _(this,fe)}get parentNode(){return _(this,Mr)}get nextSibling(){return _(this,fe)[_(this,fe).length-1].nextSibling}get previousSibling(){return _(this,fe)[0].previousSibling}get value(){return _(this,fe).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let t=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===Pc?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),$e(this,fe,Bc(_(this,fe)[0].parentNode,_(this,fe),t,this.nextSibling))}};Mr=new WeakMap;fe=new WeakMap;var Oi=class extends He{constructor(e,t){let a=t.getAttribute("directive")||t.getAttribute("type"),r=t.getAttribute("expression")||t.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),Oc(this,"directive"),this.expression=r,this.template=t,this.directive=a}};function Bc(i,e,t,a=null){let r=0,n,o,d,u=t.length,c=e.length;for(;r<u&&r<c&&e[r]==t[r];)r++;for(;r<u&&r<c&&t[u-1]==e[c-1];)a=t[--c,--u];if(r==c)for(;r<u;)i.insertBefore(t[r++],a);if(r==u)for(;r<c;)i.removeChild(e[r++]);else{for(n=e[r];r<u;)d=t[r++],o=n?n.nextSibling:a,n==d?n=o:r<u&&t[r]==o?(i.replaceChild(d,n),n=o):i.insertBefore(d,n);for(;n!=a;)o=n.nextSibling,i.removeChild(n),n=o}return t}var cd={string:i=>String(i)},Rr=class{constructor(e){this.template=e,this.state=void 0}},Tt=new WeakMap,It=new WeakMap,Cs={partial:(i,e)=>{e[i.expression]=new Rr(i.template)},if:(i,e)=>{var t;if(hd(i.expression,e))if(Tt.get(i)!==i.template){Tt.set(i,i.template);let a=new Ve(i.template,e,wr);i.replace(a),It.set(i,a)}else(t=It.get(i))==null||t.update(e);else i.replace(""),Tt.delete(i),It.delete(i)}},$c=Object.keys(Cs),wr={processCallback(i,e,t){var a,r;if(!!t)for(let[n,o]of e){if(o instanceof Oi){if(!o.directive){let u=$c.find(c=>o.template.hasAttribute(c));u&&(o.directive=u,o.expression=o.template.getAttribute(u))}(a=Cs[o.directive])==null||a.call(Cs,o,t);continue}let d=hd(n,t);if(d instanceof Rr){Tt.get(o)!==d.template?(Tt.set(o,d.template),d=new Ve(d.template,d.state,wr),o.value=d,It.set(o,d)):(r=It.get(o))==null||r.update(d.state);continue}d?(o instanceof ee&&o.attributeName.startsWith("aria-")&&(d=String(d)),o instanceof ee?typeof d=="boolean"?o.booleanValue=d:typeof d=="function"?o.element[o.attributeName]=d:o.value=d:(o.value=d,Tt.delete(o),It.delete(o))):o instanceof ee?o.value=void 0:(o.value=void 0,Tt.delete(o),It.delete(o))}}},md={"!":i=>!i,"!!":i=>!!i,"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>i<e,"<=":(i,e)=>i<=e,"??":(i,e)=>i!=null?i:e,"|":(i,e)=>{var t;return(t=cd[e])==null?void 0:t.call(cd,i)}};function Vc(i){return Hc(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function hd(i,e={}){var t,a,r,n,o,d,u;let c=Vc(i);if(c.length===0||c.some(({type:h})=>!h))return Ni(i);if(((t=c[0])==null?void 0:t.token)===">"){let h=e[(a=c[1])==null?void 0:a.token];if(!h)return Ni(i);let f={...e};h.state=f;let b=c.slice(2);for(let T=0;T<b.length;T+=3){let V=(r=b[T])==null?void 0:r.token,G=(n=b[T+1])==null?void 0:n.token,I=(o=b[T+2])==null?void 0:o.token;V&&G==="="&&(f[V]=Ui(I,e))}return h}if(c.length===1)return Cr(c[0])?Ui(c[0].token,e):Ni(i);if(c.length===2){let h=(d=c[0])==null?void 0:d.token,f=md[h];if(!f||!Cr(c[1]))return Ni(i);let b=Ui(c[1].token,e);return f(b)}if(c.length===3){let h=(u=c[1])==null?void 0:u.token,f=md[h];if(!f||!Cr(c[0])||!Cr(c[2]))return Ni(i);let b=Ui(c[0].token,e);if(h==="|")return f(b,c[2].token);let T=Ui(c[2].token,e);return f(b,T)}}function Ni(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function Cr({type:i}){return["number","boolean","string","param"].includes(i)}function Ui(i,e){let t=i[0],a=i.slice(-1);return i==="true"||i==="false"?i==="true":t===a&&["'",'"'].includes(t)?i.slice(1,-1):Xi(i)?parseFloat(i):e[i]}function Hc(i,e){let t,a,r,n=[];for(;i;){r=null,t=i.length;for(let o in e)a=e[o].exec(i),a&&a.index<t&&(r={token:a[0],type:o,matches:a.slice(1)},t=a.index);t&&n.push({token:i.substr(0,t),type:void 0}),r&&n.push(r),i=i.substr(t+(r?r.token.length:0))}return n}var Wc=Object.defineProperty,Fc=(i,e,t)=>e in i?Wc(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Bi=(i,e,t)=>(Fc(i,typeof e!="symbol"?e+"":e,t),t),Ns=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ds=(i,e,t)=>(Ns(i,e,"read from private field"),t?t.call(i):e.get(i)),Pi=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},kt=(i,e,t,a)=>(Ns(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Rs=(i,e,t)=>(Ns(i,e,"access private method"),t),ti,Dr,ii,xs,pd,xr,Os,ws={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Ed=m.createElement("template");Ed.innerHTML=`
|
|
926
|
+
`;var As=class extends L{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}constructor(){super({slotTemplate:Zl})}get mediaAudioTrackEnabled(){return w(this,s.MEDIA_AUDIO_TRACK_ENABLED)}set mediaAudioTrackEnabled(e){M(this,s.MEDIA_AUDIO_TRACK_ENABLED,e)}};l.customElements.get("media-audio-track-button")||l.customElements.define("media-audio-track-button",As);var gr=class extends me{static get observedAttributes(){return[...super.observedAttributes,s.MEDIA_AUDIO_TRACK_ENABLED,s.MEDIA_AUDIO_TRACK_UNAVAILABLE]}init(){let e=m.createElement("media-audio-track-button");e.part.add("button"),e.preventClick=!0;let t=m.createElement("media-audio-track-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};l.customElements.get("media-audio-track-selectmenu")||l.customElements.define("media-audio-track-selectmenu",gr);var g=Fd(require("@mux/mux-video")),P=require("@mux/playback-core");var id=require("@mux/mux-video");var Ic="en",ft={code:Ic};var ql="en";function y(i,e=!0){var r,n;let t=e&&(n=(r=ft)==null?void 0:r[i])!=null?n:i,a=e?ft.code:ql;return new _s(t,a)}var _s=class{constructor(e,t=(a=>(a=ft.code)!=null?a:ql)()){this.message=e,this.locale=t}format(e){return this.message.replace(/\{(\w+)\}/g,(t,a)=>{var r;return(r=e[a])!=null?r:""})}toString(){return this.message}};function Ql(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${Ar(t)}: ${a}; `)}),e?e.trim():void 0}function Ar(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function _r(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function $e(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function yr(i){let e=kc(i).toString();return e?"?"+e:""}function kc(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}function et(i){let e=(i!=null?i:"").split(".")[1];if(!e)return{};let t=e.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(t).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}var ys=(i,e)=>!i||!e?!1:i.contains(e)?!0:ys(i,e.getRootNode().host);var Tr=require("@mux/playback-core");var Ts="mux.com",Sc=()=>{try{return"1.14.2"}catch{}return"UNKNOWN"},Mc=Sc(),kr=()=>Mc,Is=(i,{maxResolution:e,token:t,domain:a=Ts}={})=>{let o=!!t?{token:t}:{redundant_streams:!0,...e?{max_resolution:e}:{}};return`https://stream.${a}/${i}.m3u8${yr(o)}`},zl=(i,{token:e,thumbnailTime:t,domain:a=Ts}={})=>{let r=e==null?t:void 0,{aud:n}=et(e);if(!(e&&n!=="t"))return`https://image.${a}/${i}/thumbnail.webp${yr({token:e,time:r})}`},Xl=(i,{token:e,domain:t=Ts}={})=>{let{aud:a}=et(e);if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${yr({token:e,format:"webp"})}`},wi=i=>{if(!!i){if([Tr.StreamTypes.LIVE,Tr.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return Tr.StreamTypes.LIVE}};var Lc={crossorigin:"crossOrigin",playsinline:"playsInline"};function Jl(i){var e;return(e=Lc[i])!=null?e:_r(i)}var gt,At,j,Ir=class{constructor(e,t){W(this,gt,void 0);W(this,At,void 0);W(this,j,[]);le(this,gt,e),le(this,At,t)}[Symbol.iterator](){return k(this,j).values()}get length(){return k(this,j).length}get value(){var e;return(e=k(this,j).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(le(this,j,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return k(this,j)[e]}values(){return k(this,j).values()}keys(){return k(this,j).keys()}forEach(e){k(this,j).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||k(this,j).push(r)}),!(this.value===""&&!((t=k(this,gt))!=null&&t.hasAttribute(`${k(this,At)}`)))&&((a=k(this,gt))==null||a.setAttribute(`${k(this,At)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{k(this,j).splice(k(this,j).indexOf(a),1)}),(t=k(this,gt))==null||t.setAttribute(`${k(this,At)}`,`${this.value}`)}contains(e){return k(this,j).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};gt=new WeakMap,At=new WeakMap,j=new WeakMap;var jl=`[mux-player ${kr()}]`;function tt(...i){console.warn(jl,...i)}function be(...i){console.error(jl,...i)}function ks(i){var t;let e=(t=i.message)!=null?t:"";if(i.context&&(e+=` ${i.context}`),i.file){let a="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${y("Read more: ")}
|
|
927
|
+
${a}${i.file}`}tt(e)}var J={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},_t={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},td=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),Cc=id.VideoEvents.filter(i=>i!=="error"),Rc=Object.values(J).filter(i=>![J.PLAYSINLINE].includes(i)),wc=Object.values(_t);function ad(i){i.querySelectorAll(":scope > track").forEach(e=>{var t;(t=i.media)==null||t.append(e.cloneNode())}),Cc.forEach(e=>{var t;(t=i.media)==null||t.addEventListener(e,a=>{i.dispatchEvent(new Event(a.type))})})}var Ss=class extends B.HTMLElement{static get observedAttributes(){return[...Rc,...wc]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var r;(r=this.media)==null||r.append(a.cloneNode())});let e=a=>{for(let r of a)r.type==="childList"&&(r.removedNodes.forEach(n=>{var d,u;let o=(d=this.media)==null?void 0:d.querySelector(`track[src="${n.src}"]`);o&&((u=this.media)==null||u.removeChild(o))}),r.addedNodes.forEach(n=>{var o;(o=this.media)==null||o.append(n.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,a){var r,n;switch(e){case _t.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case _t.VOLUME:{let o=(r=$e(a))!=null?r:1;this.media&&(this.media.volume=o);return}case _t.PLAYBACKRATE:{let o=(n=$e(a))!=null?n:1;this.media&&(this.media.playbackRate=o,this.media.defaultPlaybackRate=o);return}}}play(){var e,t;return(t=(e=this.media)==null?void 0:e.play())!=null?t:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e,t;return(t=(e=this.media)==null?void 0:e.buffered)!=null?t:td}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:td}get readyState(){var e,t;return(t=(e=this.media)==null?void 0:e.readyState)!=null?t:0}get videoWidth(){var e,t;return(t=(e=this.media)==null?void 0:e.videoWidth)!=null?t:0}get videoHeight(){var e,t;return(t=(e=this.media)==null?void 0:e.videoHeight)!=null?t:0}get currentTime(){var e,t;return(t=(e=this.media)==null?void 0:e.currentTime)!=null?t:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,t;return(t=(e=this.media)==null?void 0:e.volume)!=null?t:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,t;return(t=(e=this.media)==null?void 0:e.playbackRate)!=null?t:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=$e(this.getAttribute(_t.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(_t.PLAYBACKRATE,`${e}`):this.removeAttribute(_t.PLAYBACKRATE)}get crossOrigin(){return Di(this,J.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(J.CROSSORIGIN,`${e}`)}get autoplay(){return Di(this,J.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(J.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(J.AUTOPLAY)}get loop(){return Di(this,J.LOOP)!=null}set loop(e){e?this.setAttribute(J.LOOP,""):this.removeAttribute(J.LOOP)}get muted(){var e,t;return(t=(e=this.media)==null?void 0:e.muted)!=null?t:!1}set muted(e){this.media&&(this.media.muted=Boolean(e))}get defaultMuted(){return Di(this,J.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(J.MUTED,""):this.removeAttribute(J.MUTED)}get playsInline(){return Di(this,J.PLAYSINLINE)!=null}set playsInline(e){be("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(J.PRELOAD,e):this.removeAttribute(J.PRELOAD)}};function Di(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var Ms=Ss;var Dc=Object.defineProperty,xc=(i,e,t)=>e in i?Dc(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Oc=(i,e,t)=>(xc(i,typeof e!="symbol"?e+"":e,t),t),ld=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_=(i,e,t)=>(ld(i,e,"read from private field"),t?t.call(i):e.get(i)),De=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ve=(i,e,t,a)=>(ld(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),jt,Sr,yt,xi,it,at,rt,Tt,ei,Mr,fe,rd=1,nd=0,Nc=1,Uc={processCallback(i,e,t){if(!!t){for(let[a,r]of e)if(a in t){let n=t[a];typeof n=="boolean"&&r instanceof ee&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof ee?r.element[r.attributeName]=n:r.value=n}}}},He=class extends l.DocumentFragment{constructor(e,t,a=Uc){var r;super(),De(this,jt,void 0),De(this,Sr,void 0),this.append(e.content.cloneNode(!0)),Ve(this,jt,dd(this)),Ve(this,Sr,a),(r=a.createCallback)==null||r.call(a,this,_(this,jt),t),a.processCallback(this,_(this,jt),t)}update(e){_(this,Sr).processCallback(this,_(this,jt),e)}};jt=new WeakMap;Sr=new WeakMap;var dd=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new Ls;for([t,a]of od(r.value))if(!t)n.append(a);else{let o=new ee(i,r.name,r.namespaceURI);n.append(o),e.push([a,o])}r.value=n.toString()}for(let r of i.childNodes)if(r.nodeType===rd&&!(r instanceof HTMLTemplateElement))dd(r,e);else if(r.nodeType===rd||r.data.includes("{{")){let n=[];if(r.data)for([t,a]of od(r.data))if(!t)n.push(new Text(a));else{let o=new We(i);n.push(o),e.push([a,o])}else if(r instanceof HTMLTemplateElement){let o=new Oi(i,r);n.push(o),e.push([o.expression,o])}r.replaceWith(...n.flatMap(o=>o.replacementNodes||[o]))}return e},sd={},od=i=>{let e="",t=0,a=sd[i],r=0,n;if(a)return a;for(a=[];n=i[r];r++)n==="{"&&i[r+1]==="{"&&i[r-1]!=="\\"&&i[r+2]&&++t==1?(e&&a.push([nd,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([Nc,e.trim()]),e="",r++):e+=n||"";return e&&a.push([nd,(t>0?"{{":"")+e]),sd[i]=a},Pc=11,Lr=class{get value(){return""}set value(e){}toString(){return this.value}},ud=new WeakMap,Ls=class{constructor(){De(this,yt,[])}[Symbol.iterator](){return _(this,yt).values()}get length(){return _(this,yt).length}item(e){return _(this,yt)[e]}append(...e){for(let t of e)t instanceof ee&&ud.set(t,this),_(this,yt).push(t)}toString(){return _(this,yt).join("")}};yt=new WeakMap;var ee=class extends Lr{constructor(e,t,a){super(),De(this,Tt),De(this,xi,""),De(this,it,void 0),De(this,at,void 0),De(this,rt,void 0),Ve(this,it,e),Ve(this,at,t),Ve(this,rt,a)}get attributeName(){return _(this,at)}get attributeNamespace(){return _(this,rt)}get element(){return _(this,it)}get value(){return _(this,xi)}set value(e){_(this,xi)!==e&&(Ve(this,xi,e),!_(this,Tt,ei)||_(this,Tt,ei).length===1?e==null?_(this,it).removeAttributeNS(_(this,rt),_(this,at)):_(this,it).setAttributeNS(_(this,rt),_(this,at),e):_(this,it).setAttributeNS(_(this,rt),_(this,at),_(this,Tt,ei)))}get booleanValue(){return _(this,it).hasAttributeNS(_(this,rt),_(this,at))}set booleanValue(e){if(!_(this,Tt,ei)||_(this,Tt,ei).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};xi=new WeakMap;it=new WeakMap;at=new WeakMap;rt=new WeakMap;Tt=new WeakSet;ei=function(){return ud.get(this)};var We=class extends Lr{constructor(e,t){super(),De(this,Mr,void 0),De(this,fe,void 0),Ve(this,Mr,e),Ve(this,fe,t?[...t]:[new Text])}get replacementNodes(){return _(this,fe)}get parentNode(){return _(this,Mr)}get nextSibling(){return _(this,fe)[_(this,fe).length-1].nextSibling}get previousSibling(){return _(this,fe)[0].previousSibling}get value(){return _(this,fe).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let t=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===Pc?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),Ve(this,fe,Bc(_(this,fe)[0].parentNode,_(this,fe),t,this.nextSibling))}};Mr=new WeakMap;fe=new WeakMap;var Oi=class extends We{constructor(e,t){let a=t.getAttribute("directive")||t.getAttribute("type"),r=t.getAttribute("expression")||t.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),Oc(this,"directive"),this.expression=r,this.template=t,this.directive=a}};function Bc(i,e,t,a=null){let r=0,n,o,d,u=t.length,c=e.length;for(;r<u&&r<c&&e[r]==t[r];)r++;for(;r<u&&r<c&&t[u-1]==e[c-1];)a=t[--c,--u];if(r==c)for(;r<u;)i.insertBefore(t[r++],a);if(r==u)for(;r<c;)i.removeChild(e[r++]);else{for(n=e[r];r<u;)d=t[r++],o=n?n.nextSibling:a,n==d?n=o:r<u&&t[r]==o?(i.replaceChild(d,n),n=o):i.insertBefore(d,n);for(;n!=a;)o=n.nextSibling,i.removeChild(n),n=o}return t}var cd={string:i=>String(i)},Rr=class{constructor(e){this.template=e,this.state=void 0}},It=new WeakMap,kt=new WeakMap,Cs={partial:(i,e)=>{e[i.expression]=new Rr(i.template)},if:(i,e)=>{var t;if(hd(i.expression,e))if(It.get(i)!==i.template){It.set(i,i.template);let a=new He(i.template,e,wr);i.replace(a),kt.set(i,a)}else(t=kt.get(i))==null||t.update(e);else i.replace(""),It.delete(i),kt.delete(i)}},$c=Object.keys(Cs),wr={processCallback(i,e,t){var a,r;if(!!t)for(let[n,o]of e){if(o instanceof Oi){if(!o.directive){let u=$c.find(c=>o.template.hasAttribute(c));u&&(o.directive=u,o.expression=o.template.getAttribute(u))}(a=Cs[o.directive])==null||a.call(Cs,o,t);continue}let d=hd(n,t);if(d instanceof Rr){It.get(o)!==d.template?(It.set(o,d.template),d=new He(d.template,d.state,wr),o.value=d,kt.set(o,d)):(r=kt.get(o))==null||r.update(d.state);continue}d?(o instanceof ee&&o.attributeName.startsWith("aria-")&&(d=String(d)),o instanceof ee?typeof d=="boolean"?o.booleanValue=d:typeof d=="function"?o.element[o.attributeName]=d:o.value=d:(o.value=d,It.delete(o),kt.delete(o))):o instanceof ee?o.value=void 0:(o.value=void 0,It.delete(o),kt.delete(o))}}},md={"!":i=>!i,"!!":i=>!!i,"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>i<e,"<=":(i,e)=>i<=e,"??":(i,e)=>i!=null?i:e,"|":(i,e)=>{var t;return(t=cd[e])==null?void 0:t.call(cd,i)}};function Vc(i){return Hc(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function hd(i,e={}){var t,a,r,n,o,d,u;let c=Vc(i);if(c.length===0||c.some(({type:h})=>!h))return Ni(i);if(((t=c[0])==null?void 0:t.token)===">"){let h=e[(a=c[1])==null?void 0:a.token];if(!h)return Ni(i);let f={...e};h.state=f;let b=c.slice(2);for(let T=0;T<b.length;T+=3){let V=(r=b[T])==null?void 0:r.token,G=(n=b[T+1])==null?void 0:n.token,I=(o=b[T+2])==null?void 0:o.token;V&&G==="="&&(f[V]=Ui(I,e))}return h}if(c.length===1)return Cr(c[0])?Ui(c[0].token,e):Ni(i);if(c.length===2){let h=(d=c[0])==null?void 0:d.token,f=md[h];if(!f||!Cr(c[1]))return Ni(i);let b=Ui(c[1].token,e);return f(b)}if(c.length===3){let h=(u=c[1])==null?void 0:u.token,f=md[h];if(!f||!Cr(c[0])||!Cr(c[2]))return Ni(i);let b=Ui(c[0].token,e);if(h==="|")return f(b,c[2].token);let T=Ui(c[2].token,e);return f(b,T)}}function Ni(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function Cr({type:i}){return["number","boolean","string","param"].includes(i)}function Ui(i,e){let t=i[0],a=i.slice(-1);return i==="true"||i==="false"?i==="true":t===a&&["'",'"'].includes(t)?i.slice(1,-1):Xi(i)?parseFloat(i):e[i]}function Hc(i,e){let t,a,r,n=[];for(;i;){r=null,t=i.length;for(let o in e)a=e[o].exec(i),a&&a.index<t&&(r={token:a[0],type:o,matches:a.slice(1)},t=a.index);t&&n.push({token:i.substr(0,t),type:void 0}),r&&n.push(r),i=i.substr(t+(r?r.token.length:0))}return n}var Wc=Object.defineProperty,Fc=(i,e,t)=>e in i?Wc(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Bi=(i,e,t)=>(Fc(i,typeof e!="symbol"?e+"":e,t),t),Ns=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ds=(i,e,t)=>(Ns(i,e,"read from private field"),t?t.call(i):e.get(i)),Pi=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},St=(i,e,t,a)=>(Ns(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Rs=(i,e,t)=>(Ns(i,e,"access private method"),t),ti,Dr,ii,xs,pd,xr,Os,ws={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Ed=m.createElement("template");Ed.innerHTML=`
|
|
928
928
|
<style>
|
|
929
929
|
:host {
|
|
930
930
|
display: inline-block;
|
|
@@ -948,7 +948,7 @@ ${a}${i.file}`}et(e)}var J={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"
|
|
|
948
948
|
display: none;
|
|
949
949
|
}
|
|
950
950
|
</style>
|
|
951
|
-
`;var
|
|
951
|
+
`;var nt=class extends l.HTMLElement{constructor(){super(),Pi(this,xs),Pi(this,xr),Bi(this,"renderRoot"),Bi(this,"renderer"),Pi(this,ti,void 0),Pi(this,Dr,void 0),Pi(this,ii,void 0),this.shadowRoot?this.renderRoot=this.shadowRoot:(this.renderRoot=this.attachShadow({mode:"open"}),this.createRenderer());let e=new MutationObserver(t=>{var a;this.mediaController&&!((a=this.mediaController)!=null&&a.breakpointsComputed)||t.some(r=>{let n=r.target;return n===this?!0:n.localName!=="media-controller"?!1:!!(ws[r.attributeName]||r.attributeName.startsWith("breakpoint"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.addEventListener(xe.BREAKPOINTS_COMPUTED,this.render),Rs(this,xs,pd).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=Ds(this,ti))!=null?e:this.constructor.template}set template(e){St(this,ii,null),St(this,ti,e),this.createRenderer()}get props(){var e,t,a;let r=[...Array.from((t=(e=this.mediaController)==null?void 0:e.attributes)!=null?t:[]).filter(({name:o})=>ws[o]||o.startsWith("breakpoint")),...Array.from(this.attributes)],n={};for(let o of r){let d=(a=ws[o.name])!=null?a:uo(o.name),{value:u}=o;u!=null?(Xi(u)&&(u=parseFloat(u)),n[d]=u===""?!0:u):n[d]=!1}return n}attributeChangedCallback(e,t,a){e==="template"&&t!=a&&Rs(this,xr,Os).call(this)}connectedCallback(){Rs(this,xr,Os).call(this)}createRenderer(){this.template&&this.template!==Ds(this,Dr)&&(St(this,Dr,this.template),this.renderer=new He(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(Ed.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};ti=new WeakMap;Dr=new WeakMap;ii=new WeakMap;xs=new WeakSet;pd=function(i){if(Object.prototype.hasOwnProperty.call(this,i)){let e=this[i];delete this[i],this[i]=e}};xr=new WeakSet;Os=function(){var i;let e=this.getAttribute("template");if(!e||e===Ds(this,ii))return;let t=this.getRootNode(),a=(i=t==null?void 0:t.getElementById)==null?void 0:i.call(t,e);if(a){St(this,ii,e),St(this,ti,a),this.createRenderer();return}Kc(e)&&(St(this,ii,e),Yc(e).then(r=>{let n=m.createElement("template");n.innerHTML=r,St(this,ti,n),this.createRenderer()}).catch(console.error))};Bi(nt,"template");Bi(nt,"observedAttributes",["template"]);Bi(nt,"processor",wr);function Kc(i){if(!/^(\/|\.\/|https?:\/\/)/.test(i))return!1;let e=/^https?:\/\//.test(i)?void 0:location.origin;try{new URL(i,e)}catch{return!1}return!0}async function Yc(i){let e=await fetch(i);if(e.status!==200)throw new Error(`Failed to load resource: the server responded with a status of ${e.status}`);return e.text()}l.customElements.get("media-theme")||l.customElements.define("media-theme",nt);var vd=`:host {
|
|
952
952
|
--media-control-display: var(--controls);
|
|
953
953
|
--media-loading-indicator-display: var(--loading-indicator);
|
|
954
954
|
--media-dialog-display: var(--dialog);
|
|
@@ -1141,7 +1141,7 @@ media-poster-image:not([src]) {
|
|
|
1141
1141
|
<div class="dialog">
|
|
1142
1142
|
<slot></slot>
|
|
1143
1143
|
</div>
|
|
1144
|
-
`;var
|
|
1144
|
+
`;var st=class extends B.HTMLElement{constructor(){var t;super();this.attachShadow({mode:"open"}),(t=this.shadowRoot)==null||t.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),bd(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),Zc(this))}attributeChangedCallback(t,a,r){t==="open"&&a!==r&&(r!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&bd(this)}};st.styles=fd,st.template=gd,st.observedAttributes=["open"];function bd(i){let e=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(i.dispatchEvent(e),e.defaultPrevented)return;let t=i.querySelector("[autofocus]:not([disabled])");!t&&i.tabIndex>=0&&(t=i),t||(t=Ad(i.shadowRoot)),i._previouslyFocusedElement=ne.activeElement,ne.activeElement instanceof HTMLElement&&ne.activeElement.blur(),i.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function Ad(i){let t=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');let a=i==null?void 0:i.querySelector(t.join(", "));if(!a&&"attachShadow"in Element.prototype){let r=(i==null?void 0:i.querySelectorAll("*"))||[];for(let n=0;n<r.length&&!(r[n].tagName&&r[n].shadowRoot&&(a=Ad(r[n].shadowRoot),a));n++);}return a}function Zc(i){i._previouslyFocusedElement instanceof HTMLElement&&i._previouslyFocusedElement.focus()}B.customElements.get("media-dialog")||(B.customElements.define("media-dialog",st),B.MediaDialog=st);var Us=st;var _d=ne.createElement("template");_d.innerHTML=`
|
|
1145
1145
|
<style>
|
|
1146
1146
|
${Us.styles}
|
|
1147
1147
|
|
|
@@ -1172,12 +1172,12 @@ media-poster-image:not([src]) {
|
|
|
1172
1172
|
</svg>
|
|
1173
1173
|
</button>
|
|
1174
1174
|
</slot>
|
|
1175
|
-
`;var $i=class extends Us{constructor(){var e,t;super(),(t=(e=this.shadowRoot)==null?void 0:e.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};$i.template=_d;B.customElements.get("mxp-dialog")||(B.customElements.define("mxp-dialog",$i),B.MxpDialog=$i);var Vi=new WeakMap,Hi=class{constructor(e,t){this.element=e;this.type=t;this.element.addEventListener(this.type,this);let a=Vi.get(this.element);a&&a.set(this.type,this)}set(e){if(typeof e=="function")this.handleEvent=e.bind(this.element);else if(typeof e=="object"&&typeof e.handleEvent=="function")this.handleEvent=e.handleEvent.bind(e);else{this.element.removeEventListener(this.type,this);let t=Vi.get(this.element);t&&t.delete(this.type)}}static for(e){Vi.has(e.element)||Vi.set(e.element,new Map);let t=e.attributeName.slice(2),a=Vi.get(e.element);return a&&a.has(t)?a.get(t):new Hi(e.element,t)}};function qc(i,e){return i instanceof ee&&i.attributeName.startsWith("on")?(Hi.for(i).set(e),i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),!0):!1}function Qc(i,e){return e instanceof Or&&i instanceof
|
|
1175
|
+
`;var $i=class extends Us{constructor(){var e,t;super(),(t=(e=this.shadowRoot)==null?void 0:e.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};$i.template=_d;B.customElements.get("mxp-dialog")||(B.customElements.define("mxp-dialog",$i),B.MxpDialog=$i);var Vi=new WeakMap,Hi=class{constructor(e,t){this.element=e;this.type=t;this.element.addEventListener(this.type,this);let a=Vi.get(this.element);a&&a.set(this.type,this)}set(e){if(typeof e=="function")this.handleEvent=e.bind(this.element);else if(typeof e=="object"&&typeof e.handleEvent=="function")this.handleEvent=e.handleEvent.bind(e);else{this.element.removeEventListener(this.type,this);let t=Vi.get(this.element);t&&t.delete(this.type)}}static for(e){Vi.has(e.element)||Vi.set(e.element,new Map);let t=e.attributeName.slice(2),a=Vi.get(e.element);return a&&a.has(t)?a.get(t):new Hi(e.element,t)}};function qc(i,e){return i instanceof ee&&i.attributeName.startsWith("on")?(Hi.for(i).set(e),i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),!0):!1}function Qc(i,e){return e instanceof Or&&i instanceof We?(e.renderInto(i),!0):!1}function zc(i,e){return e instanceof DocumentFragment&&i instanceof We?(e.childNodes.length&&i.replace(...e.childNodes),!0):!1}function Xc(i,e){if(i instanceof ee){let t=i.attributeNamespace,a=i.element.getAttributeNS(t,i.attributeName);return String(e)!==a&&(i.value=String(e)),!0}return i.value=String(e),!0}function Jc(i,e){if(i instanceof ee&&e instanceof Element){let t=i.element;return t[i.attributeName]!==e&&(i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),t[i.attributeName]=e),!0}return!1}function jc(i,e){if(typeof e=="boolean"&&i instanceof ee){let t=i.attributeNamespace,a=i.element.hasAttributeNS(t,i.attributeName);return e!==a&&(i.booleanValue=e),!0}return!1}function em(i,e){return e===!1&&i instanceof We?(i.replace(""),!0):!1}function tm(i,e){Jc(i,e)||jc(i,e)||qc(i,e)||em(i,e)||Qc(i,e)||zc(i,e)||Xc(i,e)}var Ps=new Map,yd=new WeakMap,Td=new WeakMap,Or=class{constructor(e,t,a){this.strings=e;this.values=t;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(Ps.has(this.stringsKey))return Ps.get(this.stringsKey);{let e=ne.createElement("template"),t=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<t?`{{ ${n} }}`:""),""),Ps.set(this.stringsKey,e),e}}renderInto(e){var r;let t=this.template;if(yd.get(e)!==t){yd.set(e,t);let n=new He(t,this.values,this.processor);Td.set(e,n),e instanceof We?e.replace(...n.children):e.appendChild(n);return}let a=Td.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},im={processCallback(i,e,t){var a;if(!!t){for(let[r,n]of e)if(r in t){let o=(a=t[r])!=null?a:"";tm(n,o)}}}};function Fe(i,...e){return new Or(i,e,im)}function Id(i,e){i.renderInto(e)}var kd=require("@mux/playback-core"),Sd=i=>Fe`
|
|
1176
1176
|
<style>
|
|
1177
1177
|
${vd}
|
|
1178
1178
|
</style>
|
|
1179
1179
|
${rm(i)}
|
|
1180
|
-
`,am=i=>{let e=i.hotKeys?`${i.hotKeys}`:"";return wi(i.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},rm=i=>{var e,t,a,r,n,o,d,u,c,h,f,b,T,V,G,I,re,ge,oe,ni,
|
|
1180
|
+
`,am=i=>{let e=i.hotKeys?`${i.hotKeys}`:"";return wi(i.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},rm=i=>{var e,t,a,r,n,o,d,u,c,h,f,b,T,V,G,I,re,ge,oe,ni,Ct,Hs,Ws,Fs,Ks,Ys,Gs,Zs,qs,Qs,zs,Xs,Js,js;return Fe`
|
|
1181
1181
|
<media-theme
|
|
1182
1182
|
template="${i.themeTemplate||!1}"
|
|
1183
1183
|
defaultstreamtype="${(e=i.defaultStreamType)!=null?e:!1}"
|
|
@@ -1210,7 +1210,7 @@ media-poster-image:not([src]) {
|
|
|
1210
1210
|
debug="${(ge=i.debug)!=null?ge:!1}"
|
|
1211
1211
|
prefer-cmcd="${(oe=i.preferCmcd)!=null?oe:!1}"
|
|
1212
1212
|
disable-cookies="${(ni=i.disableCookies)!=null?ni:!1}"
|
|
1213
|
-
prefer-playback="${(
|
|
1213
|
+
prefer-playback="${(Ct=i.preferPlayback)!=null?Ct:!1}"
|
|
1214
1214
|
start-time="${i.startTime!=null?i.startTime:!1}"
|
|
1215
1215
|
beacon-collection-domain="${(Hs=i.beaconCollectionDomain)!=null?Hs:!1}"
|
|
1216
1216
|
player-software-name="${(Ws=i.playerSoftwareName)!=null?Ws:!1}"
|
|
@@ -1221,7 +1221,7 @@ media-poster-image:not([src]) {
|
|
|
1221
1221
|
cast-src="${i.src?i.src:i.playbackId?Is(i.playbackId,{maxResolution:i.maxResolution,domain:i.customDomain,token:i.tokens.playback}):!1}"
|
|
1222
1222
|
exportparts="video"
|
|
1223
1223
|
>
|
|
1224
|
-
${i.storyboard?
|
|
1224
|
+
${i.storyboard?Fe`<track label="thumbnails" default kind="metadata" src="${i.storyboard}" />`:Fe``}
|
|
1225
1225
|
</mux-video>
|
|
1226
1226
|
<slot name="poster" slot="poster">
|
|
1227
1227
|
<media-poster-image
|
|
@@ -1237,20 +1237,20 @@ media-poster-image:not([src]) {
|
|
|
1237
1237
|
onclose="${i.onCloseErrorDialog}"
|
|
1238
1238
|
oninitfocus="${i.onInitFocusDialog}"
|
|
1239
1239
|
>
|
|
1240
|
-
${(Qs=i.dialog)!=null&&Qs.title?
|
|
1240
|
+
${(Qs=i.dialog)!=null&&Qs.title?Fe`<h3>${i.dialog.title}</h3>`:Fe``}
|
|
1241
1241
|
<p>
|
|
1242
1242
|
${(zs=i.dialog)==null?void 0:zs.message}
|
|
1243
|
-
${(Xs=i.dialog)!=null&&Xs.linkUrl?
|
|
1243
|
+
${(Xs=i.dialog)!=null&&Xs.linkUrl?Fe`<a
|
|
1244
1244
|
href="${i.dialog.linkUrl}"
|
|
1245
1245
|
target="_blank"
|
|
1246
1246
|
rel="external noopener"
|
|
1247
1247
|
aria-label="${(Js=i.dialog.linkText)!=null?Js:""} ${y("(opens in a new window)")}"
|
|
1248
1248
|
>${(js=i.dialog.linkText)!=null?js:i.dialog.linkUrl}</a
|
|
1249
|
-
>`:
|
|
1249
|
+
>`:Fe``}
|
|
1250
1250
|
</p>
|
|
1251
1251
|
</mxp-dialog>
|
|
1252
1252
|
</media-theme>
|
|
1253
|
-
`};var Wi=require("@mux/mux-video");function Nr(i,e,t,a,r){var d,u,c;let n={},o={};switch(i.code){case Wi.MediaError.MEDIA_ERR_NETWORK:{switch(n.title=y("Network Error",r),n.message=i.message,(d=i.data)==null?void 0:d.response.code){case 412:{n.title=y("Video is not currently available",r),n.message=y("The live stream or video file are not yet ready.",r),o.message=y("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),o.file="412-not-playable.md";break}case 404:{n.title=y("Video does not exist",r),n.message="",o.message=y("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),o.file="404-not-found.md";break}case 403:{if(n.title=y("Invalid playback URL",r),n.message=y("The video URL or playback-token are formatted with incorrect or incomplete information.",r),o.message=y("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",r),o.file="missing-signed-tokens.md",!a)break;let{exp:h,aud:f,sub:b}=
|
|
1253
|
+
`};var Wi=require("@mux/mux-video");function Nr(i,e,t,a,r){var d,u,c;let n={},o={};switch(i.code){case Wi.MediaError.MEDIA_ERR_NETWORK:{switch(n.title=y("Network Error",r),n.message=i.message,(d=i.data)==null?void 0:d.response.code){case 412:{n.title=y("Video is not currently available",r),n.message=y("The live stream or video file are not yet ready.",r),o.message=y("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),o.file="412-not-playable.md";break}case 404:{n.title=y("Video does not exist",r),n.message="",o.message=y("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),o.file="404-not-found.md";break}case 403:{if(n.title=y("Invalid playback URL",r),n.message=y("The video URL or playback-token are formatted with incorrect or incomplete information.",r),o.message=y("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",r),o.file="missing-signed-tokens.md",!a)break;let{exp:h,aud:f,sub:b}=et(a),T=Date.now()>h*1e3,V=b!==t,G=f!=="v",I={timeStyle:"medium",dateStyle:"medium"};if(T){n.title=y("Video URL has expired",r),n.message=y("The video\u2019s secured playback-token has expired.",r),o.message=y("The video\u2019s secured playback-token has expired.",r),o.context=y("Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(ft.code,I).format(h*1e3),currentDate:new Intl.DateTimeFormat(ft.code,I).format(Date.now())}),o.file="403-expired-token.md";break}if(V){n.title=y("Video URL is formatted incorrectly",r),n.message=y("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),o.message=y("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),o.context=y("Specified playback ID: {playbackId} and the playback ID encoded in the playback-token: {tokenPlaybackId}",r).format({playbackId:t,tokenPlaybackId:b}),o.file="403-playback-id-mismatch.md";break}if(G){n.title=y("Video URL is formatted incorrectly",r),n.message=y("The playback-token is formatted with incorrect information.",r),o.message=y("The playback-token is formatted with incorrect information.",r),o.context=y("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:f}),o.file="403-incorrect-aud-value.md";break}o.message=y("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",r),o.file="403-malformatted-token.md";break}}break}case Wi.MediaError.MEDIA_ERR_DECODE:{let{message:h}=i;n={title:y("Media Error",r),message:h},o.file="media-decode-error.md";break}case Wi.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let h=(c=(u=i.data)==null?void 0:u.response)==null?void 0:c.code;if(h>=400&&h<500){i.code=Wi.MediaError.MEDIA_ERR_NETWORK,i.data={response:{code:h}},{dialog:n,devlog:o}=Nr(i,e,t,a);break}n={title:y("Source Not Supported",r),message:i.message},o.file="media-src-not-supported.md";break}default:n={title:y("Error",r),message:i.message};break}return e&&(n={title:y("Your device appears to be offline",r),message:y("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:o}}var Md=`<!-- prettier-ignore -->
|
|
1254
1254
|
<template id="media-theme-classic">
|
|
1255
1255
|
<style>
|
|
1256
1256
|
:host {
|
|
@@ -2018,5 +2018,5 @@ media-poster-image:not([src]) {
|
|
|
2018
2018
|
|
|
2019
2019
|
</media-controller>
|
|
2020
2020
|
</template>
|
|
2021
|
-
`;var Bs=ne.createElement("template");"innerHTML"in Bs&&(Bs.innerHTML=Md);var Ld,Cd,Ur=class extends rt{};Ur.template=(Cd=(Ld=Bs.content)==null?void 0:Ld.children)==null?void 0:Cd[0];B.customElements.get("media-theme-classic")||B.customElements.define("media-theme-classic",Ur);var sm="classic";var Fe={SRC:"src",POSTER:"poster"},p={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",NO_VOLUME_PREF:"no-volume-pref"},$s=["audio","backwardseekoffset","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function om(i,e){var a;return{src:!i.playbackId&&i.src,playbackId:i.playbackId,hasSrc:!!i.playbackId||!!i.src,poster:i.poster,storyboard:i.storyboard,storyboardSrc:i.getAttribute(p.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),themeTemplate:lm(i),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(p.NOHOTKEYS),hotKeys:i.getAttribute(p.HOTKEYS),muted:i.muted,paused:i.paused,preload:i.preload,envKey:i.envKey,preferCmcd:i.preferCmcd,debug:i.debug,disableCookies:i.disableCookies,tokens:i.tokens,beaconCollectionDomain:i.beaconCollectionDomain,maxResolution:i.maxResolution,metadata:i.metadata,playerSoftwareName:i.playerSoftwareName,playerSoftwareVersion:i.playerSoftwareVersion,startTime:i.startTime,preferPlayback:i.preferPlayback,audio:i.audio,defaultStreamType:i.defaultStreamType,targetLiveWindow:i.getAttribute(g.Attributes.TARGET_LIVE_WINDOW),streamType:wi(i.getAttribute(g.Attributes.STREAM_TYPE)),primaryColor:i.primaryColor,secondaryColor:i.secondaryColor,forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultShowRemainingTime:i.defaultShowRemainingTime,hideDuration:dm(i),playbackRates:i.getAttribute(p.PLAYBACK_RATES),customDomain:(a=i.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(p.TITLE),novolumepref:i.hasAttribute(p.NO_VOLUME_PREF),...e}}function lm(i){var t,a;let e=i.theme;if(e){let r=(a=(t=i.getRootNode())==null?void 0:t.getElementById)==null?void 0:a.call(t,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let n=B.customElements.get(e);if(n!=null&&n.template)return n.template}}function dm(i){var t;let e=(t=i.mediaController)==null?void 0:t.querySelector("media-time-display");return e&&getComputedStyle(e).getPropertyValue("--media-duration-display-display").trim()==="none"}function Rd(i){let e=i.hasAttribute(p.TITLE)?{video_title:i.getAttribute(p.TITLE)}:{};return i.getAttributeNames().filter(t=>t.startsWith("metadata-")).reduce((t,a)=>{let r=i.getAttribute(a);return r!==null&&(t[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),t},e)}var um=Object.values(g.Attributes),cm=Object.values(Fe),mm=Object.values(p),hm=kr(),pm="mux-player",wd={dialog:void 0,isDialogOpen:!1},Ki,Yi,Ke,Gi,Mt,st,ai,Pr,Dd,Zi,Vs,ot,ri,Br,xd,$r,Od,Vr,Nd,Hr,Ud,Fi=class extends Ms{constructor(){super();W(this,st);W(this,Pr);W(this,Zi);W(this,ot);W(this,Br);W(this,$r);W(this,Vr);W(this,Hr);W(this,Ki,!1);W(this,Yi,{});W(this,Ke,!0);W(this,Gi,new Ir(this,"hotkeys"));W(this,Mt,{...wd,onCloseErrorDialog:()=>K(this,Zi,Vs).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{ys(this,ne.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),K(this,Pr,Dd).call(this),this.isConnected&&K(this,st,ai).call(this)}static get observedAttributes(){var t;return[...(t=Ms.observedAttributes)!=null?t:[],...cm,...um,...mm]}get mediaTheme(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("media-theme")}get mediaController(){var t,a;return(a=(t=this.mediaTheme)==null?void 0:t.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){var a;let t=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");t&&(t.metadata=Rd(this))}attributeChangedCallback(t,a,r){switch(K(this,st,ai).call(this),super.attributeChangedCallback(t,a,r),t){case p.HOTKEYS:k(this,Gi).value=r;break;case p.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&et(y("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case p.THUMBNAIL_TOKEN:{let{aud:o}=je(r);r&&o!=="t"&&et(y("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:o}));break}case p.STORYBOARD_TOKEN:{let{aud:o}=je(r);r&&o!=="s"&&et(y("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:o}));break}case g.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&be(y("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case g.Attributes.STREAM_TYPE:r&&![P.StreamTypes.LIVE,P.StreamTypes.ON_DEMAND,P.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:ks({file:"invalid-stream-type.md",message:y("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):this.targetLiveWindow=r===P.StreamTypes.LIVE?0:Number.NaN}[g.Attributes.PLAYBACK_ID,Fe.SRC,p.PLAYBACK_TOKEN].includes(t)&&a!==r&&le(this,Mt,{...k(this,Mt),...wd}),K(this,ot,ri).call(this,{[Jl(t)]:r})}get preferCmcd(){var t;return(t=this.getAttribute(g.Attributes.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?P.CmcdTypeValues.includes(t)?this.setAttribute(g.Attributes.PREFER_CMCD,t):et(`Invalid value for preferCmcd. Must be one of ${P.CmcdTypeValues.join()}`):this.removeAttribute(g.Attributes.PREFER_CMCD))}get hasPlayed(){var t,a;return(a=(t=this.mediaController)==null?void 0:t.hasAttribute("media-has-played"))!=null?a:!1}get inLiveWindow(){var t;return(t=this.mediaController)==null?void 0:t.hasAttribute("media-time-is-live")}get _hls(){var t;return(t=this.media)==null?void 0:t._hls}get mux(){var t;return(t=this.media)==null?void 0:t.mux}get theme(){var t;return(t=this.getAttribute(p.THEME))!=null?t:sm}set theme(t){this.setAttribute(p.THEME,`${t}`)}get themeProps(){let t=this.mediaTheme;if(!t)return;let a={};for(let r of t.getAttributeNames()){if($s.includes(r))continue;let n=t.getAttribute(r);a[_r(r)]=n===""?!0:n}return a}set themeProps(t){var r,n;K(this,st,ai).call(this);let a={...this.themeProps,...t};for(let o in a){if($s.includes(o))continue;let d=t==null?void 0:t[o];typeof d=="boolean"||d==null?(r=this.mediaTheme)==null||r.toggleAttribute(Ar(o),Boolean(d)):(n=this.mediaTheme)==null||n.setAttribute(Ar(o),d)}}get playbackId(){var t;return(t=this.getAttribute(g.Attributes.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(g.Attributes.PLAYBACK_ID,t):this.removeAttribute(g.Attributes.PLAYBACK_ID)}get src(){var t,a;return this.playbackId?(t=St(this,Fe.SRC))!=null?t:void 0:(a=this.getAttribute(Fe.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(Fe.SRC,t):this.removeAttribute(Fe.SRC)}get poster(){var a;let t=this.getAttribute(Fe.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return zl(this.playbackId,{domain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(Fe.POSTER,t):this.removeAttribute(Fe.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(p.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(p.STORYBOARD_SRC,t):this.removeAttribute(p.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[P.StreamTypes.LIVE,P.StreamTypes.UNKNOWN].includes(this.streamType)))return Xl(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(p.AUDIO)}set audio(t){if(!t){this.removeAttribute(p.AUDIO);return}this.setAttribute(p.AUDIO,"")}get hotkeys(){return k(this,Gi)}get nohotkeys(){return this.hasAttribute(p.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(p.NOHOTKEYS);return}this.setAttribute(p.NOHOTKEYS,"")}get thumbnailTime(){return Be(this.getAttribute(p.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(p.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(p.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(p.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=St(this,p.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(p.PLACEHOLDER,`${t}`)}get primaryColor(){var a,r;let t=this.getAttribute(p.PRIMARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=B.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),t))return t}set primaryColor(t){this.setAttribute(p.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var a,r;let t=this.getAttribute(p.SECONDARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=B.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),t))return t}set secondaryColor(t){this.setAttribute(p.SECONDARY_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(p.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(p.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(p.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(p.PLAYBACK_RATES))return this.getAttribute(p.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(t=>Number(t)).filter(t=>!Number.isNaN(t)).sort((t,a)=>t-a)}set playbackRates(t){if(!t){this.removeAttribute(p.PLAYBACK_RATES);return}this.setAttribute(p.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=Be(this.getAttribute(p.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(p.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=Be(this.getAttribute(p.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(p.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(p.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(p.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(p.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:pm}get playerSoftwareVersion(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:hm}get beaconCollectionDomain(){var t;return(t=this.getAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var t;return(t=this.getAttribute(g.Attributes.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(g.Attributes.MAX_RESOLUTION,t):this.removeAttribute(g.Attributes.MAX_RESOLUTION))}get customDomain(){var t;return(t=this.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(g.Attributes.CUSTOM_DOMAIN,t):this.removeAttribute(g.Attributes.CUSTOM_DOMAIN))}get envKey(){var t;return(t=St(this,g.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(g.Attributes.ENV_KEY,`${t}`)}get noVolumePref(){return this.hasAttribute(p.NO_VOLUME_PREF)}set noVolumePref(t){t?this.setAttribute(p.NO_VOLUME_PREF,""):this.removeAttribute(p.NO_VOLUME_PREF)}get debug(){return St(this,g.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(g.Attributes.DEBUG,""):this.removeAttribute(g.Attributes.DEBUG)}get disableCookies(){return St(this,g.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(g.Attributes.DISABLE_COOKIES,""):this.removeAttribute(g.Attributes.DISABLE_COOKIES)}get streamType(){var t,a,r;return(r=(a=this.getAttribute(g.Attributes.STREAM_TYPE))!=null?a:(t=this.media)==null?void 0:t.streamType)!=null?r:P.StreamTypes.UNKNOWN}set streamType(t){this.setAttribute(g.Attributes.STREAM_TYPE,`${t}`)}get defaultStreamType(){var t,a,r;return(r=(a=this.getAttribute(p.DEFAULT_STREAM_TYPE))!=null?a:(t=this.mediaController)==null?void 0:t.getAttribute(p.DEFAULT_STREAM_TYPE))!=null?r:P.StreamTypes.ON_DEMAND}set defaultStreamType(t){t?this.setAttribute(p.DEFAULT_STREAM_TYPE,t):this.removeAttribute(p.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var t,a;return this.hasAttribute(p.TARGET_LIVE_WINDOW)?+this.getAttribute(p.TARGET_LIVE_WINDOW):(a=(t=this.media)==null?void 0:t.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(p.TARGET_LIVE_WINDOW):this.setAttribute(p.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t;return(t=this.media)==null?void 0:t.liveEdgeStart}get startTime(){return Be(St(this,g.Attributes.START_TIME))}set startTime(t){this.setAttribute(g.Attributes.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(g.Attributes.PREFER_PLAYBACK);if(t===P.PlaybackTypes.MSE||t===P.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===P.PlaybackTypes.MSE||t===P.PlaybackTypes.NATIVE?this.setAttribute(g.Attributes.PREFER_PLAYBACK,t):this.removeAttribute(g.Attributes.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(K(this,st,ai).call(this),!this.media){be("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Rd(this),...t}}async addCuePoints(t){var a;if(K(this,st,ai).call(this),!this.media){be("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(t)}get activeCuePoint(){var t;return(t=this.media)==null?void 0:t.activeCuePoint}get cuePoints(){var t,a;return(a=(t=this.media)==null?void 0:t.cuePoints)!=null?a:[]}getStartDate(){var t;return(t=this.media)==null?void 0:t.getStartDate()}get currentPdt(){var t;return(t=this.media)==null?void 0:t.currentPdt}get tokens(){let t=this.getAttribute(p.PLAYBACK_TOKEN),a=this.getAttribute(p.THUMBNAIL_TOKEN),r=this.getAttribute(p.STORYBOARD_TOKEN);return{...k(this,Yi),...t!=null?{playback:t}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){le(this,Yi,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(p.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(p.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(p.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(p.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(p.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(p.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,n){var d;let o=(d=this.media)==null?void 0:d.nativeEl;if(!!o)return(0,P.addTextTrack)(o,t,a,r,n)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(!!a)return(0,P.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};Ki=new WeakMap,Yi=new WeakMap,Ke=new WeakMap,Gi=new WeakMap,Mt=new WeakMap,st=new WeakSet,ai=function(){var t,a,r;if(!k(this,Ki)){le(this,Ki,!0),K(this,ot,ri).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof B.HTMLElement))throw""}catch{be("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof g.default))throw""}catch{be("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof on))throw""}catch{be("<media-controller> failed to upgrade!")}ad(this),K(this,Br,xd).call(this),K(this,$r,Od).call(this),K(this,Vr,Nd).call(this),le(this,Ke,(a=(t=this.mediaController)==null?void 0:t.hasAttribute("userinactive"))!=null?a:!0),K(this,Hr,Ud).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>{K(this,ot,ri).call(this)})}},Pr=new WeakSet,Dd=function(){var t,a;try{(t=window==null?void 0:window.CSS)==null||t.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(a=window==null?void 0:window.CSS)==null||a.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},Zi=new WeakSet,Vs=function(t){Object.assign(k(this,Mt),t),K(this,ot,ri).call(this)},ot=new WeakSet,ri=function(t={}){Id(Sd(om(this,{...k(this,Mt),...t})),this.shadowRoot)},Br=new WeakSet,xd=function(){let t=r=>{var d,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if($s.includes(n))return;let o=this.getAttribute(r);o!=null?(d=this.mediaTheme)==null||d.setAttribute(n,o):(u=this.mediaTheme)==null||u.removeAttribute(n)};new MutationObserver(r=>{for(let{attributeName:n}of r)t(n)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(t)},$r=new WeakSet,Od=function(){var a;let t=r=>{let{detail:n}=r;if(n instanceof g.MediaError||(n=new g.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){et(n),n.data&&et(`${n.name} data:`,n.data);return}let{dialog:o,devlog:d}=Nr(n,!window.navigator.onLine,this.playbackId,this.playbackToken);d.message&&ks(d),be(n),n.data&&be(`${n.name} data:`,n.data),K(this,Zi,Vs).call(this,{isDialogOpen:!0,dialog:o})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var o,d,u;if(!(((o=this.media)==null?void 0:o.error)instanceof g.MediaError))return r;let{devlog:n}=Nr((d=this.media)==null?void 0:d.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(u=this.media)==null?void 0:u.error.code,player_error_message:n.message?String(n.message):r.player_error_message,player_error_context:n.context?String(n.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var o,d;let{detail:n}=r;if(!n){let{message:u,code:c}=(d=(o=this.media)==null?void 0:o.error)!=null?d:{};n=new g.MediaError(u,c)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Vr=new WeakSet,Nd=function(){var a,r,n,o;let t=()=>K(this,ot,ri).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",t),(o=(n=this.media)==null?void 0:n.textTracks)==null||o.addEventListener("removetrack",t)},Hr=new WeakSet,Ud=function(){var h,f;let t=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(!/Firefox/i.test(navigator.userAgent))return;let r,n=new WeakMap,o=()=>this.streamType===P.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,d=(b,T,V=!1)=>{if(o())return;Array.from(b&&b.activeCues||[]).forEach(I=>{if(!(!I.snapToLines||I.line<-5||I.line>=0&&I.line<10))if(!T||this.paused){let re=I.text.split(`
|
|
2022
|
-
`).length,ge=t?-2:-3;this.streamType===P.StreamTypes.LIVE&&(ge=t?-1:-2);let oe=ge-re;if(I.line===oe&&!V)return;n.has(I)||n.set(I,I.line),I.line=oe-1,I.line=oe}else setTimeout(()=>{I.line=n.get(I)||"auto"},500)})},u=()=>{var b,T;d(r,(T=(b=this.mediaController)==null?void 0:b.hasAttribute("userinactive"))!=null?T:!1)},c=()=>{var V,G;let T=Array.from(((G=(V=this.mediaController)==null?void 0:V.media)==null?void 0:G.textTracks)||[]).filter(I=>["subtitles","captions"].includes(I.kind)&&I.mode==="showing")[0];T!==r&&(r==null||r.removeEventListener("cuechange",u)),r=T,r==null||r.addEventListener("cuechange",u),d(r,k(this,
|
|
2021
|
+
`;var Bs=ne.createElement("template");"innerHTML"in Bs&&(Bs.innerHTML=Md);var Ld,Cd,Ur=class extends nt{};Ur.template=(Cd=(Ld=Bs.content)==null?void 0:Ld.children)==null?void 0:Cd[0];B.customElements.get("media-theme-classic")||B.customElements.define("media-theme-classic",Ur);var sm="classic";var Ke={SRC:"src",POSTER:"poster"},p={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",NO_VOLUME_PREF:"no-volume-pref"},$s=["audio","backwardseekoffset","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function om(i,e){var a;return{src:!i.playbackId&&i.src,playbackId:i.playbackId,hasSrc:!!i.playbackId||!!i.src,poster:i.poster,storyboard:i.storyboard,storyboardSrc:i.getAttribute(p.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),themeTemplate:lm(i),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(p.NOHOTKEYS),hotKeys:i.getAttribute(p.HOTKEYS),muted:i.muted,paused:i.paused,preload:i.preload,envKey:i.envKey,preferCmcd:i.preferCmcd,debug:i.debug,disableCookies:i.disableCookies,tokens:i.tokens,beaconCollectionDomain:i.beaconCollectionDomain,maxResolution:i.maxResolution,metadata:i.metadata,playerSoftwareName:i.playerSoftwareName,playerSoftwareVersion:i.playerSoftwareVersion,startTime:i.startTime,preferPlayback:i.preferPlayback,audio:i.audio,defaultStreamType:i.defaultStreamType,targetLiveWindow:i.getAttribute(g.Attributes.TARGET_LIVE_WINDOW),streamType:wi(i.getAttribute(g.Attributes.STREAM_TYPE)),primaryColor:i.primaryColor,secondaryColor:i.secondaryColor,forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultShowRemainingTime:i.defaultShowRemainingTime,hideDuration:dm(i),playbackRates:i.getAttribute(p.PLAYBACK_RATES),customDomain:(a=i.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(p.TITLE),novolumepref:i.hasAttribute(p.NO_VOLUME_PREF),...e}}function lm(i){var t,a;let e=i.theme;if(e){let r=(a=(t=i.getRootNode())==null?void 0:t.getElementById)==null?void 0:a.call(t,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let n=B.customElements.get(e);if(n!=null&&n.template)return n.template}}function dm(i){var t;let e=(t=i.mediaController)==null?void 0:t.querySelector("media-time-display");return e&&getComputedStyle(e).getPropertyValue("--media-duration-display-display").trim()==="none"}function Rd(i){let e=i.hasAttribute(p.TITLE)?{video_title:i.getAttribute(p.TITLE)}:{};return i.getAttributeNames().filter(t=>t.startsWith("metadata-")).reduce((t,a)=>{let r=i.getAttribute(a);return r!==null&&(t[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),t},e)}var um=Object.values(g.Attributes),cm=Object.values(Ke),mm=Object.values(p),hm=kr(),pm="mux-player",wd={dialog:void 0,isDialogOpen:!1},Ki,Yi,Ye,Gi,Lt,ot,ai,Pr,Dd,Zi,Vs,lt,ri,Br,xd,$r,Od,Vr,Nd,Hr,Ud,Fi=class extends Ms{constructor(){super();W(this,ot);W(this,Pr);W(this,Zi);W(this,lt);W(this,Br);W(this,$r);W(this,Vr);W(this,Hr);W(this,Ki,!1);W(this,Yi,{});W(this,Ye,!0);W(this,Gi,new Ir(this,"hotkeys"));W(this,Lt,{...wd,onCloseErrorDialog:()=>K(this,Zi,Vs).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{ys(this,ne.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),K(this,Pr,Dd).call(this),this.isConnected&&K(this,ot,ai).call(this)}static get observedAttributes(){var t;return[...(t=Ms.observedAttributes)!=null?t:[],...cm,...um,...mm]}get mediaTheme(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("media-theme")}get mediaController(){var t,a;return(a=(t=this.mediaTheme)==null?void 0:t.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){var a;let t=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");t&&(t.metadata=Rd(this))}attributeChangedCallback(t,a,r){switch(K(this,ot,ai).call(this),super.attributeChangedCallback(t,a,r),t){case p.HOTKEYS:k(this,Gi).value=r;break;case p.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&tt(y("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case p.THUMBNAIL_TOKEN:{let{aud:o}=et(r);r&&o!=="t"&&tt(y("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:o}));break}case p.STORYBOARD_TOKEN:{let{aud:o}=et(r);r&&o!=="s"&&tt(y("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:o}));break}case g.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&be(y("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case g.Attributes.STREAM_TYPE:r&&![P.StreamTypes.LIVE,P.StreamTypes.ON_DEMAND,P.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:ks({file:"invalid-stream-type.md",message:y("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):this.targetLiveWindow=r===P.StreamTypes.LIVE?0:Number.NaN}[g.Attributes.PLAYBACK_ID,Ke.SRC,p.PLAYBACK_TOKEN].includes(t)&&a!==r&&le(this,Lt,{...k(this,Lt),...wd}),K(this,lt,ri).call(this,{[Jl(t)]:r})}get preferCmcd(){var t;return(t=this.getAttribute(g.Attributes.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?P.CmcdTypeValues.includes(t)?this.setAttribute(g.Attributes.PREFER_CMCD,t):tt(`Invalid value for preferCmcd. Must be one of ${P.CmcdTypeValues.join()}`):this.removeAttribute(g.Attributes.PREFER_CMCD))}get hasPlayed(){var t,a;return(a=(t=this.mediaController)==null?void 0:t.hasAttribute("media-has-played"))!=null?a:!1}get inLiveWindow(){var t;return(t=this.mediaController)==null?void 0:t.hasAttribute("media-time-is-live")}get _hls(){var t;return(t=this.media)==null?void 0:t._hls}get mux(){var t;return(t=this.media)==null?void 0:t.mux}get theme(){var t;return(t=this.getAttribute(p.THEME))!=null?t:sm}set theme(t){this.setAttribute(p.THEME,`${t}`)}get themeProps(){let t=this.mediaTheme;if(!t)return;let a={};for(let r of t.getAttributeNames()){if($s.includes(r))continue;let n=t.getAttribute(r);a[_r(r)]=n===""?!0:n}return a}set themeProps(t){var r,n;K(this,ot,ai).call(this);let a={...this.themeProps,...t};for(let o in a){if($s.includes(o))continue;let d=t==null?void 0:t[o];typeof d=="boolean"||d==null?(r=this.mediaTheme)==null||r.toggleAttribute(Ar(o),Boolean(d)):(n=this.mediaTheme)==null||n.setAttribute(Ar(o),d)}}get playbackId(){var t;return(t=this.getAttribute(g.Attributes.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(g.Attributes.PLAYBACK_ID,t):this.removeAttribute(g.Attributes.PLAYBACK_ID)}get src(){var t,a;return this.playbackId?(t=Mt(this,Ke.SRC))!=null?t:void 0:(a=this.getAttribute(Ke.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(Ke.SRC,t):this.removeAttribute(Ke.SRC)}get poster(){var a;let t=this.getAttribute(Ke.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return zl(this.playbackId,{domain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(Ke.POSTER,t):this.removeAttribute(Ke.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(p.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(p.STORYBOARD_SRC,t):this.removeAttribute(p.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[P.StreamTypes.LIVE,P.StreamTypes.UNKNOWN].includes(this.streamType)))return Xl(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(p.AUDIO)}set audio(t){if(!t){this.removeAttribute(p.AUDIO);return}this.setAttribute(p.AUDIO,"")}get hotkeys(){return k(this,Gi)}get nohotkeys(){return this.hasAttribute(p.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(p.NOHOTKEYS);return}this.setAttribute(p.NOHOTKEYS,"")}get thumbnailTime(){return $e(this.getAttribute(p.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(p.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(p.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(p.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=Mt(this,p.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(p.PLACEHOLDER,`${t}`)}get primaryColor(){var a,r;let t=this.getAttribute(p.PRIMARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=B.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),t))return t}set primaryColor(t){this.setAttribute(p.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var a,r;let t=this.getAttribute(p.SECONDARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=B.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),t))return t}set secondaryColor(t){this.setAttribute(p.SECONDARY_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(p.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(p.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(p.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(p.PLAYBACK_RATES))return this.getAttribute(p.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(t=>Number(t)).filter(t=>!Number.isNaN(t)).sort((t,a)=>t-a)}set playbackRates(t){if(!t){this.removeAttribute(p.PLAYBACK_RATES);return}this.setAttribute(p.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=$e(this.getAttribute(p.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(p.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=$e(this.getAttribute(p.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(p.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(p.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(p.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(p.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:pm}get playerSoftwareVersion(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:hm}get beaconCollectionDomain(){var t;return(t=this.getAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var t;return(t=this.getAttribute(g.Attributes.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(g.Attributes.MAX_RESOLUTION,t):this.removeAttribute(g.Attributes.MAX_RESOLUTION))}get customDomain(){var t;return(t=this.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(g.Attributes.CUSTOM_DOMAIN,t):this.removeAttribute(g.Attributes.CUSTOM_DOMAIN))}get envKey(){var t;return(t=Mt(this,g.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(g.Attributes.ENV_KEY,`${t}`)}get noVolumePref(){return this.hasAttribute(p.NO_VOLUME_PREF)}set noVolumePref(t){t?this.setAttribute(p.NO_VOLUME_PREF,""):this.removeAttribute(p.NO_VOLUME_PREF)}get debug(){return Mt(this,g.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(g.Attributes.DEBUG,""):this.removeAttribute(g.Attributes.DEBUG)}get disableCookies(){return Mt(this,g.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(g.Attributes.DISABLE_COOKIES,""):this.removeAttribute(g.Attributes.DISABLE_COOKIES)}get streamType(){var t,a,r;return(r=(a=this.getAttribute(g.Attributes.STREAM_TYPE))!=null?a:(t=this.media)==null?void 0:t.streamType)!=null?r:P.StreamTypes.UNKNOWN}set streamType(t){this.setAttribute(g.Attributes.STREAM_TYPE,`${t}`)}get defaultStreamType(){var t,a,r;return(r=(a=this.getAttribute(p.DEFAULT_STREAM_TYPE))!=null?a:(t=this.mediaController)==null?void 0:t.getAttribute(p.DEFAULT_STREAM_TYPE))!=null?r:P.StreamTypes.ON_DEMAND}set defaultStreamType(t){t?this.setAttribute(p.DEFAULT_STREAM_TYPE,t):this.removeAttribute(p.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var t,a;return this.hasAttribute(p.TARGET_LIVE_WINDOW)?+this.getAttribute(p.TARGET_LIVE_WINDOW):(a=(t=this.media)==null?void 0:t.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(p.TARGET_LIVE_WINDOW):this.setAttribute(p.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t;return(t=this.media)==null?void 0:t.liveEdgeStart}get startTime(){return $e(Mt(this,g.Attributes.START_TIME))}set startTime(t){this.setAttribute(g.Attributes.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(g.Attributes.PREFER_PLAYBACK);if(t===P.PlaybackTypes.MSE||t===P.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===P.PlaybackTypes.MSE||t===P.PlaybackTypes.NATIVE?this.setAttribute(g.Attributes.PREFER_PLAYBACK,t):this.removeAttribute(g.Attributes.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(K(this,ot,ai).call(this),!this.media){be("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Rd(this),...t}}async addCuePoints(t){var a;if(K(this,ot,ai).call(this),!this.media){be("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(t)}get activeCuePoint(){var t;return(t=this.media)==null?void 0:t.activeCuePoint}get cuePoints(){var t,a;return(a=(t=this.media)==null?void 0:t.cuePoints)!=null?a:[]}getStartDate(){var t;return(t=this.media)==null?void 0:t.getStartDate()}get currentPdt(){var t;return(t=this.media)==null?void 0:t.currentPdt}get tokens(){let t=this.getAttribute(p.PLAYBACK_TOKEN),a=this.getAttribute(p.THUMBNAIL_TOKEN),r=this.getAttribute(p.STORYBOARD_TOKEN);return{...k(this,Yi),...t!=null?{playback:t}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){le(this,Yi,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(p.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(p.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(p.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(p.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(p.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(p.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,n){var d;let o=(d=this.media)==null?void 0:d.nativeEl;if(!!o)return(0,P.addTextTrack)(o,t,a,r,n)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(!!a)return(0,P.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};Ki=new WeakMap,Yi=new WeakMap,Ye=new WeakMap,Gi=new WeakMap,Lt=new WeakMap,ot=new WeakSet,ai=function(){var t,a,r;if(!k(this,Ki)){le(this,Ki,!0),K(this,lt,ri).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof B.HTMLElement))throw""}catch{be("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof g.default))throw""}catch{be("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof on))throw""}catch{be("<media-controller> failed to upgrade!")}ad(this),K(this,Br,xd).call(this),K(this,$r,Od).call(this),K(this,Vr,Nd).call(this),le(this,Ye,(a=(t=this.mediaController)==null?void 0:t.hasAttribute("userinactive"))!=null?a:!0),K(this,Hr,Ud).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>{K(this,lt,ri).call(this)})}},Pr=new WeakSet,Dd=function(){var t,a;try{(t=window==null?void 0:window.CSS)==null||t.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(a=window==null?void 0:window.CSS)==null||a.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},Zi=new WeakSet,Vs=function(t){Object.assign(k(this,Lt),t),K(this,lt,ri).call(this)},lt=new WeakSet,ri=function(t={}){Id(Sd(om(this,{...k(this,Lt),...t})),this.shadowRoot)},Br=new WeakSet,xd=function(){let t=r=>{var d,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if($s.includes(n))return;let o=this.getAttribute(r);o!=null?(d=this.mediaTheme)==null||d.setAttribute(n,o):(u=this.mediaTheme)==null||u.removeAttribute(n)};new MutationObserver(r=>{for(let{attributeName:n}of r)t(n)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(t)},$r=new WeakSet,Od=function(){var a;let t=r=>{let{detail:n}=r;if(n instanceof g.MediaError||(n=new g.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){tt(n),n.data&&tt(`${n.name} data:`,n.data);return}let{dialog:o,devlog:d}=Nr(n,!window.navigator.onLine,this.playbackId,this.playbackToken);d.message&&ks(d),be(n),n.data&&be(`${n.name} data:`,n.data),K(this,Zi,Vs).call(this,{isDialogOpen:!0,dialog:o})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var o,d,u;if(!(((o=this.media)==null?void 0:o.error)instanceof g.MediaError))return r;let{devlog:n}=Nr((d=this.media)==null?void 0:d.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(u=this.media)==null?void 0:u.error.code,player_error_message:n.message?String(n.message):r.player_error_message,player_error_context:n.context?String(n.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var o,d;let{detail:n}=r;if(!n){let{message:u,code:c}=(d=(o=this.media)==null?void 0:o.error)!=null?d:{};n=new g.MediaError(u,c)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Vr=new WeakSet,Nd=function(){var a,r,n,o;let t=()=>K(this,lt,ri).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",t),(o=(n=this.media)==null?void 0:n.textTracks)==null||o.addEventListener("removetrack",t)},Hr=new WeakSet,Ud=function(){var h,f;let t=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(!/Firefox/i.test(navigator.userAgent))return;let r,n=new WeakMap,o=()=>this.streamType===P.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,d=(b,T,V=!1)=>{if(o())return;Array.from(b&&b.activeCues||[]).forEach(I=>{if(!(!I.snapToLines||I.line<-5||I.line>=0&&I.line<10))if(!T||this.paused){let re=I.text.split(`
|
|
2022
|
+
`).length,ge=t?-2:-3;this.streamType===P.StreamTypes.LIVE&&(ge=t?-1:-2);let oe=ge-re;if(I.line===oe&&!V)return;n.has(I)||n.set(I,I.line),I.line=oe-1,I.line=oe}else setTimeout(()=>{I.line=n.get(I)||"auto"},500)})},u=()=>{var b,T;d(r,(T=(b=this.mediaController)==null?void 0:b.hasAttribute("userinactive"))!=null?T:!1)},c=()=>{var V,G;let T=Array.from(((G=(V=this.mediaController)==null?void 0:V.media)==null?void 0:G.textTracks)||[]).filter(I=>["subtitles","captions"].includes(I.kind)&&I.mode==="showing")[0];T!==r&&(r==null||r.removeEventListener("cuechange",u)),r=T,r==null||r.addEventListener("cuechange",u),d(r,k(this,Ye))};if(c(),(h=this.textTracks)==null||h.addEventListener("change",c),(f=this.textTracks)==null||f.addEventListener("addtrack",c),navigator.userAgent.includes("Chrome/")){let b=()=>{d(r,k(this,Ye),!0),this.paused||window.requestAnimationFrame(b)};this.addEventListener("playing",()=>{b()})}this.addEventListener("userinactivechange",()=>{var T,V;let b=(V=(T=this.mediaController)==null?void 0:T.hasAttribute("userinactive"))!=null?V:!0;k(this,Ye)!==b&&(le(this,Ye,b),d(r,k(this,Ye)))})};function Mt(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}B.customElements.get("mux-player")||(B.customElements.define("mux-player",Fi),B.MuxPlayerElement=Fi);var Em=Fi;
|