import{r as e}from"./chunk-DT4yxi9n.js";import{n as t,t as n}from"./jsx-runtime-CzGT4z3X.js";var r=e(t(),1),i=n();function a(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)|0;return Math.abs(t)%360}function o(e,t){let n=(e||t||`?`).trim();return n?([...n].filter(e=>e.trim().length>0)[0]??`?`).toUpperCase():`?`}function s({profilePicUrl:e,nickname:t=``,uniqueId:n=``,size:s,ringColor:c,ringWidth:l=0}){let[u,d]=(0,r.useState)(!1),f=!!e&&!u,p={width:s,height:s,borderRadius:`50%`,flex:`0 0 auto`,display:`block`,objectFit:`cover`,background:`rgba(255,255,255,0.08)`,...c&&l>0?{boxShadow:`0 0 0 ${l}px ${c}`}:{}};if(f)return(0,i.jsx)(`img`,{src:e,alt:t||n,style:p,onError:()=>d(!0),referrerPolicy:`no-referrer`});let m=a(n||t||`?`);return(0,i.jsx)(`div`,{"aria-label":t||n,style:{...p,background:`linear-gradient(135deg, hsl(${m} 65% 48%), hsl(${(m+40)%360} 65% 38%))`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#fff`,fontWeight:800,fontFamily:`system-ui, -apple-system, sans-serif`,fontSize:Math.round(s*.44),lineHeight:1,userSelect:`none`},children:o(t,n)})}export{s as t};