import{cH as O,cG as G,f as x,d2 as Q,cP as X,r as N,j as f,cL as T,cI as z,cM as J,cJ as K,cK as Y,cV as Z,T as H}from"./index-c5c88b67.js";import{b as _,u as V,f as ee}from"./Grow-7345f8ea.js";function oe(e){return O("PrivateSwitchBase",e)}G("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const te=e=>{const{classes:o,checked:s,disabled:t,edge:l}=e,d={root:["root",s&&"checked",t&&"disabled",l&&`edge${z(l)}`],input:["input"]};return J(d,oe,o)},se=x(Q)({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:o})=>e==="start"&&o.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:o})=>e==="end"&&o.size!=="small",style:{marginRight:-12}}]}),re=x("input",{shouldForwardProp:X})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),ae=N.forwardRef(function(o,s){const{autoFocus:t,checked:l,checkedIcon:d,className:h,defaultChecked:p,disabled:S,disableFocusRipple:P=!1,edge:E=!1,icon:R,id:B,inputProps:M,inputRef:U,name:L,onBlur:w,onChange:F,onFocus:v,readOnly:$,required:m=!1,tabIndex:k,type:i,value:g,...q}=o,[u,C]=_({controlled:l,default:!!p,name:"SwitchBase",state:"checked"}),r=V(),I=n=>{v&&v(n),r&&r.onFocus&&r.onFocus(n)},b=n=>{w&&w(n),r&&r.onBlur&&r.onBlur(n)},c=n=>{if(n.nativeEvent.defaultPrevented)return;const A=n.target.checked;C(A),F&&F(n,A)};let a=S;r&&typeof a>"u"&&(a=r.disabled);const W=i==="checkbox"||i==="radio",j={...o,checked:u,disabled:a,disableFocusRipple:P,edge:E},D=te(j);return f.jsxs(se,{component:"span",className:T(D.root,h),centerRipple:!0,focusRipple:!P,disabled:a,tabIndex:null,role:void 0,onFocus:I,onBlur:b,ownerState:j,ref:s,...q,children:[f.jsx(re,{autoFocus:t,checked:l,defaultChecked:p,className:D.input,disabled:a,id:W?B:void 0,name:L,onChange:c,readOnly:$,ref:U,required:m,ownerState:j,tabIndex:k,type:i,...i==="checkbox"&&g===void 0?{}:{value:g},...M}),u?d:R]})}),be=ae;function le(e){return O("MuiFormControlLabel",e)}const ne=G("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),y=ne,ie=e=>{const{classes:o,disabled:s,labelPlacement:t,error:l,required:d}=e,h={root:["root",s&&"disabled",`labelPlacement${z(t)}`,l&&"error",d&&"required"],label:["label",s&&"disabled"],asterisk:["asterisk",l&&"error"]};return J(h,le,o)},ce=x("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:s}=e;return[{[`& .${y.label}`]:o.label},o.root,o[`labelPlacement${z(s.labelPlacement)}`]]}})(K(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${y.disabled}`]:{cursor:"default"},[`& .${y.label}`]:{[`&.${y.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:o})=>o==="start"||o==="top"||o==="bottom",style:{marginLeft:16}}]}))),de=x("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,o)=>o.asterisk})(K(({theme:e})=>({[`&.${y.error}`]:{color:(e.vars||e).palette.error.main}}))),pe=N.forwardRef(function(o,s){const t=Y({props:o,name:"MuiFormControlLabel"}),{checked:l,className:d,componentsProps:h={},control:p,disabled:S,disableTypography:P,inputRef:E,label:R,labelPlacement:B="end",name:M,onChange:U,required:L,slots:w={},slotProps:F={},value:v,...$}=t,m=V(),k=S??p.props.disabled??(m==null?void 0:m.disabled),i=L??p.props.required,g={disabled:k,required:i};["checked","name","onChange","value","inputRef"].forEach(a=>{typeof p.props[a]>"u"&&typeof t[a]<"u"&&(g[a]=t[a])});const q=ee({props:t,muiFormControl:m,states:["error"]}),u={...t,disabled:k,labelPlacement:B,required:i,error:q.error},C=ie(u),r={slots:w,slotProps:{...h,...F}},[I,b]=Z("typography",{elementType:H,externalForwardedProps:r,ownerState:u});let c=R;return c!=null&&c.type!==H&&!P&&(c=f.jsx(I,{component:"span",...b,className:T(C.label,b==null?void 0:b.className),children:c})),f.jsxs(ce,{className:T(C.root,d),ownerState:u,ref:s,...$,children:[N.cloneElement(p,g),i?f.jsxs("div",{children:[c,f.jsxs(de,{ownerState:u,"aria-hidden":!0,className:C.asterisk,children:[" ","*"]})]}):c]})}),fe=pe;export{fe as F,be as S};
