import{o as $,d as w,m,k as D,a as k}from"./@babel-BJZJ6yB5.js";import{c as M}from"./classnames-3ZYesfuy.js";import{n as j}from"./rc-util-uI9ZRjCe.js";import{a}from"./react-CXoDaX02.js";var V=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],W=a.forwardRef(function(e,g){var s=e.prefixCls,n=s===void 0?"rc-checkbox":s,C=e.className,b=e.style,_=e.checked,l=e.disabled,u=e.defaultChecked,y=u===void 0?!1:u,d=e.type,o=d===void 0?"checkbox":d,x=e.title,i=e.onChange,R=$(e,V),c=a.useRef(null),f=a.useRef(null),E=j(y,{value:_}),h=w(E,2),v=h[0],N=h[1];a.useImperativeHandle(g,function(){return{focus:function(t){var r;(r=c.current)===null||r===void 0||r.focus(t)},blur:function(){var t;(t=c.current)===null||t===void 0||t.blur()},input:c.current,nativeElement:f.current}});var P=M(n,C,m(m({},"".concat(n,"-checked"),v),"".concat(n,"-disabled"),l)),S=function(t){l||("checked"in e||N(t.target.checked),i?.({target:k(k({},e),{},{type:o,checked:t.target.checked}),stopPropagation:function(){t.stopPropagation()},preventDefault:function(){t.preventDefault()},nativeEvent:t.nativeEvent}))};return a.createElement("span",{className:P,title:x,style:b,ref:f},a.createElement("input",D({},R,{className:"".concat(n,"-input"),ref:c,onChange:S,disabled:l,checked:!!v,type:o})),a.createElement("span",{className:"".concat(n,"-inner")}))});export{W as C};
