import{j as s,d as c,r as i,u,az as h,cn as v,aa as p,A as g}from"./main-D6SjkSWq.js";import{A as b}from"./artist-links-B9W9tkZ1.js";import{G as C}from"./genre-link-DdPuED_F.js";import{P as T}from"./share-media-button-DKcCMMvL.js";import{u as N,W as k}from"./waveform-CtNtJAYq.js";import{S as w}from"./slider-CfGytOec.js";import{F as d}from"./formatted-duration-DCG54VKZ.js";import{u as P}from"./use-track-permissions-thcH1McM.js";import{C as z,T as F,a as L,b as S}from"./comment-bar-new-comment-form-DwRWesDV.js";import{T as W}from"./track-image-DHipIy5D.js";import{T as _}from"./track-link-BvulRuhc.js";import{t as y}from"./track-context-dialog-DFle9LFD.js";import{R as B}from"./Repeat-CGX8Q_WZ.js";function R({track:e,queue:a,className:t}){const{duration:o,...r}=N(e,a);return s.jsxs("div",{className:c("flex items-center gap-12",t),children:[s.jsx("div",{className:"min-w-40 flex-shrink-0 text-right text-xs text-muted",children:r.value?s.jsx(d,{seconds:r.value}):"0:00"}),s.jsx(w,{trackColor:"neutral",thumbSize:"w-14 h-14",showThumbOnHoverOnly:!0,className:"flex-auto",width:"w-auto",...r}),s.jsx("div",{className:"min-w-40 flex-shrink-0 text-xs text-muted",children:s.jsx(d,{seconds:o})})]})}const Y=i.memo(({track:e,queue:a,reposter:t,className:o,hideArtwork:r=!1,hideActions:l=!1,linksInNewTab:m=!1})=>{var x;const{player:n}=u(),{managesTrack:f}=P([e]),j=(n==null?void 0:n.seekbar_type)==="waveform"&&y(e);return s.jsxs("div",{className:c("overflow-hidden",!r&&"md:flex md:gap-24",o),children:[!r&&s.jsx(W,{track:e,className:"flex-shrink-0 rounded max-md:hidden",size:"w-184 h-184"}),s.jsxs("div",{className:"min-w-0 flex-auto",children:[s.jsxs("div",{className:"flex items-center gap-14",children:[s.jsx(T,{track:e,tracks:a,buttonType:"icon",color:"primary",variant:"flat",radius:"rounded-full",equalizerColor:"white"}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-6 text-sm text-muted",children:[s.jsx(b,{artists:e.artists,target:m?"_blank":void 0}),t&&s.jsxs(i.Fragment,{children:[s.jsx(B,{size:"xs"}),s.jsx(h,{user:t,target:m?"_blank":void 0})]})]}),s.jsx("div",{children:s.jsx(_,{track:e,target:m?"_blank":void 0})})]}),s.jsxs("div",{className:"ml-auto text-sm",children:[s.jsx(v,{date:e.created_at}),(x=e.genres)!=null&&x.length?s.jsx(p,{className:"mt-6 w-max",size:"xs",children:s.jsx(C,{genre:e.genres[0],target:m?"_blank":void 0})}):null]})]}),s.jsx("div",{className:"mt-20",children:j?s.jsx(z,{disableCommenting:l,children:s.jsx(A,{track:e,queue:a})}):s.jsx(R,{track:e,queue:a})}),!l&&s.jsx(F,{item:e,managesItem:f,className:"mt-20"})]})]})});function A({track:e,queue:a}){const{markerIsVisible:t}=i.useContext(L);return s.jsxs(i.Fragment,{children:[s.jsx(k,{track:e,queue:a}),s.jsx(g,{mode:"wait",children:t&&s.jsx(S,{className:"mb-8 mt-28",commentable:e})})]})}export{Y as T,A as W,R as a};
