Loading
function(e,l,t){t.d(l,{b:()=>G,default:()=>L});var n=t(477900),i=t(582128),s=t(503698),r=t.n(s),a=t(17928),o=t(189213),d=t(462887),c=t(192308),u=t(331322),f=t(939249),p=t(478016),m=t(834730),x=t(442433),g=t(66834),A=t(736653),h=t(573648),j=t(104171),b=t(666860),v=t(889227),N=t(280450),y=t(696451),_=t(317525),C=t(174459),E=t(975571),k=t(967740),I=t(652215),S=t(105292),R=t(609548),w=t(76145);function G(e,l){(0,c.openModalLazy)(async()=>{let{default:i}=await Promise.all([t.e("106980"),t.e("839772"),t.e("555679"),t.e("317225"),t.e("124060"),t.e("146566"),t.e("32661"),t.e("696123"),t.e("553984"),t.e("237834"),t.e("28561"),t.e("553203"),t.e("717460"),t.e("269178"),t.e("373566"),t.e("49282"),t.e("580971")]).then(t.bind(t,488358));return t=>(0,n.jsx)(i,{role:e,guildId:l,...t})})}let L=function(e){let{guildId:l,transitionState:s,onClose:c}=e,L=(0,a.bG)([_.A],()=>_.A.getSortedRoles(l)),U=(0,a.bG)([N.default],()=>N.default.getId()),z=(0,a.bG)([y.Ay],()=>y.Ay.getMember(l,U)),[T,V]=i.useState([]),M=(0,A.Ay)();if(i.useEffect(()=>{0!==T.length&&C.default.track(I.HAw.PASSPORT_ENTRY_VIEWED,{role_ids:T.map(e=>{let{role_id:l}=e;return l}),...(0,b.H$)(l)})},[l,T]),i.useEffect(()=>{g.A.getGuildRoleConnectionsConfigurations(l).then(e=>V(e))},[l]),null==z)return null;let O=L.filter(e=>null===e.tags.guild_connections);return(0,n.jsx)(o.a,{transitionState:s,title:S.intl.string(S.t.ghtnss),onClose:c,subtitle:S.intl.format(S.t["Y+TsEV"],{helpdeskArticleUrl:E.A.getArticleURL(I.MVz.CONNECTION_DETAILS)}),actions:[],children:(0,n.jsx)(u.B,{padding:{top:8},children:O.map(e=>{let s=z.roles.includes(e.id),a=function(e){let t=T.find(l=>{let{role_id:t}=l;return t===e});if(null==t)return[];let i={};for(let e of t.rules.flat()){let s;if(null!=e.application_id){let i=t.applications?.[e.application_id];s=i?.bot!=null?(0,n.jsx)("img",{src:new v.A(i.bot).getAvatarURL(l,24),alt:"",className:r()(R.ZN,w.my)}):null}else{let l=h.A.get(e.connection_type);if(null==l)continue;s=(0,n.jsx)("img",{src:(0,d.q)(M)?l.icon.lightSVG:l.icon.darkSVG,alt:"",className:w.my})}null!=s&&(i[`${e.connection_type}:${e.application_id}`]=s)}return Object.values(i)}(e.id);return(0,n.jsxs)(f.D,{className:r()(R.L5,s?R.xN:null),onClick:s?void 0:()=>G(e,l),onContextMenu:s?i=>{var s;return s=e.id,void(0,x.L3)(i,async()=>{let{default:e}=await t.e("868001").then(t.bind(t,699896));return t=>(0,n.jsx)(e,{...t,roleId:s,onLeaveRole:()=>g.A.unassignGuildRoleConnection(l,s)})})}:void 0,children:[s?(0,n.jsx)("div",{className:R.UA,children:(0,n.jsx)(p.U,{size:"xs",color:"currentColor"})}):null,(0,n.jsx)(k.A,{guildId:l,role:e,size:24}),(0,n.jsxs)("div",{className:R.fk,children:[(0,n.jsx)(m.E,{variant:"body-md/medium",color:"text-strong",className:R.CF,children:e.name}),void 0!==e.description?(0,n.jsx)(m.E,{variant:"body-xs/normal",color:"text-default",className:R.Xr,children:e.description}):null]}),(0,n.jsx)(j.Ay,{showUserPopout:!1,guildId:l,users:a.map(()=>null),renderUser:(e,l,t)=>(0,n.jsx)(i.Fragment,{children:a[t]},t),max:3})]},e.id)})})})}}