@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.
Files changed (91) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -2
  3. package/__yt_engine__/engine.html +9 -0
  4. package/app.webmanifest +31 -0
  5. package/assets/account-BL8Hv7lS.js +157 -0
  6. package/assets/account-By94iboj.js +1 -0
  7. package/assets/account-DfiXzypA-YE6OyKjK.js +1 -0
  8. package/assets/account-generation-BP_-Qyck-BOth6YQ_.js +1 -0
  9. package/assets/agent-source-E4g0cDzU.js +1 -0
  10. package/assets/api-1NDCtwel-CAaxX8P1.js +3 -0
  11. package/assets/binary-encoding-By5K7InN.js +1 -0
  12. package/assets/build-CNn3bm6X.js +1 -0
  13. package/assets/busy-C1JPjoZ_-CJ0641jK.js +1 -0
  14. package/assets/cards-Csel8naI.js +2334 -0
  15. package/assets/channel-B5f9YTIf.js +1160 -0
  16. package/assets/client-version-D9kIz6Gz.js +1 -0
  17. package/assets/comments-CJp9O808.js +612 -0
  18. package/assets/dislikes-DH5jCVEY.js +1 -0
  19. package/assets/dist-7VpLCl1k.js +1 -0
  20. package/assets/dist-BOrL1gYg.js +2 -0
  21. package/assets/downloads-CMXDjA_E.js +191 -0
  22. package/assets/egress.worker-DopXr5uP.js +104 -0
  23. package/assets/engine-B_kFyW7L.js +2 -0
  24. package/assets/feed-channels-Dg2mvF5x.js +251 -0
  25. package/assets/feed-groups-CnyR4sOO.js +160 -0
  26. package/assets/feed-history-BDAGG9N5.js +368 -0
  27. package/assets/feed-playlists-DcGR2AL6.js +167 -0
  28. package/assets/feed-subscriptions-Sm3tKz4P.js +165 -0
  29. package/assets/feed-you-lxbqknXX.js +110 -0
  30. package/assets/formats-CDwXfKnr.js +1 -0
  31. package/assets/frame-BrGNSf3s.js +2 -0
  32. package/assets/fs-CjRTQ7Nu.js +1 -0
  33. package/assets/fs-CwRtKje1-CBsYhX2-.js +1 -0
  34. package/assets/fullscreen-view-BLgosU84.js +269 -0
  35. package/assets/group-C00s0aT7.js +183 -0
  36. package/assets/groups-button-CvVnqwlu.js +25 -0
  37. package/assets/hashtag-CCIhITaL.js +115 -0
  38. package/assets/icons-DKsqNLSs.js +1 -0
  39. package/assets/index-A5dHbptn.css +1 -0
  40. package/assets/index-DwsYJ-bu.js +1328 -0
  41. package/assets/lib-h0P14ZFl.js +70 -0
  42. package/assets/linkify-B6hdFhsL.js +1 -0
  43. package/assets/packages-C3w3tSjj-BCtDk0vj.js +1 -0
  44. package/assets/party-CUcxsJDF.js +180 -0
  45. package/assets/playlist-DF7wsidw.js +521 -0
  46. package/assets/playlist-card-Btoc7D8f.js +91 -0
  47. package/assets/playlist-panel-D97BwT1f.js +199 -0
  48. package/assets/post-CQ9mfVos.js +39 -0
  49. package/assets/post-card-ZUQixO1G.js +76 -0
  50. package/assets/privacy-hkbqXFeB.js +46 -0
  51. package/assets/protobuf-BXZ2dCCc.js +1 -0
  52. package/assets/read-more-BhddUSlS.js +20 -0
  53. package/assets/rich-text-07paR5O3.js +25 -0
  54. package/assets/roboto-cyrillic-ext-BCp_3N7R.woff2 +0 -0
  55. package/assets/roboto-cyrillic-fOt7epNf.woff2 +0 -0
  56. package/assets/roboto-greek-DlT9XTxE.woff2 +0 -0
  57. package/assets/roboto-greek-ext-Bgw4czJT.woff2 +0 -0
  58. package/assets/roboto-latin-ccAYIvAh.woff2 +0 -0
  59. package/assets/roboto-latin-ext-DYIxWhlt.woff2 +0 -0
  60. package/assets/roboto-math-4a3xuzGk.woff2 +0 -0
  61. package/assets/roboto-symbols-B7iHSfaG.woff2 +0 -0
  62. package/assets/roboto-vietnamese-_f1XEJpo.woff2 +0 -0
  63. package/assets/rooms-B-AvBY-c-FNDqRDHE.js +1 -0
  64. package/assets/rooms-B91zuirR.js +1 -0
  65. package/assets/save-menu-DF1WKqSE.js +462 -0
  66. package/assets/search-Cx5IpDtZ.js +1026 -0
  67. package/assets/settings-kESE_uBm.js +99 -0
  68. package/assets/shaka-BwT9pJcV.js +36 -0
  69. package/assets/share-dialog-Cp0BJ6bg.js +156 -0
  70. package/assets/shorts-BxDB7m0c.js +686 -0
  71. package/assets/shorts-grid-Bgbkl5dP.js +11 -0
  72. package/assets/sign-in-Bx3zmj-m.js +97 -0
  73. package/assets/signed-out-prompt-CEAx65kq.js +79 -0
  74. package/assets/signin-DkI8Ogzz.js +18 -0
  75. package/assets/social-bXt3vmd4.js +1 -0
  76. package/assets/video-card-compact-r-K4XyDb.js +190 -0
  77. package/assets/watch-CkxSP1IA.js +1802 -0
  78. package/assets/web-BNanCsH5.js +43 -0
  79. package/favicon.ico +0 -0
  80. package/favicon.svg +5 -0
  81. package/icons/icon-192.png +0 -0
  82. package/icons/icon-512.png +0 -0
  83. package/index-Bj-Q3X8Q.js +4120 -0
  84. package/index.html +32 -0
  85. package/package.json +45 -4
  86. package/store/background.webp +0 -0
  87. package/store/channel.webp +0 -0
  88. package/store/cover.webp +0 -0
  89. package/store/phone.webp +0 -0
  90. package/store/search.webp +0 -0
  91. package/store/watch.webp +0 -0
@@ -0,0 +1,462 @@
1
+ import{Ut as e,dn as t,en as n,et as r,g as i,h as a,in as o,j as s,mn as c,on as l,sn as u,tn as d,z as f}from"./icons-DKsqNLSs.js";import{O as p,a as m,c as h,d as g,g as _,k as v,o as y,ot as b,s as x,t as S,y as C}from"./sign-in-Bx3zmj-m.js";import{$ as w,G as T,L as E,X as D,Z as O,_n as k,c as A,et as j,in as M,j as N,k as P,nt as F,o as I,p as L,t as R,tt as z}from"./cards-Csel8naI.js";import{n as B,t as V}from"./rich-text-07paR5O3.js";u();var H=3,U=20,W=4,G=24,K=b`
2
+ margin-top: 1.2rem;
3
+ padding: 1.2rem;
4
+ border-radius: 1.2rem;
5
+ background: var(--bg-hover);
6
+ font-size: 1.4rem;
7
+ line-height: 2rem;
8
+ color: var(--text-primary);
9
+ transition: background 0.15s ease;
10
+
11
+ &.collapsed {
12
+ cursor: pointer;
13
+ }
14
+
15
+ &.collapsed:hover {
16
+ background: var(--bg-hover-strong);
17
+ }
18
+
19
+ .meta {
20
+ display: flex;
21
+ flex-wrap: wrap;
22
+ column-gap: 0.8rem;
23
+ font-weight: 500;
24
+ overflow-wrap: anywhere;
25
+ }
26
+
27
+ .counts {
28
+ white-space: pre-wrap;
29
+ }
30
+
31
+ .hashtag {
32
+ color: var(--text-secondary);
33
+ }
34
+
35
+ .snippet {
36
+ position: relative;
37
+ }
38
+
39
+ .text {
40
+ display: block;
41
+ white-space: pre-wrap;
42
+ word-break: break-word;
43
+ }
44
+
45
+ /* Cut by height rather than a line clamp: a clamp draws its own
46
+ ellipsis on the last kept line, which is a lone one when that line is blank.
47
+ The mask hides the last line from where the inline button starts, fading
48
+ the text it cuts, so it reads on the translucent box in either theme. */
49
+ .clamped .text {
50
+ max-height: ${6}rem;
51
+ overflow: hidden;
52
+ mask-image:
53
+ linear-gradient(to top, transparent 2rem, #000 2rem),
54
+ linear-gradient(to right, #000 var(--fade-from, 0), transparent var(--more-left, 0));
55
+ }
56
+
57
+ .more {
58
+ position: absolute;
59
+ left: var(--more-left, auto);
60
+ bottom: 0;
61
+ padding: 0;
62
+ border: none;
63
+ background: transparent;
64
+ color: var(--text-primary);
65
+ font: inherit;
66
+ font-weight: 500;
67
+ white-space: nowrap;
68
+ cursor: pointer;
69
+ }
70
+
71
+ /* youtube.com pads each section 16px above and below */
72
+ .chapters,
73
+ .music,
74
+ .transcript,
75
+ .channel-card {
76
+ padding: 1.6rem 0;
77
+ }
78
+
79
+ .chapters-head {
80
+ display: flex;
81
+ align-items: center;
82
+ justify-content: space-between;
83
+ gap: 1.2rem;
84
+ margin-bottom: 0.4rem;
85
+ }
86
+
87
+ .chapters-heading {
88
+ font-size: 2rem;
89
+ font-weight: 700;
90
+ line-height: 2.8rem;
91
+ }
92
+
93
+ .view-all {
94
+ flex: none;
95
+ height: 4rem;
96
+ padding: 0 1.5rem;
97
+ border: 1px solid var(--border-subtle);
98
+ border-radius: 2rem;
99
+ background: transparent;
100
+ color: var(--text-primary);
101
+ font: inherit;
102
+ font-weight: 500;
103
+ cursor: pointer;
104
+ }
105
+
106
+ .view-all:hover {
107
+ background: var(--bg-hover);
108
+ }
109
+
110
+ .show-transcript {
111
+ display: block;
112
+ margin-top: 1.6rem;
113
+ color: var(--accent);
114
+ }
115
+
116
+ .show-transcript:hover {
117
+ background: var(--accent-hover);
118
+ }
119
+
120
+ .pill {
121
+ display: inline-flex;
122
+ align-items: center;
123
+ gap: 0.6rem;
124
+ }
125
+
126
+ .music-count,
127
+ .song-line,
128
+ .channel-subs {
129
+ display: block;
130
+ color: var(--text-secondary);
131
+ font-size: 1.2rem;
132
+ line-height: 1.8rem;
133
+ }
134
+
135
+ .songs {
136
+ margin-top: 0.4rem;
137
+ --rail-gap: 1.2rem;
138
+ --rail-arrow-top: 6.2rem;
139
+ }
140
+
141
+ .song {
142
+ display: block;
143
+ width: 16.4rem;
144
+ color: var(--text-primary);
145
+ }
146
+
147
+ .song-thumb,
148
+ .channel-avatar {
149
+ display: block;
150
+ flex: none;
151
+ overflow: hidden;
152
+ background: var(--bg-chip);
153
+ }
154
+
155
+ .song-thumb {
156
+ width: 16.4rem;
157
+ height: 16.4rem;
158
+ border-radius: 0.8rem;
159
+ }
160
+
161
+ .song-thumb img,
162
+ .channel-avatar img {
163
+ display: block;
164
+ width: 100%;
165
+ height: 100%;
166
+ object-fit: cover;
167
+ }
168
+
169
+ .song-details {
170
+ display: block;
171
+ min-width: 0;
172
+ padding-top: 0.4rem;
173
+ }
174
+
175
+ .song-title {
176
+ display: -webkit-box;
177
+ overflow: hidden;
178
+ -webkit-line-clamp: 2;
179
+ -webkit-box-orient: vertical;
180
+ }
181
+
182
+ .song-line {
183
+ overflow: hidden;
184
+ white-space: nowrap;
185
+ text-overflow: ellipsis;
186
+ }
187
+
188
+ /* youtube.com lays a lone song beside its cover, and several under theirs in a row */
189
+ .songs.single .song {
190
+ display: flex;
191
+ gap: 1.6rem;
192
+ width: auto;
193
+ }
194
+
195
+ .songs.single .song-details {
196
+ padding-top: 0;
197
+ }
198
+
199
+ .music-channel {
200
+ justify-content: center;
201
+ width: 32.8rem;
202
+ max-width: 100%;
203
+ margin-top: 2rem;
204
+ }
205
+
206
+ .channel-head {
207
+ display: flex;
208
+ align-items: center;
209
+ gap: 1.2rem;
210
+ margin-bottom: 1.6rem;
211
+ }
212
+
213
+ .channel-avatar {
214
+ width: 3.6rem;
215
+ height: 3.6rem;
216
+ border-radius: 50%;
217
+ }
218
+
219
+ .channel-name {
220
+ display: block;
221
+ font-size: 2rem;
222
+ font-weight: 600;
223
+ line-height: 2.6rem;
224
+ }
225
+
226
+ .channel-links {
227
+ --rail-gap: 0.8rem;
228
+ --rail-arrow-top: 0;
229
+ }
230
+
231
+ /* youtube.com glides the cards up until they end 24 px above the bottom (measured 2026-11-10); cards above the
232
+ page's top land under the masthead */
233
+ .channel-card {
234
+ scroll-margin: var(--header-height) 0 2.4rem;
235
+ }
236
+
237
+ /* youtube.com's info cards, measured 2026-11-10: rows 64 px tall and 12 px apart, a 112 px wide picture with a
238
+ channel's 64 px avatar in its middle, and the text 16 px after it, the title on one line */
239
+ .info-cards {
240
+ display: grid;
241
+ gap: 1.2rem;
242
+ margin-top: 1.6rem;
243
+ }
244
+
245
+ .info-card {
246
+ display: flex;
247
+ align-items: center;
248
+ gap: 1.6rem;
249
+ height: 6.4rem;
250
+ color: var(--text-primary);
251
+ }
252
+
253
+ .card-thumb {
254
+ position: relative;
255
+ flex: none;
256
+ width: 11.2rem;
257
+ height: 6.4rem;
258
+ overflow: hidden;
259
+ border-radius: 0.8rem;
260
+ background: var(--bg-chip);
261
+ }
262
+
263
+ .card-thumb.round {
264
+ width: 6.4rem;
265
+ margin: 0 2.4rem;
266
+ border-radius: 50%;
267
+ }
268
+
269
+ .card-thumb img {
270
+ display: block;
271
+ width: 100%;
272
+ height: 100%;
273
+ object-fit: cover;
274
+ }
275
+
276
+ .card-duration {
277
+ position: absolute;
278
+ right: 0.4rem;
279
+ bottom: 0.4rem;
280
+ padding: 0 0.4rem;
281
+ border-radius: 0.4rem;
282
+ background: var(--bg-badge);
283
+ color: #ffffff;
284
+ font-size: 1.2rem;
285
+ font-weight: 500;
286
+ line-height: 1.8rem;
287
+ }
288
+
289
+ .card-text {
290
+ min-width: 0;
291
+ }
292
+
293
+ .card-title {
294
+ display: -webkit-box;
295
+ overflow: hidden;
296
+ font-weight: 500;
297
+ -webkit-line-clamp: 1;
298
+ -webkit-box-orient: vertical;
299
+ }
300
+
301
+ .card-subtitle {
302
+ display: flex;
303
+ align-items: center;
304
+ gap: 0.4rem;
305
+ color: var(--text-secondary);
306
+ font-size: 1.2rem;
307
+ line-height: 1.8rem;
308
+ }
309
+
310
+ .less {
311
+ display: block;
312
+ margin-top: 1.6rem;
313
+ padding: 0;
314
+ border: none;
315
+ background: transparent;
316
+ color: var(--text-primary);
317
+ font: inherit;
318
+ font-weight: 500;
319
+ cursor: pointer;
320
+ }
321
+ `,q=b`
322
+ .clamped .text {
323
+ max-height: ${40}rem;
324
+ }
325
+
326
+ .less {
327
+ margin-top: 2rem;
328
+ }
329
+ `,J=(e,t)=>{let n=e.querySelector(`.text`);if(!n)return!1;let r=Number.parseFloat(getComputedStyle(n).lineHeight),i=Math.round(n.scrollHeight/r),a=e.querySelector(`.more`);if(!a)return i>t;let o=n.getBoundingClientRect(),s=Math.max(1,Math.min(t,i)),c=o.top+(s-1)*r,l=document.createRange();l.selectNodeContents(n);let u=Math.max(0,...[...l.getClientRects()].filter(e=>e.width>0&&e.top+e.height/2>=c&&e.top+e.height/2<c+r).map(e=>e.right-o.left)),d=o.width-a.offsetWidth,f=Math.min(u+W,d);return e.style.setProperty(`--more-left`,`${f}px`),e.style.setProperty(`--fade-from`,`${f<u+W?f-G:f}px`),i>t},Y=({viewCountText:e,publishedDateText:t,shortViewCountText:r,relativeDateText:s,hashtags:c=[],description:u,runs:p,videoId:m,chapters:g=[],currentChapter:_=-1,onViewChapters:v,onShowTranscript:y,music:b,channelCard:S,open:w=!1})=>{let[T,E]=l(!1),[D,O]=l(!1),j=T||w,N=!T&&!(w&&D),P=d(null),F=d(null),[z,W]=l(0);o(()=>{if(S&&!w)return R(()=>{E(!0),W(e=>e+1)})},[S,w]),o(()=>{z>0&&F.current?.scrollIntoView({block:`nearest`,behavior:`smooth`})},[z]),n(()=>{let e=P.current;if(T||!e)return;let t=()=>{let t=J(e,w?U:H);w&&O(!t)};t(),document.fonts.ready.then(t);let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[T,u,p,w]);let G=()=>E(!0),Y=x(`button`,{type:`button`,className:`less`,onClick:()=>E(!1),children:`Show less`}),Q=k({expanded:j,viewCountText:e,shortViewCountText:r,publishedDateText:t,relativeDateText:s});return h(`div`,{css:w?[K,q]:K,className:j?void 0:`collapsed`,onClick:j?void 0:G,children:[Q||c.length>0?h(`div`,{className:`meta`,children:[Q?x(`span`,{className:`counts`,children:Q}):void 0,c.map(e=>{let t=B(e);return t?x(C,{className:`hashtag`,href:t,children:e},e):x(`span`,{className:`hashtag`,children:e},e)})]}):void 0,u?h(`div`,{className:N?`snippet clamped`:`snippet`,ref:P,onClick:w&&N?G:void 0,children:[p&&p.length>0?x(V,{className:`text`,runs:p,videoId:m}):x(`div`,{className:`text`,children:u}),N?x(`button`,{type:`button`,className:`more`,children:`...more`}):void 0]}):void 0,u&&T&&w?Y:void 0,j&&m&&g.length>0?h(`section`,{className:`chapters`,"aria-label":`Chapters`,children:[h(`div`,{className:`chapters-head`,children:[x(`h2`,{className:`chapters-heading`,children:`Chapters`}),v?x(`button`,{type:`button`,className:`view-all`,onClick:()=>{v(),scrollTo({top:0})},children:`View all`}):void 0]}),x(I,{videoId:m,chapters:g,current:_,onSeek:e=>{L(m,e),scrollTo({top:0})}})]}):void 0,j&&b?h(`section`,{className:`music`,"aria-label":`Music`,children:[x(`h2`,{className:`chapters-heading`,children:`Music`}),b.countText?x(`span`,{className:`music-count`,children:b.countText}):void 0,b.songs.length===1?x(`div`,{className:`songs single`,children:x(Z,{song:b.songs[0]})}):x(`div`,{className:`songs`,children:x(A,{label:`songs`,count:b.songs.length,children:b.songs.map((e,t)=>x(Z,{song:e},`${t}:${e.title}`))})}),b.channelId?h(C,{className:`view-all pill music-channel`,href:`/channel/${b.channelId}`,children:[x(f,{size:24,strokeWidth:1.5}),`Music`]}):void 0]}):void 0,j&&y?h(`section`,{className:`transcript`,"aria-label":`Transcript`,children:[x(`h2`,{className:`chapters-heading`,children:`Transcript`}),x(`button`,{type:`button`,className:`view-all show-transcript`,onClick:()=>{y(),scrollTo({top:0})},children:`Show transcript`})]}):void 0,j&&S?h(`section`,{className:`channel-card`,"aria-label":`Channel`,ref:F,children:[h(C,{className:`channel-head`,href:`/channel/${S.id}`,children:[x(`span`,{className:`channel-avatar`,children:S.avatar?x(M,{src:S.avatar}):void 0}),h(`span`,{children:[x(`span`,{className:`channel-name`,children:S.name}),S.subscriberCountText?x(`span`,{className:`channel-subs`,children:S.subscriberCountText}):void 0]})]}),x(`div`,{className:`channel-links`,children:h(A,{label:`links`,count:S.links.length,children:[S.videosUrl?h(C,{className:`view-all pill`,href:S.videosUrl,children:[x(i,{size:24,strokeWidth:1.5}),`Videos`]}):void 0,S.aboutUrl?h(C,{className:`view-all pill`,href:S.aboutUrl,children:[x(a,{size:24,strokeWidth:1.5}),`About`]}):void 0,S.links.map(e=>x(`a`,{className:`view-all pill`,href:e.url,target:`_blank`,rel:`noreferrer noopener`,children:e.title},e.url))]})}),S.cards.length>0?x(`div`,{className:`info-cards`,children:S.cards.map((e,t)=>x(X,{card:e},t))}):void 0]}):void 0,u&&T&&!w?Y:void 0]})},X=({card:t})=>{let n=h(y,{children:[h(`span`,{className:t.channelId?`card-thumb round`:`card-thumb`,children:[t.thumbnail?x(M,{src:t.thumbnail}):void 0,t.duration?x(`span`,{className:`card-duration`,children:t.duration}):void 0]}),h(`span`,{className:`card-text`,children:[x(`span`,{className:`card-title`,children:t.title}),t.subtitle?h(`span`,{className:`card-subtitle`,children:[t.subtitle,t.url?x(e,{size:12,strokeWidth:2,"aria-hidden":`true`}):void 0]}):void 0]})]});return t.url?x(`a`,{className:`info-card`,href:t.url,target:`_blank`,rel:`noreferrer noopener`,children:n}):x(C,{className:`info-card`,href:t.videoId?P(t.videoId):`/channel/${t.channelId}`,children:n})},Z=({song:e})=>{let t=h(y,{children:[x(`span`,{className:`song-thumb`,children:e.thumbnail?x(M,{src:e.thumbnail}):void 0}),h(`span`,{className:`song-details`,children:[x(`span`,{className:`song-title`,children:e.title}),e.artist?x(`span`,{className:`song-line`,children:e.artist}):void 0,e.album?x(`span`,{className:`song-line`,children:e.album}):void 0]})]});return e.videoId?x(C,{className:`song`,href:P(e.videoId),children:t}):x(`div`,{className:`song`,children:t})};c(),u();var Q=_(`
330
+ query SavePlaylists($cursor: String) {
331
+ playlists(cursor: $cursor) {
332
+ items {
333
+ id
334
+ title
335
+ videoCountText
336
+ }
337
+ cursor
338
+ }
339
+ }
340
+ `),ee=_(`
341
+ mutation AddToPlaylist($playlistId: ID!, $videoIds: [ID!]!) {
342
+ addToPlaylist(playlistId: $playlistId, videoIds: $videoIds) {
343
+ id
344
+ }
345
+ }
346
+ `),te=_(`
347
+ mutation CreatePlaylist($title: String!, $videoIds: [ID!], $privacy: PlaylistPrivacy) {
348
+ createPlaylist(title: $title, videoIds: $videoIds, privacy: $privacy) {
349
+ id
350
+ title
351
+ videoCountText
352
+ privacy
353
+ }
354
+ }
355
+ `),ne=b`
356
+ display: flex;
357
+ align-items: center;
358
+ gap: 0.8rem;
359
+ height: var(--action-height, 3.6rem);
360
+ padding: 0 1.6rem;
361
+ border: none;
362
+ border-radius: calc(var(--action-height, 3.6rem) / 2);
363
+ background: var(--bg-chip);
364
+ color: var(--text-primary);
365
+ font-size: 1.4rem;
366
+ font-weight: 500;
367
+ cursor: pointer;
368
+ transition: background 0.15s ease;
369
+
370
+ &:hover {
371
+ background: var(--bg-chip-hover);
372
+ }
373
+ `,re=b`
374
+ min-width: 28rem;
375
+ `,ie=b`
376
+ display: flex;
377
+ flex-direction: column;
378
+ gap: 1.6rem;
379
+
380
+ .field {
381
+ display: flex;
382
+ flex-direction: column;
383
+ gap: 0.4rem;
384
+ }
385
+
386
+ .field-label {
387
+ font-size: 1.2rem;
388
+ color: var(--text-secondary);
389
+ }
390
+
391
+ .name {
392
+ height: 4rem;
393
+ padding: 0 1.2rem;
394
+ border: 1px solid var(--border-strong);
395
+ border-radius: 0.8rem;
396
+ background: var(--bg-input);
397
+ color: var(--text-primary);
398
+ font-size: 1.4rem;
399
+ }
400
+
401
+ .name:focus,
402
+ .privacy:focus {
403
+ outline: none;
404
+ border-color: var(--accent-focus);
405
+ }
406
+
407
+ .privacy {
408
+ height: 4rem;
409
+ padding: 0 1.2rem;
410
+ border: 1px solid var(--border-strong);
411
+ border-radius: 0.8rem;
412
+ background: var(--bg-input);
413
+ color: var(--text-primary);
414
+ font-size: 1.4rem;
415
+ }
416
+
417
+ .row {
418
+ display: flex;
419
+ justify-content: flex-end;
420
+ gap: 0.8rem;
421
+ }
422
+
423
+ .cancel,
424
+ .create {
425
+ height: 3.6rem;
426
+ padding: 0 1.6rem;
427
+ border: none;
428
+ border-radius: 1.8rem;
429
+ font-size: 1.4rem;
430
+ font-weight: 500;
431
+ cursor: pointer;
432
+ transition: background 0.15s ease;
433
+ }
434
+
435
+ .cancel {
436
+ background: transparent;
437
+ color: var(--accent);
438
+ }
439
+
440
+ .cancel:hover {
441
+ background: var(--accent-hover);
442
+ }
443
+
444
+ /* --accent-inverse is the OPPOSITE theme's accent, meant as a foreground on
445
+ an inverted surface: as a fill here it lands at #3ea6ff in the light theme
446
+ and takes white text to 2.6:1, under the 4.5:1 this size needs. The filled
447
+ pills elsewhere in the app use the inverse PAIR, which stays legible in
448
+ both themes and needs no literal. */
449
+ .create {
450
+ background: var(--bg-inverse);
451
+ color: var(--text-inverse);
452
+ }
453
+
454
+ .create:not(:disabled):hover {
455
+ background: var(--bg-inverse-hover);
456
+ }
457
+
458
+ .create:disabled {
459
+ opacity: 0.5;
460
+ cursor: default;
461
+ }
462
+ `,ae=({videoId:e,align:n=`end`,class:i,trigger:a})=>{let{ready:o,signedIn:c}=g(),[u,d]=l(!1),[f,_]=l([]),[b,C]=l([]),[k,A]=l(void 0),[M,P]=l(!1),[I,L]=l([]),[R,B]=l(``),[V,H]=l(`PRIVATE`),[{data:U,error:W,fetching:G},K]=v({query:Q,variables:{cursor:f[f.length-1]?.cursor},pause:!u||!o||!c}),[,q]=p(ee),[J,Y]=p(te),X=U?.playlists,{items:Z,cursor:ae}=N({pages:X?[...f,X]:f,key:e=>e.id}),oe=()=>{X?.cursor&&!G&&_(f[f.length-1]===X?f:[...f,X])},$=[...I,...Z.filter(e=>e.id!==`WL`&&!I.some(t=>t.id===e.id))],se=(t,n)=>{k!==void 0||b.includes(t)||(A(t),q({playlistId:t,videoIds:[e]}).then(e=>{if(A(void 0),e.error){m(O(e.error));return}C(e=>[...e,t]),m(`Saved to ${n}`)}))},ce=e=>B(e.currentTarget.value),le=e=>H(e.currentTarget.value),ue=t=>{t.preventDefault();let n=R.trim();n.length===0||J.fetching||Y({title:n,videoIds:[e],privacy:V}).then(e=>{if(e.error){m(O(e.error));return}let t=e.data?.createPlaylist;t&&(L(e=>[...e,t]),C(e=>[...e,t.id])),P(!1),B(``),m(`Saved to ${n}`)})},de=()=>h(y,{children:[x(r,{size:20,strokeWidth:1.5}),`Save`]});return o&&!c?a?t(a,{onClick:S}):x(`button`,{type:`button`,css:ne,className:i,onClick:S,children:de()}):h(y,{children:[x(w,{label:`Save to playlist`,align:n,class:i,onOpenChange:d,trigger:a??x(`button`,{type:`button`,css:ne,children:de()}),children:h(`div`,{css:re,role:`presentation`,children:[h(z,{title:`Save video to…`,children:[x(j,{label:`Watch later`,checked:b.includes(`WL`),disabled:k!==void 0||b.includes(`WL`),onSelect:()=>se(`WL`,`Watch later`)}),$.map(e=>x(j,{label:e.title,detail:e.videoCountText??void 0,trailingIcon:E(e.privacy),checked:b.includes(e.id),disabled:k!==void 0||b.includes(e.id),onSelect:()=>se(e.id,e.title)},e.id)),G&&$.length===0?x(j,{label:`Loading…`,disabled:!0}):void 0,!G&&!W&&$.length===0?x(j,{label:`No playlists yet`,disabled:!0}):void 0,W&&!G?x(D,{error:W,reexecute:K}):void 0,ae&&!W?x(j,{label:G?`Loading more…`:`Show more`,disabled:G,closeOnSelect:!1,onSelect:oe}):void 0]}),x(F,{}),x(j,{icon:s,label:`Create new playlist`,disabled:k!==void 0,onSelect:()=>P(!0)})]})}),M?x(T,{title:`New playlist`,onClose:()=>P(!1),children:h(`form`,{css:ie,onSubmit:ue,children:[h(`label`,{className:`field`,children:[x(`span`,{className:`field-label`,children:`Name`}),x(`input`,{className:`name`,type:`text`,value:R,maxLength:150,placeholder:`Enter playlist name`,onInput:ce})]}),h(`label`,{className:`field`,children:[x(`span`,{className:`field-label`,children:`Visibility`}),h(`select`,{className:`privacy`,value:V,onChange:le,children:[x(`option`,{value:`PRIVATE`,children:`Private`}),x(`option`,{value:`UNLISTED`,children:`Unlisted`}),x(`option`,{value:`PUBLIC`,children:`Public`})]})]}),h(`div`,{className:`row`,children:[x(`button`,{type:`button`,className:`cancel`,onClick:()=>P(!1),children:`Cancel`}),x(`button`,{type:`submit`,className:`create`,disabled:R.trim().length===0||J.fetching,children:J.fetching?`Creating…`:`Create`})]})]})}):void 0]})};export{Y as n,ae as t};