import{r as g}from"./redux-1.0.74-D8bIc6ki.js";import{e as S,g as T,B as i,a as l,u as j,f as A,h as F,i as L,j as R,m as M,p as P}from"./CircularProgress-1.0.74-QfwfRJ7i.js";import{u as B,j as k}from"./ButtonBase-1.0.74-W6tAH7AI.js";import{j as U}from"./tanstack-1.0.74-aU0azVkW.js";import{T as z}from"./Typography-1.0.74-B4mhsevh.js";function N(e){return T("MuiLink",e)}const E=S("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),H=({theme:e,ownerState:r})=>{const t=r.color,n=i(e,`palette.${t}.main`,!1)||i(e,`palette.${t}`,!1)||r.color,o=i(e,`palette.${t}.mainChannel`)||i(e,`palette.${t}Channel`);return"vars"in e&&o?`rgba(${o} / 0.4)`:l(n,.4)},v={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},W=e=>{const{classes:r,component:t,focusVisible:n,underline:o}=e,u={root:["root",`underline${L(o)}`,t==="button"&&"button",n&&"focusVisible"]};return R(u,N,r)},O=A(z,{name:"MuiLink",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[r.root,r[`underline${L(t.underline)}`],t.component==="button"&&r.button]}})(M(({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:r,ownerState:t})=>r==="always"&&t.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},...Object.entries(e.palette).filter(P()).map(([r])=>({props:{underline:"always",color:r},style:{"--Link-underlineColor":e.vars?`rgba(${e.vars.palette[r].mainChannel} / 0.4)`:l(e.palette[r].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:l(e.palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":e.vars?`rgba(${e.vars.palette.text.secondaryChannel} / 0.4)`:l(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"},[`&.${E.focusVisible}`]:{outline:"auto"}}}]}))),Q=g.forwardRef(function(r,t){const n=j({props:r,name:"MuiLink"}),o=B(),{className:u,color:s="primary",component:d="a",onBlur:y,onFocus:f,TypographyClasses:w,underline:b="always",variant:m="inherit",sx:c,...x}=n,[h,C]=g.useState(!1),$=a=>{k(a.target)||C(!1),y&&y(a)},D=a=>{k(a.target)&&C(!0),f&&f(a)},p={...n,color:s,component:d,focusVisible:h,underline:b,variant:m},V=W(p);return U.jsx(O,{color:s,className:F(V.root,u),classes:w,component:d,onBlur:$,onFocus:D,ref:t,ownerState:p,variant:m,...x,sx:[...v[s]===void 0?[{color:s}]:[],...Array.isArray(c)?c:[c]],style:{...x.style,...b==="always"&&s!=="inherit"&&!v[s]&&{"--Link-underlineColor":H({theme:o,ownerState:p})}}})});export{Q as L};
