import{f as R,ds as w,d5 as S,t as F,r as d,v as j,d9 as G,d8 as V,j as y,w as C,x as E,z as p}from"./index-60657852.js";import{e as I}from"./Select-7d2a5359.js";import{g as N,l as n}from"./ListItem-d3e4c009.js";const P=(t,e)=>{const{ownerState:s}=t;return[e.root,s.dense&&e.dense,s.alignItems==="flex-start"&&e.alignItemsFlexStart,s.divider&&e.divider,!s.disableGutters&&e.gutters]},D=t=>{const{alignItems:e,classes:s,dense:i,disabled:a,disableGutters:l,divider:c,selected:u}=t,o=E({root:["root",i&&"dense",!l&&"gutters",c&&"divider",a&&"disabled",e==="flex-start"&&"alignItemsFlexStart",u&&"selected"]},N,s);return{...s,...o}},M=R(w,{shouldForwardProp:t=>S(t)||t==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:P})(F(({theme:t})=>({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${n.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:p(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${n.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:p(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${n.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:p(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:p(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${n.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${n.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},variants:[{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.dense,style:{paddingTop:4,paddingBottom:4}}]}))),T=d.forwardRef(function(e,s){const i=j({props:e,name:"MuiListItemButton"}),{alignItems:a="center",autoFocus:l=!1,component:c="div",children:u,dense:f=!1,disableGutters:o=!1,divider:$=!1,focusVisibleClassName:B,selected:O=!1,className:k,...r}=i,b=d.useContext(I),x=d.useMemo(()=>({dense:f||b.dense||!1,alignItems:a,disableGutters:o}),[a,b.dense,f,o]),v=d.useRef(null);G(()=>{l&&v.current&&v.current.focus()},[l]);const m={...i,alignItems:a,dense:x.dense,disableGutters:o,divider:$,selected:O},g=D(m),L=V(v,s);return y.jsx(I.Provider,{value:x,children:y.jsx(M,{ref:L,href:r.href||r.to,component:(r.href||r.to)&&c==="div"?"button":c,focusVisibleClassName:C(g.focusVisible,B),ownerState:m,className:C(g.root,k),...r,classes:g,children:u})})}),W=T;export{W as L};
