import{d as T,r as x,D as n,e as i,ak as h,E as a,H as s,I as r,P as y,h as w,b as f,u as c,F as C,M as V,A as z,O as D,f as $,a1 as P}from"./lucide-C2DU1LFb.js";import{c as k,h as A,s as F,b as N,e as S,_ as X}from"./index-CxiRlsCY.js";import{n as p,l as B,V as Y,b as E,d as b,B as G,G as M,c as H}from"./vuetify-RelkxOq-.js";const U={key:0,class:"mobile-brand"},j={key:1},q=T({__name:"Toolbar",props:{color:{default:"transparent"},icon:{default:void 0},title:{default:void 0},menuItems:{default:void 0},enforceOverflowMenu:{type:Boolean,default:!1},showLoading:{type:Boolean,default:void 0},home:{type:Boolean},iconAction:{type:Function,default:void 0}},emits:["iconClicked","titleClicked"],setup(l,{emit:L}){const u=x(!1),m=(o,t)=>{if(o.preventDefault(),t.subItems?.length){const e=t.closeOnContentClick===!1?t.subItems.map(g=>({...g,close_on_click:g.close_on_click??!1})):t.subItems,d="clientX"in o?o.clientX:0,v="clientY"in o?o.clientY:0;S.emit("contextmenu",{items:e,posX:d,posY:v})}else t.action&&(u.value=!1,t.action())},O=L;return(o,t)=>(i(),n(G,{color:l.color,class:"header"},h({title:a(()=>[w(o.$slots,"title",{},()=>[c(F).mobileLayout&&l.home?(i(),f("div",U,[...t[3]||(t[3]=[$("img",{src:N,alt:"Music Assistant",class:"mobile-brand-logo"},null,-1),$("span",{class:"mobile-brand-text"},"Music Assistant",-1)])])):l.title?(i(),f("button",{key:1,onClick:t[1]||(t[1]=e=>O("titleClicked"))},P(l.title),1)):r("",!0)],!0)]),_:2},[l.icon?{name:"prepend",fn:a(()=>[s(p,{icon:typeof l.icon=="string"?l.icon:void 0,size:"small",disabled:l.iconAction==null,style:{opacity:"0.8"},onClick:t[0]||(t[0]=e=>l.iconAction?.())},{default:a(()=>[typeof l.icon!="string"?(i(),n(y(l.icon),{key:0,class:"w-6 h-6"})):r("",!0)]),_:1},8,["icon","disabled"])]),key:"0"}:void 0,o.$slots.append?{name:"append",fn:a(()=>[w(o.$slots,"append",{},void 0,!0)]),key:"1"}:l.menuItems?.length?{name:"append",fn:a(()=>[l.showLoading&&c(k).syncTasks.value.length>0?(i(),n(B,{key:0,color:"primary",indeterminate:"",title:o.$t("tooltip.loading")},null,8,["title"])):r("",!0),(i(!0),f(C,null,V(l.menuItems.filter(e=>!e.hide&&!l.enforceOverflowMenu&&(c(A)("bp7")||e.overflowAllowed===!1)),e=>(i(),n(p,{key:e.label,variant:"text",style:{width:"40px"},title:o.$t(e.label,e.labelArgs||[]),disabled:e.disabled==!0,onClick:d=>m(d,e)},{default:a(()=>[s(M,{"model-value":e.active==!0,color:"primary",dot:""},{default:a(()=>[typeof e.icon=="string"?(i(),n(b,{key:0,icon:e.icon,color:o.$vuetify.theme.current.dark?"#fff":"#000",size:"22px"},null,8,["icon","color"])):e.icon?(i(),n(y(e.icon),{key:1,class:"w-[22px] h-[22px]",color:o.$vuetify.theme.current.dark?"#fff":"#000"},null,8,["color"])):r("",!0)]),_:2},1032,["model-value"])]),_:2},1032,["title","disabled","onClick"]))),128)),(!c(A)("bp7")||l.enforceOverflowMenu)&&l.menuItems.filter(e=>e.hide!=!0&&e.overflowAllowed!==!1).length?(i(),f("div",j,[s(Y,{modelValue:u.value,"onUpdate:modelValue":t[2]||(t[2]=e=>u.value=e),location:"bottom end",scrim:"","close-on-content-click":!1},{activator:a(({props:e})=>[s(p,z({variant:"plain",style:{width:"15px","margin-left":"-10px"}},e),{default:a(()=>[s(b,{icon:"mdi-dots-vertical",color:o.$vuetify.theme.current.dark?"#fff":"#000",size:"22",style:{"margin-right":"-5px",width:"15px"}},null,8,["color"])]),_:1},16)]),default:a(()=>[s(E,{density:"compact",slim:"",tile:""},{default:a(()=>[(i(!0),f(C,null,V(l.menuItems.filter(e=>e.hide!=!0&&e.overflowAllowed!=!1),(e,d)=>(i(),n(H,{key:d,title:o.$t(e.label,e.labelArgs||[]),disabled:e.disabled==!0,"append-icon":e.subItems?.length?"mdi-chevron-right":void 0,onClick:D(v=>m(v,e),["prevent","stop"])},h({_:2},[e.icon?{name:"prepend",fn:a(()=>[s(M,{"model-value":e.active==!0,color:"primary",dot:""},{default:a(()=>[typeof e.icon=="string"?(i(),n(b,{key:0,icon:e.icon,color:o.$vuetify.theme.current.dark?"#fff":"#000",size:"22px"},null,8,["icon","color"])):(i(),n(y(e.icon),{key:1,class:"w-[22px] h-[22px]",color:o.$vuetify.theme.current.dark?"#fff":"#000"},null,8,["color"]))]),_:2},1032,["model-value"])]),key:"0"}:void 0]),1032,["title","disabled","append-icon","onClick"]))),128))]),_:1})]),_:1},8,["modelValue"])])):r("",!0)]),key:"2"}:l.showLoading?{name:"append",fn:a(()=>[c(k).fetchesInProgress.value.length>0||c(k).syncTasks.value.length>0?(i(),n(B,{key:0,color:"primary",indeterminate:""})):r("",!0)]),key:"3"}:void 0]),1032,["color"]))}}),R=X(q,[["__scopeId","data-v-facc66f4"]]);export{R as T};
