import{C as e,H as t,I as n,It as r,Q as i,T as a,a as o,at as s,bt as c,g as l,j as u,k as d,m as f,mt as p,p as m,rt as h,tt as g,w as _,x as v}from"./_plugin-vue_export-helper-BVhEvvHC.js";import{$r as y,Ci as b,Ei as x,Jr as S,Ni as C,Oi as w,Rr as T,Si as E,Sr as D,Wn as O,Yr as k,ei as A,mi as j,ni as M,ri as N}from"./src-CD6Jsigc.js";var[P,F]=x(`CheckboxGroupRoot`);function I(e){return e===`indeterminate`}function L(e){return I(e)?`indeterminate`:e?`checked`:`unchecked`}n(),c(),o();var[R,z]=x(`CheckboxRoot`),B=u({inheritAttrs:!1,__name:`CheckboxRoot`,props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},value:{type:null,required:!1,default:`on`},id:{type:String,required:!1},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(n,{emit:o}){let c=n,u=o,{forwardRef:d,currentElement:x}=M(),C=P(null),O=j(c,`modelValue`,u,{defaultValue:c.defaultValue??c.falseValue,passive:c.modelValue===void 0}),k=v(()=>C?.disabled.value||c.disabled),A=v(()=>w(O.value,c.trueValue)),F=v(()=>b(C?.modelValue.value)?O.value===`indeterminate`?`indeterminate`:A.value:E(C.modelValue.value,c.value));function R(){if(b(C?.modelValue.value))O.value===`indeterminate`?O.value=c.trueValue:O.value=A.value?c.falseValue:c.trueValue;else{let e=[...C.modelValue.value||[]];if(E(e,c.value)){let t=e.findIndex(e=>w(e,c.value));e.splice(t,1)}else e.push(c.value);C.modelValue.value=e}}let B=N(x),V=y(),H=s(),U=v(()=>{if(!H[`aria-label`])return c.id&&x.value?document.querySelector(`[for="${c.id}"]`)?.innerText:void 0});return z({disabled:k,state:F}),(n,o)=>(i(),a(l,null,[(i(),e(h(r(C)?.rovingFocus.value?r(D):r(S)),t({...n.$attrs,...r(V)},{id:n.id,ref:r(d),role:`checkbox`,"as-child":n.asChild,as:n.as,type:n.as===`button`?`button`:void 0,"aria-checked":r(I)(F.value)?`mixed`:F.value,"aria-required":n.required,"aria-label":n.$attrs[`aria-label`]||U.value,"data-state":r(L)(F.value),"data-disabled":k.value?``:void 0,disabled:k.value,focusable:r(C)?.rovingFocus.value?!k.value:void 0,onKeydown:m(f(()=>{},[`prevent`]),[`enter`]),onClick:R}),{default:p(()=>[g(n.$slots,`default`,{modelValue:r(O),state:F.value})]),_:3},16,[`id`,`as-child`,`as`,`type`,`aria-checked`,`aria-required`,`aria-label`,`data-state`,`data-disabled`,`disabled`,`focusable`,`onKeydown`])),r(B)&&n.name&&!r(C)?(i(),e(r(T),t({key:0,type:`checkbox`,checked:!!F.value,name:n.name,value:n.value,disabled:k.value,required:n.required},r(V)),null,16,[`checked`,`name`,`value`,`disabled`,`required`])):_(`v-if`,!0)],64))}});n(),c();var V=u({__name:`CheckboxIndicator`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(n){let{forwardRef:a}=M(),o=R();return(n,s)=>(i(),e(r(k),{present:n.forceMount||r(I)(r(o).state.value)||r(o).state.value===!0},{default:p(()=>[d(r(S),t({ref:r(a),"data-state":r(L)(r(o).state.value),"data-disabled":r(o).disabled.value?``:void 0,style:{pointerEvents:`none`},"as-child":n.asChild,as:n.as},n.$attrs),{default:p(()=>[g(n.$slots,`default`)]),_:3},16,[`data-state`,`data-disabled`,`as-child`,`as`])]),_:3},8,[`present`]))}});n(),c();var H=u({__name:`Checkbox`,props:{defaultValue:{},modelValue:{},disabled:{type:Boolean},value:{},id:{},trueValue:{},falseValue:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(n,{emit:a}){let o=n,s=a,c=v(()=>{let{class:e,...t}=o;return t}),l=A(c,s);return(n,a)=>(i(),e(r(B),t(r(l),{class:r(C)(`peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow-sm focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground`,o.class)}),{default:p(()=>[d(r(V),{class:`flex h-full w-full items-center justify-center text-current`},{default:p(()=>[g(n.$slots,`default`,{},()=>[d(r(O),{class:`h-4 w-4`})])]),_:3})]),_:3},16,[`class`]))}});export{H as t};