import{d as R,bC as w,bA as O,bj as S,r as c,bk as j,bq as F,bt as G,j as m,bm as C,bn as V}from"./index-d2b25495.js";import{a as y}from"./List-863f013e.js";import{g as E,l as n}from"./ListItem-cd83fb06.js";const N=(t,s)=>{const{ownerState:e}=t;return[s.root,e.dense&&s.dense,e.alignItems==="flex-start"&&s.alignItemsFlexStart,e.divider&&s.divider,!e.disableGutters&&s.gutters]},P=t=>{const{alignItems:s,classes:e,dense:i,disabled:o,disableGutters:l,divider:d,selected:p}=t,a=V({root:["root",i&&"dense",!l&&"gutters",d&&"divider",o&&"disabled",s==="flex-start"&&"alignItemsFlexStart",p&&"selected"]},E,e);return{...e,...a}},D=R(w,{shouldForwardProp:t=>O(t)||t==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:N})(S(({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.alpha((t.vars||t).palette.primary.main,(t.vars||t).palette.action.selectedOpacity),[`&.${n.focusVisible}`]:{backgroundColor:t.alpha((t.vars||t).palette.primary.main,`${(t.vars||t).palette.action.selectedOpacity} + ${(t.vars||t).palette.action.focusOpacity}`)}},[`&.${n.selected}:hover`]:{backgroundColor:t.alpha((t.vars||t).palette.primary.main,`${(t.vars||t).palette.action.selectedOpacity} + ${(t.vars||t).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:t.alpha((t.vars||t).palette.primary.main,(t.vars||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:s})=>s.divider,style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:s})=>!s.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:s})=>s.dense,style:{paddingTop:4,paddingBottom:4}}]}))),M=c.forwardRef(function(s,e){const i=j({props:s,name:"MuiListItemButton"}),{alignItems:o="center",autoFocus:l=!1,component:d="div",children:p,dense:u=!1,disableGutters:a=!1,divider:I=!1,focusVisibleClassName:B,selected:k=!1,className:$,...r}=i,v=c.useContext(y),g=c.useMemo(()=>({dense:u||v.dense||!1,alignItems:o,disableGutters:a}),[o,v.dense,u,a]),f=c.useRef(null);F(()=>{l&&f.current&&f.current.focus()},[l]);const x={...i,alignItems:o,dense:g.dense,disableGutters:a,divider:I,selected:k},b=P(x),L=G(f,e);return m.jsx(y.Provider,{value:g,children:m.jsx(D,{ref:L,href:r.href||r.to,component:(r.href||r.to)&&d==="div"?"button":d,focusVisibleClassName:C(b.focusVisible,B),ownerState:x,className:C(b.root,$),...r,classes:b,children:p})})}),q=M;export{q as L};
