import{d as M,D as n,aq as h,E as i,H as s,I as c,P as v,h as m,b as d,F as w,M as C,u as k,r as D,A as O,e as a,O as P,a1 as z}from"./lucide-BsOfcLnq.js";import{g as V,s as F,e as L,_ as T}from"./index-CyXUjyDM.js";import{m as y,V as x,b as S,d as p,F as X,K as $,c as Y}from"./vuetify-DHCm6MV9.js";const E={key:0},N=M({__name:"Toolbar",props:{color:{default:"transparent"},icon:{default:void 0},title:{default:void 0},menuItems:{default:void 0},enforceOverflowMenu:{type:Boolean,default:!1},isDiscoverPage:{type:Boolean},iconAction:{type:Function,default:void 0}},emits:["iconClicked","titleClicked"],setup(l,{emit:A}){const f=D(!1),b=(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,r="clientX"in o?o.clientX:0,u="clientY"in o?o.clientY:0;L.emit("contextmenu",{items:e,posX:r,posY:u})}else t.action&&(f.value=!1,t.action())},B=A;return(o,t)=>(a(),n(X,{color:l.color,class:"header"},h({title:i(()=>[m(o.$slots,"title",{},()=>[l.title||k(F).mobileLayout&&l.isDiscoverPage?(a(),d("button",{key:0,onClick:t[1]||(t[1]=e=>B("titleClicked"))},z(l.title||(l.isDiscoverPage?o.$t("discover"):"")),1)):c("",!0)],!0)]),_:2},[l.icon?{name:"prepend",fn:i(()=>[s(y,{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:i(()=>[typeof l.icon!="string"?(a(),n(v(l.icon),{key:0,class:"w-6 h-6"})):c("",!0)]),_:1},8,["icon","disabled"])]),key:"0"}:void 0,o.$slots.append?{name:"append",fn:i(()=>[m(o.$slots,"append",{},void 0,!0)]),key:"1"}:l.menuItems?.length?{name:"append",fn:i(()=>[(a(!0),d(w,null,C(l.menuItems.filter(e=>!e.hide&&!l.enforceOverflowMenu&&(k(V)("bp7")||e.overflowAllowed===!1)),e=>(a(),n(y,{key:e.label,variant:"text",style:{width:"40px"},title:o.$t(e.label,e.labelArgs||[]),disabled:e.disabled==!0,onClick:r=>b(r,e)},{default:i(()=>[s($,{"model-value":e.active==!0,color:"primary",dot:""},{default:i(()=>[typeof e.icon=="string"?(a(),n(p,{key:0,icon:e.icon,color:o.$vuetify.theme.current.dark?"#fff":"#000",size:"22px"},null,8,["icon","color"])):e.icon?(a(),n(v(e.icon),{key:1,class:"w-[22px] h-[22px]",color:o.$vuetify.theme.current.dark?"#fff":"#000"},null,8,["color"])):c("",!0)]),_:2},1032,["model-value"])]),_:2},1032,["title","disabled","onClick"]))),128)),(!k(V)("bp7")||l.enforceOverflowMenu)&&l.menuItems.filter(e=>e.hide!=!0&&e.overflowAllowed!==!1).length?(a(),d("div",E,[s(x,{modelValue:f.value,"onUpdate:modelValue":t[2]||(t[2]=e=>f.value=e),location:"bottom end",scrim:"","close-on-content-click":!1},{activator:i(({props:e})=>[s(y,O({variant:"plain",style:{width:"15px","margin-left":"-10px"}},e),{default:i(()=>[s(p,{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:i(()=>[s(S,{density:"compact",slim:"",tile:""},{default:i(()=>[(a(!0),d(w,null,C(l.menuItems.filter(e=>e.hide!=!0&&e.overflowAllowed!=!1),(e,r)=>(a(),n(Y,{key:r,title:o.$t(e.label,e.labelArgs||[]),disabled:e.disabled==!0,"append-icon":e.subItems?.length?"mdi-chevron-right":void 0,onClick:P(u=>b(u,e),["prevent","stop"])},h({_:2},[e.icon?{name:"prepend",fn:i(()=>[s($,{"model-value":e.active==!0,color:"primary",dot:""},{default:i(()=>[typeof e.icon=="string"?(a(),n(p,{key:0,icon:e.icon,color:o.$vuetify.theme.current.dark?"#fff":"#000",size:"22px"},null,8,["icon","color"])):(a(),n(v(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"])])):c("",!0)]),key:"2"}:void 0]),1032,["color"]))}}),U=T(N,[["__scopeId","data-v-0616233f"]]);export{U as T};
