import{resetComponent as x}from"../../style/index.mjs";import"../../theme/internal.mjs";import $ from"../../theme/util/genComponentStyleHook.mjs";import{merge as C}from"../../theme/util/statistic.mjs";const y=t=>{const{antCls:e,componentCls:o,iconCls:r,avatarBg:n,avatarColor:i,containerSize:a,containerSizeLG:l,containerSizeSM:c,textFontSize:g,textFontSizeLG:p,textFontSizeSM:u,borderRadius:m,borderRadiusLG:h,borderRadiusSM:v,lineWidth:d,lineType:z}=t,S=(s,b,f)=>({width:s,height:s,lineHeight:`${s-d*2}px`,borderRadius:"50%",[`&${o}-square`]:{borderRadius:f},[`${o}-string`]:{position:"absolute",left:{_skip_check_:!0,value:"50%"},transformOrigin:"0 center"},[`&${o}-icon`]:{fontSize:b,[`> ${r}`]:{margin:0}}});return{[o]:{...x(t),position:"relative",display:"inline-block",overflow:"hidden",color:i,whiteSpace:"nowrap",textAlign:"center",verticalAlign:"middle",background:n,border:`${d}px ${z} transparent`,"&-image":{background:"transparent"},[`${e}-image-img`]:{display:"block"},...S(a,g,m),"&-lg":{...S(l,p,h)},"&-sm":{...S(c,u,v)},"> img":{display:"block",width:"100%",height:"100%",objectFit:"cover"}}}},L=t=>{const{componentCls:e,groupBorderColor:o,groupOverlapping:r,groupSpace:n}=t;return{[`${e}-group`]:{display:"inline-flex",[`${e}`]:{borderColor:o},"> *:not(:first-child)":{marginInlineStart:r}},[`${e}-group-popover`]:{[`${e} + ${e}`]:{marginInlineStart:n}}}},M=$("Avatar",t=>{const{colorTextLightSolid:e,colorTextPlaceholder:o}=t,r=C(t,{avatarBg:o,avatarColor:e});return[y(r),L(r)]},t=>{const{controlHeight:e,controlHeightLG:o,controlHeightSM:r,fontSize:n,fontSizeLG:i,fontSizeXL:a,fontSizeHeading3:l,marginXS:c,marginXXS:g,colorBorderBg:p}=t;return{containerSize:e,containerSizeLG:o,containerSizeSM:r,textFontSize:Math.round((i+a)/2),textFontSizeLG:l,textFontSizeSM:n,groupSpace:g,groupOverlapping:-c,groupBorderColor:p}});export{M as default};
