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