import{g as V,f as F,ao as a,a2 as T,r as g,b as h,w as A,j as R,c as M,E as L,d as P,s as j,T as U,m as z,F as B,W as k}from"./render-D1ZqzUbP.js";function E(e){return V("MuiLink",e)}const N=F("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),W=({theme:e,ownerState:o})=>{const r=o.color;if("colorSpace"in e&&e.colorSpace){const l=a(e,`palette.${r}.main`)||a(e,`palette.${r}`)||o.color;return e.alpha(l,.4)}const n=a(e,`palette.${r}.main`,!1)||a(e,`palette.${r}`,!1)||o.color,t=a(e,`palette.${r}.mainChannel`)||a(e,`palette.${r}Channel`);return"vars"in e&&t?`rgba(${t} / 0.4)`:T(n,.4)},v={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},H=e=>{const{classes:o,component:r,focusVisible:n,underline:t}=e,l={root:["root",`underline${L(t)}`,r==="button"&&"button",n&&"focusVisible"]};return P(l,E,o)},O=j(U,{name:"MuiLink",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:r}=e;return[o.root,o[`underline${L(r.underline)}`],r.component==="button"&&o.button]}})(z(({theme:e})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:o,ownerState:r})=>o==="always"&&r.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},{props:({underline:o,ownerState:r})=>o==="always"&&r.color==="inherit",style:e.colorSpace?{textDecorationColor:e.alpha("currentColor",.4)}:null},...Object.entries(e.palette).filter(B()).map(([o])=>({props:{underline:"always",color:o},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette[o].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(e.vars||e).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${N.focusVisible}`]:{outline:"auto"}}}]}))),G=g.forwardRef(function(o,r){const n=h({props:o,name:"MuiLink"}),t=A(),{className:l,color:s="primary",component:p="a",onBlur:d,onFocus:y,TypographyClasses:w,underline:f="always",variant:b="inherit",sx:c,...x}=n,[m,C]=g.useState(!1),D=i=>{k(i.target)||C(!1),d&&d(i)},$=i=>{k(i.target)&&C(!0),y&&y(i)},u={...n,color:s,component:p,focusVisible:m,underline:f,variant:b},S=H(u);return R.jsx(O,{color:s,className:M(S.root,l),classes:w,component:p,onBlur:D,onFocus:$,ref:r,ownerState:u,variant:b,...x,sx:[...v[s]===void 0?[{color:s}]:[],...Array.isArray(c)?c:[c]],style:{...x.style,...f==="always"&&s!=="inherit"&&!v[s]&&{"--Link-underlineColor":W({theme:t,ownerState:u})}}})});export{G as L};
//# sourceMappingURL=Link-4dUp4u44.js.map
