import{C as y}from"./Container-DdZvDMit.js";import{x as c,r as p,au as g,av as w,o as f,I as e,ah as h,b as k,D as n,z as s,F as C,E as I,y as _,J as A,H as a,l as r,A as m,aw as P,B as L}from"./index-DKhfhZyI.js";import{H as x}from"./HomeWidgetRow-lfn85Zga.js";import{T as B}from"./Toolbar-DfTAf723.js";import{C as E}from"./VListItem-DG7fZYqG.js";import{_ as H}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./VContainer-bkYdVay1.js";/* empty css              */import"./PanelviewItemCompact-BXu7orP5.js";import"./ItemContextMenu.vue_vue_type_style_index_0_scoped_cee6bfa4_lang-BEm2OpTr.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-C_Zsg23g.js";import"./VMenu-BTA9m0lg.js";import"./VCard-AQsAsy9j.js";import"./VCardText-PK-MK26S.js";import"./VList-BsIdJYb-.js";import"./VChip-Bt-2eXUN.js";import"./eventbus-CGRXT3Tn.js";import"./VCheckbox-w4Dp7feX.js";import"./VCheckboxBtn-SjULh2vZ.js";import"./VToolbar-Be3D-k7i.js";import"./VAlert-EFQTLSCo.js";const T=c({__name:"HomeWidgetRows",async setup(v){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 u=e.subscribe(h.MEDIA_ITEM_PLAYED,async b=>{t.value.recently_played.items=await e.getRecentlyPlayedItems(10),t.value.in_progress_items.items=await e.getInProgressItems(10)});k(u)}),(u,b)=>(s(!0),n(C,null,I(t.value,l=>(s(),n("div",{key:l.label},[l.items.length?(s(),_(x,{key:0,"widget-row":l},null,8,["widget-row"])):A("",!0)]))),128))}}),V=c({__name:"HomeView",setup(v){const i=p(localStorage.getItem("frontend.settings.hide_settings")=="true");return(o,t)=>(s(),n("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:m(()=>[(s(),_(P,null,{fallback:m(()=>[r(E,{indeterminate:""})]),default:m(()=>[L("div",null,[r(T)])]),_:1}))]),_:1})]))}}),et=H(V,[["__scopeId","data-v-823be14f"]]);export{et as default};
