import{m as H,n as W,f as k,d8 as V,cP as X,r as N,j as f,v as T,o as z,w as G,q as J,t as Y,x as Z,T as O}from"./index-dc933734.js";import{u as _,a as K,f as ee}from"./Grow-3459ea54.js";function oe(e){return H("PrivateSwitchBase",e)}W("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 G(d,oe,o)},se=k(V)({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=k("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:U,inputRef:M,name:v,onBlur:w,onChange:x,onFocus:L,readOnly:$,required:m=!1,tabIndex:F,type:i,value:g,...q}=o,[u,C]=_({controlled:l,default:!!p,name:"SwitchBase",state:"checked"}),r=K(),j=n=>{L&&L(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),x&&x(n,A)};let a=S;r&&typeof a>"u"&&(a=r.disabled);const Q=i==="checkbox"||i==="radio",I={...o,checked:u,disabled:a,disableFocusRipple:P,edge:E},D=te(I);return f.jsxs(se,{component:"span",className:T(D.root,h),centerRipple:!0,focusRipple:!P,disabled:a,tabIndex:null,role:void 0,onFocus:j,onBlur:b,ownerState:I,ref:s,...q,children:[f.jsx(re,{autoFocus:t,checked:l,defaultChecked:p,className:D.input,disabled:a,id:Q?B:void 0,name:v,onChange:c,readOnly:$,ref:M,required:m,ownerState:I,tabIndex:F,type:i,...i==="checkbox"&&g===void 0?{}:{value:g},...U}),u?d:R]})}),be=ae;function le(e){return H("MuiFormControlLabel",e)}const ne=W("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 G(h,le,o)},ce=k("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:s}=e;return[{[`& .${y.label}`]:o.label},o.root,o[`labelPlacement${z(s.labelPlacement)}`]]}})(J(({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=k("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,o)=>o.asterisk})(J(({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:U,onChange:M,required:v,slots:w={},slotProps:x={},value:L,...$}=t,m=K(),F=S??p.props.disabled??(m==null?void 0:m.disabled),i=v??p.props.required,g={disabled:F,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:F,labelPlacement:B,required:i,error:q.error},C=ie(u),r={slots:w,slotProps:{...h,...x}},[j,b]=Z("typography",{elementType:O,externalForwardedProps:r,ownerState:u});let c=R;return c!=null&&c.type!==O&&!P&&(c=f.jsx(j,{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};
