import{bh as C,bi as h,d as L,r as a,bk as N,j as r,bm as v,bn as B,bj as Y,cF as q,bt as J}from"./index-60a3c753.js";import{a as I,i as w}from"./List-f567f8e4.js";function K(e){return C("MuiListItem",e)}h("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);function at(e){return C("MuiListItemButton",e)}const O=h("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),Q=O;function W(e){return C("MuiListItemSecondaryAction",e)}h("MuiListItemSecondaryAction",["root","disableGutters"]);const X=e=>{const{disableGutters:t,classes:s}=e;return B({root:["root",t&&"disableGutters"]},W,s)},Z=L("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:s}=e;return[t.root,s.disableGutters&&t.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:({ownerState:e})=>e.disableGutters,style:{right:0}}]}),U=a.forwardRef(function(t,s){const o=N({props:t,name:"MuiListItemSecondaryAction"}),{className:n,...c}=o,p=a.useContext(I),i={...o,disableGutters:p.disableGutters},g=X(i);return r.jsx(Z,{className:v(g.root,n),ownerState:i,ref:s,...c})});U.muiName="ListItemSecondaryAction";const _=U,tt=(e,t)=>{const{ownerState:s}=e;return[t.root,s.dense&&t.dense,s.alignItems==="flex-start"&&t.alignItemsFlexStart,s.divider&&t.divider,!s.disableGutters&&t.gutters,!s.disablePadding&&t.padding,s.hasSecondaryAction&&t.secondaryAction]},et=e=>{const{alignItems:t,classes:s,dense:o,disableGutters:n,disablePadding:c,divider:p,hasSecondaryAction:i}=e;return B({root:["root",o&&"dense",!n&&"gutters",!c&&"padding",p&&"divider",t==="flex-start"&&"alignItemsFlexStart",i&&"secondaryAction"],container:["container"]},K,s)},st=L("div",{name:"MuiListItem",slot:"Root",overridesResolver:tt})(Y(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:t})=>!t.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:t})=>!t.disablePadding&&t.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:t})=>!t.disablePadding&&!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>!t.disablePadding&&!!t.secondaryAction,style:{paddingRight:48}},{props:({ownerState:t})=>!!t.secondaryAction,style:{[`& > .${Q.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>t.button,style:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}},{props:({ownerState:t})=>t.hasSecondaryAction,style:{paddingRight:48}}]}))),ot=L("li",{name:"MuiListItem",slot:"Container"})({position:"relative"}),nt=a.forwardRef(function(t,s){const o=N({props:t,name:"MuiListItem"}),{alignItems:n="center",children:c,className:p,component:i,components:g={},componentsProps:k={},ContainerComponent:S="li",ContainerProps:{className:F,...$}={},dense:A=!1,disableGutters:x=!1,disablePadding:D=!1,divider:E=!1,secondaryAction:R,slotProps:T={},slots:z={},...H}=o,P=a.useContext(I),y=a.useMemo(()=>({dense:A||P.dense||!1,alignItems:n,disableGutters:x}),[n,P.dense,A,x]),V=a.useRef(null),d=a.Children.toArray(c),M=d.length&&q(d[d.length-1],["ListItemSecondaryAction"]),b={...o,alignItems:n,dense:y.dense,disableGutters:x,disablePadding:D,divider:E,hasSecondaryAction:M},G=et(b),j=J(V,s),f=z.root||g.Root||st,m=T.root||k.root||{},u={className:v(G.root,m.className,p),...H};let l=i||"li";return M?(l=!u.component&&!i?"div":l,S==="li"&&(l==="li"?l="div":u.component==="li"&&(u.component="div")),r.jsx(I.Provider,{value:y,children:r.jsxs(ot,{as:S,className:v(G.container,F),ref:j,ownerState:b,...$,children:[r.jsx(f,{...m,...!w(f)&&{as:l,ownerState:{...b,...m.ownerState}},...u,children:d}),d.pop()]})})):r.jsx(I.Provider,{value:y,children:r.jsxs(f,{...m,as:l,ref:j,...!w(f)&&{ownerState:{...b,...m.ownerState}},...u,children:[d,R&&r.jsx(_,{children:R})]})})}),dt=nt;export{dt as L,_ as a,at as g,Q as l};
