import{d as D,G as n,ar as h,H as i,J as s,K as c,_ as v,h as m,c as d,O as w,u as k,F as C,Q as M,D as O,r as z,a4 as L,b as a}from"./lucide-OrjrigGq.js";import{q as V,s as P,f as T,_ as x}from"./index-STpfFCKU.js";import{E as F,m as y,d as b,J as $,b as S,c as X,V as Y}from"./vuetify-Cc3ogKHH.js";const E={key:0},J=D({__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=z(!1),p=(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;T.emit("contextmenu",{items:e,posX:r,posY:u})}else t.action&&(f.value=!1,t.action())},B=A;return(o,t)=>(a(),n(F,{color:l.color,class:"header"},h({title:i(()=>[m(o.$slots,"title",{},()=>[l.title||k(P).mobileLayout&&l.isDiscoverPage?(a(),d("button",{key:0,onClick:t[1]||(t[1]=e=>B("titleClicked"))},L(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||l.menuItems?.length?{name:"append",fn:i(()=>[m(o.$slots,"append",{},void 0,!0),(a(!0),d(C,null,w(l.menuItems?.filter(e=>!e.hide&&!l.enforceOverflowMenu&&(k(V)("bp8")||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=>p(r,e)},{default:i(()=>[s($,{"model-value":e.active==!0,color:"primary",dot:""},{default:i(()=>[typeof e.icon=="string"?(a(),n(b,{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)("bp8")||l.enforceOverflowMenu)&&l.menuItems?.filter(e=>e.hide!=!0&&e.overflowAllowed!==!1).length?(a(),d("div",E,[s(Y,{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(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:i(()=>[s(S,{density:"compact",slim:"",tile:""},{default:i(()=>[(a(!0),d(C,null,w(l.menuItems?.filter(e=>e.hide!=!0&&e.overflowAllowed!=!1),(e,r)=>(a(),n(X,{key:r,title:o.$t(e.label,e.labelArgs||[]),disabled:e.disabled==!0,"append-icon":e.subItems?.length?"mdi-chevron-right":void 0,onClick:M(u=>p(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(b,{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:"1"}:void 0]),1032,["color"]))}}),H=x(J,[["__scopeId","data-v-42cfb676"]]);export{H as T};
