import{W as M,V as $,as as y,n as j,c as N,_ as P,b as a,s as U,d as W,e as h,f as _}from"./OdysseyThemeProvider-Bh0Bu-2o.js";import{r as x}from"./index-NdkWRN8K.js";import{j as z}from"./jsx-runtime-CnH95YSl.js";import{b as E,u as H}from"./useIsFocusVisible-DH0qxT5e.js";import{T as I}from"./Typography-ClQ35Rr-.js";function O(e){return $("MuiLink",e)}const q=M("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),C={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},w=e=>C[e]||e,G=({theme:e,ownerState:o})=>{const n=w(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.alpha(r,.4)},J=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],K=e=>{const{classes:o,component:n,focusVisible:r,underline:s}=e,t={root:["root",`underline${h(s)}`,n==="button"&&"button",r&&"focusVisible"]};return _(t,O,o)},Q=U(I,{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:G({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"},[`&.${q.focusVisible}`]:{outline:"auto"}})),eo=x.forwardRef(function(o,n){const r=N({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=P(r,J),{isFocusVisibleRef:f,onBlur:F,onFocus:L,ref:R}=E(),[v,m]=x.useState(!1),D=H(n,R),T=i=>{F(i),f.current===!1&&m(!1),u&&u(i)},A=i=>{L(i),f.current===!0&&m(!0),p&&p(i)},b=a({},r,{color:t,component:c,focusVisible:v,underline:k,variant:d}),B=K(b);return z.jsx(Q,a({color:t,className:W(B.root,s),classes:g,component:c,onBlur:T,onFocus:A,ref:D,ownerState:b,variant:d,sx:[...Object.keys(C).includes(t)?[]:[{color:t}],...Array.isArray(l)?l:[l]]},V))});export{eo as L};
