1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5d14646e-c1dc-5f2a-9c8c-459f47ab9db3")}catch(e){}}(); 3import{s as e,t}from"./jsx-runtime-D4ePz0Hl.js";import{t as n}from"./useTranslation-xRzBcOIb.js";import{t as r}from"./classnames-B9Sa-P4w.js";import{t as i}from"./Tooltip-IxbCCOij.js";var a=e(r(),1),o=e(t(),1),s=({label:e,className:t,style:n})=>(0,o.jsx)(`span`,{style:n,className:(0,a.default)(`inline-flex max-w-[7.5rem] cursor-default items-center overflow-hidden rounded-full px-2 py-0.5 text-[11px] font-semibold leading-3 transition-colors`,t),children:(0,o.jsx)(`span`,{className:`min-w-0 truncate`,children:e})}),c={"#EDE9FE":`bg-violet-100 text-violet-800 group-data-[open]:bg-violet-200`,"#E0E7FF":`bg-indigo-100 text-indigo-800 group-data-[open]:bg-indigo-200`,"#D1FAE5":`bg-emerald-100 text-emerald-800 group-data-[open]:bg-emerald-200`,"#FEF3C7":`bg-amber-100 text-amber-800 group-data-[open]:bg-amber-200`,"#FCE7F3":`bg-pink-100 text-pink-800 group-data-[open]:bg-pink-200`},l=e=>e in c,u=({badge:e,interactive:t=!0})=>{let n=e.background_color.toUpperCase(),r=l(n)?c[n]:void 0,a=(0,o.jsx)(s,{label:e.name,className:r,style:r?void 0:{backgroundColor:e.background_color,color:e.text_on_background_color}});return t?(0,o.jsx)(i,{content:(0,o.jsxs)(`span`,{className:`block max-w-[240px]`,children:[(0,o.jsx)(`span`,{className:`block font-semibold`,children:e.name}),(0,o.jsx)(`span`,{className:`block`,children:e.description})]}),placement:`bottom`,className:`group inline-flex items-center`,interactive:!0,arrow:!0,children:(0,o.jsx)(`button`,{type:`button`,"aria-label":`${e.name}: ${e.description}`,className:`inline-flex items-center p-0 m-0 border-0 bg-transparent leading-none cursor-default`,children:a})}):(0,o.jsx)(`span`,{title:`${e.name}: ${e.description}`,className:`inline-flex items-center leading-none`,children:a})},d={admin:{shortKey:`community.roles.admin_short`,labelKey:`community.roles.admin`},manager:{shortKey:`community.roles.manager_short`,labelKey:`community.roles.manager`},moderator:{shortKey:`community.roles.moderator_short`,labelKey:`community.roles.moderator`}},f=[`admin`,`manager`,`moderator`],p=e=>f.find(t=>e.includes(t)),m=`bg-gray-100 text-gray-700`,h=({communityRole:e,interactive:t=!0})=>{let{t:r}=n(),{shortKey:a,labelKey:c}=d[e],l=r(a),u=r(c),f=(0,o.jsx)(s,{label:l,className:`uppercase tracking-wide ${m}`});return t?(0,o.jsx)(i,{content:u,placement:`bottom`,className:`group inline-flex items-center`,interactive:!0,arrow:!0,children:(0,o.jsx)(`button`,{type:`button`,"aria-label":u,className:`inline-flex items-center p-0 m-0 border-0 bg-transparent leading-none cursor-default`,children:f})}):(0,o.jsx)(`span`,{title:u,className:`inline-flex items-center leading-none`,children:f})},g={banned:{labelKey:`community.banned_badge`,className:`bg-red-100 text-red-600`},blocked:{labelKey:`community.blocked_badge`,className:`bg-black/5 text-black/60`},blocked_you:{labelKey:`community.blocked_you_badge`,className:`bg-black/5 text-black/60`}},_=2,v=(e,t)=>(0,o.jsx)(s,{label:e(t.labelKey),className:`uppercase tracking-wide ${t.className}`}),y=({roles:e,isBanned:t=!1,isBlocked:r=!1,blockedYou:i=!1,badges:s=[],limit:c,interactive:l=!0})=>{let{t:d}=n();if(t)return v(d,g.banned);if(r)return v(d,g.blocked);if(i)return v(d,g.blocked_you);let f=p(e),m=s.map(e=>({key:e.id,node:(0,o.jsx)(u,{badge:e,interactive:l})})),y=f?[{key:f,node:(0,o.jsx)(h,{communityRole:f,interactive:l})},...m]:m;return y.length===0?null:(0,o.jsx)(`div`,{className:`flex items-center gap-[6px] flex-wrap`,children:(c===null?y:y.slice(0,c??_)).map((e,t)=>(0,o.jsx)(`span`,{className:(0,a.default)(`inline-flex items-center`,c===void 0&&t>0&&`max-sm:hidden`),children:e.node},e.key))})};export{y as t}; 4//# sourceMappingURL=MemberBadge-CEtxB9l1.js.map 5//# debugId=5d14646e-c1dc-5f2a-9c8c-459f47ab9db3
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.