offsite 0.0.17 → 0.0.18
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/apps/server/dist/main.mjs +240 -135
- package/apps/server/dist/main.mjs.map +1 -1
- package/apps/web/dist/assets/HugeiconsIcon-CXlzk0hX.js +1 -0
- package/apps/web/dist/assets/angular-html-CPrDeWzk.js +1 -0
- package/apps/web/dist/assets/{angular-ts-DGEt84_g.js → angular-ts-DCisMPVX.js} +1 -1
- package/apps/web/dist/assets/{apl-bz_iDiNf.js → apl-BRH60u60.js} +1 -1
- package/apps/web/dist/assets/{astro-jXSlLJ7l.js → astro-Dq6p_VTJ.js} +1 -1
- package/apps/web/dist/assets/{blade-2sxYYh5A.js → blade-CC3PQRrX.js} +1 -1
- package/apps/web/dist/assets/c-iCihek07.js +1 -0
- package/apps/web/dist/assets/{chapel-DUoqr6M4.js → chapel-DmtgEXO_.js} +1 -1
- package/apps/web/dist/assets/{cobol-Cn0D9nVy.js → cobol-CGlx5WnO.js} +1 -1
- package/apps/web/dist/assets/{coffee-C1tCcS8h.js → coffee-CiiSLhB6.js} +1 -1
- package/apps/web/dist/assets/cpp-71xkOQct.js +1 -0
- package/apps/web/dist/assets/{crystal-DF-BMake.js → crystal-Bn4W9FYe.js} +1 -1
- package/apps/web/dist/assets/css-AeYbVOD-.js +1 -0
- package/apps/web/dist/assets/{edge-D8r2HbS9.js → edge-D8qeodQq.js} +1 -1
- package/apps/web/dist/assets/{elixir-K6buEKBc.js → elixir-BkREp_f2.js} +1 -1
- package/apps/web/dist/assets/{elm-B78wD7Un.js → elm-o4NJxfws.js} +1 -1
- package/apps/web/dist/assets/{erb-DuhNLWPu.js → erb-CpQ5AKmM.js} +1 -1
- package/apps/web/dist/assets/{git-rebase-C6n0imm6.js → git-rebase-BDPpS8w6.js} +1 -1
- package/apps/web/dist/assets/{glimmer-js-B65Nng8o.js → glimmer-js-BTqwx0oO.js} +1 -1
- package/apps/web/dist/assets/{glimmer-ts-Cme47tem.js → glimmer-ts-N9jKyowB.js} +1 -1
- package/apps/web/dist/assets/glsl-D5MA2a_X.js +1 -0
- package/apps/web/dist/assets/graphql-Ctjuxyvl.js +1 -0
- package/apps/web/dist/assets/{hack-W5aeWZGp.js → hack-ZTcFnVsP.js} +1 -1
- package/apps/web/dist/assets/haml-ChtpF0E7.js +1 -0
- package/apps/web/dist/assets/{handlebars-CYz9msjm.js → handlebars-CpsBgm7t.js} +1 -1
- package/apps/web/dist/assets/{html-derivative-fPnJ7c-5.js → html-derivative-DNPJNw-0.js} +1 -1
- package/apps/web/dist/assets/html-hnucWepv.js +1 -0
- package/apps/web/dist/assets/{http-DIR9LW29.js → http-kmH8AyfE.js} +1 -1
- package/apps/web/dist/assets/{hurl-73h4sQYH.js → hurl-DCZHXKU4.js} +1 -1
- package/apps/web/dist/assets/image-viewer-CBM7yEMl.js +1 -0
- package/apps/web/dist/assets/index-DkRVBJlp.css +2 -0
- package/apps/web/dist/assets/index-h6Rg_ww0.js +1206 -0
- package/apps/web/dist/assets/java-DdHNQ9hk.js +1 -0
- package/apps/web/dist/assets/javascript-obGGvMPs.js +1 -0
- package/apps/web/dist/assets/{jinja-wBZAPGc9.js → jinja-81yqctvv.js} +1 -1
- package/apps/web/dist/assets/{jison-bZuttet2.js → jison-CBjhYtSs.js} +1 -1
- package/apps/web/dist/assets/json-DAgxKhMr.js +1 -0
- package/apps/web/dist/assets/jsx-gTgmArGx.js +1 -0
- package/apps/web/dist/assets/jsx-runtime-BNakU3Ej.js +1 -0
- package/apps/web/dist/assets/{julia-Bj20nWQB.js → julia-KRkZs2hS.js} +1 -1
- package/apps/web/dist/assets/{just-pKKGVoyp.js → just-BuSkJCkO.js} +1 -1
- package/apps/web/dist/assets/{latex-DN5Fi2zg.js → latex-CvI9akcJ.js} +1 -1
- package/apps/web/dist/assets/{liquid-DtPrOPBs.js → liquid-VY2h0b2O.js} +1 -1
- package/apps/web/dist/assets/lua-FONpmTUP.js +1 -0
- package/apps/web/dist/assets/{marko-BAsjT454.js → marko-BRIeiu02.js} +1 -1
- package/apps/web/dist/assets/{mdc-DwMa0Ya_.js → mdc-CX_1c8hS.js} +1 -1
- package/apps/web/dist/assets/{nginx-BlYeGp57.js → nginx-BTMw9COX.js} +1 -1
- package/apps/web/dist/assets/{nim-DASYTjR5.js → nim-BrYFxDF2.js} +1 -1
- package/apps/web/dist/assets/{org-DSeAzk6D.js → org-Cd0u8vWD.js} +1 -1
- package/apps/web/dist/assets/{perl-BGPYGeVd.js → perl-1pN6i0RM.js} +1 -1
- package/apps/web/dist/assets/{php-kgT6t38x.js → php-C7NaTRTO.js} +1 -1
- package/apps/web/dist/assets/{pug-COTHnC13.js → pug-Co4hciMS.js} +1 -1
- package/apps/web/dist/assets/{qml-DhqsM4c7.js → qml-_a-QhfPD.js} +1 -1
- package/apps/web/dist/assets/r-BHcO8Vjq.js +1 -0
- package/apps/web/dist/assets/{razor-BGH58TzE.js → razor-DVe451rE.js} +1 -1
- package/apps/web/dist/assets/regexp-DR20uMnK.js +1 -0
- package/apps/web/dist/assets/rolldown-runtime-hePW80VL.js +1 -0
- package/apps/web/dist/assets/{rst-UweowKJr.js → rst-hVyWO_Fc.js} +1 -1
- package/apps/web/dist/assets/{ruby-DtfMo-6m.js → ruby-Zd-8tM08.js} +1 -1
- package/apps/web/dist/assets/{sas-DkQGY_o2.js → sas-D3h2pRQf.js} +1 -1
- package/apps/web/dist/assets/scss-DDJaLTnA.js +1 -0
- package/apps/web/dist/assets/shellscript-Da78Ox-3.js +1 -0
- package/apps/web/dist/assets/{shellsession-CT0a4IuI.js → shellsession-CVsQGYfZ.js} +1 -1
- package/apps/web/dist/assets/{soy-B3ufTOzS.js → soy-CXX9LSpm.js} +1 -1
- package/apps/web/dist/assets/sql-ByhjMBKn.js +1 -0
- package/apps/web/dist/assets/{stata-BYhfUPEu.js → stata-CjrVU8-t.js} +1 -1
- package/apps/web/dist/assets/{surrealql-UIZa84-V.js → surrealql-BZoq2lXR.js} +1 -1
- package/apps/web/dist/assets/{svelte-SkphxuD6.js → svelte-CZ5lJGR6.js} +1 -1
- package/apps/web/dist/assets/{templ-C8T3Zgrx.js → templ-EWf5LxrK.js} +1 -1
- package/apps/web/dist/assets/tex-BK-H2Wn4.js +1 -0
- package/apps/web/dist/assets/{ts-tags-Bk8_Hqg_.js → ts-tags-C4CDubZg.js} +1 -1
- package/apps/web/dist/assets/tsx-CUOciP0b.js +1 -0
- package/apps/web/dist/assets/{twig-pKLKVHRj.js → twig-D6Rh4Rda.js} +1 -1
- package/apps/web/dist/assets/typescript-BydbNFcO.js +1 -0
- package/apps/web/dist/assets/{typst-DCcUGqaw.js → typst-Bq_qwoSs.js} +1 -1
- package/apps/web/dist/assets/video-player-D73_kRr7.js +1416 -0
- package/apps/web/dist/assets/video-viewer-CUqarcH1.js +1 -0
- package/apps/web/dist/assets/{vue-B_0IsDtY.js → vue-D5NIjYCb.js} +1 -1
- package/apps/web/dist/assets/{vue-html-B42dVyQs.js → vue-html-DkKkQnZL.js} +1 -1
- package/apps/web/dist/assets/{vue-vine-CUms6qs_.js → vue-vine-C-CFC0K-.js} +1 -1
- package/apps/web/dist/assets/xml-BlnrEAEy.js +1 -0
- package/apps/web/dist/assets/{xsl-73EQy__K.js → xsl-BOPS8gLt.js} +1 -1
- package/apps/web/dist/assets/yaml-Du_6cdrH.js +1 -0
- package/apps/web/dist/assets/zoomable-image-CVx2-A2g.js +41 -0
- package/apps/web/dist/index.html +5 -2
- package/apps/web/dist/sw.js +1 -1
- package/package.json +1 -1
- package/apps/web/dist/assets/angular-html-DS1oV12F.js +0 -1
- package/apps/web/dist/assets/c-DapwzVu-.js +0 -1
- package/apps/web/dist/assets/cpp-DxWN2Okg.js +0 -1
- package/apps/web/dist/assets/css-DO_8FP-m.js +0 -1
- package/apps/web/dist/assets/glsl-DCAs0c4j.js +0 -1
- package/apps/web/dist/assets/graphql-CjoRmsAT.js +0 -1
- package/apps/web/dist/assets/haml-C_s1GJd7.js +0 -1
- package/apps/web/dist/assets/html-rJzVMoNs.js +0 -1
- package/apps/web/dist/assets/index-CbDKWecy.js +0 -1206
- package/apps/web/dist/assets/index-aoUjY0qi.css +0 -2
- package/apps/web/dist/assets/java-CC9QxJEZ.js +0 -1
- package/apps/web/dist/assets/javascript-BhEdsWyv.js +0 -1
- package/apps/web/dist/assets/json-BwYVcFZr.js +0 -1
- package/apps/web/dist/assets/jsx-DZ0EGwxr.js +0 -1
- package/apps/web/dist/assets/lua-C1ueigSQ.js +0 -1
- package/apps/web/dist/assets/r-D-KnVREb.js +0 -1
- package/apps/web/dist/assets/regexp-BHxEHonG.js +0 -1
- package/apps/web/dist/assets/scss-QYV6e_ks.js +0 -1
- package/apps/web/dist/assets/shellscript-CBTXJvxj.js +0 -1
- package/apps/web/dist/assets/sql-BhGvXJN_.js +0 -1
- package/apps/web/dist/assets/tex-Be-e7W9g.js +0 -1
- package/apps/web/dist/assets/tsx-B_hC-_lk.js +0 -1
- package/apps/web/dist/assets/typescript-D8MumUKS.js +0 -1
- package/apps/web/dist/assets/xml-Dh5mAVtG.js +0 -1
- package/apps/web/dist/assets/yaml-C5lWNsLB.js +0 -1
|
@@ -0,0 +1,1416 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";var r=e(t(),1),i=new Set([`style`,`children`,`ref`,`key`,`suppressContentEditableWarning`,`suppressHydrationWarning`,`dangerouslySetInnerHTML`]),a={className:`class`,htmlFor:`for`};function o(e){return e.toLowerCase()}function s(e){if(typeof e==`boolean`)return e?``:void 0;if(typeof e!=`function`&&!(typeof e==`object`&&e))return e}function c({react:e,tagName:t,elementClass:n,events:r,displayName:c,defaultProps:u,toAttributeName:d=o,toAttributeValue:f=s}){let p=Number.parseInt(e.version)>=19,m=e.forwardRef((o,c)=>{let m=e.useRef(null),h=e.useRef(new Map),ee={},g={},_={},v={};for(let[e,t]of Object.entries(o)){if(i.has(e)){_[e]=t;continue}let r=d(a[e]??e);if(n.prototype&&e in n.prototype&&!(e in(globalThis.HTMLElement?.prototype??{}))&&!n.observedAttributes?.some(e=>e===r)){v[e]=t;continue}if(e.startsWith(`on`)){ee[e]=t;continue}let o=f(t);r&&o!=null&&(g[r]=String(o),p||(_[r]=o)),r&&p&&(_[r]=o===s(t)?t:o)}if(typeof window<`u`){for(let t in ee){let n=ee[t],i=t.endsWith(`Capture`),a=(r?.[t]??t.slice(2).toLowerCase()).slice(0,i?-7:void 0);e.useLayoutEffect(()=>{let e=m?.current;if(e&&typeof n==`function`)return e.addEventListener(a,n,i),()=>{e.removeEventListener(a,n,i)}},[m?.current,n])}e.useLayoutEffect(()=>{if(m.current===null)return;let e=new Map;for(let t in v)l(m.current,t,v[t]),h.current.delete(t),e.set(t,v[t]);for(let[e,t]of h.current)l(m.current,e,void 0);h.current=e})}if(typeof window>`u`&&n?.getTemplateHTML&&n?.shadowRootOptions){let{mode:t,delegatesFocus:r}=n.shadowRootOptions;_.children=[e.createElement(`template`,{shadowrootmode:t,shadowrootdelegatesfocus:r,dangerouslySetInnerHTML:{__html:n.getTemplateHTML(g,o)},key:`ce-la-react-ssr-template-shadow-root`}),_.children]}return e.createElement(t,{...u,..._,ref:e.useCallback(e=>{m.current=e,typeof c==`function`?c(e):c!==null&&(c.current=e)},[c])},_.children)});return m.displayName=c??n.name,m}function l(e,t,n){e[t]=n,n==null&&t in(globalThis.HTMLElement?.prototype??{})&&e.removeAttribute(t)}var u={MEDIA_PLAY_REQUEST:`mediaplayrequest`,MEDIA_PAUSE_REQUEST:`mediapauserequest`,MEDIA_MUTE_REQUEST:`mediamuterequest`,MEDIA_UNMUTE_REQUEST:`mediaunmuterequest`,MEDIA_LOOP_REQUEST:`medialooprequest`,MEDIA_VOLUME_REQUEST:`mediavolumerequest`,MEDIA_SEEK_REQUEST:`mediaseekrequest`,MEDIA_AIRPLAY_REQUEST:`mediaairplayrequest`,MEDIA_ENTER_FULLSCREEN_REQUEST:`mediaenterfullscreenrequest`,MEDIA_EXIT_FULLSCREEN_REQUEST:`mediaexitfullscreenrequest`,MEDIA_PREVIEW_REQUEST:`mediapreviewrequest`,MEDIA_ENTER_PIP_REQUEST:`mediaenterpiprequest`,MEDIA_EXIT_PIP_REQUEST:`mediaexitpiprequest`,MEDIA_ENTER_CAST_REQUEST:`mediaentercastrequest`,MEDIA_EXIT_CAST_REQUEST:`mediaexitcastrequest`,MEDIA_SHOW_TEXT_TRACKS_REQUEST:`mediashowtexttracksrequest`,MEDIA_HIDE_TEXT_TRACKS_REQUEST:`mediahidetexttracksrequest`,MEDIA_SHOW_SUBTITLES_REQUEST:`mediashowsubtitlesrequest`,MEDIA_DISABLE_SUBTITLES_REQUEST:`mediadisablesubtitlesrequest`,MEDIA_TOGGLE_SUBTITLES_REQUEST:`mediatogglesubtitlesrequest`,MEDIA_PLAYBACK_RATE_REQUEST:`mediaplaybackraterequest`,MEDIA_RENDITION_REQUEST:`mediarenditionrequest`,MEDIA_AUDIO_TRACK_REQUEST:`mediaaudiotrackrequest`,MEDIA_SEEK_TO_LIVE_REQUEST:`mediaseektoliverequest`,REGISTER_MEDIA_STATE_RECEIVER:`registermediastatereceiver`,UNREGISTER_MEDIA_STATE_RECEIVER:`unregistermediastatereceiver`},d={MEDIA_CHROME_ATTRIBUTES:`mediachromeattributes`,MEDIA_CONTROLLER:`mediacontroller`},f={MEDIA_AIRPLAY_UNAVAILABLE:`mediaAirplayUnavailable`,MEDIA_AUDIO_TRACK_ENABLED:`mediaAudioTrackEnabled`,MEDIA_AUDIO_TRACK_LIST:`mediaAudioTrackList`,MEDIA_AUDIO_TRACK_UNAVAILABLE:`mediaAudioTrackUnavailable`,MEDIA_BUFFERED:`mediaBuffered`,MEDIA_CAST_UNAVAILABLE:`mediaCastUnavailable`,MEDIA_CHAPTERS_CUES:`mediaChaptersCues`,MEDIA_CURRENT_TIME:`mediaCurrentTime`,MEDIA_DURATION:`mediaDuration`,MEDIA_ENDED:`mediaEnded`,MEDIA_ERROR:`mediaError`,MEDIA_ERROR_CODE:`mediaErrorCode`,MEDIA_ERROR_MESSAGE:`mediaErrorMessage`,MEDIA_FULLSCREEN_UNAVAILABLE:`mediaFullscreenUnavailable`,MEDIA_HAS_PLAYED:`mediaHasPlayed`,MEDIA_HEIGHT:`mediaHeight`,MEDIA_IS_AIRPLAYING:`mediaIsAirplaying`,MEDIA_IS_CASTING:`mediaIsCasting`,MEDIA_IS_FULLSCREEN:`mediaIsFullscreen`,MEDIA_IS_PIP:`mediaIsPip`,MEDIA_LOADING:`mediaLoading`,MEDIA_MUTED:`mediaMuted`,MEDIA_LOOP:`mediaLoop`,MEDIA_PAUSED:`mediaPaused`,MEDIA_PIP_UNAVAILABLE:`mediaPipUnavailable`,MEDIA_PLAYBACK_RATE:`mediaPlaybackRate`,MEDIA_PREVIEW_CHAPTER:`mediaPreviewChapter`,MEDIA_PREVIEW_COORDS:`mediaPreviewCoords`,MEDIA_PREVIEW_IMAGE:`mediaPreviewImage`,MEDIA_PREVIEW_TIME:`mediaPreviewTime`,MEDIA_RENDITION_LIST:`mediaRenditionList`,MEDIA_RENDITION_SELECTED:`mediaRenditionSelected`,MEDIA_RENDITION_UNAVAILABLE:`mediaRenditionUnavailable`,MEDIA_SEEKABLE:`mediaSeekable`,MEDIA_STREAM_TYPE:`mediaStreamType`,MEDIA_SUBTITLES_LIST:`mediaSubtitlesList`,MEDIA_SUBTITLES_SHOWING:`mediaSubtitlesShowing`,MEDIA_TARGET_LIVE_WINDOW:`mediaTargetLiveWindow`,MEDIA_TIME_IS_LIVE:`mediaTimeIsLive`,MEDIA_VOLUME:`mediaVolume`,MEDIA_VOLUME_LEVEL:`mediaVolumeLevel`,MEDIA_VOLUME_UNAVAILABLE:`mediaVolumeUnavailable`,MEDIA_LANG:`mediaLang`,MEDIA_WIDTH:`mediaWidth`},p=Object.entries(f),m=p.reduce((e,[t,n])=>(e[t]=n.toLowerCase(),e),{}),h=p.reduce((e,[t,n])=>(e[t]=n.toLowerCase(),e),{USER_INACTIVE_CHANGE:`userinactivechange`,BREAKPOINTS_CHANGE:`breakpointchange`,BREAKPOINTS_COMPUTED:`breakpointscomputed`});Object.entries(h).reduce((e,[t,n])=>{let r=m[t];return r&&(e[n]=r),e},{userinactivechange:`userinactive`});var ee=Object.entries(m).reduce((e,[t,n])=>{let r=h[t];return r&&(e[n]=r),e},{userinactive:`userinactivechange`}),g={SUBTITLES:`subtitles`,CAPTIONS:`captions`,DESCRIPTIONS:`descriptions`,CHAPTERS:`chapters`,METADATA:`metadata`},_={DISABLED:`disabled`,HIDDEN:`hidden`,SHOWING:`showing`},v={MOUSE:`mouse`,PEN:`pen`,TOUCH:`touch`},y={UNAVAILABLE:`unavailable`,UNSUPPORTED:`unsupported`},b={LIVE:`live`,ON_DEMAND:`on-demand`,UNKNOWN:`unknown`},te={INLINE:`inline`,FULLSCREEN:`fullscreen`,PICTURE_IN_PICTURE:`picture-in-picture`};function ne(e){return e?.map(re).join(` `)}function re(e){if(e){let{id:t,width:n,height:r}=e;return[t,n,r].filter(e=>e!=null).join(`:`)}}function ie(e){return e?.map(ae).join(` `)}function ae(e){if(e){let{id:t,kind:n,language:r,label:i}=e;return[t,n,r,i].filter(e=>e!=null).join(`:`)}}function oe(e){return typeof e==`number`&&!Number.isNaN(e)&&Number.isFinite(e)}var se=e=>new Promise(t=>setTimeout(t,e)),ce={en:{"Start airplay":`Start airplay`,"Stop airplay":`Stop airplay`,Audio:`Audio`,Captions:`Captions`,"Enable captions":`Enable captions`,"Disable captions":`Disable captions`,"Start casting":`Start casting`,"Stop casting":`Stop casting`,"Enter fullscreen mode":`Enter fullscreen mode`,"Exit fullscreen mode":`Exit fullscreen mode`,Mute:`Mute`,Unmute:`Unmute`,Loop:`Loop`,"Enter picture in picture mode":`Enter picture in picture mode`,"Exit picture in picture mode":`Exit picture in picture mode`,Play:`Play`,Pause:`Pause`,"Playback rate":`Playback rate`,"Playback rate {playbackRate}":`Playback rate {playbackRate}`,Quality:`Quality`,"Seek backward":`Seek backward`,"Seek forward":`Seek forward`,Settings:`Settings`,Auto:`Auto`,"audio player":`audio player`,"video player":`video player`,volume:`volume`,seek:`seek`,"closed captions":`closed captions`,"current playback rate":`current playback rate`,"playback time":`playback time`,"media loading":`media loading`,settings:`settings`,"audio tracks":`audio tracks`,quality:`quality`,play:`play`,pause:`pause`,mute:`mute`,unmute:`unmute`,"chapter: {chapterName}":`chapter: {chapterName}`,live:`live`,Off:`Off`,"start airplay":`start airplay`,"stop airplay":`stop airplay`,"start casting":`start casting`,"stop casting":`stop casting`,"enter fullscreen mode":`enter fullscreen mode`,"exit fullscreen mode":`exit fullscreen mode`,"enter picture in picture mode":`enter picture in picture mode`,"exit picture in picture mode":`exit picture in picture mode`,"seek to live":`seek to live`,"playing live":`playing live`,"seek back {seekOffset} seconds":`seek back {seekOffset} seconds`,"seek forward {seekOffset} seconds":`seek forward {seekOffset} seconds`,"Network Error":`Network Error`,"Decode Error":`Decode Error`,"Source Not Supported":`Source Not Supported`,"Encryption Error":`Encryption Error`,"A network error caused the media download to fail.":`A network error caused the media download to fail.`,"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":`A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.`,"An unsupported error occurred. The server or network failed, or your browser does not support this format.":`An unsupported error occurred. The server or network failed, or your browser does not support this format.`,"The media is encrypted and there are no keys to decrypt it.":`The media is encrypted and there are no keys to decrypt it.`,hour:`hour`,hours:`hours`,minute:`minute`,minutes:`minutes`,second:`second`,seconds:`seconds`,"{time} remaining":`{time} remaining`,"{currentTime} of {totalTime}":`{currentTime} of {totalTime}`,"video not loaded, unknown time.":`video not loaded, unknown time.`}},le=globalThis.navigator?.language||`en`,ue=e=>{le=e},de=e=>{let[t]=le.split(`-`);return ce[le]?.[e]||ce[t]?.[e]||ce.en?.[e]||e},fe=()=>{let[e]=le.split(`-`);return ce[le]?le:ce[e]?e:`en`},x=(e,t={})=>de(e).replace(/\{(\w+)\}/g,(e,n)=>n in t?String(t[n]):`{${n}}`),pe=[{singular:`hour`,plural:`hours`},{singular:`minute`,plural:`minutes`},{singular:`second`,plural:`seconds`}],me=(e,t)=>`${e} ${x(e===1?pe[t].singular:pe[t].plural)}`,he=e=>{if(!oe(e))return``;let t=Math.abs(e),n=t!==e,r=new Date(0,0,0,0,0,t,0),i=[r.getHours(),r.getMinutes(),r.getSeconds()].map((e,t)=>e&&me(e,t)).filter(e=>e).join(`, `);return n?x(`{time} remaining`,{time:i}):t===0?me(0,2):i};function ge(e,t){let n=!1;e<0&&(n=!0,e=0-e),e=e<0?0:e;let r=Math.floor(e%60),i=Math.floor(e/60%60),a=Math.floor(e/3600),o=Math.floor(t/60%60),s=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(a=i=r=`0`),a=a>0||s>0?a+`:`:``,i=((a||o>=10)&&i<10?`0`+i:i)+`:`,r=r<10?`0`+r:r,(n?`-`:``)+a+i+r}Object.freeze({length:0,start(e){let t=e>>>0;if(t>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${t}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(e){let t=e>>>0;if(t>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${t}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});var _e=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},ve=class extends _e{},ye=class extends ve{constructor(){super(...arguments),this.role=null}},be=class{observe(){}unobserve(){}disconnect(){}},xe={createElement:function(){return new Se.HTMLElement},createElementNS:function(){return new Se.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(e){return!1}},Se={ResizeObserver:be,document:xe,Node:ve,Element:ye,HTMLElement:class extends ye{constructor(){super(...arguments),this.innerHTML=``}get content(){return new Se.DocumentFragment}},DocumentFragment:class extends _e{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(e){return null},setItem(e,t){},removeItem(e){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return``}},matchMedia(e){return{matches:!1,media:e}},DOMParser:class{parseFromString(e,t){return{body:{textContent:e}}}}},Ce=`global`in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window>`u`||window.customElements===void 0,we=Object.keys(Se).every(e=>e in globalThis),S=Ce&&!we?Se:globalThis,C=Ce&&!we?xe:globalThis.document,Te=new WeakMap,Ee=e=>{let t=Te.get(e);return t||Te.set(e,t=new Set),t},De=new S.ResizeObserver(e=>{for(let t of e)for(let e of Ee(t.target))e(t)});function Oe(e,t){Ee(e).add(t),De.observe(e)}function ke(e,t){let n=Ee(e);n.delete(t),n.size||De.unobserve(e)}function Ae(e){let t={};for(let n of e)t[n.name]=n.value;return t}function je(e){return Me(e)??Le(e,`media-controller`)}function Me(e){let{MEDIA_CONTROLLER:t}=d,n=e.getAttribute(t);if(n)return ze(e)?.getElementById(n)}var Ne=(e,t,n=`.value`)=>{let r=e.querySelector(n);r&&(r.textContent=t)},Pe=(e,t)=>{let n=`slot[name="${t}"]`,r=e.shadowRoot.querySelector(n);return r?r.children:[]},Fe=(e,t)=>Pe(e,t)[0],Ie=(e,t)=>!e||!t?!1:e?.contains(t)?!0:Ie(e,t.getRootNode().host),Le=(e,t)=>e?e.closest(t)||Le(e.getRootNode().host,t):null;function Re(e=document){let t=e?.activeElement;return t?Re(t.shadowRoot)??t:null}function ze(e){let t=(e?.getRootNode)?.call(e);return t instanceof ShadowRoot||t instanceof Document?t:null}function Be(e,{depth:t=3,checkOpacity:n=!0,checkVisibilityCSS:r=!0}={}){if(e.checkVisibility)return e.checkVisibility({checkOpacity:n,checkVisibilityCSS:r});let i=e;for(;i&&t>0;){let e=getComputedStyle(i);if(n&&e.opacity===`0`||r&&e.visibility===`hidden`||e.display===`none`)return!1;i=i.parentElement,t--}return!0}function Ve(e,t,n,r){let i=r.x-n.x,a=r.y-n.y,o=i*i+a*a;if(o===0)return 0;let s=((e-n.x)*i+(t-n.y)*a)/o;return Math.max(0,Math.min(1,s))}function w(e,t){return He(e,e=>e===t)||Ue(e,t)}function He(e,t){let n;for(n of e.querySelectorAll(`style:not([media])`)??[]){let e;try{e=n.sheet?.cssRules}catch{continue}for(let n of e??[])if(t(n.selectorText))return n}}function Ue(e,t){let n=e.querySelectorAll(`style:not([media])`)??[],r=n?.[n.length-1];if(!r?.sheet)return console.warn(`Media Chrome: No style sheet found on style tag of`,e),{style:{setProperty:()=>{},removeProperty:()=>``,getPropertyValue:()=>``}};let i=r?.sheet.insertRule(`${t}{}`,r.sheet.cssRules.length);return r.sheet.cssRules?.[i]}function T(e,t,n=NaN){let r=e.getAttribute(t);return r==null?n:+r}function E(e,t,n){let r=+n;n==null||Number.isNaN(r)?e.hasAttribute(t)&&e.removeAttribute(t):T(e,t,void 0)!==r&&e.setAttribute(t,`${r}`)}function D(e,t){return e.hasAttribute(t)}function O(e,t,n){n==null?e.hasAttribute(t)&&e.removeAttribute(t):D(e,t)!=n&&e.toggleAttribute(t,n)}function k(e,t,n=null){return e.getAttribute(t)??n}function A(e,t,n){if(n==null){e.hasAttribute(t)&&e.removeAttribute(t);return}let r=`${n}`;k(e,t,void 0)!==r&&e.setAttribute(t,r)}var We=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},Ge=(e,t,n)=>(We(e,t,`read from private field`),n?n.call(e):t.get(e)),Ke=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},qe=(e,t,n,r)=>(We(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),j;function Je(e){return`
|
|
2
|
+
<style>
|
|
3
|
+
:host {
|
|
4
|
+
display: var(--media-control-display, var(--media-gesture-receiver-display, inline-block));
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
}
|
|
7
|
+
</style>
|
|
8
|
+
`}var Ye=class extends S.HTMLElement{constructor(){if(super(),Ke(this,j,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[d.MEDIA_CONTROLLER,m.MEDIA_PAUSED]}attributeChangedCallback(e,t,n){var r,i,a,o;e===d.MEDIA_CONTROLLER&&(t&&((i=(r=Ge(this,j))?.unassociateElement)==null||i.call(r,this),qe(this,j,null)),n&&this.isConnected&&(qe(this,j,this.getRootNode()?.getElementById(n)),(o=(a=Ge(this,j))?.associateElement)==null||o.call(a,this)))}connectedCallback(){var e,t;this.tabIndex=-1,this.setAttribute(`aria-hidden`,`true`),qe(this,j,Xe(this)),this.getAttribute(d.MEDIA_CONTROLLER)&&((t=(e=Ge(this,j))?.associateElement)==null||t.call(e,this)),Ge(this,j)&&(Ge(this,j).addEventListener(`pointerdown`,this),Ge(this,j).addEventListener(`click`,this),Ge(this,j).hasAttribute(`tabindex`)||(Ge(this,j).tabIndex=0))}disconnectedCallback(){var e,t,n,r;this.getAttribute(d.MEDIA_CONTROLLER)&&((t=(e=Ge(this,j))?.unassociateElement)==null||t.call(e,this)),(n=Ge(this,j))==null||n.removeEventListener(`pointerdown`,this),(r=Ge(this,j))==null||r.removeEventListener(`click`,this),qe(this,j,null)}handleEvent(e){let t=e.composedPath()?.[0];if([`video`,`media-controller`].includes(t?.localName)){if(e.type===`pointerdown`)this._pointerType=e.pointerType;else if(e.type===`click`){let{clientX:t,clientY:n}=e,{left:r,top:i,width:a,height:o}=this.getBoundingClientRect(),s=t-r,c=n-i;if(s<0||c<0||s>a||c>o||a===0&&o===0)return;let l=this._pointerType||`mouse`;if(this._pointerType=void 0,l===v.TOUCH){this.handleTap(e);return}if(l===v.MOUSE||l===v.PEN){this.handleMouseClick(e);return}}}}get mediaPaused(){return D(this,m.MEDIA_PAUSED)}set mediaPaused(e){O(this,m.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?u.MEDIA_PLAY_REQUEST:u.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new S.CustomEvent(t,{composed:!0,bubbles:!0}))}};j=new WeakMap,Ye.shadowRootOptions={mode:`open`},Ye.getTemplateHTML=Je;function Xe(e){let t=e.getAttribute(d.MEDIA_CONTROLLER);return t?e.getRootNode()?.getElementById(t):Le(e,`media-controller`)}S.customElements.get(`media-gesture-receiver`)||S.customElements.define(`media-gesture-receiver`,Ye);var Ze=Ye,Qe=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},M=(e,t,n)=>(Qe(e,t,`read from private field`),n?n.call(e):t.get(e)),N=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},P=(e,t,n,r)=>(Qe(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),F=(e,t,n)=>(Qe(e,t,`access private method`),n),$e,et,tt,nt,rt,it,at,ot,st,ct,lt,ut,dt,ft,pt,mt,ht,gt,_t,vt,I={AUDIO:`audio`,AUTOHIDE:`autohide`,BREAKPOINTS:`breakpoints`,GESTURES_DISABLED:`gesturesdisabled`,KEYBOARD_CONTROL:`keyboardcontrol`,NO_AUTOHIDE:`noautohide`,USER_INACTIVE:`userinactive`,AUTOHIDE_OVER_CONTROLS:`autohideovercontrols`};function yt(e){return`
|
|
9
|
+
<style>
|
|
10
|
+
|
|
11
|
+
:host([${m.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
|
|
12
|
+
outline: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:host {
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
position: relative;
|
|
18
|
+
display: inline-block;
|
|
19
|
+
line-height: 0;
|
|
20
|
+
background-color: var(--media-background-color, #000);
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:host(:not([${I.AUDIO}])) [part~=layer]:not([part~=media-layer]) {
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: 0;
|
|
27
|
+
left: 0;
|
|
28
|
+
bottom: 0;
|
|
29
|
+
right: 0;
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-flow: column nowrap;
|
|
32
|
+
align-items: start;
|
|
33
|
+
pointer-events: none;
|
|
34
|
+
background: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
slot[name=media] {
|
|
38
|
+
display: var(--media-slot-display, contents);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
:host([${I.AUDIO}]) slot[name=media] {
|
|
43
|
+
display: var(--media-slot-display, none);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
:host([${I.AUDIO}]) [part~=layer][part~=gesture-layer] {
|
|
48
|
+
height: 0;
|
|
49
|
+
display: block;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
:host(:not([${I.AUDIO}])[${I.GESTURES_DISABLED}]) ::slotted([slot=gestures-chrome]),
|
|
54
|
+
:host(:not([${I.AUDIO}])[${I.GESTURES_DISABLED}]) media-gesture-receiver[slot=gestures-chrome] {
|
|
55
|
+
display: none;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
::slotted(:not([slot=media]):not([slot=poster]):not(media-loading-indicator):not([role=dialog]):not([hidden])) {
|
|
60
|
+
pointer-events: auto;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:host(:not([${I.AUDIO}])) *[part~=layer][part~=centered-layer] {
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
:host(:not([${I.AUDIO}])) ::slotted(media-gesture-receiver[slot=gestures-chrome]),
|
|
69
|
+
:host(:not([${I.AUDIO}])) media-gesture-receiver[slot=gestures-chrome] {
|
|
70
|
+
align-self: stretch;
|
|
71
|
+
flex-grow: 1;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
slot[name=middle-chrome] {
|
|
75
|
+
display: inline;
|
|
76
|
+
flex-grow: 1;
|
|
77
|
+
pointer-events: none;
|
|
78
|
+
background: none;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
::slotted([slot=media]),
|
|
83
|
+
::slotted([slot=poster]) {
|
|
84
|
+
width: 100%;
|
|
85
|
+
height: 100%;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
:host(:not([${I.AUDIO}])) .spacer {
|
|
90
|
+
flex-grow: 1;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
:host(:-webkit-full-screen) {
|
|
95
|
+
|
|
96
|
+
width: 100% !important;
|
|
97
|
+
height: 100% !important;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
::slotted(:not([slot=media]):not([slot=poster]):not([${I.NO_AUTOHIDE}]):not([hidden]):not([role=dialog])) {
|
|
102
|
+
opacity: 1;
|
|
103
|
+
transition: var(--media-control-transition-in, opacity 0.25s);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
:host([${I.USER_INACTIVE}]:not([${m.MEDIA_PAUSED}]):not([${m.MEDIA_IS_AIRPLAYING}]):not([${m.MEDIA_IS_CASTING}]):not([${I.AUDIO}])) ::slotted(:not([slot=media]):not([slot=poster]):not([${I.NO_AUTOHIDE}]):not([role=dialog])) {
|
|
108
|
+
opacity: 0;
|
|
109
|
+
transition: var(--media-control-transition-out, opacity 1s);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
:host([${I.USER_INACTIVE}]:not([${I.NO_AUTOHIDE}]):not([${m.MEDIA_PAUSED}]):not([${m.MEDIA_IS_CASTING}]):not([${I.AUDIO}])) ::slotted([slot=media]) {
|
|
113
|
+
cursor: none;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
:host([${I.USER_INACTIVE}][${I.AUTOHIDE_OVER_CONTROLS}]:not([${I.NO_AUTOHIDE}]):not([${m.MEDIA_PAUSED}]):not([${m.MEDIA_IS_CASTING}]):not([${I.AUDIO}])) * {
|
|
117
|
+
--media-cursor: none;
|
|
118
|
+
cursor: none;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
::slotted(media-control-bar) {
|
|
123
|
+
align-self: stretch;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
:host(:not([${I.AUDIO}])[${m.MEDIA_HAS_PLAYED}]) slot[name=poster] {
|
|
128
|
+
display: none;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
::slotted([role=dialog]) {
|
|
132
|
+
width: 100%;
|
|
133
|
+
height: 100%;
|
|
134
|
+
align-self: center;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
::slotted([role=menu]) {
|
|
138
|
+
align-self: end;
|
|
139
|
+
}
|
|
140
|
+
</style>
|
|
141
|
+
|
|
142
|
+
<slot name="media" part="layer media-layer"></slot>
|
|
143
|
+
<slot name="poster" part="layer poster-layer"></slot>
|
|
144
|
+
<slot name="gestures-chrome" part="layer gesture-layer">
|
|
145
|
+
<media-gesture-receiver slot="gestures-chrome">
|
|
146
|
+
<template shadowrootmode="${Ze.shadowRootOptions.mode}">
|
|
147
|
+
${Ze.getTemplateHTML({})}
|
|
148
|
+
</template>
|
|
149
|
+
</media-gesture-receiver>
|
|
150
|
+
</slot>
|
|
151
|
+
<span part="layer vertical-layer">
|
|
152
|
+
<slot name="top-chrome" part="top chrome"></slot>
|
|
153
|
+
<slot name="middle-chrome" part="middle chrome"></slot>
|
|
154
|
+
<slot name="centered-chrome" part="layer centered-layer center centered chrome"></slot>
|
|
155
|
+
|
|
156
|
+
<slot part="bottom chrome"></slot>
|
|
157
|
+
</span>
|
|
158
|
+
<slot name="dialog" part="layer dialog-layer"></slot>
|
|
159
|
+
`}var bt=Object.values(m),xt=`sm:384 md:576 lg:768 xl:960`;function St(e){Ct(e.target,e.contentRect.width)}function Ct(e,t){if(!e.isConnected)return;let n=wt(e.getAttribute(I.BREAKPOINTS)??xt),r=Tt(n,t),i=!1;if(Object.keys(n).forEach(t=>{r.includes(t)?e.hasAttribute(`breakpoint${t}`)||(e.setAttribute(`breakpoint${t}`,``),i=!0):e.hasAttribute(`breakpoint${t}`)&&(e.removeAttribute(`breakpoint${t}`),i=!0)}),i){let t=new CustomEvent(h.BREAKPOINTS_CHANGE,{detail:r});e.dispatchEvent(t)}e.breakpointsComputed||(e.breakpointsComputed=!0,e.dispatchEvent(new CustomEvent(h.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))}function wt(e){let t=e.split(/\s+/);return Object.fromEntries(t.map(e=>e.split(`:`)))}function Tt(e,t){return Object.keys(e).filter(n=>t>=parseInt(e[n]))}var Et=class extends S.HTMLElement{constructor(){if(super(),N(this,st),N(this,lt),N(this,dt),N(this,pt),N(this,ht),N(this,$e,void 0),N(this,et,0),N(this,tt,null),N(this,nt,null),N(this,rt,void 0),this.breakpointsComputed=!1,N(this,it,e=>{let t=this.media;for(let n of e){if(n.type!==`childList`)continue;let e=n.removedNodes;for(let r of e){if(r.slot!=`media`||n.target!=this)continue;let e=n.previousSibling&&n.previousSibling.previousElementSibling;if(!e||!t)this.mediaUnsetCallback(r);else{let t=e.slot!==`media`;for(;(e=e.previousSibling)!==null;)e.slot==`media`&&(t=!1);t&&this.mediaUnsetCallback(r)}}if(t)for(let e of n.addedNodes)e===t&&this.handleMediaUpdated(t)}}),N(this,at,!1),N(this,ot,e=>{M(this,at)||(setTimeout(()=>{St(e),P(this,at,!1)},0),P(this,at,!0))}),N(this,_t,void 0),N(this,vt,()=>{M(this,_t).assignedElements({flatten:!0}).length?this.handleMediaUpdated(this.media):M(this,tt)&&this.mediaUnsetCallback(M(this,tt))}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Ae(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}P(this,$e,new MutationObserver(M(this,it)))}static get observedAttributes(){return[I.AUTOHIDE,I.GESTURES_DISABLED].concat(bt).filter(e=>![m.MEDIA_RENDITION_LIST,m.MEDIA_AUDIO_TRACK_LIST,m.MEDIA_CHAPTERS_CUES,m.MEDIA_WIDTH,m.MEDIA_HEIGHT,m.MEDIA_ERROR,m.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,t,n){e.toLowerCase()==I.AUTOHIDE&&(this.autohide=n)}get media(){let e=this.querySelector(`:scope > [slot=media]`);return e?.nodeName==`SLOT`&&(e=e.assignedElements({flatten:!0})[0]),e}async handleMediaUpdated(e){e&&(P(this,tt,e),e.localName.includes(`-`)&&await S.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;M(this,$e).observe(this,{childList:!0,subtree:!0}),Oe(this,M(this,ot));let t=this.getAttribute(I.AUDIO)==null?x(`video player`):x(`audio player`);this.setAttribute(`role`,`region`),this.setAttribute(`aria-label`,t),this.handleMediaUpdated(this.media),this.setAttribute(I.USER_INACTIVE,``),Ct(this,this.getBoundingClientRect().width);let n=this.querySelector(`:scope > slot[slot=media]`);n&&(P(this,_t,n),M(this,_t).addEventListener(`slotchange`,M(this,vt))),this.addEventListener(`pointerdown`,this),this.addEventListener(`pointermove`,this),this.addEventListener(`pointerup`,this),this.addEventListener(`mouseleave`,this),this.addEventListener(`keyup`,this),(e=S.window)==null||e.addEventListener(`mouseup`,this)}disconnectedCallback(){var e;ke(this,M(this,ot)),clearTimeout(M(this,nt)),M(this,$e).disconnect(),this.media&&this.mediaUnsetCallback(this.media),(e=S.window)==null||e.removeEventListener(`mouseup`,this),this.removeEventListener(`pointerdown`,this),this.removeEventListener(`pointermove`,this),this.removeEventListener(`pointerup`,this),this.removeEventListener(`mouseleave`,this),this.removeEventListener(`keyup`,this),M(this,_t)&&(M(this,_t).removeEventListener(`slotchange`,M(this,vt)),P(this,_t,null)),P(this,at,!1)}mediaSetCallback(e){}mediaUnsetCallback(e){P(this,tt,null)}handleEvent(e){switch(e.type){case`pointerdown`:P(this,et,e.timeStamp);break;case`pointermove`:F(this,st,ct).call(this,e);break;case`pointerup`:F(this,lt,ut).call(this,e);break;case`mouseleave`:F(this,dt,ft).call(this);break;case`mouseup`:this.removeAttribute(I.KEYBOARD_CONTROL);break;case`keyup`:F(this,ht,gt).call(this),this.setAttribute(I.KEYBOARD_CONTROL,``)}}set autohide(e){let t=Number(e);P(this,rt,isNaN(t)?0:t)}get autohide(){return(M(this,rt)===void 0?2:M(this,rt)).toString()}get breakpoints(){return k(this,I.BREAKPOINTS)}set breakpoints(e){A(this,I.BREAKPOINTS,e)}get audio(){return D(this,I.AUDIO)}set audio(e){O(this,I.AUDIO,e)}get gesturesDisabled(){return D(this,I.GESTURES_DISABLED)}set gesturesDisabled(e){O(this,I.GESTURES_DISABLED,e)}get keyboardControl(){return D(this,I.KEYBOARD_CONTROL)}set keyboardControl(e){O(this,I.KEYBOARD_CONTROL,e)}get noAutohide(){return D(this,I.NO_AUTOHIDE)}set noAutohide(e){O(this,I.NO_AUTOHIDE,e)}get autohideOverControls(){return D(this,I.AUTOHIDE_OVER_CONTROLS)}set autohideOverControls(e){O(this,I.AUTOHIDE_OVER_CONTROLS,e)}get userInteractive(){return D(this,I.USER_INACTIVE)}set userInteractive(e){O(this,I.USER_INACTIVE,e)}};$e=new WeakMap,et=new WeakMap,tt=new WeakMap,nt=new WeakMap,rt=new WeakMap,it=new WeakMap,at=new WeakMap,ot=new WeakMap,st=new WeakSet,ct=function(e){if(e.pointerType!==`mouse`&&e.timeStamp-M(this,et)<250)return;F(this,pt,mt).call(this),clearTimeout(M(this,nt));let t=this.hasAttribute(I.AUTOHIDE_OVER_CONTROLS);([this,this.media].includes(e.target)||t)&&F(this,ht,gt).call(this)},lt=new WeakSet,ut=function(e){if(e.pointerType===`touch`){let t=!this.hasAttribute(I.USER_INACTIVE);[this,this.media].includes(e.target)&&t?F(this,dt,ft).call(this):F(this,ht,gt).call(this)}else e.composedPath().some(e=>[`media-play-button`,`media-fullscreen-button`].includes(e?.localName))&&F(this,ht,gt).call(this)},dt=new WeakSet,ft=function(){if(M(this,rt)<0||this.hasAttribute(I.USER_INACTIVE))return;this.setAttribute(I.USER_INACTIVE,``);let e=new S.CustomEvent(h.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(e)},pt=new WeakSet,mt=function(){if(!this.hasAttribute(I.USER_INACTIVE))return;this.removeAttribute(I.USER_INACTIVE);let e=new S.CustomEvent(h.USER_INACTIVE_CHANGE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(e)},ht=new WeakSet,gt=function(){F(this,pt,mt).call(this),clearTimeout(M(this,nt));let e=parseInt(this.autohide);e<0||P(this,nt,setTimeout(()=>{F(this,dt,ft).call(this)},e*1e3))},_t=new WeakMap,vt=new WeakMap,Et.shadowRootOptions={mode:`open`},Et.getTemplateHTML=yt,S.customElements.get(`media-container`)||S.customElements.define(`media-container`,Et);var Dt=Et,Ot=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},L=(e,t,n)=>(Ot(e,t,`read from private field`),n?n.call(e):t.get(e)),kt=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},At=(e,t,n,r)=>(Ot(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),jt,Mt,Nt,Pt,Ft,It,Lt=class{constructor(e,t,{defaultValue:n}={defaultValue:void 0}){kt(this,Ft),kt(this,jt,void 0),kt(this,Mt,void 0),kt(this,Nt,void 0),kt(this,Pt,new Set),At(this,jt,e),At(this,Mt,t),At(this,Nt,new Set(n))}[Symbol.iterator](){return L(this,Ft,It).values()}get length(){return L(this,Ft,It).size}get value(){return[...L(this,Ft,It)].join(` `)??``}set value(e){e!==this.value&&(At(this,Pt,new Set),this.add(...e?.split(` `)??[]))}toString(){return this.value}item(e){return[...L(this,Ft,It)][e]}values(){return L(this,Ft,It).values()}forEach(e,t){L(this,Ft,It).forEach(e,t)}add(...e){var t;e.forEach(e=>L(this,Pt).add(e)),(this.value!==``||L(this,jt)?.hasAttribute(`${L(this,Mt)}`))&&((t=L(this,jt))==null||t.setAttribute(`${L(this,Mt)}`,`${this.value}`))}remove(...e){var t;e.forEach(e=>L(this,Pt).delete(e)),(t=L(this,jt))==null||t.setAttribute(`${L(this,Mt)}`,`${this.value}`)}contains(e){return L(this,Ft,It).has(e)}toggle(e,t){return t===void 0?this.contains(e)?(this.remove(e),!1):(this.add(e),!0):t?(this.add(e),!0):(this.remove(e),!1)}replace(e,t){return this.remove(e),this.add(t),e===t}};jt=new WeakMap,Mt=new WeakMap,Nt=new WeakMap,Pt=new WeakMap,Ft=new WeakSet,It=function(){return L(this,Pt).size?L(this,Pt):L(this,Nt)};var Rt=(e=``)=>e.split(/\s+/),zt=(e=``)=>{let[t,n,r]=e.split(`:`),i=r?decodeURIComponent(r):void 0;return{kind:t===`cc`?g.CAPTIONS:g.SUBTITLES,language:n,label:i}},Bt=(e=``,t={})=>Rt(e).map(e=>{let n=zt(e);return{...t,...n}}),Vt=e=>e?Array.isArray(e)?e.map(e=>typeof e==`string`?zt(e):e):typeof e==`string`?Bt(e):[e]:[],Ht=({kind:e,label:t,language:n}={kind:`subtitles`})=>t?`${e===`captions`?`cc`:`sb`}:${n}:${encodeURIComponent(t)}`:n,Ut=(e=[])=>Array.prototype.map.call(e,Ht).join(` `),Wt=(e,t)=>n=>n[e]===t,Gt=e=>{let t=Object.entries(e).map(([e,t])=>Wt(e,t));return e=>t.every(t=>t(e))},Kt=(e,t=[],n=[])=>{let r=Vt(n).map(Gt);Array.from(t).filter(e=>r.some(t=>t(e))).forEach(t=>{t.mode=e})},qt=(e,t=()=>!0)=>{if(!e?.textTracks)return[];let n=typeof t==`function`?t:Gt(t);return Array.from(e.textTracks).filter(n)},Jt=e=>!!e.mediaSubtitlesShowing?.length||e.hasAttribute(m.MEDIA_SUBTITLES_SHOWING),Yt=e=>{let{media:t,fullscreenElement:n}=e;try{let e=n&&`requestFullscreen`in n?`requestFullscreen`:n&&`webkitRequestFullScreen`in n?`webkitRequestFullScreen`:void 0;if(e){let t=n[e]?.call(n);if(t instanceof Promise)return t.catch(()=>{})}else t?.webkitEnterFullscreen?t.webkitEnterFullscreen():t?.requestFullscreen&&t.requestFullscreen()}catch(e){console.error(e)}},Xt=`exitFullscreen`in C?`exitFullscreen`:`webkitExitFullscreen`in C?`webkitExitFullscreen`:`webkitCancelFullScreen`in C?`webkitCancelFullScreen`:void 0,Zt=e=>{let{documentElement:t}=e;if(Xt){let e=(t?.[Xt])?.call(t);if(e instanceof Promise)return e.catch(()=>{})}},Qt=`fullscreenElement`in C?`fullscreenElement`:`webkitFullscreenElement`in C?`webkitFullscreenElement`:void 0,$t=e=>{let{documentElement:t,media:n}=e,r=t?.[Qt];return!r&&`webkitDisplayingFullscreen`in n&&`webkitPresentationMode`in n&&n.webkitDisplayingFullscreen&&n.webkitPresentationMode===te.FULLSCREEN?n:r},en=e=>{let{media:t,documentElement:n,fullscreenElement:r=t}=e;if(!t||!n)return!1;let i=$t(e);if(!i)return!1;if(i===r||i===t)return!0;if(i.localName.includes(`-`)){let e=i.shadowRoot;if(!(Qt in e))return Ie(i,r);for(;e?.[Qt];){if(e[Qt]===r)return!0;e=e[Qt]?.shadowRoot}}return!1},tn=`fullscreenEnabled`in C?`fullscreenEnabled`:`webkitFullscreenEnabled`in C?`webkitFullscreenEnabled`:void 0,nn=e=>{let{documentElement:t,media:n}=e;return!!t?.[tn]||n&&`webkitSupportsFullscreen`in n},rn,an=()=>{var e;return rn||(rn=((e=C)?.createElement)?.call(e,`video`),rn)},on=async(e=an())=>{if(!e)return!1;let t=e.volume;e.volume=t/2+.1;let n=new AbortController,r=await Promise.race([sn(e,n.signal),cn(e,t)]);return n.abort(),r},sn=(e,t)=>new Promise(n=>{e.addEventListener(`volumechange`,()=>n(!0),{signal:t})}),cn=async(e,t)=>{for(let n=0;n<10;n++){if(e.volume===t)return!1;await se(10)}return e.volume!==t},ln=/.*Version\/.*Safari\/.*/.test(S.navigator.userAgent),un=(e=an())=>S.matchMedia(`(display-mode: standalone)`).matches&&ln?!1:typeof e?.requestPictureInPicture==`function`,dn=(e=an())=>nn({documentElement:C,media:e}),fn=dn(),pn=un(),mn=!!S.WebKitPlaybackTargetAvailabilityEvent,hn=!!S.chrome,gn=e=>qt(e.media,e=>[g.SUBTITLES,g.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),_n=e=>qt(e.media,e=>e.mode===_.SHOWING&&[g.SUBTITLES,g.CAPTIONS].includes(e.kind)),vn=(e,t)=>{let n=gn(e),r=_n(e),i=!!r.length;if(n.length){if(t===!1||i&&t!==!0)Kt(_.DISABLED,n,r);else if(t===!0||!i&&t!==!1){let t=n[0],{options:i}=e;if(!i?.noSubtitlesLangPref){let e=S.localStorage.getItem(`media-chrome-pref-subtitles-lang`),r=e?[e,...S.navigator.languages]:S.navigator.languages,i=n.filter(e=>r.some(t=>e.language.toLowerCase().startsWith(t.split(`-`)[0]))).sort((e,t)=>r.findIndex(t=>e.language.toLowerCase().startsWith(t.split(`-`)[0]))-r.findIndex(e=>t.language.toLowerCase().startsWith(e.split(`-`)[0])));i[0]&&(t=i[0])}let{language:a,label:o,kind:s}=t;Kt(_.DISABLED,n,r),Kt(_.SHOWING,n,[{language:a,label:o,kind:s}])}}},yn=(e,t)=>e===t?!0:e==null||t==null||typeof e!=typeof t?!1:typeof e==`number`&&Number.isNaN(e)&&Number.isNaN(t)?!0:typeof e==`object`?Array.isArray(e)?bn(e,t):Object.entries(e).every(([e,n])=>e in t&&yn(n,t[e])):!1,bn=(e,t)=>{let n=Array.isArray(e),r=Array.isArray(t);return n===r?n||r?e.length===t.length&&e.every((e,n)=>yn(e,t[n])):!0:!1},xn=Object.values(b),Sn,Cn=on().then(e=>(Sn=e,Sn)),wn=async(...e)=>{await Promise.all(e.filter(e=>e).map(async e=>{if(!(`localName`in e&&e instanceof S.HTMLElement))return;let t=e.localName;if(!t.includes(`-`))return;let n=S.customElements.get(t);n&&e instanceof n||(await S.customElements.whenDefined(t),S.customElements.upgrade(e))}))},Tn=new S.DOMParser,En=e=>e&&(Tn.parseFromString(e,`text/html`).body.textContent||e),Dn={mediaError:{get(e,t){let{media:n}=e;if(t?.type!==`playing`)return n?.error},mediaEvents:[`emptied`,`error`,`playing`]},mediaErrorCode:{get(e,t){let{media:n}=e;if(t?.type!==`playing`)return n?.error?.code},mediaEvents:[`emptied`,`error`,`playing`]},mediaErrorMessage:{get(e,t){let{media:n}=e;if(t?.type!==`playing`)return n?.error?.message??``},mediaEvents:[`emptied`,`error`,`playing`]},mediaWidth:{get(e){let{media:t}=e;return t?.videoWidth??0},mediaEvents:[`resize`]},mediaHeight:{get(e){let{media:t}=e;return t?.videoHeight??0},mediaEvents:[`resize`]},mediaPaused:{get(e){let{media:t}=e;return t?.paused??!0},set(e,t){var n;let{media:r}=t;r&&(e?r.pause():(n=r.play())==null||n.catch(()=>{}))},mediaEvents:[`play`,`playing`,`pause`,`emptied`]},mediaHasPlayed:{get(e,t){let{media:n}=e;return n?t?t.type===`playing`:!n.paused:!1},mediaEvents:[`playing`,`emptied`]},mediaEnded:{get(e){let{media:t}=e;return t?.ended??!1},mediaEvents:[`seeked`,`ended`,`emptied`]},mediaPlaybackRate:{get(e){let{media:t}=e;return t?.playbackRate??1},set(e,t){let{media:n}=t;n&&Number.isFinite(+e)&&(n.playbackRate=+e)},mediaEvents:[`ratechange`,`loadstart`]},mediaMuted:{get(e){let{media:t}=e;return t?.muted??!1},set(e,t){let{media:n,options:{noMutedPref:r}={}}=t;if(n){n.muted=e;try{let t=S.localStorage.getItem(`media-chrome-pref-muted`)!==null,i=n.hasAttribute(`muted`);if(r){t&&S.localStorage.removeItem(`media-chrome-pref-muted`);return}if(i&&!t)return;S.localStorage.setItem(`media-chrome-pref-muted`,e?`true`:`false`)}catch(e){console.debug(`Error setting muted pref`,e)}}},mediaEvents:[`volumechange`],stateOwnersUpdateHandlers:[(e,t)=>{let{options:{noMutedPref:n}}=t,{media:r}=t;if(!(!r||r.muted||n))try{let n=S.localStorage.getItem(`media-chrome-pref-muted`)===`true`;Dn.mediaMuted.set(n,t),e(n)}catch(e){console.debug(`Error getting muted pref`,e)}}]},mediaLoop:{get(e){let{media:t}=e;return t?.loop},set(e,t){let{media:n}=t;n&&(n.loop=e)},mediaEvents:[`medialooprequest`]},mediaVolume:{get(e){let{media:t}=e;return t?.volume??1},set(e,t){let{media:n,options:{noVolumePref:r}={}}=t;if(n){try{e==null?S.localStorage.removeItem(`media-chrome-pref-volume`):!n.hasAttribute(`muted`)&&!r&&S.localStorage.setItem(`media-chrome-pref-volume`,e.toString())}catch(e){console.debug(`Error setting volume pref`,e)}Number.isFinite(+e)&&(n.volume=+e)}},mediaEvents:[`volumechange`],stateOwnersUpdateHandlers:[(e,t)=>{let{options:{noVolumePref:n}}=t;if(!n)try{let{media:n}=t;if(!n)return;let r=S.localStorage.getItem(`media-chrome-pref-volume`);if(r==null)return;Dn.mediaVolume.set(+r,t),e(+r)}catch(e){console.debug(`Error getting volume pref`,e)}}]},mediaVolumeLevel:{get(e){let{media:t}=e;return t?.volume===void 0?`high`:t.muted||t.volume===0?`off`:t.volume<.5?`low`:t.volume<.75?`medium`:`high`},mediaEvents:[`volumechange`]},mediaCurrentTime:{get(e){let{media:t}=e;return t?.currentTime??0},set(e,t){let{media:n}=t;n&&oe(e)&&(n.currentTime=e)},mediaEvents:[`timeupdate`,`loadedmetadata`,`seeking`]},mediaDuration:{get(e){let{media:t,options:{defaultDuration:n}={}}=e;return n&&(!t||!t.duration||Number.isNaN(t.duration)||!Number.isFinite(t.duration))?n:Number.isFinite(t?.duration)?t.duration:NaN},mediaEvents:[`durationchange`,`loadedmetadata`,`emptied`]},mediaLoading:{get(e){let{media:t}=e;return t?.readyState<3},mediaEvents:[`waiting`,`playing`,`emptied`]},mediaSeekable:{get(e){let{media:t}=e;if(!t?.seekable?.length)return;let n=t.seekable.start(0),r=t.seekable.end(t.seekable.length-1);if(n||r)return[Number(n.toFixed(3)),Number(r.toFixed(3))]},mediaEvents:[`loadedmetadata`,`emptied`,`progress`,`seekablechange`]},mediaBuffered:{get(e){let{media:t}=e,n=t?.buffered??[];return Array.from(n).map((e,t)=>[Number(n.start(t).toFixed(3)),Number(n.end(t).toFixed(3))])},mediaEvents:[`progress`,`emptied`]},mediaStreamType:{get(e){let{media:t,options:{defaultStreamType:n}={}}=e,r=[b.LIVE,b.ON_DEMAND].includes(n)?n:void 0;if(!t)return r;let{streamType:i}=t;if(xn.includes(i))return i===b.UNKNOWN?r:i;let a=t.duration;return a===1/0?b.LIVE:Number.isFinite(a)?b.ON_DEMAND:r},mediaEvents:[`emptied`,`durationchange`,`loadedmetadata`,`streamtypechange`]},mediaTargetLiveWindow:{get(e){let{media:t}=e;if(!t)return NaN;let{targetLiveWindow:n}=t,r=Dn.mediaStreamType.get(e);return(n==null||Number.isNaN(n))&&r===b.LIVE?0:n},mediaEvents:[`emptied`,`durationchange`,`loadedmetadata`,`streamtypechange`,`targetlivewindowchange`]},mediaTimeIsLive:{get(e){let{media:t,options:{liveEdgeOffset:n=10}={}}=e;if(!t)return!1;if(typeof t.liveEdgeStart==`number`)return!Number.isNaN(t.liveEdgeStart)&&t.currentTime>=t.liveEdgeStart;if(Dn.mediaStreamType.get(e)!==b.LIVE)return!1;let r=t.seekable;if(!r)return!0;if(!r.length)return!1;let i=r.end(r.length-1)-n;return t.currentTime>=i},mediaEvents:[`playing`,`timeupdate`,`progress`,`waiting`,`emptied`]},mediaSubtitlesList:{get(e){return gn(e).map(({kind:e,label:t,language:n})=>({kind:e,label:t,language:n}))},mediaEvents:[`loadstart`],textTracksEvents:[`addtrack`,`removetrack`]},mediaSubtitlesShowing:{get(e){return _n(e).map(({kind:e,label:t,language:n})=>({kind:e,label:t,language:n}))},mediaEvents:[`loadstart`],textTracksEvents:[`addtrack`,`removetrack`,`change`],stateOwnersUpdateHandlers:[(e,t)=>{var n,r;let{media:i,options:a}=t;if(!i)return;let o=e=>{a.defaultSubtitles&&(!e||[g.CAPTIONS,g.SUBTITLES].includes(e?.track?.kind))&&vn(t,!0)};return i.addEventListener(`loadstart`,o),(n=i.textTracks)==null||n.addEventListener(`addtrack`,o),(r=i.textTracks)==null||r.addEventListener(`removetrack`,o),()=>{var e,t;i.removeEventListener(`loadstart`,o),(e=i.textTracks)==null||e.removeEventListener(`addtrack`,o),(t=i.textTracks)==null||t.removeEventListener(`removetrack`,o)}}]},mediaChaptersCues:{get(e){let{media:t}=e;if(!t)return[];let[n]=qt(t,{kind:g.CHAPTERS});return Array.from(n?.cues??[]).map(({text:e,startTime:t,endTime:n})=>({text:En(e),startTime:t,endTime:n}))},mediaEvents:[`loadstart`,`loadedmetadata`],textTracksEvents:[`addtrack`,`removetrack`,`change`],stateOwnersUpdateHandlers:[(e,t)=>{let{media:n}=t;if(!n)return;let r=n.querySelector(`track[kind="chapters"][default][src]`),i=n.shadowRoot?.querySelector(`:is(video,audio) > track[kind="chapters"][default][src]`);return r?.addEventListener(`load`,e),i?.addEventListener(`load`,e),()=>{r?.removeEventListener(`load`,e),i?.removeEventListener(`load`,e)}}]},mediaIsPip:{get(e){let{media:t,documentElement:n}=e;if(!t||!n||!n.pictureInPictureElement)return!1;if(n.pictureInPictureElement===t)return!0;if(n.pictureInPictureElement instanceof HTMLMediaElement)return t.localName?.includes(`-`)?Ie(t,n.pictureInPictureElement):!1;if(n.pictureInPictureElement.localName.includes(`-`)){let e=n.pictureInPictureElement.shadowRoot;for(;e?.pictureInPictureElement;){if(e.pictureInPictureElement===t)return!0;e=e.pictureInPictureElement?.shadowRoot}}return!1},set(e,t){let{media:n}=t;if(n){if(e){if(!C.pictureInPictureEnabled){console.warn(`MediaChrome: Picture-in-picture is not enabled`);return}if(!n.requestPictureInPicture){console.warn(`MediaChrome: The current media does not support picture-in-picture`);return}let e=()=>{console.warn(`MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.`)};n.requestPictureInPicture().catch(t=>{if(t.code===11){if(!n.src){console.warn(`MediaChrome: The media is not ready for picture-in-picture. It must have a src set.`);return}if(n.readyState===0&&n.preload===`none`){let t=()=>{n.removeEventListener(`loadedmetadata`,r),n.preload=`none`},r=()=>{n.requestPictureInPicture().catch(e),t()};n.addEventListener(`loadedmetadata`,r),n.preload=`metadata`,setTimeout(()=>{n.readyState===0&&e(),t()},1e3)}else throw t}else throw t})}else C.pictureInPictureElement&&C.exitPictureInPicture()}},mediaEvents:[`enterpictureinpicture`,`leavepictureinpicture`]},mediaRenditionList:{get(e){let{media:t}=e;return[...t?.videoRenditions??[]].map(e=>({...e}))},mediaEvents:[`emptied`,`loadstart`],videoRenditionsEvents:[`addrendition`,`removerendition`]},mediaRenditionSelected:{get(e){let{media:t}=e;return t?.videoRenditions?.[t.videoRenditions?.selectedIndex]?.id},set(e,t){let{media:n}=t;if(!n?.videoRenditions){console.warn(`MediaController: Rendition selection not supported by this media.`);return}let r=e,i=Array.prototype.findIndex.call(n.videoRenditions,e=>e.id==r);n.videoRenditions.selectedIndex!=i&&(n.videoRenditions.selectedIndex=i)},mediaEvents:[`emptied`],videoRenditionsEvents:[`addrendition`,`removerendition`,`change`]},mediaAudioTrackList:{get(e){let{media:t}=e;return[...t?.audioTracks??[]]},mediaEvents:[`emptied`,`loadstart`],audioTracksEvents:[`addtrack`,`removetrack`]},mediaAudioTrackEnabled:{get(e){let{media:t}=e;return[...t?.audioTracks??[]].find(e=>e.enabled)?.id},set(e,t){let{media:n}=t;if(!n?.audioTracks){console.warn(`MediaChrome: Audio track selection not supported by this media.`);return}let r=e;for(let e of n.audioTracks)e.enabled=r==e.id},mediaEvents:[`emptied`],audioTracksEvents:[`addtrack`,`removetrack`,`change`]},mediaIsFullscreen:{get(e){return en(e)},set(e,t,n){var r;e?(Yt(t),n.detail&&!t.media?.inert&&((r=t.media)==null||r.focus())):Zt(t)},rootEvents:[`fullscreenchange`,`webkitfullscreenchange`],mediaEvents:[`webkitbeginfullscreen`,`webkitendfullscreen`,`webkitpresentationmodechanged`]},mediaIsCasting:{get(e){let{media:t}=e;return!t?.remote||t.remote?.state===`disconnected`?!1:t.remote.state===`connected`},set(e,t){let{media:n}=t;n&&(e&&n.remote?.state!==`disconnected`||(e||n.remote?.state===`connected`)&&(typeof n.remote.prompt==`function`?n.remote.prompt().catch(()=>{}):console.warn(`MediaChrome: Casting is not supported in this environment`)))},remoteEvents:[`connect`,`connecting`,`disconnect`]},mediaIsAirplaying:{get(){return!1},set(e,t){let{media:n}=t;n&&(n.webkitShowPlaybackTargetPicker&&S.WebKitPlaybackTargetAvailabilityEvent?n.webkitShowPlaybackTargetPicker():console.error(`MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment`))},mediaEvents:[`webkitcurrentplaybacktargetiswirelesschanged`]},mediaFullscreenUnavailable:{get(e){let{media:t}=e;if(!fn||!dn(t))return y.UNSUPPORTED}},mediaPipUnavailable:{get(e){let{media:t}=e;if(!pn||!un(t))return y.UNSUPPORTED;if(t?.disablePictureInPicture)return y.UNAVAILABLE}},mediaVolumeUnavailable:{get(e){let{media:t}=e;if(Sn===!1||t?.volume==null)return y.UNSUPPORTED},stateOwnersUpdateHandlers:[e=>{Sn??Cn.then(t=>e(t?void 0:y.UNSUPPORTED))}]},mediaCastUnavailable:{get(e,{availability:t=`not-available`}={}){let{media:n}=e;if(!hn||!n?.remote?.state)return y.UNSUPPORTED;if(t!=null&&t!==`available`)return y.UNAVAILABLE},stateOwnersUpdateHandlers:[(e,t)=>{var n;let{media:r}=t;if(r)return r.disableRemotePlayback||r.hasAttribute(`disableremoteplayback`)||(n=r?.remote)==null||n.watchAvailability(t=>{e({availability:t?`available`:`not-available`})}).catch(t=>{t.name===`NotSupportedError`?e({availability:null}):e({availability:`not-available`})}),()=>{var e;(e=r?.remote)==null||e.cancelWatchAvailability().catch(()=>{})}}]},mediaAirplayUnavailable:{get(e,t){if(!mn)return y.UNSUPPORTED;if(t?.availability===`not-available`)return y.UNAVAILABLE},mediaEvents:[`webkitplaybacktargetavailabilitychanged`],stateOwnersUpdateHandlers:[(e,t)=>{var n;let{media:r}=t;if(r)return r.disableRemotePlayback||r.hasAttribute(`disableremoteplayback`)||(n=r?.remote)==null||n.watchAvailability(t=>{e({availability:t?`available`:`not-available`})}).catch(t=>{t.name===`NotSupportedError`?e({availability:null}):e({availability:`not-available`})}),()=>{var e;(e=r?.remote)==null||e.cancelWatchAvailability().catch(()=>{})}}]},mediaRenditionUnavailable:{get(e){let{media:t}=e;if(!t?.videoRenditions)return y.UNSUPPORTED;if(!t.videoRenditions?.length)return y.UNAVAILABLE},mediaEvents:[`emptied`,`loadstart`],videoRenditionsEvents:[`addrendition`,`removerendition`]},mediaAudioTrackUnavailable:{get(e){let{media:t}=e;if(!t?.audioTracks)return y.UNSUPPORTED;if((t.audioTracks?.length??0)<=1)return y.UNAVAILABLE},mediaEvents:[`emptied`,`loadstart`],audioTracksEvents:[`addtrack`,`removetrack`]},mediaLang:{get(e){let{options:{mediaLang:t}={}}=e;return t??`en`}}},On={[u.MEDIA_PREVIEW_REQUEST](e,t,{detail:n}){let{media:r}=t,i=n??void 0,a,o;if(r&&i!=null){let[e]=qt(r,{kind:g.METADATA,label:`thumbnails`}),t=Array.prototype.find.call(e?.cues??[],(e,t,n)=>t===0?e.endTime>i:t===n.length-1?e.startTime<=i:e.startTime<=i&&e.endTime>i);if(t){let e=/'^(?:[a-z]+:)?\/\//i.test(t.text)?void 0:r?.querySelector(`track[label="thumbnails"]`)?.src,n=new URL(t.text,e);o=new URLSearchParams(n.hash).get(`#xywh`).split(`,`).map(e=>+e),a=n.href}}let s=e.mediaDuration.get(t),c=e.mediaChaptersCues.get(t).find((e,t,n)=>t===n.length-1&&s===e.endTime?e.startTime<=i&&e.endTime>=i:e.startTime<=i&&e.endTime>i)?.text;return n!=null&&c==null&&(c=``),{mediaPreviewTime:i,mediaPreviewImage:a,mediaPreviewCoords:o,mediaPreviewChapter:c}},[u.MEDIA_PAUSE_REQUEST](e,t){e.mediaPaused.set(!0,t)},[u.MEDIA_PLAY_REQUEST](e,t){let n=e.mediaStreamType.get(t)===b.LIVE,r=!t.options?.noAutoSeekToLive,i=e.mediaTargetLiveWindow.get(t)>0;if(n&&r&&!i){let n=e.mediaSeekable.get(t)?.[1];if(n){let r=n-(t.options?.seekToLiveOffset??0);e.mediaCurrentTime.set(r,t)}}e.mediaPaused.set(!1,t)},[u.MEDIA_PLAYBACK_RATE_REQUEST](e,t,{detail:n}){let r=n;e.mediaPlaybackRate.set(r,t)},[u.MEDIA_MUTE_REQUEST](e,t){e.mediaMuted.set(!0,t)},[u.MEDIA_UNMUTE_REQUEST](e,t){e.mediaVolume.get(t)||e.mediaVolume.set(.25,t),e.mediaMuted.set(!1,t)},[u.MEDIA_LOOP_REQUEST](e,t,{detail:n}){let r=!!n;return e.mediaLoop.set(r,t),{mediaLoop:r}},[u.MEDIA_VOLUME_REQUEST](e,t,{detail:n}){let r=n;r&&e.mediaMuted.get(t)&&e.mediaMuted.set(!1,t),e.mediaVolume.set(r,t)},[u.MEDIA_SEEK_REQUEST](e,t,{detail:n}){let r=n;e.mediaCurrentTime.set(r,t)},[u.MEDIA_SEEK_TO_LIVE_REQUEST](e,t){let n=e.mediaSeekable.get(t)?.[1];if(Number.isNaN(Number(n)))return;let r=n-(t.options?.seekToLiveOffset??0);e.mediaCurrentTime.set(r,t)},[u.MEDIA_SHOW_SUBTITLES_REQUEST](e,t,{detail:n}){let{options:r}=t,i=gn(t),a=Vt(n),o=a[0]?.language;o&&!r.noSubtitlesLangPref&&S.localStorage.setItem(`media-chrome-pref-subtitles-lang`,o),Kt(_.SHOWING,i,a)},[u.MEDIA_DISABLE_SUBTITLES_REQUEST](e,t,{detail:n}){let r=gn(t),i=n??[];Kt(_.DISABLED,r,i)},[u.MEDIA_TOGGLE_SUBTITLES_REQUEST](e,t,{detail:n}){vn(t,n)},[u.MEDIA_RENDITION_REQUEST](e,t,{detail:n}){let r=n;e.mediaRenditionSelected.set(r,t)},[u.MEDIA_AUDIO_TRACK_REQUEST](e,t,{detail:n}){let r=n;e.mediaAudioTrackEnabled.set(r,t)},[u.MEDIA_ENTER_PIP_REQUEST](e,t){e.mediaIsFullscreen.get(t)&&e.mediaIsFullscreen.set(!1,t),e.mediaIsPip.set(!0,t)},[u.MEDIA_EXIT_PIP_REQUEST](e,t){e.mediaIsPip.set(!1,t)},[u.MEDIA_ENTER_FULLSCREEN_REQUEST](e,t,n){e.mediaIsPip.get(t)&&e.mediaIsPip.set(!1,t),e.mediaIsFullscreen.set(!0,t,n)},[u.MEDIA_EXIT_FULLSCREEN_REQUEST](e,t){e.mediaIsFullscreen.set(!1,t)},[u.MEDIA_ENTER_CAST_REQUEST](e,t){e.mediaIsFullscreen.get(t)&&e.mediaIsFullscreen.set(!1,t),e.mediaIsCasting.set(!0,t)},[u.MEDIA_EXIT_CAST_REQUEST](e,t){e.mediaIsCasting.set(!1,t)},[u.MEDIA_AIRPLAY_REQUEST](e,t){e.mediaIsAirplaying.set(!0,t)}},kn=({media:e,fullscreenElement:t,documentElement:n,stateMediator:r=Dn,requestMap:i=On,options:a={},monitorStateOwnersOnlyWithSubscriptions:o=!0})=>{let s=[],c={options:{...a}},l=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0}),u=e=>{e!=null&&(yn(e,l)||(l=Object.freeze({...l,...e}),s.forEach(e=>e(l))))},d=()=>{let e=Object.entries(r).reduce((e,[t,{get:n}])=>(e[t]=n(c),e),{});u(e)},f={},p,m=async(e,t)=>{let n=!!p;if(p={...c,...p??{},...e},n)return;await wn(...Object.values(e));let i=s.length>0&&t===0&&o,a=c.media!==p.media,l=c.media?.textTracks!==p.media?.textTracks,m=c.media?.videoRenditions!==p.media?.videoRenditions,h=c.media?.audioTracks!==p.media?.audioTracks,ee=c.media?.remote!==p.media?.remote,g=c.documentElement!==p.documentElement,_=!!c.media&&(a||i),v=!!c.media?.textTracks&&(l||i),y=!!c.media?.videoRenditions&&(m||i),b=!!c.media?.audioTracks&&(h||i),te=!!c.media?.remote&&(ee||i),ne=!!c.documentElement&&(g||i),re=_||v||y||b||te||ne,ie=s.length===0&&t===1&&o,ae=!!p.media&&(a||ie),oe=!!p.media?.textTracks&&(l||ie),se=!!p.media?.videoRenditions&&(m||ie),ce=!!p.media?.audioTracks&&(h||ie),le=!!p.media?.remote&&(ee||ie),ue=!!p.documentElement&&(g||ie),de=ae||oe||se||ce||le||ue;re||de?(Object.entries(r).forEach(([e,{get:t,mediaEvents:n=[],textTracksEvents:r=[],videoRenditionsEvents:i=[],audioTracksEvents:a=[],remoteEvents:o=[],rootEvents:s=[],stateOwnersUpdateHandlers:l=[]}])=>{f[e]||(f[e]={});let d=n=>{let r=t(c,n);u({[e]:r})},m;m=f[e].mediaEvents,n.forEach(t=>{m&&_&&(c.media.removeEventListener(t,m),f[e].mediaEvents=void 0),ae&&(p.media.addEventListener(t,d),f[e].mediaEvents=d)}),m=f[e].textTracksEvents,r.forEach(t=>{var n,r;m&&v&&((n=c.media.textTracks)==null||n.removeEventListener(t,m),f[e].textTracksEvents=void 0),oe&&((r=p.media.textTracks)==null||r.addEventListener(t,d),f[e].textTracksEvents=d)}),m=f[e].videoRenditionsEvents,i.forEach(t=>{var n,r;m&&y&&((n=c.media.videoRenditions)==null||n.removeEventListener(t,m),f[e].videoRenditionsEvents=void 0),se&&((r=p.media.videoRenditions)==null||r.addEventListener(t,d),f[e].videoRenditionsEvents=d)}),m=f[e].audioTracksEvents,a.forEach(t=>{var n,r;m&&b&&((n=c.media.audioTracks)==null||n.removeEventListener(t,m),f[e].audioTracksEvents=void 0),ce&&((r=p.media.audioTracks)==null||r.addEventListener(t,d),f[e].audioTracksEvents=d)}),m=f[e].remoteEvents,o.forEach(t=>{var n,r;m&&te&&((n=c.media.remote)==null||n.removeEventListener(t,m),f[e].remoteEvents=void 0),le&&((r=p.media.remote)==null||r.addEventListener(t,d),f[e].remoteEvents=d)}),m=f[e].rootEvents,s.forEach(t=>{m&&ne&&(c.documentElement.removeEventListener(t,m),f[e].rootEvents=void 0),ue&&(p.documentElement.addEventListener(t,d),f[e].rootEvents=d)});let h=f[e].stateOwnersUpdateHandlers;if(h&&re&&(Array.isArray(h)?h:[h]).forEach(e=>{typeof e==`function`&&e()}),de){let t=l.map(e=>e(d,p)).filter(e=>typeof e==`function`);f[e].stateOwnersUpdateHandlers=t.length===1?t[0]:t}else re&&(f[e].stateOwnersUpdateHandlers=void 0)}),Object.entries(p).forEach(([e,t])=>{c[e]=t}),d(),p=void 0):(Object.entries(p).forEach(([e,t])=>{c[e]=t}),d(),p=void 0)};return m({media:e,fullscreenElement:t,documentElement:n,options:a}),{dispatch(e){let{type:t,detail:n}=e;i[t]&&l.mediaErrorCode==null?u(i[t](r,c,e)):t===`mediaelementchangerequest`?m({media:n}):t===`fullscreenelementchangerequest`?m({fullscreenElement:n}):t===`documentelementchangerequest`?m({documentElement:n}):t===`optionschangerequest`&&(Object.entries(n??{}).forEach(([e,t])=>{c.options[e]=t}),d())},getState(){return l},subscribe(e){return m({},s.length+1),s.push(e),e(l),()=>{let t=s.indexOf(e);t>=0&&(m({},s.length-1),s.splice(t,1))}}}},An=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},R=(e,t,n)=>(An(e,t,`read from private field`),n?n.call(e):t.get(e)),z=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},jn=(e,t,n,r)=>(An(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),Mn=(e,t,n)=>(An(e,t,`access private method`),n),Nn,Pn,B,Fn,In,Ln,Rn,zn,Bn,Vn,Hn,Un,Wn,Gn,Kn,qn=[`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Enter`,` `,`f`,`m`,`k`,`c`,`l`,`j`,`>`,`<`,`p`],Jn=10,Yn=.025,Xn=.25,Zn=.25,Qn=2,V={DEFAULT_SUBTITLES:`defaultsubtitles`,DEFAULT_STREAM_TYPE:`defaultstreamtype`,DEFAULT_DURATION:`defaultduration`,FULLSCREEN_ELEMENT:`fullscreenelement`,HOTKEYS:`hotkeys`,KEYBOARD_BACKWARD_SEEK_OFFSET:`keyboardbackwardseekoffset`,KEYBOARD_FORWARD_SEEK_OFFSET:`keyboardforwardseekoffset`,KEYBOARD_DOWN_VOLUME_STEP:`keyboarddownvolumestep`,KEYBOARD_UP_VOLUME_STEP:`keyboardupvolumestep`,KEYS_USED:`keysused`,LANG:`lang`,LOOP:`loop`,LIVE_EDGE_OFFSET:`liveedgeoffset`,NO_AUTO_SEEK_TO_LIVE:`noautoseektolive`,NO_DEFAULT_STORE:`nodefaultstore`,NO_HOTKEYS:`nohotkeys`,NO_MUTED_PREF:`nomutedpref`,NO_SUBTITLES_LANG_PREF:`nosubtitleslangpref`,NO_VOLUME_PREF:`novolumepref`,SEEK_TO_LIVE_OFFSET:`seektoliveoffset`},$n=class extends Et{constructor(){super(),z(this,Bn),z(this,Un),z(this,Gn),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,z(this,Nn,new Lt(this,V.HOTKEYS)),z(this,Pn,void 0),z(this,B,void 0),z(this,Fn,null),z(this,In,void 0),z(this,Ln,void 0),z(this,Rn,e=>{var t;(t=R(this,B))==null||t.dispatch(e)}),z(this,zn,void 0),z(this,Hn,e=>{let{key:t,shiftKey:n}=e;n&&(t===`/`||t===`?`)||qn.includes(t)?this.keyboardShortcutHandler(e):this.removeEventListener(`keyup`,R(this,Hn))}),this.associateElement(this);let e={};jn(this,In,t=>{Object.entries(t).forEach(([t,n])=>{if(t in e&&e[t]===n)return;this.propagateMediaState(t,n);let r=t.toLowerCase(),i=new S.CustomEvent(ee[r],{composed:!0,detail:n});this.dispatchEvent(i)}),e=t})}static get observedAttributes(){return super.observedAttributes.concat(V.NO_HOTKEYS,V.HOTKEYS,V.DEFAULT_STREAM_TYPE,V.DEFAULT_SUBTITLES,V.DEFAULT_DURATION,V.NO_MUTED_PREF,V.NO_VOLUME_PREF,V.LANG,V.LOOP,V.LIVE_EDGE_OFFSET,V.SEEK_TO_LIVE_OFFSET,V.NO_AUTO_SEEK_TO_LIVE)}get mediaStore(){return R(this,B)}set mediaStore(e){var t;R(this,B)&&((t=R(this,Ln))==null||t.call(this),jn(this,Ln,void 0)),jn(this,B,e),!R(this,B)&&!this.hasAttribute(V.NO_DEFAULT_STORE)?Mn(this,Bn,Vn).call(this):jn(this,Ln,R(this,B)?.subscribe(R(this,In)))}get fullscreenElement(){return R(this,Pn)??this}set fullscreenElement(e){var t;this.hasAttribute(V.FULLSCREEN_ELEMENT)&&this.removeAttribute(V.FULLSCREEN_ELEMENT),jn(this,Pn,e),(t=R(this,B))==null||t.dispatch({type:`fullscreenelementchangerequest`,detail:this.fullscreenElement})}get defaultSubtitles(){return D(this,V.DEFAULT_SUBTITLES)}set defaultSubtitles(e){O(this,V.DEFAULT_SUBTITLES,e)}get defaultStreamType(){return k(this,V.DEFAULT_STREAM_TYPE)}set defaultStreamType(e){A(this,V.DEFAULT_STREAM_TYPE,e)}get defaultDuration(){return T(this,V.DEFAULT_DURATION)}set defaultDuration(e){E(this,V.DEFAULT_DURATION,e)}get noHotkeys(){return D(this,V.NO_HOTKEYS)}set noHotkeys(e){O(this,V.NO_HOTKEYS,e)}get keysUsed(){return k(this,V.KEYS_USED)}set keysUsed(e){A(this,V.KEYS_USED,e)}get liveEdgeOffset(){return T(this,V.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){E(this,V.LIVE_EDGE_OFFSET,e)}get noAutoSeekToLive(){return D(this,V.NO_AUTO_SEEK_TO_LIVE)}set noAutoSeekToLive(e){O(this,V.NO_AUTO_SEEK_TO_LIVE,e)}get noVolumePref(){return D(this,V.NO_VOLUME_PREF)}set noVolumePref(e){O(this,V.NO_VOLUME_PREF,e)}get noMutedPref(){return D(this,V.NO_MUTED_PREF)}set noMutedPref(e){O(this,V.NO_MUTED_PREF,e)}get noSubtitlesLangPref(){return D(this,V.NO_SUBTITLES_LANG_PREF)}set noSubtitlesLangPref(e){O(this,V.NO_SUBTITLES_LANG_PREF,e)}get noDefaultStore(){return D(this,V.NO_DEFAULT_STORE)}set noDefaultStore(e){O(this,V.NO_DEFAULT_STORE,e)}get resolvedLang(){return fe()}attributeChangedCallback(e,t,n){var r,i,a,o,s,c,l,d,f,p;if(super.attributeChangedCallback(e,t,n),e===V.NO_HOTKEYS)n!==t&&n===``?(this.hasAttribute(V.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):n!==t&&n===null&&this.enableHotkeys();else if(e===V.HOTKEYS)R(this,Nn).value=n;else if(e===V.DEFAULT_SUBTITLES&&n!==t)(r=R(this,B))==null||r.dispatch({type:`optionschangerequest`,detail:{defaultSubtitles:this.hasAttribute(V.DEFAULT_SUBTITLES)}});else if(e===V.DEFAULT_STREAM_TYPE)(i=R(this,B))==null||i.dispatch({type:`optionschangerequest`,detail:{defaultStreamType:this.getAttribute(V.DEFAULT_STREAM_TYPE)??void 0}});else if(e===V.LIVE_EDGE_OFFSET&&n!==t)(a=R(this,B))==null||a.dispatch({type:`optionschangerequest`,detail:{liveEdgeOffset:this.hasAttribute(V.LIVE_EDGE_OFFSET)?+this.getAttribute(V.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(V.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(V.SEEK_TO_LIVE_OFFSET):this.hasAttribute(V.LIVE_EDGE_OFFSET)?+this.getAttribute(V.LIVE_EDGE_OFFSET):void 0}});else if(e===V.SEEK_TO_LIVE_OFFSET&&n!==t)(o=R(this,B))==null||o.dispatch({type:`optionschangerequest`,detail:{seekToLiveOffset:this.hasAttribute(V.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(V.SEEK_TO_LIVE_OFFSET):this.hasAttribute(V.LIVE_EDGE_OFFSET)?+this.getAttribute(V.LIVE_EDGE_OFFSET):void 0}});else if(e===V.NO_AUTO_SEEK_TO_LIVE)(s=R(this,B))==null||s.dispatch({type:`optionschangerequest`,detail:{noAutoSeekToLive:this.hasAttribute(V.NO_AUTO_SEEK_TO_LIVE)}});else if(e===V.FULLSCREEN_ELEMENT){let e=n?this.getRootNode()?.getElementById(n):void 0;jn(this,Pn,e),(c=R(this,B))==null||c.dispatch({type:`fullscreenelementchangerequest`,detail:this.fullscreenElement})}else e===V.LANG&&n!==t?(ue(n),(l=R(this,B))==null||l.dispatch({type:`optionschangerequest`,detail:{mediaLang:n}})):e===V.LOOP&&n!==t?(d=R(this,B))==null||d.dispatch({type:u.MEDIA_LOOP_REQUEST,detail:n!=null}):e===V.NO_VOLUME_PREF&&n!==t?(f=R(this,B))==null||f.dispatch({type:`optionschangerequest`,detail:{noVolumePref:this.hasAttribute(V.NO_VOLUME_PREF)}}):e===V.NO_MUTED_PREF&&n!==t&&((p=R(this,B))==null||p.dispatch({type:`optionschangerequest`,detail:{noMutedPref:this.hasAttribute(V.NO_MUTED_PREF)}}))}connectedCallback(){var e,t;this.associateElement(this),!R(this,B)&&!this.hasAttribute(V.NO_DEFAULT_STORE)&&Mn(this,Bn,Vn).call(this),(e=R(this,B))==null||e.dispatch({type:`documentelementchangerequest`,detail:C}),(t=R(this,B))==null||t.dispatch({type:`fullscreenelementchangerequest`,detail:this.fullscreenElement}),super.connectedCallback(),R(this,B)&&!R(this,Ln)&&jn(this,Ln,R(this,B)?.subscribe(R(this,In))),R(this,zn)!==void 0&&R(this,B)&&this.media&&setTimeout(()=>{var e;this.media?.textTracks?.length&&((e=R(this,B))==null||e.dispatch({type:u.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:R(this,zn)}))},0),this.hasAttribute(V.NO_HOTKEYS)?this.disableHotkeys():this.enableHotkeys()}disconnectedCallback(){var e,t,n,r,i;if((e=super.disconnectedCallback)==null||e.call(this),this.disableHotkeys(),R(this,B)){let e=R(this,B).getState();jn(this,zn,!!e.mediaSubtitlesShowing?.length),(t=R(this,B))==null||t.dispatch({type:`fullscreenelementchangerequest`,detail:void 0}),(n=R(this,B))==null||n.dispatch({type:`documentelementchangerequest`,detail:void 0}),(r=R(this,B))==null||r.dispatch({type:u.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})}R(this,Ln)&&((i=R(this,Ln))==null||i.call(this),jn(this,Ln,void 0)),this.unassociateElement(this),R(this,Fn)&&(R(this,Fn).remove(),jn(this,Fn,null))}mediaSetCallback(e){var t;super.mediaSetCallback(e),(t=R(this,B))==null||t.dispatch({type:`mediaelementchangerequest`,detail:e}),e.hasAttribute(`tabindex`)||(e.tabIndex=-1)}mediaUnsetCallback(e){var t;super.mediaUnsetCallback(e),(t=R(this,B))==null||t.dispatch({type:`mediaelementchangerequest`,detail:void 0})}propagateMediaState(e,t){ur(this.mediaStateReceivers,e,t)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let n=dr(e,this.registerMediaStateReceiver.bind(this),this.unregisterMediaStateReceiver.bind(this));Object.values(u).forEach(t=>{e.addEventListener(t,R(this,Rn))}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;t.has(e)&&(t.get(e)(),t.delete(e),Object.values(u).forEach(t=>{e.removeEventListener(t,R(this,Rn))}))}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),R(this,B)&&Object.entries(R(this,B).getState()).forEach(([t,n])=>{ur([e],t,n)}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,n=t.indexOf(e);n<0||t.splice(n,1)}enableHotkeys(){this.addEventListener(`keydown`,Mn(this,Un,Wn))}disableHotkeys(){this.removeEventListener(`keydown`,Mn(this,Un,Wn)),this.removeEventListener(`keyup`,R(this,Hn))}get hotkeys(){return R(this,Nn)}set hotkeys(e){A(this,V.HOTKEYS,e)}keyboardShortcutHandler(e){let t=e.target;if((t.getAttribute(V.KEYS_USED)?.split(` `)??t?.keysUsed??[]).map(e=>e===`Space`?` `:e).filter(Boolean).includes(e.key))return;let n,r,i;if(!R(this,Nn).contains(`no${e.key.toLowerCase()}`)&&!(e.key===` `&&R(this,Nn).contains(`nospace`))&&(!e.shiftKey||e.key!==`/`&&e.key!==`?`||!R(this,Nn).contains(`noshift+/`)))switch(e.key){case` `:case`k`:n=R(this,B).getState().mediaPaused?u.MEDIA_PLAY_REQUEST:u.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new S.CustomEvent(n,{composed:!0,bubbles:!0}));break;case`m`:n=this.mediaStore.getState().mediaVolumeLevel===`off`?u.MEDIA_UNMUTE_REQUEST:u.MEDIA_MUTE_REQUEST,this.dispatchEvent(new S.CustomEvent(n,{composed:!0,bubbles:!0}));break;case`f`:n=this.mediaStore.getState().mediaIsFullscreen?u.MEDIA_EXIT_FULLSCREEN_REQUEST:u.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new S.CustomEvent(n,{composed:!0,bubbles:!0}));break;case`c`:this.dispatchEvent(new S.CustomEvent(u.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case`ArrowLeft`:case`j`:{let e=this.hasAttribute(V.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(V.KEYBOARD_BACKWARD_SEEK_OFFSET):Jn;r=Math.max((this.mediaStore.getState().mediaCurrentTime??0)-e,0),i=new S.CustomEvent(u.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r}),this.dispatchEvent(i);break}case`ArrowRight`:case`l`:{let e=this.hasAttribute(V.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(V.KEYBOARD_FORWARD_SEEK_OFFSET):Jn;r=Math.max((this.mediaStore.getState().mediaCurrentTime??0)+e,0),i=new S.CustomEvent(u.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r}),this.dispatchEvent(i);break}case`ArrowUp`:{let e=this.hasAttribute(V.KEYBOARD_UP_VOLUME_STEP)?+this.getAttribute(V.KEYBOARD_UP_VOLUME_STEP):Yn;r=Math.min((this.mediaStore.getState().mediaVolume??1)+e,1),i=new S.CustomEvent(u.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:r}),this.dispatchEvent(i);break}case`ArrowDown`:{let e=this.hasAttribute(V.KEYBOARD_DOWN_VOLUME_STEP)?+this.getAttribute(V.KEYBOARD_DOWN_VOLUME_STEP):Yn;r=Math.max((this.mediaStore.getState().mediaVolume??1)-e,0),i=new S.CustomEvent(u.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:r}),this.dispatchEvent(i);break}case`<`:{let e=this.mediaStore.getState().mediaPlaybackRate??1;r=Math.max(e-Xn,Zn).toFixed(2),i=new S.CustomEvent(u.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r}),this.dispatchEvent(i);break}case`>`:{let e=this.mediaStore.getState().mediaPlaybackRate??1;r=Math.min(e+Xn,Qn).toFixed(2),i=new S.CustomEvent(u.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r}),this.dispatchEvent(i);break}case`/`:case`?`:e.shiftKey&&Mn(this,Gn,Kn).call(this);break;case`p`:n=this.mediaStore.getState().mediaIsPip?u.MEDIA_EXIT_PIP_REQUEST:u.MEDIA_ENTER_PIP_REQUEST,i=new S.CustomEvent(n,{composed:!0,bubbles:!0}),this.dispatchEvent(i)}}};Nn=new WeakMap,Pn=new WeakMap,B=new WeakMap,Fn=new WeakMap,In=new WeakMap,Ln=new WeakMap,Rn=new WeakMap,zn=new WeakMap,Bn=new WeakSet,Vn=function(){this.mediaStore=kn({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(V.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(V.DEFAULT_DURATION)?+this.getAttribute(V.DEFAULT_DURATION):void 0,defaultStreamType:this.getAttribute(V.DEFAULT_STREAM_TYPE)??void 0,liveEdgeOffset:this.hasAttribute(V.LIVE_EDGE_OFFSET)?+this.getAttribute(V.LIVE_EDGE_OFFSET):void 0,seekToLiveOffset:this.hasAttribute(V.SEEK_TO_LIVE_OFFSET)?+this.getAttribute(V.SEEK_TO_LIVE_OFFSET):this.hasAttribute(V.LIVE_EDGE_OFFSET)?+this.getAttribute(V.LIVE_EDGE_OFFSET):void 0,noAutoSeekToLive:this.hasAttribute(V.NO_AUTO_SEEK_TO_LIVE),noVolumePref:this.hasAttribute(V.NO_VOLUME_PREF),noMutedPref:this.hasAttribute(V.NO_MUTED_PREF),noSubtitlesLangPref:this.hasAttribute(V.NO_SUBTITLES_LANG_PREF)}})},Hn=new WeakMap,Un=new WeakSet,Wn=function(e){let{metaKey:t,altKey:n,key:r,shiftKey:i}=e,a=i&&(r===`/`||r===`?`);if(a&&R(this,Fn)?.open||t||n||!a&&!qn.includes(r)){this.removeEventListener(`keyup`,R(this,Hn));return}let o=e.target,s=o instanceof HTMLElement&&(o.tagName.toLowerCase()===`media-volume-range`||o.tagName.toLowerCase()===`media-time-range`);[` `,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`].includes(r)&&!(R(this,Nn).contains(`no${r.toLowerCase()}`)||r===` `&&R(this,Nn).contains(`nospace`))&&!s&&e.preventDefault(),this.addEventListener(`keyup`,R(this,Hn),{once:!0})},Gn=new WeakSet,Kn=function(){R(this,Fn)||(jn(this,Fn,C.createElement(`media-keyboard-shortcuts-dialog`)),this.appendChild(R(this,Fn))),R(this,Fn).open=!0};var er=Object.values(m),tr=Object.values(f),nr=e=>{var t;let{observedAttributes:n}=e.constructor;!n&&e.nodeName?.includes(`-`)&&(S.customElements.upgrade(e),{observedAttributes:n}=e.constructor);let r=((t=(e?.getAttribute)?.call(e,d.MEDIA_CHROME_ATTRIBUTES))?.split)?.call(t,/\s+/);return Array.isArray(n||r)?(n||r).filter(e=>er.includes(e)):[]},rr=e=>(e.nodeName?.includes(`-`)&&S.customElements.get(e.nodeName?.toLowerCase())&&!(e instanceof S.customElements.get(e.nodeName.toLowerCase()))&&S.customElements.upgrade(e),tr.some(t=>t in e)),ir=e=>rr(e)||!!nr(e).length,ar=e=>(e?.join)?.call(e,`:`),or={[m.MEDIA_SUBTITLES_LIST]:Ut,[m.MEDIA_SUBTITLES_SHOWING]:Ut,[m.MEDIA_SEEKABLE]:ar,[m.MEDIA_BUFFERED]:e=>e?.map(ar).join(` `),[m.MEDIA_PREVIEW_COORDS]:e=>e?.join(` `),[m.MEDIA_RENDITION_LIST]:ne,[m.MEDIA_AUDIO_TRACK_LIST]:ie},sr=async(e,t,n)=>{if(e.isConnected||await se(0),typeof n==`boolean`||n==null)return O(e,t,n);if(typeof n==`number`)return E(e,t,n);if(typeof n==`string`)return A(e,t,n);if(Array.isArray(n)&&!n.length)return e.removeAttribute(t);let r=or[t]?.call(or,n)??n;return e.setAttribute(t,r)},cr=e=>!!e.closest?.call(e,`*[slot="media"]`),lr=(e,t)=>{if(cr(e))return;let n=(e,t)=>{ir(e)&&t(e);let{children:n=[]}=e??{},r=e?.shadowRoot?.children??[];[...n,...r].forEach(e=>lr(e,t))},r=e?.nodeName.toLowerCase();r.includes(`-`)&&!ir(e)?S.customElements.whenDefined(r).then(()=>{n(e,t)}):n(e,t)},ur=(e,t,n)=>{e.forEach(e=>{if(t in e){e[t]=n;return}let r=nr(e),i=t.toLowerCase();r.includes(i)&&sr(e,i,n)})},dr=(e,t,n)=>{lr(e,t);let r=e=>{t(e?.composedPath()[0]??e.target)},i=e=>{n(e?.composedPath()[0]??e.target)};e.addEventListener(u.REGISTER_MEDIA_STATE_RECEIVER,r),e.addEventListener(u.UNREGISTER_MEDIA_STATE_RECEIVER,i);let a=e=>{e.forEach(e=>{let{addedNodes:r=[],removedNodes:i=[],type:a,target:o,attributeName:s}=e;a===`childList`?(Array.prototype.forEach.call(r,e=>lr(e,t)),Array.prototype.forEach.call(i,e=>lr(e,n))):a===`attributes`&&s===d.MEDIA_CHROME_ATTRIBUTES&&(ir(o)?t(o):n(o))})},o=[],s=e=>{let r=e.target;r.name!==`media`&&(o.forEach(e=>lr(e,n)),o=[...r.assignedElements({flatten:!0})],o.forEach(e=>lr(e,t)))};e.addEventListener(`slotchange`,s);let c=new MutationObserver(a);return c.observe(e,{childList:!0,attributes:!0,subtree:!0}),()=>{lr(e,n),e.removeEventListener(`slotchange`,s),c.disconnect(),e.removeEventListener(u.REGISTER_MEDIA_STATE_RECEIVER,r),e.removeEventListener(u.UNREGISTER_MEDIA_STATE_RECEIVER,i)}};S.customElements.get(`media-controller`)||S.customElements.define(`media-controller`,$n);var fr=$n,pr={PLACEMENT:`placement`,BOUNDS:`bounds`};function mr(e){return`
|
|
160
|
+
<style>
|
|
161
|
+
:host {
|
|
162
|
+
--_tooltip-background-color: var(--media-tooltip-background-color, var(--media-secondary-color, rgba(20, 20, 30, .7)));
|
|
163
|
+
--_tooltip-background: var(--media-tooltip-background, var(--_tooltip-background-color));
|
|
164
|
+
--_tooltip-arrow-half-width: calc(var(--media-tooltip-arrow-width, 12px) / 2);
|
|
165
|
+
--_tooltip-arrow-height: var(--media-tooltip-arrow-height, 5px);
|
|
166
|
+
--_tooltip-arrow-background: var(--media-tooltip-arrow-color, var(--_tooltip-background-color));
|
|
167
|
+
position: relative;
|
|
168
|
+
pointer-events: none;
|
|
169
|
+
display: var(--media-tooltip-display, inline-flex);
|
|
170
|
+
justify-content: center;
|
|
171
|
+
align-items: center;
|
|
172
|
+
box-sizing: border-box;
|
|
173
|
+
z-index: var(--media-tooltip-z-index, 1);
|
|
174
|
+
background: var(--_tooltip-background);
|
|
175
|
+
color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
|
|
176
|
+
font: var(--media-font,
|
|
177
|
+
var(--media-font-weight, 400)
|
|
178
|
+
var(--media-font-size, 13px) /
|
|
179
|
+
var(--media-text-content-height, var(--media-control-height, 18px))
|
|
180
|
+
var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
|
|
181
|
+
padding: var(--media-tooltip-padding, .35em .7em);
|
|
182
|
+
border: var(--media-tooltip-border, none);
|
|
183
|
+
border-radius: var(--media-tooltip-border-radius, 5px);
|
|
184
|
+
filter: var(--media-tooltip-filter, drop-shadow(0 0 4px rgba(0, 0, 0, .2)));
|
|
185
|
+
white-space: var(--media-tooltip-white-space, nowrap);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
:host([hidden]) {
|
|
189
|
+
display: none;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
img, svg {
|
|
193
|
+
display: inline-block;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
#arrow {
|
|
197
|
+
position: absolute;
|
|
198
|
+
width: 0px;
|
|
199
|
+
height: 0px;
|
|
200
|
+
border-style: solid;
|
|
201
|
+
display: var(--media-tooltip-arrow-display, block);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
:host(:not([placement])),
|
|
205
|
+
:host([placement="top"]) {
|
|
206
|
+
position: absolute;
|
|
207
|
+
bottom: calc(100% + var(--media-tooltip-distance, 12px));
|
|
208
|
+
left: 50%;
|
|
209
|
+
transform: translate(calc(-50% - var(--media-tooltip-offset-x, 0px)), 0);
|
|
210
|
+
}
|
|
211
|
+
:host(:not([placement])) #arrow,
|
|
212
|
+
:host([placement="top"]) #arrow {
|
|
213
|
+
top: 100%;
|
|
214
|
+
left: 50%;
|
|
215
|
+
border-width: var(--_tooltip-arrow-height) var(--_tooltip-arrow-half-width) 0 var(--_tooltip-arrow-half-width);
|
|
216
|
+
border-color: var(--_tooltip-arrow-background) transparent transparent transparent;
|
|
217
|
+
transform: translate(calc(-50% + var(--media-tooltip-offset-x, 0px)), 0);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
:host([placement="right"]) {
|
|
221
|
+
position: absolute;
|
|
222
|
+
left: calc(100% + var(--media-tooltip-distance, 12px));
|
|
223
|
+
top: 50%;
|
|
224
|
+
transform: translate(0, -50%);
|
|
225
|
+
}
|
|
226
|
+
:host([placement="right"]) #arrow {
|
|
227
|
+
top: 50%;
|
|
228
|
+
right: 100%;
|
|
229
|
+
border-width: var(--_tooltip-arrow-half-width) var(--_tooltip-arrow-height) var(--_tooltip-arrow-half-width) 0;
|
|
230
|
+
border-color: transparent var(--_tooltip-arrow-background) transparent transparent;
|
|
231
|
+
transform: translate(0, -50%);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
:host([placement="bottom"]) {
|
|
235
|
+
position: absolute;
|
|
236
|
+
top: calc(100% + var(--media-tooltip-distance, 12px));
|
|
237
|
+
left: 50%;
|
|
238
|
+
transform: translate(calc(-50% - var(--media-tooltip-offset-x, 0px)), 0);
|
|
239
|
+
}
|
|
240
|
+
:host([placement="bottom"]) #arrow {
|
|
241
|
+
bottom: 100%;
|
|
242
|
+
left: 50%;
|
|
243
|
+
border-width: 0 var(--_tooltip-arrow-half-width) var(--_tooltip-arrow-height) var(--_tooltip-arrow-half-width);
|
|
244
|
+
border-color: transparent transparent var(--_tooltip-arrow-background) transparent;
|
|
245
|
+
transform: translate(calc(-50% + var(--media-tooltip-offset-x, 0px)), 0);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
:host([placement="left"]) {
|
|
249
|
+
position: absolute;
|
|
250
|
+
right: calc(100% + var(--media-tooltip-distance, 12px));
|
|
251
|
+
top: 50%;
|
|
252
|
+
transform: translate(0, -50%);
|
|
253
|
+
}
|
|
254
|
+
:host([placement="left"]) #arrow {
|
|
255
|
+
top: 50%;
|
|
256
|
+
left: 100%;
|
|
257
|
+
border-width: var(--_tooltip-arrow-half-width) 0 var(--_tooltip-arrow-half-width) var(--_tooltip-arrow-height);
|
|
258
|
+
border-color: transparent transparent transparent var(--_tooltip-arrow-background);
|
|
259
|
+
transform: translate(0, -50%);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
:host([placement="none"]) #arrow {
|
|
263
|
+
display: none;
|
|
264
|
+
}
|
|
265
|
+
</style>
|
|
266
|
+
<slot></slot>
|
|
267
|
+
<div id="arrow"></div>
|
|
268
|
+
`}var hr=class extends S.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{if(!Be(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;let e=this.placement;if(e===`left`||e===`right`){this.style.removeProperty(`--media-tooltip-offset-x`);return}let t=getComputedStyle(this),n=Le(this,`#`+this.bounds)??je(this);if(!n)return;let{x:r,width:i}=n.getBoundingClientRect(),{x:a,width:o}=this.getBoundingClientRect(),s=a+o,c=r+i,l=t.getPropertyValue(`--media-tooltip-offset-x`),u=l?parseFloat(l.replace(`px`,``)):0,d=t.getPropertyValue(`--media-tooltip-container-margin`),f=d?parseFloat(d.replace(`px`,``)):0,p=a-r+u-f,m=s-c+u+f;p<0?this.style.setProperty(`--media-tooltip-offset-x`,`${p}px`):m>0?this.style.setProperty(`--media-tooltip-offset-x`,`${m}px`):this.style.removeProperty(`--media-tooltip-offset-x`)},!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}if(this.arrowEl=this.shadowRoot.querySelector(`#arrow`),Object.prototype.hasOwnProperty.call(this,`placement`)){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[pr.PLACEMENT,pr.BOUNDS]}get placement(){return k(this,pr.PLACEMENT)}set placement(e){A(this,pr.PLACEMENT,e)}get bounds(){return k(this,pr.BOUNDS)}set bounds(e){A(this,pr.BOUNDS,e)}};hr.shadowRootOptions={mode:`open`},hr.getTemplateHTML=mr,S.customElements.get(`media-tooltip`)||S.customElements.define(`media-tooltip`,hr);var gr=hr,_r=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},H=(e,t,n)=>(_r(e,t,`read from private field`),n?n.call(e):t.get(e)),vr=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},yr=(e,t,n,r)=>(_r(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),br=(e,t,n)=>(_r(e,t,`access private method`),n),xr,Sr,Cr,wr,Tr,Er,Dr,Or={TOOLTIP_PLACEMENT:`tooltipplacement`,DISABLED:`disabled`,NO_TOOLTIP:`notooltip`};function kr(e,t={}){return`
|
|
269
|
+
<style>
|
|
270
|
+
:host {
|
|
271
|
+
position: relative;
|
|
272
|
+
font: var(--media-font,
|
|
273
|
+
var(--media-font-weight, bold)
|
|
274
|
+
var(--media-font-size, 14px) /
|
|
275
|
+
var(--media-text-content-height, var(--media-control-height, 24px))
|
|
276
|
+
var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
|
|
277
|
+
color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
|
|
278
|
+
background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));
|
|
279
|
+
padding: var(--media-button-padding, var(--media-control-padding, 10px));
|
|
280
|
+
justify-content: var(--media-button-justify-content, center);
|
|
281
|
+
display: inline-flex;
|
|
282
|
+
align-items: center;
|
|
283
|
+
vertical-align: middle;
|
|
284
|
+
box-sizing: border-box;
|
|
285
|
+
transition: background .15s linear;
|
|
286
|
+
pointer-events: auto;
|
|
287
|
+
cursor: var(--media-cursor, pointer);
|
|
288
|
+
-webkit-tap-highlight-color: transparent;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
:host(:focus-visible) {
|
|
293
|
+
box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
|
|
294
|
+
outline: 0;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
:host(:where(:focus)) {
|
|
298
|
+
box-shadow: none;
|
|
299
|
+
outline: 0;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
:host(:hover) {
|
|
303
|
+
background: var(--media-control-hover-background, rgba(50 50 70 / .7));
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
slot[name="icon"] {
|
|
307
|
+
display: inline-flex;
|
|
308
|
+
align-items: center;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
svg, img, ::slotted(svg), ::slotted(img) {
|
|
312
|
+
width: var(--media-button-icon-width);
|
|
313
|
+
height: var(--media-button-icon-height, var(--media-control-height, 24px));
|
|
314
|
+
transform: var(--media-button-icon-transform);
|
|
315
|
+
transition: var(--media-button-icon-transition);
|
|
316
|
+
fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));
|
|
317
|
+
vertical-align: middle;
|
|
318
|
+
max-width: 100%;
|
|
319
|
+
max-height: 100%;
|
|
320
|
+
min-width: 100%;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
media-tooltip {
|
|
324
|
+
|
|
325
|
+
max-width: 0;
|
|
326
|
+
overflow-x: clip;
|
|
327
|
+
opacity: 0;
|
|
328
|
+
transition: opacity .3s, max-width 0s 9s;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
:host(:hover) media-tooltip,
|
|
332
|
+
:host(:focus-visible) media-tooltip {
|
|
333
|
+
max-width: 100vw;
|
|
334
|
+
opacity: 1;
|
|
335
|
+
transition: opacity .3s;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
:host([notooltip]) slot[name="tooltip"] {
|
|
339
|
+
display: none;
|
|
340
|
+
}
|
|
341
|
+
</style>
|
|
342
|
+
|
|
343
|
+
${this.getSlotTemplateHTML(e,t)}
|
|
344
|
+
|
|
345
|
+
<slot name="tooltip">
|
|
346
|
+
<media-tooltip part="tooltip" aria-hidden="true">
|
|
347
|
+
<template shadowrootmode="${gr.shadowRootOptions.mode}">
|
|
348
|
+
${gr.getTemplateHTML({})}
|
|
349
|
+
</template>
|
|
350
|
+
<slot name="tooltip-content">
|
|
351
|
+
${this.getTooltipContentHTML(e)}
|
|
352
|
+
</slot>
|
|
353
|
+
</media-tooltip>
|
|
354
|
+
</slot>
|
|
355
|
+
`}function Ar(e,t){return`
|
|
356
|
+
<slot></slot>
|
|
357
|
+
`}function jr(){return``}var U=class extends S.HTMLElement{constructor(){if(super(),vr(this,Er),vr(this,xr,void 0),this.preventClick=!1,this.tooltipEl=null,vr(this,Sr,e=>{this.preventClick||this.handleClick(e),setTimeout(H(this,Cr),0)}),vr(this,Cr,()=>{var e,t;(t=(e=this.tooltipEl)?.updateXOffset)==null||t.call(e)}),vr(this,wr,e=>{let{key:t}=e;this.keysUsed.includes(t)?this.preventClick||this.handleClick(e):this.removeEventListener(`keyup`,H(this,wr))}),vr(this,Tr,e=>{let{metaKey:t,altKey:n,key:r}=e;t||n||!this.keysUsed.includes(r)?this.removeEventListener(`keyup`,H(this,wr)):this.addEventListener(`keyup`,H(this,wr),{once:!0})}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Ae(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}this.tooltipEl=this.shadowRoot.querySelector(`media-tooltip`)}static get observedAttributes(){return[`disabled`,Or.TOOLTIP_PLACEMENT,d.MEDIA_CONTROLLER,m.MEDIA_LANG]}enable(){this.addEventListener(`click`,H(this,Sr)),this.addEventListener(`keydown`,H(this,Tr)),this.tabIndex=0}disable(){this.removeEventListener(`click`,H(this,Sr)),this.removeEventListener(`keydown`,H(this,Tr)),this.removeEventListener(`keyup`,H(this,wr)),this.tabIndex=-1}attributeChangedCallback(e,t,n){var r,i,a,o;e===d.MEDIA_CONTROLLER?(t&&((i=(r=H(this,xr))?.unassociateElement)==null||i.call(r,this),yr(this,xr,null)),n&&this.isConnected&&(yr(this,xr,this.getRootNode()?.getElementById(n)),(o=(a=H(this,xr))?.associateElement)==null||o.call(a,this))):e===`disabled`&&n!==t?n==null?this.enable():this.disable():e===Or.TOOLTIP_PLACEMENT&&this.tooltipEl&&n!==t?this.tooltipEl.placement=n:e===m.MEDIA_LANG&&(this.shadowRoot.querySelector(`slot[name="tooltip-content"]`).innerHTML=this.constructor.getTooltipContentHTML()),H(this,Cr).call(this)}connectedCallback(){var e,t;let{style:n}=w(this.shadowRoot,`:host`);n.setProperty(`display`,`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute(`disabled`)?this.disable():this.enable(),this.setAttribute(`role`,`button`);let r=this.getAttribute(d.MEDIA_CONTROLLER);r&&(yr(this,xr,this.getRootNode()?.getElementById(r)),(t=(e=H(this,xr))?.associateElement)==null||t.call(e,this)),S.customElements.whenDefined(`media-tooltip`).then(()=>br(this,Er,Dr).call(this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=H(this,xr))?.unassociateElement)==null||t.call(e,this),yr(this,xr,null),this.removeEventListener(`mouseenter`,H(this,Cr)),this.removeEventListener(`focus`,H(this,Cr)),this.removeEventListener(`click`,H(this,Sr))}get keysUsed(){return[`Enter`,` `]}get tooltipPlacement(){return k(this,Or.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){A(this,Or.TOOLTIP_PLACEMENT,e)}get mediaController(){return k(this,d.MEDIA_CONTROLLER)}set mediaController(e){A(this,d.MEDIA_CONTROLLER,e)}get disabled(){return D(this,Or.DISABLED)}set disabled(e){O(this,Or.DISABLED,e)}get noTooltip(){return D(this,Or.NO_TOOLTIP)}set noTooltip(e){O(this,Or.NO_TOOLTIP,e)}handleClick(e){}};xr=new WeakMap,Sr=new WeakMap,Cr=new WeakMap,wr=new WeakMap,Tr=new WeakMap,Er=new WeakSet,Dr=function(){this.addEventListener(`mouseenter`,H(this,Cr)),this.addEventListener(`focus`,H(this,Cr)),this.addEventListener(`click`,H(this,Sr));let e=this.tooltipPlacement;e&&this.tooltipEl&&(this.tooltipEl.placement=e)},U.shadowRootOptions={mode:`open`},U.getTemplateHTML=kr,U.getSlotTemplateHTML=Ar,U.getTooltipContentHTML=jr,S.customElements.get(`media-chrome-button`)||S.customElements.define(`media-chrome-button`,U);var Mr=U,Nr=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
358
|
+
<path d="M22.13 3H3.87a.87.87 0 0 0-.87.87v13.26a.87.87 0 0 0 .87.87h3.4L9 16H5V5h16v11h-4l1.72 2h3.4a.87.87 0 0 0 .87-.87V3.87a.87.87 0 0 0-.86-.87Zm-8.75 11.44a.5.5 0 0 0-.76 0l-4.91 5.73a.5.5 0 0 0 .38.83h9.82a.501.501 0 0 0 .38-.83l-4.91-5.73Z"/>
|
|
359
|
+
</svg>
|
|
360
|
+
`;function Pr(e){return`
|
|
361
|
+
<style>
|
|
362
|
+
:host([${m.MEDIA_IS_AIRPLAYING}]) slot[name=icon] slot:not([name=exit]) {
|
|
363
|
+
display: none !important;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
:host(:not([${m.MEDIA_IS_AIRPLAYING}])) slot[name=icon] slot:not([name=enter]) {
|
|
368
|
+
display: none !important;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
:host([${m.MEDIA_IS_AIRPLAYING}]) slot[name=tooltip-enter],
|
|
372
|
+
:host(:not([${m.MEDIA_IS_AIRPLAYING}])) slot[name=tooltip-exit] {
|
|
373
|
+
display: none;
|
|
374
|
+
}
|
|
375
|
+
</style>
|
|
376
|
+
|
|
377
|
+
<slot name="icon">
|
|
378
|
+
<slot name="enter">${Nr}</slot>
|
|
379
|
+
<slot name="exit">${Nr}</slot>
|
|
380
|
+
</slot>
|
|
381
|
+
`}function Fr(){return`
|
|
382
|
+
<slot name="tooltip-enter">${x(`start airplay`)}</slot>
|
|
383
|
+
<slot name="tooltip-exit">${x(`stop airplay`)}</slot>
|
|
384
|
+
`}var Ir=e=>{let t=e.mediaIsAirplaying?x(`stop airplay`):x(`start airplay`);e.setAttribute(`aria-label`,t)},Lr=class extends U{static get observedAttributes(){return[...super.observedAttributes,m.MEDIA_IS_AIRPLAYING,m.MEDIA_AIRPLAY_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Ir(this)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===m.MEDIA_IS_AIRPLAYING&&Ir(this)}get mediaIsAirplaying(){return D(this,m.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){O(this,m.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return k(this,m.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){A(this,m.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new S.CustomEvent(u.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};Lr.getSlotTemplateHTML=Pr,Lr.getTooltipContentHTML=Fr,S.customElements.get(`media-airplay-button`)||S.customElements.define(`media-airplay-button`,Lr);var Rr=Lr,zr=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
385
|
+
<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"/>
|
|
386
|
+
</svg>`,Br=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
387
|
+
<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"/>
|
|
388
|
+
</svg>`;function Vr(e){return`
|
|
389
|
+
<style>
|
|
390
|
+
:host([aria-checked="true"]) slot[name=off] {
|
|
391
|
+
display: none !important;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
:host(:not([aria-checked="true"])) slot[name=on] {
|
|
396
|
+
display: none !important;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
:host([aria-checked="true"]) slot[name=tooltip-enable],
|
|
400
|
+
:host(:not([aria-checked="true"])) slot[name=tooltip-disable] {
|
|
401
|
+
display: none;
|
|
402
|
+
}
|
|
403
|
+
</style>
|
|
404
|
+
|
|
405
|
+
<slot name="icon">
|
|
406
|
+
<slot name="on">${zr}</slot>
|
|
407
|
+
<slot name="off">${Br}</slot>
|
|
408
|
+
</slot>
|
|
409
|
+
`}function Hr(){return`
|
|
410
|
+
<slot name="tooltip-enable">${x(`Enable captions`)}</slot>
|
|
411
|
+
<slot name="tooltip-disable">${x(`Disable captions`)}</slot>
|
|
412
|
+
`}var Ur=e=>{e.setAttribute(`aria-checked`,Jt(e).toString())},Wr=class extends U{static get observedAttributes(){return[...super.observedAttributes,m.MEDIA_SUBTITLES_LIST,m.MEDIA_SUBTITLES_SHOWING]}connectedCallback(){super.connectedCallback(),this.setAttribute(`role`,`button`),this.setAttribute(`aria-label`,x(`closed captions`)),Ur(this)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===m.MEDIA_SUBTITLES_SHOWING&&Ur(this)}get mediaSubtitlesList(){return Gr(this,m.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Kr(this,m.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Gr(this,m.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Kr(this,m.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new S.CustomEvent(u.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}};Wr.getSlotTemplateHTML=Vr,Wr.getTooltipContentHTML=Hr;var Gr=(e,t)=>{let n=e.getAttribute(t);return n?Bt(n):[]},Kr=(e,t,n)=>{if(!n?.length){e.removeAttribute(t);return}let r=Ut(n);e.getAttribute(t)!==r&&e.setAttribute(t,r)};S.customElements.get(`media-captions-button`)||S.customElements.define(`media-captions-button`,Wr);var qr=Wr,Jr=`<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg>`,Yr=`<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg>`;function Xr(e){return`
|
|
413
|
+
<style>
|
|
414
|
+
:host([${m.MEDIA_IS_CASTING}]) slot[name=icon] slot:not([name=exit]) {
|
|
415
|
+
display: none !important;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
:host(:not([${m.MEDIA_IS_CASTING}])) slot[name=icon] slot:not([name=enter]) {
|
|
420
|
+
display: none !important;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
:host([${m.MEDIA_IS_CASTING}]) slot[name=tooltip-enter],
|
|
424
|
+
:host(:not([${m.MEDIA_IS_CASTING}])) slot[name=tooltip-exit] {
|
|
425
|
+
display: none;
|
|
426
|
+
}
|
|
427
|
+
</style>
|
|
428
|
+
|
|
429
|
+
<slot name="icon">
|
|
430
|
+
<slot name="enter">${Jr}</slot>
|
|
431
|
+
<slot name="exit">${Yr}</slot>
|
|
432
|
+
</slot>
|
|
433
|
+
`}function Zr(){return`
|
|
434
|
+
<slot name="tooltip-enter">${x(`Start casting`)}</slot>
|
|
435
|
+
<slot name="tooltip-exit">${x(`Stop casting`)}</slot>
|
|
436
|
+
`}var Qr=e=>{let t=e.mediaIsCasting?x(`stop casting`):x(`start casting`);e.setAttribute(`aria-label`,t)},$r=class extends U{static get observedAttributes(){return[...super.observedAttributes,m.MEDIA_IS_CASTING,m.MEDIA_CAST_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Qr(this)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===m.MEDIA_IS_CASTING&&Qr(this)}get mediaIsCasting(){return D(this,m.MEDIA_IS_CASTING)}set mediaIsCasting(e){O(this,m.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return k(this,m.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){A(this,m.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?u.MEDIA_EXIT_CAST_REQUEST:u.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new S.CustomEvent(e,{composed:!0,bubbles:!0}))}};$r.getSlotTemplateHTML=Xr,$r.getTooltipContentHTML=Zr,S.customElements.get(`media-cast-button`)||S.customElements.define(`media-cast-button`,$r);var ei=$r,ti=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},ni=(e,t,n)=>(ti(e,t,`read from private field`),n?n.call(e):t.get(e)),ri=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},ii=(e,t,n,r)=>(ti(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),ai=(e,t,n)=>(ti(e,t,`access private method`),n),oi,si,ci,li,ui,di,fi,pi,mi,hi,gi,_i,vi,yi,bi;function xi(e){return`
|
|
437
|
+
<style>
|
|
438
|
+
:host {
|
|
439
|
+
font: var(--media-font,
|
|
440
|
+
var(--media-font-weight, normal)
|
|
441
|
+
var(--media-font-size, 14px) /
|
|
442
|
+
var(--media-text-content-height, var(--media-control-height, 24px))
|
|
443
|
+
var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
|
|
444
|
+
color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
|
|
445
|
+
display: var(--media-dialog-display, inline-flex);
|
|
446
|
+
justify-content: center;
|
|
447
|
+
align-items: center;
|
|
448
|
+
|
|
449
|
+
transition-behavior: allow-discrete;
|
|
450
|
+
visibility: hidden;
|
|
451
|
+
opacity: 0;
|
|
452
|
+
transform: translateY(2px) scale(.99);
|
|
453
|
+
pointer-events: none;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
:host([open]) {
|
|
457
|
+
transition: display .2s, visibility 0s, opacity .2s ease-out, transform .15s ease-out;
|
|
458
|
+
visibility: visible;
|
|
459
|
+
opacity: 1;
|
|
460
|
+
transform: translateY(0) scale(1);
|
|
461
|
+
pointer-events: auto;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
#content {
|
|
465
|
+
display: flex;
|
|
466
|
+
position: relative;
|
|
467
|
+
box-sizing: border-box;
|
|
468
|
+
width: min(320px, 100%);
|
|
469
|
+
word-wrap: break-word;
|
|
470
|
+
max-height: 100%;
|
|
471
|
+
overflow: auto;
|
|
472
|
+
text-align: center;
|
|
473
|
+
line-height: 1.4;
|
|
474
|
+
}
|
|
475
|
+
</style>
|
|
476
|
+
${this.getSlotTemplateHTML(e)}
|
|
477
|
+
`}function Si(e){return`
|
|
478
|
+
<slot id="content"></slot>
|
|
479
|
+
`}var Ci={OPEN:`open`,ANCHOR:`anchor`},wi=class extends S.HTMLElement{constructor(){super(),ri(this,li),ri(this,di),ri(this,pi),ri(this,hi),ri(this,_i),ri(this,yi),ri(this,oi,!1),ri(this,si,null),ri(this,ci,null)}static get observedAttributes(){return[Ci.OPEN,Ci.ANCHOR]}get open(){return D(this,Ci.OPEN)}set open(e){O(this,Ci.OPEN,e)}handleEvent(e){switch(e.type){case`invoke`:ai(this,hi,gi).call(this,e);break;case`focusout`:ai(this,_i,vi).call(this,e);break;case`keydown`:ai(this,yi,bi).call(this,e)}}connectedCallback(){ai(this,li,ui).call(this),this.role||=`dialog`,this.addEventListener(`invoke`,this),this.addEventListener(`focusout`,this),this.addEventListener(`keydown`,this)}disconnectedCallback(){this.removeEventListener(`invoke`,this),this.removeEventListener(`focusout`,this),this.removeEventListener(`keydown`,this)}attributeChangedCallback(e,t,n){ai(this,li,ui).call(this),e===Ci.OPEN&&n!==t&&(this.open?ai(this,di,fi).call(this):ai(this,pi,mi).call(this))}focus(){ii(this,si,Re());let e=!this.dispatchEvent(new Event(`focus`,{composed:!0,cancelable:!0})),t=!this.dispatchEvent(new Event(`focusin`,{composed:!0,bubbles:!0,cancelable:!0}));e||t||this.querySelector(`[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]`)?.focus()}get keysUsed(){return[`Escape`,`Tab`]}};oi=new WeakMap,si=new WeakMap,ci=new WeakMap,li=new WeakSet,ui=function(){if(!ni(this,oi)&&(ii(this,oi,!0),!this.shadowRoot)){this.attachShadow(this.constructor.shadowRootOptions);let e=Ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e),queueMicrotask(()=>{let{style:e}=w(this.shadowRoot,`:host`);e.setProperty(`transition`,`display .15s, visibility .15s, opacity .15s ease-in, transform .15s ease-in`)})}},di=new WeakSet,fi=function(){var e;(e=ni(this,ci))==null||e.setAttribute(`aria-expanded`,`true`),this.dispatchEvent(new Event(`open`,{composed:!0,bubbles:!0})),this.addEventListener(`transitionend`,()=>this.focus(),{once:!0})},pi=new WeakSet,mi=function(){var e;(e=ni(this,ci))==null||e.setAttribute(`aria-expanded`,`false`),this.dispatchEvent(new Event(`close`,{composed:!0,bubbles:!0}))},hi=new WeakSet,gi=function(e){ii(this,ci,e.relatedTarget),Ie(this,e.relatedTarget)||(this.open=!this.open)},_i=new WeakSet,vi=function(e){var t;Ie(this,e.relatedTarget)||((t=ni(this,si))==null||t.focus(),ni(this,ci)&&ni(this,ci)!==e.relatedTarget&&this.open&&(this.open=!1))},yi=new WeakSet,bi=function(e){var t,n,r,i,a;let{key:o,ctrlKey:s,altKey:c,metaKey:l}=e;s||c||l||this.keysUsed.includes(o)&&(e.preventDefault(),e.stopPropagation(),o===`Tab`?(e.shiftKey?(n=(t=this.previousElementSibling)?.focus)==null||n.call(t):(i=(r=this.nextElementSibling)?.focus)==null||i.call(r),this.blur()):o===`Escape`&&((a=ni(this,si))==null||a.focus(),this.open=!1))},wi.shadowRootOptions={mode:`open`},wi.getTemplateHTML=xi,wi.getSlotTemplateHTML=Si,S.customElements.get(`media-chrome-dialog`)||S.customElements.define(`media-chrome-dialog`,wi);var Ti=wi,Ei=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},W=(e,t,n)=>(Ei(e,t,`read from private field`),n?n.call(e):t.get(e)),G=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},Di=(e,t,n,r)=>(Ei(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),Oi=(e,t,n)=>(Ei(e,t,`access private method`),n),ki,Ai,ji,Mi,Ni,Pi,Fi,Ii,Li,Ri,zi,Bi,Vi,Hi,Ui,Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi,Qi,$i;function ea(e){return`
|
|
480
|
+
<style>
|
|
481
|
+
:host {
|
|
482
|
+
--_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
|
|
483
|
+
--_media-range-padding: var(--media-range-padding, var(--media-control-padding, 10px));
|
|
484
|
+
|
|
485
|
+
box-shadow: var(--_focus-visible-box-shadow, none);
|
|
486
|
+
background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));
|
|
487
|
+
height: calc(var(--media-control-height, 24px) + 2 * var(--_media-range-padding));
|
|
488
|
+
display: inline-flex;
|
|
489
|
+
align-items: center;
|
|
490
|
+
|
|
491
|
+
vertical-align: middle;
|
|
492
|
+
box-sizing: border-box;
|
|
493
|
+
position: relative;
|
|
494
|
+
width: 100px;
|
|
495
|
+
transition: background .15s linear;
|
|
496
|
+
cursor: var(--media-cursor, pointer);
|
|
497
|
+
pointer-events: auto;
|
|
498
|
+
touch-action: none;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
input[type=range]:focus {
|
|
503
|
+
outline: 0;
|
|
504
|
+
}
|
|
505
|
+
input[type=range]:focus::-webkit-slider-runnable-track {
|
|
506
|
+
outline: 0;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
:host(:hover) {
|
|
510
|
+
background: var(--media-control-hover-background, rgb(50 50 70 / .7));
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
#leftgap {
|
|
514
|
+
padding-left: var(--media-range-padding-left, var(--_media-range-padding));
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
#rightgap {
|
|
518
|
+
padding-right: var(--media-range-padding-right, var(--_media-range-padding));
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
#startpoint,
|
|
522
|
+
#endpoint {
|
|
523
|
+
position: absolute;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
#endpoint {
|
|
527
|
+
right: 0;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
#container {
|
|
531
|
+
|
|
532
|
+
width: var(--media-range-track-width, 100%);
|
|
533
|
+
transform: translate(var(--media-range-track-translate-x, 0px), var(--media-range-track-translate-y, 0px));
|
|
534
|
+
position: relative;
|
|
535
|
+
height: 100%;
|
|
536
|
+
display: flex;
|
|
537
|
+
align-items: center;
|
|
538
|
+
min-width: 40px;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
#range {
|
|
542
|
+
|
|
543
|
+
display: var(--media-time-range-hover-display, block);
|
|
544
|
+
bottom: var(--media-time-range-hover-bottom, 0);
|
|
545
|
+
height: var(--media-time-range-hover-height, max(100% , 25px));
|
|
546
|
+
width: 100%;
|
|
547
|
+
position: absolute;
|
|
548
|
+
cursor: var(--media-cursor, pointer);
|
|
549
|
+
|
|
550
|
+
-webkit-appearance: none;
|
|
551
|
+
-webkit-tap-highlight-color: transparent;
|
|
552
|
+
background: transparent;
|
|
553
|
+
margin: 0;
|
|
554
|
+
z-index: 1;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
@media (hover: hover) {
|
|
558
|
+
#range {
|
|
559
|
+
bottom: var(--media-time-range-hover-bottom, 0);
|
|
560
|
+
height: var(--media-time-range-hover-height, max(100%, 20px));
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
#range::-webkit-slider-thumb {
|
|
567
|
+
-webkit-appearance: none;
|
|
568
|
+
background: transparent;
|
|
569
|
+
width: .1px;
|
|
570
|
+
height: .1px;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
#range::-moz-range-thumb {
|
|
575
|
+
background: transparent;
|
|
576
|
+
border: transparent;
|
|
577
|
+
width: .1px;
|
|
578
|
+
height: .1px;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
#appearance {
|
|
582
|
+
height: var(--media-range-track-height, 4px);
|
|
583
|
+
display: flex;
|
|
584
|
+
flex-direction: column;
|
|
585
|
+
justify-content: center;
|
|
586
|
+
width: 100%;
|
|
587
|
+
position: absolute;
|
|
588
|
+
|
|
589
|
+
will-change: transform;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
#track {
|
|
593
|
+
background: var(--media-range-track-background, rgb(255 255 255 / .2));
|
|
594
|
+
border-radius: var(--media-range-track-border-radius, 1px);
|
|
595
|
+
border: var(--media-range-track-border, none);
|
|
596
|
+
outline: var(--media-range-track-outline);
|
|
597
|
+
outline-offset: var(--media-range-track-outline-offset);
|
|
598
|
+
backdrop-filter: var(--media-range-track-backdrop-filter);
|
|
599
|
+
-webkit-backdrop-filter: var(--media-range-track-backdrop-filter);
|
|
600
|
+
box-shadow: var(--media-range-track-box-shadow, none);
|
|
601
|
+
position: absolute;
|
|
602
|
+
width: 100%;
|
|
603
|
+
height: 100%;
|
|
604
|
+
overflow: hidden;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
#progress,
|
|
608
|
+
#pointer {
|
|
609
|
+
position: absolute;
|
|
610
|
+
height: 100%;
|
|
611
|
+
will-change: width;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
#progress {
|
|
615
|
+
background: var(--media-range-bar-color, var(--media-primary-color, rgb(238 238 238)));
|
|
616
|
+
transition: var(--media-range-track-transition);
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
#pointer {
|
|
620
|
+
background: var(--media-range-track-pointer-background);
|
|
621
|
+
border-right: var(--media-range-track-pointer-border-right);
|
|
622
|
+
transition: visibility .25s, opacity .25s;
|
|
623
|
+
visibility: hidden;
|
|
624
|
+
opacity: 0;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
@media (hover: hover) {
|
|
628
|
+
:host(:hover) #pointer {
|
|
629
|
+
transition: visibility .5s, opacity .5s;
|
|
630
|
+
visibility: visible;
|
|
631
|
+
opacity: 1;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
#thumb,
|
|
636
|
+
::slotted([slot=thumb]) {
|
|
637
|
+
width: var(--media-range-thumb-width, 10px);
|
|
638
|
+
height: var(--media-range-thumb-height, 10px);
|
|
639
|
+
transition: var(--media-range-thumb-transition);
|
|
640
|
+
transform: var(--media-range-thumb-transform, none);
|
|
641
|
+
opacity: var(--media-range-thumb-opacity, 1);
|
|
642
|
+
translate: -50%;
|
|
643
|
+
position: absolute;
|
|
644
|
+
left: 0;
|
|
645
|
+
cursor: var(--media-cursor, pointer);
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
#thumb {
|
|
649
|
+
border-radius: var(--media-range-thumb-border-radius, 10px);
|
|
650
|
+
background: var(--media-range-thumb-background, var(--media-primary-color, rgb(238 238 238)));
|
|
651
|
+
box-shadow: var(--media-range-thumb-box-shadow, 1px 1px 1px transparent);
|
|
652
|
+
border: var(--media-range-thumb-border, none);
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
:host([disabled]) #thumb {
|
|
656
|
+
background-color: #777;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
.segments #appearance {
|
|
660
|
+
height: var(--media-range-segment-hover-height, 7px);
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
#track {
|
|
664
|
+
clip-path: url(#segments-clipping);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
#segments {
|
|
668
|
+
--segments-gap: var(--media-range-segments-gap, 2px);
|
|
669
|
+
position: absolute;
|
|
670
|
+
width: 100%;
|
|
671
|
+
height: 100%;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
#segments-clipping {
|
|
675
|
+
transform: translateX(calc(var(--segments-gap) / 2));
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
#segments-clipping:empty {
|
|
679
|
+
display: none;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
#segments-clipping rect {
|
|
683
|
+
height: var(--media-range-track-height, 4px);
|
|
684
|
+
y: calc((var(--media-range-segment-hover-height, 7px) - var(--media-range-track-height, 4px)) / 2);
|
|
685
|
+
transition: var(--media-range-segment-transition, transform .1s ease-in-out);
|
|
686
|
+
transform: var(--media-range-segment-transform, scaleY(1));
|
|
687
|
+
transform-origin: center;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
/* Visible label for accessibility - positioned off-screen but technically visible (Firefox requires visible labels) */
|
|
691
|
+
#range-label {
|
|
692
|
+
position: absolute;
|
|
693
|
+
left: -10000px;
|
|
694
|
+
background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));
|
|
695
|
+
pointer-events: none;
|
|
696
|
+
}
|
|
697
|
+
</style>
|
|
698
|
+
<div id="leftgap"></div>
|
|
699
|
+
<div id="container">
|
|
700
|
+
<div id="startpoint"></div>
|
|
701
|
+
<div id="endpoint"></div>
|
|
702
|
+
<div id="appearance">
|
|
703
|
+
<div id="track" part="track">
|
|
704
|
+
<div id="pointer"></div>
|
|
705
|
+
<div id="progress" part="progress"></div>
|
|
706
|
+
</div>
|
|
707
|
+
<slot name="thumb">
|
|
708
|
+
<div id="thumb" part="thumb"></div>
|
|
709
|
+
</slot>
|
|
710
|
+
<svg id="segments" aria-hidden="true"><clipPath id="segments-clipping"></clipPath></svg>
|
|
711
|
+
</div>
|
|
712
|
+
<input id="range" type="range" min="0" max="1" step="any" value="0">
|
|
713
|
+
<label for="range" id="range-label"></label>
|
|
714
|
+
|
|
715
|
+
${this.getContainerTemplateHTML(e)}
|
|
716
|
+
</div>
|
|
717
|
+
<div id="rightgap"></div>
|
|
718
|
+
`}function ta(e){return``}var na=class extends S.HTMLElement{constructor(){if(super(),G(this,Ri),G(this,Bi),G(this,Hi),G(this,Wi),G(this,Ki),G(this,Ji),G(this,Xi),G(this,Qi),G(this,ki,void 0),G(this,Ai,void 0),G(this,ji,void 0),G(this,Mi,void 0),G(this,Ni,{}),G(this,Pi,[]),G(this,Fi,()=>{if(this.range.matches(`:focus-visible`)){let{style:e}=w(this.shadowRoot,`:host`);e.setProperty(`--_focus-visible-box-shadow`,`var(--_focus-box-shadow)`)}}),G(this,Ii,()=>{let{style:e}=w(this.shadowRoot,`:host`);e.removeProperty(`--_focus-visible-box-shadow`)}),G(this,Li,()=>{let e=this.shadowRoot.querySelector(`#segments-clipping`);e&&e.parentNode.append(e)}),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Ae(this.attributes),t=this.constructor.getTemplateHTML(e);this.shadowRoot.setHTMLUnsafe?this.shadowRoot.setHTMLUnsafe(t):this.shadowRoot.innerHTML=t}this.container=this.shadowRoot.querySelector(`#container`),Di(this,ji,this.shadowRoot.querySelector(`#startpoint`)),Di(this,Mi,this.shadowRoot.querySelector(`#endpoint`)),this.range=this.shadowRoot.querySelector(`#range`),this.appearance=this.shadowRoot.querySelector(`#appearance`)}static get observedAttributes(){return[`disabled`,`aria-disabled`,d.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,n){var r,i,a,o;e===d.MEDIA_CONTROLLER?(t&&((i=(r=W(this,ki))?.unassociateElement)==null||i.call(r,this),Di(this,ki,null)),n&&this.isConnected&&(Di(this,ki,this.getRootNode()?.getElementById(n)),(o=(a=W(this,ki))?.associateElement)==null||o.call(a,this))):(e===`disabled`||e===`aria-disabled`&&t!==n)&&(n==null?(this.range.removeAttribute(e),Oi(this,Bi,Vi).call(this)):(this.range.setAttribute(e,n),Oi(this,Hi,Ui).call(this)))}connectedCallback(){var e,t;let{style:n}=w(this.shadowRoot,`:host`);n.setProperty(`display`,`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),W(this,Ni).pointer=w(this.shadowRoot,`#pointer`),W(this,Ni).progress=w(this.shadowRoot,`#progress`),W(this,Ni).thumb=w(this.shadowRoot,`#thumb, ::slotted([slot="thumb"])`),W(this,Ni).activeSegment=w(this.shadowRoot,`#segments-clipping rect:nth-child(0)`);let r=this.getAttribute(d.MEDIA_CONTROLLER);r&&(Di(this,ki,this.getRootNode()?.getElementById(r)),(t=(e=W(this,ki))?.associateElement)==null||t.call(e,this)),this.updateBar(),this.shadowRoot.addEventListener(`focusin`,W(this,Fi)),this.shadowRoot.addEventListener(`focusout`,W(this,Ii)),Oi(this,Bi,Vi).call(this),Oe(this.container,W(this,Li))}disconnectedCallback(){var e,t;Oi(this,Hi,Ui).call(this),(t=(e=W(this,ki))?.unassociateElement)==null||t.call(e,this),Di(this,ki,null),this.shadowRoot.removeEventListener(`focusin`,W(this,Fi)),this.shadowRoot.removeEventListener(`focusout`,W(this,Ii)),ke(this.container,W(this,Li))}updatePointerBar(e){var t;(t=W(this,Ni).pointer)==null||t.style.setProperty(`width`,`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,t;let n=this.range.valueAsNumber*100;(e=W(this,Ni).progress)==null||e.style.setProperty(`width`,`${n}%`),(t=W(this,Ni).thumb)==null||t.style.setProperty(`left`,`${n}%`)}updateSegments(e){let t=this.shadowRoot.querySelector(`#segments-clipping`);if(t.textContent=``,this.container.classList.toggle(`segments`,!!e?.length),!e?.length)return;let n=[...new Set([+this.range.min,...e.flatMap(e=>[e.start,e.end]),+this.range.max])];Di(this,Pi,[...n]);let r=n.pop();for(let[e,i]of n.entries()){let[a,o]=[e===0,e===n.length-1],s=a?`calc(var(--segments-gap) / -1)`:`${i*100}%`,c=`calc(${((o?r:n[e+1])-i)*100}%${a||o?``:` - var(--segments-gap)`})`,l=C.createElementNS(`http://www.w3.org/2000/svg`,`rect`),u=Ue(this.shadowRoot,`#segments-clipping rect:nth-child(${e+1})`);u.style.setProperty(`x`,s),u.style.setProperty(`width`,c),t.append(l)}}getPointerRatio(e){return Ve(e.clientX,e.clientY,W(this,ji).getBoundingClientRect(),W(this,Mi).getBoundingClientRect())}get dragging(){return this.hasAttribute(`dragging`)}handleEvent(e){switch(e.type){case`pointermove`:Oi(this,Qi,$i).call(this,e);break;case`input`:this.updateBar();break;case`pointerenter`:Oi(this,Ki,qi).call(this,e);break;case`pointerdown`:Oi(this,Wi,Gi).call(this,e);break;case`pointerup`:Oi(this,Ji,Yi).call(this);break;case`pointerleave`:Oi(this,Xi,Zi).call(this)}}get keysUsed(){return[`ArrowUp`,`ArrowRight`,`ArrowDown`,`ArrowLeft`]}};ki=new WeakMap,Ai=new WeakMap,ji=new WeakMap,Mi=new WeakMap,Ni=new WeakMap,Pi=new WeakMap,Fi=new WeakMap,Ii=new WeakMap,Li=new WeakMap,Ri=new WeakSet,zi=function(e){let t=W(this,Ni).activeSegment;if(!t)return;let n=this.getPointerRatio(e),r=`#segments-clipping rect:nth-child(${W(this,Pi).findIndex((e,t,r)=>{let i=r[t+1];return i!=null&&n>=e&&n<=i})+1})`;(t.selectorText!=r||!t.style.transform)&&(t.selectorText=r,t.style.setProperty(`transform`,`var(--media-range-segment-hover-transform, scaleY(2))`))},Bi=new WeakSet,Vi=function(){!this.hasAttribute(`disabled`)&&this.isConnected&&(this.addEventListener(`input`,this),this.addEventListener(`pointerdown`,this),this.addEventListener(`pointerenter`,this))},Hi=new WeakSet,Ui=function(){var e,t;this.removeEventListener(`input`,this),this.removeEventListener(`pointerdown`,this),this.removeEventListener(`pointerenter`,this),this.removeEventListener(`pointerleave`,this),(e=S.window)==null||e.removeEventListener(`pointerup`,this),(t=S.window)==null||t.removeEventListener(`pointermove`,this)},Wi=new WeakSet,Gi=function(e){var t;Di(this,Ai,e.composedPath().includes(this.range)),(t=S.window)==null||t.addEventListener(`pointerup`,this,{once:!0})},Ki=new WeakSet,qi=function(e){var t;e.pointerType!==`mouse`&&Oi(this,Wi,Gi).call(this,e),this.addEventListener(`pointerleave`,this,{once:!0}),(t=S.window)==null||t.addEventListener(`pointermove`,this)},Ji=new WeakSet,Yi=function(){var e;(e=S.window)==null||e.removeEventListener(`pointerup`,this),this.toggleAttribute(`dragging`,!1),this.range.disabled=this.hasAttribute(`disabled`)},Xi=new WeakSet,Zi=function(){var e,t;this.removeEventListener(`pointerleave`,this),(e=S.window)==null||e.removeEventListener(`pointermove`,this),this.toggleAttribute(`dragging`,!1),this.range.disabled=this.hasAttribute(`disabled`),(t=W(this,Ni).activeSegment)==null||t.style.removeProperty(`transform`)},Qi=new WeakSet,$i=function(e){(e.pointerType!==`pen`||e.buttons!==0)&&(this.toggleAttribute(`dragging`,e.buttons===1||e.pointerType!==`mouse`),this.updatePointerBar(e),Oi(this,Ri,zi).call(this,e),this.dragging&&(e.pointerType!==`mouse`||!W(this,Ai))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(e),this.range.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0}))))},na.shadowRootOptions={mode:`open`},na.getTemplateHTML=ea,na.getContainerTemplateHTML=ta,S.customElements.get(`media-chrome-range`)||S.customElements.define(`media-chrome-range`,na);var ra=na,ia=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},aa=(e,t,n)=>(ia(e,t,`read from private field`),n?n.call(e):t.get(e)),oa=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},sa=(e,t,n,r)=>(ia(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),ca;function la(e){return`
|
|
719
|
+
<style>
|
|
720
|
+
:host {
|
|
721
|
+
|
|
722
|
+
box-sizing: border-box;
|
|
723
|
+
display: var(--media-control-display, var(--media-control-bar-display, inline-flex));
|
|
724
|
+
color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
|
|
725
|
+
--media-loading-indicator-icon-height: 44px;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
::slotted(media-time-range),
|
|
729
|
+
::slotted(media-volume-range) {
|
|
730
|
+
min-height: 100%;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
::slotted(media-time-range),
|
|
734
|
+
::slotted(media-clip-selector) {
|
|
735
|
+
flex-grow: 1;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
::slotted([role="menu"]) {
|
|
739
|
+
position: absolute;
|
|
740
|
+
}
|
|
741
|
+
</style>
|
|
742
|
+
|
|
743
|
+
<slot></slot>
|
|
744
|
+
`}var ua=class extends S.HTMLElement{constructor(){if(super(),oa(this,ca,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[d.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,n){var r,i,a,o;e===d.MEDIA_CONTROLLER&&(t&&((i=(r=aa(this,ca))?.unassociateElement)==null||i.call(r,this),sa(this,ca,null)),n&&this.isConnected&&(sa(this,ca,this.getRootNode()?.getElementById(n)),(o=(a=aa(this,ca))?.associateElement)==null||o.call(a,this)))}connectedCallback(){var e,t;let n=this.getAttribute(d.MEDIA_CONTROLLER);n&&(sa(this,ca,this.getRootNode()?.getElementById(n)),(t=(e=aa(this,ca))?.associateElement)==null||t.call(e,this))}disconnectedCallback(){var e,t;(t=(e=aa(this,ca))?.unassociateElement)==null||t.call(e,this),sa(this,ca,null)}};ca=new WeakMap,ua.shadowRootOptions={mode:`open`},ua.getTemplateHTML=la,S.customElements.get(`media-control-bar`)||S.customElements.define(`media-control-bar`,ua);var da=ua,fa=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},pa=(e,t,n)=>(fa(e,t,`read from private field`),n?n.call(e):t.get(e)),ma=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},ha=(e,t,n,r)=>(fa(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),ga;function _a(e,t={}){return`
|
|
745
|
+
<style>
|
|
746
|
+
:host {
|
|
747
|
+
font: var(--media-font,
|
|
748
|
+
var(--media-font-weight, normal)
|
|
749
|
+
var(--media-font-size, 14px) /
|
|
750
|
+
var(--media-text-content-height, var(--media-control-height, 24px))
|
|
751
|
+
var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
|
|
752
|
+
color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
|
|
753
|
+
background: var(--media-text-background, var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7))));
|
|
754
|
+
padding: var(--media-control-padding, 10px);
|
|
755
|
+
display: inline-flex;
|
|
756
|
+
justify-content: center;
|
|
757
|
+
align-items: center;
|
|
758
|
+
vertical-align: middle;
|
|
759
|
+
box-sizing: border-box;
|
|
760
|
+
text-align: center;
|
|
761
|
+
pointer-events: auto;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
|
|
765
|
+
:host(:focus-visible) {
|
|
766
|
+
box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
|
|
767
|
+
outline: 0;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
|
|
771
|
+
:host(:where(:focus)) {
|
|
772
|
+
box-shadow: none;
|
|
773
|
+
outline: 0;
|
|
774
|
+
}
|
|
775
|
+
</style>
|
|
776
|
+
|
|
777
|
+
${this.getSlotTemplateHTML(e,t)}
|
|
778
|
+
`}function va(e,t){return`
|
|
779
|
+
<slot></slot>
|
|
780
|
+
`}var ya=class extends S.HTMLElement{constructor(){if(super(),ma(this,ga,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[d.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,n){var r,i,a,o;e===d.MEDIA_CONTROLLER&&(t&&((i=(r=pa(this,ga))?.unassociateElement)==null||i.call(r,this),ha(this,ga,null)),n&&this.isConnected&&(ha(this,ga,this.getRootNode()?.getElementById(n)),(o=(a=pa(this,ga))?.associateElement)==null||o.call(a,this)))}connectedCallback(){var e,t;let{style:n}=w(this.shadowRoot,`:host`);n.setProperty(`display`,`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let r=this.getAttribute(d.MEDIA_CONTROLLER);r&&(ha(this,ga,this.getRootNode()?.getElementById(r)),(t=(e=pa(this,ga))?.associateElement)==null||t.call(e,this))}disconnectedCallback(){var e,t;(t=(e=pa(this,ga))?.unassociateElement)==null||t.call(e,this),ha(this,ga,null)}};ga=new WeakMap,ya.shadowRootOptions={mode:`open`},ya.getTemplateHTML=_a,ya.getSlotTemplateHTML=va,S.customElements.get(`media-text-display`)||S.customElements.define(`media-text-display`,ya);var ba=ya,xa=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},Sa=(e,t,n)=>(xa(e,t,`read from private field`),n?n.call(e):t.get(e)),Ca=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},wa=(e,t,n,r)=>(xa(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),Ta;function Ea(e,t){return`
|
|
781
|
+
<slot>${ge(t.mediaDuration)}</slot>
|
|
782
|
+
`}var Da=class extends ya{constructor(){super(),Ca(this,Ta,void 0),wa(this,Ta,this.shadowRoot.querySelector(`slot`)),Sa(this,Ta).textContent=ge(this.mediaDuration??0)}static get observedAttributes(){return[...super.observedAttributes,m.MEDIA_DURATION]}attributeChangedCallback(e,t,n){e===m.MEDIA_DURATION&&(Sa(this,Ta).textContent=ge(+n)),super.attributeChangedCallback(e,t,n)}get mediaDuration(){return T(this,m.MEDIA_DURATION)}set mediaDuration(e){E(this,m.MEDIA_DURATION,e)}};Ta=new WeakMap,Da.getSlotTemplateHTML=Ea,S.customElements.get(`media-duration-display`)||S.customElements.define(`media-duration-display`,Da);var Oa=Da,ka={2:x(`Network Error`),3:x(`Decode Error`),4:x(`Source Not Supported`),5:x(`Encryption Error`)},Aa={2:x(`A network error caused the media download to fail.`),3:x(`A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.`),4:x(`An unsupported error occurred. The server or network failed, or your browser does not support this format.`),5:x(`The media is encrypted and there are no keys to decrypt it.`)},ja=e=>e.code===1?null:{title:ka[e.code]??`Error ${e.code}`,message:Aa[e.code]??e.message},Ma=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},Na=(e,t,n)=>(Ma(e,t,`read from private field`),n?n.call(e):t.get(e)),Pa=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},Fa=(e,t,n,r)=>(Ma(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),Ia;function La(e){return`
|
|
783
|
+
<style>
|
|
784
|
+
:host {
|
|
785
|
+
background: rgb(20 20 30 / .8);
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
#content {
|
|
789
|
+
display: block;
|
|
790
|
+
padding: 1.2em 1.5em;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
h3,
|
|
794
|
+
p {
|
|
795
|
+
margin-block: 0 .3em;
|
|
796
|
+
}
|
|
797
|
+
</style>
|
|
798
|
+
<slot name="error-${e.mediaerrorcode}" id="content">
|
|
799
|
+
${za({code:+e.mediaerrorcode,message:e.mediaerrormessage})}
|
|
800
|
+
</slot>
|
|
801
|
+
`}function Ra(e){return e.code&&ja(e)!==null}function za(e){let{title:t,message:n}=ja(e)??{},r=``;return t&&(r+=`<slot name="error-${e.code}-title"><h3>${t}</h3></slot>`),n&&(r+=`<slot name="error-${e.code}-message"><p>${n}</p></slot>`),r}var Ba=[m.MEDIA_ERROR_CODE,m.MEDIA_ERROR_MESSAGE],Va=class extends wi{constructor(){super(...arguments),Pa(this,Ia,null)}static get observedAttributes(){return[...super.observedAttributes,...Ba]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,t,n){if(super.attributeChangedCallback(e,t,n),!Ba.includes(e))return;let r=this.mediaError??{code:this.mediaErrorCode,message:this.mediaErrorMessage};if(this.open=Ra(r),this.open&&(this.shadowRoot.querySelector(`slot`).name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector(`#content`).innerHTML=this.formatErrorMessage(r),!this.hasAttribute(`aria-label`))){let{title:e}=ja(r);e&&this.setAttribute(`aria-label`,e)}}get mediaError(){return Na(this,Ia)}set mediaError(e){Fa(this,Ia,e)}get mediaErrorCode(){return T(this,`mediaerrorcode`)}set mediaErrorCode(e){E(this,`mediaerrorcode`,e)}get mediaErrorMessage(){return k(this,`mediaerrormessage`)}set mediaErrorMessage(e){A(this,`mediaerrormessage`,e)}};Ia=new WeakMap,Va.getSlotTemplateHTML=La,Va.formatErrorMessage=za,S.customElements.get(`media-error-dialog`)||S.customElements.define(`media-error-dialog`,Va);var Ha=Va,Ua=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},Wa=(e,t,n)=>(Ua(e,t,`read from private field`),n?n.call(e):t.get(e)),Ga=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},Ka,qa;function Ja(e){return`
|
|
802
|
+
<style>
|
|
803
|
+
:host {
|
|
804
|
+
position: fixed;
|
|
805
|
+
top: 0;
|
|
806
|
+
left: 0;
|
|
807
|
+
z-index: 9999;
|
|
808
|
+
background: rgb(20 20 30 / .8);
|
|
809
|
+
backdrop-filter: blur(10px);
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
#content {
|
|
813
|
+
display: block;
|
|
814
|
+
width: clamp(400px, 40vw, 700px);
|
|
815
|
+
max-width: 90vw;
|
|
816
|
+
text-align: left;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
h2 {
|
|
820
|
+
margin: 0 0 1.5rem 0;
|
|
821
|
+
font-size: 1.5rem;
|
|
822
|
+
font-weight: 500;
|
|
823
|
+
text-align: center;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
.shortcuts-table {
|
|
827
|
+
width: 100%;
|
|
828
|
+
border-collapse: collapse;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
.shortcuts-table tr {
|
|
832
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
.shortcuts-table tr:last-child {
|
|
836
|
+
border-bottom: none;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
.shortcuts-table td {
|
|
840
|
+
padding: 0.75rem 0.5rem;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
.shortcuts-table td:first-child {
|
|
844
|
+
text-align: right;
|
|
845
|
+
padding-right: 1rem;
|
|
846
|
+
width: 40%;
|
|
847
|
+
min-width: 120px;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
.shortcuts-table td:last-child {
|
|
851
|
+
padding-left: 1rem;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
.key {
|
|
855
|
+
display: inline-block;
|
|
856
|
+
background: rgba(255, 255, 255, 0.15);
|
|
857
|
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
858
|
+
border-radius: 4px;
|
|
859
|
+
padding: 0.25rem 0.5rem;
|
|
860
|
+
font-family: 'Courier New', monospace;
|
|
861
|
+
font-size: 0.9rem;
|
|
862
|
+
font-weight: 500;
|
|
863
|
+
min-width: 1.5rem;
|
|
864
|
+
text-align: center;
|
|
865
|
+
margin: 0 0.2rem;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
.description {
|
|
869
|
+
color: rgba(255, 255, 255, 0.9);
|
|
870
|
+
font-size: 0.95rem;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
.key-combo {
|
|
874
|
+
display: flex;
|
|
875
|
+
align-items: center;
|
|
876
|
+
justify-content: flex-end;
|
|
877
|
+
gap: 0.3rem;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
.key-separator {
|
|
881
|
+
color: rgba(255, 255, 255, 0.5);
|
|
882
|
+
font-size: 0.9rem;
|
|
883
|
+
}
|
|
884
|
+
</style>
|
|
885
|
+
<slot id="content">
|
|
886
|
+
${Ya()}
|
|
887
|
+
</slot>
|
|
888
|
+
`}function Ya(){return`
|
|
889
|
+
<h2>Keyboard Shortcuts</h2>
|
|
890
|
+
<table class="shortcuts-table">${[{keys:[`Space`,`k`],description:`Toggle Playback`},{keys:[`m`],description:`Toggle mute`},{keys:[`f`],description:`Toggle fullscreen`},{keys:[`c`],description:`Toggle captions or subtitles, if available`},{keys:[`p`],description:`Toggle Picture in Picture`},{keys:[`←`,`j`],description:`Seek back 10s`},{keys:[`→`,`l`],description:`Seek forward 10s`},{keys:[`↑`],description:`Turn volume up`},{keys:[`↓`],description:`Turn volume down`},{keys:[`< (SHIFT+,)`],description:`Decrease playback rate`},{keys:[`> (SHIFT+.)`],description:`Increase playback rate`}].map(({keys:e,description:t})=>`
|
|
891
|
+
<tr>
|
|
892
|
+
<td>
|
|
893
|
+
<div class="key-combo">${e.map((e,t)=>t>0?`<span class="key-separator">or</span><span class="key">${e}</span>`:`<span class="key">${e}</span>`).join(``)}</div>
|
|
894
|
+
</td>
|
|
895
|
+
<td class="description">${t}</td>
|
|
896
|
+
</tr>
|
|
897
|
+
`).join(``)}</table>
|
|
898
|
+
`}var Xa=class extends wi{constructor(){super(...arguments),Ga(this,Ka,e=>{if(!this.open)return;let t=this.shadowRoot?.querySelector(`#content`);if(!t)return;let n=e.composedPath(),r=n[0]===this||n.includes(this),i=n.includes(t);r&&!i&&(this.open=!1)}),Ga(this,qa,e=>{if(!this.open)return;let t=e.shiftKey&&(e.key===`/`||e.key===`?`);(e.key===`Escape`||t)&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&(this.open=!1,e.preventDefault(),e.stopPropagation())})}connectedCallback(){super.connectedCallback(),this.open&&(this.addEventListener(`click`,Wa(this,Ka)),document.addEventListener(`keydown`,Wa(this,qa)))}disconnectedCallback(){this.removeEventListener(`click`,Wa(this,Ka)),document.removeEventListener(`keydown`,Wa(this,qa))}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===`open`&&(this.open?(this.addEventListener(`click`,Wa(this,Ka)),document.addEventListener(`keydown`,Wa(this,qa))):(this.removeEventListener(`click`,Wa(this,Ka)),document.removeEventListener(`keydown`,Wa(this,qa))))}};Ka=new WeakMap,qa=new WeakMap,Xa.getSlotTemplateHTML=Ja,S.customElements.get(`media-keyboard-shortcuts-dialog`)||S.customElements.define(`media-keyboard-shortcuts-dialog`,Xa);var Za=Xa,Qa=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},$a=(e,t,n)=>(Qa(e,t,`read from private field`),n?n.call(e):t.get(e)),eo=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},to=(e,t,n,r)=>(Qa(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),no,ro=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
899
|
+
<path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
|
|
900
|
+
</svg>`,io=`<svg aria-hidden="true" viewBox="0 0 26 24">
|
|
901
|
+
<path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
|
|
902
|
+
</svg>`;function ao(e){return`
|
|
903
|
+
<style>
|
|
904
|
+
:host([${m.MEDIA_IS_FULLSCREEN}]) slot[name=icon] slot:not([name=exit]) {
|
|
905
|
+
display: none !important;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
|
|
909
|
+
:host(:not([${m.MEDIA_IS_FULLSCREEN}])) slot[name=icon] slot:not([name=enter]) {
|
|
910
|
+
display: none !important;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
:host([${m.MEDIA_IS_FULLSCREEN}]) slot[name=tooltip-enter],
|
|
914
|
+
:host(:not([${m.MEDIA_IS_FULLSCREEN}])) slot[name=tooltip-exit] {
|
|
915
|
+
display: none;
|
|
916
|
+
}
|
|
917
|
+
</style>
|
|
918
|
+
|
|
919
|
+
<slot name="icon">
|
|
920
|
+
<slot name="enter">${ro}</slot>
|
|
921
|
+
<slot name="exit">${io}</slot>
|
|
922
|
+
</slot>
|
|
923
|
+
`}function oo(){return`
|
|
924
|
+
<slot name="tooltip-enter">${x(`Enter fullscreen mode`)}</slot>
|
|
925
|
+
<slot name="tooltip-exit">${x(`Exit fullscreen mode`)}</slot>
|
|
926
|
+
`}var so=e=>{let t=e.mediaIsFullscreen?x(`exit fullscreen mode`):x(`enter fullscreen mode`);e.setAttribute(`aria-label`,t)},co=class extends U{constructor(){super(...arguments),eo(this,no,null)}static get observedAttributes(){return[...super.observedAttributes,m.MEDIA_IS_FULLSCREEN,m.MEDIA_FULLSCREEN_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),so(this)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===m.MEDIA_IS_FULLSCREEN&&so(this)}get mediaFullscreenUnavailable(){return k(this,m.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){A(this,m.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return D(this,m.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){O(this,m.MEDIA_IS_FULLSCREEN,e)}handleClick(e){to(this,no,e);let t=$a(this,no)instanceof PointerEvent,n=this.mediaIsFullscreen?new S.CustomEvent(u.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0}):new S.CustomEvent(u.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(n)}};no=new WeakMap,co.getSlotTemplateHTML=ao,co.getTooltipContentHTML=oo,S.customElements.get(`media-fullscreen-button`)||S.customElements.define(`media-fullscreen-button`,co);var lo=co,{MEDIA_TIME_IS_LIVE:uo,MEDIA_PAUSED:fo}=m,{MEDIA_SEEK_TO_LIVE_REQUEST:po,MEDIA_PLAY_REQUEST:mo}=u,ho=`<svg viewBox="0 0 6 12" aria-hidden="true"><circle cx="3" cy="6" r="2"></circle></svg>`;function go(e){return`
|
|
927
|
+
<style>
|
|
928
|
+
:host { --media-tooltip-display: none; }
|
|
929
|
+
|
|
930
|
+
slot[name=indicator] > *,
|
|
931
|
+
:host ::slotted([slot=indicator]) {
|
|
932
|
+
|
|
933
|
+
min-width: auto;
|
|
934
|
+
fill: var(--media-live-button-icon-color, rgb(140, 140, 140));
|
|
935
|
+
color: var(--media-live-button-icon-color, rgb(140, 140, 140));
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
:host([${uo}]:not([${fo}])) slot[name=indicator] > *,
|
|
939
|
+
:host([${uo}]:not([${fo}])) ::slotted([slot=indicator]) {
|
|
940
|
+
fill: var(--media-live-button-indicator-color, rgb(255, 0, 0));
|
|
941
|
+
color: var(--media-live-button-indicator-color, rgb(255, 0, 0));
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
:host([${uo}]:not([${fo}])) {
|
|
945
|
+
cursor: var(--media-cursor, not-allowed);
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
slot[name=text]{
|
|
949
|
+
text-transform: uppercase;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
</style>
|
|
953
|
+
|
|
954
|
+
<slot name="indicator">${ho}</slot>
|
|
955
|
+
|
|
956
|
+
<slot name="spacer"> </slot><slot name="text">${x(`live`)}</slot>
|
|
957
|
+
`}var _o=e=>{let t=e.mediaPaused||!e.mediaTimeIsLive,n=x(t?`seek to live`:`playing live`);e.setAttribute(`aria-label`,n);let r=e.shadowRoot?.querySelector(`slot[name="text"]`);r&&(r.textContent=x(`live`)),t?e.removeAttribute(`aria-disabled`):e.setAttribute(`aria-disabled`,`true`)},vo=class extends U{static get observedAttributes(){return[...super.observedAttributes,uo,fo]}connectedCallback(){super.connectedCallback(),_o(this)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),_o(this)}get mediaPaused(){return D(this,m.MEDIA_PAUSED)}set mediaPaused(e){O(this,m.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return D(this,m.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){O(this,m.MEDIA_TIME_IS_LIVE,e)}handleClick(){(this.mediaPaused||!this.mediaTimeIsLive)&&(this.dispatchEvent(new S.CustomEvent(po,{composed:!0,bubbles:!0})),this.hasAttribute(fo)&&this.dispatchEvent(new S.CustomEvent(mo,{composed:!0,bubbles:!0})))}};vo.getSlotTemplateHTML=go,S.customElements.get(`media-live-button`)||S.customElements.define(`media-live-button`,vo);var yo=vo,bo=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},xo=(e,t,n)=>(bo(e,t,`read from private field`),n?n.call(e):t.get(e)),So=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},Co=(e,t,n,r)=>(bo(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),wo,To,Eo={LOADING_DELAY:`loadingdelay`,NO_AUTOHIDE:`noautohide`},Do=500,Oo=`
|
|
958
|
+
<svg aria-hidden="true" viewBox="0 0 100 100">
|
|
959
|
+
<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">
|
|
960
|
+
<animateTransform
|
|
961
|
+
attributeName="transform"
|
|
962
|
+
attributeType="XML"
|
|
963
|
+
type="rotate"
|
|
964
|
+
dur="1s"
|
|
965
|
+
from="0 50 50"
|
|
966
|
+
to="360 50 50"
|
|
967
|
+
repeatCount="indefinite" />
|
|
968
|
+
</path>
|
|
969
|
+
</svg>
|
|
970
|
+
`;function ko(e){return`
|
|
971
|
+
<style>
|
|
972
|
+
:host {
|
|
973
|
+
display: var(--media-control-display, var(--media-loading-indicator-display, inline-block));
|
|
974
|
+
vertical-align: middle;
|
|
975
|
+
box-sizing: border-box;
|
|
976
|
+
--_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${Do}ms);
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
#status {
|
|
980
|
+
color: rgba(0,0,0,0);
|
|
981
|
+
width: 0px;
|
|
982
|
+
height: 0px;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
:host slot[name=icon] > *,
|
|
986
|
+
:host ::slotted([slot=icon]) {
|
|
987
|
+
opacity: var(--media-loading-indicator-opacity, 0);
|
|
988
|
+
transition: opacity 0.15s;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
:host([${m.MEDIA_LOADING}]:not([${m.MEDIA_PAUSED}])) slot[name=icon] > *,
|
|
992
|
+
:host([${m.MEDIA_LOADING}]:not([${m.MEDIA_PAUSED}])) ::slotted([slot=icon]) {
|
|
993
|
+
opacity: var(--media-loading-indicator-opacity, 1);
|
|
994
|
+
transition: opacity 0.15s var(--_loading-indicator-delay);
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
:host #status {
|
|
998
|
+
visibility: var(--media-loading-indicator-opacity, hidden);
|
|
999
|
+
transition: visibility 0.15s;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
:host([${m.MEDIA_LOADING}]:not([${m.MEDIA_PAUSED}])) #status {
|
|
1003
|
+
visibility: var(--media-loading-indicator-opacity, visible);
|
|
1004
|
+
transition: visibility 0.15s var(--_loading-indicator-delay);
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
svg, img, ::slotted(svg), ::slotted(img) {
|
|
1008
|
+
width: var(--media-loading-indicator-icon-width);
|
|
1009
|
+
height: var(--media-loading-indicator-icon-height, 100px);
|
|
1010
|
+
fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));
|
|
1011
|
+
vertical-align: middle;
|
|
1012
|
+
}
|
|
1013
|
+
</style>
|
|
1014
|
+
|
|
1015
|
+
<slot name="icon">${Oo}</slot>
|
|
1016
|
+
<div id="status" role="status" aria-live="polite">${x(`media loading`)}</div>
|
|
1017
|
+
`}var Ao=class extends S.HTMLElement{constructor(){if(super(),So(this,wo,void 0),So(this,To,Do),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[d.MEDIA_CONTROLLER,m.MEDIA_PAUSED,m.MEDIA_LOADING,Eo.LOADING_DELAY]}attributeChangedCallback(e,t,n){var r,i,a,o;e===Eo.LOADING_DELAY&&t!==n?this.loadingDelay=Number(n):e===d.MEDIA_CONTROLLER&&(t&&((i=(r=xo(this,wo))?.unassociateElement)==null||i.call(r,this),Co(this,wo,null)),n&&this.isConnected&&(Co(this,wo,this.getRootNode()?.getElementById(n)),(o=(a=xo(this,wo))?.associateElement)==null||o.call(a,this)))}connectedCallback(){var e,t;let n=this.getAttribute(d.MEDIA_CONTROLLER);n&&(Co(this,wo,this.getRootNode()?.getElementById(n)),(t=(e=xo(this,wo))?.associateElement)==null||t.call(e,this))}disconnectedCallback(){var e,t;(t=(e=xo(this,wo))?.unassociateElement)==null||t.call(e,this),Co(this,wo,null)}get loadingDelay(){return xo(this,To)}set loadingDelay(e){Co(this,To,e);let{style:t}=w(this.shadowRoot,`:host`);t.setProperty(`--_loading-indicator-delay`,`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return D(this,m.MEDIA_PAUSED)}set mediaPaused(e){O(this,m.MEDIA_PAUSED,e)}get mediaLoading(){return D(this,m.MEDIA_LOADING)}set mediaLoading(e){O(this,m.MEDIA_LOADING,e)}get mediaController(){return k(this,d.MEDIA_CONTROLLER)}set mediaController(e){A(this,d.MEDIA_CONTROLLER,e)}get noAutohide(){return D(this,Eo.NO_AUTOHIDE)}set noAutohide(e){O(this,Eo.NO_AUTOHIDE,e)}};wo=new WeakMap,To=new WeakMap,Ao.shadowRootOptions={mode:`open`},Ao.getTemplateHTML=ko,S.customElements.get(`media-loading-indicator`)||S.customElements.define(`media-loading-indicator`,Ao);var jo=Ao,Mo=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1018
|
+
<path d="M16.5 12A4.5 4.5 0 0 0 14 8v2.18l2.45 2.45a4.22 4.22 0 0 0 .05-.63Zm2.5 0a6.84 6.84 0 0 1-.54 2.64L20 16.15A8.8 8.8 0 0 0 21 12a9 9 0 0 0-7-8.77v2.06A7 7 0 0 1 19 12ZM4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25A6.92 6.92 0 0 1 14 18.7v2.06A9 9 0 0 0 17.69 19l2 2.05L21 19.73l-9-9L4.27 3ZM12 4 9.91 6.09 12 8.18V4Z"/>
|
|
1019
|
+
</svg>`,No=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1020
|
+
<path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4Z"/>
|
|
1021
|
+
</svg>`,Po=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1022
|
+
<path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4ZM14 3.23v2.06a7 7 0 0 1 0 13.42v2.06a9 9 0 0 0 0-17.54Z"/>
|
|
1023
|
+
</svg>`;function Fo(e){return`
|
|
1024
|
+
<style>
|
|
1025
|
+
:host(:not([${m.MEDIA_VOLUME_LEVEL}])) slot[name=icon] slot:not([name=high]),
|
|
1026
|
+
:host([${m.MEDIA_VOLUME_LEVEL}=high]) slot[name=icon] slot:not([name=high]) {
|
|
1027
|
+
display: none !important;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
:host([${m.MEDIA_VOLUME_LEVEL}=off]) slot[name=icon] slot:not([name=off]) {
|
|
1031
|
+
display: none !important;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
:host([${m.MEDIA_VOLUME_LEVEL}=low]) slot[name=icon] slot:not([name=low]) {
|
|
1035
|
+
display: none !important;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
:host([${m.MEDIA_VOLUME_LEVEL}=medium]) slot[name=icon] slot:not([name=medium]) {
|
|
1039
|
+
display: none !important;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
:host(:not([${m.MEDIA_VOLUME_LEVEL}=off])) slot[name=tooltip-unmute],
|
|
1043
|
+
:host([${m.MEDIA_VOLUME_LEVEL}=off]) slot[name=tooltip-mute] {
|
|
1044
|
+
display: none;
|
|
1045
|
+
}
|
|
1046
|
+
</style>
|
|
1047
|
+
|
|
1048
|
+
<slot name="icon">
|
|
1049
|
+
<slot name="off">${Mo}</slot>
|
|
1050
|
+
<slot name="low">${No}</slot>
|
|
1051
|
+
<slot name="medium">${No}</slot>
|
|
1052
|
+
<slot name="high">${Po}</slot>
|
|
1053
|
+
</slot>
|
|
1054
|
+
`}function Io(){return`
|
|
1055
|
+
<slot name="tooltip-mute">${x(`Mute`)}</slot>
|
|
1056
|
+
<slot name="tooltip-unmute">${x(`Unmute`)}</slot>
|
|
1057
|
+
`}var Lo=e=>{let t=e.mediaVolumeLevel===`off`?x(`unmute`):x(`mute`);e.setAttribute(`aria-label`,t)},Ro=class extends U{static get observedAttributes(){return[...super.observedAttributes,m.MEDIA_VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),Lo(this)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===m.MEDIA_VOLUME_LEVEL&&Lo(this)}get mediaVolumeLevel(){return k(this,m.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){A(this,m.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel===`off`?u.MEDIA_UNMUTE_REQUEST:u.MEDIA_MUTE_REQUEST;this.dispatchEvent(new S.CustomEvent(e,{composed:!0,bubbles:!0}))}};Ro.getSlotTemplateHTML=Fo,Ro.getTooltipContentHTML=Io,S.customElements.get(`media-mute-button`)||S.customElements.define(`media-mute-button`,Ro);var zo=Ro,Bo=`<svg aria-hidden="true" viewBox="0 0 28 24">
|
|
1058
|
+
<path d="M24 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h20a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Zm-1 16H5V5h18v14Zm-3-8h-7v5h7v-5Z"/>
|
|
1059
|
+
</svg>`;function Vo(e){return`
|
|
1060
|
+
<style>
|
|
1061
|
+
:host([${m.MEDIA_IS_PIP}]) slot[name=icon] slot:not([name=exit]) {
|
|
1062
|
+
display: none !important;
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
:host(:not([${m.MEDIA_IS_PIP}])) slot[name=icon] slot:not([name=enter]) {
|
|
1066
|
+
display: none !important;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
:host([${m.MEDIA_IS_PIP}]) slot[name=tooltip-enter],
|
|
1070
|
+
:host(:not([${m.MEDIA_IS_PIP}])) slot[name=tooltip-exit] {
|
|
1071
|
+
display: none;
|
|
1072
|
+
}
|
|
1073
|
+
</style>
|
|
1074
|
+
|
|
1075
|
+
<slot name="icon">
|
|
1076
|
+
<slot name="enter">${Bo}</slot>
|
|
1077
|
+
<slot name="exit">${Bo}</slot>
|
|
1078
|
+
</slot>
|
|
1079
|
+
`}function Ho(){return`
|
|
1080
|
+
<slot name="tooltip-enter">${x(`Enter picture in picture mode`)}</slot>
|
|
1081
|
+
<slot name="tooltip-exit">${x(`Exit picture in picture mode`)}</slot>
|
|
1082
|
+
`}var Uo=e=>{let t=e.mediaIsPip?x(`exit picture in picture mode`):x(`enter picture in picture mode`);e.setAttribute(`aria-label`,t)},Wo=class extends U{static get observedAttributes(){return[...super.observedAttributes,m.MEDIA_IS_PIP,m.MEDIA_PIP_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),Uo(this)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===m.MEDIA_IS_PIP&&Uo(this)}get mediaPipUnavailable(){return k(this,m.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){A(this,m.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return D(this,m.MEDIA_IS_PIP)}set mediaIsPip(e){O(this,m.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?u.MEDIA_EXIT_PIP_REQUEST:u.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new S.CustomEvent(e,{composed:!0,bubbles:!0}))}};Wo.getSlotTemplateHTML=Vo,Wo.getTooltipContentHTML=Ho,S.customElements.get(`media-pip-button`)||S.customElements.define(`media-pip-button`,Wo);var Go=Wo,Ko=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},qo=(e,t,n)=>(Ko(e,t,`read from private field`),n?n.call(e):t.get(e)),Jo=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},Yo,Xo={RATES:`rates`},Zo=[1,1.2,1.5,1.7,2];function Qo(e){return Math.round(e*100)/100}function $o(e){return`
|
|
1083
|
+
<style>
|
|
1084
|
+
:host {
|
|
1085
|
+
min-width: 5ch;
|
|
1086
|
+
padding: var(--media-button-padding, var(--media-control-padding, 10px 5px));
|
|
1087
|
+
}
|
|
1088
|
+
</style>
|
|
1089
|
+
<slot name="icon">${e.mediaplaybackrate?Qo(+e.mediaplaybackrate):1}x</slot>
|
|
1090
|
+
`}function es(){return x(`Playback rate`)}var ts=class extends U{constructor(){super(),Jo(this,Yo,new Lt(this,Xo.RATES,{defaultValue:Zo})),this.container=this.shadowRoot.querySelector(`slot[name="icon"]`),this.container.innerHTML=`${Qo(this.mediaPlaybackRate??1)}x`}static get observedAttributes(){return[...super.observedAttributes,m.MEDIA_PLAYBACK_RATE,Xo.RATES]}attributeChangedCallback(e,t,n){if(super.attributeChangedCallback(e,t,n),e===Xo.RATES&&(qo(this,Yo).value=n),e===m.MEDIA_PLAYBACK_RATE){let e=n?+n:NaN,t=Qo(Number.isNaN(e)?1:e);this.container.innerHTML=`${t}x`,this.setAttribute(`aria-label`,x(`Playback rate {playbackRate}`,{playbackRate:t}))}}get rates(){return qo(this,Yo)}set rates(e){e?Array.isArray(e)?qo(this,Yo).value=e.join(` `):typeof e==`string`&&(qo(this,Yo).value=e):qo(this,Yo).value=``}get mediaPlaybackRate(){return T(this,m.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){E(this,m.MEDIA_PLAYBACK_RATE,e)}handleClick(){let e=Array.from(qo(this,Yo).values(),e=>+e).sort((e,t)=>e-t),t=e.find(e=>e>this.mediaPlaybackRate)??e[0]??1,n=new S.CustomEvent(u.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(n)}};Yo=new WeakMap,ts.getSlotTemplateHTML=$o,ts.getTooltipContentHTML=es,S.customElements.get(`media-playback-rate-button`)||S.customElements.define(`media-playback-rate-button`,ts);var ns=ts,rs=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1091
|
+
<path d="m6 21 15-9L6 3v18Z"/>
|
|
1092
|
+
</svg>`,is=`<svg aria-hidden="true" viewBox="0 0 24 24">
|
|
1093
|
+
<path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
|
|
1094
|
+
</svg>`;function as(e){return`
|
|
1095
|
+
<style>
|
|
1096
|
+
:host([${m.MEDIA_PAUSED}]) slot[name=pause],
|
|
1097
|
+
:host(:not([${m.MEDIA_PAUSED}])) slot[name=play] {
|
|
1098
|
+
display: none !important;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
:host([${m.MEDIA_PAUSED}]) slot[name=tooltip-pause],
|
|
1102
|
+
:host(:not([${m.MEDIA_PAUSED}])) slot[name=tooltip-play] {
|
|
1103
|
+
display: none;
|
|
1104
|
+
}
|
|
1105
|
+
</style>
|
|
1106
|
+
|
|
1107
|
+
<slot name="icon">
|
|
1108
|
+
<slot name="play">${rs}</slot>
|
|
1109
|
+
<slot name="pause">${is}</slot>
|
|
1110
|
+
</slot>
|
|
1111
|
+
`}function os(){return`
|
|
1112
|
+
<slot name="tooltip-play">${x(`Play`)}</slot>
|
|
1113
|
+
<slot name="tooltip-pause">${x(`Pause`)}</slot>
|
|
1114
|
+
`}var ss=e=>{let t=e.mediaPaused?x(`play`):x(`pause`);e.setAttribute(`aria-label`,t)},cs=class extends U{static get observedAttributes(){return[...super.observedAttributes,m.MEDIA_PAUSED,m.MEDIA_ENDED]}connectedCallback(){super.connectedCallback(),ss(this)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),(e===m.MEDIA_PAUSED||e===m.MEDIA_LANG)&&ss(this)}get mediaPaused(){return D(this,m.MEDIA_PAUSED)}set mediaPaused(e){O(this,m.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?u.MEDIA_PLAY_REQUEST:u.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new S.CustomEvent(e,{composed:!0,bubbles:!0}))}};cs.getSlotTemplateHTML=as,cs.getTooltipContentHTML=os,S.customElements.get(`media-play-button`)||S.customElements.define(`media-play-button`,cs);var ls=cs,us={PLACEHOLDER_SRC:`placeholdersrc`,SRC:`src`};function ds(e){return`
|
|
1115
|
+
<style>
|
|
1116
|
+
:host {
|
|
1117
|
+
pointer-events: none;
|
|
1118
|
+
display: var(--media-poster-image-display, inline-block);
|
|
1119
|
+
box-sizing: border-box;
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
img {
|
|
1123
|
+
max-width: 100%;
|
|
1124
|
+
max-height: 100%;
|
|
1125
|
+
min-width: 100%;
|
|
1126
|
+
min-height: 100%;
|
|
1127
|
+
background-repeat: no-repeat;
|
|
1128
|
+
background-position: var(--media-poster-image-background-position, var(--media-object-position, center));
|
|
1129
|
+
background-size: var(--media-poster-image-background-size, var(--media-object-fit, contain));
|
|
1130
|
+
object-fit: var(--media-object-fit, contain);
|
|
1131
|
+
object-position: var(--media-object-position, center);
|
|
1132
|
+
}
|
|
1133
|
+
</style>
|
|
1134
|
+
|
|
1135
|
+
<img part="poster img" aria-hidden="true" id="image"/>
|
|
1136
|
+
`}var fs=e=>{e.style.removeProperty(`background-image`)},ps=(e,t)=>{e.style[`background-image`]=`url('${t}')`},ms=class extends S.HTMLElement{static get observedAttributes(){return[us.PLACEHOLDER_SRC,us.SRC]}constructor(){if(super(),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}this.image=this.shadowRoot.querySelector(`#image`)}attributeChangedCallback(e,t,n){e===us.SRC&&(n==null?this.image.removeAttribute(us.SRC):this.image.setAttribute(us.SRC,n)),e===us.PLACEHOLDER_SRC&&(n==null?fs(this.image):ps(this.image,n))}get placeholderSrc(){return k(this,us.PLACEHOLDER_SRC)}set placeholderSrc(e){A(this,us.SRC,e)}get src(){return k(this,us.SRC)}set src(e){A(this,us.SRC,e)}};ms.shadowRootOptions={mode:`open`},ms.getTemplateHTML=ds,S.customElements.get(`media-poster-image`)||S.customElements.define(`media-poster-image`,ms);var hs=ms,gs=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},_s=(e,t,n)=>(gs(e,t,`read from private field`),n?n.call(e):t.get(e)),vs=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},ys=(e,t,n,r)=>(gs(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),bs,xs=class extends ya{constructor(){super(),vs(this,bs,void 0),ys(this,bs,this.shadowRoot.querySelector(`slot`))}static get observedAttributes(){return[...super.observedAttributes,m.MEDIA_PREVIEW_CHAPTER,m.MEDIA_LANG]}attributeChangedCallback(e,t,n){if(super.attributeChangedCallback(e,t,n),(e===m.MEDIA_PREVIEW_CHAPTER||e===m.MEDIA_LANG)&&n!==t&&n!=null){if(_s(this,bs).textContent=n,n!==``){let e=x(`chapter: {chapterName}`,{chapterName:n});this.setAttribute(`aria-valuetext`,e)}else this.removeAttribute(`aria-valuetext`)}}get mediaPreviewChapter(){return k(this,m.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){A(this,m.MEDIA_PREVIEW_CHAPTER,e)}};bs=new WeakMap,S.customElements.get(`media-preview-chapter-display`)||S.customElements.define(`media-preview-chapter-display`,xs);var Ss=xs,Cs=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},ws=(e,t,n)=>(Cs(e,t,`read from private field`),n?n.call(e):t.get(e)),Ts=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},Es=(e,t,n,r)=>(Cs(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),Ds;function Os(e){return`
|
|
1137
|
+
<style>
|
|
1138
|
+
:host {
|
|
1139
|
+
box-sizing: border-box;
|
|
1140
|
+
display: var(--media-control-display, var(--media-preview-thumbnail-display, inline-block));
|
|
1141
|
+
overflow: hidden;
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
img {
|
|
1145
|
+
display: none;
|
|
1146
|
+
position: relative;
|
|
1147
|
+
}
|
|
1148
|
+
</style>
|
|
1149
|
+
<img crossorigin loading="eager" decoding="async">
|
|
1150
|
+
`}var ks=class extends S.HTMLElement{constructor(){if(super(),Ts(this,Ds,void 0),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let e=Ae(this.attributes);this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(e)}}static get observedAttributes(){return[d.MEDIA_CONTROLLER,m.MEDIA_PREVIEW_IMAGE,m.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t;let n=this.getAttribute(d.MEDIA_CONTROLLER);n&&(Es(this,Ds,this.getRootNode()?.getElementById(n)),(t=(e=ws(this,Ds))?.associateElement)==null||t.call(e,this))}disconnectedCallback(){var e,t;(t=(e=ws(this,Ds))?.unassociateElement)==null||t.call(e,this),Es(this,Ds,null)}attributeChangedCallback(e,t,n){var r,i,a,o;[m.MEDIA_PREVIEW_IMAGE,m.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===d.MEDIA_CONTROLLER&&(t&&((i=(r=ws(this,Ds))?.unassociateElement)==null||i.call(r,this),Es(this,Ds,null)),n&&this.isConnected&&(Es(this,Ds,this.getRootNode()?.getElementById(n)),(o=(a=ws(this,Ds))?.associateElement)==null||o.call(a,this)))}get mediaPreviewImage(){return k(this,m.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){A(this,m.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(m.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(e=>+e)}set mediaPreviewCoords(e){e?this.setAttribute(m.MEDIA_PREVIEW_COORDS,e.join(` `)):this.removeAttribute(m.MEDIA_PREVIEW_COORDS)}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[n,r,i,a]=e,o=t.split(`#`)[0],s=getComputedStyle(this),{maxWidth:c,maxHeight:l,minWidth:u,minHeight:d}=s,f=s.getPropertyValue(`--media-preview-thumbnail-object-fit`).trim()||`contain`,p,m;if(f===`fill`){let e=parseInt(c)/i,t=parseInt(l)/a,n=parseInt(u)/i,r=parseInt(d)/a;p=e<1?e:Math.max(e,n),m=t<1?t:Math.max(t,r)}else{let e=Math.min(parseInt(c)/i,parseInt(l)/a),t=Math.max(parseInt(u)/i,parseInt(d)/a),n=e<1?e:t>1?t:1;p=n,m=n}let{style:h}=w(this.shadowRoot,`:host`),ee=w(this.shadowRoot,`img`).style,g=this.shadowRoot.querySelector(`img`),_=Math.min(p,m)<1?`min`:`max`;h.setProperty(`${_}-width`,`initial`,`important`),h.setProperty(`${_}-height`,`initial`,`important`),h.width=`${i*p}px`,h.height=`${a*m}px`;let v=()=>{ee.width=`${this.imgWidth*p}px`,ee.height=`${this.imgHeight*m}px`,ee.display=`block`};g.src!==o&&(g.onload=()=>{this.imgWidth=g.naturalWidth,this.imgHeight=g.naturalHeight,v(),g.onload=null},g.src=o,v()),v(),ee.transform=`translate(-${n*p}px, -${r*m}px)`}};Ds=new WeakMap,ks.shadowRootOptions={mode:`open`},ks.getTemplateHTML=Os,S.customElements.get(`media-preview-thumbnail`)||S.customElements.define(`media-preview-thumbnail`,ks);var As=ks,js=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},Ms=(e,t,n)=>(js(e,t,`read from private field`),n?n.call(e):t.get(e)),Ns=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},Ps=(e,t,n,r)=>(js(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),Fs,Is=class extends ya{constructor(){super(),Ns(this,Fs,void 0),Ps(this,Fs,this.shadowRoot.querySelector(`slot`)),Ms(this,Fs).textContent=ge(0)}static get observedAttributes(){return[...super.observedAttributes,m.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===m.MEDIA_PREVIEW_TIME&&n!=null&&(Ms(this,Fs).textContent=ge(parseFloat(n)))}get mediaPreviewTime(){return T(this,m.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){E(this,m.MEDIA_PREVIEW_TIME,e)}};Fs=new WeakMap,S.customElements.get(`media-preview-time-display`)||S.customElements.define(`media-preview-time-display`,Is);var Ls=Is,Rs={SEEK_OFFSET:`seekoffset`},zs=30,Bs=e=>`
|
|
1151
|
+
<svg aria-hidden="true" viewBox="0 0 20 24">
|
|
1152
|
+
<defs>
|
|
1153
|
+
<style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
|
|
1154
|
+
</defs>
|
|
1155
|
+
<text class="text value" transform="translate(2.18 19.87)">${e}</text>
|
|
1156
|
+
<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"/>
|
|
1157
|
+
</svg>`;function Vs(e,t){return`
|
|
1158
|
+
<slot name="icon">${Bs(t.seekOffset)}</slot>
|
|
1159
|
+
`}var Hs=(e,t)=>{e.setAttribute(`aria-label`,x(`seek back {seekOffset} seconds`,{seekOffset:t}))};function Us(){return x(`Seek backward`)}var Ws=0,Gs=class extends U{static get observedAttributes(){return[...super.observedAttributes,m.MEDIA_CURRENT_TIME,Rs.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=T(this,Rs.SEEK_OFFSET,zs)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),Hs(this,this.seekOffset),e===Rs.SEEK_OFFSET&&(this.seekOffset=T(this,Rs.SEEK_OFFSET,zs))}get seekOffset(){return T(this,Rs.SEEK_OFFSET,zs)}set seekOffset(e){E(this,Rs.SEEK_OFFSET,e),this.setAttribute(`aria-label`,x(`seek back {seekOffset} seconds`,{seekOffset:this.seekOffset})),Ne(Fe(this,`icon`),this.seekOffset)}get mediaCurrentTime(){return T(this,m.MEDIA_CURRENT_TIME,Ws)}set mediaCurrentTime(e){E(this,m.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new S.CustomEvent(u.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};Gs.getSlotTemplateHTML=Vs,Gs.getTooltipContentHTML=Us,S.customElements.get(`media-seek-backward-button`)||S.customElements.define(`media-seek-backward-button`,Gs);var Ks=Gs,qs={SEEK_OFFSET:`seekoffset`},Js=30,Ys=e=>`
|
|
1160
|
+
<svg aria-hidden="true" viewBox="0 0 20 24">
|
|
1161
|
+
<defs>
|
|
1162
|
+
<style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style>
|
|
1163
|
+
</defs>
|
|
1164
|
+
<text class="text value" transform="translate(8.9 19.87)">${e}</text>
|
|
1165
|
+
<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"/>
|
|
1166
|
+
</svg>`;function Xs(e,t){return`
|
|
1167
|
+
<slot name="icon">${Ys(t.seekOffset)}</slot>
|
|
1168
|
+
`}var Zs=(e,t)=>{e.setAttribute(`aria-label`,x(`seek forward {seekOffset} seconds`,{seekOffset:t}))};function Qs(){return x(`Seek forward`)}var $s=0,ec=class extends U{static get observedAttributes(){return[...super.observedAttributes,m.MEDIA_CURRENT_TIME,qs.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this.seekOffset=T(this,qs.SEEK_OFFSET,Js)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),Zs(this,this.seekOffset),e===qs.SEEK_OFFSET&&(this.seekOffset=T(this,qs.SEEK_OFFSET,Js))}get seekOffset(){return T(this,qs.SEEK_OFFSET,Js)}set seekOffset(e){E(this,qs.SEEK_OFFSET,e),this.setAttribute(`aria-label`,x(`seek forward {seekOffset} seconds`,{seekOffset:this.seekOffset})),Ne(Fe(this,`icon`),this.seekOffset)}get mediaCurrentTime(){return T(this,m.MEDIA_CURRENT_TIME,$s)}set mediaCurrentTime(e){E(this,m.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new S.CustomEvent(u.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};ec.getSlotTemplateHTML=Xs,ec.getTooltipContentHTML=Qs,S.customElements.get(`media-seek-forward-button`)||S.customElements.define(`media-seek-forward-button`,ec);var tc=ec,nc=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},rc=(e,t,n)=>(nc(e,t,`read from private field`),n?n.call(e):t.get(e)),ic=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},ac=(e,t,n,r)=>(nc(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),oc=(e,t,n)=>(nc(e,t,`access private method`),n),sc,cc,lc,uc,dc,fc,pc,mc,hc,gc,_c,vc={REMAINING:`remaining`,SHOW_DURATION:`showduration`,NO_TOGGLE:`notoggle`},yc=[...Object.values(vc),m.MEDIA_CURRENT_TIME,m.MEDIA_DURATION,m.MEDIA_SEEKABLE],bc=[`Enter`,` `],xc=` / `,Sc=(e,{timesSep:t=xc}={})=>{let n=e.mediaCurrentTime??0,[,r]=e.mediaSeekable??[],i=0;Number.isFinite(e.mediaDuration)?i=e.mediaDuration:Number.isFinite(r)&&(i=r);let a=e.remaining?ge(0-(i-n)):ge(n);return e.showDuration?`${a}${t}${ge(i)}`:a},Cc=e=>{let t=e.mediaCurrentTime,[,n]=e.mediaSeekable??[],r=null;if(Number.isFinite(e.mediaDuration)?r=e.mediaDuration:Number.isFinite(n)&&(r=n),t==null||r===null){e.setAttribute(`aria-description`,x(`video not loaded, unknown time.`));return}let i=e.remaining?he(0-(r-t)):he(t);if(!e.showDuration){e.setAttribute(`aria-description`,i);return}let a=x(`{currentTime} of {totalTime}`,{currentTime:i,totalTime:he(r)});e.setAttribute(`aria-description`,a)};function wc(e,t){return`
|
|
1169
|
+
<slot>${Sc(t)}</slot>
|
|
1170
|
+
`}var Tc=e=>{e.setAttribute(`aria-label`,x(`playback time`))},Ec=class extends ya{constructor(){super(),ic(this,uc),ic(this,fc),ic(this,mc),ic(this,gc),ic(this,sc,void 0),ic(this,cc,null),ic(this,lc,e=>{let{metaKey:t,altKey:n,key:r}=e;t||n||!bc.includes(r)?this.removeEventListener(`keyup`,rc(this,cc)):this.addEventListener(`keyup`,rc(this,cc))}),ac(this,sc,this.shadowRoot.querySelector(`slot`)),rc(this,sc).innerHTML=`${Sc(this)}`}static get observedAttributes(){return[...super.observedAttributes,...yc,`disabled`]}connectedCallback(){let{style:e}=w(this.shadowRoot,`:host(:hover:not([notoggle]))`);e.setProperty(`cursor`,`var(--media-cursor, pointer)`),e.setProperty(`background`,`var(--media-control-hover-background, rgba(50 50 70 / .7))`),this.setAttribute(`aria-label`,x(`playback time`)),oc(this,mc,hc).call(this),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute(`remaining`)?this.removeAttribute(`remaining`):this.setAttribute(`remaining`,``))}disconnectedCallback(){this.disable(),oc(this,fc,pc).call(this),super.disconnectedCallback()}attributeChangedCallback(e,t,n){Tc(this),yc.includes(e)?this.update():e===`disabled`&&n!==t?n==null?oc(this,mc,hc).call(this):oc(this,gc,_c).call(this):e===vc.NO_TOGGLE&&n!==t&&(this.noToggle?oc(this,gc,_c).call(this):oc(this,mc,hc).call(this)),super.attributeChangedCallback(e,t,n)}enable(){this.noToggle||(this.tabIndex=0)}disable(){this.tabIndex=-1}get remaining(){return D(this,vc.REMAINING)}set remaining(e){O(this,vc.REMAINING,e)}get showDuration(){return D(this,vc.SHOW_DURATION)}set showDuration(e){O(this,vc.SHOW_DURATION,e)}get noToggle(){return D(this,vc.NO_TOGGLE)}set noToggle(e){O(this,vc.NO_TOGGLE,e)}get mediaDuration(){return T(this,m.MEDIA_DURATION)}set mediaDuration(e){E(this,m.MEDIA_DURATION,e)}get mediaCurrentTime(){return T(this,m.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){E(this,m.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(m.MEDIA_SEEKABLE);if(e)return e.split(`:`).map(e=>+e)}set mediaSeekable(e){e==null?this.removeAttribute(m.MEDIA_SEEKABLE):this.setAttribute(m.MEDIA_SEEKABLE,e.join(`:`))}update(){let e=Sc(this);Cc(this),e!==rc(this,sc).innerHTML&&(rc(this,sc).innerHTML=e)}};sc=new WeakMap,cc=new WeakMap,lc=new WeakMap,uc=new WeakSet,dc=function(){rc(this,cc)||(ac(this,cc,e=>{let{key:t}=e;bc.includes(t)?this.toggleTimeDisplay():this.removeEventListener(`keyup`,rc(this,cc))}),this.addEventListener(`keydown`,rc(this,lc)),this.addEventListener(`click`,this.toggleTimeDisplay))},fc=new WeakSet,pc=function(){rc(this,cc)&&(this.removeEventListener(`keyup`,rc(this,cc)),this.removeEventListener(`keydown`,rc(this,lc)),this.removeEventListener(`click`,this.toggleTimeDisplay),ac(this,cc,null))},mc=new WeakSet,hc=function(){!this.noToggle&&!this.hasAttribute(`disabled`)&&(this.setAttribute(`role`,`button`),this.enable(),oc(this,uc,dc).call(this))},gc=new WeakSet,_c=function(){this.removeAttribute(`role`),this.disable(),oc(this,fc,pc).call(this)},Ec.getSlotTemplateHTML=wc,S.customElements.get(`media-time-display`)||S.customElements.define(`media-time-display`,Ec);var Dc=Ec,Oc=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},K=(e,t,n)=>(Oc(e,t,`read from private field`),n?n.call(e):t.get(e)),kc=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},q=(e,t,n,r)=>(Oc(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),Ac=(e,t,n,r)=>({set _(r){q(e,t,r,n)},get _(){return K(e,t,r)}}),jc,Mc,Nc,Pc,Fc,Ic,Lc,Rc,zc,Bc,Vc=class{constructor(e,t,n){kc(this,jc,void 0),kc(this,Mc,void 0),kc(this,Nc,void 0),kc(this,Pc,void 0),kc(this,Fc,void 0),kc(this,Ic,void 0),kc(this,Lc,void 0),kc(this,Rc,void 0),kc(this,zc,0),kc(this,Bc,(e=performance.now())=>{q(this,zc,requestAnimationFrame(K(this,Bc))),q(this,Pc,performance.now()-K(this,Nc));let t=1e3/this.fps;if(K(this,Pc)>t){q(this,Nc,e-K(this,Pc)%t);let n=1e3/((e-K(this,Mc))/++Ac(this,Fc)._),r=(e-K(this,Ic))/1e3/this.duration,i=K(this,Lc)+r*this.playbackRate;i-K(this,jc).valueAsNumber>0?q(this,Rc,this.playbackRate/this.duration/n):(q(this,Rc,.995*K(this,Rc)),i=K(this,jc).valueAsNumber+K(this,Rc)),this.callback(i)}}),q(this,jc,e),this.callback=t,this.fps=n}start(){K(this,zc)===0&&(q(this,Nc,performance.now()),q(this,Mc,K(this,Nc)),q(this,Fc,0),K(this,Bc).call(this))}stop(){K(this,zc)!==0&&(cancelAnimationFrame(K(this,zc)),q(this,zc,0))}update({start:e,duration:t,playbackRate:n}){let r=e-K(this,jc).valueAsNumber,i=Math.abs(t-this.duration);(r>0||r<-.5/t||i>=.5)&&this.callback(e),q(this,Lc,e),q(this,Ic,performance.now()),this.duration=t,this.playbackRate=n}};jc=new WeakMap,Mc=new WeakMap,Nc=new WeakMap,Pc=new WeakMap,Fc=new WeakMap,Ic=new WeakMap,Lc=new WeakMap,Rc=new WeakMap,zc=new WeakMap,Bc=new WeakMap;var Hc=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},J=(e,t,n)=>(Hc(e,t,`read from private field`),n?n.call(e):t.get(e)),Y=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},X=(e,t,n,r)=>(Hc(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),Z=(e,t,n)=>(Hc(e,t,`access private method`),n),Uc,Wc,Gc,Kc,qc,Jc,Yc,Xc,Zc,Qc,$c,el,tl,nl,rl,il,al,ol,sl,cl,ll,ul,dl,fl,pl,ml,hl=e=>{let t=e.range,n=he(+vl(e)),r=he(+e.mediaSeekableEnd),i=n&&r?x(`{currentTime} of {totalTime}`,{currentTime:n,totalTime:r}):x(`video not loaded, unknown time.`);t.setAttribute(`aria-valuetext`,i)};function gl(e){return`
|
|
1171
|
+
<style>
|
|
1172
|
+
:host {
|
|
1173
|
+
--media-box-border-radius: 4px;
|
|
1174
|
+
--media-box-padding-left: 10px;
|
|
1175
|
+
--media-box-padding-right: 10px;
|
|
1176
|
+
--media-preview-border-radius: var(--media-box-border-radius);
|
|
1177
|
+
--media-box-arrow-offset: var(--media-box-border-radius);
|
|
1178
|
+
--_control-background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));
|
|
1179
|
+
--_preview-background: var(--media-preview-background, var(--_control-background));
|
|
1180
|
+
|
|
1181
|
+
|
|
1182
|
+
contain: layout;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
#buffered {
|
|
1186
|
+
background: var(--media-time-range-buffered-color, rgb(255 255 255 / .4));
|
|
1187
|
+
position: absolute;
|
|
1188
|
+
height: 100%;
|
|
1189
|
+
will-change: width;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
#preview-rail,
|
|
1193
|
+
#current-rail {
|
|
1194
|
+
width: 100%;
|
|
1195
|
+
position: absolute;
|
|
1196
|
+
left: 0;
|
|
1197
|
+
bottom: 100%;
|
|
1198
|
+
pointer-events: none;
|
|
1199
|
+
will-change: transform;
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
[part~="box"] {
|
|
1203
|
+
width: min-content;
|
|
1204
|
+
|
|
1205
|
+
position: absolute;
|
|
1206
|
+
bottom: 100%;
|
|
1207
|
+
flex-direction: column;
|
|
1208
|
+
align-items: center;
|
|
1209
|
+
transform: translateX(-50%);
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
[part~="current-box"] {
|
|
1213
|
+
display: var(--media-current-box-display, var(--media-box-display, flex));
|
|
1214
|
+
margin: var(--media-current-box-margin, var(--media-box-margin, 0 0 5px));
|
|
1215
|
+
visibility: hidden;
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
[part~="preview-box"] {
|
|
1219
|
+
display: var(--media-preview-box-display, var(--media-box-display, flex));
|
|
1220
|
+
margin: var(--media-preview-box-margin, var(--media-box-margin, 0 0 5px));
|
|
1221
|
+
transition-property: var(--media-preview-transition-property, visibility, opacity);
|
|
1222
|
+
transition-duration: var(--media-preview-transition-duration-out, .25s);
|
|
1223
|
+
transition-delay: var(--media-preview-transition-delay-out, 0s);
|
|
1224
|
+
visibility: hidden;
|
|
1225
|
+
opacity: 0;
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
:host(:is([${m.MEDIA_PREVIEW_IMAGE}], [${m.MEDIA_PREVIEW_TIME}])[dragging]) [part~="preview-box"] {
|
|
1229
|
+
transition-duration: var(--media-preview-transition-duration-in, .5s);
|
|
1230
|
+
transition-delay: var(--media-preview-transition-delay-in, .25s);
|
|
1231
|
+
visibility: visible;
|
|
1232
|
+
opacity: 1;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
@media (hover: hover) {
|
|
1236
|
+
:host(:is([${m.MEDIA_PREVIEW_IMAGE}], [${m.MEDIA_PREVIEW_TIME}]):hover) [part~="preview-box"] {
|
|
1237
|
+
transition-duration: var(--media-preview-transition-duration-in, .5s);
|
|
1238
|
+
transition-delay: var(--media-preview-transition-delay-in, .25s);
|
|
1239
|
+
visibility: visible;
|
|
1240
|
+
opacity: 1;
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
media-preview-thumbnail,
|
|
1245
|
+
::slotted(media-preview-thumbnail) {
|
|
1246
|
+
visibility: hidden;
|
|
1247
|
+
|
|
1248
|
+
transition: visibility 0s .25s;
|
|
1249
|
+
transition-delay: calc(var(--media-preview-transition-delay-out, 0s) + var(--media-preview-transition-duration-out, .25s));
|
|
1250
|
+
background: var(--media-preview-thumbnail-background, var(--_preview-background));
|
|
1251
|
+
box-shadow: var(--media-preview-thumbnail-box-shadow, 0 0 4px rgb(0 0 0 / .2));
|
|
1252
|
+
max-width: var(--media-preview-thumbnail-max-width, 180px);
|
|
1253
|
+
max-height: var(--media-preview-thumbnail-max-height, 160px);
|
|
1254
|
+
min-width: var(--media-preview-thumbnail-min-width, 120px);
|
|
1255
|
+
min-height: var(--media-preview-thumbnail-min-height, 80px);
|
|
1256
|
+
border: var(--media-preview-thumbnail-border);
|
|
1257
|
+
border-radius: var(--media-preview-thumbnail-border-radius,
|
|
1258
|
+
var(--media-preview-border-radius) var(--media-preview-border-radius) 0 0);
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
:host([${m.MEDIA_PREVIEW_IMAGE}][dragging]) media-preview-thumbnail,
|
|
1262
|
+
:host([${m.MEDIA_PREVIEW_IMAGE}][dragging]) ::slotted(media-preview-thumbnail) {
|
|
1263
|
+
transition-delay: var(--media-preview-transition-delay-in, .25s);
|
|
1264
|
+
visibility: visible;
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
@media (hover: hover) {
|
|
1268
|
+
:host([${m.MEDIA_PREVIEW_IMAGE}]:hover) media-preview-thumbnail,
|
|
1269
|
+
:host([${m.MEDIA_PREVIEW_IMAGE}]:hover) ::slotted(media-preview-thumbnail) {
|
|
1270
|
+
transition-delay: var(--media-preview-transition-delay-in, .25s);
|
|
1271
|
+
visibility: visible;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
:host([${m.MEDIA_PREVIEW_TIME}]:hover) {
|
|
1275
|
+
--media-time-range-hover-display: block;
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
media-preview-chapter-display,
|
|
1280
|
+
::slotted(media-preview-chapter-display) {
|
|
1281
|
+
font-size: var(--media-font-size, 13px);
|
|
1282
|
+
line-height: 17px;
|
|
1283
|
+
min-width: 0;
|
|
1284
|
+
visibility: hidden;
|
|
1285
|
+
|
|
1286
|
+
transition: min-width 0s, border-radius 0s, margin 0s, padding 0s, visibility 0s;
|
|
1287
|
+
transition-delay: calc(var(--media-preview-transition-delay-out, 0s) + var(--media-preview-transition-duration-out, .25s));
|
|
1288
|
+
background: var(--media-preview-chapter-background, var(--_preview-background));
|
|
1289
|
+
border-radius: var(--media-preview-chapter-border-radius,
|
|
1290
|
+
var(--media-preview-border-radius) var(--media-preview-border-radius)
|
|
1291
|
+
var(--media-preview-border-radius) var(--media-preview-border-radius));
|
|
1292
|
+
padding: var(--media-preview-chapter-padding, 3.5px 9px);
|
|
1293
|
+
margin: var(--media-preview-chapter-margin, 0 0 5px);
|
|
1294
|
+
text-shadow: var(--media-preview-chapter-text-shadow, 0 0 4px rgb(0 0 0 / .75));
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
:host([${m.MEDIA_PREVIEW_IMAGE}]) media-preview-chapter-display,
|
|
1298
|
+
:host([${m.MEDIA_PREVIEW_IMAGE}]) ::slotted(media-preview-chapter-display) {
|
|
1299
|
+
transition-delay: var(--media-preview-transition-delay-in, .25s);
|
|
1300
|
+
border-radius: var(--media-preview-chapter-border-radius, 0);
|
|
1301
|
+
padding: var(--media-preview-chapter-padding, 3.5px 9px 0);
|
|
1302
|
+
margin: var(--media-preview-chapter-margin, 0);
|
|
1303
|
+
min-width: 100%;
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
media-preview-chapter-display[${m.MEDIA_PREVIEW_CHAPTER}],
|
|
1307
|
+
::slotted(media-preview-chapter-display[${m.MEDIA_PREVIEW_CHAPTER}]) {
|
|
1308
|
+
visibility: visible;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
media-preview-chapter-display:not([aria-valuetext]),
|
|
1312
|
+
::slotted(media-preview-chapter-display:not([aria-valuetext])) {
|
|
1313
|
+
display: none;
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
media-preview-time-display,
|
|
1317
|
+
::slotted(media-preview-time-display),
|
|
1318
|
+
media-time-display,
|
|
1319
|
+
::slotted(media-time-display) {
|
|
1320
|
+
font-size: var(--media-font-size, 13px);
|
|
1321
|
+
line-height: 17px;
|
|
1322
|
+
min-width: 0;
|
|
1323
|
+
|
|
1324
|
+
transition: min-width 0s, border-radius 0s;
|
|
1325
|
+
transition-delay: calc(var(--media-preview-transition-delay-out, 0s) + var(--media-preview-transition-duration-out, .25s));
|
|
1326
|
+
background: var(--media-preview-time-background, var(--_preview-background));
|
|
1327
|
+
border-radius: var(--media-preview-time-border-radius,
|
|
1328
|
+
var(--media-preview-border-radius) var(--media-preview-border-radius)
|
|
1329
|
+
var(--media-preview-border-radius) var(--media-preview-border-radius));
|
|
1330
|
+
padding: var(--media-preview-time-padding, 3.5px 9px);
|
|
1331
|
+
margin: var(--media-preview-time-margin, 0);
|
|
1332
|
+
text-shadow: var(--media-preview-time-text-shadow, 0 0 4px rgb(0 0 0 / .75));
|
|
1333
|
+
transform: translateX(min(
|
|
1334
|
+
max(calc(50% - var(--_box-width) / 2),
|
|
1335
|
+
calc(var(--_box-shift, 0))),
|
|
1336
|
+
calc(var(--_box-width) / 2 - 50%)
|
|
1337
|
+
));
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
:host([${m.MEDIA_PREVIEW_IMAGE}]) media-preview-time-display,
|
|
1341
|
+
:host([${m.MEDIA_PREVIEW_IMAGE}]) ::slotted(media-preview-time-display) {
|
|
1342
|
+
transition-delay: var(--media-preview-transition-delay-in, .25s);
|
|
1343
|
+
border-radius: var(--media-preview-time-border-radius,
|
|
1344
|
+
0 0 var(--media-preview-border-radius) var(--media-preview-border-radius));
|
|
1345
|
+
min-width: 100%;
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
:host([${m.MEDIA_PREVIEW_TIME}]:hover) {
|
|
1349
|
+
--media-time-range-hover-display: block;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
[part~="arrow"],
|
|
1353
|
+
::slotted([part~="arrow"]) {
|
|
1354
|
+
display: var(--media-box-arrow-display, inline-block);
|
|
1355
|
+
transform: translateX(min(
|
|
1356
|
+
max(calc(50% - var(--_box-width) / 2 + var(--media-box-arrow-offset)),
|
|
1357
|
+
calc(var(--_box-shift, 0))),
|
|
1358
|
+
calc(var(--_box-width) / 2 - 50% - var(--media-box-arrow-offset))
|
|
1359
|
+
));
|
|
1360
|
+
|
|
1361
|
+
border-color: transparent;
|
|
1362
|
+
border-top-color: var(--media-box-arrow-background, var(--_control-background));
|
|
1363
|
+
border-width: var(--media-box-arrow-border-width,
|
|
1364
|
+
var(--media-box-arrow-height, 5px) var(--media-box-arrow-width, 6px) 0);
|
|
1365
|
+
border-style: solid;
|
|
1366
|
+
justify-content: center;
|
|
1367
|
+
height: 0;
|
|
1368
|
+
}
|
|
1369
|
+
</style>
|
|
1370
|
+
<div id="preview-rail">
|
|
1371
|
+
<slot name="preview" part="box preview-box">
|
|
1372
|
+
<media-preview-thumbnail>
|
|
1373
|
+
<template shadowrootmode="${As.shadowRootOptions.mode}">
|
|
1374
|
+
${As.getTemplateHTML({})}
|
|
1375
|
+
</template>
|
|
1376
|
+
</media-preview-thumbnail>
|
|
1377
|
+
<media-preview-chapter-display></media-preview-chapter-display>
|
|
1378
|
+
<media-preview-time-display></media-preview-time-display>
|
|
1379
|
+
<slot name="preview-arrow"><div part="arrow"></div></slot>
|
|
1380
|
+
</slot>
|
|
1381
|
+
</div>
|
|
1382
|
+
<div id="current-rail">
|
|
1383
|
+
<slot name="current" part="box current-box">
|
|
1384
|
+
|
|
1385
|
+
</slot>
|
|
1386
|
+
</div>
|
|
1387
|
+
`}var _l=(e,t=e.mediaCurrentTime)=>{let n=Number.isFinite(e.mediaSeekableStart)?e.mediaSeekableStart:0,r=Number.isFinite(e.mediaDuration)?e.mediaDuration:e.mediaSeekableEnd;if(Number.isNaN(r))return 0;let i=(t-n)/(r-n);return Math.max(0,Math.min(i,1))},vl=(e,t=e.range.valueAsNumber)=>{let n=Number.isFinite(e.mediaSeekableStart)?e.mediaSeekableStart:0,r=Number.isFinite(e.mediaDuration)?e.mediaDuration:e.mediaSeekableEnd;return Number.isNaN(r)?0:t*(r-n)+n},yl=class extends na{constructor(){super(),Y(this,el),Y(this,rl),Y(this,al),Y(this,sl),Y(this,ll),Y(this,dl),Y(this,pl),Y(this,Uc,null),Y(this,Wc,void 0),Y(this,Gc,void 0),Y(this,Kc,void 0),Y(this,qc,void 0),Y(this,Jc,void 0),Y(this,Yc,void 0),Y(this,Xc,void 0),Y(this,Zc,void 0),Y(this,Qc,void 0),Y(this,$c,()=>{Z(this,el,tl).call(this)?J(this,Wc).start():J(this,Wc).stop()}),Y(this,nl,e=>{this.dragging||(oe(e)&&(this.range.valueAsNumber=e),J(this,Qc)||this.updateBar())}),this.shadowRoot.querySelector(`#track`).insertAdjacentHTML(`afterbegin`,`<div id="buffered" part="buffered"></div>`),X(this,Gc,this.shadowRoot.querySelectorAll(`[part~="box"]`)),X(this,qc,this.shadowRoot.querySelector(`[part~="preview-box"]`)),X(this,Jc,this.shadowRoot.querySelector(`[part~="current-box"]`));let e=getComputedStyle(this);X(this,Yc,parseInt(e.getPropertyValue(`--media-box-padding-left`))),X(this,Xc,parseInt(e.getPropertyValue(`--media-box-padding-right`))),X(this,Wc,new Vc(this.range,J(this,nl),60))}static get observedAttributes(){return[...super.observedAttributes,m.MEDIA_PAUSED,m.MEDIA_DURATION,m.MEDIA_SEEKABLE,m.MEDIA_CURRENT_TIME,m.MEDIA_PREVIEW_IMAGE,m.MEDIA_PREVIEW_TIME,m.MEDIA_PREVIEW_CHAPTER,m.MEDIA_BUFFERED,m.MEDIA_PLAYBACK_RATE,m.MEDIA_LOADING,m.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute(`aria-label`,x(`seek`)),J(this,$c).call(this),X(this,Uc,this.getRootNode()),(e=J(this,Uc))==null||e.addEventListener(`transitionstart`,this)}disconnectedCallback(){var e;super.disconnectedCallback(),J(this,Wc).stop(),(e=J(this,Uc))==null||e.removeEventListener(`transitionstart`,this),X(this,Uc,null)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),t!=n&&(e===m.MEDIA_CURRENT_TIME||e===m.MEDIA_PAUSED||e===m.MEDIA_ENDED||e===m.MEDIA_LOADING||e===m.MEDIA_DURATION||e===m.MEDIA_SEEKABLE?(J(this,Wc).update({start:_l(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),J(this,$c).call(this),hl(this)):e===m.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===m.MEDIA_DURATION||e===m.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=J(this,Zc),this.updateBar()))}get mediaChaptersCues(){return J(this,Zc)}set mediaChaptersCues(e){X(this,Zc,e),this.updateSegments(J(this,Zc)?.map(e=>({start:_l(this,e.startTime),end:_l(this,e.endTime)})))}get mediaPaused(){return D(this,m.MEDIA_PAUSED)}set mediaPaused(e){O(this,m.MEDIA_PAUSED,e)}get mediaLoading(){return D(this,m.MEDIA_LOADING)}set mediaLoading(e){O(this,m.MEDIA_LOADING,e)}get mediaDuration(){return T(this,m.MEDIA_DURATION)}set mediaDuration(e){E(this,m.MEDIA_DURATION,e)}get mediaCurrentTime(){return T(this,m.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){E(this,m.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return T(this,m.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){E(this,m.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(m.MEDIA_BUFFERED);return e?e.split(` `).map(e=>e.split(`:`).map(e=>+e)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(m.MEDIA_BUFFERED);return}let t=e.map(e=>e.join(`:`)).join(` `);this.setAttribute(m.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(m.MEDIA_SEEKABLE);if(e)return e.split(`:`).map(e=>+e)}set mediaSeekable(e){e==null?this.removeAttribute(m.MEDIA_SEEKABLE):this.setAttribute(m.MEDIA_SEEKABLE,e.join(`:`))}get mediaSeekableEnd(){let[,e=this.mediaDuration]=this.mediaSeekable??[];return e}get mediaSeekableStart(){let[e=0]=this.mediaSeekable??[];return e}get mediaPreviewImage(){return k(this,m.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){A(this,m.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return T(this,m.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){E(this,m.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return D(this,m.MEDIA_ENDED)}set mediaEnded(e){O(this,m.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){let e=this.mediaBuffered;if(!e.length)return;let t;if(this.mediaEnded)t=1;else{let n=this.mediaCurrentTime,[,r=this.mediaSeekableStart]=e.find(([e,t])=>e<=n&&n<=t)??[];t=_l(this,r)}let{style:n}=w(this.shadowRoot,`#buffered`);n.setProperty(`width`,`${t*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector(`slot[name="current"]`).assignedElements().length)return;let e=w(this.shadowRoot,`#current-rail`),t=w(this.shadowRoot,`[part~="current-box"]`),n=Z(this,rl,il).call(this,J(this,Jc)),r=Z(this,al,ol).call(this,n,this.range.valueAsNumber),i=Z(this,sl,cl).call(this,n,this.range.valueAsNumber);e.style.transform=`translateX(${r})`,e.style.setProperty(`--_range-width`,`${n.range.width}`),t.style.setProperty(`--_box-shift`,`${i}`),t.style.setProperty(`--_box-width`,`${n.box.width}px`),t.style.setProperty(`visibility`,`initial`)}handleEvent(e){switch(super.handleEvent(e),e.type){case`input`:Z(this,pl,ml).call(this);break;case`pointermove`:Z(this,ll,ul).call(this,e);break;case`pointerup`:J(this,Qc)&&X(this,Qc,!1);break;case`pointerdown`:X(this,Qc,!0);break;case`pointerleave`:Z(this,dl,fl).call(this,null);break;case`transitionstart`:Ie(e.target,this)&&setTimeout(()=>J(this,$c).call(this),0)}}};Uc=new WeakMap,Wc=new WeakMap,Gc=new WeakMap,Kc=new WeakMap,qc=new WeakMap,Jc=new WeakMap,Yc=new WeakMap,Xc=new WeakMap,Zc=new WeakMap,Qc=new WeakMap,$c=new WeakMap,el=new WeakSet,tl=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&Be(this)},nl=new WeakMap,rl=new WeakSet,il=function(e){let t=((this.getAttribute(`bounds`)?Le(this,`#${this.getAttribute(`bounds`)}`):this.parentElement)??this).getBoundingClientRect(),n=this.range.getBoundingClientRect(),r=e.offsetWidth;return{box:{width:r,min:-(n.left-t.left-r/2),max:t.right-n.left-r/2},bounds:t,range:n}},al=new WeakSet,ol=function(e,t){let n=`${t*100}%`,{width:r,min:i,max:a}=e.box;if(!r)return n;if(Number.isNaN(i)||(n=`max(${`calc(1 / var(--_range-width) * 100 * ${i}% + var(--media-box-padding-left))`}, ${n})`),!Number.isNaN(a)){let e=`calc(1 / var(--_range-width) * 100 * ${a}% - var(--media-box-padding-right))`;n=`min(${n}, ${e})`}return n},sl=new WeakSet,cl=function(e,t){let{width:n,min:r,max:i}=e.box,a=t*e.range.width;if(a<r+J(this,Yc)){let t=e.range.left-e.bounds.left-J(this,Yc);return`${a-n/2+t}px`}if(a>i-J(this,Xc)){let t=e.bounds.right-e.range.right-J(this,Xc);return`${a+n/2-t-e.range.width}px`}return 0},ll=new WeakSet,ul=function(e){let t=[...J(this,Gc)].some(t=>e.composedPath().includes(t));if(!this.dragging&&(t||!e.composedPath().includes(this))){Z(this,dl,fl).call(this,null);return}let n=this.mediaSeekableEnd;if(!n)return;let r=w(this.shadowRoot,`#preview-rail`),i=w(this.shadowRoot,`[part~="preview-box"]`),a=Z(this,rl,il).call(this,J(this,qc)),o=(e.clientX-a.range.left)/a.range.width;o=Math.max(0,Math.min(1,o));let s=Z(this,al,ol).call(this,a,o),c=Z(this,sl,cl).call(this,a,o);r.style.transform=`translateX(${s})`,r.style.setProperty(`--_range-width`,`${a.range.width}`),i.style.setProperty(`--_box-shift`,`${c}`),i.style.setProperty(`--_box-width`,`${a.box.width}px`);let l=Math.round(J(this,Kc))-Math.round(o*n);Math.abs(l)<1&&o>.01&&o<.99||(X(this,Kc,o*n),Z(this,dl,fl).call(this,J(this,Kc)))},dl=new WeakSet,fl=function(e){this.dispatchEvent(new S.CustomEvent(u.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:e}))},pl=new WeakSet,ml=function(){J(this,Wc).stop();let e=vl(this);this.dispatchEvent(new S.CustomEvent(u.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e}))},yl.shadowRootOptions={mode:`open`},yl.getContainerTemplateHTML=gl,S.customElements.get(`media-time-range`)||S.customElements.define(`media-time-range`,yl);var bl=yl,xl=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},Sl=(e,t,n)=>(xl(e,t,`read from private field`),n?n.call(e):t.get(e)),Cl=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},wl,Tl=1,El=e=>e.mediaMuted?0:e.mediaVolume,Dl=e=>`${Math.round(e*100)}%`,Ol=class extends na{constructor(){super(...arguments),Cl(this,wl,()=>{let e=this.range.value,t=new S.CustomEvent(u.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}static get observedAttributes(){return[...super.observedAttributes,m.MEDIA_VOLUME,m.MEDIA_MUTED,m.MEDIA_VOLUME_UNAVAILABLE]}connectedCallback(){super.connectedCallback(),this.range.setAttribute(`aria-label`,x(`volume`)),this.range.addEventListener(`input`,Sl(this,wl))}disconnectedCallback(){this.range.removeEventListener(`input`,Sl(this,wl)),super.disconnectedCallback()}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),(e===m.MEDIA_VOLUME||e===m.MEDIA_MUTED)&&(this.range.valueAsNumber=El(this),this.range.setAttribute(`aria-valuetext`,Dl(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return T(this,m.MEDIA_VOLUME,Tl)}set mediaVolume(e){E(this,m.MEDIA_VOLUME,e)}get mediaMuted(){return D(this,m.MEDIA_MUTED)}set mediaMuted(e){O(this,m.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return k(this,m.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){A(this,m.MEDIA_VOLUME_UNAVAILABLE,e)}};wl=new WeakMap,S.customElements.get(`media-volume-range`)||S.customElements.define(`media-volume-range`,Ol);var kl=Ol;function Al(e){return`
|
|
1388
|
+
<style>
|
|
1389
|
+
:host {
|
|
1390
|
+
min-width: 4ch;
|
|
1391
|
+
padding: var(--media-button-padding, var(--media-control-padding, 10px 5px));
|
|
1392
|
+
width: 100%;
|
|
1393
|
+
display: grid;
|
|
1394
|
+
grid-template-columns: 1fr auto;
|
|
1395
|
+
gap: 1rem;
|
|
1396
|
+
font-weight: var(--media-button-font-weight, normal);
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
#checked-indicator {
|
|
1400
|
+
display: none;
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
:host([${m.MEDIA_LOOP}]) #checked-indicator {
|
|
1404
|
+
display: block;
|
|
1405
|
+
}
|
|
1406
|
+
</style>
|
|
1407
|
+
|
|
1408
|
+
<span id="icon">
|
|
1409
|
+
</span>
|
|
1410
|
+
|
|
1411
|
+
<div id="checked-indicator">
|
|
1412
|
+
<svg aria-hidden="true" viewBox="0 1 24 24" part="checked-indicator indicator">
|
|
1413
|
+
<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"/>
|
|
1414
|
+
</svg>
|
|
1415
|
+
</div>
|
|
1416
|
+
`}function jl(){return x(`Loop`)}var Ml=class extends U{constructor(){super(...arguments),this.container=null}static get observedAttributes(){return[...super.observedAttributes,m.MEDIA_LOOP]}connectedCallback(){super.connectedCallback(),this.container=this.shadowRoot?.querySelector(`#icon`)||null,this.container&&(this.container.textContent=x(`Loop`))}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===m.MEDIA_LOOP&&this.container&&this.setAttribute(`aria-checked`,this.mediaLoop?`true`:`false`)}get mediaLoop(){return D(this,m.MEDIA_LOOP)}set mediaLoop(e){O(this,m.MEDIA_LOOP,e)}handleClick(){let e=!this.mediaLoop,t=new S.CustomEvent(u.MEDIA_LOOP_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};Ml.getSlotTemplateHTML=Al,Ml.getTooltipContentHTML=jl,S.customElements.get(`media-loop-button`)||S.customElements.define(`media-loop-button`,Ml);var Nl=Ml;function Q(e){if(typeof e==`boolean`)return e?``:void 0;if(typeof e!=`function`){if(Array.isArray(e)&&e.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`))return e.join(` `);if(!(typeof e==`object`&&e))return e}}c({tagName:`media-gesture-receiver`,elementClass:Ze,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}}),c({tagName:`media-container`,elementClass:Dt,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}});var Pl=c({tagName:`media-controller`,elementClass:fr,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}});c({tagName:`media-tooltip`,elementClass:gr,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}}),c({tagName:`media-chrome-button`,elementClass:Mr,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}}),c({tagName:`media-airplay-button`,elementClass:Rr,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}}),c({tagName:`media-captions-button`,elementClass:qr,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}}),c({tagName:`media-cast-button`,elementClass:ei,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}}),c({tagName:`media-chrome-dialog`,elementClass:Ti,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}}),c({tagName:`media-chrome-range`,elementClass:ra,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}});var Fl=c({tagName:`media-control-bar`,elementClass:da,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}});c({tagName:`media-text-display`,elementClass:ba,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}}),c({tagName:`media-duration-display`,elementClass:Oa,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}}),c({tagName:`media-error-dialog`,elementClass:Ha,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}}),c({tagName:`media-keyboard-shortcuts-dialog`,elementClass:Za,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}});var Il=c({tagName:`media-fullscreen-button`,elementClass:lo,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}});c({tagName:`media-live-button`,elementClass:yo,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}});var Ll=c({tagName:`media-loading-indicator`,elementClass:jo,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}}),Rl=c({tagName:`media-mute-button`,elementClass:zo,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}}),zl=c({tagName:`media-pip-button`,elementClass:Go,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}}),Bl=c({tagName:`media-playback-rate-button`,elementClass:ns,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}}),Vl=c({tagName:`media-play-button`,elementClass:ls,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}});c({tagName:`media-poster-image`,elementClass:hs,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}}),c({tagName:`media-preview-chapter-display`,elementClass:Ss,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}}),c({tagName:`media-preview-thumbnail`,elementClass:As,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}}),c({tagName:`media-preview-time-display`,elementClass:Ls,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}});var Hl=c({tagName:`media-seek-backward-button`,elementClass:Ks,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}}),Ul=c({tagName:`media-seek-forward-button`,elementClass:tc,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}}),Wl=c({tagName:`media-time-display`,elementClass:Dc,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}}),Gl=c({tagName:`media-time-range`,elementClass:bl,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}}),Kl=c({tagName:`media-volume-range`,elementClass:kl,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}});c({tagName:`media-loop-button`,elementClass:Nl,react:r.default,toAttributeValue:Q,defaultProps:{suppressHydrationWarning:!0}});var $=n();function ql(e){return(0,$.jsxs)(Pl,{className:`size-full outline-none [--media-background-color:black] [--media-control-background:transparent] [--media-control-hover-background:rgb(255_255_255/12%)] [--media-font-family:inherit] [--media-range-track-border-radius:9999px]`,children:[(0,$.jsx)(`video`,{slot:`media`,src:e.src,"aria-label":e.label,autoPlay:!0,playsInline:!0,preload:`auto`,className:`size-full object-contain`}),(0,$.jsx)(Ll,{slot:`centered-chrome`,noAutohide:!0}),(0,$.jsxs)(Fl,{className:`w-full bg-linear-to-t from-black/70 to-transparent px-2 pt-6 pb-1 *:p-2.5`,children:[(0,$.jsx)(Vl,{}),(0,$.jsx)(Hl,{seekOffset:10}),(0,$.jsx)(Ul,{seekOffset:10}),(0,$.jsx)(Gl,{className:`grow`}),(0,$.jsx)(Wl,{showDuration:!0}),(0,$.jsx)(Rl,{}),(0,$.jsx)(Kl,{}),(0,$.jsx)(Bl,{}),(0,$.jsx)(zl,{}),(0,$.jsx)(Il,{})]})]})}export{ql as VideoPlayer};
|