Loading
function(e,t,n){n.d(t,{z9:()=>eF,w_:()=>eO,Ay:()=>eV,th:()=>eG});var l=n(627968),s=n(64700),i=n(503698),a=n.n(i),r=n(284009),o=n.n(r),u=n(936504),d=n(562708),c=n(837381),m=n(172218),h=n(612324),p=n(535185),f=n(148839),g=n(607399),A=n(17928),x=n(780645),C=n(990078),v=n(97808),E=n(939249),T=n(821609),j=n(952270),S=n(428678),_=n(661531),N=n(549254),y=n(574553);function R(e){let{as:t,muted:n=!1,selected:s=!1,className:i,...r}=e,o=t??E.D;return(0,l.jsx)(o,{...r,className:a()(y.bG,i,{[y.SU]:n,[y.wH]:s})})}var I=n(778712),b=n(192308),M=n(789645),w=n(308528),U=n(442433),O=n(765671),D=n(960076),P=n(397244),k=n(714114),L=n(394871),F=n(709066),G=n(262295),V=n(620982),B=n(343328);let H=(0,n(945810).mj)({kind:"user",name:"2026-02-channel-wave-button",defaultConfig:{enabled:!1,showClose:!0},variations:{1:{enabled:!0,showClose:!1},2:{enabled:!0,showClose:!0}}});var Q=n(963027),W=n(571694),z=n(47167),q=n(989349),Z=n.n(q),K=n(691540),Y=n(857250),X=n(97483),$=n(720149),J=n(976860),ee=n(74114),et=n(232835),en=n(994500),el=n(58703),es=n(935208),ei=n(330001),ea=n(652215),er=n(381941),eo=n(375708),eu=n(449582),ed=n(351952),ec=n(88686),em=n(174755),eh=n(187322),ep=n(586893);let ef=s.forwardRef(function(e,t){let{className:n,focusProps:s,...i}=e;return(0,l.jsx)(eh.vN,{...s,children:(0,l.jsx)("li",{className:a()(n,ep.k),...i,ref:t})})});var eg=n(824994),eA=n(922301),ex=n(368919),eC=n(414808),ev=n(302005),eE=n(954376),eT=n(534400),ej=n(854627),eS=n(616356),e_=n(290863),eN=n(222823),ey=n(741961),eR=n(543465),eI=n(287809),eb=n(19575),eM=n(330076);let ew=eb.Ay.getEnableHardwareAcceleration()?v.Js:v.eu,eU={offset:{top:2,bottom:2,right:4}},eO=e=>{let{nameplate:t,icon:n,forceShow:s=!1,reducedClickTarget:i=!1,visibleElementRef:r,...o}=e,u=(0,ed.K)(t);return(0,l.jsx)(E.D,{className:a()(eM.b,{[eM.DQ]:null!=t,[eM.by]:s,[eM.wY]:i}),style:u,...o,focusProps:{offset:{top:-2,bottom:-2,left:-2,right:6}},children:(0,l.jsx)("div",{ref:r,className:a()({[eM.PJ]:null!=t}),children:(0,l.jsx)(n,{size:"sm",color:"currentColor",className:a()(eM.ut,{[eM.Uq]:null!=t})})})})},eD=e=>{let{onClick:t,channelName:n,showNameplate:s}=e,{enabled:i}=H.useConfig({location:"Wave CTA"});return i?(0,l.jsx)("div",{className:eM.KQ,children:(0,l.jsx)(C.m,{text:eo.intl.formatToPlainString(eo.t.m0zYbV,{username:n}),children:(0,l.jsx)(T.$,{size:"sm",variant:s?"overlay-secondary":"secondary",onClick:t,text:eo.intl.string(eo.t.pVlP58)})})}):null},eP=()=>(0,l.jsx)(j.G,{size:"xs",color:"currentColor",className:eM.wB}),ek=()=>(0,l.jsx)(S.K,{size:"xs",color:"currentColor",className:eM.wB});function eL(e){let{eventTargetRef:t,isNitro:n,contentWidth:i,hoverGradientStart:a,hoverGradientMiddle:r,hoverGradientEnd:o}=e,u=s.useMemo(()=>null!=a&&null!=r&&null!=o?{Color_GradientCenter:a,Color_InnerRing:r??_.A.colors.NITRO_TAB_GRADIENT_INNER_RING??r,Color_OuterRing:o,NitroVFX:!1}:n?{Color_GradientCenter:_.A.colors.NITRO_TAB_GRADIENT_CENTER,Color_InnerRing:_.A.colors.NITRO_TAB_GRADIENT_INNER_RING,Color_OuterRing:_.A.colors.NITRO_TAB_GRADIENT_OUTER_RING,NitroVFX:!0}:{Color_GradientCenter:_.A.colors.STANDARD_TAB_GRADIENT_CENTER,Color_InnerRing:_.A.colors.STANDARD_TAB_GRADIENT_INNER_RING,Color_OuterRing:_.A.colors.STANDARD_TAB_GRADIENT_OUTER_RING,NitroVFX:!1},[n,a,r,o]);return(0,l.jsx)(N.U,{eventTargetRef:t,className:eM.a1,dataBinding:{...u,DimmerWidth:(i??0)+32}})}let eF=e=>{let{route:t,selected:n,icon:i,iconClassName:r,interactiveClassName:o,text:d,children:c,locationState:m,onClick:h,className:p,role:f,"aria-posinset":A,"aria-setsize":x,listItemRef:C,showHoverGradient:v=!1,nitroHoverGradient:E=!1,hoverGradientStart:T,hoverGradientMiddle:j,hoverGradientEnd:S,..._}=e,{width:N,ref:y}=(0,O.Ay)(),I=s.useRef(null),b=C??I;return(0,l.jsx)(ef,{className:a()(eM.Ix,{[eM.Ij]:g.Fr},p),onClick:h,role:f,focusProps:{within:!0,...eU},"aria-posinset":A,"aria-setsize":x,ref:b,children:(0,l.jsxs)(R,{as:"div",selected:n,className:a()(o,eM.bG,eM.$J,{[eM.Q2]:n}),children:[v&&(0,l.jsx)(eL,{eventTargetRef:b,isNitro:E,contentWidth:N,hoverGradientStart:T,hoverGradientMiddle:j,hoverGradientEnd:S}),(0,l.jsxs)(u.N_,{to:{pathname:t,state:m},className:eM.nf,..._,children:[(0,l.jsx)(G.A,{ref:v?y:void 0,muted:!1,avatar:(0,l.jsx)(i,{size:"refresh_sm",className:a()(eM.e_,r),color:"currentColor"}),name:d,innerClassName:eM.xx}),c]})]})})};function eG(e){let{channel:t,selected:i=!1,user:r,activities:g,applicationStream:C,voiceChannel:v,isTyping:E,status:T,isMobile:j,isVR:S,nameplate:_,ref:N,"aria-posinset":y,"aria-setsize":O}=e,[k,q]=s.useState(!1),[eu,ed]=s.useState(!1),[eh,ep]=s.useState(!1),eS=s.useRef(null),[e_,ey]=s.useState(!1),eI=(0,m.K)(s.useCallback(e=>{ey(e)},[])),eb=s.useRef(null),eL=N??eb,eF=(0,h.A)(eL,eI),{showMenuItemPopover:eG,markMenuItemPopoverAsDismissed:eV}=(0,ev.z)({location:"PrivateChannel",isChannelSelected:!0===i,isTargetInViewport:e_,channelType:t.type}),{avatarSrc:eB,avatarDecorationSrc:eH,eventHandlers:eQ}=(0,ej.A)({userId:r?.id,size:I._3.SIZE_32,animateOnHover:!(i||k||eu||eh)}),[eW,ez]=s.useState({maskImage:"none"}),eq=s.useRef(null),eZ=t.isMultiUserDM(),eK=t.isSystemDM(),eY=!eZ&&!eK&&t.type===ea.rbe.DM,eX=eY&&r?.primaryGuild!=null,e$=(0,A.bG)([eR.Ay],()=>eR.Ay.isChannelMuted(t.getGuildId(),t.id)),{ignored:eJ,blocked:e0}=(0,A.cf)([en.A],()=>({ignored:en.A.isIgnored(t.getRecipientId()),blocked:en.A.isBlocked(t.getRecipientId())})),e1=eY&&eJ,e2=eY&&e0,e3=(e$||e1||e2)&&!(i||k),e6=(0,A.bG)([eN.Ay],()=>eN.Ay.getMentionCount(t.id)>0),e5=(0,z.Ay)(t),e4=s.useRef(null),e8=null!=_&&(i||k||eh),e7=()=>{q(!0)},e9=()=>{q(!1)},te=()=>{ed(!0)},tt=()=>{ed(!1)},tn=function(e){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];null!=e&&(e.preventDefault(),e.stopPropagation()),w.A.closePrivateChannel(t.id,i,n)},tl=()=>{w.A.preload(ea.ME,t.id)},ts=e=>{e.stopPropagation()},ti=e=>{e.target===e.currentTarget&&eS.current?.click()},ta=e=>{let s="contextmenu"===e.type?d.ImpressionNames.DM_LIST_RIGHT_CLICK_MENU_SHOWN:d.ImpressionNames.DM_LIST_KEBAB_MENU_SHOWN;ep(!0),t.isMultiUserDM()?(0,U.L3)(e,async()=>{let{default:e}=await Promise.all([n.e("26132"),n.e("46652"),n.e("93190"),n.e("91763"),n.e("38730"),n.e("34971"),n.e("42339"),n.e("12520"),n.e("46149"),n.e("53416"),n.e("60200")]).then(n.bind(n,4027));return n=>(0,l.jsx)(e,{...n,channel:t,selected:i})},{impressionName:s,noBlurEvent:!0,onClose:()=>ep(!1)}):(0,U.L3)(e,async()=>{let{default:e}=await Promise.all([n.e("13878"),n.e("6274"),n.e("23531"),n.e("12697"),n.e("26132"),n.e("46652"),n.e("93190"),n.e("34552"),n.e("93103"),n.e("8757"),n.e("91763"),n.e("89673"),n.e("85968"),n.e("68403"),n.e("29787"),n.e("71210"),n.e("82073"),n.e("97558"),n.e("88342"),n.e("91994"),n.e("38730"),n.e("42451"),n.e("76665"),n.e("98965"),n.e("35313"),n.e("76273"),n.e("36564"),n.e("34971"),n.e("45996"),n.e("52229"),n.e("792"),n.e("92822"),n.e("23427"),n.e("29422"),n.e("9291"),n.e("38056"),n.e("7059"),n.e("8829"),n.e("42339"),n.e("98199"),n.e("41175"),n.e("60816"),n.e("39778")]).then(n.bind(n,385913));return n=>(0,l.jsx)(e,{...n,user:r,channel:t,channelSelected:i})},{impressionName:s,onClose:()=>ep(!1)})},tr=e=>{e.preventDefault(),e.stopPropagation();let s=eo.intl.formatToPlainString(eo.t.hJ5Ap4,{name:e5}),i=eo.intl.format(eo.t.SSIVOu,{name:e5});t.isManaged()&&(s=eo.intl.formatToPlainString(eo.t.hVGjEW,{name:e5}),i=eo.intl.format(eo.t.IK1Qvs,{name:e5})),(0,b.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("70588"),n.e("37803")]).then(n.bind(n,148166));return t=>(0,l.jsx)(e,{title:s,body:i,onSubmit:tn,...t})})},to=(0,l.jsx)(ex.A,{userName:e5,displayNameStyles:r?.displayNameStyles,effectDisplayType:k||i||eh?eA.G.ANIMATED:eA.G.PLAIN,loop:k,boldFontOpacity:.9}),tu=eX?(0,l.jsxs)(l.Fragment,{children:[to,(0,l.jsx)(eT.Ay,{primaryGuild:r?.primaryGuild,userId:r?.id,inline:!0,disableGuildProfile:!0,className:a()(eM.fc,{[eM.Y_]:e3})})]}):to,td=s.useRef(null),tc=(0,eg.W)({location:"PrivateChannel"})&&r?.displayNameStyles!=null,{isIncomingCall:tm,isOngoingCall:th}=(0,V.A)(t.id),tp=[(0,Q.Ay)({channel:t,unread:e6,isIncomingCall:tm,isOngoingCall:th}),(0,Q.r2)({channel:t,muted:e$,userStatus:T})].filter(Boolean).join(", "),tf=(0,A.bG)([eN.Ay],()=>eN.Ay.lastMessageId(t.id)),{waveShouldShow:tg,wavePressed:tA}=function(e,t){let[n,l]=s.useState(!1),i=s.useCallback(async()=>{if(!n){l(!0),(0,ei.W)({channelId:e.id,source:"DM Channel"}),(0,J.pX)(ea.BVt.CHANNEL(ea.ME,e.id));try{await $.A.sendStickers(e.id,["749054660769218631"],"",{location:er.Hx.SEND_WAVE})}catch(e){e.ok||429!==e.status||(0,K.P0)((0,Y.o)(eo.intl.string(eo.t.Whhv4w),X.Ck.FAILURE))}l(!1)}},[e.id,n]),a=e.isDM()&&!e.isSystemDM()&&!e.rawRecipients.some(e=>e.bot),r=a?e.getRecipientId():null,o=(0,A.bG)([en.A],()=>null!=r&&en.A.isFriend(r)),u=(0,A.bG)([en.A],()=>null!=r&&en.A.isIgnored(r)),d=(0,A.bG)([et.A],()=>{let t=et.A.getMessages(e.id);return 1===t.length&&t.first()?.type===ea.lAJ.FRIEND_REQUEST_ACCEPTED}),c=es.default.extractTimestamp(e.id),m=(0,el.v0)(Z()(),Z()(c),18144e5),h=(0,ee.l)(e.id);return{waveShouldShow:a&&o&&!u&&(null==t||d)&&m&&null==h,wavePressed:i}}(t,tf),{showClose:tx}=H.useConfig({location:"PrivateChannel"}),tC=(0,f.A)(()=>{let e=eq.current?.getBoundingClientRect()??null,t=td.current?.getBoundingClientRect()??null;if(null==t||null==e||e.width+44-t.width<=0)return void ez({maskImage:"none"});let n=t.width-16;ez({maskImage:`linear-gradient(to right, rgba(0, 0, 0, 1) 0, rgba(0, 0, 0, 1) ${n}px, rgba(0, 0, 0, 0))`})});return s.useLayoutEffect(tC,[k,i,tC]),(0,p.g)(eL,tC),(0,l.jsx)(c.tG,{id:t.id,children:e=>{let{role:n,...s}=e;return(0,l.jsxs)(ef,{className:a()(eM.Ix,eM.dm),role:n,focusProps:{...eU,focusTarget:eS,ringTarget:eL},ref:eF,onMouseEnter:e7,onMouseLeave:e9,onMouseDown:tl,onFocus:te,onBlur:tt,onContextMenu:ta,"aria-setsize":O,"aria-posinset":y,children:[e6?(0,l.jsx)("div",{className:a()(eM.dM,{[eM.SU]:e3})}):null,(0,l.jsxs)(R,{className:a()(eM.bG,{[eM.Q2]:i||eh}),as:"div",onClick:ti,muted:e3,selected:i,children:[(0,l.jsx)(em.A,{nameplate:e8?_:void 0,selected:i,hovered:k,content:td,placement:ec.u.CHANNEL}),(0,l.jsx)("div",{className:eM.lU,ref:eq,children:tu}),(0,l.jsx)(u.N_,{style:eW,innerRef:eS,to:ea.BVt.CHANNEL(ea.ME,t.id),className:eM.nf,"aria-label":tp,...s,children:(0,l.jsx)(G.A,{ref:td,avatar:(()=>{let e=I._3.SIZE_32;if(t.isMultiUserDM())if(t.recipients.length>=2&&null==t.icon)return(0,l.jsx)(eE.A,{"aria-hidden":!0,recipients:t.recipients,size:e,isTyping:E,status:T});else return(0,l.jsx)(ew,{...eQ,src:(0,W.Y)(t),"aria-hidden":!0,size:e,status:E?ea.clD.ONLINE:T,isTyping:E});o()(null!=r,"PrivateChannel.renderAvatar: Invalid prop configuration - no user or channel");let n=null;return r.isSystemUser()||(n=(0,D.A)(g)?ea.clD.STREAMING:T),(0,l.jsx)(ew,{...eQ,size:I._3.SIZE_32,src:eB,avatarDecoration:eH,status:n,isMobile:j,isVR:S,isTyping:E,"aria-label":r.username,statusTooltip:!0})})(),highlighted:e6&&!e3,muted:e3,subText:t.isSystemDM()?(0,l.jsx)("div",{className:eM.W$,children:(0,B.A)(t.id)?eo.intl.string(eo.t.FL5T01):eo.intl.string(eo.t.NnY5lc)}):t.isMultiUserDM()?(0,l.jsx)("div",{className:eM.W$,children:eo.intl.format(eo.t.CxSA5N,{members:t.recipients.length+1})}):(0,P.A)({activities:g,status:T,applicationStream:C,voiceChannel:v})?(0,l.jsx)(L.A,{user:r,activities:g,voiceChannel:v,applicationStream:C,animateEmoji:k||eu||eh,textClassName:eM.XD,iconClassName:e3?eM.tG:void 0}):null,name:(0,l.jsx)(x.A,{className:a()(eM.uN,{[eM.e8]:tc}),children:tu}),decorators:t.isSystemDM()?(0,l.jsx)(F.A,{className:eM.G$,type:F.A.Types.SYSTEM_DM,verified:!0}):null,withDisplayNameStyles:tc})}),(0,l.jsxs)("div",{className:a()(eM._q,{[eM.EY]:e8}),children:[e1?(0,l.jsx)(eP,{}):null,e2?(0,l.jsx)(ek,{}):null,tg&&null!=e5?(0,l.jsx)(eD,{channelName:e5,onClick:tA,showNameplate:e8}):null,tx||!tg?(0,l.jsx)(eO,{icon:M.P,"aria-label":eZ?eo.intl.string(eo.t["26C4oi"]):eo.intl.string(eo.t.jsvgc3),onClick:eZ?tr:tn,onMouseDown:ts,nameplate:_,reducedClickTarget:!0,visibleElementRef:e4}):null]})]}),eG&&(0,l.jsx)(eC.A,{targetElementRef:eL,markMenuItemPopoverAsDismissed:eV})]})}})}let eV=21552==n.j?e=>{let{channel:t,selected:n,...s}=e,i=(0,A.bG)([eI.default],()=>eI.default.getUser(t.getRecipientId())),a=i?.id,r=(0,A.cf)([e_.A,eS.A],()=>{let e;if(t.isMultiUserDM()){let n=e_.A.getState().statuses;t.recipients.some(e=>n[e]===ea.clD.ONLINE)&&(e=ea.clD.ONLINE)}else null!=a&&(e=e_.A.getStatus(a));return{status:e,activities:null!=a?e_.A.getActivities(a):null,applicationStream:null!=a?eS.A.getAnyStreamForUser(a):null,isMobile:null!=a&&e_.A.isMobileOnline(a),isVR:null!=a&&e_.A.isVROnline(a)}},[t,a]),{voiceChannel:o}=(0,k.A)({userId:a}),u=(0,eu.r)({user:i}),d=(0,A.bG)([eI.default,ey.A],()=>t.isMultiUserDM()?es.default.keys(ey.A.getTypingUsers(t.id)).some(e=>e!==eI.default.getCurrentUser()?.id):null!=i&&ey.A.isTyping(t.id,t.getRecipientId()),[t,i]);return t.isMultiUserDM()?(0,l.jsx)(eG,{channel:t,selected:n,isTyping:d,status:r.status===ea.clD.ONLINE?ea.clD.ONLINE:void 0,...s}):(0,l.jsx)(eG,{channel:t,selected:n,user:i,voiceChannel:o,isTyping:d,nameplate:u,...s,...r})}:null}