import{C as y}from"./Container-C-MxRHLg.js";import{Q as u,x as p,b7 as g,b8 as w,o as f,a4 as e,aS as h,b as k,Z as m,S as s,G as C,$ as I,R as _,a9 as A,a2 as a,B as r,U as n,b9 as P,W as L}from"./index-orrnp8a1.js";import{H as x}from"./HomeWidgetRow-ChtBFClq.js";import{T as B}from"./Toolbar-CE2HDv9i.js";import{f as R}from"./VBtn-BJolvyKt.js";import{_ as T}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./VContainer-DvR1uhzJ.js";/* empty css              */import"./PanelviewItemCompact-Bf1Qb2IB.js";import"./MediaItemThumb-BFLLxiOJ.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-DgYavPcK.js";import"./VChip-DzIcRFdM.js";import"./VCheckbox-BaanYS4J.js";import"./VCheckboxBtn-CICj8ZxL.js";import"./VToolbar-BlKUHnwt.js";import"./VAlert-BhQ3L7Kc.js";const V=u({__name:"HomeWidgetRows",async setup(b){let i,o;const t=p({in_progress_items:{label:"in_progress_items",icon:"mdi-motion-play",items:[]},recently_played:{label:"recently_played",icon:"mdi-motion-play",items:[]},artists:{label:"artists",icon:"mdi-account-music",path:"/artists",items:[]},albums:{label:"albums",icon:"mdi-album",path:"/albums",items:[]},playlists:{label:"playlists",icon:"mdi-playlist-music",path:"/playlists",items:[]},tracks:{label:"tracks",icon:"mdi-file-music",path:"/tracks",items:[]},radios:{label:"radios",icon:"mdi-radio",path:"/radios",items:[]},browse:{label:"browse",icon:"mdi-folder",path:"/browse",items:[]}}),d=async function(){t.value.recently_played.items=await e.getRecentlyPlayedItems(10),t.value.in_progress_items.items=await e.getInProgressItems(10),t.value.artists.items=await e.getLibraryArtists(void 0,void 0,20,void 0,"random"),t.value.artists.count=a.libraryArtistsCount,t.value.albums.items=await e.getLibraryAlbums(void 0,void 0,20,void 0,"timestamp_added_desc"),t.value.albums.count=a.libraryAlbumsCount,t.value.playlists.items=await e.getLibraryPlaylists(void 0,void 0,20,void 0,"timestamp_added_desc"),t.value.playlists.count=a.libraryPlaylistsCount,t.value.radios.items=await e.getLibraryRadios(void 0,void 0,20,void 0,"timestamp_added_desc"),t.value.radios.count=a.libraryRadiosCount,t.value.tracks.items=await e.getLibraryTracks(void 0,void 0,20,void 0,"timestamp_added_desc"),t.value.tracks.count=a.libraryTracksCount,t.value.browse.items=await e.browse()};return[i,o]=g(()=>d()),await i,o(),w(()=>{d()}),f(()=>{const c=e.subscribe(h.MEDIA_ITEM_PLAYED,async v=>{t.value.recently_played.items=await e.getRecentlyPlayedItems(10),t.value.in_progress_items.items=await e.getInProgressItems(10)});k(c)}),(c,v)=>(s(!0),m(C,null,I(t.value,l=>(s(),m("div",{key:l.label},[l.items.length?(s(),_(x,{key:0,"widget-row":l},null,8,["widget-row"])):A("",!0)]))),128))}}),E=u({__name:"HomeView",setup(b){const i=p(localStorage.getItem("frontend.settings.hide_settings")=="true");return(o,t)=>(s(),m("div",null,[r(B,{title:"Music Assistant","show-loading":!0,"menu-items":i.value?[]:[{label:"settings.settings",icon:"mdi-cog-outline",action:()=>{o.$router.push({path:"settings"})}}]},null,8,["menu-items"]),r(y,{variant:"panel"},{default:n(()=>[(s(),_(P,null,{fallback:n(()=>[r(R,{indeterminate:""})]),default:n(()=>[L("div",null,[r(V)])]),_:1}))]),_:1})]))}}),J=T(E,[["__scopeId","data-v-823be14f"]]);export{J as default};
