import{I as d}from"./ItemsListing-CVwEjiOr.js";import{I as y}from"./InfoHeader-BVLnVgWk.js";import{f as s,E as b}from"./index-BTUEMLf5.js";import{_ as k}from"./ProviderDetails.vue_vue_type_style_index_0_lang-CVMsU16L.js";import{d as w,w as h,o as I,r as T,a0 as g,b as D,H as E,D as n,I as p,f as u,u as B,e as l}from"./lucide-_oCiFqes.js";import"./Container-DwB3rN_Z.js";import"./index-kQIztB-E.js";import"./vuetify-BaCqMXPP.js";import"./Toolbar-CaFrSIBc.js";import"./userPreferences-XD50db6K.js";import"./vue-router-DvALZv_2.js";import"./Button-GSo8rtij.js";import"./ListItem-MmQyHMan.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-TaIM0H3y.js";import"./MediaItemThumb-BaHIgYra.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-DjFjyMgl.js";import"./vue-i18n-Dtd59yt5.js";import"./PanelviewItemCompact-CLqGya98.js";import"./marquee_text_sync-C0q0U3mh.js";import"./index-CpZ4YSWB.js";import"./reka-ui-BT9Jz-E-.js";import"./vueuse-CtSQZy69.js";import"./index-MfQlFusE.js";import"./DialogTitle.vue_vue_type_script_setup_true_lang-DOHf3CAT.js";import"./DialogFooter.vue_vue_type_script_setup_true_lang-CmePkLod.js";import"./qrcode-fG4AAl2w.js";import"./marked-i_gIkIP3.js";import"./color-BTziYnFN.js";/* empty css            */import"./swiper-B7iBjdLa.js";const ie=w({__name:"TrackDetails",props:{itemId:{},provider:{},album:{}},setup(a){const t=a,e=T(),v=async function(){e.value=await s.getTrack(t.itemId,t.provider,t.album)};h(()=>t.itemId,r=>{r&&v()},{immediate:!0}),I(()=>{const r=s.subscribe(b.MEDIA_ITEM_UPDATED,i=>{const o=i.data;if(e.value?.uri==o.uri)e.value=o;else if("provider_mappings"in o){for(const m of o.provider_mappings)if(m.item_id==t.itemId&&[m.provider_instance,m.provider_domain].includes(t.provider)){e.value=o;break}}});g(r)});const f=async function(r){return await s.getTrackVersions(e.value.item_id,e.value.provider)},c=async function(r){return await s.getTrackAlbums(t.itemId,t.provider,r.libraryOnly)};return(r,i)=>(l(),D("section",null,[E(y,{item:e.value,"active-provider":a.provider},null,8,["item","active-provider"]),e.value?(l(),n(d,{key:0,itemtype:"trackalbums","parent-item":e.value,"show-provider":!0,"show-favorites-only-filter":!1,"show-library-only-filter":e.value.provider=="library"&&B(s).hasStreamingProviders.value,"show-track-number":!1,"show-refresh-button":!1,"load-items":c,"sort-keys":["name","sort_name","year","year_desc"],title:r.$t("appears_on"),path:a.provider+a.itemId,"allow-collapse":!0},null,8,["parent-item","show-library-only-filter","title","path"])):p("",!0),i[0]||(i[0]=u("br",null,null,-1)),e.value?(l(),n(d,{key:1,itemtype:"trackversions","parent-item":e.value,"show-provider":!0,"show-favorites-only-filter":!1,"show-track-number":!1,"load-items":f,"sort-keys":["name","sort_name","duration"],title:r.$t("other_versions"),"hide-on-empty":!0,path:a.provider+a.itemId,"allow-collapse":!0,"show-refresh-button":!1,"refresh-on-parent-update":!0},null,8,["parent-item","title","path"])):p("",!0),i[1]||(i[1]=u("br",null,null,-1)),e.value?(l(),n(k,{key:2,"item-details":e.value},null,8,["item-details"])):p("",!0),i[2]||(i[2]=u("br",null,null,-1))]))}});export{ie as default};
