"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("../_util/classNames.js"),s=require("../_util/props-util/index.js"),E=require("../_util/vnode.js"),y=require("../_util/vue-types/index.js"),I=require("../config-provider/hooks/useConfigInject.js");require("../theme/internal.js");const S=require("../grid/Col.js"),V=require("./ItemMeta.js"),j=require("./contextKey.js"),v=()=>({prefixCls:String,extra:y.default.any,actions:y.default.array,grid:Object,colStyle:{type:Object,default:void 0}}),A=e.defineComponent({compatConfig:{MODE:3},name:"AListItem",inheritAttrs:!1,Meta:V.default,props:v(),slots:Object,setup(a,{slots:i,attrs:g}){const{itemLayout:o,grid:u}=e.inject(j.ListContextKey,{grid:e.ref(),itemLayout:e.ref()}),{prefixCls:C}=I.default("list",a),N=()=>{const r=i.default?.()||[];let c;return r.forEach(t=>{s.isStringElement(t)&&!s.isEmptyElement(t)&&(c=!0)}),c&&r.length>1},q=()=>{const r=a.extra??i.extra?.();return o.value==="vertical"?!!r:!N()};return()=>{const{class:r,...c}=g,t=C.value,l=a.extra??i.extra?.(),d=i.default?.();let n=a.actions??s.flattenChildren(i.actions?.());n=n&&!Array.isArray(n)?[n]:n;const m=n&&n.length>0&&e.createVNode("ul",{class:`${t}-item-action`,key:"actions"},[n.map(($,x)=>e.createVNode("li",{key:`${t}-item-action-${x}`},[$,x!==n.length-1&&e.createVNode("em",{class:`${t}-item-action-split`},null)]))]),h=u.value?"div":"li",f=e.createVNode(h,{...c,class:p.default(`${t}-item`,{[`${t}-item-no-flex`]:!q()},r)},{default:()=>[o.value==="vertical"&&l?[e.createVNode("div",{class:`${t}-item-main`,key:"content"},[d,m]),e.createVNode("div",{class:`${t}-item-extra`,key:"extra"},[l])]:[d,m,E.cloneElement(l,{key:"extra"})]]});return u.value?e.createVNode(S.default,{flex:1,style:a.colStyle},{default:()=>[f]}):f}}});exports.default=A;exports.listItemProps=v;
