"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),r=require("classnames"),a=require("@material-ui/core/Avatar"),i=require("../Tooltip/Tooltip.js");require("../Tooltip/ScrollableTooltip.js");var o=require("../../utils/main.js"),s=require("@material-ui/core");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=n(r),u=n(a),c=function(e){switch(e){case 24:return 12;case 32:return 14;case 40:return 16;case 48:return 20;case 128:return 64;case 200:return 80;default:return Math.floor(e/2)}},d=function(e){return{minWidth:e,width:e,height:e,lineHeight:"".concat(e,"px"),fontSize:c(e)}},f=["#5F47A4","#9078C8","#DC74FD","#F695B5","#CB4F4F","#896F65","#F3AE96","#EE7850","#DDAE67","#A6CA72","#62893D","#91C9C4","#38818D","#77B5F1","#3F4C99","#919DA4"],h=function(e){return f[Math.abs(o.hashCode(e)%f.length)]},m=s.makeStyles((function(e){return{avatar:{color:e.palette.common.white,fontWeight:"bold"}}})),p=function(r){var a=r.className,s=r.imgSrc,n=r.alt,c=r.displayName,f=void 0===c?"":c,p=r.showTooltip,v=void 0!==p&&p,b=r.size,g=void 0===b?32:b,C=r["data-testid"],F=void 0===C?"generic_avatar":C,j=m();return t.jsx(i.Tooltip,{title:f,disableFocusListener:!v,disableHoverListener:!v,disableTouchListener:!v,children:t.jsx(u.default,{"data-testid":F,alt:n,src:s,className:l.default(j.avatar,a),style:e.__assign(e.__assign({},d(Number(g))),{backgroundColor:!!f&&h(f)}),children:f?o.getNameInitials(f):null})})};exports.AvatarComponent=p,exports.default=p;
