import{b as j,i as w,aj as z,R as c,ak as m,d as A,B as V,a as E,D as I,o as f,c as y,al as S,e as h,w as _,r as q,f as D,E as F,h as G,n as K,y as L,j as p,J as R,am as J,s as d,an as O,ao as U,x as $,F as H,z as M,a9 as g,l as Q,ab as W}from"./index-BKKvzUDD.js";import{f as X}from"./vnode-78qeDweP.js";import{u as C,a as Y,E as Z}from"./el-popper-D6_hxRbQ.js";const aa=j({size:{type:[Number,String],values:z,validator:a=>m(a)},shape:{type:String,values:["circle","square"]},icon:{type:w},src:{type:String,default:""},alt:String,srcSet:String,fit:{type:c(String),default:"cover"}}),ea={error:a=>a instanceof Event},b=Symbol("avatarGroupContextKey"),ta={size:{type:c([Number,String]),values:z,validator:a=>m(a)},shape:{type:c(String),values:["circle","square"]},collapseAvatars:Boolean,collapseAvatarsTooltip:Boolean,maxCollapseAvatars:{type:Number,default:1},effect:{type:c(String),default:"light"},placement:{type:c(String),values:Y,default:"top"},popperClass:C.popperClass,popperStyle:C.popperStyle,collapseClass:String,collapseStyle:{type:c([String,Array,Object,Boolean]),default:void 0}},sa=["src","alt","srcset"];var la=A({name:"ElAvatar",__name:"avatar",props:aa,emits:ea,setup(a,{emit:n}){const t=a,r=n,e=V(b,void 0),l=E("avatar"),o=L(!1),s=p(()=>t.size??(e==null?void 0:e.size)),v=p(()=>t.shape??(e==null?void 0:e.shape)??"circle"),B=p(()=>{const{icon:i}=t,u=[l.b()];return R(s.value)&&u.push(l.m(s.value)),i&&u.push(l.m("icon")),v.value&&u.push(l.m(v.value)),u}),x=p(()=>m(s.value)?l.cssVarBlock({size:J(s.value)}):void 0),T=p(()=>({objectFit:t.fit}));I(()=>[t.src,t.srcSet],()=>o.value=!1);function P(i){o.value=!0,r("error",i)}return(i,u)=>(f(),y("span",{class:K(B.value),style:S(x.value)},[(a.src||a.srcSet)&&!o.value?(f(),y("img",{key:0,src:a.src,alt:a.alt,srcset:a.srcSet,style:S(T.value),onError:P},null,44,sa)):a.icon?(f(),h(D(F),{key:1},{default:_(()=>[(f(),h(q(a.icon)))]),_:1})):G(i.$slots,"default",{key:2})],6))}}),k=la,N=A({name:"ElAvatarGroup",props:ta,setup(a,{slots:n}){const t=E("avatar-group");return H(b,M({size:g(a,"size"),shape:g(a,"shape")})),()=>{var l;const r=X(((l=n.default)==null?void 0:l.call(n))??[]);let e=r;if(a.collapseAvatars&&r.length>a.maxCollapseAvatars){e=r.slice(0,a.maxCollapseAvatars);const o=r.slice(a.maxCollapseAvatars);e.push(d(Z,{popperClass:a.popperClass,popperStyle:a.popperStyle,placement:a.placement,effect:a.effect,disabled:!a.collapseAvatarsTooltip},{default:()=>d(k,{size:a.size,shape:a.shape,class:a.collapseClass,style:a.collapseStyle},{default:()=>[$("+ "),o.length]}),content:()=>d("div",{class:t.e("collapse-avatars")},[o.map((s,v)=>O(s)?U(s,{key:s.key??v}):s)])}))}return d("div",{class:t.b()},[e])}}});const na=Q(k,{AvatarGroup:N});W(N);export{na as E};
