import{r as A,t as M,v as y,w as j,s as z,T as N,x as h,y as P,_ as U,j as _,z as W,B as w}from"./dataProvider-3f13e24d.js";import{a}from"./_baseSet-5837f3b2.js";import{r as x}from"./index-76fb7be0.js";import{u as H,a as E}from"./useIsFocusVisible-e5ed743c.js";function I(e){return M("MuiLink",e)}const O=A("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),S=O,C={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},q=e=>C[e]||e,G=({theme:e,ownerState:o})=>{const n=q(o.color),r=y(e,`palette.${n}`,!1)||o.color,s=y(e,`palette.${n}Channel`);return"vars"in e&&s?`rgba(${s} / 0.4)`:j(r,.4)},J=G,K=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],Q=e=>{const{classes:o,component:n,focusVisible:r,underline:s}=e,t={root:["root",`underline${h(s)}`,n==="button"&&"button",r&&"focusVisible"]};return w(t,I,o)},X=z(N,{name:"MuiLink",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:n}=e;return[o.root,o[`underline${h(n.underline)}`],n.component==="button"&&o.button]}})(({theme:e,ownerState:o})=>a({},o.underline==="none"&&{textDecoration:"none"},o.underline==="hover"&&{textDecoration:"none","&:hover":{textDecoration:"underline"}},o.underline==="always"&&a({textDecoration:"underline"},o.color!=="inherit"&&{textDecorationColor:J({theme:e,ownerState:o})},{"&:hover":{textDecorationColor:"inherit"}}),o.component==="button"&&{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"},[`&.${S.focusVisible}`]:{outline:"auto"}})),Y=x.forwardRef(function(o,n){const r=P({props:o,name:"MuiLink"}),{className:s,color:t="primary",component:c="a",onBlur:u,onFocus:p,TypographyClasses:g,underline:k="always",variant:d="inherit",sx:l}=r,v=U(r,K),{isFocusVisibleRef:f,onBlur:L,onFocus:V,ref:F}=H(),[D,m]=x.useState(!1),R=E(n,F),T=i=>{L(i),f.current===!1&&m(!1),u&&u(i)},$=i=>{V(i),f.current===!0&&m(!0),p&&p(i)},b=a({},r,{color:t,component:c,focusVisible:D,underline:k,variant:d}),B=Q(b);return _(X,a({color:t,className:W(B.root,s),classes:g,component:c,onBlur:T,onFocus:$,ref:R,ownerState:b,variant:d,sx:[...Object.keys(C).includes(t)?[]:[{color:t}],...Array.isArray(l)?l:[l]]},v))}),ro=Y;export{ro as L};
