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