import{d as p,o as s,c as l,w as t,z as f,b as a,a as T,n as i,ac as u,p as m,e as c,t as r,f as n,D as C}from"./BvNnk7SS.js";import{a as k,b,T as B}from"./CYKwSea8.js";const N=["data-state","disabled"],O={key:0,class:"sr-only"},R=p({inheritAttrs:!1,__name:"UiEditorToggle",props:{pressed:{type:Boolean,default:!1},disabled:{type:Boolean},tooltip:{},onClick:{},offset:{default:4},classRoot:{}},setup(y){return(e,o)=>(s(),l(a(B),{class:i(e.classRoot)},{default:t(()=>[f(a(k),{class:"TOOLTIP_TRIGGER"},{default:t(()=>[T("button",{"data-state":e.pressed?"on":"off",disabled:e.disabled?!0:void 0,class:i(e.$attrs.class||"TOGGLE_BUTTON"),onClick:o[0]||(o[0]=(...d)=>e.onClick&&e.onClick(...d)),onMousedown:o[1]||(o[1]=u(()=>{},["prevent"]))},[m(e.$slots,"default"),e.tooltip?(s(),c("span",O,r(e.tooltip),1)):n("",!0)],42,N)]),_:3}),e.tooltip&&!e.disabled?(s(),l(a(b),{key:0,offset:e.offset,class:"TOOLTIP_CONTENT"},{default:t(()=>[C(r(e.tooltip),1)]),_:1},8,["offset"])):n("",!0)]),_:3},8,["class"]))}});export{R as _};
