@banou/ftube 0.0.0-stage → 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +44 -2
- package/__yt_engine__/engine.html +9 -0
- package/app.webmanifest +31 -0
- package/assets/account-BL8Hv7lS.js +157 -0
- package/assets/account-By94iboj.js +1 -0
- package/assets/account-DfiXzypA-YE6OyKjK.js +1 -0
- package/assets/account-generation-BP_-Qyck-BOth6YQ_.js +1 -0
- package/assets/agent-source-E4g0cDzU.js +1 -0
- package/assets/api-1NDCtwel-CAaxX8P1.js +3 -0
- package/assets/binary-encoding-By5K7InN.js +1 -0
- package/assets/build-CNn3bm6X.js +1 -0
- package/assets/busy-C1JPjoZ_-CJ0641jK.js +1 -0
- package/assets/cards-Csel8naI.js +2334 -0
- package/assets/channel-B5f9YTIf.js +1160 -0
- package/assets/client-version-D9kIz6Gz.js +1 -0
- package/assets/comments-CJp9O808.js +612 -0
- package/assets/dislikes-DH5jCVEY.js +1 -0
- package/assets/dist-7VpLCl1k.js +1 -0
- package/assets/dist-BOrL1gYg.js +2 -0
- package/assets/downloads-CMXDjA_E.js +191 -0
- package/assets/egress.worker-DopXr5uP.js +104 -0
- package/assets/engine-B_kFyW7L.js +2 -0
- package/assets/feed-channels-Dg2mvF5x.js +251 -0
- package/assets/feed-groups-CnyR4sOO.js +160 -0
- package/assets/feed-history-BDAGG9N5.js +368 -0
- package/assets/feed-playlists-DcGR2AL6.js +167 -0
- package/assets/feed-subscriptions-Sm3tKz4P.js +165 -0
- package/assets/feed-you-lxbqknXX.js +110 -0
- package/assets/formats-CDwXfKnr.js +1 -0
- package/assets/frame-BrGNSf3s.js +2 -0
- package/assets/fs-CjRTQ7Nu.js +1 -0
- package/assets/fs-CwRtKje1-CBsYhX2-.js +1 -0
- package/assets/fullscreen-view-BLgosU84.js +269 -0
- package/assets/group-C00s0aT7.js +183 -0
- package/assets/groups-button-CvVnqwlu.js +25 -0
- package/assets/hashtag-CCIhITaL.js +115 -0
- package/assets/icons-DKsqNLSs.js +1 -0
- package/assets/index-A5dHbptn.css +1 -0
- package/assets/index-DwsYJ-bu.js +1328 -0
- package/assets/lib-h0P14ZFl.js +70 -0
- package/assets/linkify-B6hdFhsL.js +1 -0
- package/assets/packages-C3w3tSjj-BCtDk0vj.js +1 -0
- package/assets/party-CUcxsJDF.js +180 -0
- package/assets/playlist-DF7wsidw.js +521 -0
- package/assets/playlist-card-Btoc7D8f.js +91 -0
- package/assets/playlist-panel-D97BwT1f.js +199 -0
- package/assets/post-CQ9mfVos.js +39 -0
- package/assets/post-card-ZUQixO1G.js +76 -0
- package/assets/privacy-hkbqXFeB.js +46 -0
- package/assets/protobuf-BXZ2dCCc.js +1 -0
- package/assets/read-more-BhddUSlS.js +20 -0
- package/assets/rich-text-07paR5O3.js +25 -0
- package/assets/roboto-cyrillic-ext-BCp_3N7R.woff2 +0 -0
- package/assets/roboto-cyrillic-fOt7epNf.woff2 +0 -0
- package/assets/roboto-greek-DlT9XTxE.woff2 +0 -0
- package/assets/roboto-greek-ext-Bgw4czJT.woff2 +0 -0
- package/assets/roboto-latin-ccAYIvAh.woff2 +0 -0
- package/assets/roboto-latin-ext-DYIxWhlt.woff2 +0 -0
- package/assets/roboto-math-4a3xuzGk.woff2 +0 -0
- package/assets/roboto-symbols-B7iHSfaG.woff2 +0 -0
- package/assets/roboto-vietnamese-_f1XEJpo.woff2 +0 -0
- package/assets/rooms-B-AvBY-c-FNDqRDHE.js +1 -0
- package/assets/rooms-B91zuirR.js +1 -0
- package/assets/save-menu-DF1WKqSE.js +462 -0
- package/assets/search-Cx5IpDtZ.js +1026 -0
- package/assets/settings-kESE_uBm.js +99 -0
- package/assets/shaka-BwT9pJcV.js +36 -0
- package/assets/share-dialog-Cp0BJ6bg.js +156 -0
- package/assets/shorts-BxDB7m0c.js +686 -0
- package/assets/shorts-grid-Bgbkl5dP.js +11 -0
- package/assets/sign-in-Bx3zmj-m.js +97 -0
- package/assets/signed-out-prompt-CEAx65kq.js +79 -0
- package/assets/signin-DkI8Ogzz.js +18 -0
- package/assets/social-bXt3vmd4.js +1 -0
- package/assets/video-card-compact-r-K4XyDb.js +190 -0
- package/assets/watch-CkxSP1IA.js +1802 -0
- package/assets/web-BNanCsH5.js +43 -0
- package/favicon.ico +0 -0
- package/favicon.svg +5 -0
- package/icons/icon-192.png +0 -0
- package/icons/icon-512.png +0 -0
- package/index-Bj-Q3X8Q.js +4120 -0
- package/index.html +32 -0
- package/package.json +45 -4
- package/store/background.webp +0 -0
- package/store/channel.webp +0 -0
- package/store/cover.webp +0 -0
- package/store/phone.webp +0 -0
- package/store/search.webp +0 -0
- package/store/watch.webp +0 -0
|
@@ -0,0 +1,2334 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/shaka-BwT9pJcV.js","assets/dist-BOrL1gYg.js","assets/formats-CDwXfKnr.js","assets/binary-encoding-By5K7InN.js","index-Bj-Q3X8Q.js","assets/build-CNn3bm6X.js","assets/icons-DKsqNLSs.js","assets/sign-in-Bx3zmj-m.js","assets/index-A5dHbptn.css","assets/dist-7VpLCl1k.js","assets/fullscreen-view-BLgosU84.js","assets/comments-CJp9O808.js","assets/read-more-BhddUSlS.js","assets/rich-text-07paR5O3.js","assets/save-menu-DF1WKqSE.js","assets/share-dialog-Cp0BJ6bg.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,d as t,o as n,r}from"./dist-BOrL1gYg.js";import{D as i}from"./build-CNn3bm6X.js";import{$ as a,A as o,At as s,Bt as c,C as l,D as u,F as d,Ft as f,H as p,It as m,J as h,Kt as g,L as _,Lt as v,M as ee,Mt as y,Nt as b,Ot as te,Rt as ne,Z as x,Zt as S,_ as C,a as re,an as w,b as ie,bt as ae,cn as T,dn as oe,en as E,et as se,fn as D,hn as ce,i as le,in as O,jt as ue,kt as de,ln as fe,m as pe,mn as k,n as A,nn as j,o as me,on as M,pn as he,rn as ge,sn as N,tn as P,ut as F,vt as _e,w as ve,wt as ye,yt as be,zt as xe}from"./icons-DKsqNLSs.js";import{C as Se,O as Ce,_ as I,a as L,c as R,d as we,g as Te,k as z,o as B,ot as V,p as Ee,s as H,t as De,v as Oe,y as ke}from"./sign-in-Bx3zmj-m.js";k(),N(),S();var Ae=new Intl.NumberFormat(`en`,{notation:`compact`}),je=e=>Ae.format(e),Me=e=>{try{return decodeURIComponent(e)}catch{return e}},Ne=e=>{if(e)return/^\d+$/.test(e)?`${je(Number(e))} views`:e},Pe=e=>{if(e==null||e<=0)return;let t=Math.floor(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}:${String(r).padStart(2,`0`)}:${String(i).padStart(2,`0`)}`:`${r}:${String(i).padStart(2,`0`)}`},U=new Intl.RelativeTimeFormat(`en`,{numeric:`always`}),Fe=[[`year`,31536e3],[`month`,2592e3],[`week`,604800],[`day`,86400],[`hour`,3600],[`minute`,60]],W=(e,t=Date.now())=>{let n=e?Date.parse(e):NaN;if(Number.isNaN(n))return;let r=Math.max(0,(t-n)/1e3),[i,a]=Fe.find(([,e])=>r>=e)??[`second`,1];return U.format(-Math.floor(r/a),i)},Ie=(e,t)=>`${e} ${t}${e===1?``:`s`}`,Le=(e,t=!1)=>e.byline?.length?`names`:e.channel&&!t?`channel`:void 0,Re=(e,t)=>{let n=[Ne(e),t??void 0].filter(e=>e!==void 0);return n.length>0?n.join(` • `):void 0},ze=({expanded:e,viewCountText:t,shortViewCountText:n,publishedDateText:r,relativeDateText:i})=>(e?[t??n,r??i]:[n??t,i??r]).filter(e=>e).join(` `),Be=e=>{if(!e)return;let t=e.trim();if(/^\d+s?$/.test(t)){let e=Number.parseInt(t,10);return Number.isFinite(e)?e:void 0}let n=t.match(/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/);if(!n||n[0]===``)return;let[,r,i,a]=n;if(r!==void 0||i!==void 0||a!==void 0)return Number(r??0)*3600+Number(i??0)*60+Number(a??0)},Ve=new Set,He=()=>i(()=>import(`./shaka-BwT9pJcV.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),Ue=(e,t)=>{if(!e)return;let n=t?`${e}\0${t}`:e;Ve.has(n)||(Ve.add(n),Ve.size>128&&Ve.delete(Ve.values().next().value),He().catch(()=>{}),Ee().then(n=>t?n.prefetchPlayback(e,t):n.prefetchPlayback(e)).catch(()=>{}))},We=140,Ge=(e,t)=>{let n=P(void 0);return{onPointerEnter:()=>{t||(clearTimeout(n.current),n.current=setTimeout(()=>Ue(e),We))},onPointerLeave:()=>clearTimeout(n.current),onPointerDown:()=>{clearTimeout(n.current),Ue(e,t)}}},Ke=[50,75,100,125,150,175,200],qe=[`50%`,`75%`,`100%`,`150%`,`200%`,`300%`,`400%`],Je={"Monospaced Serif":`"Courier New", Courier, "Nimbus Mono L", "Cutive Mono", serif-monospace, monospace`,"Proportional Serif":`"Times New Roman", Times, Georgia, Cambria, "PT Serif Caption", serif`,"Monospaced Sans-Serif":`"Deja Vu Sans Mono", "Lucida Console", Monaco, Consolas, "PT Mono", sans-serif-monospace, monospace`,"Proportional Sans-Serif":`"YouTube Noto", Roboto, Arial, Helvetica, Verdana, "PT Sans Caption", sans-serif`,Casual:`"Comic Sans MS", Impact, Handlee, fantasy`,Cursive:`"Monotype Corsiva", "URW Chancery L", "Apple Chancery", "Dancing Script", cursive`,"Small Capitals":`Arial, Helvetica, Verdana, "Marcellus SC", sans-serif`},Ye={White:`255, 255, 255`,Yellow:`255, 255, 0`,Green:`0, 255, 0`,Cyan:`0, 255, 255`,Blue:`0, 0, 255`,Magenta:`255, 0, 255`,Red:`255, 0, 0`,Black:`8, 8, 8`},Xe=[`None`,`Drop Shadow`,`Raised`,`Depressed`,`Outline`],Ze=(e,t,n)=>{let r=[];for(let i=e;i<=t;i+=n)r.push(i);return r},Qe=(e,t,n,r)=>{let i=Math.max(t,1)/32,[a,o,s,c]=[1,2,3,5].map(e=>Math.max(e*i,1));switch(e){case`Drop Shadow`:return Ze(s,c,i).map(e=>`${n} ${o}px ${o}px ${e}px`);case`Raised`:return Ze(a,s,globalThis.devicePixelRatio>=2?.5:1).map(e=>`${n} ${e}px ${e}px`);case`Depressed`:return[`${r} ${a}px ${a}px`,`${n} -${a}px -${a}px`];case`Outline`:return Array.from({length:5},()=>`${n} 0 0 ${o}px`);default:return[]}},$e=e=>e.map(e=>({value:e,label:e})),et=e=>e.map(e=>({value:e,label:`${e*100}%`})),tt=[{key:`captionFont`,label:`Font family`,choices:$e(Object.keys(Je))},{key:`captionColor`,label:`Font color`,choices:$e(Object.keys(Ye))},{key:`captionSize`,label:`Font size`,choices:Ke.map((e,t)=>({value:e,label:qe[t]}))},{key:`captionBackground`,label:`Background color`,choices:$e(Object.keys(Ye))},{key:`captionBackgroundOpacity`,label:`Background opacity`,choices:et([0,.25,.5,.75,1])},{key:`captionEdge`,label:`Character edge style`,choices:$e(Xe)},{key:`captionOpacity`,label:`Font opacity`,choices:et([.25,.5,.75,1])}],nt=(e,t)=>Math.min(Ke.at(-1),Math.max(Ke[0],e+t*50)),rt=(e,t)=>{let n=e.captionOpacity,r=Qe(e.captionEdge,t,`rgba(34, 34, 34, ${n})`,`rgba(204, 204, 204, ${n})`);return[`font-size: ${e.captionSize}%`,`font-family: ${Je[e.captionFont]}`,`color: rgba(${Ye[e.captionColor]}, ${n})`,`background-color: rgba(${Ye[e.captionBackground]}, ${e.captionBackgroundOpacity})`,`text-shadow: ${r.length>0?r.join(`, `):`none`}`].join(`; `)},it=.25,at=.05,ot=[1,1.25,1.5,2,3],st=e=>Math.min(3,Math.max(it,Math.round(e*20)/20)),ct=(e,t)=>st(e+t*.25),lt=e=>e===1?`Normal`:String(e);N();var G={theme:`device`,autoplay:!0,volume:1,muted:!1,playbackRate:1,quality:`auto`,stableVolume:!1,captionsEnabled:!1,captionFont:`Proportional Sans-Serif`,captionColor:`White`,captionSize:100,captionBackground:`Black`,captionBackgroundOpacity:.75,captionEdge:`None`,captionOpacity:1,theater:!1,ambientMode:!0,showDislikes:!0,skipSponsors:!0,guideCollapsed:!1,hideShorts:!1,suggestExtension:!0},ut=`yt-client:settings`,dt=(e,t,n)=>Math.min(n,Math.max(t,e)),ft=e=>{let t=e.theme,n=e.quality,r=e.volume,i=e.playbackRate,a=e.captionsLanguage,o=e.captionPosition,s=o&&typeof o==`object`&&typeof o.x==`number`&&Number.isFinite(o.x)&&typeof o.y==`number`&&Number.isFinite(o.y)?{x:dt(o.x,0,1),y:dt(o.y,0,1)}:void 0;return{theme:t===`light`||t===`dark`&&e.themeChosen===!0?t:G.theme,autoplay:typeof e.autoplay==`boolean`?e.autoplay:G.autoplay,volume:typeof r==`number`&&Number.isFinite(r)?dt(r,0,1):G.volume,muted:typeof e.muted==`boolean`?e.muted:G.muted,playbackRate:typeof i==`number`&&Number.isFinite(i)?st(i):G.playbackRate,quality:n===`auto`||typeof n==`number`&&Number.isFinite(n)?n:G.quality,stableVolume:typeof e.stableVolume==`boolean`?e.stableVolume:G.stableVolume,captionsEnabled:typeof e.captionsEnabled==`boolean`?e.captionsEnabled:G.captionsEnabled,captionsLanguage:typeof a==`string`?a:void 0,captionsChosen:e.captionsChosen===!0||e.captionsEnabled===!0||void 0,...Object.fromEntries(tt.map(({key:t,choices:n})=>[t,n.some(n=>n.value===e[t])?e[t]:G[t]])),captionPosition:s,theater:typeof e.theater==`boolean`?e.theater:G.theater,ambientMode:typeof e.ambientMode==`boolean`?e.ambientMode:G.ambientMode,showDislikes:typeof e.showDislikes==`boolean`?e.showDislikes:G.showDislikes,skipSponsors:typeof e.skipSponsors==`boolean`?e.skipSponsors:G.skipSponsors,guideCollapsed:typeof e.guideCollapsed==`boolean`?e.guideCollapsed:G.guideCollapsed,hideShorts:typeof e.hideShorts==`boolean`?e.hideShorts:G.hideShorts,suggestExtension:typeof e.suggestExtension==`boolean`?e.suggestExtension:G.suggestExtension,extensionSeen:typeof e.extensionSeen==`boolean`?e.extensionSeen:void 0,themeChosen:e.themeChosen===!0||void 0}},pt=(()=>{try{let e=localStorage.getItem(ut);if(!e)return{...G};let t=JSON.parse(e);return!t||typeof t!=`object`?{...G}:ft(t)}catch{return{...G}}})(),mt=new Set,ht=()=>pt,gt=e=>(mt.add(e),()=>{mt.delete(e)}),_t=e=>{let[t,n]=M(()=>pt[e]);return O(()=>(n(pt[e]),gt(t=>n(t[e]))),[e]),t},vt=e=>{let t={...pt,...e,...`theme`in e?{themeChosen:!0}:{},...`captionsEnabled`in e?{captionsChosen:!0}:{}};pt=t;try{localStorage.setItem(ut,JSON.stringify(t))}catch{}for(let e of mt)e(t);return t},yt=()=>{try{return window.matchMedia(`(prefers-color-scheme: light)`).matches}catch{return!1}},bt=e=>e===`device`?yt()?`light`:`dark`:e,xt={dark:`#0f0f0f`,light:`#f9f9f9`},St=(e=pt.theme)=>{let t=bt(e);return document.documentElement.dataset.theme=t,document.querySelector(`meta[name="theme-color"]`)?.setAttribute(`content`,xt[t]),t},Ct=()=>{let e;try{e=window.matchMedia(`(prefers-color-scheme: light)`)}catch{return()=>{}}let t=()=>{pt.theme===`device`&&St(`device`)};e.addEventListener(`change`,t);let n=gt(e=>St(e.theme));return()=>{e.removeEventListener(`change`,t),n()}};N();var wt={visibility:`hidden`},Tt=({src:e,srcSet:t,sizes:n})=>{let[r,i]=M(),[a,o]=M(!1),s=r===e;return O(()=>{if(!s||a)return;let e=()=>{i(void 0),o(!0)};return window.addEventListener(`online`,e),()=>window.removeEventListener(`online`,e)},[s,a]),H(`img`,{src:e,srcSet:t??void 0,sizes:n,alt:``,loading:`lazy`,style:s?wt:void 0,onError:()=>i(e)},a?`retry`:`first`)},Et=V`
|
|
3
|
+
display: inline-block;
|
|
4
|
+
flex: none;
|
|
5
|
+
margin-left: 0.4rem;
|
|
6
|
+
vertical-align: -0.2em;
|
|
7
|
+
fill: currentColor;
|
|
8
|
+
`,Dt=`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2Zm-1.9 14.7L6 12.6l1.4-1.4 2.7 2.7 6.5-6.5 1.4 1.4-7.9 7.9Z`,Ot=`M12 4v9.38A3.95 3.95 0 0 0 10 13c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V8h4V4h-6Z`,kt=({channel:e,size:t=14})=>{if(!e?.isVerified&&!e?.isVerifiedArtist)return null;let n=e.isVerifiedArtist?`Official Artist Channel`:`Verified`;return H(`svg`,{css:Et,width:t,height:t,viewBox:`0 0 24 24`,role:`img`,"aria-label":n,"data-badge":e.isVerifiedArtist?`artist`:`verified`,children:H(`path`,{d:e.isVerifiedArtist?Ot:Dt})})},At=e=>{if(e.length===1)return e[0];let t=0;for(let n of e)t+=n.byteLength;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.byteLength;return n},jt=(e,t)=>(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0,Mt=(e,t,n)=>{e[t]=n>>>24&255,e[t+1]=n>>>16&255,e[t+2]=n>>>8&255,e[t+3]=n&255},Nt=(e,t)=>jt(e,t)*4294967296+jt(e,t+4),Pt=(e,t)=>String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]),Ft=(e,t=0,n=e.byteLength)=>{let r=[],i=t;for(;i+8<=n;){let t=jt(e,i),a=Pt(e,i+4),o=8;if(t===1){if(i+16>n)throw Error(`mp4-muxer: truncated 64-bit box header for ${a}`);t=Nt(e,i+8),o=16}else t===0&&(t=n-i);if(t<o||i+t>n)throw Error(`mp4-muxer: invalid box size ${t} for ${a}`);r.push({type:a,start:i,headerSize:o,size:t,data:e.subarray(i,i+t)}),i+=t}return r},It=(e,t)=>{let n=0;for(let e of t)n+=e.byteLength;let r=new Uint8Array(8+n);Mt(r,0,r.byteLength),r[4]=e.charCodeAt(0),r[5]=e.charCodeAt(1),r[6]=e.charCodeAt(2),r[7]=e.charCodeAt(3);let i=8;for(let e of t)r.set(e,i),i+=e.byteLength;return r},Lt=e=>{let t=new Uint8Array(24);return Mt(t,4,e),Mt(t,8,1),It(`trex`,[t])},Rt=(e,t)=>{let n=Uint8Array.from(e),r=Ft(n,8,n.byteLength),i=r.find(e=>e.type===`tkhd`);if(!i)throw Error(`mp4-muxer: trak is missing tkhd box`);let a=n[i.start+i.headerSize],o=i.start+i.headerSize+(a===1?20:12);if(o+4>i.start+i.size)throw Error(`mp4-muxer: tkhd box is truncated`);Mt(n,o,t);let s=1,c=r.find(e=>e.type===`mdia`);if(c){let e=Ft(n,c.start+c.headerSize,c.start+c.size).find(e=>e.type===`mdhd`);if(e){let t=n[e.start+e.headerSize],r=e.start+e.headerSize+(t===1?20:12);r+4<=e.start+e.size&&(s=jt(n,r)||1)}}return{patched:n,timescale:s}},zt=(e,t)=>{if(!e)return{trex:Lt(t)};let n=Ft(e,8,e.byteLength),r=n.find(e=>e.type===`mehd`)?.data,i=n.find(e=>e.type===`trex`);if(!i||i.size<32)return{mehd:r,trex:Lt(t)};let a=Uint8Array.from(i.data);return Mt(a,i.headerSize+4,t),{mehd:r,trex:a}},Bt=(e,t)=>{let n=Ft(At(e)),r=n.find(e=>e.type===`ftyp`)?.data,i=n.find(e=>e.type===`moov`);if(!i)throw Error(`mp4-muxer: track ${t} is missing moov box`);let a=Ft(i.data,i.headerSize,i.size),o=a.find(e=>e.type===`mvhd`)?.data,s=a.find(e=>e.type===`trak`)?.data,c=a.find(e=>e.type===`mvex`)?.data;if(!o||!s)throw Error(`mp4-muxer: track ${t} moov is missing mvhd or trak`);let{patched:l,timescale:u}=Rt(s,t),{mehd:d,trex:f}=zt(c,t),p=[],m=0;for(let e=0;e<n.length;e+=1){let r=n[e];if(r.type!==`moof`)continue;let i;for(let t=e+1;t<n.length;t+=1){let r=n[t];if(r.type===`mdat`){i=r,e=t;break}if(r.type===`moof`)break}if(!i)throw Error(`mp4-muxer: moof without following mdat on track ${t}`);let a=Uint8Array.from(r.data),o=Ft(a,r.headerSize,r.size),s=0;for(let e of o){if(e.type!==`traf`)continue;let n=Ft(a,e.start+e.headerSize,e.start+e.size),r=n.find(e=>e.type===`tfhd`);r&&r.size>=r.headerSize+8&&Mt(a,r.start+r.headerSize+4,t);let i=n.find(e=>e.type===`tfdt`);if(i){let e=a[i.start+i.headerSize],t=i.start+i.headerSize+4;e===1&&t+8<=i.start+i.size?s=Nt(a,t):t+4<=i.start+i.size&&(s=jt(a,t))}}p.push({trackId:t,decodeTimeSec:s/u,order:m++,moof:a,mdat:i.data})}return{ftyp:r,mvhd:o,patchedTrak:l,mehd:d,trex:f,fragments:p}},Vt=(e,t)=>{let n=Uint8Array.from(e);if(n.byteLength<108)throw Error(`mp4-muxer: mvhd box is truncated`);return Mt(n,n.byteLength-4,t),n},Ht=(e,t)=>{let n=Ft(e,8,e.byteLength).find(e=>e.type===`mfhd`);n&&n.size>=n.headerSize+8&&Mt(e,n.start+n.headerSize+4,t)},Ut=(e,t)=>{let n=Bt(e,1),r=Bt(t,2),i=[],a=n.mehd??r.mehd;a&&i.push(a),i.push(n.trex,r.trex);let o=It(`mvex`,i),s=It(`moov`,[Vt(n.mvhd,3),n.patchedTrak,r.patchedTrak,o]),c=[...n.fragments,...r.fragments].sort((e,t)=>e.decodeTimeSec-t.decodeTimeSec||e.trackId-t.trackId||e.order-t.order),l=[];n.ftyp&&l.push(n.ftyp),l.push(s);for(let e=0;e<c.length;e+=1){let t=c[e];Ht(t.moof,e+1),l.push(t.moof,t.mdat)}return l};N();var Wt=`yt-client:downloads`,Gt=100,Kt=new Set([`completed`,`failed`,`cancelled`]),qt=134217728,Jt=15e3,Yt=()=>{try{return typeof localStorage<`u`?localStorage:void 0}catch{return}},Xt=(e,t)=>`${(e.replace(/[\u0000-\u001f]/g,` `).replace(/[\\/:*?"<>|]/g,` `).replace(/\s+/g,` `).trim().replace(/^[.\s]+|[.\s]+$/g,``)||`video`).slice(0,120).trim()}.${t.replace(/^\.+/,``).trim()||`bin`}`,Zt=e=>{if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return r===0?`${Math.round(n)} ${t[r]}`:`${n.toFixed(1)} ${t[r]}`},Qt=(e=Yt())=>{if(!e)return[];try{let t=e.getItem(Wt);if(!t)return[];let n=JSON.parse(t);return Array.isArray(n)?n.filter(e=>{if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.id==`string`&&typeof t.videoId==`string`&&typeof t.title==`string`&&(t.mode===`video`||t.mode===`audio`)&&(t.container===`mp4`||t.container===`m4a`||t.container===`webm`)&&typeof t.filename==`string`&&Kt.has(t.status)}).slice(0,Gt).map(e=>({...e,blobUrl:void 0})):[]}catch{return[]}},$t=(e,t=Yt())=>{if(t)try{let n=e.filter(e=>Kt.has(e.status)).slice(0,Gt).map(({blobUrl:e,...t})=>t);t.setItem(Wt,JSON.stringify(n))}catch{}},K=Qt(),en,tn=0,nn=new Set,rn=new Set,an=new Map,on=new Set,sn=new Map,cn=new Map,ln=new Map,un=e=>{let t=ln.get(e);t&&(clearTimeout(t),ln.delete(e)),cn.delete(e);let n=sn.get(e);if(n){sn.delete(e);try{URL.revokeObjectURL(n)}catch{}}},dn=e=>{let t=0;for(let e of cn.values())t+=e;if(t<=134217728)return;let n=[];for(let r of sn.keys()){if(t<=134217728)break;r!==e&&(t-=cn.get(r)??0,un(r),n.push(r))}if(n.length>0){let e=new Set(n);K=K.map(t=>e.has(t.id)?{...t,blobUrl:void 0}:t)}},fn=(e,t=!1)=>{for(let t of e.slice(Gt))un(t.id);K=e.slice(0,Gt),t&&$t(K);for(let e of nn)e(K)},pn=(e,t,n=!1)=>{fn(K.map(n=>n.id===e?{...n,...t}:n),n)},mn=(e,t)=>{if(typeof document>`u`)return;let n=document.createElement(`a`);n.href=e,n.download=t,n.style.display=`none`,document.body.appendChild(n),n.click(),n.remove()},hn=e=>{en=e;for(let e of rn)e(en)},gn=()=>{en=void 0;for(let e of rn)e(void 0)},_n=()=>{let[e,t]=M(en);return O(()=>(rn.add(t),t(en),()=>{rn.delete(t)}),[]),e},vn=()=>{let[e,t]=M(K);return O(()=>(nn.add(t),t(K),()=>{nn.delete(t)}),[]),e},yn=e=>{let t=K.find(t=>t.id===e);return t?.blobUrl?(mn(t.blobUrl,t.filename),!0):!1},bn=async e=>{let t=K.find(t=>t.id===e);if(!t||Kt.has(t.status))return;on.add(e);let n=an.get(e);if(an.delete(e),pn(e,{status:`cancelled`},!0),n)try{await(await Ee()).cancelDownload(n)}catch{}},xn=e=>{let t=K.find(t=>t.id===e);t&&(Kt.has(t.status)||bn(e),un(e),fn(K.filter(t=>t.id!==e),!0))},Sn=()=>{let e=[];for(let t of K)Kt.has(t.status)?un(t.id):e.push(t);fn(e,!0)},Cn=async(e,t={})=>{let n=`dl-${Date.now()}-${++tn}`,r=Xt(e.target.title,e.container),i={id:n,videoId:e.target.videoId,title:e.target.title,channelName:e.target.channelName??void 0,thumbnail:e.target.thumbnail??void 0,mode:e.mode,container:e.container,qualityLabel:e.qualityLabel,filename:r,status:`starting`,loadedBytes:0,totalBytes:e.estimatedBytes,createdAt:Date.now()};fn([i,...K]);let a=t.engine??Ee,o=t.notify??(e=>L(e)),s=t.saveFile??mn;try{let t=await a();if(on.has(n))throw new DOMException(`Cancelled`,`AbortError`);let c=await t.startDownload({videoId:e.target.videoId,mode:e.mode,videoKey:e.videoKey,audioKey:e.audioKey});if(an.set(n,c.downloadId),on.has(n))throw t.cancelDownload(c.downloadId).catch(()=>{}),new DOMException(`Cancelled`,`AbortError`);let l=c.estimatedBytes??e.estimatedBytes;pn(n,{status:`downloading`,totalBytes:l});let u=[],d=[];for(;;){if(on.has(n))throw t.cancelDownload(c.downloadId).catch(()=>{}),new DOMException(`Cancelled`,`AbortError`);let e=await t.pollDownload(c.downloadId);for(let t of e.videoChunks)u.push(new Uint8Array(t));for(let t of e.audioChunks)d.push(new Uint8Array(t));if(pn(n,{loadedBytes:e.loadedBytes,totalBytes:e.totalBytes??l}),e.error)throw Error(e.error);if(e.done)break}if(an.delete(n),on.has(n))throw new DOMException(`Cancelled`,`AbortError`);let f;if(e.mode===`video`){if(pn(n,{status:`muxing`}),await new Promise(e=>setTimeout(e,0)),on.has(n)||(f=Ut(u,d),on.has(n)))throw new DOMException(`Cancelled`,`AbortError`)}else f=d;let p=new Blob(f,{type:c.mimeType});if(u.length=0,d.length=0,f=[],p.size===0)throw Error(`youtube: downloaded file was empty`);let m=URL.createObjectURL(p);s(m,r);let h=p.size<=qt;if(h)sn.set(n,m),cn.set(n,p.size),dn(n);else{let e=setTimeout(()=>{ln.delete(n);try{URL.revokeObjectURL(m)}catch{}},Jt);ln.set(n,e)}let g=Date.now(),_={status:`completed`,loadedBytes:p.size,totalBytes:p.size,sizeBytes:p.size,completedAt:g,blobUrl:h?m:void 0};return pn(n,_,!0),o(`Saved ${r}`),K.find(e=>e.id===n)??{...i,..._}}catch(e){if(an.delete(n),on.has(n))return on.delete(n),pn(n,{status:`cancelled`},!0),K.find(e=>e.id===n)??{...i,status:`cancelled`};let t=e instanceof Error?e.message.replace(/^youtube:\s*/i,``):String(e);return pn(n,{status:`failed`,error:t},!0),o(`Download failed: ${t}`),K.find(e=>e.id===n)??{...i,status:`failed`,error:t}}},wn=crypto.randomUUID(),Tn=e=>e?{playerParams:e,document:wn}:void 0,En=e=>{let t=e;return t?.document===wn&&typeof t.playerParams==`string`?t.playerParams:void 0};N();var Dn=({open:e,onClose:t,rootRef:n,panelRef:r,triggerRef:i})=>{E(()=>{if(!e)return;let a=e=>{let i=e.target;n.current?.contains(i)||r?.current?.contains(i)||t()},o=e=>{e.key===`Escape`&&(e.stopPropagation(),t(),i?.current?.focus())};return document.addEventListener(`pointerdown`,a),document.addEventListener(`keydown`,o),()=>{document.removeEventListener(`pointerdown`,a),document.removeEventListener(`keydown`,o)}},[e,t,n,r,i])},On=V`
|
|
9
|
+
position: absolute;
|
|
10
|
+
top: calc(100% + 0.8rem);
|
|
11
|
+
min-width: 20rem;
|
|
12
|
+
max-height: 70vh;
|
|
13
|
+
padding: 0.8rem 0;
|
|
14
|
+
overflow-y: auto;
|
|
15
|
+
border-radius: 1.2rem;
|
|
16
|
+
background: var(--bg-menu);
|
|
17
|
+
box-shadow: var(--shadow-menu);
|
|
18
|
+
z-index: var(--z-popup);
|
|
19
|
+
|
|
20
|
+
&.align-end {
|
|
21
|
+
right: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&.align-start {
|
|
25
|
+
left: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* as wide as its widest unbreakable row, like a panel in place, so a long title wraps rather than stretching the menu
|
|
29
|
+
across the page */
|
|
30
|
+
&.anchored {
|
|
31
|
+
position: fixed;
|
|
32
|
+
width: min-content;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* youtube.com's player menu, measured 2026-11-10: see-through black over the video in either theme, as wide as its
|
|
36
|
+
longest row */
|
|
37
|
+
&.media {
|
|
38
|
+
--bg-menu: rgba(0, 0, 0, 0.6);
|
|
39
|
+
--bg-hover: rgba(255, 255, 255, 0.1);
|
|
40
|
+
--text-primary: #eeeeee;
|
|
41
|
+
--shadow-menu: none;
|
|
42
|
+
width: max-content;
|
|
43
|
+
backdrop-filter: blur(16px);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* the row's wash is its focus mark: Chrome rings the row a right-click focuses, where youtube.com's shows nothing */
|
|
47
|
+
&.media [role^='menuitem'] {
|
|
48
|
+
outline: none;
|
|
49
|
+
font-size: 1.3rem;
|
|
50
|
+
font-weight: 500;
|
|
51
|
+
}
|
|
52
|
+
`,kn=8,An=(e,t,n,r)=>{let i=t.getBoundingClientRect(),{clientWidth:a,clientHeight:o}=document.documentElement,s=Math.min(e.scrollHeight,o*.7),c={below:o-i.bottom-kn,above:i.top-kn},l=r===`below`?`above`:`below`,u=s<=c[r]?r:s<=c[l]||c[l]>c[r]?l:r;e.style.maxHeight=`${Math.max(Math.min(o*.7,c[u]),0)}px`,e.style.top=u===`below`?`${i.bottom+kn}px`:`auto`,e.style.bottom=u===`above`?`${o-i.top+kn}px`:`auto`;let d=i.left,f=i.right-e.offsetWidth,p=n===`start`?d+e.offsetWidth<=a?d:f:f>=0?f:d;e.style.left=`${Math.max(kn,Math.min(p,a-e.offsetWidth-kn))}px`},jn=(e,{x:t,y:n})=>{let{clientWidth:r,clientHeight:i}=document.documentElement;e.style.top=`${Math.max(0,Math.min(n+1,i-e.offsetHeight))}px`,e.style.left=`${Math.max(0,Math.min(t+1,r-e.offsetWidth))}px`},q=({align:e=`end`,side:t=`below`,anchor:n,at:r,media:i=!1,panelRef:a,onKeyDown:o,label:s,children:c,class:l})=>{let u=P(r);u.current=r;let d=!!(n??r);E(()=>{let r=a?.current,i=n?.current;if(!r||!i&&!u.current)return;let o=()=>{u.current?jn(r,u.current()):i&&An(r,i,e,t)};o();let s,c=()=>{s===void 0&&(s=requestAnimationFrame(()=>{s=void 0,o()}))};window.addEventListener(`scroll`,c,{capture:!0,passive:!0}),window.addEventListener(`resize`,c);let l=new ResizeObserver(c);return l.observe(r),()=>{s!==void 0&&cancelAnimationFrame(s),window.removeEventListener(`scroll`,c,{capture:!0}),window.removeEventListener(`resize`,c),l.disconnect()}},[n,a,e,t]);let f=H(`div`,{css:On,className:[d?`anchored`:`align-${e}`,i?`media`:void 0,l].filter(e=>e!==void 0).join(` `),ref:a,role:`menu`,"aria-label":s,onKeyDown:o,children:c});return d?g(f,document.fullscreenElement??document.body):f},Mn=V`
|
|
53
|
+
width: 100%;
|
|
54
|
+
min-height: 4rem;
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
gap: 1.6rem;
|
|
58
|
+
padding: 0 1.6rem;
|
|
59
|
+
border: none;
|
|
60
|
+
background: transparent;
|
|
61
|
+
color: var(--text-primary);
|
|
62
|
+
font-size: 1.4rem;
|
|
63
|
+
text-align: left;
|
|
64
|
+
cursor: pointer;
|
|
65
|
+
transition: background 0.15s ease;
|
|
66
|
+
|
|
67
|
+
&:hover:not(:disabled),
|
|
68
|
+
&:focus-visible {
|
|
69
|
+
background: var(--bg-hover);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&:disabled {
|
|
73
|
+
opacity: 0.5;
|
|
74
|
+
cursor: default;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.label {
|
|
78
|
+
flex: 1;
|
|
79
|
+
min-width: 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.detail {
|
|
83
|
+
color: var(--text-secondary);
|
|
84
|
+
}
|
|
85
|
+
`,J=({icon:e,detail:t,disabled:n,selected:r,role:i=`menuitem`,onSelect:a,children:o})=>R(`button`,{type:`button`,css:Mn,role:i,"aria-checked":r,disabled:n,onClick:a,children:[e?H(e,{size:20,strokeWidth:1.5}):void 0,H(`span`,{className:`label`,children:o}),t?H(`span`,{className:`detail`,children:t}):void 0]});V`
|
|
86
|
+
height: 1px;
|
|
87
|
+
margin: 0.8rem 0;
|
|
88
|
+
background: var(--border-subtle);
|
|
89
|
+
`;var Nn=(e,t)=>e.findLastIndex(e=>e.startSeconds<=t),Pn=(e,t,n)=>e[Nn(e,t)+n]?.startSeconds,Fn=(e,t)=>{let n=[0,...e.map(e=>e.startSeconds).filter(e=>e>0&&e<t),t];return n.slice(0,-1).map((e,t)=>({start:e,end:n[t+1]}))},In=.4,Ln=(e,t,n)=>{let r=t>0?Math.max(0,Math.min(1,n/t)):0,i=Math.max(0,e.findLastIndex(e=>e.start<=n));return`calc(${r*100}% + ${(i-r*(e.length-1))*In}rem)`},Rn=(e,t,n)=>{if(t<=0)return`100%`;let r=(n.end-n.start)/t;return`calc(${r*100}% - ${r*(e.length-1)*In}rem)`},zn=(e,t)=>`${e.end>e.start?Math.max(0,Math.min(1,(t-e.start)/(e.end-e.start)))*100:0}%`,Bn=(e,t,n)=>{let r=Math.max(0,t.findLastIndex(e=>e.left<=n)),i=e[r],a=t[r];if(!i||!a)return 0;let o=a.width>0?Math.max(0,Math.min(1,(n-a.left)/a.width)):0;return i.start+o*(i.end-i.start)},Vn=8,Hn=(e,t)=>t?.isLive()?t.seekRange():{start:0,end:Number.isFinite(e.duration)?e.duration:0},Un=({start:e,end:t},n)=>Math.max(e,Math.min(t,n)),Wn=({start:e,end:t},n)=>e+(t-e)*n,Gn=({end:e},t)=>e-t<Vn,Kn=(e,t)=>Gn(e,t)?0:t;N();var qn=[10,15,20,30,45,60],Jn,Yn,Xn=new Set,Zn=e=>{for(let t of Xn)t(e)},Qn=()=>Jn,$n=e=>{clearTimeout(Yn),Yn=void 0,typeof e==`number`?(Jn={minutes:e,endsAt:Date.now()+e*6e4},Yn=setTimeout(er,e*6e4)):Jn=e,Zn(!1)},er=()=>{clearTimeout(Yn),Yn=void 0,Jn=void 0,Zn(!0)},tr=e=>(Xn.add(e),()=>{Xn.delete(e)}),nr=e=>{let[t,n]=M(Qn),r=P(e);return r.current=e,O(()=>tr(e=>{n(Qn()),e&&r.current()}),[]),t},rr=e=>{let t=Math.max(1,Math.ceil(e/60)),n=Math.floor(t/60),r=t%60;return[n>0?`${n} hr`:``,r>0?`${r} min`:``].filter(Boolean).join(` `)},ir=(e,t,n=Date.now())=>e===void 0?`Off`:`${rr(e===`end`?t:(e.endsAt-n)/1e3)} left`,ar=V`
|
|
90
|
+
width: min(24.4rem, 100%);
|
|
91
|
+
color: var(--text-primary);
|
|
92
|
+
|
|
93
|
+
.speed {
|
|
94
|
+
margin-bottom: 2.4rem;
|
|
95
|
+
font-size: 1.8rem;
|
|
96
|
+
font-weight: 900;
|
|
97
|
+
line-height: 2.2rem;
|
|
98
|
+
text-align: center;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.slider-row {
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
gap: 1.6rem;
|
|
105
|
+
margin-bottom: 2.4rem;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.speed-button {
|
|
109
|
+
flex: none;
|
|
110
|
+
height: 3.2rem;
|
|
111
|
+
padding: 0;
|
|
112
|
+
border: none;
|
|
113
|
+
border-radius: 1.6rem;
|
|
114
|
+
background: var(--bg-hover);
|
|
115
|
+
color: inherit;
|
|
116
|
+
font: inherit;
|
|
117
|
+
font-weight: 500;
|
|
118
|
+
line-height: 1.6rem;
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
transition: background 0.2s ease;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.speed-button:hover {
|
|
124
|
+
background: var(--bg-hover-strong);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.step {
|
|
128
|
+
width: 3.2rem;
|
|
129
|
+
font-size: 2.4rem;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* a 4 px track filled up to the speed and a 16 px knob, in Chrome through the --fill gradient and in Firefox through
|
|
133
|
+
its progress part */
|
|
134
|
+
input {
|
|
135
|
+
flex: 1;
|
|
136
|
+
min-width: 0;
|
|
137
|
+
height: 2.4rem;
|
|
138
|
+
margin: 0;
|
|
139
|
+
background: transparent;
|
|
140
|
+
appearance: none;
|
|
141
|
+
cursor: pointer;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
input::-webkit-slider-runnable-track {
|
|
145
|
+
height: 0.4rem;
|
|
146
|
+
border-radius: 1.2rem;
|
|
147
|
+
background: linear-gradient(to right, var(--text-primary) var(--fill), #909090 var(--fill));
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
input::-webkit-slider-thumb {
|
|
151
|
+
width: 1.6rem;
|
|
152
|
+
height: 1.6rem;
|
|
153
|
+
margin-top: -0.6rem;
|
|
154
|
+
border-radius: 50%;
|
|
155
|
+
background: var(--text-primary);
|
|
156
|
+
appearance: none;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
input::-moz-range-track {
|
|
160
|
+
height: 0.4rem;
|
|
161
|
+
border-radius: 1.2rem;
|
|
162
|
+
background: #909090;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
input::-moz-range-progress {
|
|
166
|
+
height: 0.4rem;
|
|
167
|
+
border-radius: 1.2rem;
|
|
168
|
+
background: var(--text-primary);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
input::-moz-range-thumb {
|
|
172
|
+
width: 1.6rem;
|
|
173
|
+
height: 1.6rem;
|
|
174
|
+
border: none;
|
|
175
|
+
border-radius: 50%;
|
|
176
|
+
background: var(--text-primary);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.chips {
|
|
180
|
+
display: flex;
|
|
181
|
+
gap: 0.6rem;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.chip {
|
|
185
|
+
flex: 1;
|
|
186
|
+
min-width: 0;
|
|
187
|
+
display: flex;
|
|
188
|
+
flex-direction: column;
|
|
189
|
+
align-items: center;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.chip .speed-button {
|
|
193
|
+
width: 100%;
|
|
194
|
+
font-size: 1.2rem;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.chip-label {
|
|
198
|
+
margin-top: 0.4rem;
|
|
199
|
+
color: var(--text-secondary);
|
|
200
|
+
font-size: 1rem;
|
|
201
|
+
line-height: 1.4rem;
|
|
202
|
+
}
|
|
203
|
+
`,or=e=>Number.isInteger(e)?e.toFixed(1):String(e),sr=({rate:e,onRate:t})=>R(`div`,{css:ar,children:[H(`div`,{className:`speed`,"aria-live":`polite`,children:`${e.toFixed(2)}x`}),R(`div`,{className:`slider-row`,children:[H(`button`,{type:`button`,className:`speed-button step`,"aria-label":`Decrease playback speed 0.05`,onClick:()=>t(st(e-at)),children:`-`}),H(`input`,{type:`range`,min:it,max:3,step:at,value:e,"aria-label":`Playback speed`,"aria-valuetext":`${e.toFixed(2)}x`,style:{"--fill":`${(e-it)/(3-it)*100}%`},onInput:e=>t(st(Number(e.currentTarget.value)))}),H(`button`,{type:`button`,className:`speed-button step`,"aria-label":`Increase playback speed 0.05`,onClick:()=>t(st(e+at)),children:`+`})]}),H(`div`,{className:`chips`,children:ot.map(e=>R(`div`,{className:`chip`,children:[H(`button`,{type:`button`,className:`speed-button`,onClick:()=>t(e),children:or(e)}),e===1?H(`span`,{className:`chip-label`,children:`Normal`}):void 0]},e))})]});N();var Y=e=>{if(!Number.isFinite(e)||e<0)return`0:00`;let t=Math.floor(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}:${String(r).padStart(2,`0`)}:${String(i).padStart(2,`0`)}`:`${r}:${String(i).padStart(2,`0`)}`},cr=V`
|
|
204
|
+
position: absolute;
|
|
205
|
+
left: 0;
|
|
206
|
+
right: 0;
|
|
207
|
+
bottom: 0;
|
|
208
|
+
padding: 0 1.2rem;
|
|
209
|
+
color: #ffffff;
|
|
210
|
+
opacity: 0;
|
|
211
|
+
transition: opacity 0.2s ease;
|
|
212
|
+
pointer-events: none;
|
|
213
|
+
|
|
214
|
+
&.visible {
|
|
215
|
+
opacity: 1;
|
|
216
|
+
pointer-events: auto;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.scrubber {
|
|
220
|
+
position: relative;
|
|
221
|
+
height: 1.6rem;
|
|
222
|
+
display: flex;
|
|
223
|
+
align-items: flex-end;
|
|
224
|
+
padding-bottom: 0.1rem;
|
|
225
|
+
cursor: pointer;
|
|
226
|
+
touch-action: none;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.rail {
|
|
230
|
+
position: relative;
|
|
231
|
+
width: 100%;
|
|
232
|
+
height: 0.4rem;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/* youtube.com's chapters: square ends 4 px apart, 4 px tall, 6 px while the pointer is on the bar and 10 px for the
|
|
236
|
+
chapter under it, growing about their middle */
|
|
237
|
+
.part {
|
|
238
|
+
position: absolute;
|
|
239
|
+
top: 50%;
|
|
240
|
+
height: 100%;
|
|
241
|
+
overflow: hidden;
|
|
242
|
+
background: rgba(40, 40, 40, 0.6);
|
|
243
|
+
transform: translateY(-50%);
|
|
244
|
+
transition: height 0.1s ease;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.scrubber:hover .part,
|
|
248
|
+
.scrubber.scrubbing .part {
|
|
249
|
+
height: 0.6rem;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.scrubber .part.hovered {
|
|
253
|
+
height: 1rem;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.buffered,
|
|
257
|
+
.played {
|
|
258
|
+
position: absolute;
|
|
259
|
+
top: 0;
|
|
260
|
+
bottom: 0;
|
|
261
|
+
left: 0;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.buffered {
|
|
265
|
+
background: rgba(255, 255, 255, 0.4);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.played {
|
|
269
|
+
background: var(--brand-red);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/* SponsorBlock's own colour for sponsors */
|
|
273
|
+
.sponsor {
|
|
274
|
+
position: absolute;
|
|
275
|
+
top: 0;
|
|
276
|
+
bottom: 0;
|
|
277
|
+
background: #00d400;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.knob {
|
|
281
|
+
position: absolute;
|
|
282
|
+
top: 50%;
|
|
283
|
+
width: 1.2rem;
|
|
284
|
+
height: 1.2rem;
|
|
285
|
+
margin-left: -0.6rem;
|
|
286
|
+
border-radius: 50%;
|
|
287
|
+
background: var(--brand-red);
|
|
288
|
+
transform: translateY(-50%);
|
|
289
|
+
transition: transform 0.1s ease;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.scrubber:hover .knob,
|
|
293
|
+
.scrubber.scrubbing .knob {
|
|
294
|
+
transform: translateY(-50%) scale(1.3);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.preview {
|
|
298
|
+
position: absolute;
|
|
299
|
+
bottom: 100%;
|
|
300
|
+
margin-bottom: 0.8rem;
|
|
301
|
+
transform: translateX(-50%);
|
|
302
|
+
pointer-events: none;
|
|
303
|
+
text-align: center;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.preview-frame {
|
|
307
|
+
border: 2px solid #ffffff;
|
|
308
|
+
border-radius: 0.4rem;
|
|
309
|
+
background-color: #000;
|
|
310
|
+
background-repeat: no-repeat;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.preview-time {
|
|
314
|
+
display: inline-flex;
|
|
315
|
+
gap: 0.8rem;
|
|
316
|
+
max-width: 30rem;
|
|
317
|
+
margin-top: 0.4rem;
|
|
318
|
+
padding: 0 0.8rem;
|
|
319
|
+
border-radius: 1.2rem;
|
|
320
|
+
background: rgba(0, 0, 0, 0.6);
|
|
321
|
+
font-size: 1.3rem;
|
|
322
|
+
line-height: 2.4rem;
|
|
323
|
+
font-variant-numeric: tabular-nums;
|
|
324
|
+
white-space: nowrap;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.preview-chapter {
|
|
328
|
+
overflow: hidden;
|
|
329
|
+
font-weight: 500;
|
|
330
|
+
text-overflow: ellipsis;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.bar {
|
|
334
|
+
display: flex;
|
|
335
|
+
align-items: center;
|
|
336
|
+
height: 5.6rem;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/* the groups left of the spacer, which the player's frame can hold short of the middle */
|
|
340
|
+
.left {
|
|
341
|
+
display: flex;
|
|
342
|
+
align-items: center;
|
|
343
|
+
min-width: 0;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.spacer {
|
|
347
|
+
flex: 1;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.control {
|
|
351
|
+
position: relative;
|
|
352
|
+
flex: none;
|
|
353
|
+
width: 4.8rem;
|
|
354
|
+
height: 4rem;
|
|
355
|
+
display: flex;
|
|
356
|
+
align-items: center;
|
|
357
|
+
justify-content: center;
|
|
358
|
+
padding: 0;
|
|
359
|
+
border: none;
|
|
360
|
+
border-radius: 2.8rem;
|
|
361
|
+
background: transparent;
|
|
362
|
+
color: #ffffff;
|
|
363
|
+
cursor: pointer;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/* after .control, whose transparent background would otherwise win on a control that is its own group */
|
|
367
|
+
.group {
|
|
368
|
+
position: relative;
|
|
369
|
+
flex: none;
|
|
370
|
+
height: 4rem;
|
|
371
|
+
border-radius: 2.8rem;
|
|
372
|
+
background: rgba(0, 0, 0, 0.3);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/* the hover wash: a 32 px band inside the shared group, and the whole shape of a control that is its own group */
|
|
376
|
+
.control::after,
|
|
377
|
+
.volume::after,
|
|
378
|
+
.chapter::after,
|
|
379
|
+
.live-badge::after {
|
|
380
|
+
content: '';
|
|
381
|
+
position: absolute;
|
|
382
|
+
inset: 0.4rem 0;
|
|
383
|
+
border-radius: 4rem;
|
|
384
|
+
background: rgba(255, 255, 255, 0.1);
|
|
385
|
+
opacity: 0;
|
|
386
|
+
transition: opacity 0.1s ease;
|
|
387
|
+
pointer-events: none;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.control:hover::after,
|
|
391
|
+
.volume:hover::after,
|
|
392
|
+
.chapter:hover::after,
|
|
393
|
+
.live-badge:enabled:hover::after {
|
|
394
|
+
opacity: 1;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.play {
|
|
398
|
+
width: 4rem;
|
|
399
|
+
border-radius: 50%;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
.play::after {
|
|
403
|
+
inset: 0.4rem;
|
|
404
|
+
border-radius: 50%;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.next {
|
|
408
|
+
margin-left: 0.8rem;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.next::after {
|
|
412
|
+
inset: 0;
|
|
413
|
+
border-radius: inherit;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.volume::after {
|
|
417
|
+
inset: 0.4rem;
|
|
418
|
+
border-radius: inherit;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
.volume {
|
|
422
|
+
display: flex;
|
|
423
|
+
align-items: center;
|
|
424
|
+
margin-left: 1.2rem;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.volume .control {
|
|
428
|
+
width: 4rem;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
.volume .control::after {
|
|
432
|
+
display: none;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.volume-slider {
|
|
436
|
+
display: flex;
|
|
437
|
+
align-items: center;
|
|
438
|
+
width: 0;
|
|
439
|
+
height: 4rem;
|
|
440
|
+
overflow: hidden;
|
|
441
|
+
opacity: 0;
|
|
442
|
+
transition: width 0.2s cubic-bezier(0, 0, 0.2, 1), margin 0.2s cubic-bezier(0, 0, 0.2, 1), opacity 0.15s ease;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
.volume:hover .volume-slider,
|
|
446
|
+
.volume:focus-within .volume-slider {
|
|
447
|
+
width: 5.2rem;
|
|
448
|
+
margin-right: 1.6rem;
|
|
449
|
+
opacity: 1;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/* youtube.com's volume bar (measured 2026-11-23): 52 x 40 px hit target, 2 px track, 12 px white handle */
|
|
453
|
+
.volume-slider input {
|
|
454
|
+
flex: none;
|
|
455
|
+
width: 5.2rem;
|
|
456
|
+
height: 4rem;
|
|
457
|
+
margin: 0;
|
|
458
|
+
padding: 0;
|
|
459
|
+
background: transparent;
|
|
460
|
+
appearance: none;
|
|
461
|
+
cursor: pointer;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.volume-slider input::-webkit-slider-runnable-track {
|
|
465
|
+
height: 0.2rem;
|
|
466
|
+
border-radius: 0.1rem;
|
|
467
|
+
background: linear-gradient(to right, #ffffff var(--fill), rgba(255, 255, 255, 0.2) var(--fill));
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
.volume-slider input::-webkit-slider-thumb {
|
|
471
|
+
width: 1.2rem;
|
|
472
|
+
height: 1.2rem;
|
|
473
|
+
margin-top: -0.5rem;
|
|
474
|
+
border: none;
|
|
475
|
+
border-radius: 50%;
|
|
476
|
+
background: #ffffff;
|
|
477
|
+
appearance: none;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.volume-slider input::-moz-range-track {
|
|
481
|
+
height: 0.2rem;
|
|
482
|
+
border: none;
|
|
483
|
+
border-radius: 0.1rem;
|
|
484
|
+
background: rgba(255, 255, 255, 0.2);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
.volume-slider input::-moz-range-progress {
|
|
488
|
+
height: 0.2rem;
|
|
489
|
+
border-radius: 0.1rem;
|
|
490
|
+
background: #ffffff;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
.volume-slider input::-moz-range-thumb {
|
|
494
|
+
width: 1.2rem;
|
|
495
|
+
height: 1.2rem;
|
|
496
|
+
border: none;
|
|
497
|
+
border-radius: 50%;
|
|
498
|
+
background: #ffffff;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
.volume-slider input:focus-visible {
|
|
502
|
+
outline: none;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.volume-slider input:focus-visible::-webkit-slider-thumb {
|
|
506
|
+
box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.45);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
.volume-slider input:focus-visible::-moz-range-thumb {
|
|
510
|
+
box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.45);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
/* the groups that give way, so a long chapter title and then an hour-long clock clip rather than pushing a button out of the player */
|
|
514
|
+
.time,
|
|
515
|
+
.live-badge,
|
|
516
|
+
.chapter {
|
|
517
|
+
flex: 0 1 auto;
|
|
518
|
+
min-width: 0;
|
|
519
|
+
overflow: hidden;
|
|
520
|
+
margin-left: 0.8rem;
|
|
521
|
+
padding: 0 1.6rem;
|
|
522
|
+
font-size: 1.4rem;
|
|
523
|
+
line-height: 4rem;
|
|
524
|
+
font-variant-numeric: tabular-nums;
|
|
525
|
+
white-space: nowrap;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
.time .current {
|
|
529
|
+
font-weight: 500;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/* the title and youtube.com's 20 px chevron after it, which opens the chapter list, in at most a quarter of the
|
|
533
|
+
player's width (measured 2026-11-10 at 704 to 1920 px, in full screen and on the watch page) */
|
|
534
|
+
.chapter {
|
|
535
|
+
flex-shrink: 100;
|
|
536
|
+
display: flex;
|
|
537
|
+
align-items: center;
|
|
538
|
+
max-width: 25cqi;
|
|
539
|
+
border: none;
|
|
540
|
+
color: inherit;
|
|
541
|
+
font: inherit;
|
|
542
|
+
font-size: 1.3rem;
|
|
543
|
+
font-weight: 500;
|
|
544
|
+
cursor: pointer;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
.chapter::after,
|
|
548
|
+
.live-badge::after {
|
|
549
|
+
inset: 0;
|
|
550
|
+
border-radius: inherit;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
.chapter-title {
|
|
554
|
+
min-width: 0;
|
|
555
|
+
overflow: hidden;
|
|
556
|
+
text-overflow: ellipsis;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
.chapter svg {
|
|
560
|
+
flex: none;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/* youtube.com's Live, in 14 px regular: a red dot at the edge, and a grey one on a button back to it while behind
|
|
564
|
+
(measured 2026-11-11) */
|
|
565
|
+
.live-badge {
|
|
566
|
+
display: flex;
|
|
567
|
+
align-items: center;
|
|
568
|
+
gap: 0.6rem;
|
|
569
|
+
border: none;
|
|
570
|
+
color: inherit;
|
|
571
|
+
font-family: inherit;
|
|
572
|
+
cursor: pointer;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
.live-badge:disabled {
|
|
576
|
+
cursor: default;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
.live-badge::before {
|
|
580
|
+
content: '';
|
|
581
|
+
flex: none;
|
|
582
|
+
width: 0.8rem;
|
|
583
|
+
height: 0.8rem;
|
|
584
|
+
border-radius: 50%;
|
|
585
|
+
background: #757575;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
.live-badge:disabled::before {
|
|
589
|
+
background: rgba(225, 0, 45, 0.9);
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
.right {
|
|
593
|
+
display: flex;
|
|
594
|
+
margin-left: 0.8rem;
|
|
595
|
+
padding: 0 0.4rem;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
.menu-anchor {
|
|
599
|
+
position: relative;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
.autoplay-track {
|
|
603
|
+
position: relative;
|
|
604
|
+
width: 3rem;
|
|
605
|
+
height: 1.8rem;
|
|
606
|
+
border-radius: 0.9rem;
|
|
607
|
+
background: rgba(255, 255, 255, 0.1);
|
|
608
|
+
transition: background 0.15s ease;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
.autoplay-knob {
|
|
612
|
+
position: absolute;
|
|
613
|
+
top: 0.2rem;
|
|
614
|
+
left: 0.2rem;
|
|
615
|
+
display: grid;
|
|
616
|
+
place-items: center;
|
|
617
|
+
width: 1.4rem;
|
|
618
|
+
height: 1.4rem;
|
|
619
|
+
border-radius: 50%;
|
|
620
|
+
background: #ffffff;
|
|
621
|
+
color: #000000;
|
|
622
|
+
transition: transform 0.15s ease, background 0.15s ease;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
.autoplay[aria-checked='true'] .autoplay-track {
|
|
626
|
+
background: #ffffff;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
.autoplay[aria-checked='true'] .autoplay-knob {
|
|
630
|
+
background: #000000;
|
|
631
|
+
color: #ffffff;
|
|
632
|
+
transform: translateX(1.2rem);
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
/* youtube.com's menu, as wide as its longest row and at most 82% of the player's height less its 70 px of controls,
|
|
636
|
+
and 413 px: 140, 239 and 350 px on 240, 360 and 495 px players (its player code, measured 2026-11-10) */
|
|
637
|
+
.settings-menu {
|
|
638
|
+
bottom: calc(100% + 0.8rem);
|
|
639
|
+
top: auto;
|
|
640
|
+
width: max-content;
|
|
641
|
+
max-width: calc(100cqi - 2.4rem);
|
|
642
|
+
max-height: min(41.3rem, (var(--player-height, 100vh) - 7rem) * 0.82);
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
/* youtube.com's Playback speed panel, measured 2026-11-10: a 57 px header of a 48 px back button and the title in
|
|
646
|
+
12 px medium over a rule, then the picker 24 px below it and 16 px from the other sides, 269 px wide in all with
|
|
647
|
+
these four chips */
|
|
648
|
+
.speed-menu {
|
|
649
|
+
padding: 0;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
.panel-header {
|
|
653
|
+
display: flex;
|
|
654
|
+
align-items: center;
|
|
655
|
+
padding: 0.4rem 0;
|
|
656
|
+
border-bottom: 1px solid var(--border-subtle);
|
|
657
|
+
color: var(--text-primary);
|
|
658
|
+
font-size: 1.2rem;
|
|
659
|
+
font-weight: 500;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
.panel-back {
|
|
663
|
+
display: grid;
|
|
664
|
+
place-items: center;
|
|
665
|
+
width: 4.8rem;
|
|
666
|
+
height: 4.8rem;
|
|
667
|
+
padding: 0;
|
|
668
|
+
border: none;
|
|
669
|
+
background: transparent;
|
|
670
|
+
color: inherit;
|
|
671
|
+
cursor: pointer;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
.speed-picker {
|
|
675
|
+
padding: 2.4rem 1.6rem 1.6rem;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
/* below these player widths the clock would clip, so the chapter goes first, then the volume slider and 8 px of each
|
|
679
|
+
right-hand button (FTube draws Next and PiP, which youtube.com's bar does not) */
|
|
680
|
+
@container player (max-width: 760px) {
|
|
681
|
+
.chapter {
|
|
682
|
+
display: none;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
@container player (max-width: 700px) {
|
|
687
|
+
.volume-slider {
|
|
688
|
+
display: none;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
.right .control {
|
|
692
|
+
width: 4rem;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
/* compact bar for phone widths: uniform 36 px circular left controls and 32 px right icons */
|
|
697
|
+
@container player (max-width: 600px) {
|
|
698
|
+
padding: 0 0.8rem;
|
|
699
|
+
|
|
700
|
+
.bar {
|
|
701
|
+
height: 4.8rem;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
.group {
|
|
705
|
+
height: 3.6rem;
|
|
706
|
+
border-radius: 1.8rem;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
.play,
|
|
710
|
+
.next,
|
|
711
|
+
.volume,
|
|
712
|
+
.volume .control {
|
|
713
|
+
width: 3.6rem;
|
|
714
|
+
height: 3.6rem;
|
|
715
|
+
border-radius: 50%;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
.next,
|
|
719
|
+
.volume,
|
|
720
|
+
.time,
|
|
721
|
+
.live-badge,
|
|
722
|
+
.right {
|
|
723
|
+
margin-left: 0.6rem;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
.time,
|
|
727
|
+
.live-badge {
|
|
728
|
+
height: 3.6rem;
|
|
729
|
+
padding: 0 0.8rem;
|
|
730
|
+
font-size: 1.2rem;
|
|
731
|
+
line-height: 3.6rem;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
.right {
|
|
735
|
+
height: 3.6rem;
|
|
736
|
+
padding: 0 0.2rem;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
.right .control {
|
|
740
|
+
width: 3.2rem;
|
|
741
|
+
height: 3.6rem;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
.control > svg {
|
|
745
|
+
width: 2rem;
|
|
746
|
+
height: 2rem;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
.autoplay,
|
|
750
|
+
.theater-toggle {
|
|
751
|
+
display: none;
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
/* below 400 px, hide PiP and tighten gaps so an hour-long clock fits on 360 px phones */
|
|
756
|
+
@container player (max-width: 400px) {
|
|
757
|
+
.next,
|
|
758
|
+
.volume,
|
|
759
|
+
.time,
|
|
760
|
+
.live-badge,
|
|
761
|
+
.right {
|
|
762
|
+
margin-left: 0.4rem;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
.control > svg {
|
|
766
|
+
width: 1.8rem;
|
|
767
|
+
height: 1.8rem;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
.pip {
|
|
771
|
+
display: none;
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
`,lr=({video:t,state:i,heights:a,storyboards:o,quality:c,onQuality:l,audioTracks:g=[],audioTrackId:v,onAudioTrack:te,hasDrc:ne=!1,stableVolume:x=!1,onStableVolume:S,ambientMode:C=!0,onAmbientMode:ae,captionTracks:T,translationLanguages:oe=[],caption:E,onCaption:se,onToggleCaption:D,theater:ce,onTheater:ue,onNext:de,autoplay:fe,onAutoplay:pe,visible:k,isLive:A=!1,chapters:j=[],onChapters:he,segments:ge=[],onMenu:N,sleepTimer:F,sleepMenu:_e=0,docked:ye=!1})=>{let[be,xe]=M(!1),[Se,Ce]=M(void 0),[I,L]=M(void 0),[we,Te]=M(!1),[z,B]=M(void 0),[V,Ee]=M(ht);O(()=>gt(Ee),[]);let De=P(null),Oe=P(null),ke=P(null),[Ae,je]=M(!1),Me=w(()=>B(void 0),[]),Ne=z!==void 0;Dn({open:Ne,onClose:Me,rootRef:Oe,triggerRef:ke}),O(()=>(N?.(Ne),()=>N?.(!1)),[Ne]);let Pe=P(_e);O(()=>{_e!==Pe.current&&(Pe.current=_e,B(`sleep`))},[_e]),O(()=>{ye&&B(void 0)},[ye]),O(()=>{let e=()=>je(document.fullscreenElement!==null);return document.addEventListener(`fullscreenchange`,e),e(),()=>document.removeEventListener(`fullscreenchange`,e)},[]),O(()=>{let e=()=>Te(document.pictureInPictureElement===t);return t.addEventListener(`enterpictureinpicture`,e),t.addEventListener(`leavepictureinpicture`,e),e(),()=>{t.removeEventListener(`enterpictureinpicture`,e),t.removeEventListener(`leavepictureinpicture`,e)}},[t]);let U=A?i.liveWindow:void 0,Fe=U?.start??0,W=U?Math.max(0,U.end-U.start):i.duration,Ie=Se??i.currentTime-Fe,Le=U!==void 0&&!Gn(U,i.currentTime),Re=j[Nn(j,Ie)],ze=Fn(j,W),Be=e=>Ln(ze,W,e),Ve=I?j[Nn(j,I.time)]:void 0,He=I&&ze.length>1?ze.findLastIndex(e=>e.start<=I.time):-1,Ue=e=>{let t=De.current;if(!t||W<=0)return 0;let n=[...t.querySelectorAll(`.part`)].map(e=>e.getBoundingClientRect());return Bn(ze,n,e)},We=e=>{W<=0||e.button!==0||(e.currentTarget.setPointerCapture(e.pointerId),xe(!0),Ce(Ue(e.clientX)))},Ge=e=>{let t=De.current;if(t&&W>0){let n=t.getBoundingClientRect();L({time:Ue(e.clientX),ratio:Math.max(0,Math.min(1,(e.clientX-n.left)/n.width))})}be&&Ce(Ue(e.clientX))},Ke=e=>{be&&(e.currentTarget.releasePointerCapture(e.pointerId),t.currentTime=Fe+Ue(e.clientX),xe(!1),Ce(void 0))},qe=e=>{let n=Number(e.currentTarget.value);t.volume=n,t.muted=n===0,vt({volume:n,muted:t.muted})},Je=()=>{let e=!t.muted;t.muted=e,!e&&t.volume===0&&(t.volume=.5),vt({muted:e,volume:t.volume})},Ye=t.playbackRate||ht().playbackRate,Xe=e=>{t.playbackRate=e,vt({playbackRate:e})},Ze=e=>{(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&(e.preventDefault(),e.key===`ArrowLeft`&&B(`root`))},Qe=()=>{let e=t.closest(`[data-player-root]`);document.fullscreenElement?document.exitFullscreen().catch(()=>{}):e?.requestFullscreen().catch(()=>{})},$e=()=>{if(document.pictureInPictureElement){document.exitPictureInPicture().catch(()=>{});return}t.requestPictureInPicture().catch(()=>{})},et=document.pictureInPictureEnabled===!0&&!t.disablePictureInPicture,nt=r(o),rt=nt&&I?e(nt,I.time):void 0,it=i.muted?0:i.volume,at=it===0?le:i.volume<.5?me:re,ot=g.find(e=>e.id===v),st=E&&T.find(e=>e.id===E.trackId),ct=n(T,oe,E),ut=!!(st?.translatable&&oe.length>0),dt=t.videoHeight>0?`${t.videoHeight}p`:void 0,ft=Math.max(0,i.duration-i.currentTime),pt=e=>U?`-${Y(W-e)}`:Y(e),mt=e=>{$n(e),B(`root`)};return R(`div`,{css:cr,className:k||be||Ne?`visible`:void 0,style:{"--player-height":`${t.clientHeight}px`},children:[R(`div`,{className:be?`scrubber scrubbing`:`scrubber`,role:`slider`,"aria-label":`Seek`,"aria-valuemin":0,"aria-valuemax":Math.round(W),"aria-valuenow":Math.round(Ie),"aria-valuetext":A&&!Le?`Live`:pt(Ie),tabIndex:0,onPointerDown:We,onPointerMove:Ge,onPointerUp:Ke,onPointerCancel:Ke,onPointerLeave:()=>L(void 0),children:[R(`div`,{className:`rail`,ref:De,children:[ze.map((e,t)=>R(`div`,{className:t===He?`part hovered`:`part`,style:{left:Be(e.start),width:Rn(ze,W,e)},children:[H(`div`,{className:`buffered`,style:{width:zn(e,i.buffered-Fe)}}),H(`div`,{className:`played`,style:{width:zn(e,Ie)}})]},t)),W>0?ge.map((e,t)=>H(`div`,{className:`sponsor`,style:{left:Be(e.start),width:`calc(${Be(Math.min(e.end,W))} - ${Be(e.start)})`}},t)):void 0,H(`div`,{className:`knob`,style:{left:Be(Ie)}})]}),I?R(`div`,{className:`preview`,style:{left:`${I.ratio*100}%`},children:[rt?H(`div`,{className:`preview-frame`,style:{width:`${rt.width}px`,height:`${rt.height}px`,backgroundImage:`url("${rt.url}")`,backgroundPosition:`-${rt.x}px -${rt.y}px`}}):void 0,R(`div`,{className:`preview-time`,children:[H(`span`,{children:pt(I.time)}),Ve?H(`span`,{className:`preview-chapter`,children:Ve.title}):void 0]})]}):void 0]}),R(`div`,{className:`bar`,children:[R(`div`,{className:`left`,children:[H(`button`,{type:`button`,className:`control group play`,"aria-label":i.ended?`Replay`:i.paused?`Play`:`Pause`,onClick:()=>i.paused?void t.play().catch(()=>{}):t.pause(),children:i.ended?H(u,{size:22,strokeWidth:2}):i.paused?H(ee,{size:22,fill:`currentColor`,strokeWidth:0}):H(_,{size:22,fill:`currentColor`,strokeWidth:0})}),de?H(`button`,{type:`button`,className:`control group next`,"aria-label":`Next`,onClick:de,children:H(ie,{size:22,fill:`currentColor`,strokeWidth:2})}):void 0,R(`div`,{className:`group volume`,children:[H(`button`,{type:`button`,className:`control`,"aria-label":i.muted?`Unmute`:`Mute`,onClick:Je,children:H(at,{size:24,strokeWidth:1.8})}),H(`div`,{className:`volume-slider`,children:H(`input`,{type:`range`,min:0,max:1,step:.01,value:it,"aria-label":`Volume`,"aria-valuetext":`${Math.round(it*100)}%`,style:{"--fill":`calc(0.6rem + ${it} * (100% - 1.2rem))`},onInput:qe})})]}),A?H(`button`,{type:`button`,className:`group live-badge`,disabled:!Le,"aria-label":Le?`Skip ahead to live broadcast`:void 0,onClick:()=>{U&&(t.currentTime=U.end)},children:`Live`}):R(`span`,{className:`group time`,children:[H(`span`,{className:`current`,children:Y(Ie)}),` / `,Y(W)]}),Re&&!A?R(`button`,{type:`button`,className:`group chapter`,"aria-label":Re.title,onClick:he,children:[H(`span`,{className:`chapter-title`,children:Re.title}),H(s,{size:20,strokeWidth:2})]}):void 0]}),H(`span`,{className:`spacer`}),R(`div`,{className:`group right`,children:[pe&&!A?H(`button`,{type:`button`,className:`control autoplay`,role:`switch`,"aria-label":`Autoplay`,"aria-checked":fe===!0,onClick:()=>pe(!fe),children:H(`span`,{className:`autoplay-track`,children:H(`span`,{className:`autoplay-knob`,children:H(fe?ee:_,{size:9,fill:`currentColor`,strokeWidth:0})})})}):void 0,T.length>0?H(`button`,{type:`button`,className:`control`,"aria-label":E?`Turn off captions`:`Turn on captions`,"aria-pressed":E!==void 0,onClick:D,children:H(E?f:m,{size:24,strokeWidth:1.8})}):void 0,R(`div`,{className:`menu-anchor`,ref:Oe,children:[H(`button`,{ref:ke,type:`button`,className:`control`,"aria-label":`Settings`,"aria-haspopup":`menu`,"aria-expanded":z!==void 0,onClick:()=>B(e=>e===void 0?`root`:void 0),children:H(ve,{size:24,strokeWidth:1.8})}),z===`root`?R(q,{label:`Player settings`,class:`settings-menu`,children:[ae?H(J,{role:`menuitemcheckbox`,selected:C,detail:C?`On`:`Off`,onSelect:ae,children:`Ambient mode`}):void 0,ne&&S?H(J,{role:`menuitemcheckbox`,selected:x,detail:x?`On`:`Off`,onSelect:()=>S(!x),children:`Stable Volume`}):void 0,H(J,{detail:ct??`Off`,disabled:T.length===0,onSelect:()=>B(`captions`),children:`Subtitles`}),g.length>1&&te?H(J,{detail:ot?.label,onSelect:()=>B(`audio`),children:`Audio track`}):void 0,H(J,{detail:ir(F,ft),onSelect:()=>B(`sleep`),children:`Sleep timer`}),H(J,{detail:lt(Ye),onSelect:()=>B(`speed`),children:`Playback speed`}),H(J,{detail:c===`auto`?`Auto${dt?` (${dt})`:``}`:`${c}p`,disabled:a.length===0,onSelect:()=>B(`quality`),children:`Quality`})]}):z===`audio`&&g.length>1&&te?R(q,{label:`Audio track`,class:`settings-menu`,children:[H(J,{icon:y,onSelect:()=>B(`root`),children:`Audio track`}),g.map(e=>H(J,{icon:v===e.id?b:void 0,detail:e.autoDubbed&&!/auto/i.test(e.label)?`auto-dubbed`:void 0,onSelect:()=>{te(e.id),B(void 0)},children:e.label},e.id))]}):z===`speed`?R(q,{label:`Playback speed`,class:`settings-menu speed-menu`,onKeyDown:Ze,children:[R(`div`,{className:`panel-header`,children:[H(`button`,{type:`button`,className:`panel-back`,"aria-label":`Back to previous menu`,onClick:()=>B(`root`),children:H(y,{size:24,strokeWidth:2})}),H(`span`,{role:`heading`,"aria-level":2,children:`Playback speed`})]}),H(`div`,{className:`speed-picker`,children:H(sr,{rate:Ye,onRate:Xe})})]}):z===`captions`?R(q,{label:`Subtitles`,class:`settings-menu`,children:[H(J,{icon:E===void 0?b:void 0,onSelect:()=>{se(void 0),B(void 0)},children:`Off`}),T.map(e=>H(J,{icon:E?.trackId===e.id&&!E.translateTo?b:void 0,detail:e.auto?`auto`:void 0,onSelect:()=>{se({trackId:e.id}),B(void 0)},children:e.label},e.id)),ut?H(J,{onSelect:()=>B(`caption-translate`),children:`Auto-translate`}):void 0,E?.translateTo&&ct?H(J,{icon:b,onSelect:()=>B(void 0),children:ct}):void 0,H(J,{onSelect:()=>B(`caption-options`),children:`Options`})]}):z===`caption-translate`&&E?R(q,{label:`Auto-translate`,class:`settings-menu`,children:[H(J,{icon:y,onSelect:()=>B(`captions`),children:`Auto-translate`}),oe.map(e=>H(J,{icon:E.translateTo===e.languageCode?b:void 0,onSelect:()=>{se({trackId:E.trackId,translateTo:e.languageCode}),B(void 0)},children:e.label},e.languageCode))]}):z===`quality`?R(q,{label:`Quality`,class:`settings-menu`,children:[H(J,{icon:c===`auto`?b:void 0,detail:dt,onSelect:()=>{l(`auto`),B(void 0)},children:`Auto`}),a.map(e=>H(J,{icon:c===e?b:void 0,onSelect:()=>{l(e),B(void 0)},children:`${e}p`},e))]}):z===`sleep`?R(q,{label:`Sleep timer`,class:`settings-menu`,children:[H(J,{icon:F===void 0?b:void 0,onSelect:()=>mt(void 0),children:`Off`}),qn.map(e=>H(J,{icon:typeof F==`object`&&F.minutes===e?b:void 0,onSelect:()=>mt(e),children:`${e} minutes`},e)),!A&&W>0?H(J,{icon:F===`end`?b:void 0,detail:rr(ft),onSelect:()=>mt(`end`),children:`End of video`}):void 0]}):z===`caption-options`?R(q,{label:`Options`,class:`settings-menu`,children:[H(J,{icon:y,onSelect:()=>B(`captions`),children:`Options`}),tt.map(e=>H(J,{detail:e.choices.find(t=>t.value===V[e.key])?.label,onSelect:()=>B(e),children:e.label},e.key)),H(J,{onSelect:()=>vt({...Object.fromEntries(tt.map(({key:e})=>[e,G[e]])),captionPosition:void 0}),children:`Reset`})]}):typeof z==`object`?R(q,{label:z.label,class:`settings-menu`,children:[H(J,{icon:y,onSelect:()=>B(`caption-options`),children:z.label}),z.choices.map(e=>H(J,{icon:V[z.key]===e.value?b:void 0,onSelect:()=>vt({[z.key]:e.value}),children:e.label},e.value))]}):void 0]}),et?H(`button`,{type:`button`,className:`control pip`,"aria-label":we?`Exit picture in picture`:`Picture in picture`,"aria-pressed":we,onClick:$e,children:H(d,{size:24,strokeWidth:1.8})}):void 0,H(`button`,{type:`button`,className:`control theater-toggle`,"aria-label":`Theater mode`,"aria-pressed":ce,onClick:ue,children:R(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,"aria-hidden":`true`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,children:[H(`rect`,{x:`2`,y:`6`,width:`20`,height:`12`,rx:`1.5`}),ce?H(`rect`,{x:`6`,y:`9`,width:`12`,height:`6`,rx:`1`}):void 0]})}),H(`button`,{type:`button`,className:`control`,"aria-label":Ae?`Exit full screen`:`Full screen`,onClick:Qe,children:H(Ae?p:h,{size:24,strokeWidth:1.8})})]})]})]})},ur=e=>{let t=e;return!(!t||t.tagName!==`INPUT`&&t.tagName!==`TEXTAREA`&&!t.isContentEditable)};N();var dr=0,fr=150,pr=360,mr=10,hr=!0,gr=e=>t(e,ht().captionsLanguage??navigator.language),_r=e=>{e.preventDefault(),e.stopPropagation()},vr=10,yr=(e,t)=>{let n=e.filter(e=>e.thumbnailWidth<=t*.6);return n.length?r(n):e.reduce((e,t)=>!e||t.thumbnailWidth<e.thumbnailWidth?t:e,void 0)},br=V`
|
|
775
|
+
position: absolute;
|
|
776
|
+
inset: 0;
|
|
777
|
+
background: #000;
|
|
778
|
+
/* Above the card's own thumbnail overlays.
|
|
779
|
+
|
|
780
|
+
The duration badge and the resume bar are siblings drawn AFTER this one, and
|
|
781
|
+
the resume bar is deliberately last so it wins wherever the two overlap. It
|
|
782
|
+
therefore also won over the scrubber: both sit flush to the bottom edge, the
|
|
783
|
+
resume bar is 4px and the scrubber's visible track is the bottom 3px of its
|
|
784
|
+
strip, so the track was painted UNDER a bar of the same brand red. What the
|
|
785
|
+
reader saw was a scrubber; what the pointer hit was a span with no handler,
|
|
786
|
+
so dragging it did nothing. The preview covers the whole thumbnail anyway,
|
|
787
|
+
so it owns this box while it is up. */
|
|
788
|
+
z-index: 1;
|
|
789
|
+
|
|
790
|
+
/* Held invisible until the video actually has a frame to show.
|
|
791
|
+
|
|
792
|
+
This box is opaque black and it covers the thumbnail from the moment it
|
|
793
|
+
mounts, so every millisecond of session setup was painted as a black
|
|
794
|
+
rectangle where a picture used to be, which reads as the card breaking
|
|
795
|
+
rather than as the card loading. Fading the preview IN is the same thing as
|
|
796
|
+
fading the thumbnail OUT, and it needs no second element and no
|
|
797
|
+
coordination with the card: the still is simply still there, underneath.
|
|
798
|
+
|
|
799
|
+
It also fixes the failure case. A preview that never produces a frame now
|
|
800
|
+
leaves the thumbnail up forever instead of leaving a black hole, which is
|
|
801
|
+
the behaviour the silent-failure design already asked for everywhere else
|
|
802
|
+
in this file. */
|
|
803
|
+
opacity: 0;
|
|
804
|
+
transition: opacity 0.18s ease;
|
|
805
|
+
|
|
806
|
+
&[data-painted] {
|
|
807
|
+
opacity: 1;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
@media (prefers-reduced-motion: reduce) {
|
|
811
|
+
transition: none;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
video {
|
|
815
|
+
display: block;
|
|
816
|
+
width: 100%;
|
|
817
|
+
height: 100%;
|
|
818
|
+
object-fit: cover;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
/* the browser sizes cues to 5% of the element's height, which is 14 px on a 500 px card */
|
|
822
|
+
video::cue {
|
|
823
|
+
font-size: 1.8rem;
|
|
824
|
+
background: rgba(8, 8, 8, 0.75);
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
/* The grab area is deliberately several times the height of the bar it draws.
|
|
828
|
+
A 3px track on the last pixels of a thumbnail is not a pointer target at
|
|
829
|
+
any card size, so the strip reaches well above the line and the line itself
|
|
830
|
+
sits at the bottom of it. */
|
|
831
|
+
.scrubber {
|
|
832
|
+
position: absolute;
|
|
833
|
+
left: 0;
|
|
834
|
+
right: 0;
|
|
835
|
+
bottom: 0;
|
|
836
|
+
height: 2.4rem;
|
|
837
|
+
display: flex;
|
|
838
|
+
align-items: flex-end;
|
|
839
|
+
cursor: pointer;
|
|
840
|
+
touch-action: none;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
.track {
|
|
844
|
+
position: relative;
|
|
845
|
+
width: 100%;
|
|
846
|
+
height: 0.4rem;
|
|
847
|
+
background: rgba(255, 255, 255, 0.3);
|
|
848
|
+
transition: height 0.12s ease;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
/* Thickens under the pointer, so the thing being aimed at confirms the aim
|
|
852
|
+
before the press rather than after it. */
|
|
853
|
+
.scrubber:hover .track {
|
|
854
|
+
height: 0.6rem;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
/* Buffered sits UNDER played and over the track, the same three-layer stack
|
|
858
|
+
the watch controls use, so the bar reads as "have it / played it / neither"
|
|
859
|
+
rather than as one bar that only knows about the playhead. */
|
|
860
|
+
.buffered {
|
|
861
|
+
position: absolute;
|
|
862
|
+
inset: 0 auto 0 0;
|
|
863
|
+
background: rgba(255, 255, 255, 0.5);
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
.fill {
|
|
867
|
+
position: absolute;
|
|
868
|
+
inset: 0 auto 0 0;
|
|
869
|
+
background: var(--brand-red);
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
/* hidden at rest, as youtube.com's playhead dot is */
|
|
873
|
+
.knob {
|
|
874
|
+
position: absolute;
|
|
875
|
+
bottom: -0.3rem;
|
|
876
|
+
width: 1.2rem;
|
|
877
|
+
height: 1.2rem;
|
|
878
|
+
margin-left: -0.6rem;
|
|
879
|
+
border-radius: 50%;
|
|
880
|
+
background: var(--brand-red);
|
|
881
|
+
pointer-events: none;
|
|
882
|
+
opacity: 0;
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
.scrubber:hover .knob,
|
|
886
|
+
.scrubber.scrubbing .knob {
|
|
887
|
+
opacity: 1;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
.scrubber.scrubbing .track {
|
|
891
|
+
height: 0.6rem;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
/* a storyboard tile scaled up to the whole preview while a drag is held, the video seeking only on release */
|
|
895
|
+
.scrub-frame {
|
|
896
|
+
position: absolute;
|
|
897
|
+
left: 50%;
|
|
898
|
+
top: 50%;
|
|
899
|
+
background-color: #000;
|
|
900
|
+
background-repeat: no-repeat;
|
|
901
|
+
pointer-events: none;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
.scrub-time {
|
|
905
|
+
position: absolute;
|
|
906
|
+
left: 50%;
|
|
907
|
+
top: 50%;
|
|
908
|
+
transform: translate(-50%, -50%);
|
|
909
|
+
padding: 0 1.2rem;
|
|
910
|
+
border-radius: 1.6rem;
|
|
911
|
+
background: rgba(0, 0, 0, 0.6);
|
|
912
|
+
color: #fff;
|
|
913
|
+
font-size: 1.4rem;
|
|
914
|
+
font-weight: 500;
|
|
915
|
+
line-height: 3.2rem;
|
|
916
|
+
font-variant-numeric: tabular-nums;
|
|
917
|
+
pointer-events: none;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
/* Storyboard scrub preview: the sheet frame plus its timestamp, centred on
|
|
921
|
+
the pointer and clamped inside the card. Identical treatment to the watch
|
|
922
|
+
scrubber (white border, time underneath) because it is the same gesture. */
|
|
923
|
+
.preview {
|
|
924
|
+
position: absolute;
|
|
925
|
+
bottom: 100%;
|
|
926
|
+
margin-bottom: 0.6rem;
|
|
927
|
+
transform: translateX(-50%);
|
|
928
|
+
pointer-events: none;
|
|
929
|
+
text-align: center;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
.preview-frame {
|
|
933
|
+
border: 2px solid #ffffff;
|
|
934
|
+
border-radius: 0.4rem;
|
|
935
|
+
background-color: #000;
|
|
936
|
+
background-repeat: no-repeat;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
.preview-time {
|
|
940
|
+
margin-top: 0.2rem;
|
|
941
|
+
font-size: 1.2rem;
|
|
942
|
+
font-weight: 500;
|
|
943
|
+
font-variant-numeric: tabular-nums;
|
|
944
|
+
text-shadow: 0 1px 3px #000;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
.time {
|
|
948
|
+
position: absolute;
|
|
949
|
+
right: 0.8rem;
|
|
950
|
+
bottom: 0.8rem;
|
|
951
|
+
padding: 0.1rem 0.4rem;
|
|
952
|
+
border-radius: 0.4rem;
|
|
953
|
+
background: var(--bg-badge);
|
|
954
|
+
color: var(--text-on-media);
|
|
955
|
+
font-size: 1.2rem;
|
|
956
|
+
font-weight: 500;
|
|
957
|
+
line-height: 1.8rem;
|
|
958
|
+
font-variant-numeric: tabular-nums;
|
|
959
|
+
pointer-events: none;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
.time.live {
|
|
963
|
+
display: flex;
|
|
964
|
+
align-items: center;
|
|
965
|
+
gap: 0.2rem;
|
|
966
|
+
background: var(--brand-red);
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
.scrubber.live {
|
|
970
|
+
pointer-events: none;
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
.corner {
|
|
974
|
+
position: absolute;
|
|
975
|
+
top: 0.8rem;
|
|
976
|
+
right: 0.8rem;
|
|
977
|
+
display: flex;
|
|
978
|
+
flex-direction: column;
|
|
979
|
+
gap: 0.8rem;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
.corner button {
|
|
983
|
+
display: flex;
|
|
984
|
+
align-items: center;
|
|
985
|
+
justify-content: center;
|
|
986
|
+
width: 2.8rem;
|
|
987
|
+
height: 2.8rem;
|
|
988
|
+
padding: 0;
|
|
989
|
+
border: none;
|
|
990
|
+
border-radius: 50%;
|
|
991
|
+
background: rgba(0, 0, 0, 0.6);
|
|
992
|
+
color: #fff;
|
|
993
|
+
cursor: pointer;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
.corner button:hover {
|
|
997
|
+
background: rgba(0, 0, 0, 0.8);
|
|
998
|
+
}
|
|
999
|
+
`,xr=({videoId:n,href:i,playerParams:a})=>{let[,s]=Se(),c=P(null),[l,u]=M(0),[d,p]=M(0),[h,g]=M(!1),[_,v]=M(!1),[ee,y]=M(!1),[b,te]=M(hr),[ne,x]=M([]),[S,C]=M([]),[w,ie]=M(),ae=P(void 0),[T,oe]=M(),[E,se]=M();O(()=>{let e=c.current;if(!e)return;let t=++dr,r=new AbortController,i,o;e.muted=hr;let s=He();s.catch(()=>{});let l=setTimeout(()=>{(async()=>{let c=await Ee();if(r.signal.aborted||t!==dr)return;let l=Math.min(pr,Math.max(240,Math.ceil(e.getBoundingClientRect().height*devicePixelRatio))),u=c.openPlayback(n,l,a,void 0,!0);u.catch(()=>{}),o={api:c,promise:u};let{startShakaPlayback:d}=await s;if(r.signal.aborted||t!==dr||(o=void 0,i=await d({api:c,video:e,videoId:n,playerParams:a,maxHeight:l,preview:!0,bufferingGoal:mr,sessionPromise:u,startTime:0,signal:r.signal,onError:()=>{}}),r.signal.aborted))return;x(i.storyboards),C(i.captionTracks),ae.current=i.selectCaption,v(i.isLive),g(!0);let f=gr(i.captionTracks);f&&(ie(f.id),i.selectCaption(f.id).catch(()=>ie(void 0)))})().catch(()=>{})},fr),d=()=>{u(e.currentTime);let t=e.buffered;for(let n=0;n<t.length;n+=1)if(t.start(n)<=e.currentTime&&e.currentTime<=t.end(n)){e.duration>0&&p(t.end(n)/e.duration);break}};e.addEventListener(`timeupdate`,d),e.addEventListener(`progress`,d);let f=()=>y(!0);return e.readyState>=2&&f(),e.addEventListener(`loadeddata`,f),()=>{if(clearTimeout(l),r.abort(),e.removeEventListener(`timeupdate`,d),e.removeEventListener(`progress`,d),e.removeEventListener(`loadeddata`,f),o){let{api:e,promise:t}=o;t.then(t=>e.closePlayback(t.id)).catch(()=>{})}i?.destroy()}},[n,a]);let D=e=>{let t=e.currentTarget.getBoundingClientRect();return Math.min(1,Math.max(0,(e.clientX-t.left)/t.width))},ce=e=>{let t=e.currentTarget.parentElement;t&&c.current?.duration&&se({ratio:D(e),width:t.clientWidth,height:t.clientHeight})},ue=e=>{let t=c.current;se(void 0),t&&t.duration&&(t.currentTime=D(e)*t.duration,u(t.currentTime))},de=e=>{let t=Math.floor(c.current?.currentTime??0);if(_||t<vr||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;e.preventDefault();let n=new URL(i,location.origin);n.searchParams.set(`t`,`${t}s`),s(n.pathname+n.search,{state:Tn(a)})},fe=()=>{let e=w?void 0:(gr(S)??t(S,void 0))?.id;ie(e),ae.current?.(e).catch(()=>ie(void 0))},pe=e=>{let t=c.current;if(!t?.duration)return;let n=e.currentTarget.getBoundingClientRect(),r=D(e);oe({x:e.clientX-n.left,width:n.width,time:r*t.duration})},k=c.current?.duration??0,A=E?r(ne):void 0,j=E&&A?e(A,E.ratio*k):void 0,me=E&&j?Math.max(E.width/j.width,E.height/j.height):1,he=E?.ratio??(k>0?l/k:0),ge=T&&!E?yr(ne,T.width):void 0,N=ge&&T?e(ge,T.time):void 0,F=N?N.width/2+2:0,_e=T?Math.min(Math.max(T.x,F),Math.max(F,T.width-F)):0;return R(`div`,{css:br,"data-painted":ee?``:void 0,onClick:de,children:[H(`video`,{ref:c,muted:!0,playsInline:!0,tabIndex:-1,"aria-hidden":`true`}),j?H(`div`,{className:`scrub-frame`,style:{width:`${j.width}px`,height:`${j.height}px`,backgroundImage:`url("${j.url}")`,backgroundPosition:`-${j.x}px -${j.y}px`,transform:`translate(-50%, -50%) scale(${me})`}}):void 0,E?H(`div`,{className:`scrub-time`,children:Y(E.ratio*k)}):void 0,h&&!E?R(`div`,{className:`corner`,onPointerDown:_r,onClick:_r,children:[H(`button`,{type:`button`,"aria-label":b?`Unmute preview`:`Mute preview`,onClick:()=>{let e=c.current;e&&(e.muted=!e.muted,hr=e.muted,te(e.muted))},children:H(b?le:re,{size:16,strokeWidth:2})}),S.length>0?H(`button`,{type:`button`,"aria-label":`Subtitles/CC`,"aria-pressed":w!==void 0,onClick:fe,children:H(w?f:m,{size:16,strokeWidth:2})}):void 0]}):void 0,h&&_?R(`span`,{className:`time live`,children:[H(o,{size:12,strokeWidth:2.5}),`LIVE`]}):h&&!E&&!T?H(`span`,{className:`time`,children:Y(k-l)}):void 0,h&&_?H(`div`,{className:`scrubber live`,children:H(`div`,{className:`track`,children:H(`div`,{className:`fill`,style:{width:`100%`}})})}):void 0,h&&!_?R(`div`,{className:E?`scrubber scrubbing`:`scrubber`,onPointerLeave:()=>oe(void 0),onPointerDown:e=>{_r(e),e.currentTarget.setPointerCapture(e.pointerId),ce(e)},onPointerMove:e=>{pe(e),e.currentTarget.hasPointerCapture(e.pointerId)&&ce(e)},onPointerUp:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&ue(e)},onPointerCancel:()=>se(void 0),onClick:_r,children:[R(`div`,{className:`track`,children:[H(`div`,{className:`buffered`,style:{width:`${Math.round(d*100)}%`}}),H(`div`,{className:`fill`,style:{width:`${he*100}%`}}),H(`div`,{className:`knob`,style:{left:`${he*100}%`}})]}),T&&!E?R(`div`,{className:`preview`,style:{left:`${_e}px`},children:[N?H(`div`,{className:`preview-frame`,style:{width:`${N.width}px`,height:`${N.height}px`,backgroundImage:`url("${N.url}")`,backgroundPosition:`-${N.x}px -${N.y}px`}}):void 0,H(`div`,{className:`preview-time`,children:Y(T.time)})]}):void 0]}):void 0]})},Sr=(e,t,{list:n,t:r}={})=>{let i=new URLSearchParams({v:t});n&&i.set(`list`,n);let a=Math.floor(r??0);return a>0&&i.set(`t`,String(a)),`${e}/watch?${i}`},Cr=e=>`/shorts/${encodeURIComponent(e)}`,wr=(e,t)=>`${e}${Cr(t)}`,Tr=e=>e.replaceAll(`&`,`&`).replaceAll(`"`,`"`).replaceAll(`<`,`<`).replaceAll(`>`,`>`),Er=({videoId:e,title:t,width:n,height:r})=>`<iframe width="${Math.round(n)}" height="${Math.round(r)}" src="https://www.youtube.com/embed/${encodeURIComponent(e)}"`+(t?` title="${Tr(t)}"`:``)+` frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>`;N();var Dr=new Set,X={items:[],currentIndex:-1,resumeIndex:0},Or=e=>{X=e;for(let e of Dr)e(X)},kr=(e=X)=>{if(e.items.length!==0)return e.currentIndex>=0?e.currentIndex+1<e.items.length?e.currentIndex+1:void 0:e.resumeIndex>=0&&e.resumeIndex<e.items.length?e.resumeIndex:void 0},Ar=(e=X)=>{if(e.items.length!==0){if(e.currentIndex>0)return e.currentIndex-1;if(e.currentIndex===-1&&e.resumeIndex>0)return Math.min(e.resumeIndex-1,e.items.length-1)}},jr=e=>!X.items.some(t=>t.id===e.id)&&(Or({...X,items:[...X.items,e]}),!0),Mr=e=>{if(e<0||e>=X.items.length)return;let t=X.items.filter((t,n)=>n!==e);if(t.length===0){Or({items:[],currentIndex:-1,resumeIndex:0});return}if(e===X.currentIndex){Or({items:t,currentIndex:-1,resumeIndex:Math.min(e,t.length)});return}let n=X.currentIndex>e?X.currentIndex-1:X.currentIndex;Or({items:t,currentIndex:n,resumeIndex:n>=0?n+1:X.resumeIndex>e?X.resumeIndex-1:Math.min(X.resumeIndex,t.length)})},Nr=(e,t,n)=>e===t?n:t<e&&n>=e?e-1:t>e&&n<=e?e+1:e,Pr=(e,t)=>{if(e===t||e<0||t<0||e>=X.items.length||t>=X.items.length)return;let n=[...X.items],[r]=n.splice(e,1);if(r){if(n.splice(t,0,r),X.currentIndex>=0){let r=Nr(X.currentIndex,e,t);Or({items:n,currentIndex:r,resumeIndex:r+1});return}Or({items:n,currentIndex:-1,resumeIndex:X.resumeIndex})}},Fr=e=>{if(e<-1||e>=X.items.length)return;let t=e>=0?e+1:0;(e!==X.currentIndex||t!==X.resumeIndex)&&Or({...X,currentIndex:e,resumeIndex:t})},Ir=e=>{if(X.items.length===0)return;let t=e?X.items.findIndex(t=>t.id===e):-1;if(t!==-1){(t!==X.currentIndex||X.resumeIndex!==t+1)&&Or({...X,currentIndex:t,resumeIndex:t+1});return}X.currentIndex!==-1&&Or({...X,currentIndex:-1})},Lr=()=>{(X.items.length!==0||X.currentIndex!==-1||X.resumeIndex!==0)&&Or({items:[],currentIndex:-1,resumeIndex:0})},Rr=()=>{let[e,t]=M(X);return O(()=>{let e=e=>t(e);return Dr.add(e),e(X),()=>{Dr.delete(e)}},[]),e};N();var Z={theater:!1,claimed:!1,chapter:-1},zr=new Set,Br=()=>{for(let e of Array.from(zr))e()},Vr=()=>Z,Hr=e=>{Z={...Z,...e},Br()},Ur=({videoId:e,startAt:t,title:n,poster:r,list:i,index:a,playerParams:o})=>{if(Z.videoId===e){(n!==void 0&&n!==Z.title||i!==Z.list||a!==Z.index)&&Hr({title:n??Z.title,poster:r??Z.poster,list:i,index:a});return}Hr({videoId:e,startAt:t,title:n,poster:r,list:i,index:a,playerParams:o,theater:ht().theater,chapter:-1,panel:void 0})},Wr=()=>{Lr(),Hr({videoId:void 0,startAt:void 0,title:void 0,poster:void 0,list:void 0,index:void 0,playerParams:void 0,theater:!1,chapter:-1,panel:void 0})},Gr=e=>Hr({theater:e}),Kr=e=>{e!==Z.chapter&&Hr({chapter:e})},qr=e=>{e!==Z.panel&&Hr({panel:e})},Jr=()=>{let[e,t]=M(Z);return O(()=>{let e=()=>t(Z);return zr.add(e),e(),()=>{zr.delete(e)}},[]),e},Yr,Xr,Zr=()=>(Yr??=Object.assign(document.createElement(`div`),{className:`player-host`}),Yr),Qr=e=>{Xr=e??void 0,Xr&&Yr&&Yr.parentElement===null&&Xr.append(Yr)},$r=e=>{let t=Zr(),n=e??Xr;n&&t.parentElement!==n&&n.append(t),Z.claimed!==!!e&&Hr({claimed:!!e})},ei=Zr,ti=[],ni=()=>{let e=ti;return ti=[],Promise.allSettled(e.map(e=>fetch(e,{priority:`low`}).then(e=>e.ok?e.arrayBuffer():Promise.reject(e.status)).then(()=>{let t=document.createElement(`link`);t.rel=`modulepreload`,t.crossOrigin=``,t.href=e,document.head.append(t)},t=>{t!==404&&ti.push(e)})))},ri=(e,t=3e4)=>{ti=[...e],addEventListener(`online`,()=>void ni()),setInterval(()=>{ti.length>0&&ni()},t),ni()},ii=async()=>{await ni(),location.reload()},ai=()=>JSON.parse(document.getElementById(`lazy-code`)?.textContent??`[]`),oi=class extends Error{},si=e=>{let t,n,r;return i=>{if(t)return he(t,i);if(r){let e=r;throw r=void 0,n=void 0,e}throw n??=e().then(e=>{t=e.default},e=>{r=new oi(e instanceof Error?e.message:String(e),{cause:e})}),n}};N();var ci=V`
|
|
1000
|
+
max-width: 56rem;
|
|
1001
|
+
margin: 4.8rem auto;
|
|
1002
|
+
padding: 2.4rem;
|
|
1003
|
+
border-radius: 1.2rem;
|
|
1004
|
+
background: var(--bg-subtle);
|
|
1005
|
+
text-align: center;
|
|
1006
|
+
|
|
1007
|
+
p {
|
|
1008
|
+
margin: 0 0 1.6rem;
|
|
1009
|
+
font-size: 1.4rem;
|
|
1010
|
+
color: var(--text-primary);
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
button {
|
|
1014
|
+
height: 3.6rem;
|
|
1015
|
+
padding: 0 1.6rem;
|
|
1016
|
+
border: none;
|
|
1017
|
+
border-radius: 1.8rem;
|
|
1018
|
+
background: var(--bg-inverse);
|
|
1019
|
+
color: var(--text-inverse);
|
|
1020
|
+
font-size: 1.4rem;
|
|
1021
|
+
font-weight: 500;
|
|
1022
|
+
cursor: pointer;
|
|
1023
|
+
}
|
|
1024
|
+
`,li=`You're offline. Check your connection.`,ui=`Something went wrong.`,di=3e4,fi=3e3,pi=-1/0;addEventListener(`online`,()=>{pi=Date.now()});var mi=(e,t=!0)=>{let n=P(e);n.current=e,E(()=>{if(!t)return;let e=()=>n.current();return addEventListener(`online`,e),()=>removeEventListener(`online`,e)},[t]),O(()=>{if(!t||!navigator.onLine||Date.now()-pi>di)return;let e=setTimeout(()=>n.current(),fi);return()=>clearTimeout(e)},[t])},hi=({line:e,retry:t,whenOnline:n=!1,reload:r=!1})=>(mi(t,n),R(`div`,{css:ci,role:`alert`,children:[H(`p`,{children:e}),r?H(`button`,{type:`button`,onClick:()=>void ii(),children:`Reload`}):H(`button`,{type:`button`,onClick:t,children:`Try again`})]})),gi=()=>fetch(`/`,{method:`HEAD`,cache:`no-store`}).then(()=>!0,()=>!1),_i=({children:e})=>{let t=P(!1),[n,r]=M(!1),[i,a]=j(e=>{console.error(`yt-client: the page failed`,e),e instanceof oi&&(t.current&&gi().then(r),t.current=!0)});if(!i)return H(B,{children:e});let o=i instanceof oi;return H(hi,{line:o&&!navigator.onLine?li:ui,retry:a,whenOnline:o,reload:o&&n})};k(),N();var vi=`[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]`,yi=500,bi=e=>[...e?.querySelectorAll(vi)??[]],xi=(e,t)=>{let n=bi(e);n.length!==0&&n[(t%n.length+n.length)%n.length]?.focus()},Si=(e,t)=>{let n=bi(e).indexOf(document.activeElement);xi(e,n===-1?t>0?0:-1:n+t)},Ci=(e,t,n)=>{if(t.key===`ArrowDown`||t.key===`ArrowUp`){t.preventDefault(),Si(e,t.key===`ArrowDown`?1:-1);return}if(t.key===`Home`||t.key===`End`){t.preventDefault(),xi(e,t.key===`Home`?0:-1);return}if(t.key===`Tab`){if(bi(e).length===0)return;t.preventDefault(),Si(e,t.shiftKey?-1:1);return}if(t.key.length!==1||t.key===` `||t.ctrlKey||t.metaKey||t.altKey)return;let r=Date.now();n.buffer=r-n.at>yi?t.key.toLowerCase():n.buffer+t.key.toLowerCase(),n.at=r;let i=bi(e);if(i.length===0)return;let a=n.buffer,o=i.indexOf(document.activeElement),s=a.length===1?o+1:Math.max(o,0),c=i.map((e,t)=>i[(s+t+i.length)%i.length]).find(e=>(e.dataset.menuLabel??e.textContent??``).trim().toLowerCase().startsWith(a));c&&(t.preventDefault(),c.focus())},wi=D(void 0),Ti=V`
|
|
1025
|
+
position: relative;
|
|
1026
|
+
display: flex;
|
|
1027
|
+
align-items: center;
|
|
1028
|
+
flex: none;
|
|
1029
|
+
`,Ei=({trigger:e,children:t,label:n,align:r=`end`,side:i,class:a,panelClass:o,onOpenChange:s})=>{let[c,l]=M(!1),u=P(null),d=P(null),f=P(null),p=P(`first`),m=P({buffer:``,at:0}),h=P(s);h.current=s;let g=w(e=>{l(e),h.current?.(e)},[]);Dn({open:c,onClose:w(()=>g(!1),[g]),rootRef:u,panelRef:d,triggerRef:f});let _=w(()=>{g(!1),f.current?.focus()},[g]);E(()=>{c&&xi(d.current,p.current===`last`?-1:0)},[c]);let v=e=>{let t=e.target?.tagName;if(t!==`INPUT`&&t!==`TEXTAREA`&&t!==`SELECT`){if(c){Ci(d.current,e,m.current);return}(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),p.current=e.key===`ArrowUp`?`last`:`first`,g(!0))}},ee=fe(()=>({close:_}),[_]),y={ref:f,"aria-haspopup":`menu`,"aria-expanded":c,onClick:()=>{p.current=`first`,g(!c)}};return R(`div`,{css:Ti,className:a,ref:u,"data-open":c?`true`:void 0,onKeyDown:v,children:[typeof e==`function`?e(y):oe(e,y),c?H(wi.Provider,{value:ee,children:H(q,{label:n,align:r,side:i,class:o,anchor:f,panelRef:d,onKeyDown:v,children:t})}):void 0]})},Di=({at:e,label:t,media:n,onClose:r,children:i})=>{let a=P(null),o=P({buffer:``,at:0});Dn({open:!0,onClose:r,rootRef:a}),E(()=>xi(a.current,0),[]);let s=fe(()=>({close:r}),[r]);return H(wi.Provider,{value:s,children:H(q,{label:t,at:e,media:n,panelRef:a,onKeyDown:e=>Ci(a.current,e,o.current),children:i})})},Oi=V`
|
|
1030
|
+
width: 100%;
|
|
1031
|
+
min-height: 4rem;
|
|
1032
|
+
display: flex;
|
|
1033
|
+
align-items: center;
|
|
1034
|
+
gap: 1.6rem;
|
|
1035
|
+
padding: 0 1.6rem;
|
|
1036
|
+
border: none;
|
|
1037
|
+
background: transparent;
|
|
1038
|
+
color: var(--text-primary);
|
|
1039
|
+
font-size: 1.4rem;
|
|
1040
|
+
text-align: left;
|
|
1041
|
+
cursor: pointer;
|
|
1042
|
+
transition: background 0.15s ease;
|
|
1043
|
+
|
|
1044
|
+
> svg {
|
|
1045
|
+
flex: none;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
&:hover:not([aria-disabled='true']),
|
|
1049
|
+
&:focus-visible {
|
|
1050
|
+
background: var(--bg-hover);
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
&[aria-disabled='true'] {
|
|
1054
|
+
opacity: 0.5;
|
|
1055
|
+
cursor: default;
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
.label {
|
|
1059
|
+
flex: 1;
|
|
1060
|
+
min-width: 0;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
.detail {
|
|
1064
|
+
color: var(--text-secondary);
|
|
1065
|
+
white-space: nowrap;
|
|
1066
|
+
}
|
|
1067
|
+
`,Q=({icon:e,label:t,detail:n,checked:r,disabled:i,trailingIcon:a,closeOnSelect:o,onSelect:s,ariaLabel:c})=>{let l=T(wi),u=o??r===void 0;return R(`button`,{type:`button`,css:Oi,role:r===void 0?`menuitem`:`menuitemcheckbox`,"aria-checked":r,"aria-disabled":i?`true`:void 0,tabIndex:-1,"aria-label":typeof t==`string`?void 0:c,"data-menu-label":typeof t==`string`?t:c,onClick:()=>{i||(s?.(),u&&l?.close())},children:[e?H(e,{size:20,strokeWidth:1.5}):r===void 0?void 0:H(r?C:pe,{size:20,strokeWidth:1.5}),H(`span`,{className:`label`,children:t}),n?H(`span`,{className:`detail`,children:n}):void 0,a?H(a,{size:16,strokeWidth:1.5}):void 0,e&&r?H(b,{size:20,strokeWidth:1.5}):void 0]})},ki=V`
|
|
1068
|
+
.section-title {
|
|
1069
|
+
padding: 0.8rem 1.6rem 0.4rem;
|
|
1070
|
+
font-size: 1.2rem;
|
|
1071
|
+
font-weight: 500;
|
|
1072
|
+
color: var(--text-secondary);
|
|
1073
|
+
}
|
|
1074
|
+
`,Ai=({title:e,children:t})=>{let n=ge();return R(`div`,{css:ki,role:`group`,"aria-labelledby":n,children:[H(`div`,{className:`section-title`,id:n,children:e}),t]})},ji=V`
|
|
1075
|
+
height: 1px;
|
|
1076
|
+
margin: 0.8rem 0;
|
|
1077
|
+
background: var(--border-subtle);
|
|
1078
|
+
`,Mi=()=>H(`div`,{css:ji,role:`separator`}),Ni=/status code 5\d\d|fetch|network|load failed|JSON/i,Pi=e=>!navigator.onLine||Ni.test(e.message)?li:ui,Fi=({error:e,reexecute:t})=>H(hi,{line:Pi(e),retry:()=>t({requestPolicy:`network-only`}),whenOnline:!0}),Ii=({error:e,reexecute:t})=>(mi(()=>t({requestPolicy:`network-only`})),H(Q,{label:Pi(e),disabled:!0}));N();var Li=Te(`
|
|
1079
|
+
mutation SetSubscribed($channelId: ID!, $subscribed: Boolean!) {
|
|
1080
|
+
setSubscribed(channelId: $channelId, subscribed: $subscribed) {
|
|
1081
|
+
id
|
|
1082
|
+
isSubscribed
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
`),Ri=Te(`
|
|
1086
|
+
mutation SetNotificationLevel($channelId: ID!, $level: NotificationLevel!) {
|
|
1087
|
+
setNotificationLevel(channelId: $channelId, level: $level) {
|
|
1088
|
+
id
|
|
1089
|
+
notificationLevel
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
`),zi=V`
|
|
1093
|
+
display: flex;
|
|
1094
|
+
align-items: center;
|
|
1095
|
+
gap: 0.8rem;
|
|
1096
|
+
|
|
1097
|
+
.subscribe {
|
|
1098
|
+
flex: none;
|
|
1099
|
+
display: flex;
|
|
1100
|
+
align-items: center;
|
|
1101
|
+
gap: 0.6rem;
|
|
1102
|
+
height: var(--action-height, 3.6rem);
|
|
1103
|
+
padding: 0 1.6rem;
|
|
1104
|
+
border: none;
|
|
1105
|
+
border-radius: calc(var(--action-height, 3.6rem) / 2);
|
|
1106
|
+
background: var(--bg-inverse);
|
|
1107
|
+
color: var(--text-inverse);
|
|
1108
|
+
font-size: 1.4rem;
|
|
1109
|
+
font-weight: 500;
|
|
1110
|
+
cursor: pointer;
|
|
1111
|
+
transition: background 0.15s ease, color 0.15s ease;
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
.subscribe:hover:not(:disabled) {
|
|
1115
|
+
background: var(--bg-inverse-hover);
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
.subscribe:disabled {
|
|
1119
|
+
opacity: 0.6;
|
|
1120
|
+
cursor: default;
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
.subscribe.subscribed {
|
|
1124
|
+
background: var(--bg-chip);
|
|
1125
|
+
color: var(--text-primary);
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
.subscribe.subscribed:hover:not(:disabled) {
|
|
1129
|
+
background: var(--bg-chip-hover);
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
.bell {
|
|
1133
|
+
position: relative;
|
|
1134
|
+
}
|
|
1135
|
+
`,Bi=()=>{let[e,t]=Ce(Li);return{fetching:e.fetching,toggle:async(e,n)=>{let r=await t({channelId:e,subscribed:!n});if(r.error){L(Pi(r.error));return}return L(n?`Unsubscribed`:`Subscribed`),r.data?.setSubscribed.isSubscribed===!0}}},Vi=[{level:`ALL`,label:`All`,Icon:ne},{level:`PERSONALIZED`,label:`Personalized`,Icon:v},{level:`NONE`,label:`None`,Icon:xe}],Hi=({channelId:e,subscribed:t,notificationLevel:n})=>{let{fetching:r,toggle:i}=Bi(),[a,o]=Ce(Ri),[s,c]=M(!1),l=P(null),u=P(null);Dn({open:s,onClose:w(()=>c(!1),[]),rootRef:l,triggerRef:u});let d=r||a.fetching,f=t===!0,p=Vi.find(e=>e.level===n)??Vi[1],m=()=>{if(e){if(t==null){De();return}i(e,f)}},h=t=>{c(!1),e&&t!==n&&o({channelId:e,level:t}).then(e=>{e.error&&L(Pi(e.error))})};return R(`div`,{css:zi,ref:l,children:[H(`button`,{type:`button`,className:f?`subscribe subscribed`:`subscribe`,disabled:d||!e,"aria-pressed":f,onClick:m,children:f?R(B,{children:[H(b,{size:18,strokeWidth:1.5}),`Subscribed`]}):`Subscribe`}),f?R(`div`,{className:`bell`,children:[R(`button`,{ref:u,type:`button`,className:`subscribe subscribed`,"aria-label":`Notifications: ${p.label}`,"aria-haspopup":`menu`,"aria-expanded":s,disabled:d,onClick:()=>c(e=>!e),children:[H(p.Icon,{size:18,strokeWidth:1.5}),H(ue,{size:14,strokeWidth:1.5})]}),s?H(q,{label:`Notifications`,align:`start`,children:Vi.map(e=>H(J,{icon:e.Icon,selected:e.level===p.level,onSelect:()=>h(e.level),children:e.label},e.level))}):void 0]}):void 0]})};N();var Ui=V`
|
|
1136
|
+
position: fixed;
|
|
1137
|
+
inset: 0;
|
|
1138
|
+
z-index: var(--z-dialog);
|
|
1139
|
+
display: grid;
|
|
1140
|
+
place-items: center;
|
|
1141
|
+
padding: 2.4rem;
|
|
1142
|
+
|
|
1143
|
+
.scrim {
|
|
1144
|
+
position: absolute;
|
|
1145
|
+
inset: 0;
|
|
1146
|
+
background: var(--bg-scrim);
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
.panel {
|
|
1150
|
+
position: relative;
|
|
1151
|
+
width: 100%;
|
|
1152
|
+
max-width: 48rem;
|
|
1153
|
+
max-height: calc(100vh - 4.8rem);
|
|
1154
|
+
display: flex;
|
|
1155
|
+
flex-direction: column;
|
|
1156
|
+
border-radius: 1.2rem;
|
|
1157
|
+
background: var(--bg-menu);
|
|
1158
|
+
box-shadow: var(--shadow-menu);
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
.panel.wide {
|
|
1162
|
+
max-width: 96rem;
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
.head {
|
|
1166
|
+
display: flex;
|
|
1167
|
+
align-items: center;
|
|
1168
|
+
gap: 1.6rem;
|
|
1169
|
+
padding: 1.6rem 1.6rem 1.2rem 2.4rem;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
.heading {
|
|
1173
|
+
flex: 1;
|
|
1174
|
+
min-width: 0;
|
|
1175
|
+
font-size: 2rem;
|
|
1176
|
+
font-weight: 500;
|
|
1177
|
+
color: var(--text-primary);
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
.close {
|
|
1181
|
+
flex: none;
|
|
1182
|
+
width: 4rem;
|
|
1183
|
+
height: 4rem;
|
|
1184
|
+
display: flex;
|
|
1185
|
+
align-items: center;
|
|
1186
|
+
justify-content: center;
|
|
1187
|
+
border: none;
|
|
1188
|
+
border-radius: 50%;
|
|
1189
|
+
background: transparent;
|
|
1190
|
+
color: var(--text-primary);
|
|
1191
|
+
cursor: pointer;
|
|
1192
|
+
transition: background 0.15s ease;
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
.close:hover {
|
|
1196
|
+
background: var(--bg-hover);
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
.body {
|
|
1200
|
+
min-height: 0;
|
|
1201
|
+
overflow-y: auto;
|
|
1202
|
+
padding: 0 2.4rem 2.4rem;
|
|
1203
|
+
color: var(--text-primary);
|
|
1204
|
+
}
|
|
1205
|
+
`,Wi=`a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])`,Gi=({title:e,onClose:t,onEscape:n=t,children:r,wide:i=!1,closeButton:a=!0})=>{let o=P(null);return E(()=>{let e=document.activeElement,t=o.current,r=t?.querySelector(Wi);r?r.focus():t?.focus();let i=document.body.style.overflow;document.body.style.overflow=`hidden`;let a=e=>{if(e.key===`Escape`){e.stopPropagation(),n();return}if(e.key!==`Tab`||!t)return;let r=[...t.querySelectorAll(Wi)];if(r.length===0)return;let i=r[0],a=r[r.length-1],o=document.activeElement;e.shiftKey&&(o===i||o===t)?(e.preventDefault(),a.focus()):!e.shiftKey&&o===a&&(e.preventDefault(),i.focus())};return document.addEventListener(`keydown`,a),()=>{document.removeEventListener(`keydown`,a),document.body.style.overflow=i,e?.focus()}},[n]),R(`div`,{css:Ui,children:[H(`div`,{className:`scrim`,onClick:t}),R(`div`,{className:i?`panel wide`:`panel`,ref:o,role:`dialog`,"aria-modal":`true`,"aria-label":e,tabIndex:-1,children:[R(`div`,{className:`head`,children:[H(`h2`,{className:`heading`,children:e}),a?H(`button`,{type:`button`,className:`close`,"aria-label":`Close`,onClick:t,children:H(A,{size:24,strokeWidth:1.5})}):void 0]}),H(`div`,{className:`body`,children:r})]})]})};k(),S(),N();var Ki=V`
|
|
1206
|
+
padding: 0;
|
|
1207
|
+
border: none;
|
|
1208
|
+
background: none;
|
|
1209
|
+
font: inherit;
|
|
1210
|
+
text-align: start;
|
|
1211
|
+
cursor: pointer;
|
|
1212
|
+
`,qi=V`
|
|
1213
|
+
display: inline-flex;
|
|
1214
|
+
flex: none;
|
|
1215
|
+
|
|
1216
|
+
& > * {
|
|
1217
|
+
width: var(--avatar-size, 2.4rem);
|
|
1218
|
+
height: var(--avatar-size, 2.4rem);
|
|
1219
|
+
border-radius: 50%;
|
|
1220
|
+
object-fit: cover;
|
|
1221
|
+
background: var(--bg-chip);
|
|
1222
|
+
box-shadow: 0 0 0 0.2rem var(--bg-base);
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
& > * + * {
|
|
1226
|
+
margin-left: calc(var(--avatar-size, 2.4rem) / -3);
|
|
1227
|
+
}
|
|
1228
|
+
`,Ji=V`
|
|
1229
|
+
margin: 0;
|
|
1230
|
+
padding: 0;
|
|
1231
|
+
list-style: none;
|
|
1232
|
+
|
|
1233
|
+
li {
|
|
1234
|
+
display: flex;
|
|
1235
|
+
align-items: center;
|
|
1236
|
+
gap: 1.2rem;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
a {
|
|
1240
|
+
flex: 1;
|
|
1241
|
+
min-width: 0;
|
|
1242
|
+
display: flex;
|
|
1243
|
+
align-items: center;
|
|
1244
|
+
gap: 1.6rem;
|
|
1245
|
+
margin: 0 -1.2rem;
|
|
1246
|
+
padding: 0.8rem 1.2rem;
|
|
1247
|
+
border-radius: 0.8rem;
|
|
1248
|
+
color: var(--text-primary);
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
li > div {
|
|
1252
|
+
flex: none;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
a:hover {
|
|
1256
|
+
background: var(--bg-hover);
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
img,
|
|
1260
|
+
.initial {
|
|
1261
|
+
flex: none;
|
|
1262
|
+
width: 4rem;
|
|
1263
|
+
height: 4rem;
|
|
1264
|
+
border-radius: 50%;
|
|
1265
|
+
object-fit: cover;
|
|
1266
|
+
background: var(--bg-chip);
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
.initial {
|
|
1270
|
+
display: flex;
|
|
1271
|
+
align-items: center;
|
|
1272
|
+
justify-content: center;
|
|
1273
|
+
font-size: 1.6rem;
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
.text {
|
|
1277
|
+
flex: 1;
|
|
1278
|
+
min-width: 0;
|
|
1279
|
+
display: flex;
|
|
1280
|
+
flex-direction: column;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
.name {
|
|
1284
|
+
font-size: 1.6rem;
|
|
1285
|
+
font-weight: 500;
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
.detail {
|
|
1289
|
+
font-size: 1.2rem;
|
|
1290
|
+
color: var(--text-secondary);
|
|
1291
|
+
}
|
|
1292
|
+
`,Yi=({channel:e})=>e.avatar?H(`img`,{src:e.avatar,alt:``,loading:`lazy`}):H(`span`,{className:`initial`,"aria-hidden":`true`,children:e.name.slice(0,1).toUpperCase()}),Xi=({parts:e,badgeSize:t})=>H(B,{children:(e??[]).map((e,n)=>R(ce,{children:[n>0?` `:void 0,e.text,H(kt,{channel:e,size:t})]},n))}),Zi=({channels:e})=>H(`span`,{css:qi,"aria-hidden":`true`,children:e.slice(0,2).map(e=>H(Yi,{channel:e},e.id))}),Qi=({channels:e,subscribe:t,onClose:n})=>H(Gi,{title:`Collaborators`,onClose:n,children:H(`ul`,{css:Ji,children:e.map(e=>R(`li`,{children:[R(ke,{href:`/channel/${e.id}`,onClick:n,children:[H(Yi,{channel:e}),R(`span`,{className:`text`,children:[R(`span`,{className:`name`,children:[e.name,H(kt,{channel:e})]}),H(`span`,{className:`detail`,children:[e.handle,e.subscriberCountText].filter(Boolean).join(` • `)})]}),t?void 0:H(s,{size:24,strokeWidth:1.5,"aria-hidden":`true`})]}),t?H(Hi,{channelId:e.id,subscribed:e.isSubscribed,notificationLevel:e.notificationLevel}):void 0]},e.id))})}),$i=({channels:e,className:t,label:n,subscribe:r=!1,children:i})=>{let[a,o]=M(!1),s=w(()=>o(!1),[]);return R(B,{children:[H(`button`,{type:`button`,css:Ki,className:t,"aria-label":n,"aria-haspopup":`dialog`,onClick:()=>o(!0),children:i}),a?g(H(Qi,{channels:e,subscribe:r,onClose:s}),document.body):void 0]})};N();var ea=`yt-client:dismissed`,ta={videos:new Set,channels:new Set},na=e=>{if(!Array.isArray(e))return[];let t=new Set,n=[];for(let r of e)typeof r==`string`&&r.length>0&&!t.has(r)&&(t.add(r),n.push(r));return n.slice(-500)},ra=()=>{try{if(typeof localStorage>`u`)return ta;let e=localStorage.getItem(ea);if(!e)return ta;let t=JSON.parse(e);return!t||typeof t!=`object`?ta:{videos:new Set(na(t.videos)),channels:new Set(na(t.channels))}}catch{return ta}},ia=e=>{try{typeof localStorage<`u`&&localStorage.setItem(ea,JSON.stringify({videos:[...e.videos],channels:[...e.channels]}))}catch{}},$=ra(),aa=new Set,oa=e=>{$=e,ia(e);for(let e of aa)e($)},sa=e=>{if(!e||$.videos.has(e))return;let t=[...$.videos,e].slice(-500);oa({...$,videos:new Set(t)})},ca=e=>{if(!$.videos.has(e))return;let t=new Set($.videos);t.delete(e),oa({...$,videos:t})},la=e=>{if(!e||$.channels.has(e))return;let t=[...$.channels,e].slice(-500);oa({...$,channels:new Set(t)})},ua=e=>{if(!$.channels.has(e))return;let t=new Set($.channels);t.delete(e),oa({...$,channels:t})},da=()=>{($.videos.size!==0||$.channels.size!==0)&&oa({videos:new Set,channels:new Set})},fa=(e,t)=>e.videos.has(t.id)||!!t.channel?.id&&e.channels.has(t.channel.id),pa=()=>{let[e,t]=M($);return O(()=>{let e=e=>t(e);return aa.add(e),e($),()=>{aa.delete(e)}},[]),e},ma=e=>`/playlist?list=${encodeURIComponent(e)}`,ha=e=>{let t=e?.toUpperCase();if(t===`PUBLIC`)return F;if(t===`UNLISTED`)return _e;if(t===`PRIVATE`)return x},ga=e=>e?.toUpperCase()===`PUBLIC`?void 0:ha(e),_a=`M10 8.64 15.27 12 10 15.36V8.64M8 5v14l11-7L8 5Z`,va=`m13.974 2.052-8 4.7a4 4 0 00.385 7.097l.942.423-1.327.78a4 4 0 004.053 6.898l8-4.7a4 4 0 00-.385-7.097L16.7 9.73l1.328-.78a4 4 0 00-4.053-6.898Z`,ya=`M6 .5a5.5 5.5 0 100 11 5.5 5.5 0 000-11Zm.27 2.045.906 1.837 2.027.295a.3.3 0 01.166.511l-1.467 1.43.346 2.019a.3.3 0 01-.435.316L6 8l-1.813.953a.3.3 0 01-.435-.316l.346-2.019-1.467-1.43a.3.3 0 01.166-.511l2.027-.295.907-1.837a.3.3 0 01.539 0Z`,ba=V`
|
|
1293
|
+
flex: none;
|
|
1294
|
+
fill: currentColor;
|
|
1295
|
+
`,xa=V`
|
|
1296
|
+
margin-right: 0.2rem;
|
|
1297
|
+
vertical-align: -0.15em;
|
|
1298
|
+
`,Sa=()=>H(`svg`,{css:ba,width:12,height:12,viewBox:`0 0 24 24`,"aria-hidden":`true`,"data-mark":`music`,children:H(`path`,{d:Ot})}),Ca=V`
|
|
1299
|
+
margin: 0.3rem 0;
|
|
1300
|
+
`,wa=()=>H(`svg`,{css:[ba,Ca],width:12,height:12,viewBox:`0 0 24 24`,"aria-hidden":`true`,"data-mark":`shorts`,children:H(`path`,{d:va})}),Ta=()=>H(`svg`,{css:[ba,xa],width:12,height:12,viewBox:`0 0 24 24`,"aria-hidden":`true`,"data-mark":`views`,children:H(`path`,{d:_a})}),Ea=V`
|
|
1301
|
+
position: absolute;
|
|
1302
|
+
top: 0.4rem;
|
|
1303
|
+
left: 0.4rem;
|
|
1304
|
+
padding: 0.1rem 0.4rem;
|
|
1305
|
+
border-radius: 0.4rem;
|
|
1306
|
+
background: #ffffff;
|
|
1307
|
+
color: #0f0f0f;
|
|
1308
|
+
font-size: 1.2rem;
|
|
1309
|
+
font-weight: 500;
|
|
1310
|
+
line-height: 1.8rem;
|
|
1311
|
+
`,Da=({label:e})=>H(`span`,{css:Ea,"data-mark":`corner`,children:e}),Oa=V`
|
|
1312
|
+
display: inline-block;
|
|
1313
|
+
margin: 0 0.4rem;
|
|
1314
|
+
`,ka=({video:e})=>{let t=Ne(e.viewCount),n=e.publishedText||void 0;if(t===void 0&&n===void 0)return null;let r=e.metaDelimiter??void 0;return R(`div`,{className:`meta`,children:[e.viewCountIcon?H(Ta,{}):void 0,t,t!==void 0&&n!==void 0?r===void 0?` • `:H(`span`,{css:Oa,children:r}):void 0,n]})},Aa=V`
|
|
1315
|
+
display: flex;
|
|
1316
|
+
align-items: center;
|
|
1317
|
+
gap: 0.2rem;
|
|
1318
|
+
color: var(--membership);
|
|
1319
|
+
font-size: 1.2rem;
|
|
1320
|
+
font-weight: 500;
|
|
1321
|
+
line-height: 1.8rem;
|
|
1322
|
+
`,ja=()=>R(`div`,{css:Aa,className:`members-only`,children:[H(`svg`,{css:ba,width:12,height:12,viewBox:`0 0 12 12`,"aria-hidden":`true`,children:H(`path`,{d:ya})}),`Members only`]});N();var Ma=({pages:e,key:t})=>{let n=[],r=new Set;for(let i of e)for(let e of i.items){let i=t(e);r.has(i)||(r.add(i),n.push(e))}return{items:n,cursor:e[e.length-1]?.cursor??void 0}},Na=V`
|
|
1323
|
+
/* Spans the row so the probe never claims a card slot in a grid parent. */
|
|
1324
|
+
grid-column: 1 / -1;
|
|
1325
|
+
height: 0.1rem;
|
|
1326
|
+
`,Pa=`1200px 0px`,Fa=({onVisible:e,disabled:t})=>{let n=P(null),r=P(e);return r.current=e,O(()=>{let e=n.current;if(!e||t)return;let i=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&r.current()},{rootMargin:Pa});return i.observe(e),()=>i.disconnect()},[t]),H(`div`,{css:Na,ref:n,"aria-hidden":`true`})};N();var Ia=(e,t)=>{let n=new URLSearchParams({v:e});return t?.list!==void 0&&t.list.length>0&&(n.set(`list`,t.list),t.index!==void 0&&Number.isFinite(t.index)&&n.set(`index`,String(t.index))),`/watch?${n}`},La=e=>e!=null&&e>0?Math.min(e,100):void 0,Ra=V`
|
|
1327
|
+
min-width: 24rem;
|
|
1328
|
+
`,za=Te(`
|
|
1329
|
+
mutation SubmitFeedback($token: String!) {
|
|
1330
|
+
submitFeedback(token: $token)
|
|
1331
|
+
}
|
|
1332
|
+
`),Ba=({videoId:e,title:t,thumbnail:n,durationSeconds:r,channel:i,notInterestedToken:o,dontRecommendToken:s,recommendable:u,short:d,live:f,saved:p,onSaved:m})=>{let{ready:h,signedIn:g}=we(),[_,v]=M(`root`),[ee,ne]=M(!1),[x,S]=M([]),[C,re]=M(void 0),w=P(null),ie=P(_);E(()=>{ie.current!==_&&(ie.current=_,w.current?.querySelector(`[role="menuitem"], [role="menuitemcheckbox"]`)?.focus())},[_]);let[{data:T,error:oe,fetching:D},ce]=z({query:Oe,variables:{cursor:x[x.length-1]?.cursor},pause:!ee||!h||!g}),[,le]=Ce(I),[,O]=Ce(za),ue=T?.playlists,{items:de,cursor:fe}=Ma({pages:ue?[...x,ue]:x,key:e=>e.id}),pe=de.filter(e=>e.id!==`WL`),k=()=>{ue?.cursor&&!D&&S(x[x.length-1]===ue?x:[...x,ue])},A=(t,n)=>{C!==void 0||p.includes(t)||(re(t),le({playlistId:t,videoIds:[e]}).then(e=>{if(re(void 0),e.error){L(Pi(e.error));return}m(t),L(`Saved to ${n}`)}))},j=()=>{let t=d?wr(location.origin,e):`${location.origin}${Ia(e)}`,n=navigator.clipboard;if(!n){L(`Could not copy the link`);return}n.writeText(t).then(()=>L(`Link copied to clipboard`),()=>L(`Could not copy the link`))},me=()=>{let a=jr({id:e,title:t,thumbnail:n,durationSeconds:r,channel:i}),o=!Vr().videoId;o&&Ur({videoId:e,title:t,poster:n??void 0}),L(a?`Added to queue`:o?`Playing from queue`:`Already in queue`)},he=()=>{sa(e),g&&o&&O({token:o}).then(e=>{e.error&&L(Pi(e.error))}),L(`Video removed`,{label:`Undo`,onAction:()=>ca(e)})},ge=()=>{let e=i?.id;e&&la(e),g&&s&&O({token:s}).then(e=>{e.error&&L(Pi(e.error))});let t=i?.name?`We won't recommend ${i.name}`:`We won't recommend this channel`;L(t,e?{label:`Undo`,onAction:()=>ua(e)}:void 0)},N=p.includes(`WL`),F=u&&!d&&!!(i?.id||s);return H(`div`,{css:Ra,role:`presentation`,ref:w,children:_===`root`?R(B,{children:[d?void 0:H(Q,{icon:a,label:`Add to queue`,onSelect:me}),H(Q,{icon:N?b:ye,label:N?`Saved to Watch later`:`Save to Watch later`,disabled:!h||C!==void 0||N,onSelect:()=>{if(!g){De();return}A(`WL`,`Watch later`)}}),H(Q,{icon:se,label:`Save to playlist`,disabled:!h,closeOnSelect:!1,onSelect:()=>{if(!g){De();return}ne(!0),v(`playlists`)}}),H(Mi,{}),f?void 0:H(Q,{icon:ae,label:`Download`,onSelect:()=>hn({videoId:e,title:t,thumbnail:n,channelName:i?.name})}),H(Q,{icon:l,label:`Share`,onSelect:j}),u&&!d?R(B,{children:[H(Mi,{}),H(Q,{icon:c,label:`Not interested`,onSelect:he}),F?H(Q,{icon:te,label:`Don't recommend channel`,onSelect:ge}):void 0]}):void 0]}):R(B,{children:[H(Q,{icon:y,label:`Back`,closeOnSelect:!1,onSelect:()=>v(`root`)}),H(Mi,{}),pe.map(e=>H(Q,{label:e.title,detail:e.videoCountText??void 0,checked:p.includes(e.id),disabled:C!==void 0||p.includes(e.id),onSelect:()=>A(e.id,e.title)},e.id)),D&&pe.length===0?H(Q,{label:`Loading…`,disabled:!0}):void 0,!D&&!oe&&pe.length===0?H(Q,{label:`No playlists yet`,disabled:!0}):void 0,oe&&!D?H(Ii,{error:oe,reexecute:ce}):void 0,fe&&!oe?H(Q,{label:D?`Loading more…`:`Show more`,disabled:D,closeOnSelect:!1,onSelect:k}):void 0]})})},Va=({videoId:e,title:t,thumbnail:n,durationSeconds:r,channel:i,notInterestedToken:a,dontRecommendToken:o,recommendable:s=!1,iconSize:c=20,short:l=!1,live:u=!1,class:d})=>{let[f,p]=M([]);return H(Ei,{class:d,label:`More actions for ${t}`,align:`start`,trigger:H(`button`,{type:`button`,className:`more`,"aria-label":`More actions for ${t}`,children:H(be,{size:c,strokeWidth:1.5})}),children:H(Ba,{videoId:e,title:t,thumbnail:n,durationSeconds:r,channel:i,notInterestedToken:a,dontRecommendToken:o,recommendable:s,short:l,live:u,saved:f,onSaved:e=>p(t=>t.includes(e)?t:[...t,e])})})},Ha=V`
|
|
1333
|
+
display: flex;
|
|
1334
|
+
flex-direction: column;
|
|
1335
|
+
min-width: 0;
|
|
1336
|
+
|
|
1337
|
+
.thumb {
|
|
1338
|
+
position: relative;
|
|
1339
|
+
display: block;
|
|
1340
|
+
aspect-ratio: 16 / 9;
|
|
1341
|
+
border-radius: 1.2rem;
|
|
1342
|
+
overflow: hidden;
|
|
1343
|
+
background: var(--bg-elevated);
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
/* The card does NOT grow on hover. It used to, matching upstream's 4% lift,
|
|
1347
|
+
with an elevated surface behind the whole card so the grown thumbnail did
|
|
1348
|
+
not read as a picture that had outgrown its own caption. Both are gone by
|
|
1349
|
+
request: the preview now arrives inside a thumbnail that stays exactly
|
|
1350
|
+
where it was, so nothing under the pointer moves while the reader aims. */
|
|
1351
|
+
|
|
1352
|
+
/* Shorts are vertical, and a 16/9 box would letterbox one into a slot mostly
|
|
1353
|
+
made of background. The card keeps its grid column and only the thumbnail
|
|
1354
|
+
changes shape, so the surrounding layout is untouched. */
|
|
1355
|
+
&.short .thumb {
|
|
1356
|
+
aspect-ratio: 9 / 16;
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
.thumb img {
|
|
1360
|
+
display: block;
|
|
1361
|
+
width: 100%;
|
|
1362
|
+
height: 100%;
|
|
1363
|
+
object-fit: cover;
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
.thumb img.moving {
|
|
1367
|
+
position: absolute;
|
|
1368
|
+
inset: 0;
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
.badge {
|
|
1372
|
+
position: absolute;
|
|
1373
|
+
right: 0.6rem;
|
|
1374
|
+
bottom: 0.6rem;
|
|
1375
|
+
display: flex;
|
|
1376
|
+
align-items: center;
|
|
1377
|
+
gap: 0.2rem;
|
|
1378
|
+
padding: 0.1rem 0.4rem;
|
|
1379
|
+
border-radius: 0.4rem;
|
|
1380
|
+
background: var(--bg-badge);
|
|
1381
|
+
color: var(--text-on-media);
|
|
1382
|
+
font-size: 1.2rem;
|
|
1383
|
+
font-weight: 500;
|
|
1384
|
+
line-height: 1.8rem;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
.badge.live {
|
|
1388
|
+
background: var(--brand);
|
|
1389
|
+
text-transform: uppercase;
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
.progress {
|
|
1393
|
+
position: absolute;
|
|
1394
|
+
left: 0;
|
|
1395
|
+
right: 0;
|
|
1396
|
+
bottom: 0;
|
|
1397
|
+
display: block;
|
|
1398
|
+
height: 0.4rem;
|
|
1399
|
+
background: var(--bg-scrim);
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
.progress span {
|
|
1403
|
+
display: block;
|
|
1404
|
+
height: 100%;
|
|
1405
|
+
background: var(--brand);
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
.details {
|
|
1409
|
+
display: flex;
|
|
1410
|
+
align-items: flex-start;
|
|
1411
|
+
margin-top: 1.2rem;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
.avatar {
|
|
1415
|
+
flex: none;
|
|
1416
|
+
width: 3.6rem;
|
|
1417
|
+
height: 3.6rem;
|
|
1418
|
+
border-radius: 50%;
|
|
1419
|
+
overflow: hidden;
|
|
1420
|
+
background: var(--bg-chip);
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
.avatar img {
|
|
1424
|
+
display: block;
|
|
1425
|
+
width: 100%;
|
|
1426
|
+
height: 100%;
|
|
1427
|
+
object-fit: cover;
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
.avatar.fallback {
|
|
1431
|
+
display: flex;
|
|
1432
|
+
align-items: center;
|
|
1433
|
+
justify-content: center;
|
|
1434
|
+
color: var(--text-primary);
|
|
1435
|
+
font-size: 1.6rem;
|
|
1436
|
+
font-weight: 500;
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
.avatars {
|
|
1440
|
+
--avatar-size: 2.4rem;
|
|
1441
|
+
flex: none;
|
|
1442
|
+
margin-top: 0.6rem;
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
.text {
|
|
1446
|
+
flex: 1;
|
|
1447
|
+
min-width: 0;
|
|
1448
|
+
margin-left: 1.2rem;
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
.title {
|
|
1452
|
+
margin: 0 0 0.4rem;
|
|
1453
|
+
font-size: 1.6rem;
|
|
1454
|
+
font-weight: 500;
|
|
1455
|
+
line-height: 2.2rem;
|
|
1456
|
+
color: var(--text-primary);
|
|
1457
|
+
display: -webkit-box;
|
|
1458
|
+
-webkit-line-clamp: 2;
|
|
1459
|
+
-webkit-box-orient: vertical;
|
|
1460
|
+
overflow: hidden;
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
.channel-name {
|
|
1464
|
+
display: flex;
|
|
1465
|
+
align-items: center;
|
|
1466
|
+
width: fit-content;
|
|
1467
|
+
max-width: 100%;
|
|
1468
|
+
font-size: 1.4rem;
|
|
1469
|
+
font-weight: 400;
|
|
1470
|
+
color: var(--text-secondary);
|
|
1471
|
+
transition: color 0.15s ease;
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
.channel-name:hover {
|
|
1475
|
+
color: var(--text-primary);
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
/* the badge stays after the ellipsis, as on youtube.com */
|
|
1479
|
+
.channel-name .name {
|
|
1480
|
+
min-width: 0;
|
|
1481
|
+
overflow: hidden;
|
|
1482
|
+
text-overflow: ellipsis;
|
|
1483
|
+
white-space: nowrap;
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
/* a collaboration's names stay on one line, cut as youtube.com cuts them */
|
|
1487
|
+
.channel-name.names {
|
|
1488
|
+
display: block;
|
|
1489
|
+
max-width: 100%;
|
|
1490
|
+
overflow: hidden;
|
|
1491
|
+
text-overflow: ellipsis;
|
|
1492
|
+
white-space: nowrap;
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
.meta {
|
|
1496
|
+
font-size: 1.4rem;
|
|
1497
|
+
font-weight: 400;
|
|
1498
|
+
color: var(--text-secondary);
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
.members-only {
|
|
1502
|
+
margin-top: 0.2rem;
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
&.channel .text,
|
|
1506
|
+
&.shelf .text {
|
|
1507
|
+
margin-left: 0;
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
&.channel .title,
|
|
1511
|
+
&.shelf .title {
|
|
1512
|
+
font-size: 1.4rem;
|
|
1513
|
+
line-height: 2rem;
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
&.channel .meta,
|
|
1517
|
+
&.shelf .meta,
|
|
1518
|
+
&.channel .channel-name,
|
|
1519
|
+
&.shelf .channel-name {
|
|
1520
|
+
font-size: 1.2rem;
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
/* A search carousel's card on youtube.com keeps the avatar at the smaller
|
|
1524
|
+
type: measured signed out at 1280px, 2026-11-10. */
|
|
1525
|
+
&.carousel .details {
|
|
1526
|
+
margin-top: 0.8rem;
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
&.carousel .text {
|
|
1530
|
+
margin-left: 0.8rem;
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
&.carousel .title {
|
|
1534
|
+
font-size: 1.4rem;
|
|
1535
|
+
line-height: 2rem;
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
&.carousel .meta,
|
|
1539
|
+
&.carousel .channel-name {
|
|
1540
|
+
font-size: 1.2rem;
|
|
1541
|
+
line-height: 1.8rem;
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
.more {
|
|
1545
|
+
flex: none;
|
|
1546
|
+
width: 3.6rem;
|
|
1547
|
+
height: 3.6rem;
|
|
1548
|
+
display: flex;
|
|
1549
|
+
align-items: center;
|
|
1550
|
+
justify-content: center;
|
|
1551
|
+
border: none;
|
|
1552
|
+
border-radius: 50%;
|
|
1553
|
+
background: transparent;
|
|
1554
|
+
color: var(--text-primary);
|
|
1555
|
+
cursor: pointer;
|
|
1556
|
+
transition: background 0.15s ease;
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
.more:hover {
|
|
1560
|
+
background: var(--bg-hover);
|
|
1561
|
+
}
|
|
1562
|
+
`,Ua=({video:e,variant:t,context:n,recommendable:r})=>{let i=t===`carousel`&&e.isShort===!0,a=i?Cr(e.id):Ia(e.id,n),o=e.channel?`/channel/${e.channel.id}`:void 0,s=Le(e,t===`channel`),c=Pe(e.durationSeconds),l=La(e.progressPercent),u=e.isUpcoming===!0?void 0:e.inlinePlayerParams??void 0,d=Ge(e.id,u),[f,p]=M(!1),m=[t,e.isShort&&!i?`short`:void 0].filter(Boolean).join(` `),h=f&&!u?e.animatedThumbnail??void 0:void 0,g=i?void 0:Tn(u),_=t===void 0||t===`carousel`;return R(`article`,{css:Ha,className:m||void 0,onPointerEnter:e=>{u||d.onPointerEnter(),e.pointerType===`mouse`&&p(!0)},onPointerLeave:()=>{u||d.onPointerLeave(),p(!1)},onPointerDown:d.onPointerDown,children:[R(ke,{href:a,state:g,className:`thumb`,tabIndex:-1,"aria-hidden":`true`,children:[e.thumbnail?H(Tt,{src:e.thumbnail,srcSet:e.thumbnailSrcset,sizes:`(max-width: 500px) 100vw, 38rem`}):void 0,f&&u?H(xr,{videoId:e.id,href:a,playerParams:u}):void 0,h?H(`img`,{className:`moving`,src:h,alt:``}):void 0,e.thumbnailBadge?H(Da,{label:e.thumbnailBadge}):void 0,e.isLive?H(`span`,{className:`badge live`,children:`LIVE`}):h?void 0:c?R(`span`,{className:`badge`,children:[e.isMusic?H(Sa,{}):void 0,c]}):i?H(`span`,{className:`badge`,children:H(wa,{})}):void 0,l===void 0?void 0:H(`span`,{className:`progress`,children:H(`span`,{style:{width:`${l}%`}})})]}),R(`div`,{className:`details`,children:[s===`names`&&e.collaborators?.length&&_?H($i,{channels:e.collaborators,className:`avatars`,label:`Collaboration channels`,children:H(Zi,{channels:e.collaborators})}):e.channel&&o&&_?H(ke,{href:o,className:e.channel.avatar?`avatar`:`avatar fallback`,"aria-label":e.channel.name,children:e.channel.avatar?H(Tt,{src:e.channel.avatar}):e.channel.name.slice(0,1).toUpperCase()}):void 0,R(`div`,{className:`text`,children:[H(`h3`,{className:`title`,children:H(ke,{href:a,state:g,children:e.title})}),s===`names`?H(ke,{href:a,state:g,className:`channel-name names`,tabIndex:-1,children:H(Xi,{parts:e.byline})}):s===`channel`&&e.channel&&o?R(ke,{href:o,className:`channel-name`,children:[H(`span`,{className:`name`,children:e.channel.name}),H(kt,{channel:e.channel})]}):void 0,H(ka,{video:e}),e.isMembersOnly?H(ja,{}):void 0]}),H(Va,{videoId:e.id,title:e.title,thumbnail:e.thumbnail,durationSeconds:e.durationSeconds,channel:e.channel,notInterestedToken:e.notInterestedToken,dontRecommendToken:e.dontRecommendToken,recommendable:r,live:!!(e.isLive||e.isUpcoming),class:`more-menu`})]})]})},Wa=V`
|
|
1563
|
+
min-width: 0;
|
|
1564
|
+
animation: video-card-pulse 1.6s ease-in-out infinite;
|
|
1565
|
+
|
|
1566
|
+
.thumb {
|
|
1567
|
+
aspect-ratio: 16 / 9;
|
|
1568
|
+
border-radius: 1.2rem;
|
|
1569
|
+
background: var(--bg-elevated);
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
.bar {
|
|
1573
|
+
height: 1.6rem;
|
|
1574
|
+
border-radius: 0.4rem;
|
|
1575
|
+
background: var(--bg-elevated);
|
|
1576
|
+
margin-top: 1.2rem;
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
.bar.short {
|
|
1580
|
+
width: 60%;
|
|
1581
|
+
margin-top: 0.8rem;
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
@keyframes video-card-pulse {
|
|
1585
|
+
0%,
|
|
1586
|
+
100% {
|
|
1587
|
+
opacity: 1;
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
50% {
|
|
1591
|
+
opacity: 0.55;
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
`,Ga=()=>R(`div`,{css:Wa,"aria-hidden":`true`,children:[H(`div`,{className:`thumb`}),H(`div`,{className:`bar`}),H(`div`,{className:`bar short`})]}),Ka={loop:!1,shuffle:!1},qa=(e,t,n=Ka,r=Math.random)=>{if(n.shuffle){if(t<2)return;let n=Math.floor(r()*(t-1));return n>=e?n+1:n}return e+1<t?e+1:n.loop&&t>1?0:void 0},Ja=(e,t,n=Ka)=>n.shuffle?t>1:e+1<t||n.loop&&t>1,Ya=(e,t,n=Ka)=>e>0?e-1:n.loop&&t>1?t-1:void 0,Xa=50,Za=new Set,Qa=e=>{Za.delete(e),Za.add(e),Za.size>Xa&&Za.delete(Za.values().next().value)},$a=(e,t,{preferred:n,played:r=Za}={})=>{let i=e=>e.id!==t&&!r.has(e.id);return e.find(e=>e.id===n&&i(e))??e.find(i)??e.find(e=>e.id!==t)},eo=({queued:e,autoplay:t,pick:n,cancelled:r})=>e?`advance`:t&&n&&!r?`countdown`:`suggestions`;N();var to=V`
|
|
1595
|
+
position: absolute;
|
|
1596
|
+
inset: 0;
|
|
1597
|
+
display: flex;
|
|
1598
|
+
flex-direction: column;
|
|
1599
|
+
align-items: center;
|
|
1600
|
+
justify-content: center;
|
|
1601
|
+
padding: 2.4rem 2.4rem 7.2rem;
|
|
1602
|
+
background: rgba(0, 0, 0, 0.75);
|
|
1603
|
+
color: #ffffff;
|
|
1604
|
+
font-family: Roboto, Arial, sans-serif;
|
|
1605
|
+
|
|
1606
|
+
.label {
|
|
1607
|
+
font-size: 1.6rem;
|
|
1608
|
+
color: rgba(255, 255, 255, 0.7);
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
.card {
|
|
1612
|
+
display: flex;
|
|
1613
|
+
align-items: center;
|
|
1614
|
+
gap: 1.6rem;
|
|
1615
|
+
width: min(100%, 52rem);
|
|
1616
|
+
margin-top: 1.2rem;
|
|
1617
|
+
color: inherit;
|
|
1618
|
+
text-decoration: none;
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
.card img,
|
|
1622
|
+
.tile img {
|
|
1623
|
+
display: block;
|
|
1624
|
+
width: 100%;
|
|
1625
|
+
aspect-ratio: 16 / 9;
|
|
1626
|
+
object-fit: cover;
|
|
1627
|
+
border-radius: 0.8rem;
|
|
1628
|
+
background: #222;
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
.card .thumb {
|
|
1632
|
+
flex: none;
|
|
1633
|
+
width: 45%;
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
.card-text {
|
|
1637
|
+
min-width: 0;
|
|
1638
|
+
display: flex;
|
|
1639
|
+
flex-direction: column;
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
.card-title {
|
|
1643
|
+
font-size: 1.8rem;
|
|
1644
|
+
font-weight: 500;
|
|
1645
|
+
line-height: 2.4rem;
|
|
1646
|
+
display: -webkit-box;
|
|
1647
|
+
-webkit-line-clamp: 2;
|
|
1648
|
+
-webkit-box-orient: vertical;
|
|
1649
|
+
overflow: hidden;
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
.card-channel {
|
|
1653
|
+
margin-top: 0.4rem;
|
|
1654
|
+
font-size: 1.4rem;
|
|
1655
|
+
color: rgba(255, 255, 255, 0.7);
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
.actions {
|
|
1659
|
+
display: flex;
|
|
1660
|
+
align-items: center;
|
|
1661
|
+
gap: 2.4rem;
|
|
1662
|
+
margin-top: 1.6rem;
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
.cancel {
|
|
1666
|
+
height: 3.6rem;
|
|
1667
|
+
padding: 0 1.6rem;
|
|
1668
|
+
border: none;
|
|
1669
|
+
border-radius: 1.8rem;
|
|
1670
|
+
background: rgba(255, 255, 255, 0.15);
|
|
1671
|
+
color: #ffffff;
|
|
1672
|
+
font-size: 1.4rem;
|
|
1673
|
+
font-weight: 500;
|
|
1674
|
+
cursor: pointer;
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
.cancel:hover {
|
|
1678
|
+
background: rgba(255, 255, 255, 0.25);
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
.play-now {
|
|
1682
|
+
position: relative;
|
|
1683
|
+
display: grid;
|
|
1684
|
+
place-items: center;
|
|
1685
|
+
width: 6.4rem;
|
|
1686
|
+
height: 6.4rem;
|
|
1687
|
+
padding: 0;
|
|
1688
|
+
border: none;
|
|
1689
|
+
border-radius: 50%;
|
|
1690
|
+
background: rgba(255, 255, 255, 0.15);
|
|
1691
|
+
color: #ffffff;
|
|
1692
|
+
cursor: pointer;
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
.ring {
|
|
1696
|
+
position: absolute;
|
|
1697
|
+
inset: 0;
|
|
1698
|
+
transform: rotate(-90deg);
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
.ring circle {
|
|
1702
|
+
fill: none;
|
|
1703
|
+
stroke: #ffffff;
|
|
1704
|
+
stroke-width: 3;
|
|
1705
|
+
stroke-dasharray: 188.5;
|
|
1706
|
+
stroke-dashoffset: 188.5;
|
|
1707
|
+
animation: up-next-ring var(--countdown) linear forwards;
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
@keyframes up-next-ring {
|
|
1711
|
+
to {
|
|
1712
|
+
stroke-dashoffset: 0;
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
|
|
1716
|
+
.grid {
|
|
1717
|
+
display: grid;
|
|
1718
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
1719
|
+
gap: 0.8rem;
|
|
1720
|
+
width: 100%;
|
|
1721
|
+
margin: 0;
|
|
1722
|
+
padding: 0;
|
|
1723
|
+
list-style: none;
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
.tile {
|
|
1727
|
+
position: relative;
|
|
1728
|
+
display: block;
|
|
1729
|
+
color: inherit;
|
|
1730
|
+
text-decoration: none;
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
.tile-title {
|
|
1734
|
+
position: absolute;
|
|
1735
|
+
inset: 0 0 auto;
|
|
1736
|
+
padding: 0.8rem;
|
|
1737
|
+
border-radius: 0.8rem 0.8rem 0 0;
|
|
1738
|
+
background: linear-gradient(rgba(0, 0, 0, 0.8), transparent);
|
|
1739
|
+
font-size: 1.3rem;
|
|
1740
|
+
font-weight: 500;
|
|
1741
|
+
line-height: 1.8rem;
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
/* clamped inside the padding, which would otherwise show the top of a third line */
|
|
1745
|
+
.tile-title > span {
|
|
1746
|
+
display: -webkit-box;
|
|
1747
|
+
-webkit-line-clamp: 2;
|
|
1748
|
+
-webkit-box-orient: vertical;
|
|
1749
|
+
overflow: hidden;
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
@container player (max-width: 560px) {
|
|
1753
|
+
padding: 1.2rem 1.2rem 5.6rem;
|
|
1754
|
+
|
|
1755
|
+
.label {
|
|
1756
|
+
font-size: 1.3rem;
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
.card .thumb {
|
|
1760
|
+
display: none;
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
.card-title {
|
|
1764
|
+
font-size: 1.4rem;
|
|
1765
|
+
line-height: 2rem;
|
|
1766
|
+
text-align: center;
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
.card-channel {
|
|
1770
|
+
display: none;
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
.actions {
|
|
1774
|
+
margin-top: 0.8rem;
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
.play-now {
|
|
1778
|
+
width: 4.8rem;
|
|
1779
|
+
height: 4.8rem;
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
.grid {
|
|
1783
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
/* one row, all the miniplayer's height holds above the controls */
|
|
1787
|
+
.grid li:nth-of-type(n + 3) {
|
|
1788
|
+
display: none;
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
`,no=(e,t)=>n=>{n.button!==0||n.ctrlKey||n.metaKey||n.shiftKey||n.altKey||(n.preventDefault(),t(e))},ro=e=>Ia(e.id,e.list===void 0?void 0:{list:e.list,index:e.index===void 0?void 0:e.index+1}),io=({target:e,onOpen:t,onCancel:n})=>{let[r,i]=M(3),a=P({target:e,onOpen:t});return a.current={target:e,onOpen:t},O(()=>{Ue(e.id);let t=Date.now(),n=setInterval(()=>{let e=3-Math.floor((Date.now()-t)/1e3);i(Math.max(0,e)),!(e>0)&&(clearInterval(n),a.current.onOpen(a.current.target))},250);return()=>clearInterval(n)},[e.id]),R(`div`,{css:to,style:{"--countdown":`3s`},"data-end-screen":`countdown`,children:[R(`div`,{className:`label`,children:[`Up next in `,r]}),R(`a`,{className:`card`,href:ro(e),onClick:no(e,t),children:[H(`span`,{className:`thumb`,children:e.thumbnail?H(`img`,{src:e.thumbnail,alt:``}):void 0}),R(`span`,{className:`card-text`,children:[H(`span`,{className:`card-title`,children:e.title}),e.channel?H(`span`,{className:`card-channel`,children:e.channel.name}):void 0]})]}),R(`div`,{className:`actions`,children:[H(`button`,{type:`button`,className:`cancel`,onClick:n,children:`Cancel`}),R(`button`,{type:`button`,className:`play-now`,"aria-label":`Play now`,onClick:()=>t(e),children:[H(`svg`,{className:`ring`,viewBox:`0 0 64 64`,"aria-hidden":`true`,children:H(`circle`,{cx:`32`,cy:`32`,r:`30`})}),H(ee,{size:28,fill:`currentColor`,strokeWidth:0})]})]})]})},ao=({videos:e,onOpen:t})=>H(`div`,{css:to,"data-end-screen":`suggestions`,children:H(`ul`,{className:`grid`,children:e.slice(0,8).map(e=>H(`li`,{children:R(`a`,{className:`tile`,href:ro(e),onClick:no(e,t),children:[e.thumbnail?H(`img`,{src:e.thumbnail,alt:``}):void 0,H(`span`,{className:`tile-title`,children:H(`span`,{children:e.title})})]})},e.id))})}),oo,so=(e,t,n)=>{oo={videoId:e,seek:t,playhead:n}},co=e=>{if(oo?.videoId!==e)return;let t=oo.playhead();return Number.isFinite(t)&&t>=0?t:void 0},lo=e=>{let t=co(e);return t===void 0?void 0:Math.floor(t)},uo=e=>{oo?.videoId===e&&(oo=void 0)},fo=(e,t,n=!0)=>oo?.videoId!==e||!Number.isFinite(t)||t<0?!1:(oo.seek(t,n),!0);N();var po=V`
|
|
1792
|
+
position: relative;
|
|
1793
|
+
|
|
1794
|
+
.track {
|
|
1795
|
+
display: flex;
|
|
1796
|
+
gap: var(--rail-gap, 0.8rem);
|
|
1797
|
+
overflow-x: auto;
|
|
1798
|
+
scroll-behavior: smooth;
|
|
1799
|
+
/* The scrollbar is hidden because the arrows are the affordance; without
|
|
1800
|
+
them the overflow would be unreachable on a mouse-only desktop, which is
|
|
1801
|
+
why they are rendered rather than left to the trackpad. */
|
|
1802
|
+
scrollbar-width: none;
|
|
1803
|
+
scroll-snap-type: x proximity;
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
.track::-webkit-scrollbar {
|
|
1807
|
+
display: none;
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1810
|
+
.track > * {
|
|
1811
|
+
flex: none;
|
|
1812
|
+
scroll-snap-align: start;
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
.arrow {
|
|
1816
|
+
position: absolute;
|
|
1817
|
+
top: var(--rail-arrow-top, calc(50% - 6rem));
|
|
1818
|
+
display: flex;
|
|
1819
|
+
align-items: center;
|
|
1820
|
+
justify-content: center;
|
|
1821
|
+
width: 4rem;
|
|
1822
|
+
height: 4rem;
|
|
1823
|
+
border: none;
|
|
1824
|
+
border-radius: 50%;
|
|
1825
|
+
background: var(--bg-menu);
|
|
1826
|
+
color: var(--text-primary);
|
|
1827
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
|
|
1828
|
+
cursor: pointer;
|
|
1829
|
+
z-index: 1;
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
.arrow.left {
|
|
1833
|
+
left: -2rem;
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1836
|
+
.arrow.right {
|
|
1837
|
+
right: var(--rail-arrow-right, -2rem);
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
/* Without the guide a page's gutter can be narrower than the overhang,
|
|
1841
|
+
which would scroll the whole page sideways. */
|
|
1842
|
+
@media (max-width: 792px) {
|
|
1843
|
+
.arrow.left {
|
|
1844
|
+
left: 0;
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
.arrow.right {
|
|
1848
|
+
right: 0;
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
`,mo=.8,ho=({label:e,count:t,wholeCards:n=!1,children:r})=>{let i=P(null),[a,o]=M(!0),[c,l]=M(!1);E(()=>{let e=i.current;if(!e)return;let t=()=>{let t=e.scrollWidth-e.clientWidth;o(e.scrollLeft<=1),l(e.scrollLeft>=t-1)};t(),e.addEventListener(`scroll`,t,{passive:!0});let n=new ResizeObserver(t);return n.observe(e),()=>{e.removeEventListener(`scroll`,t),n.disconnect()}},[t]);let u=e=>{let t=i.current;if(!t)return;let[r,a]=[...t.children],o=n&&r&&a?a.offsetLeft-r.offsetLeft:0,s=o>0?Math.max(1,Math.round(t.clientWidth/o))*o:t.clientWidth*mo;t.scrollBy({left:e*s,behavior:`smooth`})};return R(`div`,{css:po,children:[a?void 0:H(`button`,{type:`button`,className:`arrow left`,"aria-label":`Previous ${e}`,onClick:()=>u(-1),children:H(y,{size:24,strokeWidth:2})}),H(`div`,{className:`track`,ref:i,children:r}),c?void 0:H(`button`,{type:`button`,className:`arrow right`,"aria-label":`More ${e}`,onClick:()=>u(1),children:H(s,{size:24,strokeWidth:2})})]})};N();var go=V`
|
|
1852
|
+
position: relative;
|
|
1853
|
+
flex: none;
|
|
1854
|
+
display: flex;
|
|
1855
|
+
flex-direction: column;
|
|
1856
|
+
max-height: 48rem;
|
|
1857
|
+
margin-bottom: 0.8rem;
|
|
1858
|
+
border: 1px solid var(--border);
|
|
1859
|
+
border-radius: 1.2rem;
|
|
1860
|
+
background: var(--bg-base);
|
|
1861
|
+
color: var(--text-primary);
|
|
1862
|
+
overflow: hidden;
|
|
1863
|
+
|
|
1864
|
+
.panel-head {
|
|
1865
|
+
flex: none;
|
|
1866
|
+
display: flex;
|
|
1867
|
+
align-items: center;
|
|
1868
|
+
justify-content: space-between;
|
|
1869
|
+
min-height: 5.6rem;
|
|
1870
|
+
padding: 0.4rem 0.4rem 0.4rem 1.6rem;
|
|
1871
|
+
border-bottom: 1px solid var(--border);
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1874
|
+
.panel-heading {
|
|
1875
|
+
font-size: 2rem;
|
|
1876
|
+
font-weight: 700;
|
|
1877
|
+
line-height: 2.8rem;
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1880
|
+
.panel-close {
|
|
1881
|
+
display: grid;
|
|
1882
|
+
place-items: center;
|
|
1883
|
+
width: 4rem;
|
|
1884
|
+
height: 4rem;
|
|
1885
|
+
border: none;
|
|
1886
|
+
border-radius: 50%;
|
|
1887
|
+
background: transparent;
|
|
1888
|
+
color: inherit;
|
|
1889
|
+
cursor: pointer;
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
.panel-close:hover {
|
|
1893
|
+
background: var(--bg-hover);
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
.panel-chips {
|
|
1897
|
+
flex: none;
|
|
1898
|
+
display: flex;
|
|
1899
|
+
gap: 0.8rem;
|
|
1900
|
+
padding: 0.8rem 1.2rem;
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
.panel-chip {
|
|
1904
|
+
height: 3.2rem;
|
|
1905
|
+
padding: 0 1.2rem;
|
|
1906
|
+
border: none;
|
|
1907
|
+
border-radius: 0.8rem;
|
|
1908
|
+
background: var(--bg-chip);
|
|
1909
|
+
color: var(--text-primary);
|
|
1910
|
+
font-size: 1.4rem;
|
|
1911
|
+
font-weight: 500;
|
|
1912
|
+
line-height: 2rem;
|
|
1913
|
+
cursor: pointer;
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
.panel-chip:hover {
|
|
1917
|
+
background: var(--bg-chip-hover);
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
.panel-chip[aria-selected='true'] {
|
|
1921
|
+
background: var(--bg-inverse);
|
|
1922
|
+
color: var(--text-inverse);
|
|
1923
|
+
}
|
|
1924
|
+
|
|
1925
|
+
/* in full screen the list fills the slot beside the video that the player's frame keeps */
|
|
1926
|
+
&.overlay {
|
|
1927
|
+
height: 100%;
|
|
1928
|
+
max-height: none;
|
|
1929
|
+
margin: 0;
|
|
1930
|
+
}
|
|
1931
|
+
`,_o=({label:e,heading:t,chips:n,onClose:r,overlay:i=!1,fit:a,className:o,children:s})=>{let c=P(null);return E(()=>{let e=c.current,t=a?.current;if(!e||!t)return;let n=()=>{e.style.height=`${t.offsetHeight}px`,e.style.maxHeight=`none`};n();let r=new ResizeObserver(n);return r.observe(t),()=>{r.disconnect(),e.style.height=``,e.style.maxHeight=``}},[a]),R(`section`,{css:go,ref:c,className:i?`${o} overlay`:o,"aria-label":e,children:[R(`div`,{className:`panel-head`,children:[H(`h2`,{className:`panel-heading`,children:t}),H(`button`,{type:`button`,className:`panel-close`,"aria-label":`Close`,onClick:r,children:H(A,{size:24,strokeWidth:1.5})})]}),n?H(`div`,{className:`panel-chips`,role:`tablist`,children:n}):void 0,s]})};N();var vo=V`
|
|
1932
|
+
display: inline-block;
|
|
1933
|
+
border-radius: 0.2rem;
|
|
1934
|
+
background: var(--accent-tint);
|
|
1935
|
+
color: var(--accent);
|
|
1936
|
+
font-size: 1.2rem;
|
|
1937
|
+
line-height: 1.8rem;
|
|
1938
|
+
font-variant-numeric: tabular-nums;
|
|
1939
|
+
`,yo=V`
|
|
1940
|
+
position: relative;
|
|
1941
|
+
flex: 1;
|
|
1942
|
+
min-height: 0;
|
|
1943
|
+
padding: 0.8rem 0;
|
|
1944
|
+
overflow-y: auto;
|
|
1945
|
+
|
|
1946
|
+
.chapter-row {
|
|
1947
|
+
display: flex;
|
|
1948
|
+
align-items: center;
|
|
1949
|
+
gap: 1.6rem;
|
|
1950
|
+
width: 100%;
|
|
1951
|
+
padding: 0.8rem 1.6rem;
|
|
1952
|
+
border: none;
|
|
1953
|
+
background: transparent;
|
|
1954
|
+
color: inherit;
|
|
1955
|
+
font: inherit;
|
|
1956
|
+
text-align: left;
|
|
1957
|
+
cursor: pointer;
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
.chapter-row:hover,
|
|
1961
|
+
.chapter-row[aria-current='true'] {
|
|
1962
|
+
background: var(--bg-hover);
|
|
1963
|
+
}
|
|
1964
|
+
|
|
1965
|
+
.chapter-thumb {
|
|
1966
|
+
flex: none;
|
|
1967
|
+
width: 10rem;
|
|
1968
|
+
height: 5.6rem;
|
|
1969
|
+
border-radius: 0.8rem;
|
|
1970
|
+
background: #000;
|
|
1971
|
+
object-fit: cover;
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1974
|
+
.chapter-details {
|
|
1975
|
+
display: flex;
|
|
1976
|
+
flex-direction: column;
|
|
1977
|
+
align-items: flex-start;
|
|
1978
|
+
min-width: 0;
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1981
|
+
.chapter-name {
|
|
1982
|
+
margin-bottom: 0.8rem;
|
|
1983
|
+
font-size: 1.4rem;
|
|
1984
|
+
font-weight: 500;
|
|
1985
|
+
line-height: 2rem;
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
.chapter-time {
|
|
1989
|
+
${vo}
|
|
1990
|
+
padding: 0.2rem 0.6rem;
|
|
1991
|
+
font-weight: 500;
|
|
1992
|
+
}
|
|
1993
|
+
`,bo=({videoId:e,chapters:t,current:n,heading:r=`Chapters`,chips:i,onClose:a,overlay:o=!1,fit:s})=>{let c=P(null);return E(()=>{let e=c.current,t=e?.children[n];e&&t&&(e.scrollTop=t.offsetTop-Number.parseFloat(getComputedStyle(e).paddingTop))},[]),H(_o,{label:`Chapters`,heading:r,chips:i,onClose:a,overlay:o,fit:s,className:`chapters-panel`,children:H(`div`,{css:yo,className:`chapter-rows`,ref:c,children:t.map((t,r)=>R(`button`,{type:`button`,className:`chapter-row`,"aria-current":r===n?`true`:void 0,onClick:()=>fo(e,t.startSeconds),children:[t.thumbnail?H(`img`,{className:`chapter-thumb`,src:t.thumbnail,alt:``,loading:`lazy`}):H(`span`,{className:`chapter-thumb`}),R(`span`,{className:`chapter-details`,children:[H(`span`,{className:`chapter-name`,children:t.title}),H(`span`,{className:`chapter-time`,children:Y(t.startSeconds)})]})]},`${r}:${t.startSeconds}`))})})},xo=V`
|
|
1994
|
+
--rail-gap: 1.2rem;
|
|
1995
|
+
--rail-arrow-top: 5.8rem;
|
|
1996
|
+
|
|
1997
|
+
.card {
|
|
1998
|
+
position: relative;
|
|
1999
|
+
display: block;
|
|
2000
|
+
width: 15.6rem;
|
|
2001
|
+
padding: 0.4rem 0.3rem 0.2rem;
|
|
2002
|
+
border: none;
|
|
2003
|
+
background: transparent;
|
|
2004
|
+
color: var(--text-primary);
|
|
2005
|
+
font: inherit;
|
|
2006
|
+
text-align: left;
|
|
2007
|
+
cursor: pointer;
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
.card-thumb {
|
|
2011
|
+
display: block;
|
|
2012
|
+
width: 15rem;
|
|
2013
|
+
height: 8.5rem;
|
|
2014
|
+
overflow: hidden;
|
|
2015
|
+
border-radius: 0.8rem;
|
|
2016
|
+
background: #000;
|
|
2017
|
+
}
|
|
2018
|
+
|
|
2019
|
+
.card[aria-current='true'] .card-thumb {
|
|
2020
|
+
border: 2px solid var(--accent);
|
|
2021
|
+
}
|
|
2022
|
+
|
|
2023
|
+
.card-thumb img {
|
|
2024
|
+
display: block;
|
|
2025
|
+
width: 100%;
|
|
2026
|
+
height: 100%;
|
|
2027
|
+
object-fit: cover;
|
|
2028
|
+
}
|
|
2029
|
+
|
|
2030
|
+
.card-details {
|
|
2031
|
+
position: relative;
|
|
2032
|
+
display: flex;
|
|
2033
|
+
flex-direction: column;
|
|
2034
|
+
align-items: flex-start;
|
|
2035
|
+
padding: 0.8rem 0.4rem 0;
|
|
2036
|
+
}
|
|
2037
|
+
|
|
2038
|
+
/* from this card's pill to the next one's, under both */
|
|
2039
|
+
.card:not(:last-child) .card-details::before {
|
|
2040
|
+
content: '';
|
|
2041
|
+
position: absolute;
|
|
2042
|
+
top: 1.6rem;
|
|
2043
|
+
left: 0.4rem;
|
|
2044
|
+
right: -2.2rem;
|
|
2045
|
+
height: 0.2rem;
|
|
2046
|
+
background: var(--accent-tint);
|
|
2047
|
+
}
|
|
2048
|
+
|
|
2049
|
+
.card-time {
|
|
2050
|
+
${vo}
|
|
2051
|
+
position: relative;
|
|
2052
|
+
margin-bottom: 0.8rem;
|
|
2053
|
+
padding: 0 0.4rem;
|
|
2054
|
+
}
|
|
2055
|
+
|
|
2056
|
+
.card-title {
|
|
2057
|
+
display: -webkit-box;
|
|
2058
|
+
overflow: hidden;
|
|
2059
|
+
font-size: 1.4rem;
|
|
2060
|
+
font-weight: 500;
|
|
2061
|
+
line-height: 2rem;
|
|
2062
|
+
-webkit-line-clamp: 2;
|
|
2063
|
+
-webkit-box-orient: vertical;
|
|
2064
|
+
}
|
|
2065
|
+
`,So=(e,t)=>t>0?`${Ia(e)}&t=${Math.floor(t)}s`:Ia(e),Co=({videoId:e,chapters:t,current:n=-1,onSeek:r,playerParams:i})=>H(`div`,{css:xo,children:H(ho,{label:`chapters`,count:t.length,children:t.map((t,a)=>{let o=R(B,{children:[H(`span`,{className:`card-thumb`,children:t.thumbnail?H(`img`,{src:t.thumbnail,alt:``,loading:`lazy`}):void 0}),R(`span`,{className:`card-details`,children:[H(`span`,{className:`card-time`,children:Y(t.startSeconds)}),H(`span`,{className:`card-title`,children:t.title})]})]}),s=`${a}:${t.startSeconds}`;return r?H(`button`,{type:`button`,className:`card`,"aria-current":a===n?`true`:void 0,onClick:()=>r(t.startSeconds),children:o},s):H(ke,{className:`card`,href:So(e,t.startSeconds),state:Tn(i),children:o},s)})})}),wo=V`
|
|
2066
|
+
margin-top: 1.2rem;
|
|
2067
|
+
border-radius: 0.8rem;
|
|
2068
|
+
background: var(--bg-chip);
|
|
2069
|
+
color: var(--text-primary);
|
|
2070
|
+
|
|
2071
|
+
.strip-head {
|
|
2072
|
+
display: flex;
|
|
2073
|
+
align-items: center;
|
|
2074
|
+
gap: 1.2rem;
|
|
2075
|
+
width: 100%;
|
|
2076
|
+
min-height: 3.6rem;
|
|
2077
|
+
padding: 0.4rem 1.2rem 0.4rem 0.8rem;
|
|
2078
|
+
border: none;
|
|
2079
|
+
background: transparent;
|
|
2080
|
+
color: inherit;
|
|
2081
|
+
font: inherit;
|
|
2082
|
+
font-size: 1.2rem;
|
|
2083
|
+
line-height: 1.8rem;
|
|
2084
|
+
text-align: left;
|
|
2085
|
+
cursor: pointer;
|
|
2086
|
+
}
|
|
2087
|
+
|
|
2088
|
+
.strip-thumb {
|
|
2089
|
+
flex: none;
|
|
2090
|
+
width: 5.2rem;
|
|
2091
|
+
height: 2.8rem;
|
|
2092
|
+
border-radius: 0.4rem;
|
|
2093
|
+
object-fit: cover;
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
.strip-text {
|
|
2097
|
+
flex: 1;
|
|
2098
|
+
min-width: 0;
|
|
2099
|
+
overflow: hidden;
|
|
2100
|
+
white-space: nowrap;
|
|
2101
|
+
text-overflow: ellipsis;
|
|
2102
|
+
}
|
|
2103
|
+
|
|
2104
|
+
.strip-count {
|
|
2105
|
+
margin-right: 0.6rem;
|
|
2106
|
+
font-weight: 500;
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
.strip-names {
|
|
2110
|
+
color: var(--text-secondary);
|
|
2111
|
+
}
|
|
2112
|
+
|
|
2113
|
+
.strip-head svg {
|
|
2114
|
+
flex: none;
|
|
2115
|
+
}
|
|
2116
|
+
|
|
2117
|
+
&.open {
|
|
2118
|
+
padding-bottom: 0.8rem;
|
|
2119
|
+
}
|
|
2120
|
+
|
|
2121
|
+
&.open .strip-head {
|
|
2122
|
+
padding: 0.4rem 0.4rem 0.4rem 1.6rem;
|
|
2123
|
+
font-size: 1.4rem;
|
|
2124
|
+
line-height: 2rem;
|
|
2125
|
+
color: var(--text-secondary);
|
|
2126
|
+
}
|
|
2127
|
+
|
|
2128
|
+
.strip-toggle {
|
|
2129
|
+
display: grid;
|
|
2130
|
+
flex: none;
|
|
2131
|
+
place-items: center;
|
|
2132
|
+
width: 4rem;
|
|
2133
|
+
height: 4rem;
|
|
2134
|
+
border-radius: 50%;
|
|
2135
|
+
background: var(--bg-chip-hover);
|
|
2136
|
+
color: var(--text-primary);
|
|
2137
|
+
}
|
|
2138
|
+
|
|
2139
|
+
&.open .cards {
|
|
2140
|
+
padding: 0 1.6rem;
|
|
2141
|
+
}
|
|
2142
|
+
`,To=({videoId:e,chapters:t,title:n,playerParams:r})=>{let[i,a]=M(!1);if(i)return R(`div`,{css:wo,className:`open`,children:[R(`button`,{type:`button`,className:`strip-head`,"aria-expanded":`true`,onClick:()=>a(!1),children:[H(`span`,{className:`strip-text`,children:n??`${t.length} chapters in this video`}),H(`span`,{className:`strip-toggle`,children:H(de,{size:24,strokeWidth:1.5})})]}),H(`div`,{className:`cards`,children:H(Co,{videoId:e,chapters:t,playerParams:r})})]});let o=t[0]?.thumbnail;return H(`div`,{css:wo,children:R(`button`,{type:`button`,className:`strip-head`,"aria-expanded":`false`,onClick:()=>a(!0),children:[o?H(`img`,{className:`strip-thumb`,src:o,alt:``,loading:`lazy`}):void 0,R(`span`,{className:`strip-text`,children:[H(`span`,{className:`strip-count`,children:`${t.length} chapters`}),H(`span`,{className:`strip-names`,children:t.map(e=>e.title).join(` | `)})]}),H(ue,{size:24,strokeWidth:1.5})]})})};k(),N();var Eo=Te(`
|
|
2143
|
+
query Transcript($panelId: String!, $params: String!) {
|
|
2144
|
+
transcript(panelId: $panelId, params: $params) {
|
|
2145
|
+
searchToken
|
|
2146
|
+
sections { title startSeconds lines { startSeconds timestamp text } }
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
`),Do=Te(`
|
|
2150
|
+
query TranscriptSearch($token: String!, $query: String!) {
|
|
2151
|
+
transcriptSearch(token: $token, query: $query) {
|
|
2152
|
+
sections { title startSeconds lines { startSeconds timestamp text } }
|
|
2153
|
+
}
|
|
2154
|
+
}
|
|
2155
|
+
`),Oo=.1,ko=250,Ao=V`
|
|
2156
|
+
flex: 1;
|
|
2157
|
+
min-height: 0;
|
|
2158
|
+
display: flex;
|
|
2159
|
+
flex-direction: column;
|
|
2160
|
+
|
|
2161
|
+
.transcript-search {
|
|
2162
|
+
flex: none;
|
|
2163
|
+
display: flex;
|
|
2164
|
+
align-items: center;
|
|
2165
|
+
height: 4.2rem;
|
|
2166
|
+
margin: 0.8rem 1.6rem 0.2rem;
|
|
2167
|
+
padding: 0 0.4rem 0 1.2rem;
|
|
2168
|
+
border-radius: 10rem;
|
|
2169
|
+
background: var(--bg-chip);
|
|
2170
|
+
}
|
|
2171
|
+
|
|
2172
|
+
.transcript-search input {
|
|
2173
|
+
flex: 1;
|
|
2174
|
+
min-width: 0;
|
|
2175
|
+
border: none;
|
|
2176
|
+
outline: none;
|
|
2177
|
+
background: transparent;
|
|
2178
|
+
color: var(--text-primary);
|
|
2179
|
+
font-size: 1.6rem;
|
|
2180
|
+
line-height: 2.2rem;
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2183
|
+
.transcript-search input::placeholder {
|
|
2184
|
+
color: var(--text-secondary);
|
|
2185
|
+
}
|
|
2186
|
+
|
|
2187
|
+
.transcript-clear {
|
|
2188
|
+
display: grid;
|
|
2189
|
+
place-items: center;
|
|
2190
|
+
width: 3.6rem;
|
|
2191
|
+
height: 3.6rem;
|
|
2192
|
+
border: none;
|
|
2193
|
+
border-radius: 50%;
|
|
2194
|
+
background: transparent;
|
|
2195
|
+
color: var(--text-primary);
|
|
2196
|
+
cursor: pointer;
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
.transcript-clear:hover {
|
|
2200
|
+
background: var(--bg-hover);
|
|
2201
|
+
}
|
|
2202
|
+
|
|
2203
|
+
.transcript-lines {
|
|
2204
|
+
position: relative;
|
|
2205
|
+
flex: 1;
|
|
2206
|
+
min-height: 0;
|
|
2207
|
+
padding: 0 0.8rem;
|
|
2208
|
+
overflow-y: auto;
|
|
2209
|
+
}
|
|
2210
|
+
|
|
2211
|
+
.transcript-chapter button {
|
|
2212
|
+
display: block;
|
|
2213
|
+
width: 100%;
|
|
2214
|
+
padding: 0.8rem 2.4rem 0.8rem 0.8rem;
|
|
2215
|
+
border: none;
|
|
2216
|
+
background: transparent;
|
|
2217
|
+
color: var(--text-primary);
|
|
2218
|
+
font-size: 2rem;
|
|
2219
|
+
font-weight: 700;
|
|
2220
|
+
line-height: 2.8rem;
|
|
2221
|
+
text-align: left;
|
|
2222
|
+
cursor: pointer;
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2225
|
+
.transcript-chapter button:hover {
|
|
2226
|
+
background: var(--bg-hover);
|
|
2227
|
+
}
|
|
2228
|
+
|
|
2229
|
+
.transcript-line {
|
|
2230
|
+
display: block;
|
|
2231
|
+
width: 100%;
|
|
2232
|
+
padding: 0.8rem;
|
|
2233
|
+
border: none;
|
|
2234
|
+
background: transparent;
|
|
2235
|
+
color: var(--text-secondary);
|
|
2236
|
+
font-size: 1.8rem;
|
|
2237
|
+
font-weight: 500;
|
|
2238
|
+
line-height: 2.6rem;
|
|
2239
|
+
text-align: left;
|
|
2240
|
+
cursor: pointer;
|
|
2241
|
+
}
|
|
2242
|
+
|
|
2243
|
+
.transcript-line:hover {
|
|
2244
|
+
background: var(--bg-hover);
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2247
|
+
.transcript-line[aria-current='true'] {
|
|
2248
|
+
color: var(--text-primary);
|
|
2249
|
+
}
|
|
2250
|
+
|
|
2251
|
+
.transcript-time {
|
|
2252
|
+
display: inline-block;
|
|
2253
|
+
margin-right: 0.8rem;
|
|
2254
|
+
padding: 0.2rem 0.6rem;
|
|
2255
|
+
border-radius: 10rem;
|
|
2256
|
+
background: var(--bg-hover);
|
|
2257
|
+
color: var(--text-secondary);
|
|
2258
|
+
font-size: 1.2rem;
|
|
2259
|
+
line-height: 1.8rem;
|
|
2260
|
+
font-variant-numeric: tabular-nums;
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
.transcript-line[aria-current='true'] .transcript-time {
|
|
2264
|
+
background: var(--transcript-tint);
|
|
2265
|
+
color: var(--transcript-tint-text);
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2268
|
+
.transcript-empty {
|
|
2269
|
+
padding: 0.8rem;
|
|
2270
|
+
color: var(--text-secondary);
|
|
2271
|
+
}
|
|
2272
|
+
|
|
2273
|
+
.transcript-sync {
|
|
2274
|
+
position: absolute;
|
|
2275
|
+
bottom: 1rem;
|
|
2276
|
+
left: 50%;
|
|
2277
|
+
height: 4rem;
|
|
2278
|
+
padding: 0 1.6rem;
|
|
2279
|
+
border: none;
|
|
2280
|
+
border-radius: 2rem;
|
|
2281
|
+
background: var(--bg-inverse);
|
|
2282
|
+
color: var(--text-inverse);
|
|
2283
|
+
font-size: 1.4rem;
|
|
2284
|
+
font-weight: 500;
|
|
2285
|
+
white-space: nowrap;
|
|
2286
|
+
transform: translateX(-50%);
|
|
2287
|
+
cursor: pointer;
|
|
2288
|
+
}
|
|
2289
|
+
`,jo=({videoId:e,panel:t,heading:n=`Transcript`,chips:r,onClose:i,overlay:a=!1,fit:o})=>{let[s,c]=M(``),[l,u]=M(``),[d,f]=z({query:Eo,variables:{panelId:t.panelId,params:t.params}}),p=d.data?.transcript.searchToken??void 0,m=l!==``&&p!==void 0,[h,g]=z({query:Do,variables:{token:p??``,query:l},pause:!m}),_=m?h.operation?.variables.query===l?h.data?.transcriptSearch:void 0:d.data?.transcript,[v,ee]=m?[h,g]:[d,f],y=fe(()=>_?.sections.flatMap(e=>[...e.startSeconds==null?[]:[e.startSeconds],...e.lines.map(e=>e.startSeconds)])??[],[_]),[b,te]=M(-1),ne=e=>te(y.findLastIndex(t=>t<=e));O(()=>{let t=()=>ne(lo(e)??-1);t();let n=setInterval(t,ko);return()=>clearInterval(n)},[e,y]);let x=P(null),[S,C]=M(!0),re=P(!1);E(()=>{let e=x.current,t=e?.querySelector(`[aria-current="true"]`);S&&e&&t&&(e.scrollTo({top:t.offsetTop-e.clientHeight*Oo,behavior:re.current?`smooth`:`instant`}),re.current=!0)},[b,S,y]);let w=()=>C(!1),ie=t=>{fo(e,t,!1),ne(t),C(!0)},ae=0;return H(_o,{label:`Transcript`,heading:n,chips:r,onClose:i,overlay:a,fit:o,className:`transcript-panel`,children:R(`div`,{css:Ao,className:`transcript-body`,children:[p?R(`form`,{className:`transcript-search`,role:`search`,onSubmit:e=>{e.preventDefault(),u(s.trim()),C(!0)},children:[H(`input`,{type:`text`,"aria-label":`Search transcript`,placeholder:`Search transcript`,value:s,onInput:e=>c(e.currentTarget.value)}),s?H(`button`,{type:`button`,className:`transcript-clear`,"aria-label":`Clear`,onClick:()=>{c(``),u(``)},children:H(A,{size:24,strokeWidth:1.5})}):void 0]}):void 0,R(`div`,{className:`transcript-lines`,ref:x,onWheel:w,onTouchMove:w,onPointerDown:e=>{e.target===e.currentTarget&&w()},children:[_?.sections.map(({title:e,startSeconds:t,lines:n},r)=>{let i=t==null?void 0:ae++;return R(ce,{children:[e?H(`h3`,{className:`transcript-chapter`,children:H(`button`,{type:`button`,"aria-current":i===b?`true`:void 0,onClick:()=>t==null||ie(t),children:e})}):void 0,n.map(e=>{let t=ae++;return R(`button`,{type:`button`,className:`transcript-line`,"aria-current":t===b?`true`:void 0,onClick:()=>ie(e.startSeconds),children:[H(`span`,{className:`transcript-time`,children:e.timestamp}),e.text]},t)})]},r)}),_?.sections.length===0?H(`p`,{className:`transcript-empty`,children:`No results found.`}):void 0,v.error&&!v.fetching&&!_?H(Fi,{error:v.error,reexecute:ee}):void 0]}),S?void 0:H(`button`,{type:`button`,className:`transcript-sync`,onClick:()=>C(!0),children:`Sync to video time`})]})})},Mo=({videoId:e,open:t,chapters:n,chapter:r,transcript:i,overlay:a,fit:o})=>{let s=n.length>0&&i!==void 0,c=s?[`chapters`,`transcript`].map(e=>H(`button`,{type:`button`,role:`tab`,className:`panel-chip`,"aria-selected":t===e,onClick:()=>qr(e),children:e===`chapters`?`Chapters`:`Transcript`},e)):void 0,l=s?`In this video`:void 0,u=()=>qr(void 0);if(t===`transcript`&&i)return H(jo,{videoId:e,panel:i,heading:l,chips:c,onClose:u,overlay:a,fit:o},`transcript:${e}`);if(t===`chapters`&&n.length>0)return H(bo,{videoId:e,chapters:n,current:r,heading:l,chips:c,onClose:u,overlay:a,fit:o},`chapters:${e}`)};k(),N();var No=D(void 0),Po=()=>T(No),Fo,Io=V`
|
|
2290
|
+
width: 100%;
|
|
2291
|
+
aspect-ratio: 16 / 9;
|
|
2292
|
+
overflow: hidden;
|
|
2293
|
+
border-radius: 12px;
|
|
2294
|
+
background: #000;
|
|
2295
|
+
position: relative;
|
|
2296
|
+
z-index: 1;
|
|
2297
|
+
|
|
2298
|
+
/* Fullscreen has to beat BOTH the 16/9 aspect-ratio box and the max-height
|
|
2299
|
+
that theater mode puts on this element, or the video is letterboxed inside
|
|
2300
|
+
a correctly-fullscreened container. Sizing off the viewport rather than
|
|
2301
|
+
100%/100% also survives whatever the ancestor grid was doing. */
|
|
2302
|
+
&:fullscreen {
|
|
2303
|
+
width: 100vw;
|
|
2304
|
+
height: 100vh;
|
|
2305
|
+
max-width: none;
|
|
2306
|
+
max-height: none;
|
|
2307
|
+
aspect-ratio: auto;
|
|
2308
|
+
border-radius: 0;
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
/* above the view's like and share buttons, which take this corner in full screen */
|
|
2312
|
+
&:fullscreen .sponsor-skip {
|
|
2313
|
+
bottom: 13.2rem;
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2316
|
+
/* the controls' left groups stop 8 px short of the grid's arrow in the middle, the chapter title giving way first */
|
|
2317
|
+
&:fullscreen .bar > .left {
|
|
2318
|
+
max-width: calc(50% - 2.8rem);
|
|
2319
|
+
}
|
|
2320
|
+
|
|
2321
|
+
/* youtube.com draws the chapters, the transcript and the comments in one slot beside the video, one at a time: 320 px
|
|
2322
|
+
wide and 16 px in from the edges, with the video narrowed to the rest (measured 2026-11-10 at 1280 px) */
|
|
2323
|
+
&.panel-open > [data-player-surface] {
|
|
2324
|
+
right: 35.2rem;
|
|
2325
|
+
}
|
|
2326
|
+
|
|
2327
|
+
& > .side-panel {
|
|
2328
|
+
position: absolute;
|
|
2329
|
+
top: 1.6rem;
|
|
2330
|
+
right: 1.6rem;
|
|
2331
|
+
bottom: 1.6rem;
|
|
2332
|
+
width: 32rem;
|
|
2333
|
+
}
|
|
2334
|
+
`,Lo=({details:e,onFullscreenChange:t,children:n})=>{let r=P(null),[a,o]=M(!1),[s,c]=M(!1),[l,u]=M(void 0),[d,f]=M(void 0);O(()=>{let e=()=>{let e=document.fullscreenElement!==null&&document.fullscreenElement===r.current;o(e),t?.(e),c(!1),u(void 0),qr(void 0)};return document.addEventListener(`fullscreenchange`,e),()=>{document.removeEventListener(`fullscreenchange`,e),t?.(!1)}},[t]),O(()=>{c(!1),u(void 0)},[e.videoId]),O(()=>{e.panel&&u(void 0)},[e.panel]);let p=e=>{e&&qr(void 0),u(e)};O(()=>{if(!a)return;let e=scrollY,t=()=>{document.fullscreenElement&&scrollY!==e&&scrollTo(scrollX,e)};return addEventListener(`scroll`,t),()=>removeEventListener(`scroll`,t)},[a]),O(()=>{if(!a||d)return;let e=!0;return Fo??=i(()=>import(`./fullscreen-view-BLgosU84.js`),__vite__mapDeps([10,6,1,7,5,11,12,13,14,15])),Fo.then(t=>{e&&f(t)},()=>{Fo=void 0}),()=>{e=!1}},[a]);let m=a?Mo({videoId:e.videoId,open:e.panel,chapters:e.chapters,chapter:e.chapter,transcript:e.transcript,overlay:!0}):void 0,h=()=>u(void 0),g=m??(!a||!d?void 0:l===`comments`&&!e.commentsHidden?H(d.CommentsPanel,{videoId:e.videoId,commentCountText:e.commentCountText,onClose:h},e.videoId):l===`description`&&e.description?H(d.DescriptionPanel,{details:e,onClose:h},e.videoId):void 0);return H(`div`,{css:Io,"data-player-root":!0,ref:r,className:g?`panel-open`:void 0,children:R(No.Provider,{value:{details:e,fullscreen:a,grid:s,setGrid:c,aside:l,setAside:p,view:d},children:[n,g?H(`div`,{className:`side-panel`,children:g}):void 0]})})},Ro,zo=e=>(Ro=e,()=>{Ro===e&&(Ro=void 0)}),Bo=()=>Ro?.();export{Ei as $,yn as $t,Fa as A,lr as At,fa as B,Wn as Bt,Ya as C,Ne as Cn,Ir as Ct,Ga as D,wr as Dt,Va as E,Me as En,Cr as Et,ka as F,Qn as Ft,Gi as G,En as Gt,Zi as H,Pn as Ht,ma as I,nr as It,Bi as J,Sn as Jt,Hi as K,Tn as Kt,ha as L,Un as Lt,Da as M,ur as Mt,ja as N,sr as Nt,La as O,Sr as Ot,Sa as P,er as Pt,Di as Q,xn as Qt,ga as R,Kn as Rt,$a as S,Re as Sn,Fr as St,Ua as T,Le as Tn,Er as Tt,Xi as U,q as Ut,pa as V,Nn as Vt,$i as W,Dn as Wt,Ii as X,Zt as Xt,Fi as Y,gn as Yt,Pi as Z,hn as Zt,ro as _,ze as _n,Lr as _t,Mo as a,St as an,ai as at,Qa as b,Ie as bn,Ar as bt,ho as c,vt as cn,Wr as ct,lo as d,ct as dn,ei as dt,Cn as en,Q as et,so as f,rt as fn,Qr as ft,no as g,He as gn,Jr as gt,io as h,Ge as hn,Gr as ht,Po as i,Tt as in,si as it,Ma as j,Y as jt,Ia as k,xr as kt,uo as l,_t as ln,Vr as lt,ao as m,Ue as mn,Kr as mt,Bo as n,vn as nn,Mi as nt,Co as o,ht as on,ri as ot,fo as p,nt as pn,qr as pt,zi as q,bn as qt,Lo as r,kt as rn,_i as rt,To as s,gt as sn,$r as st,zo as t,_n as tn,Ai as tt,co as u,Ct as un,Ur as ut,eo as v,W as vn,Pr as vt,Ka as w,Be as wn,Rr as wt,qa as x,Pe as xn,Mr as xt,Ja as y,je as yn,kr as yt,da as z,Hn as zt};
|