import{d as M,r as S,z as $,ay as f,a1 as A,a2 as T,c as i,e as s,w as t,f as a,j as l,u as r,M as D,g as k,i as w,t as o,az as z,H as m,_ as F,ak as H,O as L,E as N,ad as V}from"./index-2dd0c7d2.js";import{M as P,c as E,b as O}from"./helpers-4d7c5bf6.js";import{B as R}from"./Button-69b906cf.js";import{a as G,b as j,c as d,V as q,_ as W}from"./VTooltip-e62b61bd.js";import{a as J}from"./VMenu-97c1c955.js";import{V as K,G as Q,H as c,q as v}from"./VListItem-cb387084.js";import{b as U,V as X}from"./VCard-907b4685.js";import{V as Y}from"./VSpacer-e11897c6.js";import{_ as Z}from"./_plugin-vue_export-helper-c27b6911.js";const x={key:0},ee={key:1},te={key:2},ie=["src"],ae=M({__name:"PanelviewItem",props:{item:{},size:{default:200},isSelected:{type:Boolean},showCheckboxes:{type:Boolean,default:!1},showMediaType:{type:Boolean,default:!1},showActions:{type:Boolean,default:!1}},emits:["menu","click","select"],setup(g,{emit:C}){const u=g,h=S(!1),b=$(()=>{for(const e of u.item.provider_mappings)if(e.audio_format&&e.audio_format.content_type!=null&&[f.DSF,f.FLAC,f.AIFF,f.WAV].includes(e.audio_format.content_type)&&(e.audio_format.sample_rate>48e3||e.audio_format.bit_depth>16))return`${e.audio_format.sample_rate/1e3}kHz ${e.audio_format.bit_depth} bits`;return""}),y=C,_=function(e){u.showCheckboxes||y("menu",e,u.item)},B=function(e){u.showCheckboxes||y("click",e,u.item)};return(e,n)=>{const I=A("hold");return T((i(),s(X,{tile:"",hover:"",class:"panel-item",disabled:!r(O)(e.item),onClick:B,onContextmenu:V(_,["right","prevent"]),onMouseover:n[2]||(n[2]=p=>h.value=!0),onMouseleave:n[3]||(n[3]=p=>h.value=!0)},{default:t(()=>[e.showCheckboxes?(i(),s(J,{key:0,"model-value":e.showCheckboxes,contained:"",scrim:e.isSelected?e.$vuetify.theme.current.dark?"rgba(0,0,0,.75)":"rgba(255,255,255,.75)":"#ffffff00",onClick:n[0]||(n[0]=p=>{y("select",e.item,!e.isSelected)})},{default:t(()=>[a(G,{class:"panel-item-checkbox",ripple:!1,"model-value":e.isSelected},null,8,["model-value"])]),_:1},8,["model-value","scrim"])):l("",!0),a(P,{item:e.item,width:"100%"},null,8,["item"]),a(K,{variant:"text",slim:"",tile:"",density:"compact",class:"panel-item-details"},{default:t(()=>[a(Q,null,{default:t(()=>[e.item.media_type==r(D).FOLDER?(i(),k("span",x,[w("span",null,o(r(z)(e.item,e.$t)),1)])):(i(),k("span",ee,o(e.item.name),1)),"version"in e.item&&e.item.version?(i(),k("span",te," - "+o(e.item.version),1)):l("",!0)]),_:1}),"artists"in e.item&&e.item.artists?(i(),s(c,{key:0,class:"line-clamp-1"},{default:t(()=>[m(o(r(F)(e.item.artists,1)),1)]),_:1})):"owner"in e.item&&e.item.owner?(i(),s(c,{key:1,class:"line-clamp-1"},{default:t(()=>[m(o(e.item.owner),1)]),_:1})):e.showMediaType?(i(),s(c,{key:2,class:"line-clamp-1"},{default:t(()=>[m(o(e.$t(e.item.media_type)),1)]),_:1})):(i(),s(c,{key:3,class:"line-clamp-1"}))]),_:1}),e.showActions?(i(),s(U,{key:1,class:"panel-item-actions"},{default:t(()=>[a(j,{style:{padding:"0",margin:"-8px"}},{default:t(()=>[r(H)(e.item.metadata.explicit||!1)?(i(),s(d,{key:0},{default:t(()=>[a(v,{size:"30",icon:"mdi-alpha-e-box"})]),_:1})):l("",!0),b.value?(i(),s(d,{key:1},{default:t(()=>[a(v,{class:L(e.$vuetify.theme.current.dark?"hiresicon":"hiresiconinverted")},{default:t(()=>[w("img",{src:r(E),width:"30"},null,8,ie),a(q,{activator:"parent",location:"bottom"},{default:t(()=>[m(o(b.value),1)]),_:1})]),_:1},8,["class"])]),_:1})):l("",!0),"disc_number"in e.item&&e.item.disc_number?(i(),s(d,{key:2},{default:t(()=>[a(v,{icon:"md:album",style:{"margin-left":"5px"}}),m(" "+o(e.item.disc_number),1)]),_:1})):l("",!0),"track_number"in e.item&&e.item.track_number?(i(),s(d,{key:3},{default:t(()=>[a(v,{icon:"mdi-music-circle-outline",style:{"margin-left":"10px"}}),m(" "+o(e.item.track_number),1)]),_:1})):l("",!0),r(N)("bp3")?(i(),s(d,{key:4},{default:t(()=>[a(W,{item:e.item},null,8,["item"])]),_:1})):l("",!0)]),_:1}),a(Y),a(R,{variant:"list",icon:"mdi-dots-vertical",style:{"padding-right":"0","margin-right":"-5px"},onClick:n[1]||(n[1]=V(p=>e.$emit("menu",p,e.item),["stop"]))})]),_:1})):l("",!0)]),_:1},8,["disabled"])),[[I,_]])}}});const fe=Z(ae,[["__scopeId","data-v-875ba477"]]);export{fe as P};
