import{d as G,r as $,u as B,a as T,y as Y,w as F,af as M,o as ee,q,_ as h,c as u,b as i,R as ae,P as w,X as Z,i as te,ag as re,I as ne,Z as H,ah as J,v as oe,H as le,D as ie,h as se,t as X}from"./index-c0ea9eee.js";import{u as ue,e as ce,t as ve,T as fe,d as pe}from"./index-97c28cb7.js";import{r as de,u as me}from"./useFlexGapSupport-20a12060.js";import{u as ge,a as ye}from"./useSize-7089b0c3.js";var xe=function(){return{prefixCls:String,shape:{type:String,default:"circle"},size:{type:[Number,String,Object],default:function(){return"default"}},src:String,srcset:String,icon:w.any,alt:String,gap:Number,draggable:{type:Boolean,default:void 0},crossOrigin:String,loadError:{type:Function}}},he=G({compatConfig:{MODE:3},name:"AAvatar",inheritAttrs:!1,props:xe(),slots:["icon"],setup:function(e,_){var S=_.slots,o=_.attrs,c=$(!0),C=$(!1),x=$(1),d=$(null),g=$(null),A=B("avatar",e),y=A.prefixCls,m=ge(),r=T(function(){return e.size==="default"?m.value:e.size}),N=ue(),v=ce(function(){if(Y(e.size)==="object"){var n=de.find(function(s){return N.value[s]}),l=e.size[n];return l}}),a=function(l){return v.value?{width:"".concat(v.value,"px"),height:"".concat(v.value,"px"),lineHeight:"".concat(v.value,"px"),fontSize:"".concat(l?v.value/2:18,"px")}:{}},t=function(){if(!(!d.value||!g.value)){var l=d.value.offsetWidth,s=g.value.offsetWidth;if(l!==0&&s!==0){var P=e.gap,b=P===void 0?4:P;b*2