import{c as f,d as k,ag as P,w as p,a2 as b,aa as V,a as g,n as h,ah as G,ai as _,t as O,aj as S,e as $,ak as y,h as E,k as x}from"./index-7945cc5d.js";import{c as w,s as A}from"./Checker-cfdc8b8e.js";const[v,B]=f("checkbox-group"),K={max:h,disabled:Boolean,iconSize:h,direction:String,modelValue:G(),checkedColor:String},C=Symbol(v);var N=k({name:v,props:K,emits:["change","update:modelValue"],setup(a,{emit:d,slots:s}){const{children:c,linkChildren:i}=P(C),o=e=>d("update:modelValue",e),u=(e={})=>{typeof e=="boolean"&&(e={checked:e});const{checked:t,skipDisabled:r}=e,l=c.filter(n=>n.props.bindGroup?n.props.disabled&&r?n.checked.value:t!=null?t:!n.checked.value:!1).map(n=>n.name);o(l)};return p(()=>a.modelValue,e=>d("change",e)),b({toggleAll:u}),V(()=>a.modelValue),i({props:a,updateValue:o}),()=>{var e;return g("div",{class:B([a.direction])},[(e=s.default)==null?void 0:e.call(s)])}}});const[j,z]=f("checkbox"),D=_({},w,{bindGroup:O});var F=k({name:j,props:D,emits:["change","update:modelValue"],setup(a,{emit:d,slots:s}){const{parent:c}=S(C),i=e=>{const{name:t}=a,{max:r,modelValue:m}=c.props,l=m.slice();if(e)!(r&&l.length>=+r)&&!l.includes(t)&&(l.push(t),a.bindGroup&&c.updateValue(l));else{const n=l.indexOf(t);n!==-1&&(l.splice(n,1),a.bindGroup&&c.updateValue(l))}},o=$(()=>c&&a.bindGroup?c.props.modelValue.indexOf(a.name)!==-1:!!a.modelValue),u=(e=!o.value)=>{c&&a.bindGroup?i(e):d("update:modelValue",e)};return p(()=>a.modelValue,e=>d("change",e)),b({toggle:u,props:a,checked:o}),V(()=>a.modelValue),()=>g(A,E({bem:z,role:"checkbox",parent:c,checked:o.value,onToggle:u},a),y(s,["default","icon"]))}});const R=x(F),T=x(N);export{T as C,R as a};
