import{p as G,q as K,b as W,_ as Z,G as $,au as A,v as i,j as C,w as D,K as H,x as J,y as F,a4 as Q,Z as T}from"./index-B539dxxT.js";function V(e){return G("PrivateSwitchBase",e)}K("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const X=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],Y=e=>{const{classes:o,checked:d,disabled:l,edge:a}=e,r={root:["root",d&&"checked",l&&"disabled",a&&`edge${H(a)}`],input:["input"]};return J(r,V,o)},ee=F(Q,{name:"MuiSwitchBase"})(({ownerState:e})=>i({padding:9,borderRadius:"50%"},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12})),se=F("input",{name:"MuiSwitchBase",shouldForwardProp:T})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),oe=W.forwardRef(function(o,d){const{autoFocus:l,checked:a,checkedIcon:r,className:w,defaultChecked:h,disabled:y,disableFocusRipple:p=!1,edge:S=!1,icon:R,id:P,inputProps:I,inputRef:v,name:j,onBlur:f,onChange:g,onFocus:m,readOnly:z,required:E=!1,tabIndex:N,type:c,value:b}=o,U=Z(o,X),[B,_]=$({controlled:a,default:!!h,name:"SwitchBase",state:"checked"}),t=A(),q=s=>{m&&m(s),t&&t.onFocus&&t.onFocus(s)},L=s=>{f&&f(s),t&&t.onBlur&&t.onBlur(s)},M=s=>{if(s.nativeEvent.defaultPrevented)return;const x=s.target.checked;_(x),g&&g(s,x)};let n=y;t&&typeof n>"u"&&(n=t.disabled);const O=c==="checkbox"||c==="radio",u=i({},o,{checked:B,disabled:n,disableFocusRipple:p,edge:S}),k=Y(u);return C.jsxs(ee,i({component:"span",className:D(k.root,w),centerRipple:!0,focusRipple:!p,disabled:n,tabIndex:null,role:void 0,onFocus:q,onBlur:L,ownerState:u,ref:d},U,{children:[C.jsx(se,i({autoFocus:l,checked:a,defaultChecked:h,className:k.input,disabled:n,id:O?P:void 0,name:j,onChange:M,readOnly:z,ref:v,required:E,ownerState:u,tabIndex:N,type:c},c==="checkbox"&&b===void 0?{}:{value:b},I)),B?r:R]}))});export{oe as S};