import{cF as C,cG as L,f as h,r as a,cJ as N,j as r,cL as v,cM as B,cI as V,dW as W,cX as X}from"./index-d9e0bbb9.js";import{i as w}from"./isHostComponent-73d6e646.js";import{a as x}from"./List-c3ed6b04.js";function Y(e){return C("MuiListItem",e)}L("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);function dt(e){return C("MuiListItemButton",e)}const q=L("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),K=q;function O(e){return C("MuiListItemSecondaryAction",e)}L("MuiListItemSecondaryAction",["root","disableGutters"]);const Q=e=>{const{disableGutters:t,classes:s}=e;return B({root:["root",t&&"disableGutters"]},O,s)},Z=h("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,...l}=o,p=a.useContext(x),i={...o,disableGutters:p.disableGutters},g=Q(i);return r.jsx(Z,{className:v(g.root,n),ownerState:i,ref:s,...l})});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:l,divider:p,hasSecondaryAction:i}=e;return B({root:["root",o&&"dense",!n&&"gutters",!l&&"padding",p&&"divider",t==="flex-start"&&"alignItemsFlexStart",i&&"secondaryAction"],container:["container"]},Y,s)},st=h("div",{name:"MuiListItem",slot:"Root",overridesResolver:tt})(V(({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:{[`& > .${K.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=h("li",{name:"MuiListItem",slot:"Container"})({position:"relative"}),nt=a.forwardRef(function(t,s){const o=N({props:t,name:"MuiListItem"}),{alignItems:n="center",children:l,className:p,component:i,components:g={},componentsProps:F={},ContainerComponent:S="li",ContainerProps:{className:$,...k}={},dense:A=!1,disableGutters:y=!1,disablePadding:D=!1,divider:E=!1,secondaryAction:R,slotProps:T={},slots:z={},...H}=o,P=a.useContext(x),b=a.useMemo(()=>({dense:A||P.dense||!1,alignItems:n,disableGutters:y}),[n,P.dense,A,y]),J=a.useRef(null),d=a.Children.toArray(l),M=d.length&&W(d[d.length-1],["ListItemSecondaryAction"]),f={...o,alignItems:n,dense:b.dense,disableGutters:y,disablePadding:D,divider:E,hasSecondaryAction:M},G=et(f),j=X(J,s),I=z.root||g.Root||st,m=T.root||F.root||{},u={className:v(G.root,m.className,p),...H};let c=i||"li";return M?(c=!u.component&&!i?"div":c,S==="li"&&(c==="li"?c="div":u.component==="li"&&(u.component="div")),r.jsx(x.Provider,{value:b,children:r.jsxs(ot,{as:S,className:v(G.container,$),ref:j,ownerState:f,...k,children:[r.jsx(I,{...m,...!w(I)&&{as:c,ownerState:{...f,...m.ownerState}},...u,children:d}),d.pop()]})})):r.jsx(x.Provider,{value:b,children:r.jsxs(I,{...m,as:c,ref:j,...!w(I)&&{ownerState:{...f,...m.ownerState}},...u,children:[d,R&&r.jsx(_,{children:R})]})})}),ct=nt;export{ct as L,_ as a,dt as g,K as l};
