import{d as j,P as p,H as E,g as o,ac as M,k as h,aW as N,z as S,y as P,cD as T,bT as k}from"./app-D7zH3Nl5.js";import{C as w}from"./index-Cv7zOydE.js";import{c as D}from"./useFlexGapSupport-CpBR-RD-.js";const K=()=>({avatar:p.any,description:p.any,prefixCls:String,title:p.any}),z=j({compatConfig:{MODE:3},name:"AListItemMeta",props:K(),displayName:"AListItemMeta",__ANT_LIST_ITEM_META:!0,slots:Object,setup(a,u){let{slots:t}=u;const{prefixCls:e}=E("list",a);return()=>{var n,v,f,y,_,l;const i=`${e.value}-item-meta`,s=(n=a.title)!==null&&n!==void 0?n:(v=t.title)===null||v===void 0?void 0:v.call(t),r=(f=a.description)!==null&&f!==void 0?f:(y=t.description)===null||y===void 0?void 0:y.call(t),m=(_=a.avatar)!==null&&_!==void 0?_:(l=t.avatar)===null||l===void 0?void 0:l.call(t),x=o("div",{class:`${e.value}-item-meta-content`},[s&&o("h4",{class:`${e.value}-item-meta-title`},[s]),r&&o("div",{class:`${e.value}-item-meta-description`},[r])]);return o("div",{class:i},[m&&o("div",{class:`${e.value}-item-meta-avatar`},[m]),(s||r)&&x])}}}),F=Symbol("ListContextKey");var H=function(a,u){var t={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&u.indexOf(e)<0&&(t[e]=a[e]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(a);n<e.length;n++)u.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(a,e[n])&&(t[e[n]]=a[e[n]]);return t};const V=()=>({prefixCls:String,extra:p.any,actions:p.array,grid:Object,colStyle:{type:Object,default:void 0}}),G=j({compatConfig:{MODE:3},name:"AListItem",inheritAttrs:!1,Meta:z,props:V(),slots:Object,setup(a,u){let{slots:t,attrs:e}=u;const{itemLayout:n,grid:v}=M(F,{grid:h(),itemLayout:h()}),{prefixCls:f}=E("list",a),y=()=>{var l;const i=((l=t.default)===null||l===void 0?void 0:l.call(t))||[];let s;return i.forEach(r=>{T(r)&&!k(r)&&(s=!0)}),s&&i.length>1},_=()=>{var l,i;const s=(l=a.extra)!==null&&l!==void 0?l:(i=t.extra)===null||i===void 0?void 0:i.call(t);return n.value==="vertical"?!!s:!y()};return()=>{var l,i,s,r,m;const{class:x}=e,A=H(e,["class"]),d=f.value,g=(l=a.extra)!==null&&l!==void 0?l:(i=t.extra)===null||i===void 0?void 0:i.call(t),b=(s=t.default)===null||s===void 0?void 0:s.call(t);let c=(r=a.actions)!==null&&r!==void 0?r:N((m=t.actions)===null||m===void 0?void 0:m.call(t));c=c&&!Array.isArray(c)?[c]:c;const C=c&&c.length>0&&o("ul",{class:`${d}-item-action`,key:"actions"},[c.map((L,$)=>o("li",{key:`${d}-item-action-${$}`},[L,$!==c.length-1&&o("em",{class:`${d}-item-action-split`},null)]))]),I=v.value?"div":"li",O=o(I,S(S({},A),{},{class:P(`${d}-item`,{[`${d}-item-no-flex`]:!_()},x)}),{default:()=>[n.value==="vertical"&&g?[o("div",{class:`${d}-item-main`,key:"content"},[b,C]),o("div",{class:`${d}-item-extra`,key:"extra"},[g])]:[b,C,D(g,{key:"extra"})]]});return v.value?o(w,{flex:1,style:a.colStyle},{default:()=>[O]}):O}}});export{F as L,G as _,z as a};
