import{g as E,a as U,r as P,u as A,b as z,T as x,j as d,d as y,J as L,e as B,s as v,m as F}from"./main-BMMRv56V.js";import{u as H,f as I}from"./TextField-CWEE-Dgp.js";function J(e){return E("MuiFormControlLabel",e)}const t=U("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),W=e=>{const{classes:r,disabled:s,labelPlacement:o,error:m,required:b}=e,u={root:["root",s&&"disabled",`labelPlacement${L(o)}`,m&&"error",b&&"required"],label:["label",s&&"disabled"],asterisk:["asterisk",m&&"error"]};return B(u,J,r)},G=v("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:s}=e;return[{[`& .${t.label}`]:r.label},r.root,r[`labelPlacement${L(s.labelPlacement)}`]]}})(F(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${t.disabled}`]:{cursor:"default"},[`& .${t.label}`]:{[`&.${t.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:r})=>r==="start"||r==="top"||r==="bottom",style:{marginLeft:16}}]}))),K=v("span",{name:"MuiFormControlLabel",slot:"Asterisk"})(F(({theme:e})=>({[`&.${t.error}`]:{color:(e.vars||e).palette.error.main}}))),_=P.forwardRef(function(r,s){const o=A({props:r,name:"MuiFormControlLabel"}),{checked:m,className:b,componentsProps:u={},control:a,disabled:R,disableTypography:T,inputRef:O,label:q,labelPlacement:$="end",name:Q,onChange:V,required:j,slots:k={},slotProps:w={},value:X,...M}=o,n=H(),g=R??a.props.disabled??(n==null?void 0:n.disabled),f=j??a.props.required,h={disabled:g,required:f};["checked","name","onChange","value","inputRef"].forEach(p=>{typeof a.props[p]>"u"&&typeof o[p]<"u"&&(h[p]=o[p])});const N=I({props:o,muiFormControl:n,states:["error"]}),i={...o,disabled:g,labelPlacement:$,required:f,error:N.error},C=W(i),S={slots:k,slotProps:{...u,...w}},[D,c]=z("typography",{elementType:x,externalForwardedProps:S,ownerState:i});let l=q;return l!=null&&l.type!==x&&!T&&(l=d.jsx(D,{component:"span",...c,className:y(C.label,c==null?void 0:c.className),children:l})),d.jsxs(G,{className:y(C.root,b),ownerState:i,ref:s,...M,children:[P.cloneElement(a,h),f?d.jsxs("div",{children:[l,d.jsxs(K,{ownerState:i,"aria-hidden":!0,className:C.asterisk,children:[" ","*"]})]}):l]})});export{_ as F};
