import{j as t,ag as j,z as h,a as P,av as m,S as v,T as e,D as C,Y as I,at as S,aA as N,J as r,aq as b}from"./main-D6SjkSWq.js";import{M as A}from"./media-page-no-results-message-a-ZeD-S3.js";import{P as D}from"./player-page-suspsense-C3gAezeT.js";import{u as w}from"./use-player-page-pagination-params-Bet6PQb4.js";import{L as M}from"./library-page-sort-dropdown-BKrtt4l7.js";import{C as Q}from"./content-grid-CP4fsHpZ.js";import{C as T}from"./create-playlist-dialog-DRyj1u3i.js";import{b as L}from"./playlist-context-dialog-C29vsVBc.js";import{g as k}from"./playlist-link--1x9VYLm.js";import{u as q}from"./use-auth-click-capture-DFKyTs0M.js";import{A as z}from"./ad-host-CDKj9Ffh.js";import{I as R}from"./infinite-scroll-sentinel-CjTkiVp_.js";import{u as Y}from"./use-flat-infinite-query-items-Dk4It3ik.js";import{u as _}from"./useSuspenseInfiniteQuery-CYYJAO4t.js";import{P as B}from"./PlaylistAdd-D7kf7joU.js";import"./Sort-On48-68e.js";import"./genre-B_3ZyEC1.js";import"./image-selector-CCexW8Lt.js";import"./file-upload-provider-C966C2x1.js";import"./uploaded-file-Dt7HVOVK.js";import"./extension-from-filename-O0XMuZye.js";import"./pretty-bytes-bO14ePu9.js";import"./traditional-GTMgz7Xu.js";import"./use-active-upload-DElCZe_0.js";import"./open-upload-window-DxsWEG58.js";import"./AddAPhoto-BPK-B3uy.js";import"./file-input-config-DrcTpI3-.js";import"./switch-CvotT3pn.js";import"./Image-BinyWfFK.js";import"./dialog-footer-es-AfbvV.js";import"./share-media-button-DKcCMMvL.js";import"./offline-media-items-UIpHpvk8.js";import"./play-arrow-filled-J8D1BDP8.js";import"./use-player-store-_08VVZOs.js";import"./is-ctrl-or-shift-pressed-CY4knlcl.js";import"./middleware-BLXTWOs6.js";import"./Pause-Dim-ukd3.js";import"./Add-DqbkGfuM.js";import"./KeyboardArrowRight-Cz-JHdeb.js";import"./FavoriteBorder-BVoFzob6.js";import"./use-previous-CZLn_FLd.js";import"./album-image-CV6DMn1J.js";import"./Album-DPLpFLYW.js";import"./album-link-C4KAB_gW.js";import"./small-artist-image-gQ68My-z.js";import"./Mic-CaFVhbCD.js";import"./artist-link-C48CzE2I.js";import"./playlist-image-Iy94DZJb.js";import"./PlaylistPlay-CulIdmnF.js";import"./share-media-buttons-Bw-FpiIF.js";import"./Share-DoJeT0aJ.js";import"./track-image-DHipIy5D.js";import"./MusicNote-B50jw5lh.js";import"./track-link-BvulRuhc.js";import"./tabs-BwrtVGjA.js";import"./tab-panels-DDLnWdlJ.js";import"./use-clipboard-B8UhuEe-.js";import"./add-to-queue-menu-button-DVWr6Cai.js";import"./update-playlist-dialog-Cy2IHgyQ.js";import"./entitiy-offline-indicator-icon-pnyPN7v-.js";import"./check-circle-filled-nHXYTdsh.js";import"./playable-grid-item-hXbyhak8.js";import"./track-BCLqLBLk.js";import"./MoreHoriz-Bms6kOtf.js";import"./confirmation-dialog-E4zsogCz.js";import"./getScrollParent--OCc5gFh.js";import"./infiniteQueryObserver-6vEdVgAg.js";const F={"updated_at:desc":r("Recently updated"),"name:asc":r("A-Z"),"views:desc":r("Most viewed"),"plays:desc":r("Most played")},G={orderBy:"updated_at",orderDir:"desc"};function es(){return t.jsx(D,{children:t.jsx(H,{})})}function H(){const p=j(),l=q(),{trans:n}=h(),{data:c}=P(m.playlists.compactAuthUserPlaylists()),i=c.length,{searchQuery:d,setSearchQuery:u,sortDescriptor:x,setSortDescriptor:y,isDefferedLoading:f,queryParams:g}=w(G),o=_(m.playlists.userPlaylists("me",g)),a=Y(o);return t.jsxs("div",{children:[t.jsx(v,{children:t.jsx(e,{message:"Your playlists"})}),t.jsx(z,{slot:"general_top",className:"mb-34"}),t.jsxs("div",{className:"mb-20 flex items-center justify-between gap-24",children:[t.jsx("h1",{className:"whitespace-nowrap text-2xl font-semibold",children:i?t.jsx(e,{message:"[one 1 playlist|other :count playlists]",values:{count:i}}):t.jsx(e,{message:"My playlists"})}),t.jsxs(C,{type:"modal",onClose:s=>{s&&p(k(s))},children:[t.jsx(I,{className:"flex-shrink-0",onClickCapture:l,children:t.jsx(B,{})}),t.jsx(T,{})]})]}),t.jsxs("div",{className:"flex items-center justify-between gap-24",children:[t.jsx(S,{onChange:s=>u(s.target.value),className:"max-w-512 flex-auto",size:"sm",startAdornment:t.jsx(b,{}),placeholder:n(r("Search within playlists")),endAdornment:f?t.jsx(N,{size:"xs",isIndeterminate:!0}):null}),t.jsx(M,{items:F,sortDescriptor:x,setSortDescriptor:y})]}),t.jsx("div",{className:"mt-34",children:t.jsxs(Q,{children:[a.map(s=>t.jsx(L,{playlist:s},s.id)),t.jsx(R,{query:o})]})}),a.length?null:t.jsx(A,{className:"mt-34",searchQuery:d,description:t.jsx(e,{message:"You have not added any playlists to your library yet."})})]})}export{es as Component};
