import"./rolldown-runtime-DIIn1E2Q.js";import{Z as e}from"./vendor-primevue-BDZ_jj__.js";import{Bt as t,D as n,F as r,G as i,I as a,K as o,R as s,Rt as c,Ut as l,_t as u,et as d,j as f,k as p,ut as m}from"./vendor-vue-core-DO0afONr.js";import"./vendor-other-CiPV8GBG.js";import{n as h}from"./vendor-i18n-JbyM4Qz7.js";import"./vendor-reka-ui-B53kLmAc.js";import{t as g}from"./src-NuWuoO1R.js";import{r as _}from"./widgetTypes-B3taJqHN.js";import{n as v,t as y}from"./toggle-group-uNHCQYph.js";import{a as b,o as x}from"./widgetPropFilter-dgyMmag8.js";import{t as S}from"./WidgetLayoutField-CveVXp_O.js";import{t as C}from"./layout-CvM4cIQs.js";var w=s({__name:`WidgetToggleSwitch`,props:i({widget:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:[`update:modelValue`],setup(i){let s=m(i,`modelValue`),w=_(),{t:T}=h(),E=n(()=>x(i.widget.options,b)),D=n(()=>i.widget.options?.on!=null||i.widget.options?.off!=null);function handleOptionChange(e){e&&(s.value=e===`on`)}return(n,i)=>(d(),p(S,{widget:n.widget,"no-border":!D.value},{default:u(({borderStyle:m})=>[D.value?(d(),p(c(v),{key:0,type:`single`,"model-value":s.value?`on`:`off`,disabled:!!n.widget.options?.read_only,class:t(c(g)(c(C),`flex w-full min-w-0 items-center justify-center gap-1 p-1`)),"onUpdate:modelValue":i[0]||=e=>handleOptionChange(e)},{default:u(()=>[a(c(y),{value:`off`,size:`sm`},{default:u(()=>[r(l(n.widget.options?.off??c(T)(`widgets.boolean.false`)),1)]),_:1}),a(c(y),{value:`on`,size:`sm`},{default:u(()=>[r(l(n.widget.options?.on??c(T)(`widgets.boolean.true`)),1)]),_:1})]),_:1},8,[`model-value`,`disabled`,`class`])):(d(),f(`div`,{key:1,class:t(c(g)(`-m-1 flex w-fit items-center gap-2 rounded-full p-1`,c(w)||`ml-auto`,m))},[a(c(e),o({modelValue:s.value,"onUpdate:modelValue":i[1]||=e=>s.value=e},E.value,{"aria-label":n.widget.name}),null,16,[`modelValue`,`aria-label`])],2))]),_:1},8,[`widget`,`no-border`]))}});export{w as default};
//# sourceMappingURL=WidgetToggleSwitch-eJ0mLUMH.js.map