1import{j as t,B as s,G as o}from"./vendor-CB8aRiQb.js";import{c as a,d as e,u as i}from"./tanstack-DnVwJE41.js";import{u as n,S as l,a as r,b as m,c as p,d,e as c,I as u}from"./sticky-header-waZpn-Ga.js";import{l as y,aD as j,r as g,af as f,ag as x,ah as h,ai as b,aj as v,ak as S,al as P,am as C,c as A,q as I,bf as k,aS as T}from"./index-QStAHPDd.js";import{A as w}from"./actions-w19wsIcr.js";import{P as D}from"./options-7rqlAqeS.js";import{u as L}from"./i18n-B9NIix0Q.js";import{d as q}from"./context-menu-B5kCRSm2.js";import{D as F}from"./data-table-Ck3ft3Q3.js";import z from"./error-page-C1jtOmkV.js";import{s as N}from"./songs-columns-CPR6zJ-a.js";import{a as B}from"./convertSecondsToTime-CjvQNv7M.js";import"./vendor-dom-Cy37woXv.js";import"./randomCSSHexColor-BQd6MTXD.js";import"./lodash-5wnDK8zY.js";import"./dot-Q_YXDhuI.js";import"./image-loader-BtytEWBy.js";import"./multipleArtists-D-Sh2Xcm.js";import"./lightbox-D-mbmdS3.js";import"./scrollPageToTop-CcjTTbvt.js";import"./crypto-CxPwrja9.js";import"./date-time-DF0UKTVy.js";import"./tailwind-84t1un2J.js";import"./radix-Ba6gAkaf.js";import"./lucide-Baf6G6lW.js";import"./forms-C7wX05ML.js";import"./formatters-8CKGHcJj.js";import"./markdown-W3r5aBu3.js";import"./use-download-Dc_RIxPF.js";import"./command-BWvvOXd7.js";import"./quality-badge-DGq-iOWF.js";import"./cover-image-CLvi39ZQ.js";import"./play-button-ZYt8SIiZ.js";import"./equalizer-bars-BjfOAsHq.js";import"./action-button-DDoCZLD7.js";import"./like-button-x5aoeAx9.js";import"./data-table-column-header-Ba10jdmD.js";function E({playlist:s}){const{t:o}=L(),{setSongList:a,togglePlayPause:e,toggleShuffle:i}=y(),{isPlaylistActive:n,isPlaylistPlaying:l}=j(s.id),r=g((t=>t.playerState.isShuffleActive)),m={play:o(l?"playlist.buttons.pause":"playlist.buttons.play",{name:s.name}),shuffle:o("playlist.buttons.shuffle",{name:s.name}),options:o("playlist.buttons.options",{name:s.name})},p={id:s.id,name:s.name,type:"playlist"};return t.jsxs(w.Container,{children:[t.jsx(w.Button,{tooltip:m.play,buttonStyle:"primary",onClick:function(){n?e():a(s.entry,0,!1,p)},disabled:!s.entry,children:l?t.jsx(w.PauseIcon,{}):t.jsx(w.PlayIcon,{})}),t.jsx(w.Button,{tooltip:m.shuffle,onClick:function(){n?i():a(s.entry,0,!0,p)},disabled:!s.entry,isActive:n&&r,children:t.jsx(w.ShuffleIcon,{})}),t.jsx(w.Dropdown,{tooltip:m.options,options:t.jsx(D,{playlist:s,disablePlayNext:!s.entry,disableAddLast:!s.entry,disableDownload:!s.entry})})]})}function O(){const{t:o}=L(),{confirmDialogState:i,setConfirmDialogState:n,actionData:l}=q(),r=l.songIndexes.length,m=a(),p=e({mutationFn:A.playlists.update,onSuccess:()=>{m.invalidateQueries({queryKey:[I.playlist.single,l.playlistId]}),s.success(o("playlist.form.removeSong.toast.success",{count:r}))},onError:()=>{s.error(o("playlist.form.removeSong.toast.error",{count:r}))}});return t.jsx(f,{open:i,onOpenChange:t=>n(t),children:t.jsxs(x,{children:[t.jsxs(h,{children:[t.jsx(b,{children:o("playlist.form.removeSong.title",{count:r})}),t.jsx(v,{children:o("playlist.form.removeSong.description")})]}),t.jsxs(S,{children:[t.jsx(P,{children:o("logout.dialog.cancel")}),t.jsx(C,{onClick:async function(){await p.mutateAsync({playlistId:l.playlistId,songIndexToRemove:l.songIndexes})},children:o("logout.dialog.confirm")})]})]})})}function G({playlist:s}){const{bgColor:o,handleLoadImage:a,handleError:e}=n(c),{isPlaylistActive:i,isPlaylistPlaying:u}=j(s.id),{setSongList:g,togglePlayPause:f}=y();return t.jsxs(l,{style:{backgroundColor:o},children:[t.jsx(r,{isPlaying:u,onClick:function(){if(i)f();else{const t={id:s.id,name:s.name,type:"playlist"};g(s.entry,0,!1,t)}}}),t.jsxs(m,{children:[t.jsx(p,{id:s.coverArt,type:"album",size:"700",alt:s.name,onLoad:a,onError:e}),t.jsx(d,{title:s.name,subtitle:s.comment})]})]},s.id)}function H(){const{playlistId:s}=o(),{t:a}=L(),e=N(),{setSongList:n}=y(),{data:l,isLoading:r,isFetching:m}=i({queryKey:[I.playlist.single,s],queryFn:()=>A.playlists.getOne(s)});if(m||r)return t.jsx(k,{});if(!l)return t.jsx(z,{status:404,statusText:"Not Found"});const p=l.songCount>0,d=B(l.duration),c=[{content:p?a("playlist.songCount",{count:l.songCount}):null,type:"text"},{content:p?a("playlist.duration",{duration:d}):null,type:"text"}],j=l.songCount>0?l.coverArt:void 0;return t.jsxs("div",{className:"w-full relative",children:[t.jsx(G,{playlist:l}),t.jsx(u,{type:a("playlist.headline"),title:l.name,subtitle:l.comment,coverArtId:j,coverArtType:"album",coverArtSize:"700",coverArtAlt:l.name,badges:c,isPlaylist:!0}),t.jsxs(T,{children:[t.jsx(E,{playlist:l}),t.jsx(F,{columns:e,data:l.entry??[],handlePlaySong:t=>{n(l.entry,t.index,!1,{id:l.id,name:l.name,type:"playlist"})},columnFilter:["index","title","album","duration","playCount","contentType","select"],noRowsMessage:a("playlist.noSongList"),variant:"modern",enableVirtualization:!0}),t.jsx(O,{})]})]},l.id)}export{H as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.