import{d as f,o,c as i,w as a,z as u,b as l,a as t,n as r,e as T,t as n,f as d,ac as b,D as m}from"./BvNnk7SS.js";import{a as c,b as C,T as k}from"./CYKwSea8.js";import"./BOtdTvFK.js";const B=["for"],w=["data-state","disabled"],y=f({__name:"UiEditorSwitch",props:{pressed:{type:Boolean},disabled:{type:Boolean},tooltip:{},label:{},onClick:{},classes:{},offset:{default:4}},setup(E){return(e,s)=>(o(),i(l(k),null,{default:a(()=>[u(l(c),{class:"TOOLTIP_TRIGGER"},{default:a(()=>[t("div",{class:r(["group flex items-center gap0.5",e.classes])},[e.label?(o(),T("label",{key:0,for:e.label,class:"LABEL"},n(e.label),9,B)):d("",!0),t("button",{role:"switch","data-state":e.pressed?"on":"off",disabled:e.disabled?!0:void 0,class:r(["TOGGLE_SWITCH",e.classes]),onClick:s[0]||(s[0]=(...p)=>e.onClick&&e.onClick(...p)),onMousedown:s[1]||(s[1]=b(()=>{},["prevent"]))},[t("span",{class:r(e.pressed&&"translate-x-full")},null,2)],42,w)],2)]),_:1}),e.tooltip&&!e.disabled?(o(),i(l(C),{key:0,offset:e.offset,class:"TOOLTIP_CONTENT"},{default:a(()=>[m(n(e.tooltip),1)]),_:1},8,["offset"])):d("",!0)]),_:1}))}});export{y as default};
