import{r as a,q as R,_ as w,l as _,v,s as j,o as h}from"./FontSizeProvider-Cy0K7gvl.js";import{v as q}from"./trash-2-Dx96Ty-c.js";var A=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],H=a.forwardRef(function(e,m){var s=e.prefixCls,n=s===void 0?"rc-checkbox":s,k=e.className,b=e.style,g=e.checked,r=e.disabled,i=e.defaultChecked,C=i===void 0?!1:i,u=e.type,d=u===void 0?"checkbox":u,y=e.title,o=e.onChange,x=R(e,A),c=a.useRef(null),E=q(C,{value:g}),f=w(E,2),p=f[0],N=f[1];a.useImperativeHandle(m,function(){return{focus:function(t){var l;(l=c.current)===null||l===void 0||l.focus(t)},blur:function(){var t;(t=c.current)===null||t===void 0||t.blur()},input:c.current}});var D=_(n,k,v(v({},"".concat(n,"-checked"),p),"".concat(n,"-disabled"),r)),P=function(t){r||("checked"in e||N(t.target.checked),o==null||o({target:h(h({},e),{},{type:d,checked:t.target.checked}),stopPropagation:function(){t.stopPropagation()},preventDefault:function(){t.preventDefault()},nativeEvent:t.nativeEvent}))};return a.createElement("span",{className:D,title:y,style:b},a.createElement("input",j({},x,{className:"".concat(n,"-input"),ref:c,onChange:P,disabled:r,checked:!!p,type:d})),a.createElement("span",{className:"".concat(n,"-inner")}))});export{H as C};
