import{l as E,r as v,w as B,o as L,O as u,af as N,b as S,q as d,y as k,j as i,x as s,v as b,F as z,z as F,M as _,L as A,K as y,N as h,A as R,ah as g}from"./index-a5bb9833.js";import{_ as w,f as I}from"./ItemsListing.vue_vue_type_script_setup_true_lang-83c47556.js";import{_ as j}from"./InfoHeader.vue_vue_type_style_index_0_lang-ffdc6f99.js";import{C,L as q,a as K}from"./Container-4773c160.js";import{V as O}from"./VToolbar-b79315e8.js";import{V as U}from"./VDivider-df9414f0.js";import{V as G}from"./VMenu-240a4406.js";import{a as H}from"./VCard-04ae357c.js";import{l as J}from"./VBtn-629f5316.js";import"./ListviewItem-e2342ce8.js";import"./MediaItemThumb.vue_vue_type_style_index_0_lang-a35ce75a.js";import"./VDialog-667c0916.js";import"./VListItem-39677d21.js";import"./VSelect-4d69c543.js";/* empty css                             */import"./PanelviewItem.vue_vue_type_style_index_0_lang-d218249a.js";import"./Alert-a5ce795e.js";import"./VBadge-f7d58168.js";import"./VRow-7d86481a.js";/* empty css              */import"./layout-ff13c6fd.js";const P=A("br",null,null,-1),Q=A("br",null,null,-1),ve=E({__name:"ArtistDetails",props:{itemId:{},provider:{}},setup(V){const o=V,p=v("library"),n=v(!1),l=v(),c=async function(){const e=p.value;p.value="",l.value=await u.getArtist(o.itemId,o.provider),p.value=e};B(()=>o.itemId,e=>{e&&c()},{immediate:!0}),L(()=>{const e=u.subscribe(N.MEDIA_ITEM_ADDED,a=>{var t;const r=a.data;((t=l.value)==null?void 0:t.uri)==r.uri&&(n.value=!0)});S(e)});const D=async function(e,a,r,t,m=!0){const f=await u.getArtistAlbums(o.itemId,o.provider);return I(f,e,a,r,t,m)},T=async function(e,a,r,t,m=!0){const f=await u.getArtistTracks(o.itemId,o.provider);return I(f,e,a,r,t,m)},$=function(e){window.open(e,"_blank")};return(e,a)=>(d(),k("section",null,[i(j,{item:l.value,"active-provider":e.provider},null,8,["item","active-provider"]),i(C,null,{default:s(()=>[i(w,{itemtype:"artisttracks","parent-item":l.value,"show-provider":!1,"show-favorites-only-filter":!1,"show-track-number":!1,"load-data":T,"sort-keys":["timestamp_added DESC","sort_name","sort_album"],"update-available":n.value,onRefreshClicked:a[0]||(a[0]=r=>{c(),n.value=!1}),title:e.$t("tracks"),checksum:e.provider+e.itemId},null,8,["parent-item","update-available","title","checksum"]),P,i(w,{itemtype:"artistalbums","parent-item":l.value,"show-provider":!1,"show-favorites-only-filter":!1,"load-data":D,"sort-keys":["timestamp_added DESC","sort_name","year"],"update-available":n.value,onRefreshClicked:a[1]||(a[1]=r=>{c(),n.value=!1}),title:e.$t("albums"),checksum:e.provider+e.itemId},null,8,["parent-item","update-available","title","checksum"]),Q,e.provider=="library"?(d(),b(H,{key:0,style:{"margin-bottom":"10px"}},{default:s(()=>[i(O,{color:"transparent",title:e.$t("mapped_providers"),style:{height:"55px"}},null,8,["title"]),i(U),i(C,null,{default:s(()=>[i(G,null,{default:s(()=>{var r;return[(d(!0),k(z,null,F((r=l.value)==null?void 0:r.provider_mappings,t=>(d(),b(q,{key:t.provider_instance,onClick:m=>e.$router.push({name:"artist",params:{itemId:t.item_id,provider:t.provider_instance}})},{prepend:s(()=>[i(K,{domain:t.provider_domain,size:30},null,8,["domain"])]),title:s(()=>[y(h(R(u).providerManifests[t.provider_domain].name),1)]),subtitle:s(()=>[y(h(t.item_id),1)]),append:s(()=>[t.url?(d(),b(J,{key:0,variant:"plain",icon:"mdi-open-in-new",onClick:g(m=>$(t.url),["prevent"])},null,8,["onClick"])):_("",!0)]),_:2},1032,["onClick"]))),128))]}),_:1})]),_:1})]),_:1})):_("",!0)]),_:1})]))}});export{ve as default};
