import{c as V,_ as E,a as F,b as n,s as G,d as x,f as L,l as T,r as w,n as c,o as C,p as $,q as I,m as i}from"./OdysseyThemeProvider-Bh0Bu-2o.js";import{r as d}from"./index-NdkWRN8K.js";import{a as O}from"./List-CmjR1pNu.js";import{j as M}from"./jsx-runtime-CnH95YSl.js";import{u as _}from"./useIsFocusVisible-DH0qxT5e.js";import{B as D}from"./ButtonBase-BNqa2TMD.js";const H=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],S=(a,e)=>{const{ownerState:s}=a;return[e.root,s.dense&&e.dense,s.divider&&e.divider,!s.disableGutters&&e.gutters]},z=a=>{const{disabled:e,dense:s,divider:t,disableGutters:l,selected:p,classes:o}=a,r=L({root:["root",s&&"dense",e&&"disabled",!l&&"gutters",t&&"divider",p&&"selected"]},T,o);return n({},o,r)},U=G(D,{shouldForwardProp:a=>w(a)||a==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:S})(({theme:a,ownerState:e})=>n({},a.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!e.disableGutters&&{paddingLeft:16,paddingRight:16},e.divider&&{borderBottom:`1px solid ${(a.vars||a).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(a.vars||a).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${i.selected}`]:{backgroundColor:a.vars?`rgba(${a.vars.palette.primary.mainChannel} / ${a.vars.palette.action.selectedOpacity})`:c.alpha(a.palette.primary.main,a.palette.action.selectedOpacity),[`&.${i.focusVisible}`]:{backgroundColor:a.vars?`rgba(${a.vars.palette.primary.mainChannel} / calc(${a.vars.palette.action.selectedOpacity} + ${a.vars.palette.action.focusOpacity}))`:c.alpha(a.palette.primary.main,a.palette.action.selectedOpacity+a.palette.action.focusOpacity)}},[`&.${i.selected}:hover`]:{backgroundColor:a.vars?`rgba(${a.vars.palette.primary.mainChannel} / calc(${a.vars.palette.action.selectedOpacity} + ${a.vars.palette.action.hoverOpacity}))`:c.alpha(a.palette.primary.main,a.palette.action.selectedOpacity+a.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:a.vars?`rgba(${a.vars.palette.primary.mainChannel} / ${a.vars.palette.action.selectedOpacity})`:c.alpha(a.palette.primary.main,a.palette.action.selectedOpacity)}},[`&.${i.focusVisible}`]:{backgroundColor:(a.vars||a).palette.action.focus},[`&.${i.disabled}`]:{opacity:(a.vars||a).palette.action.disabledOpacity},[`& + .${I.root}`]:{marginTop:a.spacing(1),marginBottom:a.spacing(1)},[`& + .${I.inset}`]:{marginLeft:52},[`& .${$.root}`]:{marginTop:0,marginBottom:0},[`& .${$.inset}`]:{paddingLeft:36},[`& .${C.root}`]:{minWidth:36}},!e.dense&&{[a.breakpoints.up("sm")]:{minHeight:"auto"}},e.dense&&n({minHeight:32,paddingTop:4,paddingBottom:4},a.typography.body2,{[`& .${C.root} svg`]:{fontSize:"1.25rem"}}))),X=d.forwardRef(function(e,s){const t=V({props:e,name:"MuiMenuItem"}),{autoFocus:l=!1,component:p="li",dense:o=!1,divider:b=!1,disableGutters:r=!1,focusVisibleClassName:k,role:R="menuitem",tabIndex:v,className:B}=t,j=E(t,H),m=d.useContext(O),g=d.useMemo(()=>({dense:o||m.dense||!1,disableGutters:r}),[m.dense,o,r]),u=d.useRef(null);F(()=>{l&&u.current&&u.current.focus()},[l]);const N=n({},t,{dense:g.dense,divider:b,disableGutters:r}),f=z(t),P=_(u,s);let y;return t.disabled||(y=v!==void 0?v:-1),M.jsx(O.Provider,{value:g,children:M.jsx(U,n({ref:P,role:R,tabIndex:y,component:p,focusVisibleClassName:x(f.focusVisible,k),className:x(f.root,B)},j,{ownerState:N,classes:f}))})});export{X as M};
