import{flattenChildren as e,getPropsSlot as t}from"../_util/props-util/index.mjs";import n from"../config-provider/hooks/useConfigInject.mjs";import{cloneElement as r}from"../_util/vnode.mjs";import{useAvatarProviderContext as i}from"./AvatarContext.mjs";import a from"./style/index.mjs";import o from"./Avatar.mjs";import s from"../popover/index.mjs";import{computed as c,createVNode as l,defineComponent as u,watchEffect as d}from"vue";var f=()=>({prefixCls:String,maxCount:Number,maxStyle:{type:Object,default:void 0},maxPopoverPlacement:{type:String,default:`top`},maxPopoverTrigger:String,size:{type:[Number,String,Object],default:`default`},shape:{type:String,default:`circle`}}),p=u({compatConfig:{MODE:3},name:`AAvatarGroup`,inheritAttrs:!1,props:f(),setup(u,{slots:f,attrs:p}){let{prefixCls:m,direction:h}=n(`avatar`,u),g=c(()=>`${m.value}-group`),[_,v]=a(m);return d(()=>{i({size:u.size,shape:u.shape})}),()=>{let{maxPopoverPlacement:n=`top`,maxCount:i,maxStyle:a,maxPopoverTrigger:c=`hover`,shape:d}=u,m={[g.value]:!0,[`${g.value}-rtl`]:h.value===`rtl`,[`${p.class}`]:!!p.class,[v.value]:!0},y=e(t(f,u)).map((e,t)=>r(e,{key:`avatar-key-${t}`})),b=y.length;if(i&&i<b){let e=y.slice(0,i),t=y.slice(i,b);return e.push(l(s,{key:`avatar-popover-key`,content:t,trigger:c,placement:n,overlayClassName:`${g.value}-popover`},{default:()=>[l(o,{style:a,shape:d},{default:()=>[`+${b-i}`]})]})),_(l(`div`,{...p,class:m,style:p.style},[e]))}return _(l(`div`,{...p,class:m,style:p.style},[y]))}}});export{p as default,f as groupProps};