Loading
function(e,t,n){n.d(t,{g:()=>lb,A:()=>lO}),n(321073);var i=n(627968),l=n(64700),s=n(503698),a=n.n(s),r=n(735438),o=n.n(r),u=n(158390),c=n(17928),d=n(554146),h=n(451988),m=n(97808),p=n(778712),f=n(922016),g=n(939249),A=n(140735),x=n(312138);if(21552==n.j)var C=n(192308);var E=n(442433),v=n(820284),T=n(717558),_=n(964486),N=n(220839),j=n(397244),S=n(394871),y=n(308186),R=n(866323),I=n(449450);function b(e){let{text:t}=e,n=(0,R.p)(t,{from:{opacity:0,transform:"translate3d(0, 107%, 0)"},enter:{opacity:1,transform:"translate3d(0, 0, 0)"},config:{duration:220,clamp:!0}});return(0,i.jsx)("div",{className:I.k,children:n((e,t)=>(0,i.jsx)(y.animated.div,{className:I.H,style:e,children:t}))})}var M=n(29160),w=n(793574),O=n(688810),U=n(521502),D=n(380610),k=n(313961),P=n(18235),L=n(183184),F=n(384059),G=n(480890),V=n(601255),B=n(562819),H=n(449582),Q=n(351952),W=n(88686),q=n(174755),z=n(302223),Z=n(609425),K=n(922301),$=n(660184),Y=n(643501),X=n(534514),J=n(834730),ee=n(789645),et=n(826673),en=n(750506),ei=n(780964),el=n(766075),es=n(417146),ea=n(552122),er=n(717421),eo=n(775602),eu=n(993843);let ec={mass:10,tension:550,friction:140};function ed(e){let{className:t,pageMultiplier:n}=e,s=(0,c.bG)([eo.Ay],()=>eo.Ay.useReducedMotion),[r,u]=l.useState({x:0,y:0}),d=l.useMemo(()=>o().throttle(e=>{s||u({x:(window.innerWidth-e.pageX*n)/90,y:(window.innerHeight-e.pageY*n)/90})},20),[n,s]);l.useEffect(()=>(window.addEventListener("mousemove",d),()=>window.removeEventListener("mousemove",d)),[d]);let[h,m]=(0,er.z)(()=>({x:0,y:0,config:ec}));return l.useEffect(()=>{m({x:r.x,y:r.y})},[r.x,r.y,m]),(0,i.jsx)(y.animated.div,{style:{transform:(0,y.to)([h.x,h.y],(e,t)=>`translate3d(${e}px, ${t}px, 0)`)},className:a()(eu.T,t)})}var eh=n(49999),em=n(375708),ep=n(275883);function ef(e){let{dismissibleContent:t,backgroundColor:n,specialTextColor:l}=e,s=ea.A.useIsEligible(),a=(0,et.JZ)(t),r=null!=n,o=null!=l?{color:l}:void 0,{analyticsLocations:u}=(0,O.Ay)(w.A.HOLIDAY_COACHMARK);function c(e){(0,et.Dr)(t,{dismissAction:e})}function d(){(0,el.openUserSettings)(ei.X.NOTIFICATIONS_PANEL,{analyticsLocations:u}),c(eh.i.TAKE_ACTION)}return s&&!a?(0,i.jsx)(en.Ay,{children:(0,i.jsxs)("div",{className:ep.iE,style:{backgroundColor:r?n:void 0},children:[!r&&(0,i.jsxs)("div",{className:ep.o5,children:[(0,i.jsx)(ed,{className:ep.iL,pageMultiplier:5}),(0,i.jsx)("div",{className:ep.Np})]}),(0,i.jsx)("div",{className:ep.c8}),(0,i.jsxs)("div",{className:ep.Qs,children:[(0,i.jsxs)("div",{children:[(0,i.jsx)(X.D,{variant:"heading-md/bold",color:null!=o?void 0:"always-white",style:o,children:em.intl.string(em.t["6CxPoB"])}),(0,i.jsx)(J.E,{variant:"text-xs/normal",color:"always-white",children:em.intl.format(em.t.IVzJ8G,{settingsHook:(e,t)=>(0,i.jsx)(g.D,{tag:"span",className:ep.nf,style:o,onClick:d,children:e},t)})})]}),(0,i.jsx)(g.D,{className:ep.l2,onClick:()=>c(eh.i.USER_DISMISS),children:(0,i.jsx)(ee.P,{color:"currentColor",size:"xs"})})]})]})}):null}function eg(){return null==es.A.coachmarkDismissibleContent?null:(0,i.jsx)(ef,{dismissibleContent:es.A.coachmarkDismissibleContent,backgroundColor:es.A.coachmarkBackgroundColor,specialTextColor:es.A.coachmarkSpecialTextColor})}var eA=n(74848),ex=n(607399),eC=n(707554),eE=n(224640),ev=n(305866),eT=n(364522),e_=n(22231),eN=n(133171),ej=n(780338);if(21552!=n.j)var C=n(192308);var eS=n(980707),ey=n(26137),eR=n(473935),eI=n(765671),eb=n(783041),eM=n(457965),ew=n(176781),eO=n(812993),eU=n(320448),eD=n(993401),ek=n(447349);function eP(e){return(0,i.jsx)("div",{className:ek.wE,children:(0,i.jsx)(eS.W,{"data-menu-migrated":!0,variant:"fixed",hideScroller:!0,onSelect:void 0,...e})})}function eL(e){let{action:t,onClick:n,icon:s,label:a,sublabel:r,trailing:o,renderSubmenu:u,ref:c,submenuTargetElementRef:d,submenuAlign:h}=e,m=null!=n,p=(0,eD.rE)({action:t,onClick:n}),[A,x]=l.useState(!1),E=l.useRef(null),v=c??E,T=null!=u,_=T&&m,N=l.useCallback(()=>{x(!0)},[]),j=l.useCallback(()=>{(0,C.hasAnyModalOpen)()||x(!1)},[]);function S(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:ek.iA,children:(0,i.jsx)(s,{size:"xs",color:"currentColor"})}),(0,i.jsxs)("div",{className:ek.$H,children:[(0,i.jsxs)("div",{children:[(0,i.jsx)(J.E,{color:"currentColor",variant:"text-sm/medium",className:ek.W1,children:a}),(0,i.jsx)(J.E,{color:"currentColor",variant:"text-xs/medium",children:r})]}),o]})]})}function y(e){let t;return t=_?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(g.D,{className:ek.ef,onClick:p,children:S()}),(0,i.jsx)(g.D,{className:ek.ap,"aria-label":em.intl.string(em.t.PdRCRg),...e,onClick:N,children:(0,i.jsx)(eU._,{size:"xs",color:"currentColor"})})]}):T?(0,i.jsxs)(g.D,{className:ek.ef,...e,onClick:N,children:[S(),(0,i.jsx)("div",{className:ek.ap,children:(0,i.jsx)(eU._,{size:"xs",color:"currentColor"})})]}):(0,i.jsx)(g.D,{className:ek.ef,onClick:p,children:S()}),(0,i.jsx)("div",{ref:v,className:ek.jG,children:t})}return T?(0,i.jsx)("li",{className:ek.j$,onMouseEnter:N,onMouseLeave:j,children:(0,i.jsx)(f.Y,{targetElementRef:d??v,align:h,spacing:0,renderPopout:u,shouldShow:A,onRequestClose:j,children:y})}):(0,i.jsx)("li",{className:ek.j$,children:y()})}function eF(e){let{children:t,"aria-label":n}=e;return(0,i.jsx)("ul",{"aria-label":n,children:t})}var eG=n(734066),eV=n(274372),eB=n(334686),eH=n(409067),eQ=n(271597),eW=n(990078),eq=n(475358),ez=n(408278),eZ=n(625903),eK=n(404778),e$=n(689175),eY=n(821609),eX=n(532624),eJ=n(927813),e0=n(879631),e1=n(350535),e2=n(372684),e3=n(974293),e6=n(572164),e5=n(953932),e4=n(280483),e8=n(890856),e7=n(713517),e9=n(609174),te=n(619744);function tt(e){let{onBeforeEdit:t,variant:n="primary"}=e,s=(0,e9.Y_)(),a=l.useCallback(e=>{e.stopPropagation(),e.preventDefault(),t?.(),(0,eQ.p)({initialEditingClipId:s.id})},[s,t]);return(0,i.jsx)(eY.$,{onClick:a,icon:e_.R,variant:n,size:"sm",text:em.intl.string(em.t.bt75uw),fullWidth:!0})}var tn=n(82716),ti=n(585579),tl=n(226870),ts=n(285072),ta=n(316305);let tr=l.memo(function(e){let{clip:t,isNew:n,onClose:s,className:r}=e,o=l.useRef(null),{isHoveringOrFocusing:u}=(0,e7.A)(o),c=l.useCallback(()=>{s?.(),(0,eQ.p)({initialEditingClipId:t.id})},[t.id,s]);return(0,i.jsx)(e9.Cl,{clip:t,children:(0,i.jsx)(e8.s,{ref:o,"aria-label":em.intl.string(em.t.bt75uw),onClick:c,className:a()(ta.Z1,r),children:(0,i.jsxs)(tl.d,{isStatic:!0,children:[n&&(0,i.jsx)(eO.Lp,{className:ta.Ad,text:em.intl.string(em.t.y2b7CA)}),(0,i.jsxs)(ts.h,{isVisible:u,className:ta.Lw,children:[(0,i.jsxs)("div",{className:ta.mY,children:[(0,i.jsx)(tn.z,{}),(0,i.jsx)(te.k,{})]}),(0,i.jsxs)("div",{className:ta.E_,children:[(0,i.jsx)(tt,{onBeforeEdit:s,variant:"overlay-secondary"}),(0,i.jsx)(ti.E,{})]})]})]})})})});var to=n(652215),tu=n(753070),tc=n(16590),td=n(550350);function th(e){let{onOpenGallery:t,onOpenSettings:n,onClose:s,setPopoutRef:a}=e;(0,e4.A)();let r=(0,c.yK)([eV.Ay],()=>Object.values(eV.Ay.getClips())),o=(0,c.bG)([eV.Ay],()=>eV.Ay.getSettings()),u=(0,c.bG)([eV.Ay],()=>eV.Ay.getNewClipIds()),d=(0,e3.aJ)("ClipsPopout"),h=(0,c.bG)([eV.Ay],()=>eV.Ay.getEnableAutoclipping()),m=(0,c.bG)([eX.Ay],()=>eX.Ay.getKeybindForAction(to.hCu.SAVE_CLIP)),p=l.useRef(null),{enabled:f}=eB.O.useConfig({location:"ClipsPopout"}),g=f&&!o.showPovClipsInGallery,A=l.useMemo(()=>{let e=r.filter(e=>e.type===e2.nQ.CLIP&&""!==e.thumbnail&&(!g||!(0,eH.kD)(e)));return e.sort((e,t)=>t.createdAt-e.createdAt),e},[r,g]),x=l.useMemo(()=>A.slice(0,16),[A]),C=A.length>16,E=null!=m?e1.dI(m.shortcut,!0):null,v=[(0,e0.$)(o.clipsLength/eJ.A.Millis.SECOND),(0,tu.zr)(o.clipsQuality.resolution),em.intl.formatToPlainString(em.t.Qb44XH,{fps:o.clipsQuality.frameRate})];return d&&v.push(em.intl.string(tc.default.XWkJoi)),(0,i.jsxs)("div",{ref:e=>{p.current=e,a?.(e)},className:td.SW,role:"dialog","aria-label":em.intl.string(em.t.z2jK6X),children:[(0,i.jsxs)("div",{className:td.wx,children:[(0,i.jsxs)("div",{className:td.$,children:[(0,i.jsx)(X.D,{variant:"heading-md/semibold",color:"text-strong",children:em.intl.string(em.t.z2jK6X)}),null!=E&&(0,i.jsx)(eq.e,{className:td.P,shortcut:E})]}),(0,i.jsxs)("div",{className:td.$s,children:[(0,i.jsx)(eW.m,{text:em.intl.string(em.t["3D5yo/"]),children:(0,i.jsx)(ez.K,{onClick:()=>n(),icon:eZ.Z,size:"sm",variant:"icon-only","aria-label":em.intl.string(em.t["3D5yo/"])})}),(0,i.jsx)(eW.m,{text:em.intl.string(tc.default["55C2MH"]),children:(0,i.jsx)(ez.K,{onClick:()=>t(),icon:ew.x,size:"sm",variant:"icon-only","aria-label":em.intl.string(tc.default["55C2MH"])})})]})]}),(0,i.jsxs)("div",{className:td.ov,children:[v.map((e,t)=>(0,i.jsxs)(l.Fragment,{children:[t>0&&(0,i.jsx)("span",{className:td.LO,children:"\u2022"}),(0,i.jsx)(J.E,{variant:"text-xs/normal",color:"text-muted",tag:"span",className:td.c5,children:e})]},e)),d&&(0,i.jsx)(J.E,{variant:"text-xs/semibold",color:h?"text-strong":"text-feedback-critical",tag:"span",className:td.wS,children:h?em.intl.string(tc.default.lTwKmt):em.intl.string(tc.default.GNDqtf)})]}),(0,i.jsx)(eK.c,{}),x.length>0?(0,i.jsxs)(e$.Ch,{className:td.Vg,fade:!0,disableFocusRingScope:!0,children:[x.map(e=>(0,i.jsx)(tr,{clip:e,isNew:u.includes(e.id),onClose:s},e.id)),C&&(0,i.jsx)("div",{className:td.qr,children:(0,i.jsx)(eY.$,{onClick:()=>t(),text:em.intl.string(tc.default["55C2MH"]),variant:"secondary",size:"sm"})})]}):(0,i.jsx)(tm,{keybindString:E})]})}function tm(e){let{keybindString:t}=e,n=(0,e6.Et)();return(0,i.jsxs)("div",{className:td.p$,children:[(0,i.jsx)(J.E,{variant:"text-md/medium",color:"text-default",className:td.qO,children:em.intl.string(tc.default.mjfghy)}),n?null!=t&&(0,i.jsx)(J.E,{variant:"text-sm/medium",color:"text-muted",className:td.CZ,children:em.intl.format(tc.default.y4zC7j,{protipHook:e=>(0,i.jsx)(J.E,{variant:"text-sm/medium",color:"text-feedback-positive",tag:"span",children:e},"protip"),keybind:(0,i.jsx)(eq.e,{shortcut:t})})}):(0,i.jsx)(e5.A,{})]})}function tp(e){let{onClose:t,popoutContainerRef:n}=e,s=(0,eG.sw)(),{enabled:a}=eB.O.useConfig({location:"ClipsUserStatusMenuItem"}),r=(0,c.bG)([eV.Ay],()=>eV.Ay.getSettings().showPovClipsInGallery),o=a&&!r,u=(0,c.bG)([eV.Ay],()=>{let e=eV.Ay.getNewClipIds();return o?e.filter(e=>{let t=eV.Ay.getClipById(e);return null!=t&&!(0,eH.kD)(t)}).length:e.length},[o]),d=l.useCallback(e=>{t(),(0,eQ.p)({initialEditingClipId:e})},[t]),h=l.useCallback(()=>{t(),(0,el.openUserSettings)(ei.X.CLIPS_PANEL)},[t]);return s?(0,i.jsx)(eL,{action:"PRESS_CLIPS",icon:ew.x,label:em.intl.string(em.t.z2jK6X),trailing:u>0?(0,i.jsx)(eO.hV,{count:u}):null,onClick:()=>d(),submenuTargetElementRef:n,submenuAlign:"bottom",renderSubmenu:e=>(0,i.jsx)(th,{...e,onOpenGallery:d,onOpenSettings:h,onClose:t})}):null}var tf=n(480335),tg=n(577390),tA=n(474257),tx=n(31956),tC=n(744808),tE=n(645507),tv=n(970931),tT=n(315710),t_=n(832248),tN=n(462887),tj=n(736653),tS=n(439174),ty=n(428262),tR=n(878784),tI=n(788868);function tb(){let e=(0,tR.Xb)(),t=(0,ty.nK)();if(null==e||!t)return null;let n=new Date().getTime();for(let t=tI.sp.length-1;t>=0;t--){let i=tI.VD[tI.sp[t]],l=new Date(e);if(l.setMonth(e.getMonth()+i.tenureReqNumMonths),l.setHours(l.getHours()+30),n>l.getTime())if(n-l.getTime()<6048e5)return i.id;else break}return null}let tM={[tI.Ac.PREMIUM_TENURE_1_MONTH]:{dark:" #D76C1F, #F79C53",light:" #8E2A0B, #D4681C"},[tI.Ac.PREMIUM_TENURE_3_MONTH]:{dark:" #8F9E9E, #C0CBD1",light:" #53555F, #697979"},[tI.Ac.PREMIUM_TENURE_6_MONTH]:{dark:" #ED8200, #FFCE46",light:" #744400, #CC7000"},[tI.Ac.PREMIUM_TENURE_12_MONTH]:{dark:" #36AAFF, #7BE7CB",light:" #006394, #0089EB"},[tI.Ac.PREMIUM_TENURE_24_MONTH]:{dark:" #8670FF, #C2BDFF",light:" #5423CC, #8670FF"},[tI.Ac.PREMIUM_TENURE_36_MONTH]:{dark:" #009423, #67FF33",light:" #005C15, #009E25"},[tI.Ac.PREMIUM_TENURE_60_MONTH]:{dark:" #E83068, #FF8F70",light:" #881141, #DD1852"},[tI.Ac.PREMIUM_TENURE_72_MONTH]:{dark:" #829AE8, #DDB4FF, #A2D6FF",light:" #6881D4, #956CB8, #5491A0"}},tw={[tI.Ac.PREMIUM_TENURE_1_MONTH]:{dark:"https://cdn.discordapp.com/assets/content/76b6239d8631db63ae8ddfae2959791fe02bcc550c376cb35d77ef9df1a62ee5.webm",light:"https://cdn.discordapp.com/assets/content/f09f5aa678c2d463109f0ca84a572646c1b6b21974865e84ac92f3c3a3f50b87.webm"},[tI.Ac.PREMIUM_TENURE_3_MONTH]:{dark:"https://cdn.discordapp.com/assets/content/333650072ffe3aa581594ad0a78d525ce57e9e34bd236acb81db8b75aa25df7c.webm",light:"https://cdn.discordapp.com/assets/content/adb6e9b17112ca46167a49c50860b17c3aae5f0e56be9c82baa62ffdd664ad24.webm"},[tI.Ac.PREMIUM_TENURE_6_MONTH]:{dark:"https://cdn.discordapp.com/assets/content/279e3118d1cfcc6cfa8decab76b4153e4c3c1eff8a2e77888ae51b96c7292888.webm",light:"https://cdn.discordapp.com/assets/content/e2d18cff69e5718d2836557c0089cf5056f5e833e25e28b6e98bdbc1503d726f.webm"},[tI.Ac.PREMIUM_TENURE_12_MONTH]:{dark:"https://cdn.discordapp.com/assets/content/74b1267eebcf0dcd18ac9fb16c89d231604489cfa3d0eebcd71a4c24962e3538.webm",light:"https://cdn.discordapp.com/assets/content/20265cc95d50db21c86b4a217c967c535561fcb6bfa733df6ba1d0393ca5f980.webm"},[tI.Ac.PREMIUM_TENURE_24_MONTH]:{dark:"https://cdn.discordapp.com/assets/content/68ae410145a1ab508c52f2431e5f808b4cd60d89d74d41f07d6a85ce75106a2a.webm",light:"https://cdn.discordapp.com/assets/content/7aba50f994ce9e66bacabe14aafb881e43997136887f81054f1f025f032f7aea.webm"},[tI.Ac.PREMIUM_TENURE_36_MONTH]:{dark:"https://cdn.discordapp.com/assets/content/03f8fb27edf5fc0c15d71326623a871339eab9fc36316afab2fcce955049d726.webm",light:"https://cdn.discordapp.com/assets/content/566f4db88f64218ac2df0ac3af6bbc975dcd25044e5fdceb0ee8889b2b13c86c.webm"},[tI.Ac.PREMIUM_TENURE_60_MONTH]:{dark:"https://cdn.discordapp.com/assets/content/d2e0f57d4f0054e58fa2b13a28e2ccef6168ffd752760b84feff4da9b076912a.webm",light:"https://cdn.discordapp.com/assets/content/2bbcfd689cc2c402457c21c93b81c98537936d7e54ac6ac46d6a3133519b0101.webm"},[tI.Ac.PREMIUM_TENURE_72_MONTH]:{dark:"https://cdn.discordapp.com/assets/content/2d56eadb5dd14d8bc5d74a55d04cef85bfc2d083b6b0ea53f389c9f34993237a.webm",light:"https://cdn.discordapp.com/assets/content/c5e4aed8b111912db02d0aa12a73d162720f27aaf432000378344e94cde1ec65.webm"}};var tO=n(682165);let tU=l.lazy(()=>Promise.all([n.e("15323"),n.e("24832")]).then(n.bind(n,748579)));function tD(){let e=(0,c.bG)([eo.Ay],()=>eo.Ay.useReducedMotion),t=(0,t_.A)(e=>e.shouldRenderTenureLevelUp),n=function(){let e=tb(),t=(0,tN.M)((0,tj.Ay)());if(null==e)return null;let n=tM[e],i=tw[e],l={currentBadge:(0,tS.e0)(e),currentBadgeTextGradient:t?n?.dark:n?.light,levelUpVideoSrc:t?i?.dark:i?.light},s=tI.sp.indexOf(e);if(s>0){let e=tI.sp[s-1],n=tM[e];l.prevBadge=(0,tS.e0)(e),l.prevBadgeTextGradient=t?n?.dark:n?.light}return l}(),[s,a]=l.useState(null);return(null!=n&&null==s&&a(n),e||!t||null==s)?null:(0,i.jsx)(tk,{levelUpData:s})}function tk(e){let{levelUpData:t}=e,n=l.useRef(null),s=l.useCallback(()=>{t_.A.setState({shouldRenderTenureLevelUp:!1})},[]);return(0,i.jsx)(tT.O,{containerRef:n,children:(0,i.jsxs)("div",{className:tO.i,children:[(0,i.jsx)("div",{className:tO.b,children:(0,i.jsx)(eW.m,{text:em.intl.string(em.t.cpT0Cq),children:(0,i.jsx)(ez.K,{icon:ee.P,variant:"secondary",size:"sm",onClick:s,"aria-label":em.intl.string(em.t.cpT0Cq)})})}),(0,i.jsx)(l.Suspense,{fallback:null,children:(0,i.jsx)(tU,{levelUpData:t})})]})})}var tP=n(206835),tL=n(183555),tF=n(999291),tG=n(975732),tV=n(718019),tB=n(413492),tH=n(915614),tQ=n(744753),tW=n(559506),tq=n(646986),tz=n(349419),tZ=n(946356),tK=n(878555),t$=n(624479),tY=n(206845),tX=n(957565),tJ=n(427262),t0=n(962352);function t1(e){let{user:t,isVisible:n}=e,{trackUserProfileAction:l}=(0,tL.NJ)();return tX.p5?(0,i.jsx)(tY.A,{text:em.intl.string(em.t.y5MwJy),delay:0,"aria-label":!1,copyValue:tJ.Ay.getUserTag(t,{decoration:"never",identifiable:"always"}),onCopy:()=>l({action:"COPY_USERNAME"}),children:e=>(0,i.jsx)(g.D,{...e,className:a()(t0.c,{[t0.R]:n}),"aria-label":em.intl.string(em.t.y5MwJy),children:(0,i.jsx)(t$.T,{size:"xs",color:"currentColor"})})}):null}var t2=n(983495),t3=n(442228),t6=n(885386),t5=n(290863),t4=n(351906),t8=n(562153),t7=n(661531),t9=n(477782),ne=n(628284),nt=n(695366),nn=n(363195),ni=n(889227),nl=n(287809),ns=n(174459),na=n(429707),nr=n(274303),no=n(994125),nu=n(347853),nc=n(573879),nd=n(335020),nh=n(43105),nm=n(704824),np=n(46225),nf=n(429913),ng=n(379848),nA=n(633075),nx=n(735321),nC=n(667049),nE=n(606758),nv=n(495544),nT=n(403362),n_=n(518477);function nN(e){let{targetElementRef:t,onClose:n}=e,[s,a]=l.useState(!1),{trackUserProfileEditAction:r}=(0,tL.NJ)(),o=(0,c.bG)([nv.default],()=>nv.default.getId()),u=function(){let e,t,n=(0,c.bG)([nv.default],()=>nv.default.getId()),i=(0,nC.A)(n),s=l.useMemo(()=>i.filter(e=>e instanceof nA.R),[i]),a=(e=(0,eM.VA)({location:"UserProfileAccountPopoutApplicationWidgetCoachmark"}),l.useMemo(()=>e?.filter(e=>e.isEligibleForEditProfileUpsell()),[e])),r=l.useMemo(()=>a?.map(e=>e.applicationId)??[],[a]),o=(t=(0,nf.A)(r),l.useMemo(()=>t.filter(nT.Vq),[t])),{tokens:u,fetched:d}=(0,nm.j)(r),h=(0,np.U9)(o);return l.useMemo(()=>{if(null==a||null==u||!d)return null;let e=[],t=[];for(let n of a){let i=u.find(e=>e.application.id===n.applicationId),l=s.find(e=>e.applicationId===n.applicationId),a=o.find(e=>e.id===n.applicationId),r=h.find(e=>e.context.application.id===n.applicationId);if(null==a)return null;null!=i&&null==l?e.push({type:"linked",config:n,application:a,dismissibleContent:n.editProfileLinkedDc}):null==i&&r?.preferredFlow!=null&&t.push({type:"unlinked",config:n,application:a,dismissibleContent:n.editProfileUnlinkedDc,authFlow:r.preferredFlow})}return[...e,...t]},[a,u,d,s,o,h])}(),{analyticsLocations:d}=(0,O.Ay)();return null==u||0===u.length?null:(0,i.jsx)(ng.Ay,{contentTypes:u.map(e=>e.dismissibleContent),children:e=>{let{visibleContent:l,markAsDismissed:c}=e,h=u.find(e=>e.dismissibleContent===l);if(null==h)return null;let m="linked"===h.type;function p(){return(0,tG.openUserProfileModal)({userId:o,tabSection:n_.RP.WIDGETS}).then(()=>{c(eh.i.TAKE_ACTION),n()})}return(0,i.jsx)(nh.A,{targetElementRef:t,position:"right",gradientColor:"blue",graphic:null!=h.config.editProfileUpsellImage?{type:"image",src:h.config.editProfileUpsellImage}:void 0,title:em.intl.format(em.t.TXDztH,{applicationName:h.application.name}),body:m?em.intl.string(em.t["63Kso0"]):em.intl.string(em.t.HwXoeC),onRequestClose:()=>c(eh.i.USER_DISMISS),actions:[m?{text:em.intl.string(em.t.VSLDly),onClick:()=>{a(!0),p().then(()=>{let e;return e=new nA.R({applicationId:h.application.id}),void((0,nx.Y5)(e),r({action:"WIDGET_ADDED",...e.getProfileEditAnalyticsOptions()}),(0,nE.XA)(n_.jM.WIDGET_ADDED))}).finally(()=>a(!1))},loading:s}:{text:em.intl.string(em.t["DSJi3+"]),onClick:()=>{h.authFlow.initiate({onConfirm:()=>{a(!0),p().finally(()=>a(!1))},analyticsLocations:d})},loading:s}]})}})}var nj=n(661439),nS=n(385113),ny=n(188951),nR=n(334074),nI=n(90165);function nb(e){let{targetElementRef:t,onClose:s}=e,[a,r]=l.useState(!1),o=(0,c.bG)([nv.default],()=>nv.default.getId()),{eligibleApplications:u,markAsDismissed:h}=function(){let e=(0,c.yK)([nS.A],()=>nS.A.getFeaturedApplicationIds());(0,ny.A)(e),l.useEffect(()=>{(0,nj.X)()},[]);let t=(0,c.bG)([nv.default],()=>nv.default.getId()),n=(0,nC.A)(t),i=l.useMemo(()=>n.filter(e=>e instanceof nA.R),[n]),s=(0,nf.A)(e),a=l.useMemo(()=>s.filter(nT.Vq),[s]),r=(0,c.cf)([nI.A],()=>{let t={};for(let n of e){let e=a.find(e=>e.id===n)?.getCanonicalGameId();null!=e&&(t[n]=nI.A.getLastPlayedDateTime(e))}return t}),o=l.useMemo(()=>{let e=Date.now();return a.filter(t=>{if(i.some(e=>e.applicationId===t.id))return!1;let n=r[t.id];return null!=n&&e-n<7776e6})},[a,i,r]),{eligibleToShow:u,markAsDismissed:h}=(0,nR.hj)({applications:o,dismissibleContent:d.M.APP_WIDGET_V2_PROFILE_UPSELL_COACHMARK,cooldownConfig:nR.SH});return{eligibleApplications:l.useMemo(()=>o.filter(e=>u.includes(e.id)),[o,u]),markAsDismissed:h}}();return((0,l.useEffect)(()=>{0!==u.length&&Promise.all([n.e("69944"),n.e("56000"),n.e("4589"),n.e("64578"),n.e("60361"),n.e("49451"),n.e("81483"),n.e("70402"),n.e("29205"),n.e("73435"),n.e("85319"),n.e("14211"),n.e("26943"),n.e("72197"),n.e("10949"),n.e("68501"),n.e("71519"),n.e("42335"),n.e("57507"),n.e("16334"),n.e("71406"),n.e("56985"),n.e("81619"),n.e("40324"),n.e("88634"),n.e("86122"),n.e("14831"),n.e("25821"),n.e("90645"),n.e("48997"),n.e("94970"),n.e("70486"),n.e("44400"),n.e("25781"),n.e("62646"),n.e("77756"),n.e("15166"),n.e("12375"),n.e("25711"),n.e("53417"),n.e("23549"),n.e("68201"),n.e("93103"),n.e("34552"),n.e("21921"),n.e("9233"),n.e("8757"),n.e("72963"),n.e("85968"),n.e("68403"),n.e("88599"),n.e("75842"),n.e("29787"),n.e("71273"),n.e("9640"),n.e("98765"),n.e("52548"),n.e("28083"),n.e("53984"),n.e("43780"),n.e("76273"),n.e("52229"),n.e("95340"),n.e("36877"),n.e("69747"),n.e("21930"),n.e("3930"),n.e("3663"),n.e("92077"),n.e("89523"),n.e("29260"),n.e("82486"),n.e("755"),n.e("54241"),n.e("41786"),n.e("24303"),n.e("96574"),n.e("46430"),n.e("4374"),n.e("86546"),n.e("82969"),n.e("55895"),n.e("37065"),n.e("43256"),n.e("41384"),n.e("43372"),n.e("19119"),n.e("73566"),n.e("45419"),n.e("87791"),n.e("78377"),n.e("53683"),n.e("84601"),n.e("9598"),n.e("45879"),n.e("86470"),n.e("53308"),n.e("54876"),n.e("40042"),n.e("14501"),n.e("27880"),n.e("8032"),n.e("77970"),n.e("88504"),n.e("75072"),n.e("49282"),n.e("35683"),n.e("94775")]).then(n.bind(n,438857))},[u.length]),0===u.length)?null:(0,i.jsx)(nh.A,{targetElementRef:t,position:"right",gradientColor:"blue",graphic:{type:"image",src:"https://cdn.discordapp.com/assets/content/ea1ea066f1312b56d74e16232ca7da602ee5fc0206f0ea9ecc130e5094334683.svg"},title:em.intl.string(em.t.HMWL9c),body:em.intl.string(em.t["9hfy3A"]),onRequestClose:()=>h(u.map(e=>e.id),eh.i.USER_DISMISS),actions:[{text:em.intl.string(em.t.VSLDly),loading:a,onClick:function(){r(!0),(0,tG.openUserProfileModal)({userId:o,tabSection:n_.RP.WIDGETS}).then(()=>{let e=u.map(e=>e.id);(0,C.openModalLazy)(async()=>{let{default:t}=await Promise.all([n.e("15166"),n.e("12375"),n.e("8978"),n.e("78377"),n.e("45879"),n.e("87591")]).then(n.bind(n,333114));return n=>(0,i.jsx)(t,{...n,trackUserProfileEditAction:()=>{},highlightedApplicationIds:e})},{stackingBehavior:"stack"}),h(u.map(e=>e.id),eh.i.TAKE_ACTION),s()}).finally(()=>r(!1))}}]})}var nM=n(461213),nw=n(818348),nO=n(466573);function nU(){let e=(0,c.bG)([nM.A],()=>nM.A.getStatus()),t=(0,tJ.MU)(e)??"",n=e===nw.cl.INVISIBLE||e===nw.cl.OFFLINE;return(0,i.jsxs)("div",{className:nO.k,children:[(0,i.jsxs)(A.A,{tag:"div",children:[em.intl.string(em.t.AHoLf4),":"]}),t,t.length>0&&n&&(0,i.jsx)(eW.m,{text:em.intl.string(em.t.L99HQm),children:(0,i.jsx)(nt.E,{size:"xs",color:t7.A.colors.STATUS_WARNING,"aria-label":em.intl.string(em.t.L99HQm)})})]})}var nD=n(841595);let nk=(0,n(945810).mj)({name:"2025-12-social-layer-storefront-wishlist-user-account-popout",kind:"user",defaultConfig:{enabled:!1},variations:{0:{enabled:!1},1:{enabled:!0}}});var nP=n(501838),nL=n(760716),nF=n(915089),nG=n(13808);function nV(e){let{markAsDismissed:t,heading:n,subheading:s,children:r,height:o,className:u,contentClassName:c}=e,d=(0,nF.GV)(),h=l.useRef(null),m=(0,er.z)({from:{transform:"translate3d(-110%, 0, 0)",height:o},to:{transform:"translate3d(0, 0, 0)",height:o},config:{mass:1,stiffness:100,damping:15},onRest:()=>{null!=h.current&&h.current.focus()}});return(0,i.jsx)(y.animated.div,{className:a()(nG.kL,u),style:m,children:(0,i.jsxs)("aside",{"aria-labelledby":d,className:nG.Qs,children:[(0,i.jsxs)("div",{className:nG.U1,children:[(0,i.jsx)(g.D,{innerRef:h,"aria-label":em.intl.string(em.t.WAI6xu),className:nG.b,onClick:()=>{t(eh.i.USER_DISMISS)},children:(0,i.jsx)(ee.P,{color:"currentColor"})}),(0,i.jsx)(X.D,{id:d,variant:"heading-lg/semibold",children:n})]}),null!=s&&(0,i.jsx)(J.E,{variant:"text-md/normal",color:"text-subtle",children:s}),(0,i.jsx)(eT.Ip,{className:nG.XG,fade:!0,children:(0,i.jsx)("div",{className:a()(nG.gT,c),children:r})})]})})}var nB=n(973912),nH=n(871123),nQ=n(44724),nW=n(501573);function nq(){(0,nQ.default)({guildId:(0,nH.zf)()})}function nz(e){let{profileUserId:t,handleOpenUserProfileModal:n,markAsDismissed:l}=e,{analyticsLocations:s}=(0,O.Ay)([w.A.WISHLIST_ACCOUNT_POPOUT_UPSSELL]);return null==t?null:(0,i.jsxs)(nV,{heading:em.intl.string(em.t["vy/61K"]),subheading:em.intl.string(em.t.tEee9t),markAsDismissed:l,className:nW.Zj,contentClassName:nW.hQ,height:560,children:[(0,i.jsx)(nB.A,{userId:t,analyticsLocations:s,handleOpenUserProfileModal:n,numWishlistItemsToRecommend:9,className:nW.KN}),(0,i.jsx)("div",{className:nW.UD,children:(0,i.jsx)(eY.$,{variant:"primary",fullWidth:!0,text:em.intl.string(em.t.rg9FQp),onClick:nq})})]})}function nZ(e){let{displayProfile:t,handleOpenUserProfileModal:n,height:s}=e,a=function(e){let{location:t}=e,n=function(e){let{location:t}=e;return nk.useConfig({location:t}).enabled}({location:t}),i=(0,c.bG)([nl.default],()=>nl.default.getCurrentUser()),s=(0,c.bG)([nD.A],()=>null!=i?nD.A.getFirstWishlistId(i.id):null),a=(0,nL.i)(e=>e.recommendationApplicationIds),o=(0,nP.rY)(),u=(0,nP.qx)();return l.useMemo(()=>null!=a||null==s&&n?(0,r.uniq)([...a??[],...u,...o]).sort():[],[n,s,u,o,a])}({location:"AccountProfilePopoutUpsell"}),o=l.useMemo(()=>{let e=[];return a.length>0&&e.push(d.M.WISHLIST_USER_PROFILE_ACCOUNT_POPOUT_UPSELL),e},[a]);return(0,i.jsx)(ng.Ay,{contentTypes:o,bypassAutoDismiss:!0,children:e=>{let{visibleContent:l,markAsDismissed:a}=e;return null==s?null:l===d.M.WISHLIST_USER_PROFILE_ACCOUNT_POPOUT_UPSELL?(0,i.jsx)(nz,{profileUserId:t?.userId,handleOpenUserProfileModal:n,markAsDismissed:a}):null}})}var nK=n(146901),n$=n(827827);let nY=[{duration:15*eJ.A.Millis.MINUTE,label:()=>em.intl.string(em.t["8ot6gv"])},{duration:eJ.A.Millis.HOUR,label:()=>em.intl.string(em.t.UMWBZr)},{duration:8*eJ.A.Millis.HOUR,label:()=>em.intl.string(em.t.EpAXPC)},{duration:eJ.A.Millis.DAY,label:()=>em.intl.string(em.t["755t4q"])},{duration:3*eJ.A.Millis.DAY,label:()=>em.intl.string(em.t["f3/1ch"])},{duration:void 0,label:()=>em.intl.string(em.t["46dqJY"])}],nX="forever";function nJ(e){let{status:t,currentStatus:n,description:l}=e,s=t!==to.clD.ONLINE,a=(0,i.jsx)(i.Fragment,{children:nY.map(e=>{let{duration:l,label:s}=e;return(0,i.jsx)(t9.Dr,{id:`${t}-${l}`,label:s(),action:()=>(0,n$.A)({nextStatus:t,prevStatus:n,durationMillis:l}),dontCloseOnAction:!0},l??nX)})});return(0,i.jsx)(t9.Dr,{id:t,keepItemStyles:!0,hasSubmenu:s,label:(0,tJ.MU)(t),subtext:l,iconLeft:()=>(0,i.jsx)(eN.nW,{status:t,size:10}),leadingAccessory:{type:"status",status:t},action:()=>{(0,n$.A)({nextStatus:t,prevStatus:n})},dontCloseOnAction:!0,children:s?a:void 0})}function n0(e){if(null==e||"0"===e)return;let{kind:t,dateString:n,timeString:i}=(0,nK._)(e);return"today"===t?em.intl.formatToPlainString(em.t.ZxxHIO,{timeString:i}):em.intl.formatToPlainString(em.t["9OFjSe"],{dateString:n,timeString:i})}var n1=n(996988),n2=n(656884);function n3(e){let{currentUser:t,onClose:n,setPopoutRef:s,highlightBadge:r,openedAt:o,className:u}=e,d=__OVERLAY__,h=(0,tF.Ay)(t.id,void 0),{analyticsLocations:f}=(0,O.Ay)(w.A.USER_PROFILE_ACCOUNT_POPOUT),g=(0,tL.pb)({layout:"ACCOUNT_POPOUT",userId:t.id,guildId:void 0}),{ref:x,height:E}=(0,eI.Ay)(),{isHoveringOrFocusing:v,isHovering:T}=(0,e7.A)(x);l.useEffect(()=>{s?.(x.current)},[x,s]),l.useEffect(()=>(t_.A.setState({isOpen:!0}),()=>t_.A.setState({isOpen:!1,shouldRenderTenureLevelUp:!1})),[]);let _=(0,c.bG)([t5.A],()=>t5.A.getStatus(t.id)),N=n0(t6.CY.useSetting()),j=(0,c.bG)([t4.A],()=>t4.A.hidePersonalInformation),S=(0,tv.kB)(),y=t6.Q_.useSetting(),R=function(e){let t=t6.CY.useSetting(),n=(0,tv.kB)(),l=t6.Jr.useSetting();function s(i){let l=n0(t);if(e===i&&null!=l)return l;switch(i){case to.clD.DND:return n?em.intl.string(em.t.day5A6):em.intl.string(em.t["tq/fMK"]);case to.clD.INVISIBLE:return em.intl.string(em.t.zPc6Mc);default:return}}let a=(0,i.jsx)(i.Fragment,{children:nY.map(t=>{let{duration:n,label:l}=t;return(0,i.jsx)(t9.Dr,{id:`${e}-${n}`,label:l(),action:()=>{(0,tv.ES)(!0,n)},dontCloseOnAction:!0},n??nX)})}),r=nJ({status:to.clD.ONLINE,currentStatus:e}),o=nJ({status:to.clD.IDLE,currentStatus:e,description:s(to.clD.IDLE)}),u=nJ({status:to.clD.DND,currentStatus:e,description:s(to.clD.DND)}),c=nJ({status:to.clD.INVISIBLE,currentStatus:e,description:s(to.clD.INVISIBLE)});return(0,i.jsxs)(i.Fragment,{children:[r,(0,i.jsx)(t9.bX,{},"menu-separator-statuses"),o,u,c,n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t9.bX,{},"menu-separator-statuses"),(0,i.jsx)(t9.Dr,{id:"quiet-mode","aria-label":"focus mode",keepItemStyles:!0,hasSubmenu:!0,label:em.intl.string(em.t.gJRnwK),iconLeft:ej.a,leadingAccessory:{type:"icon",icon:ej.a},badge:{text:em.intl.string(em.t.ApAu9f)},subtext:null!=l&&"0"!==l?em.intl.format(em.t.BWD8fs,{endTime:new Date(Number(l)).toLocaleString(em.intl.currentLocale,{month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit"})}):em.intl.string(em.t["Br1q+x"]),action:()=>{(0,tv.ES)(!n)},dontCloseOnAction:!0,children:a},"quiet-mode")]}):null]})}(_),I=function(e){let t=(0,c.bG)([nl.default],()=>nl.default.getCurrentUser()),n=(0,c.bG)([t4.A],()=>t4.A.hidePersonalInformation),l=(0,c.bG)([nn.A],()=>(0,tN.M)(nn.A.theme)),{multiAccountUsers:s}=(0,no.K)(),a=s.map(s=>{let a=new ni.A(s),r=a.id===t?.id,o=s.tokenStatus===nr.U.INVALID,u=n?null:`#${a.discriminator}`;return(0,i.jsx)(t9.Dr,{id:a.id,focusedClassName:nd.in,void_label:e=>{let{isFocused:t}=e;return(0,i.jsxs)("div",{className:nd.ci,children:[(0,i.jsx)(m.eu,{src:a.getAvatarURL(void 0,40),size:p._3.SIZE_24,"aria-label":s.username}),(0,i.jsxs)("div",{className:nd.DD,children:[(0,i.jsx)(J.E,{className:nd.gE,variant:"text-sm/normal",children:tJ.Ay.getUserTag(a,{mode:"username",identifiable:n?"never":"always"})}),!a.hasUniqueUsername()&&(0,i.jsx)(J.E,{className:nd.df,variant:"text-sm/normal",children:u})]}),r&&(0,i.jsx)(ne.y,{size:"sm",color:t?t7.A.unsafe_rawColors.WHITE.css:t7.A.unsafe_rawColors.BRAND_500.css,secondaryColor:t&&l||t&&!l?t7.A.unsafe_rawColors.BRAND_500.css:t7.A.unsafe_rawColors.WHITE.css,className:nd.s0}),o&&(0,i.jsx)(nt.E,{color:t7.A.unsafe_rawColors.RED_400.css,secondaryColor:t&&l||t&&!l?t7.A.unsafe_rawColors.BRAND_500.css:t7.A.unsafe_rawColors.WHITE.css,size:"xs",className:nd.s0})]})},action:()=>{if(e?.(),o)(0,nu.A)();else{var n;(n=a.id)!==t?.id&&(ns.default.track(to.HAw.MULTI_ACCOUNT_SWITCH_ATTEMPT,{location:{section:to.JJy.USER_PROFILE}}),na.Mx(n,void 0,nc.WX.MULTI_ACCOUNT_MENU))}}},a.id)});return a.push((0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t9.bX,{}),(0,i.jsx)(t9.Dr,{id:"manage-accounts",label:em.intl.string(em.t.WbFpq4),action:()=>{e?.(),(0,nu.A)()}})]})),a}(n),b=(0,tP.A)({analyticsLocations:f}),M=(0,ty.TW)(t),U=l.useRef(null),D=l.useRef(null),k=(0,tA.A)(h?.profileFrame?.skuId,"UserProfileAccountPopout"),P=(0,tg.A)(h?.profileFrame?.skuId);(0,tx.A)({skuId:h?.profileFrame?.skuId,openedAt:o,context:g,analyticsLocations:f});let L=l.useRef((0,t_.A)(e=>e.shouldRenderTenureLevelUp)),F=l.useMemo(()=>(0,tE.A)(),[]),[G,V]=l.useState(()=>t_.A.getState().shouldRenderTenureLevelUp);function B(e){n?.(),(0,tG.openUserProfileModal)({customStatusPrompt:F,sourceAnalyticsLocations:f,...g,...e})}l.useEffect(()=>{let e=setTimeout(()=>{V(!1)},500);return()=>clearTimeout(e)},[]);let H=h?.widgets!=null&&h.widgets.length>0,Q=l.useCallback(()=>{n()},[n]),W=l.useCallback(()=>{b(),Q()},[b,Q]),q=(0,eM.QR)({location:"UserProfileAccountPopout"}),{enabled:z}=eb.A.useConfig({location:"UserProfileAccountPopout"}),Z=(0,eM.zd)({location:"UserProfileAccountPopout"}),K=l.useId();return(0,i.jsx)(O.f5,{value:f,children:(0,i.jsx)(tL.of,{value:g,openedAt:o,fetchStartedAt:h?.fetchStartedAt,fetchEndedAt:h?.fetchEndedAt,isLoaded:h?.isLoaded,children:(0,i.jsxs)(ev.l,{ref:x,"aria-labelledby":K,className:a()(ek.jC,u),"data-layer":"base",children:[(0,i.jsx)(A.A,{children:(0,i.jsx)(eC.H,{id:K,children:em.intl.string(em.t["5fWB8U"])})}),(0,i.jsxs)(eC.F,{children:[(0,i.jsx)(nZ,{displayProfile:h,handleOpenUserProfileModal:B,height:E}),(0,i.jsxs)(tZ.A,{className:ek.BK,user:t,displayProfile:h,themeType:n1.d.POPOUT,children:[(0,i.jsxs)("div",{className:n2.wx,children:[(0,i.jsx)(tH.A,{user:t,displayProfile:h,themeType:n1.d.POPOUT}),(0,i.jsx)(tV.A,{user:t,displayProfile:h,themeType:n1.d.POPOUT,onOpenProfile:d?void 0:B}),(0,i.jsx)(t2.A,{ref:U,user:t,themeType:n1.d.POPOUT,onCloseProfile:n,prompt:F})]}),(0,i.jsxs)(eT.Ip,{className:ek.rf,style:{pointerEvents:G?"none":void 0},children:[(0,i.jsx)(tW.A,{userId:t.id}),(0,i.jsx)(tK.Ay,{className:ek.eF,user:t,displayName:t8.Ay.getName(void 0,null,t),onClickName:d?void 0:B,displayNameTrailing:(0,i.jsx)(t1,{user:t,isVisible:v}),pronouns:h?.pronouns,trailing:(0,i.jsx)(tB.A,{displayProfile:h,themeType:n1.d.POPOUT,onClose:n,shouldOpenBadgeTooltip:null!=r?e=>e===r:void 0,shouldGlowTenureBadge:L.current})}),(0,i.jsx)(tQ.A,{isPremiumUser:M,onInteraction:n}),(0,i.jsx)(t3.A,{userId:t.id,userBio:h?.bio,hidePersonalInformation:j,onClose:n}),H&&(0,i.jsx)(tz.A,{user:t,widgets:h?.widgets,onOpenUserProfileModal:B}),(0,i.jsx)(tq.A,{user:t,currentUser:t,onOpenUserProfileModal:B,onClose:n}),(0,i.jsxs)("div",{className:ek.T_,children:[(0,i.jsx)(tZ.A.Overlay,{className:ek.g0,children:(0,i.jsxs)(eF,{children:[(0,i.jsx)(eL,{action:"EDIT_PROFILE",label:em.intl.string(em.t.s5vZlQ),icon:e_.R,onClick:W,ref:D}),(0,i.jsx)(eL,{action:"PRESS_SET_STATUS",label:(0,i.jsx)(nU,{}),sublabel:null!=N&&N,icon:()=>(0,i.jsx)(eN.nW,{status:_,size:12}),trailing:(S||_===to.clD.DND)&&(0,i.jsx)(ej.a,{size:"xxs"}),renderSubmenu:ex.Fr?void 0:e=>{let{closePopout:t}=e;return(0,i.jsx)(eP,{navId:"set-status-submenu",className:ek.hQ,"aria-label":em.intl.string(em.t.E13trI),onClose:t,children:R})},onClick:ex.Fr?()=>{n(),(0,C.openModalLazy)(()=>new Promise(e=>e(e=>{let{onClose:t,...n}=e;return(0,i.jsx)(eE.d,{onClose:t,...n,size:"sm","aria-label":em.intl.string(em.t["3Uj+2p"]),children:(0,i.jsx)(eS.W,{"data-menu-migrated":!0,navId:"set-status-submenu-mobile-web",variant:"fixed","aria-label":em.intl.string(em.t.E13trI),hideScroller:!0,onClose:t,onSelect:void 0,children:R})})})))}:void 0}),(0,i.jsx)(tp,{onClose:n,popoutContainerRef:x})]})}),(0,i.jsx)(tZ.A.Overlay,{className:ek.g0,children:(0,i.jsxs)(eF,{children:[(0,i.jsx)(eL,{action:"PRESS_SWITCH_ACCOUNTS",icon:ey.r,label:em.intl.string(em.t.oMNyYN),onClick:()=>{n(),(0,nu.A)()},renderSubmenu:e=>{let{closePopout:t}=e;return(0,i.jsx)(eP,{navId:"switch-accounts-submenu","aria-label":em.intl.string(em.t.wFhVqL),onClose:t,children:I})}}),!__OVERLAY__&&tX.p5&&y&&(0,i.jsx)(eL,{action:"COPY_USER_ID",icon:eR.L,label:em.intl.string(em.t["/AXYnE"]),onClick:()=>{(0,tX.C)(t.id),n()}})]})})]})]}),h?.profileEffect!=null&&!L.current&&(0,i.jsx)(tf.A,{skuId:h.profileEffect.skuId,isHovering:T}),null!=k&&(0,i.jsx)(tC.A,{frame:k,fadeIn:P})]}),z?(0,i.jsx)(nb,{targetElementRef:D,onClose:n}):q&&Z?(0,i.jsx)(nN,{targetElementRef:D,onClose:n}):null,(0,i.jsx)(tD,{})]})]})})})}var n6=n(371912),n5=n(655116),n4=n(106531),n8=n(148411),n7=n(342296),n9=n(852712),ie=n(167579),it=n(173660),ii=n(472444),il=n(763827),is=n(499156),ia=n(731854);let ir=2.5*eJ.A.Millis.SECOND,io=+eJ.A.Millis.HOUR;var iu=n(459838),ic=n(485296);let id=3*eJ.A.Millis.SECOND,ih=+eJ.A.Millis.DAY;var im=n(616356),ip=n(734057),ig=n(629016),iA=n(186111),ix=n(967198),iC=n(486020),iE=n(625494),iv=n(536194),iT=n(19575),i_=n(994314),iN=n(485599),ij=n(338854);function iS(e){let{targetElementRef:t,markAsDismissed:n,onCheckItOut:l,position:s,shouldShow:a=!0,children:r}=e,o=(0,eG.sw)();return(0,i.jsxs)(i.Fragment,{children:[r,a&&o?(0,i.jsx)(ij.H,{targetElementRef:t,title:em.intl.string(tc.default.Qn21R6),body:em.intl.string(tc.default.eFDg0b),badge:"beta",assetUrl:"https://cdn.discordapp.com/assets/content/4c8a4a5e95e1fc7ef746d21f8fb3153da946324813f8551c86a19266ed8e9ab0.png",disableMediaViewer:!0,position:s,caretConfig:{align:"center"},action:{text:em.intl.string(em.t.RzWDqY),onClick:function(){n(eh.i.TAKE_ACTION),l()}},onRequestClose:function(){n(eh.i.USER_DISMISS)}}):null]})}var iy=n(626584),iR=n(531685),iI=n(259065),ib=n(864386);let iM=new iy.A("DisplayNameStylesCoachmark");function iw(e){let{markAsDismissed:t,targetElementRef:n,children:s}=e,{analyticsLocations:a}=(0,O.Ay)(),r=(0,l.useRef)(null),o=(0,c.bG)([iR.A],()=>iR.A.isFocused()),u=(0,l.useCallback)(()=>{t(eh.i.TAKE_ACTION),(0,el.openUserSettings)(ei.X.PROFILE_PANEL,{analyticsLocations:a},()=>{(0,iI.L)({analyticsLocations:a})})},[t,a]),d=(0,l.useCallback)(()=>{t(eh.i.USER_DISMISS)},[t]);return(0,l.useEffect)(()=>{o&&r.current?.paused?r.current?.play().catch(iM.error):o||r.current?.pause()},[o]),(0,i.jsxs)(i.Fragment,{children:[s,(0,i.jsx)(nh.A,{targetElementRef:n,shouldShow:!0,onRequestClose:d,align:"right",position:"top",caretConfig:{align:"center"},gradientColor:"nitro-pink",graphic:{type:"video",ref:r,src:"https://cdn.discordapp.com/assets/content/5d90dc1e412ad3aa0b39088fba382025e32b718d7bf5d797512be9701b5f53b4.webm",aspectRatio:"21/9",loop:!0},size:"lg",title:em.intl.string(ib.default["1AE464"]),body:[em.intl.string(ib.default.cNc1g9),em.intl.string(em.t["4JNXHG"])],actions:[{text:em.intl.string(em.t.uw9zI7),variant:"primary",onClick:u}]})]})}var iO=n(131607),iU=n(45780),iD=n(696451),ik=n(71393),iP=n(685073),iL=n(228366);let iF={lastSeenInfos:{}},iG=iF;class iV extends c.Ay.PersistedStore{static displayName="GuildTagChangedCoachmarkStore";static persistKey="GuildTagChangedCoachmarkStore";initialize(e){iG=e??iF}getState(){return iG}getGuildLastSeenInfo(e){return iG.lastSeenInfos[e]??null}}let iB=new iV(iL.h,{GUILD_TAG_CHANGED_COACHMARK_SEEN:function(e){let{guildId:t,lastSeenInfo:n}=e;iG.lastSeenInfos[t]=n},LOGOUT:function(){iG=iF}});var iH=n(116833),iQ=n(514661);let iW=new iy.A("GuildTagAvailableCoachmark");function iq(e){let t=(0,c.bG)([ik.A],()=>ik.A.getGuild(e.guildId));function n(n){t?.profile?.tag!=null&&iL.h.dispatch({type:"GUILD_TAG_CHANGED_COACHMARK_SEEN",guildId:t.id,lastSeenInfo:{tag:t.profile.tag}}),e.onDismiss?.(n)}let{isAdopting:l,onAdoptTag:s,onEditProfile:a}=(0,iQ.A)(t?.id??null,()=>n(eh.i.TAKE_ACTION));if(null==t||!(0,iP.q0)(t))return iW.error("GuildTagChangedCoachmark rendered without guildId for a guild with tags."),e.children;let r=[{text:em.intl.string(em.t.jwEaiX),loading:l,onClick:s,variant:"primary"},{text:em.intl.string(em.t.s5vZlQ),onClick:a,variant:"secondary"}];return(0,i.jsxs)(i.Fragment,{children:[e.children,(0,i.jsx)(nh.A,{targetElementRef:e.targetElementRef,shouldShow:!0,position:"top",graphic:{type:"dynamic",component:iH.DynamicGraphicComponent.GUILD_TAG_COACHMARK_ASSET,props:{guildId:t.id,guildProfile:t.profile}},title:em.intl.formatToPlainString(em.t["m/Tc3n"],{guildName:t.name}),body:em.intl.string(em.t.DrAXIr),actions:r,size:"md",onRequestClose:()=>n(eh.i.USER_DISMISS)})]})}function iz(e){let t=(0,c.bG)([ik.A],()=>ik.A.getGuild(e.guildId));function n(t){e.onDismiss?.(t)}let{isAdopting:l,onAdoptTag:s,onEditProfile:a}=(0,iQ.A)(t?.id??null,()=>n(eh.i.TAKE_ACTION));if(null==t||!(0,iP.q0)(t))return iW.error("GuildTagAvailableCoachmark rendered without guildId for a guild with tags."),e.children;let r=[{text:em.intl.string(em.t.jwEaiX),loading:l,onClick:s,variant:"primary"},{text:em.intl.string(em.t.s5vZlQ),onClick:a,variant:"secondary"}];return(0,i.jsxs)(i.Fragment,{children:[e.children,(0,i.jsx)(nh.A,{targetElementRef:e.targetElementRef,shouldShow:!0,position:"top",graphic:{type:"dynamic",component:iH.DynamicGraphicComponent.GUILD_TAG_COACHMARK_ASSET,props:{guildId:t.id,guildProfile:t.profile}},title:em.intl.formatToPlainString(em.t.VFqnyU,{guildName:t.name}),body:em.intl.string(em.t.DrAXIr),actions:r,size:"md",onRequestClose:()=>n(eh.i.USER_DISMISS)})]})}var iZ=n(843010),iK=n(764231),i$=n(425713);function iY(e){let{groupName:t,targetElementRef:n}=e,l=tb(),s=(0,c.bG)([eo.Ay],()=>eo.Ay.useReducedMotion),a=(0,t_.A)(e=>e.isOpen),r=(0,iZ.G)();return s||null==l||a||r?null:(0,i.jsx)(ng.zJ,{contentType:d.M.NITRO_TENURE_BADGE_LEVEL_UP,timeRecurringConfig:{cooldownDurationMs:12096e5},groupName:t,children:e=>{let{visibleContent:t,markAsDismissed:s}=e;return(0,i.jsx)(iX,{recentlyLeveledTenureBadge:l,markAsDismissed:s,targetElementRef:n,shouldShow:t===d.M.NITRO_TENURE_BADGE_LEVEL_UP})}})}function iX(e){let{recentlyLeveledTenureBadge:t,markAsDismissed:n,targetElementRef:s,shouldShow:a}=e,r=tI.sp.indexOf(t),o=(0,i$.I)(tI.sp[r>0?r-1:r]).ambient,u=(0,l.useCallback)(()=>{n(eh.i.TAKE_ACTION),t_.A.setState({shouldRenderTenureLevelUp:!0}),iE._.dispatch(to.jej.SHOW_ACCOUNT_PROFILE_POPOUT,{})},[n]),c=(0,l.useCallback)(()=>{n(eh.i.USER_DISMISS)},[n]),d=tI.VD[t],h=em.intl.formatToPlainString(em.t.ewkaVR,{timeMilestone:(0,iK.T)(d.id,d.tenureReqNumMonths)?.toLocaleLowerCase()}),m=[{text:em.intl.string(em.t.RzWDqY),variant:"primary",onClick:u}];return(0,i.jsx)(nh.A,{targetElementRef:s,onRequestClose:c,shouldShow:a,caretConfig:{align:"center"},graphic:null!=o?{type:"image",src:o,aspectRatio:"6/4"}:void 0,size:"lg",title:em.intl.string(em.t.VoDxsV),body:h,actions:m})}function iJ(e){let{isQuestBarEmpty:t,hasLoadedQuestBar:n}=(0,n6.c9)(),l=null!=e.targetElementRef.current&&t&&n,[s,a]=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{shouldShow:n=!0}=t,i=(0,iU.G$)(d.V.ADOPT_CLAN_IDENTITY_NOTICE,e??to.dJq),l=(0,c.bG)([ik.A,nl.default,iD.Ay],()=>{if(null===e)return!1;let t=ik.A.getGuild(e);if(void 0===t||!(0,iP.Rg)(t)||null==t.profile||null===t.profile.tag)return!1;let n=nl.default.getCurrentUser();if(void 0===n||n.primaryGuild?.identityGuildId===t.id&&n.primaryGuild?.tag===t.profile.tag)return!1;let i=iD.Ay.getMember(e,n.id);return null!=i&&!i.isPending},[e]);return(0,iO.ww)(l&&n&&!i?[d.M.GUILD_TAG_AVAILABLE_COACHMARK_V2]:[],e??to.eGj)}(e.guildId,{shouldShow:l}),[r,o]=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{shouldShow:n=!0}=t,i=e?.primaryGuild,l=i?.identityGuildId??null,s=(0,c.bG)([iB],()=>null===l?null:iB.getGuildLastSeenInfo(l)),a=(0,c.bG)([ik.A],()=>ik.A.getGuild(l)?.profile?.tag),r=null!=a&&i?.identityGuildId===l&&i?.tag===null,o=null!=l&&s?.tag===a,u=null!==l&&r&&!o;return(0,iO.Wl)(u&&n?d.M.GUILD_TAG_UPDATED_COACHMARK:null,{cooldownDurationMs:864e5})}(e.currentUser,{shouldShow:l});return l?s===d.M.GUILD_TAG_AVAILABLE_COACHMARK_V2?(0,i.jsx)(iz,{guildId:e.guildId,onDismiss:a,targetElementRef:e.targetElementRef,children:e.children}):r===d.M.GUILD_TAG_UPDATED_COACHMARK?(0,i.jsx)(iq,{guildId:e.currentUser.primaryGuild?.identityGuildId??null,onDismiss:o,targetElementRef:e.targetElementRef,children:e.children}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(iY,{groupName:eh.m.ACCOUNT_NAME_ZONE,targetElementRef:e.targetElementRef}),(0,i.jsx)(ng.Ay,{contentTypes:e.additionalDCs??[],groupName:eh.m.ACCOUNT_NAME_ZONE,children:t=>{let{visibleContent:n,markAsDismissed:l}=t;switch(n){case d.M.DISPLAY_NAME_STYLES_COACHMARK:return(0,i.jsx)(iw,{markAsDismissed:l,targetElementRef:e.targetElementRef,children:e.children});case d.M.CLIPS_PRIMARY_ENTRY_POINT_COACHMARK:return(0,i.jsx)(iS,{markAsDismissed:l,position:"top",targetElementRef:e.targetElementRef,onCheckItOut:eQ.p,children:e.children});default:return e.children}}})]}):e.children}var i0=n(615675),i1=n(900797),i2=n(847374),i3=n(348858),i6=n(617354),i5=n(829773),i4=n(42473),i8=n(490704),i7=n(967194);function i9(e){let{selfDeaf:t,serverDeaf:n,awaitingRemote:s,onClick:r,iconForeground:o,nameplate:u,shouldShowOutputDeviceChangedTooltip:c,dismissTooltips:d}=e,h=t||n,{Component:m,play:p,events:{onMouseEnter:g,onMouseLeave:A}}=(0,i3.I)(h?"undeafen":"deafen"),x=n?i0.T:m,{name:C}=(0,eA.x5)(ia.oh.AUDIO_OUTPUT),E=(0,i6.A)(t,n,s),{analyticsLocations:v}=(0,O.Ay)(w.A.AUDIO_OUTPUT_BUTTON),T=l.useRef(null);return l.useEffect(()=>()=>p(),[h,p]),(0,i.jsx)(O.f5,{value:v,children:(0,i.jsx)(f.Y,{targetElementRef:T,renderPopout:e=>{let{closePopout:t}=e;return d(),(0,i.jsx)(O.f5,{value:v,children:(0,i.jsx)(i5.A,{onInteraction:(0,G.s)("AudioDeviceMenu",w.A.ACCOUNT),onClose:t,renderOutputDevices:!0,renderOutputVolume:!0,renderSettingsButton:!0})})},position:"top",align:"left",animation:f.Y.Animation.FADE,spacing:4,children:(e,t)=>{let{onClick:l}=e,{isShown:d}=t,m=d?i1.t:i2.a;return(0,i.jsxs)("div",{ref:T,className:a()(i8.Lh,{[i8.v8]:h,[i8.q6]:d}),children:[(0,i.jsx)(i4.A,{"aria-checked":h,"aria-label":em.intl.string(em.t.wjcRFX),className:i8.eT,disabled:s,icon:(0,i.jsx)(x,{size:"custom",width:20,height:20,color:h?t7.A.colors.ICON_VOICE_MUTED:"currentColor",className:o}),iconForeground:h?i7.o:void 0,innerClassName:a()({[i7.T]:n}),onClick:r,onContextMenu:l,onMouseEnter:g,onMouseLeave:A,plated:null!=u,redGlow:h,role:"switch",tooltipText:E}),(0,i.jsx)(i4.A,{className:a()(i8.UT,{[i8.q6]:d}),disabled:s,icon:(0,i.jsx)(m,{className:i8.$$,size:"custom",width:12,height:12,color:h?t7.A.colors.ICON_VOICE_MUTED:"currentColor"}),onClick:l,onContextMenu:l,plated:null!=u,redGlow:h,tooltipType:c?"green_void_do_not_use":void 0,tooltipForceOpen:c,tooltipPositionKey:c?em.intl.formatToPlainString(em.t["f+DDY/"],{outputDeviceName:C}):void 0,tooltipShouldShow:!d,tooltipText:c?em.intl.format(em.t["f+DDY/"],{outputDeviceName:C}):em.intl.string(em.t.aA4Vce),"aria-label":c?em.intl.formatToPlainString(em.t["f+DDY/"],{outputDeviceName:C}):em.intl.string(em.t.aA4Vce)})]})}})})}var le=n(666654),lt=n(523875),ln=n(993719);let li={};class ll extends c.Ay.Store{static displayName="CallFeedbackTutorialStore";getIsTutorialActive(e){return li[e]??!1}}let ls=new ll(iL.h,{CALL_FEEDBACK_TUTORIAL_SHOW:function(e){let{tutorialKey:t}=e;li[t]=!0},CALL_FEEDBACK_TUTORIAL_DISMISS:function(e){let{tutorialKey:t}=e;li[t]=!1}});var la=n(362823),lr=n(980923),lo=n(224585),lu=n(949341),lc=n(973324);function ld(e){let t,{selfMute:n,serverMute:s,suppress:r,awaitingRemote:o,iconForeground:u,onMouseEnter:d,onMouseLeave:h,onClick:m,nameplate:p,shouldShowSpeakingWhileMutedTooltip:g,shouldShowSpeakingWhilePTTTooltip:A,shouldShowInputDeviceChangedTooltip:x,shouldShowPTTJoinTooltip:C,dismissTooltips:E,speaking:v}=e,{showPTTIconIndicator:T}=is.A.useConfig({location:"MicrophoneButton"}),_=(0,c.bG)([ii.Ay],()=>ii.Ay.getMode()===ia.TB.PUSH_TO_TALK),N=(0,c.bG)([ii.Ay],()=>ii.Ay.getSettings().modeOptions.shortcut),j=(0,c.bG)([ls],()=>ls.getIsTutorialActive(la.v.MUTE_TUTORIAL)),S=(0,c.bG)([il.A],()=>null!=il.A.getChannelId()),{name:y}=(0,eA.x5)(ia.oh.AUDIO_INPUT),{enabledInputProfiles:R}=(0,n9.d)({location:"MicrophoneButton"}),I=l.useRef(null),b=n||r||s,M=(0,lt.L)(b?"unmute":"mute"),{analyticsLocations:U}=(0,O.Ay)(w.A.AUDIO_INPUT_BUTTON),{Component:D,events:k,play:P}=M,L=s||r?le.O:D;l.useEffect(()=>()=>P(),[b,P]);let F=(0,lr.A)(n,s,r,o);t=g?{tooltipType:"green_void_do_not_use",tooltipText:em.intl.string(em.t["29gnR4"]),tooltipForceOpen:!0}:C||A?{tooltipType:"green_void_do_not_use",tooltipText:em.intl.format(em.t.c1qUOQ,{keybind:e1.dI(N).toLocaleUpperCase()}),tooltipForceOpen:!0}:{tooltipText:F};let V=T&&_&&S,B=b?t7.A.colors.ICON_VOICE_MUTED:"currentColor",H=l.useCallback(()=>{m(),j&&ln.N(la.v.MUTE_TUTORIAL)},[m,j]);return(0,i.jsxs)(O.f5,{value:U,children:[(0,i.jsx)(f.Y,{targetElementRef:I,renderPopout:e=>{let{closePopout:t}=e;return E(),(0,i.jsx)(O.f5,{value:U,children:(0,i.jsx)(i5.A,{onInteraction:(0,G.s)("AudioDeviceMenu",w.A.ACCOUNT),onClose:t,maybeRenderPTTCheckbox:!0,renderInputProfiles:R.length>0,renderInputDevices:!0,maybeRenderInputMeter:!0,renderInputVolume:!0,renderSettingsButton:!0})})},position:"top",align:"left",animation:f.Y.Animation.FADE,spacing:4,children:(e,n)=>{let{onClick:l}=e,{isShown:s}=n,r=s?i1.t:i2.a;return(0,i.jsxs)("div",{ref:I,className:a()(i8.Lh,{[i8.v8]:b,[i8.q6]:s}),children:[(0,i.jsx)(i4.A,{"aria-checked":b,"aria-label":em.intl.string(em.t.w4m945),className:i8.eT,disabled:o,icon:(0,i.jsx)(L,{size:"custom",width:20,height:20,color:B,className:u}),onClick:H,onContextMenu:l,onMouseEnter:()=>{d(),k.onMouseEnter()},onMouseLeave:()=>{h(),k.onMouseLeave()},plated:null!=p,redGlow:b,role:"switch",...t,children:V?(0,i.jsx)("div",{className:a()(lu.U,{[lu.z]:v})}):null}),(0,i.jsx)(i4.A,{"aria-label":x?em.intl.formatToPlainString(em.t["18wnuD"],{inputDeviceName:y}):em.intl.string(em.t.fRzCbB),className:a()(i8.UT,{[i8.q6]:s}),disabled:o,icon:(0,i.jsx)(r,{className:i8.$$,size:"custom",width:12,height:12,color:B}),onClick:l,onContextMenu:l,onMouseEnter:d,onMouseLeave:h,plated:null!=p,redGlow:b,tooltipType:x?"green_void_do_not_use":void 0,tooltipForceOpen:x,tooltipPositionKey:x?em.intl.formatToPlainString(em.t["18wnuD"],{inputDeviceName:y}):void 0,tooltipShouldShow:!s,tooltipText:x?em.intl.format(em.t["18wnuD"],{inputDeviceName:y}):em.intl.string(em.t.fRzCbB)})]})}}),(0,i.jsx)(nh.A,{targetElementRef:I,shouldShow:j,graphic:{type:"image",src:lc.A},onRequestClose:()=>{ln.N(la.v.MUTE_TUTORIAL)},position:"top",title:em.intl.string(lo.default.VG4zAf),body:em.intl.string(lo.default["8VIRzR"])})]})}var lh=n(935399),lm=n(505312),lp=n(848847),lf=n(88001),lg=n(466919),lA=n(438705);function lx(e){let{targetElementRef:t,shouldShow:n,onDismiss:s}=e,a=l.useCallback(()=>{s(),(0,el.openUserSettings)(ei.X.SUBSCRIPTIONS_PANEL)},[s]);return(0,i.jsx)(nh.A,{targetElementRef:t,position:"top",caretConfig:{align:"start"},size:"md",graphic:{type:"image",src:lA},shouldShow:n,title:em.intl.format(lg.default.bx8sR9,{premiumGroupProductName:(0,lf.DP)()}),body:em.intl.format(lg.default.Pw4OFZ,{premiumGroupProductName:(0,lf.DP)()}),onRequestClose:s,actions:[{text:em.intl.string(lg.default.DD26QR),onClick:a}]})}var lC=n(873298),lE=n(840387);function lv(e){let{markAsDismissed:t,targetElementRef:n}=e,s=(0,lE.Z)(),a=t6.KP.useSetting(),r=s&&a!==lC.KP.FRIENDS_AND_ALL_GUILDS,o=(0,l.useCallback)(()=>{t(eh.i.TAKE_ACTION),(0,el.openUserSettings)(ei.X.PROFILE_PRIVACY_CATEGORY)},[t]),u=(0,l.useCallback)(()=>{t(eh.i.USER_DISMISS)},[t]),c=r?a===lC.KP.FRIENDS_ONLY?em.intl.string(em.t["/hogEy"]):em.intl.string(em.t["6hEfm1"]):em.intl.string(em.t.bnNxW1);return(0,i.jsx)(nh.A,{targetElementRef:n,shouldShow:!0,onRequestClose:u,align:"center",position:"top",caretConfig:{align:"end"},graphic:{type:"image",src:"https://cdn.discordapp.com/assets/content/0710b4aac8339f9213d3c43a8976071c26abe2b3236ccd8817180ce465f33673.svg"},title:em.intl.string(em.t.Ve4nS1),body:c,size:"md",gradientColor:"purple",actions:[{text:em.intl.string(em.t.eOoTMX),variant:"primary",onClick:o}]})}function lT(e){let t,n,{webBuildOverride:s,onClick:a,onContextMenu:r,dismissibleContents:o,iconForeground:u,nameplate:c}=e,h=l.useRef(null),[m,p]=l.useState(!1);(0,lh.Ay)(()=>{function e(){return p(!0)}return iE._.subscribe(to.jej.PREMIUM_GROUP_PURCHASE_FLOW_COMPLETED,e),()=>{iE._.unsubscribe(to.jej.PREMIUM_GROUP_PURCHASE_FLOW_COMPLETED,e)}});let f=l.useCallback(()=>{p(!1),a()},[a]);t=null!=s?em.intl.formatToPlainString(em.t.Gzh6ZP,{webBuildOverride:s.id}):em.intl.string(em.t.cduTBL);let g=eZ.Z,A=(0,lm.w)();return g=null!=s?lp.H:A.Component,(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(i4.A,{ref:h,tooltipText:t,tooltipPositionKey:n,onClick:f,onContextMenu:r,"aria-label":em.intl.string(em.t.cduTBL),icon:(0,i.jsx)(g,{size:"refresh_sm",color:"currentColor",className:u}),...A.events,plated:null!=c}),(0,i.jsx)(lx,{targetElementRef:h,shouldShow:m,onDismiss:()=>p(!1)}),(0,i.jsx)(ng.Ay,{contentTypes:o,groupName:eh.m.ACCOUNT_NAME_ZONE,children:e=>{let{visibleContent:t,markAsDismissed:n}=e;return t===d.M.PRIVATE_PROFILE_COACHMARK?(0,i.jsx)(lv,{markAsDismissed:n,targetElementRef:h}):null}})]})}var l_=n(489902);let lN=iT.Ay.getEnableHardwareAcceleration()?m.Js:m.eu,lj=2.5*eJ.A.Millis.SECOND,lS=2*eJ.A.Millis.MINUTE,ly=2*eJ.A.Millis.MINUTE,lR=5*eJ.A.Millis.SECOND;function lI(e){let{ref:t,speaking:n,voiceDb:s=-1/0,streaming:r,currentUser:o,status:u,handleClick:c,handleMouseLeave:d,renderNameTag:h,nameplate:m,avatarDecoration:A,"data-jump-section":x}=e,C=l.useRef(null),E=t??C,T=(0,iC.F_)({avatarDecoration:A,size:(0,B.Te)(p._3.SIZE_32)}),_=(0,Z.A)(),{updateOpenPopoutRef:j,highlightBadge:S,setHighlightBadge:y}=function(){let e=l.useRef(null),t=l.useCallback(t=>{e.current=()=>{t.onMouseDown(),t.onClick()}},[]),[n,i]=l.useState(),[s,a]=l.useState(!1);return(0,N.A)(()=>a(!0),750),l.useEffect(()=>{function t(t){let{highlightBadge:n}=t;null!=n&&i(n),e.current?.()}return iE._.subscribe(to.jej.SHOW_ACCOUNT_PROFILE_POPOUT,t),()=>{iE._.unsubscribe(to.jej.SHOW_ACCOUNT_PROFILE_POPOUT,t)}}),{updateOpenPopoutRef:t,highlightBadge:s?n:void 0,setHighlightBadge:i}}(),R=(0,Q.K)(m);return null==o?null:(0,i.jsx)(v.A,{object:to.ZSU.AVATAR,children:(0,i.jsx)(n7.A,{user:o,targetElementRef:E,clickTrap:!0,preload:()=>(0,n8.A)(o.id,o.getAvatarURL(void 0,n7.S),{type:"account_popout",withMutualGuilds:!1,withMutualFriends:!1,guildId:void 0}),renderPopout:(e,t)=>{let{closePopout:n,setPopoutRef:l}=e;return(0,i.jsx)(n3,{currentUser:o,highlightBadge:S,openedAt:t,onClose:n,setPopoutRef:l,className:l_.dI})},position:"top",align:"left",animation:f.Y.Animation.FADE,spacing:14,fixed:!0,ignoreModalClicks:!0,onRequestClose:()=>{d(),y(void 0)},children:e=>{j(e);let{onMouseEnter:t,onMouseDown:l,...d}=e;return(0,i.jsxs)("div",{ref:E,style:R,onMouseEnter:t,onMouseDown:l,onClick:t=>{e.onClick?.(t),c?.(t)},className:a()(l_.Q9,{[l_.ZQ]:null!=m}),children:[(0,i.jsx)(g.D,{...d,onClick:t=>{t.stopPropagation(),e.onClick?.(t),c?.(t)},"aria-label":em.intl.string(em.t["5fWB8U"]),focusProps:{ringTarget:E},className:l_.$n,"data-jump-section":x}),(0,i.jsx)(lN,{size:p._3.SIZE_32,src:o.getAvatarURL(void 0,28,!1),avatarDecoration:T,status:r?to.clD.STREAMING:u,isSpeaking:n,voiceDb:s,className:l_.my,"aria-hidden":!0}),(0,i.jsx)("div",{className:l_.oM,children:h(_)})]})}})})}class lb extends l.PureComponent{speakingWhileMutedTooltipTimeout=new h.Ep;speakingWhilePTTTooltipTimeout=new h.Ep;speakingWhilePTTInactiveBackoff=new u.A(ly,null,!1);lastSpeakingWhileMutedNotificationTime=void 0;lastSpeakingWhilePTTNotificationTime=void 0;state={hovered:!1,shouldShowNametagTooltip:!1,shouldShowSpeakingWhileMutedTooltip:!1,shouldShowSpeakingWhilePTTTooltip:!1,hoveringOnMute:!1};containerRef=l.createRef();avatarWithPopoutRef=l.createRef();componentDidUpdate(e){let{speakingWhileMuted:t,speakingWhilePTTInactive:n,occluded:i}=e,{speakingWhileMuted:l,occluded:s,speakingWhilePTTInactive:a}=this.props;s!==i&&this.handleOccludedChanged(),l!==t&&this.handleSpeakingWhileMutedChanged(),a!==n&&this.handleSpeakingWhilePTTChanged()}componentWillUnmount(){this.speakingWhileMutedTooltipTimeout.stop(),this.speakingWhilePTTTooltipTimeout.stop()}handleToggleSelfMute=()=>{let{serverMute:e,suppress:t,selfMute:n}=this.props;(0,L.A)(e,t,to.JJy.ACCOUNT_PANEL),(0,F.X)(w.A.ACCOUNT,F.O.MIC,n)};handleToggleSelfDeaf=()=>{let{serverDeaf:e,selfDeaf:t}=this.props;(0,P.A)(e,to.JJy.ACCOUNT_PANEL),(0,F.X)(w.A.ACCOUNT,F.O.DEAFEN,!t)};handleOpenAccountSettings=()=>{this.dismissTooltips(),il.A.isConnected()?(0,el.openUserSettings)(ei.X.VOICE_AND_VIDEO_PANEL):(0,el.openUserSettings)()};handleOpenSettingsContextMenu=e=>{let{currentUser:t}=this.props;null!=t&&(0,E.L3)(e,async()=>{let{default:e}=await Promise.all([n.e("26913"),n.e("49905"),n.e("89982"),n.e("14144"),n.e("97407"),n.e("24856"),n.e("93315"),n.e("8813"),n.e("78008"),n.e("25610"),n.e("42548"),n.e("44190"),n.e("41916"),n.e("16261"),n.e("18224"),n.e("13114"),n.e("16227"),n.e("26543"),n.e("95059"),n.e("37634"),n.e("812"),n.e("99115"),n.e("72386"),n.e("30541"),n.e("74187"),n.e("62279"),n.e("44667"),n.e("42157"),n.e("96636"),n.e("85917"),n.e("53727"),n.e("57034"),n.e("78220"),n.e("85948"),n.e("12940"),n.e("52443"),n.e("11266"),n.e("4954"),n.e("75954"),n.e("45976"),n.e("60654"),n.e("70179"),n.e("97690"),n.e("87103"),n.e("33973"),n.e("52865"),n.e("10581"),n.e("57215"),n.e("22535"),n.e("2499"),n.e("94970"),n.e("48997"),n.e("70486"),n.e("59135"),n.e("83140"),n.e("18670"),n.e("33238"),n.e("8641"),n.e("59204"),n.e("8736"),n.e("97242"),n.e("98795"),n.e("65123"),n.e("23549"),n.e("83566"),n.e("69722"),n.e("84183"),n.e("28510"),n.e("91752"),n.e("8502"),n.e("58493"),n.e("58376"),n.e("96089"),n.e("21194"),n.e("99272"),n.e("20993"),n.e("34161"),n.e("69164"),n.e("64578"),n.e("92116"),n.e("84200"),n.e("33217"),n.e("80050"),n.e("37502"),n.e("68316"),n.e("76900"),n.e("42535"),n.e("44819"),n.e("72376"),n.e("32802"),n.e("32317"),n.e("84209"),n.e("40706"),n.e("71453"),n.e("56588"),n.e("98902"),n.e("81725"),n.e("27655"),n.e("61448"),n.e("16607"),n.e("50462"),n.e("69848"),n.e("6619"),n.e("19019"),n.e("89014"),n.e("37870"),n.e("93083"),n.e("77335"),n.e("67943"),n.e("40775"),n.e("38847"),n.e("20469"),n.e("21149"),n.e("79093"),n.e("6129"),n.e("47334"),n.e("11171"),n.e("44448"),n.e("19464"),n.e("88429"),n.e("90629"),n.e("63251"),n.e("25235"),n.e("98369"),n.e("88522"),n.e("31333"),n.e("96388"),n.e("70402"),n.e("39328"),n.e("79886"),n.e("79086"),n.e("67696"),n.e("37398"),n.e("72196"),n.e("1844"),n.e("95820"),n.e("78852"),n.e("80851"),n.e("4981"),n.e("44400"),n.e("70676"),n.e("50814"),n.e("77756"),n.e("98444"),n.e("91064"),n.e("8261"),n.e("23017"),n.e("23045"),n.e("87121"),n.e("90003"),n.e("52307"),n.e("61229"),n.e("66721"),n.e("91533"),n.e("62965"),n.e("5288"),n.e("64345"),n.e("25695"),n.e("83705"),n.e("95595"),n.e("50692"),n.e("40759"),n.e("8445"),n.e("61725"),n.e("66969"),n.e("83185"),n.e("58388"),n.e("73923"),n.e("95932"),n.e("81688"),n.e("38342"),n.e("69373"),n.e("18270"),n.e("21437"),n.e("71455"),n.e("39281"),n.e("69152"),n.e("82097"),n.e("53079"),n.e("33885"),n.e("46819"),n.e("85355"),n.e("27289"),n.e("82895"),n.e("15086"),n.e("56821"),n.e("59800"),n.e("33422"),n.e("50037"),n.e("51173"),n.e("79555"),n.e("16113"),n.e("29205"),n.e("16328"),n.e("51437"),n.e("84287"),n.e("79247"),n.e("17773"),n.e("81619"),n.e("24143"),n.e("72328"),n.e("56762"),n.e("44792"),n.e("25006"),n.e("14898"),n.e("8225"),n.e("96137"),n.e("40065"),n.e("82662"),n.e("97421"),n.e("6095"),n.e("30006"),n.e("19402"),n.e("68201"),n.e("13111"),n.e("38939"),n.e("3376"),n.e("13554"),n.e("26132"),n.e("93103"),n.e("28367"),n.e("81647"),n.e("34552"),n.e("76602"),n.e("91763"),n.e("21921"),n.e("9233"),n.e("52511"),n.e("72963"),n.e("40402"),n.e("39970"),n.e("76418"),n.e("93766"),n.e("40258"),n.e("43437"),n.e("42724"),n.e("66495"),n.e("71210"),n.e("68403"),n.e("8555"),n.e("86127"),n.e("28095"),n.e("88599"),n.e("75842"),n.e("36863"),n.e("72789"),n.e("29233"),n.e("50117"),n.e("88342"),n.e("6949"),n.e("46070"),n.e("17249"),n.e("71273"),n.e("79049"),n.e("9640"),n.e("62422"),n.e("90365"),n.e("98765"),n.e("89088"),n.e("52548"),n.e("17989"),n.e("89421"),n.e("35027"),n.e("67861"),n.e("1518"),n.e("37977"),n.e("98965"),n.e("47626"),n.e("23354"),n.e("28083"),n.e("82644"),n.e("53984"),n.e("43780"),n.e("20590"),n.e("65437"),n.e("80830"),n.e("79745"),n.e("3589"),n.e("80854"),n.e("35395"),n.e("46844"),n.e("63235"),n.e("12193"),n.e("45413"),n.e("86672"),n.e("32756"),n.e("64850"),n.e("70104"),n.e("2564"),n.e("47417"),n.e("19558"),n.e("58946"),n.e("35313"),n.e("14285"),n.e("48330"),n.e("95752"),n.e("3332"),n.e("8362"),n.e("41678"),n.e("72401"),n.e("52617"),n.e("4744"),n.e("2698"),n.e("37021"),n.e("81314"),n.e("71430"),n.e("501"),n.e("85794"),n.e("86243"),n.e("67837"),n.e("35321"),n.e("73384"),n.e("82783"),n.e("32209"),n.e("21572"),n.e("87478"),n.e("50033"),n.e("39171"),n.e("36564"),n.e("92513"),n.e("83952"),n.e("52229"),n.e("3998"),n.e("44780"),n.e("95340"),n.e("5557"),n.e("62718"),n.e("61156"),n.e("91671"),n.e("89916"),n.e("92295"),n.e("60773"),n.e("68763"),n.e("16767"),n.e("59957"),n.e("29666"),n.e("58273"),n.e("8018"),n.e("6841"),n.e("20930"),n.e("38056"),n.e("26001"),n.e("14591"),n.e("52111"),n.e("36877"),n.e("69747"),n.e("20379"),n.e("57458"),n.e("59466"),n.e("8829"),n.e("1243"),n.e("75133"),n.e("19193"),n.e("15920"),n.e("58164"),n.e("21930"),n.e("3930"),n.e("96804"),n.e("3663"),n.e("28850"),n.e("95998"),n.e("27659"),n.e("77487"),n.e("37490"),n.e("42234"),n.e("92077"),n.e("26294"),n.e("89523"),n.e("74678"),n.e("29260"),n.e("81189"),n.e("66580"),n.e("47018"),n.e("83230"),n.e("98972"),n.e("12682"),n.e("203"),n.e("39103"),n.e("4774"),n.e("49629"),n.e("78601"),n.e("80407"),n.e("42726"),n.e("34546"),n.e("10943"),n.e("41701"),n.e("21455"),n.e("755"),n.e("60989"),n.e("79435"),n.e("68083"),n.e("48730"),n.e("71467"),n.e("60003"),n.e("49013"),n.e("30167"),n.e("51892"),n.e("94607"),n.e("41838"),n.e("18233"),n.e("33448"),n.e("3710"),n.e("96325"),n.e("45830"),n.e("8979"),n.e("33771"),n.e("77602"),n.e("82178"),n.e("38260"),n.e("46039"),n.e("95602"),n.e("34409"),n.e("22644"),n.e("29569"),n.e("83321"),n.e("96480"),n.e("46430"),n.e("73611"),n.e("79006"),n.e("94888"),n.e("89541"),n.e("44727"),n.e("46149"),n.e("5871"),n.e("27462"),n.e("86546"),n.e("22455"),n.e("60816"),n.e("68031"),n.e("97162"),n.e("10147"),n.e("6627"),n.e("43256"),n.e("60536"),n.e("73566"),n.e("7408"),n.e("46327"),n.e("28011"),n.e("15057"),n.e("45419"),n.e("75284"),n.e("64926"),n.e("50541"),n.e("47999"),n.e("37886"),n.e("59587"),n.e("61750"),n.e("20803"),n.e("95782"),n.e("61137"),n.e("27687"),n.e("55839"),n.e("18710"),n.e("86629"),n.e("98384"),n.e("71492"),n.e("91531"),n.e("24564"),n.e("34428"),n.e("54876"),n.e("39721"),n.e("19631"),n.e("82384"),n.e("76892"),n.e("16799"),n.e("52694"),n.e("43148"),n.e("71811"),n.e("71530"),n.e("38249"),n.e("40976"),n.e("85216"),n.e("83774"),n.e("83102"),n.e("80890"),n.e("2552"),n.e("89588"),n.e("24084"),n.e("44790"),n.e("87641"),n.e("44264"),n.e("74913"),n.e("35476"),n.e("1691"),n.e("14451"),n.e("7755"),n.e("93720"),n.e("54658"),n.e("71790"),n.e("81754"),n.e("78477"),n.e("33049"),n.e("21403"),n.e("43456"),n.e("44491")]).then(n.bind(n,907206));return t=>(0,i.jsx)(e,{...t,onClose:E.Z_,onInteraction:(0,G.s)("UserSettingsMenu",w.A.ACCOUNT)})})};audioOnInteractionHandler=(0,G.s)("AudioDeviceMenu",w.A.ACCOUNT);handleInputAudioContextMenu=(e,t)=>{this.dismissTooltips(),(0,E.L3)(e,async()=>{let{default:e}=await Promise.all([n.e("60536"),n.e("78827")]).then(n.bind(n,385318));return()=>{let{enabledInputProfiles:n}=(0,n9.d)({location:"Account"});return(0,i.jsx)(O.f5,{value:t,children:(0,i.jsx)(e,{onClose:E.Z_,renderInputDevices:!0,renderInputProfiles:n.length>0,renderInputVolume:!0,minimal:!0,onInteraction:this.audioOnInteractionHandler})})}})};handleOutputAudioContextMenu=(e,t)=>{this.dismissTooltips(),(0,E.L3)(e,async()=>{let{default:e}=await Promise.all([n.e("60536"),n.e("78827")]).then(n.bind(n,385318));return()=>(0,i.jsx)(O.f5,{value:t,children:(0,i.jsx)(e,{onClose:E.Z_,renderOutputDevices:!0,renderOutputVolume:!0,minimal:!0,onInteraction:this.audioOnInteractionHandler})})})};handleMouseEnter=()=>{this.setState({hovered:!0})};handleMouseLeave=()=>{this.setState({hovered:!1})};handleMouseEnterMute=()=>{this.setState({hoveringOnMute:!0,shouldShowSpeakingWhileMutedTooltip:!1,shouldShowSpeakingWhilePTTTooltip:!1}),this.speakingWhileMutedTooltipTimeout.stop(),this.speakingWhilePTTTooltipTimeout.stop()};handleMouseLeaveMute=()=>{this.setState({hoveringOnMute:!1})};dismissSpeakingWhileMutedTooltip=()=>{this.setState({shouldShowSpeakingWhileMutedTooltip:!1}),this.speakingWhileMutedTooltipTimeout.stop()};dismissSpeakingWhilePTTTooltip=()=>{this.setState({shouldShowSpeakingWhilePTTTooltip:!1}),this.speakingWhilePTTTooltipTimeout.stop()};dismissTooltips=()=>{this.props.onDismissDeviceChangedTooltip?.(),this.props.dismissPTTJoinTooltip?.(),this.dismissSpeakingWhileMutedTooltip(),this.dismissSpeakingWhilePTTTooltip()};handleOccludedChanged=()=>{let{occluded:e}=this.props;e&&this.setState({shouldShowNametagTooltip:!1,shouldShowSpeakingWhileMutedTooltip:!1,shouldShowSpeakingWhilePTTTooltip:!1})};handleSpeakingWhileMutedChanged=()=>{let{selfMute:e,serverMute:t,suppress:n,speakingWhileMuted:i,occluded:l,shouldShowPTTJoinTooltip:s,deviceChangedTooltipType:a}=this.props,{hoveringOnMute:r}=this.state,o=void 0===this.lastSpeakingWhileMutedNotificationTime||performance.now()-this.lastSpeakingWhileMutedNotificationTime>lS;i?r||!e||t||n||l||!o||null!=a||s||this.setState({shouldShowSpeakingWhileMutedTooltip:!0},()=>{this.lastSpeakingWhileMutedNotificationTime=performance.now(),this.speakingWhileMutedTooltipTimeout.start(lj,()=>this.setState({shouldShowSpeakingWhileMutedTooltip:!1}))}):(this.setState({shouldShowSpeakingWhileMutedTooltip:!1}),this.speakingWhileMutedTooltipTimeout.stop())};handleSpeakingWhilePTTChanged=()=>{let{selfMute:e,serverMute:t,suppress:n,speakingWhilePTTInactive:i,occluded:l,shouldShowPTTJoinTooltip:s,deviceChangedTooltipType:a}=this.props,{hoveringOnMute:r}=this.state,o=void 0===this.lastSpeakingWhilePTTNotificationTime||performance.now()-this.lastSpeakingWhilePTTNotificationTime>this.speakingWhilePTTInactiveBackoff.current;i?r||e||t||n||l||!o||null!=a||s||this.setState({shouldShowSpeakingWhilePTTTooltip:!0},()=>{this.lastSpeakingWhilePTTNotificationTime=performance.now(),this.speakingWhilePTTInactiveBackoff.fail(),this.speakingWhilePTTTooltipTimeout.start(lj,()=>this.setState({shouldShowSpeakingWhilePTTTooltip:!1}))}):(this.setState({shouldShowSpeakingWhilePTTTooltip:!1}),this.speakingWhilePTTTooltipTimeout.stop())};renderStatus(){let{hovered:e}=this.state,{activities:t,applicationStream:n,currentUser:l,status:s,userTag:a,voiceChannel:r}=this.props;if(null==l)return null;if((0,j.A)({activities:t,status:s,applicationStream:n,voiceChannel:r}))return(0,i.jsxs)(M.A,{hoverText:a,forceHover:e,children:[(0,i.jsx)(A.A,{children:tJ.Ay.humanizeStatus(s)}),(0,i.jsx)(S.A,{user:l,activities:t,applicationStream:n,voiceChannel:r,textClassName:l_.XD,hideTooltip:!0})]});let o=t?.find(e=>{let{type:t}=e;return t===to.$pd.CUSTOM_STATUS});return null!=o?(0,i.jsxs)(M.A,{hoverText:a,forceHover:e,children:[(0,i.jsx)(A.A,{children:tJ.Ay.humanizeStatus(s)}),(0,i.jsx)(z.A,{activity:o,emojiClassName:l_.Zg,className:l_.WO})]}):null!=s&&s!==to.clD.UNKNOWN&&l.hasUniqueUsername()?(0,i.jsx)(M.A,{hoverText:a,forceHover:e,children:(0,i.jsx)(b,{text:tJ.Ay.humanizeStatus(s)})}):a}renderNameTag=e=>{let{currentUser:t,username:n}=this.props;return null==t?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:l_.eW,children:(0,i.jsx)(iN.A,{className:a()({[l_.e8]:null!=e}),children:(0,i.jsx)($.A,{userName:n,displayNameStyles:e,effectDisplayType:this.state.hovered?K.G.ANIMATED:K.G.STATIC,loop:!0,inProfile:!0})})}),(0,i.jsx)("div",{className:l_.XP,children:(0,i.jsx)(i_.A,{children:this.renderStatus()})})]})};renderNameZone(e){let{currentUser:t,dismissibleContents:n}=this.props;return null==t?null:(0,i.jsx)(iJ,{guildId:this.props.selectedGuildId??null,currentUser:t,targetElementRef:this.avatarWithPopoutRef,additionalDCs:n.avatar,children:(0,i.jsx)(lI,{...this.props,ref:this.avatarWithPopoutRef,handleMouseLeave:this.handleMouseLeave,renderNameTag:this.renderNameTag,"data-jump-section":e["data-jump-section"]})})}render(){let{currentUser:e,nameplate:t,voiceChannel:n,isQuestBarEmpty:l,isListenAlongVisible:s}=this.props,r=this.state.hovered;return null==e?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(x.sk,{children:e=>(0,i.jsxs)("div",{ref:this.containerRef,className:a()(l_.kL,{[l_.UG]:null!=n,[l_.bc]:!l,[l_.G5]:s}),onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,children:[(0,i.jsx)(q.A,{nameplate:t,hovered:r,placement:W.u.ACCOUNT}),this.renderNameZone(e),(0,i.jsx)(lM,{...this.props,...this.state,accountContainerRef:this.containerRef,handleMouseEnterMute:this.handleMouseEnterMute,handleMouseLeaveMute:this.handleMouseLeaveMute,handleToggleSelfMute:this.handleToggleSelfMute,handleToggleSelfDeaf:this.handleToggleSelfDeaf,handleInputAudioContextMenu:this.handleInputAudioContextMenu,handleOutputAudioContextMenu:this.handleOutputAudioContextMenu,handleOpenAccountSettings:this.handleOpenAccountSettings,handleOpenSettingsContextMenu:this.handleOpenSettingsContextMenu,dismissTooltips:this.dismissTooltips})]})}),(0,i.jsx)(eg,{})]})}}function lM(e){let{selfDeaf:t,selfMute:n,awaitingRemote:l,serverMute:s,serverDeaf:a,suppress:r,shouldShowSpeakingWhileMutedTooltip:o,shouldShowSpeakingWhilePTTTooltip:u,webBuildOverride:c,handleMouseEnterMute:d,handleMouseLeaveMute:h,handleToggleSelfDeaf:m,handleToggleSelfMute:p,handleInputAudioContextMenu:f,handleOutputAudioContextMenu:g,handleOpenAccountSettings:A,handleOpenSettingsContextMenu:x,dismissibleContents:C,nameplate:E,accountContainerRef:v,deviceChangedTooltipType:T,shouldShowPTTJoinTooltip:_=!1,dismissTooltips:N,speaking:j}=e,S=(0,Q.K)(E);return(0,i.jsxs)("div",{className:l_.Uo,style:S,children:[(0,i.jsx)(ld,{accountContainerRef:v,selfMute:n,serverMute:s,suppress:r,awaitingRemote:l,onMouseEnter:d,onMouseLeave:h,onClick:p,onContextMenu:f,iconForeground:null!=E?l_.t4:void 0,nameplate:E,shouldShowSpeakingWhileMutedTooltip:o,shouldShowInputDeviceChangedTooltip:!o&&"input"===T,shouldShowSpeakingWhilePTTTooltip:u,shouldShowPTTJoinTooltip:_,dismissTooltips:N,speaking:j}),(0,i.jsx)(i9,{selfDeaf:t,serverDeaf:a,onClick:m,onContextMenu:g,awaitingRemote:l,iconForeground:null!=E?l_.t4:void 0,nameplate:E,shouldShowOutputDeviceChangedTooltip:"output"===T,dismissTooltips:N}),(0,i.jsx)(lT,{webBuildOverride:c,onClick:A,onContextMenu:x,dismissibleContents:C.settings,iconForeground:null!=E?l_.t4:void 0,nameplate:E})]})}function lw(e){let t=(0,c.bG)([il.A],()=>null!=il.A.getChannelId()),n=(0,eA.Py)(e),i=l.useRef(new h.Ep),[s,a]=l.useState(!1);l.useEffect(()=>{t&&n&&(a(!0),i.current.start(lR,()=>{a(!1)}))},[t,n]);let r=l.useCallback(()=>{a(!1),i.current.stop()},[]);return(0,_.l0)(()=>{i.current.stop()}),{shouldShowTooltip:s,dismissTooltip:r}}function lO(){let e=(0,c.bG)([nl.default],()=>nl.default.getCurrentUser()),t=(0,c.bG)([nv.default],()=>nv.default.getId()),{activities:n,streaming:s,status:a}=(0,c.cf)([nM.A],()=>{let e=nM.A.getActivities();return{activities:e,streaming:null!=e.find(e=>{let{type:t}=e;return t===to.$pd.STREAMING}),status:nM.A.getStatus()}}),r=(0,c.bG)([im.A],()=>im.A.getAnyStreamForUser(t)),u=(0,T.A)({userId:t}),m=(0,c.bG)([ic.A],()=>ic.A.getVoiceVolume(t)),p=tJ.Ay.useUserTag(e,{decoration:"never"}),f=(0,c.bG)([il.A,ip.A],()=>{let e=il.A.getChannelId();return null!=e?ip.A.getChannel(e):null}),{mute:g,selfMute:A,suppress:x}=(0,it.A)(f),{selfDeaf:E,deaf:v}=(0,ie.A)(f),N=(0,c.bG)([U.A],()=>(0,D.kK)()?U.A.getCurrentBuildOverride().overrides?.discord_web:null),j=(0,c.bG)([ii.Ay],()=>ii.Ay.getSpeakingWhileMuted()),S=(0,c.bG)([k.A],()=>k.A.isFullscreenInContext()),y=(0,c.bG)([iA.A],()=>iA.A.hasLayers()),R=(0,C.useModalsStore)(C.hasAnyModalOpenSelector)||y||iv.P.isDisallowPopupsSet()||S,I=(0,c.bG)([Y.default],()=>null!=Y.default.getAwaitingRemoteSessionInfo()),b=(0,c.bG)([ix.A],()=>ix.A.getGuildId()),M=e?.avatarDecoration,P=(0,V.A)(M),L=tJ.Ay.useName(e)??"",{analyticsLocations:F}=(0,O.Ay)(w.A.ACCOUNT),G=(0,H.r)({user:e,guildId:void 0}),{isQuestBarEmpty:B}=(0,n6.c9)(),Q=(0,c.bG)([n5.A,nl.default,ig.A],()=>{let e,t=n5.A.getSyncingWith(),n=n5.A.getActivity(),i=[];return null!=t?e=t.partyId:null!=n&&null!=n.party&&null!=n.party.id&&(e=n.party.id),null!=e&&(i=o()(Array.from(ig.A.getParty(e)??[])).map(e=>nl.default.getUser(e)).filter(nT.Vq).value()),i.length>1}),W={avatar:[],settings:[]},q=(0,n4.lX)("AccountCoachmark");!R&&(W.avatar.push(d.M.DISPLAY_NAME_STYLES_COACHMARK),q&&W.settings.push(d.M.PRIVATE_PROFILE_COACHMARK));let{shouldShowTooltip:z,dismissTooltip:Z}=lw(ia.oh.AUDIO_INPUT),{shouldShowTooltip:K,dismissTooltip:$}=lw(ia.oh.AUDIO_OUTPUT),{shouldShowTooltip:X,dismissTooltip:J}=function(){let[e,t]=l.useState(!1),n=(0,c.bG)([ii.Ay],()=>ii.Ay.getMode()===ia.TB.PUSH_TO_TALK),i=(0,c.bG)([il.A],()=>null!=il.A.getChannelId()&&(il.A.getDuration()??Number.MAX_VALUE)<ir),[s,a]=l.useState(!1),{showPTTJoinTooltip:r}=is.A.useConfig({location:"usePTTJoinTooltip"}),o=l.useRef(new h.Ep),u=l.useRef(new h.Ep);l.useEffect(()=>{if(i&&n&&!e){if(is.A.getConfig({location:"usePTTJoinTooltip:couldDisplayTooltip"}),!r)return;a(!0),t(!0),u.current.start(io,()=>{t(!1)}),o.current.start(ir,()=>{a(!1)})}i||a(!1)},[i,n,r,e]);let d=l.useCallback(()=>{a(!1),o.current.stop()},[]);return(0,_.l0)(()=>{o.current.stop(),u.current.stop()}),{shouldShowTooltip:s,dismissTooltip:d}}(),ee=function(){let{showPTTSpeakingIndicator:e}=is.A.useConfig({location:"useSpeakingWhilePTT"}),[t,n]=l.useState(!1),i=(0,c.bG)([ii.Ay],()=>ii.Ay.getMode()===ia.TB.PUSH_TO_TALK),s=(0,c.bG)([il.A],()=>il.A.getRTCConnectionId()),a=(0,c.bG)([ii.Ay],()=>{let e=ii.Ay.getModeOptions().updatedAt;return null!=e&&Date.now()-e<ih}),r=l.useRef(new h.Ep);return l.useEffect(()=>{n(!1)},[s]),l.useEffect(()=>{let t=0,l=r.current;function o(e,i){let s=(i&ia.ME.VOICE)===ia.ME.VOICE,a=ic.A.isCurrentUserPTTActive();s&&!a?++t>=6&&(n(!0),l.start(id,()=>{n(!1)})):t=0}return a&&e&&i&&null!=s&&ii.Ay.getMediaEngine().on(iu.bg.VoiceActivity,o),()=>{ii.Ay.getMediaEngine().removeListener(iu.bg.VoiceActivity,o),l.stop()}},[e,i,a,s]),t}(),et=l.useMemo(()=>z?"input":K?"output":void 0,[z,K]),en=l.useCallback(e=>{switch(e){case"input":Z();break;case"output":$()}},[Z,$]);return(0,i.jsx)(O.f5,{value:F,children:(0,i.jsx)(lb,{currentUser:e,username:L,activities:n,applicationStream:r,voiceChannel:f,dismissibleContents:W,userTag:p,occluded:R,selfDeaf:E,selfMute:A,serverDeaf:v,serverMute:g,speaking:u,voiceDb:m,speakingWhileMuted:j,speakingWhilePTTInactive:ee,status:a,streaming:s,suppress:x,webBuildOverride:N,awaitingRemote:I,nameplate:G,selectedGuildId:b,avatarDecoration:P,isQuestBarEmpty:B,isListenAlongVisible:Q,deviceChangedTooltipType:et,onDismissDeviceChangedTooltip:()=>en(et),shouldShowPTTJoinTooltip:X,dismissPTTJoinTooltip:J})})}}