Loading
function(e,t,n){"use strict";n.d(t,{Jd:()=>n7,Ay:()=>n8,h9:()=>n2,bG:()=>n1});var l=n(627968),i=n(64700),s=n(735438),r=n.n(s),a=n(837381),o=n(681154),u=n(17928),c=n(922016),d=n(939249),m=n(442433),h=n(775602),p=n(941726),f=n(963307),g=n(287809),E=n(947593),A=n(468581),C=n(808666),x=n(821609),I=n(414499),_=n(323384),S=n(55730),y=n(765379),v=n(737393),T=n(284525),N=n(793574),j=n(482030),b=n(627363),R=n(773669),P=n(403362),L=n(562153),M=n(939341),O=n(576757),w=n(751765);n(321073);var k=n(284009),D=n.n(k),U=n(989349),G=n.n(U),F=n(379834);n(587895);let V="M5 2a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3H5Zm6.81 7c-.54 0-1 .26-1.23.61A1 1 0 0 1 8.92 8.5 3.49 3.49 0 0 1 11.82 7c1.81 0 3.43 1.38 3.43 3.25 0 1.45-.98 2.61-2.27 3.06a1 1 0 0 1-1.96.37l-.19-1a1 1 0 0 1 .98-1.18c.87 0 1.44-.63 1.44-1.25S12.68 9 11.81 9ZM13 16a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm7-10.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM18.5 20a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM7 18.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM5.5 7a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z";n(654107);var B=n(583954),H=n(626584);try{n(Object(function(){var e=Error("Cannot find module '@shopify/react-native-skia'");throw e.code="MODULE_NOT_FOUND",e}())).Skia}catch(e){}let W=new H.A("AssetMap");async function K(e){let t=new Y,n=Object.entries(e).map(e=>{let[n,l]=e;return t.loadRemoteImage(n,l).catch(e=>W.warn("Failed to load canvas asset",e,n,l))});return await Promise.all(n),t}class Y{assets={};fontManager;loadFonts(){return Promise.resolve()}async loadRemoteImage(e,t){let n=new Image;return n.src=t,n.crossOrigin="anonymous",await n.decode(),this.assets[e]=n,Promise.resolve()}get(e){return this.assets[e]}has(e){return null!=this.assets[e]}}class z{canvas;exporter;constructor(e,t){this.canvas=e,this.exporter=t}setExporter(e){this.exporter=e}export(e){D()(null!=this.exporter,"DiscordCanvas: Exporting the canvas requires a valid DiscordCanvasExporter to be initialized.");let t=this.canvas.getCanvasForExport();return D()(null!=t,"DiscordCanvas: Couldn't get a canvas for export."),this.exporter.exportCanvas(t,e)}}try{n(Object(function(){var e=Error("Cannot find module '@shopify/react-native-skia'");throw e.code="MODULE_NOT_FOUND",e}())).Skia}catch(e){}async function Z(e){let{assetsToLoad:t,drawImage:l,exportConfigs:i}=e,s=await K(t);await s.loadFonts();{let e=n(765270).A,t=n(684266).A,r=document.createElement("canvas"),a=new z(new e(r,s),new t);l(a.canvas);let o=await a.export(i);return r.remove(),o}}var q=n(927813),$=n(935208),J=n(140651);let X="M20.97 4.06c0 .18.08.35.24.43.55.28.9.82 1.04 1.42.3 1.24.75 3.7.75 7.09v4.91a3.09 3.09 0 0 1-5.85 1.38l-1.76-3.51a1.09 1.09 0 0 0-1.23-.55c-.57.13-1.36.27-2.16.27s-1.6-.14-2.16-.27c-.49-.11-1 .1-1.23.55l-1.76 3.51A3.09 3.09 0 0 1 1 17.91V13c0-3.38.46-5.85.75-7.1.15-.6.49-1.13 1.04-1.4a.47.47 0 0 0 .24-.44c0-.7.48-1.32 1.2-1.47l2.93-.62c.5-.1 1 .06 1.36.4.35.34.78.71 1.28.68a42.4 42.4 0 0 1 4.4 0c.5.03.93-.34 1.28-.69.35-.33.86-.5 1.36-.39l2.94.62c.7.15 1.19.78 1.19 1.47ZM20 7.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM15.5 12a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM5 7a1 1 0 0 1 2 0v1h1a1 1 0 0 1 0 2H7v1a1 1 0 1 1-2 0v-1H4a1 1 0 1 1 0-2h1V7Z",Q="M11.33 13.68c.41.27.93.27 1.34 0 1.73-1.1 6.2-4.3 6.2-8.02 0-2.02-1.6-3.66-3.59-3.66-1.46 0-2.42.58-3.28 1.44A4.33 4.33 0 0 0 8.72 2a3.63 3.63 0 0 0-3.6 3.66c0 3.72 4.48 6.92 6.2 8.02Z M3.93 13.84a.94.94 0 0 0-.93.94 5.6 5.6 0 0 0 6.48 5.6l1.02-.18v1.27c0 .85.67 1.53 1.5 1.53s1.5-.68 1.5-1.53V20.2l1.02.17A5.6 5.6 0 0 0 21 14.78a.94.94 0 0 0-.93-.94h-2.24a5.6 5.6 0 0 0-4.89 2.9L12 18.41l-.94-1.69a5.6 5.6 0 0 0-4.89-2.9H3.93Z",ee="M12 22a9 9 0 0 0 7.03-14.62l.68-.67a1 1 0 0 0-1.42-1.42l-.67.68A8.96 8.96 0 0 0 13 4.05V3h2a1 1 0 1 0 0-2H9a1 1 0 0 0 0 2h2v1.05c-1.74.2-3.32.88-4.62 1.92l-.67-.68a1 1 0 0 0-1.42 1.42l.68.67A9 9 0 0 0 12 22Zm3.7-11.3a1 1 0 0 0-1.4-1.4l-3 3a1 1 0 0 0 1.4 1.4l3-3Z",et="M8 20a1 1 0 0 0-1 1v.5c0 .28.22.5.5.5h9a.5.5 0 0 0 .5-.5V21a1 1 0 0 0-1-1h-1a2 2 0 0 1-2-2v-.48c0-.95.7-1.73 1.5-2.23a5.7 5.7 0 0 0 1.23-1.08l2.3-.7A7 7 0 0 0 23 6.81V6a2 2 0 0 0-2-2h-2.24A2.85 2.85 0 0 0 16 2H8c-1.3 0-2.43.84-2.76 2H3a2 2 0 0 0-2 2v.82a7 7 0 0 0 4.96 6.7l2.31.7c.37.42.79.78 1.24 1.07.8.5 1.49 1.28 1.49 2.23V18a2 2 0 0 1-2 2H8Zm9.29-8.35.17-.05A5 5 0 0 0 21 6.82V6h-2.27a21.75 21.75 0 0 1-1.44 5.65Zm-10.58 0-.17-.05A5 5 0 0 1 3 6.82V6h2.27c.25 1.94.7 3.95 1.44 5.65Z",en="M4 12a8 8 0 0 1 14.93-4H15a1 1 0 1 0 0 2h6a1 1 0 0 0 1-1V3a1 1 0 1 0-2 0v3a9.98 9.98 0 0 0-18 6 10 10 0 0 0 16.29 7.78 1 1 0 0 0-1.26-1.56A8 8 0 0 1 4 12Z",el="M7.65 21.75a1 1 0 0 0 1.64.96l11.24-9.96a1 1 0 0 0-.66-1.75h-4.81a.5.5 0 0 1-.5-.6l1.79-8.15a1 1 0 0 0-1.64-.96L3.47 11.25A1 1 0 0 0 4.13 13h4.81c.32 0 .56.3.5.6l-1.79 8.15Z",ei="M3 14a9 9 0 1 0 18 0c0-2.63-.61-5.22-1.79-7.58L18.2 4.38a.7.7 0 0 0-1.3.18l-.78 3.9a.66.66 0 0 1-1.27.11L12.22 1.6a.9.9 0 0 0-1.48-.33l-4.2 4.2A12.07 12.07 0 0 0 3 14Zm9.26-.84a.57.57 0 0 0-1-.23L9.6 15a3.08 3.08 0 1 0 5.12.48c-.14-.26-.5-.28-.71-.06L13 16.5l-.74-3.34Z",es="M17.93 1.51a.74.74 0 0 0-1.41 0l-1.13 3.47h-3.65a.74.74 0 0 0-.43 1.35l2.95 2.14-1.13 3.47a.74.74 0 0 0 1.14.83l2.95-2.15 2.96 2.15a.74.74 0 0 0 1.14-.83l-1.13-3.47 2.95-2.14a.74.74 0 0 0-.43-1.35h-3.65l-1.13-3.47ZM10.7 14.7a1 1 0 0 0-1.4-1.4l-8 8a1 1 0 1 0 1.4 1.4l8-8ZM9.7 8.3a1 1 0 0 1 0 1.4l-6 6a1 1 0 0 1-1.4-1.4l6-6a1 1 0 0 1 1.4 0ZM15.7 15.7a1 1 0 0 0-1.4-1.4l-6 6a1 1 0 1 0 1.4 1.4l6-6Z",er=["gg sans","sans-serif"];function ea(e){let t,{canvas:n,badges:l,startPosition:i,maxWidth:s}=e;for(let{iconPath:e,text:r}of(n.setFont({size:12,family:er,weight:500,truncate:B.Kq.None}),l)){let l=null!=t?t.w+t.x+12:i,a=null!=t?t.w+t.x+12+18:i+18;n.drawPath(e,{x:l,y:88},!0,.6),t=n.drawText(r,{x:a,y:99,w:s},!0)}}function eo(e){let{canvas:t,avatarSrcs:n,position:{x:l,y:i},avatarImageSize:s}=e;for(let e=0;e<n.length;e++)e<n.length-1&&t.clipRoundedRect({x:l+(e+1)*(s-8)-2,y:i-1,w:s+2,h:s+2},s/2,!0),t.drawRoundedImage(n[e],{x:l+e*(s-8),y:i},{w:s,h:s},50,{fillMode:B.VZ.Cover}),t.restoreContext()}var eu=n(375708);async function ec(e){let{applicationImageSrc:t,entry:n,avatarSrcs:l,description:i,timestamp:s,colors:r,channelId:a}=e,o=n.extra.activity_name,u={AvatarImage1:l[0],...null!=l[1]&&{AvatarImage2:l[1]},...null!=l[2]&&{AvatarImage3:l[2]},...null!=t&&{ApplicationImage:t}};return await Z({assetsToLoad:u,drawImage:e=>(function(e,t){let{timestamp:n,colors:l,description:i,entry:s,numAvatars:r}=t,a=l.map((e,t)=>({color:e,stop:t}));e.setSize({w:400,h:120},4),e.drawRoundedGradientRect(a,{x:0,y:120},{x:400,y:0},{x:0,y:0,h:120,w:400},8),e.setColor("white"),e.drawRoundedImage("ApplicationImage",{x:12,y:12},{w:96,h:96},8)===B.uS.Failure&&e.drawPath(V,{x:12,y:12},!0,2+2/3),eo({canvas:e,avatarSrcs:["AvatarImage1","AvatarImage2","AvatarImage3"].slice(0,r),position:{x:120,y:12},avatarImageSize:32}),e.setColor("white"),e.setFont({size:16,family:er,weight:500,truncate:B.Kq.Wrap}),e.drawText(i,{x:120,y:64,h:32,w:260},!0),ea({canvas:e,badges:function(e,t){let n=[{iconPath:X,text:t}],l=$.default.extractTimestamp(e.extra.application_id);if(7>=G()().diff(G()(l),"days")&&n.push({iconPath:es,text:eu.intl.string(eu.t.vYuyWf)}),(0,w.Rf)(e)&&n.push({iconPath:Q,text:eu.intl.string(eu.t.keY6mW)}),(0,w.BZ)(e)){let t=(0,w.iy)(e);n.push({iconPath:el,text:eu.intl.formatToPlainString(eu.t["Klie/P"],{days:t})})}(0,w.CZ)(e)===F.m.GLOBAL&&n.push({iconPath:ei,text:eu.intl.string(eu.t.kAlUsy)});let i=(0,w.KH)(e);if(null!=i&&n.push({iconPath:en,text:(0,w.us)(i)}),(0,w.L7)(e)){let{text:t}=(0,w.Pj)(e);null!=t&&n.push({iconPath:ee,text:t})}if((0,w.uw)(e)){let t=(0,w.ty)(e);if(null!=t){let e=eu.intl.formatToPlainString(eu.t.C0AxoR,{hours:Math.round(t/q.A.Seconds.HOUR)});return[{iconPath:et,text:`${eu.intl.string(eu.t["/50eHi"])} \u{2014} ${e}`}]}}return n}(s,n),startPosition:120,maxWidth:260})})(e,{timestamp:s,colors:r,description:i,entry:n,numAvatars:l.length}),exportConfigs:{format:B.z5.CloudUpload,quality:1,fileName:`user-reacting-to-${o}.png`.toLowerCase(),fileType:"png",channelId:a}})}var ed=n(506326),em=n(503698),eh=n.n(em);n(340287);var ep=n(554146),ef=n(661531),eg=n(342952),eE=n(990078),eA=n(315710),eC=n(43990),ex=n(276293),eI=n(935063),e_=n(789645),eS=n(778712),ey=n(696986),ev=n(534514),eT=n(834730),eN=n(320448),ej=n(97808),eb=n(738188),eR=n(983851),eP=n(31300),eL=n(308528),eM=n(367513),eO=n(730852),ew=n(401843),ek=n(969151),eD=n(736653),eU=n(355622),eG=n(408018),eF=n(138617),eV=n(375499),eB=n(429433),eH=n(95701),eW=n(652215),eK=n(389605);let eY=(0,eH.createChannelRecord)({id:"1",type:eW.rbe.DM});function ez(e){let{placeholder:t,onEnter:n,setEditorRef:s,showEmojiButton:r=!1,renderAttachButton:a,autoFocus:o=!0,onFocus:u,channel:c,className:d}=e,[m,h]=i.useState(""),[p,f]=i.useState((0,eG.x7)("")),g=eU.oU.ATOMIC_REACTOR_REPLY_INPUT,E=i.useRef(null);return(0,l.jsx)(eF.Ay,{ref:E,placeholder:t,editorClassName:d,className:eh()(eK.N8,d),showRemainingCharsAfterCount:-1,allowNewLines:!1,maxCharacterCount:200,channel:c??eY,onChange:(e,t,n)=>{h(t),f(n)},type:r?{...g,emojis:{button:!0}}:g,textValue:m,richValue:p,onSubmit:e=>{let{value:t}=e;return t.length>200?Promise.resolve({shouldClear:!1,shouldRefocus:!0}):(n(t),h(""),f((0,eG.x7)("")),Promise.resolve({shouldClear:!0,shouldRefocus:!1}))},setEditorRef:s,focused:o,onFocus:u,disableThemedBackground:!0,emojiPickerCloseOnModalOuterClick:!0,disabled:!1,autoCompletePosition:function(){if(null==E.current)return"top";let e=E.current.getBoundingClientRect(),t=window.innerHeight;return e.top<t/2?"bottom":"top"}(),renderAttachButton:a})}function eZ(e){var t;let{onSelectEmoji:n,onClick:s}=e,r=(0,eD.Ay)(),[a,o]=i.useState(!1),u=i.useRef(null),d=i.useRef(null);return t=()=>o(!1),i.useEffect(()=>{function e(e){"Escape"===e.key&&t()}function n(e){null!=e.target&&(u?.current?.contains(e?.target)||t())}return document.addEventListener("keydown",e),document.addEventListener("mousedown",n),()=>{document.removeEventListener("keydown",e),document.removeEventListener("mousedown",n)}},[t,u]),(0,l.jsx)(c.Y,{targetElementRef:d,align:"right",position:"top",shouldShow:a,disablePointerEvents:!1,renderPopout:()=>(0,l.jsx)(eC.N,{theme:r,children:e=>(0,l.jsx)("div",{className:e,ref:u,children:(0,l.jsx)(eB.C,{messageId:eW.dJq,channel:eY,closePopout:()=>{o(!1)},onSelectEmoji:e=>{let{emoji:t,willClose:l,isBurst:i}=e;null!=t&&(n({emoji:t,willClose:l,isBurst:i}),o(!1))}})})}),children:()=>(0,l.jsx)(eE.m,{text:eu.intl.string(eu.t.lfIHs4),children:(0,l.jsx)("div",{ref:d,className:eK.mJ,children:(0,l.jsx)(eV.A,{active:!1,tabIndex:0,onClick:()=>{s?.(),o(!0)}})})})})}var eq=n(47167),e$=n(262763),eJ=n(402216),eX=n(268218),eQ=n(826673),e0=n(822123),e1=n(643501),e2=n(409626),e3=n(692969),e4=n(279250),e6=n(607407),e5=n(548118),e7=n(499211),e8=n(378570),e9=n(832163),te=n(565688),tt=n(533562),tn=n(308186),tl=n(805901),ti=n(565645);n(915089);var ts=n(713517);n(267889);var tr=n(7584);n(850992),n(690521),n(806931);var ta=n(307731);n(650583);var to=n(317299);function tu(e){let{emoji:t,isDisabled:n=!1,onClick:s,className:r}=e,a=i.useRef(null),o=(0,ts.M)(a);return(0,l.jsx)("span",{ref:a,children:(0,l.jsx)(d.D,{onClick:s,focusProps:{enabled:!n},children:(0,l.jsx)(tl.c,{config:eV.B,from:{value:0},to:{value:+!!o},children:e=>{let{value:i}=e;return(0,l.jsx)(tn.animated.div,{style:{transform:i.to([0,1],[1,1.14]).to(e=>`scale(${e})`)},children:(0,l.jsx)(ti.A,{className:eh()(to.Zg,r,{[to.c4]:n}),emojiId:t.id,emojiName:t?.surrogates,animated:t.animated})})}})})})}ta.EmojiIntention.CHAT,[tr.Ay.getByName("thumbsup"),tr.Ay.getByName("eyes"),tr.Ay.getByName("laughing"),tr.Ay.getByName("watermelon"),tr.Ay.getByName("fork_and_knife"),tr.Ay.getByName("yum")].filter(P.Vq);var tc=n(636585),td=n(734057),tm=n(71393),th=n(576705),tp=n(994500),tf=n(543465),tg=n(977997),tE=n(607567),tA=n(174459),tC=n(486020),tx=n(20805),tI=n(22869),t_=n(623671),tS=n(428249),ty=n(327098),tv=n(202195),tT=n(43105),tN=n(131607),tj=n(49999),tb=n(345394);let tR=function(e){let{children:t}=e,[n,s]=(0,tN.kn)([ep.M.CONTENT_INVENTORY_ONE_CLICK_REPLY_COACHTIP]),[r,a]=i.useState(!1),o=i.useRef(null);i.useEffect(()=>{let e=setTimeout(()=>{a(!0)},300);return()=>clearTimeout(e)},[]);let u=i.useCallback(()=>{s(tj.i.USER_DISMISS)},[s]);return n!==ep.M.CONTENT_INVENTORY_ONE_CLICK_REPLY_COACHTIP?t:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{ref:o,children:t}),(0,l.jsx)(tT.A,{targetElementRef:o,shouldShow:r,onRequestClose:u,position:"left",title:eu.intl.string(eu.t.V5y3qZ),body:eu.intl.string(eu.t.eSDHDk),graphic:{type:"image",src:tb.A}})]})};var tP=n(315246),tL=n(866323),tM=n(857250),tO=n(97483),tw=n(289873),tk=n(401871),tD=n(861173);function tU(){return(0,l.jsxs)("div",{className:tD.oR,children:[(0,l.jsx)(tw.y,{type:tw.t.SPINNING_CIRCLE_SIMPLE,className:tk.S}),(0,l.jsx)(eT.E,{color:"text-strong",variant:"text-md/normal",children:eu.intl.string(eu.t["5z/hlE"])})]})}let tG=e=>{let{shown:t,sent:n,className:i}=e,s=(0,u.bG)([h.Ay],()=>h.Ay.useReducedMotion),r=(0,tL.p)(t,{from:{transform:s?"translateY(0)":"translateY(16px)",opacity:0},enter:{transform:"translateY(0)",opacity:1},leave:{transform:s?"translateY(0)":"translateY(16px)",opacity:0},config:{mass:1,tension:500,friction:18,clamp:!0},delay:200},"animate-always");return(0,l.jsx)(l.Fragment,{children:r((e,t)=>t&&(0,l.jsx)(tn.animated.div,{className:i,style:e,children:n?(0,l.jsx)(tM.y,{message:eu.intl.string(eu.t.fjcCk5),type:tO.Ck.SUCCESS,id:"success_message_toast"}):(0,l.jsx)(tM.y,{message:"",type:tO.Ck.CUSTOM,id:"custom_loading_message_toast",options:{component:(0,l.jsx)(tU,{})}})}))})};var tF=n(424994),tV=n(381941),tB=n(699976),tH=n(994063);let tW=(0,eX.Fe)({createPromise:()=>Promise.all([n.e("58247"),n.e("62448"),n.e("38123"),n.e("56795"),n.e("85723"),n.e("24685"),n.e("70676"),n.e("1316"),n.e("9233"),n.e("69747"),n.e("88889"),n.e("11133"),n.e("49013"),n.e("93461"),n.e("46430"),n.e("90779"),n.e("39808"),n.e("9763"),n.e("20667")]).then(n.bind(n,316725)),webpackId:316725}),tK=i.createContext(void 0);function tY(e){let{children:t}=e,n=i.useRef(null),s=i.useId();return(0,eA.t)(n),(0,l.jsx)(tK.Provider,{value:s,children:(0,l.jsx)("div",{ref:n,className:tH.SW,role:"dialog","aria-modal":"true","aria-labelledby":s,tabIndex:-1,children:t})})}function tz(e){let{children:t,backgroundImgSrc:n,className:i,style:s={}}=e,{primaryColor:r,secondaryColor:a}=(0,J.A)(n);return null!=n&&(s.background=`linear-gradient(45deg, ${r}, ${a})`),(0,l.jsx)(eC.N,{theme:eW.NJ8.DARK,disableAdaptiveTheme:!0,children:e=>(0,l.jsx)("div",{className:eh()(tH.ZK,e,i),style:s,children:t})})}function tZ(e){let{children:t}=e;return(0,l.jsx)("div",{className:tH.$m,children:t})}function tq(e){var t;let n,s,r,a,{channel:o,user:c,onReaction:m,entry:h,buttons:p=[],header:f,onVoiceChannelPreview:E}=e,[A,C]=i.useState(!1),[I,_]=i.useState(null),S=(0,u.bG)([th.A],()=>null!=o&&eW.kvI.CONTENT_ENTRY_EMBEDS.has(o.type)&&th.A.can(eW.xBc.SEND_MESSAGES,o)),[y,v]=i.useState(!1),[T,N]=i.useState(!1),{voiceBar:j,joinVoiceButton:b}=function(e){let{channel:t,entry:n,onVoiceChannelPreview:s}=e,{streamPreviewUrl:r,channel:a}=(0,tv.A)(n),o=(0,eq.Ay)(a),{needSubscriptionToAccess:c}=(0,e7.A)(t?.id),m=(0,u.bG)([tm.A],()=>null!=a?tm.A.getGuild(a.guild_id):void 0),h=(0,u.yK)([tE.Ay],()=>null!=a?tE.Ay.getVoiceStatesForChannel(a):[],[a]),p=(0,u.bG)([tg.A],()=>tg.A.isInChannel(a?.id)),f=i.useMemo(()=>{for(let e of h){let t=td.A.getDMFromUserId(e.user.id),n=null!=t&&tf.Ay.isChannelMuted(null,t),l=tp.A.isBlockedOrIgnored(e.user.id);if(n||l)return!0}return!1},[h]);if(null==a||null==m)return{voiceBar:void 0,joinVoiceButton:void 0};let g=null!=r;function E(e){let{children:t,text:n,hasRestrictedOrMutedVCParticipant:i}=e,s=i?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eb.i,{size:"custom",width:13,height:13,className:tH.vb}),eu.intl.string(eu.t.d6DpXI)]}):n;return(0,l.jsx)(eE.m,{"aria-label":i?eu.intl.string(eu.t.d6DpXI):n??!1,__unsupportedReactNodeAsText:s,shouldShow:!0,children:t},"voice-preview")}return{voiceBar:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:tH.kP,children:[(0,l.jsx)(E,{text:eu.intl.string(eu.t.WIVYqJ),hasRestrictedOrMutedVCParticipant:f,children:(0,l.jsxs)(d.D,{"aria-label":eu.intl.string(eu.t.WIVYqJ),onClick:()=>{eM.A.updateChatOpen(a.id,!0),(0,e8.iN)(a.id),s?.(a)},className:tH.I3,children:[(0,l.jsx)(e5.Ay,{guild:m,size:e5.Ay.Sizes.SMOL,className:tH.O9,active:!0}),(0,l.jsx)(eN._,{size:"xxs",color:ef.A.colors.INTERACTIVE_TEXT_DEFAULT}),(0,l.jsx)(eR.H,{size:"xs",color:ef.A.colors.TEXT_DEFAULT}),(0,l.jsx)(eT.E,{variant:"text-sm/medium",color:"text-default",className:tH.NR,children:o})]})}),(0,l.jsx)(tc.A,{guildId:m.id,users:h,max:3,renderUser:(e,t)=>(0,l.jsx)(ej.eu,{src:e.user.getAvatarURL(m.id,16),size:eS._3.SIZE_16,"aria-label":"avatar",className:t}),renderMoreUsers:e=>(0,l.jsx)("div",{className:tH.V9,children:(0,l.jsx)(eT.E,{variant:"text-xxs/semibold",color:"text-default",children:e})})})]}),(0,l.jsx)(ey.h,{size:16})]}),joinVoiceButton:p?null:(0,l.jsx)(E,{hasRestrictedOrMutedVCParticipant:f,children:(0,l.jsx)(x.$,{onClick:()=>{e$.A.handleVoiceConnect({channel:a,connected:p,needSubscriptionToAccess:c,routeDirectlyToChannel:!0})},fullWidth:!0,text:g?eu.intl.string(eu.t.I6JG46):eu.intl.string(eu.t.VJlc0S),icon:g?eP.k:eR.H,variant:"active",size:"md"})})}}({channel:o,entry:h,onVoiceChannelPreview:E}),{embeddedActivity:R}=(0,ty.A)(h),P=(t=R,n=(0,u.bG)([tm.A],()=>tm.A.getGuild((0,ek.D)(t?.location))),s=(0,u.bG)([td.A],()=>td.A.getChannel((0,ek.H)(t?.location))),r=(0,u.yK)([g.default],()=>t?.participants?.map(e=>g.default.getUser(e.userId))??[]),a=(0,eq.Ay)(s),null!=t&&null!=n&&null!=s&&eH.k3.has(s.type)?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:tH.kP,children:[(0,l.jsxs)(d.D,{"aria-label":eu.intl.string(eu.t["W/A4Qp"]),onClick:()=>(0,e8.iN)(s.id),className:tH.I3,children:[(0,l.jsx)(e5.Ay,{guild:n,size:e5.Ay.Sizes.SMOL,className:tH.O9,active:!0}),(0,l.jsx)(eN._,{size:"xxs",color:ef.A.colors.INTERACTIVE_TEXT_DEFAULT}),(0,l.jsx)(ex.N,{size:"xs",color:ef.A.colors.TEXT_DEFAULT}),(0,l.jsx)(eT.E,{variant:"text-sm/medium",color:"text-default",className:tH.NR,children:a})]}),(0,l.jsx)(tc.A,{guildId:n.id,users:r,max:3,renderUser:(e,t)=>(0,l.jsx)(ej.eu,{src:e.getAvatarURL(n.id,16),size:eS._3.SIZE_16,"aria-label":"avatar",className:t}),renderMoreUsers:e=>(0,l.jsx)("div",{className:tH.V9,children:(0,l.jsx)(eT.E,{variant:"text-xxs/semibold",color:"text-default",children:e})})})]}),(0,l.jsx)(ey.h,{size:16})]}):null),M=null!=b&&0===p.length?[b]:p,O=M.length>0,w=M.length>=2,[k,U]=i.useState(!O),G=L.Ay.getName(o?.guild_id,o?.id,c),F=(0,eq.Ay)(o,!0),V=null!=o&&A?eu.intl.formatToPlainString(eu.t["8lzR/R"],{channel:F}):eu.intl.formatToPlainString(eu.t["4c+CAx"],{channel:`@${G}`}),B=A?eu.intl.string(eu.t.Z2CUgn):eu.intl.string(eu.t.XLGiTG),H=async e=>{let t,{emoji:n}=e;if(null!=n){if(tA.default.track(eW.HAw.CONTENT_POPOUT_EMOJI_CLICKED,{surface_type:tF.UG.GUILD_MEMBER_LIST,channel_id:o?.id,guild_id:o?.guild_id}),(0,eQ.Dr)(ep.M.CONTENT_INVENTORY_ONE_CLICK_REPLY_COACHTIP),v(!0),N(!1),A)D()(null!=o,"shareToChannelMode should only be true if a valid channel is passed"),t=o;else{let e=await eL.A.getOrEnsurePrivateChannel(c.id);t=td.A.getChannel(e)??null}return D()(null!=t,"Send channel must be defined"),K({reply:`:${n.name}:`,sendToChannel:t,onComplete:(e,t)=>{N(!0),setTimeout(()=>{v(!1),m(e,t)},600)},interactionType:tF.PA.REACTION_EMOJI_REACT_SENT,requiresChannelReadiness:!1})}},W=async e=>{let t;if((0,eQ.Dr)(ep.M.CONTENT_INVENTORY_ONE_CLICK_REPLY_COACHTIP),A)D()(null!=o,"shareToChannelMode should only be true if a valid channel is passed"),t=o;else{let e=await eL.A.openPrivateChannel({recipientIds:c.id}),n=td.A.getChannel(e);D()(null!=n,"DM channel must be defined"),t=n}let n=t.type===eW.rbe.DM?tF.PA.DM_REACTION_MESSAGE_SENT:tF.PA.CHANNEL_REACTION_MESSAGE_SENT;return K({reply:e,sendToChannel:t,interactionType:n,onComplete:m,requiresChannelReadiness:!0})};async function K(e){let{reply:t,sendToChannel:n,onComplete:l,interactionType:i,requiresChannelReadiness:s}=e;I?.focus(),await (0,tS.d)({channel:n,content:t,entry:h,whenReady:s,doNotNotifyOnError:!1,location:tV.Hx.CONTENT_INVENTORY_MEMBERLIST}),l?.(i,n)}let Y=f??j??P;function z(){C(e=>!e),k&&I?.focus()}function Z(e){U(e),e&&I?.focus()}return(0,l.jsxs)("div",{style:{pointerEvents:y?"none":"all"},children:[(0,l.jsx)(tG,{sent:T,shown:y,className:tH.Jt}),Y??(0,l.jsx)(tR,{children:(0,l.jsxs)("div",{className:tH.T7,children:[(0,l.jsx)(t$,{channel:o,onClickSuggestion:H}),(0,l.jsx)(eZ,{onSelectEmoji:H})]})}),(0,l.jsxs)("div",{className:k?tH.P2:tH.VE,children:[(0,l.jsx)(ez,{placeholder:V,onEnter:W,setEditorRef:e=>_(e),channel:A?o:void 0,showEmojiButton:null!=Y,className:tH.N8,autoFocus:!1,renderAttachButton:S?()=>(0,l.jsx)(eE.m,{text:B,children:(0,l.jsx)(d.D,{className:tH.wD,onClick:z,children:A?(0,l.jsx)(ex.N,{size:"custom",width:20,height:20}):(0,l.jsx)(eI.X,{size:"custom",width:20,height:20})})}):void 0}),O&&(0,l.jsx)(d.D,{onClick:()=>Z(!1),className:tH.i3,children:(0,l.jsx)(e_.P,{size:"custom",width:20,height:20,color:ef.A.colors.ICON_STRONG})})]}),!1===k&&(0,l.jsxs)("div",{className:tH.fh,children:[!w&&(0,l.jsx)(x.$,{fullWidth:!0,variant:"secondary",onClick:()=>Z(!0),size:"md",text:eu.intl.string(eu.t.OAJQlP)},"toggleMessageMode"),M]})]})}let t$=e=>{let{channel:t,onClickSuggestion:n}=e,[s,r]=i.useState(!1);i.useEffect(()=>{r(!0)},[]);let a=!!h.Ay.keyboardModeEnabled&&!s,o=(0,e0.Fj)(t?.guild_id).slice(0,5).map(e=>null==e.id?{emoji:e,url:e.url}:{emoji:e,url:(0,tC._O)({id:e.id,animated:e.animated,size:58})});return(0,l.jsx)(l.Fragment,{children:o.map(e=>{let{emoji:t,url:i}=e;return null!=i?(0,l.jsx)("div",{children:(0,l.jsx)(eE.m,{asContainer:!0,text:eu.intl.formatToPlainString(eu.t.kilW3l,{emojiName:t.name}),position:"top","aria-label":eu.intl.formatToPlainString(eu.t.kilW3l,{emojiName:t.name}),shouldShow:!a&&void 0,children:(0,l.jsx)(tu,{emoji:t,isDisabled:!s,onClick:()=>n({emoji:t}),className:tH.Zg})})},t.name):null})})};function tJ(e){let{channel:t,userDescription:n,entry:i,disableGameProfileLinks:s,onUserPopoutClosed:r}=e,a=t?.guild_id,{displayParticipants:o,participant1:c,participant2:d,numOtherParticipants:m}=(0,O.A)(i,3),h=(0,u.bG)([g.default],()=>g.default.getUser(i.author_id)),{streamPreviewUrl:p}=(0,tv.A)(i),f=[c,d];return(0,l.jsxs)("div",{className:tH.MH,children:[(0,l.jsxs)("div",{className:tH.WP,children:[(0,l.jsx)(eg.A,{maxUsers:3,users:o,guildId:a,size:eS._3.SIZE_24,hideOverflowCount:!0,disableUsernameTooltip:!0,onUserPopoutRequestClose:r}),(0,l.jsx)(ey.h,{size:8,horizontal:!0}),(0,l.jsx)(ev.D,{variant:"heading-sm/normal",className:eh()(tH.Xn,tH.zA),children:eu.intl.format(n,{user0:L.Ay.getName(a,t?.id,f[0]),user1:L.Ay.getName(a,t?.id,f[1]),countOthers:m,countOthersHook:(e,t)=>(0,l.jsx)(eT.E,{variant:"text-sm/medium",className:eh()(tH.Mj,tH.nk),children:e},t),name0Hook:(e,n)=>(0,l.jsx)(tI.A,{textClassName:eh()(tH.Mj,tH.nk),text:e,user:f[0],channel:t,onPopoutClosed:r,enableDisplayNameStyles:!0},n),name1Hook:(e,n)=>(0,l.jsx)(tI.A,{textClassName:eh()(tH.Mj,tH.nk),text:e,user:f[1],channel:t,onPopoutClosed:r,enableDisplayNameStyles:!0},n)})})]}),null!=p&&(0,l.jsx)(eJ.Ay,{size:eJ.Ay.Sizes.SMALL}),null!=h&&(0,l.jsx)(tP.A,{user:h,channel:t,guildId:a,entry:i,disableGameProfileLinks:s})]})}function tX(e){let{children:t,onClick:n}=e;return null==n?t:(0,l.jsx)(d.D,{className:tH.Zw,onClick:n,children:t})}function tQ(e){let{title:t,subtitle:n,badges:s,children:r,onClickThumbnail:a,onClickTitle:o,onClickSubtitle:c,headerIcons:d,disableGameProfileLinks:m=!1,showCoverImage:h=!0,onUserPopoutClosed:p,trackRankingItemInteraction:f,...g}=e,{entry:E}=g,A=(0,tx.zD)(E),C=A?E.extra?.application_id:void 0,x=(0,tt.W)();null!=x&&(C=x);let I=(0,e3.A)({location:"ContentPopout",applicationId:m?void 0:C,source:e2.Ob.ActivityCard,trackEntryPointImpression:!0,sourceUserId:E.author_id},{onOpened:()=>f?.(tF.PA.OPENED_GAME_PROFILE)}),{largeImage:_,smallImage:S}=(0,M.nO)({entry:E,showCoverImage:h,trackingSource:"memberlist_content_popout"}),y=(0,te.w)({location:"content_inventory"}),v=(0,u.bG)([e9.A],()=>e9.A.getDetectableIdsToApplicationIds()),T=A?I:void 0,N=i.useContext(tK);return(0,l.jsxs)("div",{className:tH.au,children:[(0,l.jsx)(tJ,{disableGameProfileLinks:m,...g,onUserPopoutClosed:p}),(0,l.jsxs)(tz,{backgroundImgSrc:_?.src,children:[(0,l.jsxs)("div",{className:tH.CG,children:[(0,l.jsx)("div",{className:tH.Fb,children:(0,l.jsx)(t_.d,{image:_,smallImage:S,aspectRatio:h?"none":void 0,onClick:a??T,size:t_.w.SIZE_72})}),(0,l.jsxs)("div",{className:tH.iC,children:[(0,l.jsx)(tX,{onClick:o??T,children:(0,l.jsx)(ev.D,{id:N,variant:"heading-md/medium",className:eh()(tH.$2,{[tH.bC]:null!=d}),lineClamp:3,children:t})}),null!=n?(0,l.jsx)(tX,{onClick:c??T,children:(0,l.jsx)(eT.E,{variant:"text-sm/normal",className:tH.LG,children:n})}):null,(0,l.jsx)(ey.h,{size:8}),s]}),(0,l.jsx)("div",{className:tH.hO,children:d})]}),r]}),y&&null!=C&&null!=v[C]?(0,l.jsx)(tW,{className:tH.zu,applicationId:C,userIds:[E.author_id],location:"content_popout",guildId:g.channel?.guild_id,channelId:g.channel?.id,numWishlistItems:3,cardSpec:tB.Z.SIZE_90}):null]})}function t0(e){let{title:t,subtitle:n,badges:s,children:r,stream:a,onClickThumbnail:o,onClickTitle:c,onClickSubtitle:d,onUserPopoutClosed:m,trackRankingItemInteraction:h,...p}=e,f=(0,u.bG)([td.A],()=>td.A.getChannel(a?.channelId)),[g]=i.useMemo(()=>(0,e4.eo)(f,tg.A,tm.A,th.A,e1.default),[f]),{entry:E}=p,A=(0,tx.zD)(E),C=A?E.extra?.application_id:void 0,x=(0,tt.W)();null!=x&&(C=x);let I=(0,e3.A)({location:"ContentPopout",applicationId:C,source:e2.Ob.ActivityCard,trackEntryPointImpression:!0,sourceUserId:E.author_id},{onOpened:()=>h?.(tF.PA.OPENED_GAME_PROFILE)}),_=A?I:void 0,{activity:S,activityApplication:y,fallbackApplication:v}=(0,ty.A)(E),{largeImage:T,smallImage:N}=(0,M.D8)(S,y??v),{largeImage:j}=(0,M.nO)({entry:E,trackingSource:"memberlist_streaming_content_popout"}),b=(0,te.w)({location:"content_inventory"}),R=(0,u.bG)([e9.A],()=>e9.A.getDetectableIdsToApplicationIds()),P=i.useContext(tK);return(0,l.jsxs)("div",{className:tH.au,children:[(0,l.jsx)(tJ,{...p,onUserPopoutClosed:m}),(0,l.jsxs)(tz,{backgroundImgSrc:j?.src,className:tH.uR,children:[(0,l.jsx)(tX,{onClick:g?()=>{eO.default.selectVoiceChannel(a.channelId),(0,ew.Nl)(a)}:void 0,children:(0,l.jsxs)("div",{className:tH.nh,children:[(0,l.jsx)(e6.A,{className:tH.j7,stream:a}),g&&(0,l.jsx)("div",{className:tH.NE,children:(0,l.jsx)(eT.E,{variant:"text-md/normal",color:"always-white",children:eu.intl.string(eu.t["7Xq/nV"])})})]})}),(0,l.jsxs)("div",{className:tH.$6,children:[null!=T&&(0,l.jsx)("div",{className:tH.Fb,children:(0,l.jsx)(t_.d,{image:T,smallImage:N,onClick:o??_,size:t_.w.SIZE_72})}),(0,l.jsxs)("div",{className:tH.gv,children:[(0,l.jsx)(tX,{onClick:c??_,children:(0,l.jsx)(ev.D,{id:P,variant:"heading-md/semibold",className:tH.nk,lineClamp:3,children:t})}),null!=n?(0,l.jsx)(tX,{onClick:d??_,children:(0,l.jsx)(eT.E,{variant:"text-sm/normal",className:tH.zA,children:n})}):null,(0,l.jsx)(ey.h,{size:8}),s]})]}),r]}),b&&null!=C&&null!=R[C]?(0,l.jsx)(tW,{className:tH.zu,applicationId:C,userIds:[E.author_id],location:"content_popout",guildId:p.channel?.guild_id,channelId:p.channel?.id,numWishlistItems:3,cardSpec:tB.Z.SIZE_90}):null]})}var t1=n(299846);let t2=function(e){let{channel:t,entry:n,onReaction:s,onVoiceChannelPreview:r,disableActivityProfileLinks:a}=e,{largeImage:o}=(0,M.nO)({entry:n,showCoverImage:!1,trackingSource:"memberlist_activity_content_popout"}),{user:c,details:d,activity:m,embeddedActivity:h}=(0,t1.u)(n),{primaryColor:p,secondaryColor:f}=(0,J.A)(o?.src),g=(0,u.bG)([R.default],()=>R.default.locale),{displayParticipants:E,participant1:A,participant2:k,numOtherParticipants:D}=(0,O.A)(n,3);function U(){(0,j.hg)(n.extra.application_id)}let G=i.useCallback(e=>{let l,i,s;if(o?.src==null||null==t||null==c)return;let r=D>0?function(e){let{entry:t,channel:n,users:l,countOthers:i}=e,s=eu.t["7j/5mg"];return eu.intl.formatToMarkdownString(s,{gameName:t.extra.activity_name,user1:L.Ay.getName(n?.guild_id,n?.id,l[0]),user2:L.Ay.getName(n?.guild_id,n?.id,l[1]),countOthers:i}).replaceAll("*","")}({entry:n,channel:t,users:[A,k],countOthers:D}):(l=eu.t["bES+y2"],i=L.Ay.getName(t.guild_id,t.id,c),s=n.extra.activity_name,eu.intl.formatToMarkdownString(l,{gameName:s,userName:i}).replaceAll("*",""));return ec({entry:n,applicationImageSrc:o?.src,avatarSrcs:E.map(e=>e.getAvatarURL(t.guild_id,128)),description:r,timestamp:(0,w.As)(n,g),colors:[p,f],channelId:e})},[o?.src,t,E,n,g,D,A,k,p,f,c]),{data:F}=(0,b.YY)(n.extra.application_id),V=(0,v.A)({application:F,analyticsLocations:[N.A.MEMBER_LIST_ACTIVITY_CONTENT_POPOUT]});if(null==c)return null;let B=(0,l.jsx)(ed.iT,{location:ed.N5.POPOUT,entry:n}),H=(0,l.jsx)(tQ,{channel:t,userDescription:(0,w.JM)(n)?eu.t.vPg1JT:eu.t.rPqqts,title:n.extra.activity_name,subtitle:d,badges:B,entry:n,showCoverImage:!1,onClickTitle:a?void 0:U,onClickSubtitle:a?void 0:U,onClickThumbnail:a?void 0:U}),W=(0,S.A)(m,eW.jUm.JOIN)||(0,y.A)(m),K=W?(0,l.jsx)(T.A,{embeddedActivity:h,activity:m,user:c,variant:"primary",size:"md",icon:C.I}):null,Y=null==V?null:(0,l.jsx)(x.$,{variant:"primary",size:"md",fullWidth:!0,onClick:V,text:eu.intl.string(eu.t["jaYS/h"]),icon:I.h}),z=null!=Y||a?null:(0,l.jsx)(x.$,{variant:"primary",size:"md",fullWidth:!0,onClick:U,text:eu.intl.string(eu.t.GDWYR8),icon:_.k}),Z=[Y,W&&!a?K:z].filter(P.Vq);return(0,l.jsxs)(tY,{children:[H,(0,l.jsx)(tZ,{children:(0,l.jsx)(tq,{onReaction:s,onVoiceChannelPreview:r,user:c,channel:t,generateReactionImage:G,reactionImageAltText:eu.intl.formatToPlainString(eu.t.tAwI1k,{username:c.username,activity:n.extra.activity_name}),entry:n,buttons:Z})})]})};var t3=n(322789),t4=n(808380),t6=n(687966),t5=n(39623),t7=n(960076),t8=n(544441),t9=n(562708),ne=n(688810),nt=n(139286);function nn(e){let{application:t,analyticsLocation:n}=e,{analyticsLocations:i}=(0,ne.Ay)(n),s=(0,v.A)({application:t,analyticsLocations:i});return(0,nt.A)({name:t9.ImpressionNames.CLOUD_PLAY_CTA,type:t9.ImpressionTypes.VIEW,properties:{location_stack:i}}),(0,l.jsx)(x.$,{variant:"primary",size:"md",icon:I.h,text:eu.intl.string(eu.t["jaYS/h"]),onClick:function(){s?.()},fullWidth:!0},"cloud-play")}var nl=n(601007),ni=n(648246),ns=n(308335),nr=n(790381),na=n(266080);async function no(e){let{applicationImageSrc:t,entry:n,avatarSrcs:l,description:i,timestamp:s,colors:r,channelId:a}=e,o=n.extra.game_name,u={AvatarImage1:l[0],...null!=l[1]&&{AvatarImage2:l[1]},...null!=l[2]&&{AvatarImage3:l[2]},...null!=t&&{ApplicationImage:t}};return await Z({assetsToLoad:u,drawImage:e=>(function(e,t){let{timestamp:n,colors:l,description:i,entry:s,numAvatars:r}=t,a=l.map((e,t)=>({color:e,stop:t}));e.setSize({w:400,h:120},4),e.drawRoundedGradientRect(a,{x:0,y:120},{x:400,y:0},{x:0,y:0,h:120,w:400},8),e.setColor("white"),e.drawRoundedImage("ApplicationImage",{x:12,y:12},{w:96,h:96},8)===B.uS.Failure&&e.drawPath(V,{x:12,y:12},!0,2+2/3),eo({canvas:e,avatarSrcs:["AvatarImage1","AvatarImage2","AvatarImage3"].slice(0,r),position:{x:120,y:12},avatarImageSize:32}),e.setColor("white"),e.setFont({size:16,family:er,weight:500,truncate:B.Kq.Wrap}),e.drawText(i,{x:120,y:64,h:32,w:260},!0),ea({canvas:e,badges:function(e,t){let n=[{iconPath:X,text:t}],l=$.default.extractTimestamp(e.extra.application_id);if(7>=G()().diff(G()(l),"days")&&n.push({iconPath:es,text:eu.intl.string(eu.t.vYuyWf)}),(0,w.Rf)(e)&&n.push({iconPath:Q,text:eu.intl.string(eu.t.keY6mW)}),(0,w.BZ)(e)){let t=(0,w.iy)(e);n.push({iconPath:el,text:eu.intl.formatToPlainString(eu.t["Klie/P"],{days:t})})}(0,w.CZ)(e)===F.m.GLOBAL&&n.push({iconPath:ei,text:eu.intl.string(eu.t.kAlUsy)});let i=(0,w.KH)(e);if(null!=i&&n.push({iconPath:en,text:(0,w.us)(i)}),(0,w.L7)(e)){let{text:t}=(0,w.Pj)(e);null!=t&&n.push({iconPath:ee,text:t})}if((0,w.uw)(e)){let t=(0,w.ty)(e);if(null!=t){let e=eu.intl.formatToPlainString(eu.t.C0AxoR,{hours:Math.round(t/q.A.Seconds.HOUR)});return[{iconPath:et,text:`${eu.intl.string(eu.t["/50eHi"])} \u{2014} ${e}`}]}}return n}(s,n),startPosition:120,maxWidth:260})})(e,{timestamp:s,colors:r,description:i,entry:n,numAvatars:l.length}),exportConfigs:{format:B.z5.CloudUpload,quality:1,fileName:`user-reacting-to-${o}.png`.toLowerCase(),fileType:"png",channelId:a}})}var nu=n(968309),nc=n(30370);function nd(e){let t=(0,u.bG)([nc.A],()=>nc.A.getAccounts().some(t=>t.type===e)),n=i.useCallback(()=>{if(null==e)return null;(0,nu.A)({platformType:e,location:"Member List Content Popout"})},[e]);if(null!=e)return t?void 0:n}var nm=n(18282);let nh=[...t3.n,ed.Yq],np={[t4.Y.DESKTOP]:null,[t4.Y.LINUX]:null,[t4.Y.MACOS]:null,[t4.Y.NINTENDO]:null,[t4.Y.IOS]:null,[t4.Y.ANDROID]:null,[t4.Y.XBOX]:na.A,[t4.Y.PLAYSTATION]:nr.A},nf=function(e){let{channel:t,entry:n,disableGameProfileLinks:s,onReaction:r,onVoiceChannelPreview:a,onUserPopoutClosed:o,trackRankingItemInteraction:c}=e,{largeImage:d}=(0,M.nO)({entry:n,trackingSource:"memberlist_gaming_content_popout"}),{user:m,details:h,appName:p,activity:f,embeddedActivity:g}=(0,t1.u)(n),{primaryColor:E,secondaryColor:A}=(0,J.A)(d?.src),C=(0,u.bG)([R.default],()=>R.default.locale),{streamPreviewUrl:x,stream:I}=(0,tv.A)(n),{displayParticipants:_,participant1:j,participant2:k,numOtherParticipants:D}=(0,O.A)(n,3),U=n.extra.platform,G=n.extra.application_id,F=null!=U?np[U]:null,V=nd(U===t4.Y.XBOX?eW.fg2.XBOX:U===t4.Y.PLAYSTATION?eW.fg2.PLAYSTATION:void 0),{data:B}=(0,b.YY)(G),H=(0,t8.A)(G),{analyticsLocations:W}=(0,ne.Ay)(N.A.MEMBER_LIST_GAMING_CONTENT_POPOUT),K=(0,v.J)(B),Y=(0,ns.o)(f?.application_id??g?.applicationId??B?.id),z=i.useCallback(e=>{let l,i,s,r;if(d?.src==null||null==t||null==m)return;let a=D>0?function(e){let{entry:t,channel:n,users:l,countOthers:i}=e,s=(0,w.JM)(t)?eu.t.QaUWPd:eu.t["7j/5mg"];return eu.intl.formatToMarkdownString(s,{gameName:t.extra.game_name,user1:L.Ay.getName(n?.guild_id,n?.id,l[0]),user2:L.Ay.getName(n?.guild_id,n?.id,l[1]),countOthers:i}).replaceAll("*","")}({entry:n,channel:t,users:[j,k],countOthers:D}):(l=(0,w.JM)(n),i=(0,w.Rf)(n)?l?eu.t.MHO1AV:eu.t.i7AOzw:l?eu.t["lLPKY+"]:eu.t["bES+y2"],s=L.Ay.getName(t?.guild_id,t?.id,m),r=n.extra.game_name,eu.intl.formatToMarkdownString(i,{gameName:r,userName:s}).replaceAll("*",""));return no({entry:n,applicationImageSrc:d?.src,avatarSrcs:_.map(e=>e.getAvatarURL(t.guild_id,128)),description:a,timestamp:(0,w.As)(n,C),colors:[E,A],channelId:e})},[d?.src,t,_,n,C,D,j,k,E,A,m]);if(null==m)return null;let Z=(0,l.jsx)(ed.mG,{location:null==x?ed.N5.POPOUT:ed.N5.STREAMING_POPOUT,children:nh.map((e,t)=>(0,l.jsx)(e,{entry:n},t))}),q=null==I?(0,l.jsx)(tQ,{channel:t,headerIcons:null==F?null:(0,l.jsx)(nm.A,{onClick:V,Icon:F,"aria-label":eu.intl.string(eu.t.YR4cHH)}),userDescription:(0,w.JM)(n)?eu.t.vPg1JT:eu.t.rPqqts,title:p,subtitle:h,badges:Z,entry:n,disableGameProfileLinks:s,onUserPopoutClosed:o,trackRankingItemInteraction:c,children:H.length>0?(0,l.jsx)(nl.A,{distributorCTAConfigs:H,applicationId:G,analyticsLocations:W,buttonVariant:"overlay-primary"}):null}):(0,l.jsx)(t0,{channel:t,title:n.extra.game_name,subtitle:h,badges:Z,userDescription:eu.t["6oWFUN"],entry:n,stream:I,onUserPopoutClosed:o,trackRankingItemInteraction:c,children:H.length>0?(0,l.jsx)(nl.A,{distributorCTAConfigs:H,applicationId:G,analyticsLocations:W,buttonVariant:"overlay-primary"}):null}),$=!Y&&K?(0,l.jsx)(nn,{application:B,analyticsLocation:N.A.MEMBER_LIST_GAMING_CONTENT_POPOUT},"cloud-play"):null,X=[null==$&&((0,S.A)(f,eW.jUm.JOIN)||(0,y.A)(f))?(0,l.jsx)(T.A,{activity:f,user:m,variant:"primary",size:"md",icon:t6._},"join"):null,(0,t7.A)(f)?(0,l.jsx)(ni.A,{activity:f,size:"md",variant:"primary",icon:t5.b},"watch"):null,$].filter(P.Vq);return(0,l.jsxs)(tY,{children:[q,(0,l.jsx)(tZ,{children:(0,l.jsx)(tq,{onReaction:r,onVoiceChannelPreview:a,user:m,channel:t,generateReactionImage:z,reactionImageAltText:eu.intl.formatToPlainString(eu.t.tAwI1k,{username:m.username,activity:n.extra.game_name}),entry:n,buttons:X})})]})},ng=(0,n(353640).v)(e=>({activeEntryId:null,setActiveEntryId:t=>e({activeEntryId:t})}));function nE(e){let{entry:t,isFirstApplicationOccurrence:n,targetElementRef:s}=e,{data:r}=(0,b.YY)(t.extra.application_id),{analyticsLocations:a}=(0,ne.Ay)(N.A.CLOUD_PLAY_POPOVER),o=(0,v.A)({application:r,analyticsLocations:a}),u=(0,eQ.JZ)(ep.M.CLOUD_PLAY_NEW_BADGE),c=null!=o&&!u&&n,{activeEntryId:d,setActiveEntryId:m}=ng(),h=d===t.id,p=c&&h?[ep.M.CLOUD_PLAY_POPOVER]:[],[f,g]=(0,tN.kn)(p),E=f===ep.M.CLOUD_PLAY_POPOVER;i.useEffect(()=>{c&&null===d&&m(t.id)},[d,c,t.id,m]),i.useEffect(()=>()=>{E&&(g(tj.i.USER_DISMISS),m(null))},[E,g,m]);let[A,C]=i.useState(!1);return i.useEffect(()=>{E&&!A&&C(!0)},[E,A]),(0,nt.A)({name:t9.ImpressionNames.CLOUD_PLAY_CTA,type:t9.ImpressionTypes.VIEW,properties:{location_stack:a}},{disableTrack:!A},[A]),(0,l.jsx)(tT.A,{title:eu.intl.string(eu.t["+WNDtV"]),body:eu.intl.string(eu.t["5QKxGI"]),targetElementRef:s,shouldShow:E,position:"left",caretConfig:{align:"center"},gradientColor:"pink",graphic:{type:"image",src:"https://cdn.discordapp.com/assets/content/89fae27b507d71982d8ba38286e78d3ca4b35e6c3e5e7a78263552a656f6f5a6.svg"},actions:[{icon:I.h,text:eu.intl.string(eu.t["jaYS/h"]),onClick:function(){o?.()}}],onRequestClose:function(){g(tj.i.USER_DISMISS),m(null)}})}let nA=function(e){let{entry:t,isFirstApplicationOccurrence:n,targetElementRef:i}=e;return(0,l.jsx)(nE,{entry:t,targetElementRef:i,isFirstApplicationOccurrence:n})};var nC=n(363670),nx=n(205327),nI=n(52133),n_=n(835723),nS=n(172710),ny=n(655116),nv=n(763758),nT=n(286617),nN=n(533207),nj=n(495544),nb=n(121090),nR=n(974690);async function nP(e){let{user:t,channel:n,mediaImageSrc:l,artist:i,description:s,colors:r,badges:a}=e,o=function(e){let{avatarSrc:t,mediaImageSrc:n}=e;return{AvatarImage:t,...null!=n&&{MediaImage:n}}}({avatarSrc:t.getAvatarURL(n.guild_id,128),mediaImageSrc:l}),u=i.replaceAll(/[^a-zA-Z0-9 ]/g,"").replaceAll(" ","-");return await Z({assetsToLoad:o,drawImage:e=>{var t,n,l,i;let o;t=e,o=r.map((e,t)=>({color:e,stop:t})),t.setSize({w:400,h:120},4),t.drawRoundedGradientRect(o,{x:0,y:120},{x:400,y:0},{x:0,y:0,h:120,w:400},8),(n=e).drawRoundedImage("MediaImage",{x:12,y:12},{w:96,h:96},8,{fillMode:B.VZ.Contain})===B.uS.Failure&&n.drawPath(V,{x:12,y:12},!0,2+2/3),e.drawRoundedImage("AvatarImage",{x:120,y:12},{w:32,h:32},50),l=e,i=s,l.setColor("white"),l.setFont({size:16,family:er,weight:500,truncate:B.Kq.Wrap}),l.drawText(i,{x:120,y:64,h:32,w:260},!0),ea({canvas:e,badges:a,startPosition:120,maxWidth:260})},exportConfigs:{format:B.z5.CloudUpload,quality:1,fileName:`user-reacting-to-${u}.png`.toLowerCase(),fileType:"png",channelId:n.id}})}var nL=n(693879),nM=n(809854),nO=n(272984),nw=n(229812);function nk(e){let{activity:t}=e,n=t.timestamps,{now:s}=(0,nM.e)(),{durationTimestamp:r,seekBarStyles:a}=i.useMemo(()=>{let{start:e,end:n}=t.timestamps??{};if(null==e||null==n)return{};let l=Math.min(n,s),i=n-e,r=Math.floor(Math.max(l-e,0)/i*100);return{seekBarStyles:{width:`${r}%`},durationTimestamp:(0,w.W6)({start:0},i)}},[t,s]);return null==a?null:(0,l.jsxs)("div",{className:nw.lu,children:[(0,l.jsx)(nL.z,{entry:n}),(0,l.jsx)("div",{className:nw.Lt,children:(0,l.jsx)("div",{className:nw.Vp,style:a})}),(0,l.jsx)(eT.E,{className:nw.vE,variant:"text-xs/normal",tabularNumbers:!0,color:void 0,children:r})]})}function nD(e){let t,n,s,{channel:r,entry:a,closePopout:o,onReaction:c,onVoiceChannelPreview:d}=e,{largeImage:m}=(0,M.nO)({entry:a,trackingSource:"memberlist_listened_session_content_popout"}),{activity:h,currentEntry:p,artist:f,title:g,user:E}=(0,nC.u7)(a),{primaryColor:A,secondaryColor:C}=(0,J.A)(m?.src),I=nd(eW.fg2.SPOTIFY),_=(0,u.bG)([ny.A,nj.default],()=>h?.type===eW.$pd.LISTENING&&null!=E?(0,nT.A)(ny.A,nj.default,E,h):void 0,[h,E],nI.A),S=i.useCallback(()=>{if(null==r||null==E)return;let e=h.timestamps?.start,t=(0,w.W6)(null!=e?{start:e}:a,Date.now());return nP({user:E,channel:r,mediaImageSrc:m?.src,artist:f,description:function(e,t,n){let{artist:l,media:i}=e,s=eu.t["6iNxrl"],r=L.Ay.getName(t.guild_id,t.id,n);return eu.intl.formatToMarkdownString(s,{artist:l,userName:r,media:i}).replaceAll("*","")}({artist:f,media:g},r,E),colors:[A,C],badges:function(e){let{timestamp:t}=e;return[{iconPath:"M18.03 2.8a11 11 0 1 0 2.52 2.28c-.28-.34-.8-.13-.8.31v7.37c0 1-.4 1.95-1.1 2.65l-.78.78a.6.6 0 0 0-.14.53c.08.53-.08 1.1-.5 1.52l-1 1a1.75 1.75 0 1 1-2.47-2.48l1-1c.42-.41.99-.57 1.52-.49.2.03.4 0 .53-.14l.78-.78c.42-.42.66-1 .66-1.6V3.22a.49.49 0 0 0-.22-.41ZM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm-7-2a1 1 0 0 0 1-1 6 6 0 0 1 6-6 1 1 0 1 0 0-2 8 8 0 0 0-8 8 1 1 0 0 0 1 1Z",text:t}]}({timestamp:t})})},[h,f,r,a,m?.src,A,C,g,E]);if(null==h||null==p)return null;let y=f,v=[];p.media.provider===nx.X.SPOTIFY&&(n=()=>{(0,nS.Mp)(h)},s=()=>{(0,nS.QX)(h,E.id)},t=()=>{null!=I?I():(0,nS.Mp)(h)},y=(0,l.jsx)(nv.A,{artists:f,canOpen:null!=h.sync_id,linkClassName:tH.zA,onOpenSpotifyArtist:e=>{(0,nS.mN)(h,E.id,e)}}),_?.syncDisabled===!1&&v.push((0,l.jsx)(x.$,{variant:"primary",size:"md",fullWidth:!0,text:eu.intl.string(eu.t.eU3inB),icon:n_.J,onClick:()=>{(0,nN.A)(_,nO.Qp.USER_ACTIVITY_SYNC),o()}},"listen-along")));let T=(0,l.jsx)(tQ,{onClickThumbnail:s,channel:r,entry:a,headerIcons:p.media.provider===nx.X.SPOTIFY?(0,l.jsx)(nm.A,{onClick:t,"aria-label":eu.intl.string(eu.t.rRffNz),Icon:nb.A}):null,userDescription:(0,w.JM)(a)?eu.t.Tzx5D2:eu.t.CcVI1T,title:g,onClickTitle:n,subtitle:y,badges:null,children:h.timestamps?.start!=null&&(0,l.jsx)(nk,{activity:h})});return(0,l.jsxs)(tY,{children:[T,(0,l.jsx)(tZ,{children:(0,l.jsx)(tq,{onReaction:c,onVoiceChannelPreview:d,user:E,channel:r,generateReactionImage:S,reactionImageAltText:eu.intl.formatToPlainString(eu.t.h2yWWX,{username:E.username,activity:f}),entry:a,buttons:v})})]})}var nU=n(56121),nG=n(263577),nF=n(868065),nV=n(352760);let nB=[ed.Y8],nH=[nU.j.WEEK],nW=i.memo(function(e){let{entry:t,channel:n,selected:i}=e,{largeImage:s}=(0,M.nO)({entry:t,trackingSource:"memberlist_top_artist_content_row"}),r=(0,w.TQ)(t);return null!=r&&(0,P.S1)(r,nH)?(0,l.jsxs)(nF.Zp,{selected:i,children:[(0,l.jsxs)(nF.UA,{children:[(0,l.jsx)(nF.Hp,{entry:t,channelId:n.id,guildId:n.guild_id}),(0,l.jsx)(nF.ZB,{children:t.extra.artist.name}),(0,l.jsx)(ed.mG,{location:ed.N5.CARD,children:nB.map((e,n)=>(0,l.jsx)(e,{entry:t},n))})]}),(0,l.jsx)(nG.V,{src:s?.src,size:48,className:nV.xn})]}):null});var nK=n(210528);let nY=function(e){var t,n;let{channel:s,entry:r,onReaction:a,onVoiceChannelPreview:o}=e,{parent_title:c,provider:d,image_url:m}=r.extra.media,h=r.extra.artist.name,p=(0,u.bG)([g.default],()=>g.default.getUser(r.author_id)),{primaryColor:f,secondaryColor:E}=(0,J.A)(m),A=(0,w.TQ)(r),C=i.useCallback(()=>{var e,t,n;let l,i,a,o;if(null==s||null==p||!(0,P.S1)(A,nH))return;let u=(e=r,t=s,n=p,i=function(e){if(e===nU.j.WEEK)return eu.t.SjOZfm}(A),a=L.Ay.getName(t.guild_id,t.id,n),o=e.extra.artist.name,eu.intl.formatToMarkdownString(i,{artist:o,userName:a}).replaceAll("*",""));return nP({user:p,channel:s,mediaImageSrc:m,artist:h,description:u,colors:[f,E],badges:null==(l=(0,w.Pv)(r,nR.K.AGGREGATE_COUNT)?.count)?[]:[{iconPath:et,text:eu.intl.formatToPlainString(eu.t.HtifnG,{count:l})}]})},[m,h,s,r,f,A,E,p]),x=nd(eW.fg2.SPOTIFY);if(null==p||!(0,P.S1)(A,nH))return null;function I(){let e=nO.M0.ALBUM,t=nK.A.isProtocolRegistered()?nO.RQ.PLAYER_OPEN(e,r.extra.media.external_parent_id):nO.RQ.WEB_OPEN(e,r.extra.media.external_parent_id);window.open(t)}return(0,l.jsxs)(tY,{children:[(0,l.jsx)(tQ,{onClickTitle:I,onClickSubtitle:function(){let e=nO.M0.ARTIST,t=nK.A.isProtocolRegistered()?nO.RQ.PLAYER_OPEN(e,r.extra.artist.external_id):nO.RQ.WEB_OPEN(e,r.extra.artist.external_id);window.open(t)},onClickThumbnail:I,channel:s,entry:r,headerIcons:d===nx.X.SPOTIFY?(0,l.jsx)(nm.A,{onClick:x,Icon:nb.A,"aria-label":eu.intl.string(eu.t["0ZB/XE"])}):null,userDescription:eu.t.CcVI1T,title:c,subtitle:h,badges:(0,l.jsx)(ed.mG,{location:ed.N5.POPOUT,children:nB.map((e,t)=>(0,l.jsx)(e,{entry:r},t))})}),(0,l.jsx)(tZ,{children:(0,l.jsx)(tq,{onReaction:a,onVoiceChannelPreview:o,user:p,channel:s,generateReactionImage:C,reactionImageAltText:(t=r,n=p,eu.intl.formatToPlainString(eu.t.Osmpr9,{username:n.username,artist:t.extra.artist.name})),entry:r})})]})};var nz=n(977001);let nZ=function(e){var t,n;let{channel:s,entry:r,disableGameProfileLinks:a,onReaction:o,onVoiceChannelPreview:u}=e,{largeImage:c}=(0,M.nO)({entry:r,trackingSource:"memberlist_top_game_content_popout"}),{user:d,details:m,appName:h}=(0,t1.u)(r),{primaryColor:p,secondaryColor:f}=(0,J.A)(c?.src),g=(0,w.ty)(r),E=(0,w.TQ)(r),A=i.useCallback(e=>{if(null!=s&&null!=d&&null!=g&&null!=E&&(0,nz._E)(E)){var t,n,l;let i,a,o;return no({entry:r,applicationImageSrc:c?.src,avatarSrcs:[d.getAvatarURL(s?.guild_id,128)],description:(t=r,n=s,l=d,i=function(e){if(e===nU.j.WEEK)return eu.t["7TXfc6"]}(E),a=L.Ay.getName(n.guild_id,n.id,l),o=t.extra.game_name,eu.intl.formatToMarkdownString(i,{gameName:o,userName:a}).replaceAll("*","")),timestamp:eu.intl.formatToPlainString(eu.t.YL7UE3,{hours:Math.round(g/q.A.Seconds.HOUR)}),colors:[p,f],channelId:e})}},[c?.src,s,g,r,p,E,f,d]);if(null==d||null==g||null==E||!(0,nz._E)(E))return null;let C=null!=r.extra.platform?np[r.extra.platform]:null;return(0,l.jsxs)(tY,{children:[(0,l.jsx)(tQ,{channel:s,headerIcons:null==C?null:(0,l.jsx)(nm.A,{Icon:C,"aria-label":eu.intl.string(eu.t.YR4cHH)}),entry:r,userDescription:eu.t.rPqqts,title:h,subtitle:m,badges:(0,l.jsx)(ed.mG,{location:ed.N5.POPOUT,children:nz.ac.map((e,t)=>(0,l.jsx)(e,{entry:r},t))}),disableGameProfileLinks:a}),(0,l.jsx)(tZ,{children:(0,l.jsx)(tq,{onReaction:o,onVoiceChannelPreview:u,user:d,channel:s,generateReactionImage:A,reactionImageAltText:(t=r,n=d,eu.intl.formatToPlainString(eu.t.tAwI1k,{username:n.username,activity:t.extra.game_name})),entry:r})})]})};var nq=n(514243),n$=n(347306),nJ=n(123917),nX=n(998218);async function nQ(e){let{mediaImageSrc:t,entry:n,avatarSrc:l,description:i,timestamp:s,episodeDescription:r,colors:a,channelId:o}=e,u=n.extra.media_title,c={AvatarImage:l,...null!=t&&{MediaImage:t},...!1};return await Z({assetsToLoad:c,drawImage:function(e){let t,n=a.map((e,t)=>({color:e,stop:t}));e.setSize({w:400,h:120},4),e.drawRoundedGradientRect(n,{x:0,y:120},{x:400,y:0},{x:0,y:0,h:120,w:400},8),e.setColor("white");let l=e.drawRoundedImage("MediaImage",{x:12,y:12},{w:96,h:96},8,{fillMode:B.VZ.Contain});l===B.uS.Failure&&(l=e.drawRoundedImage("ApplicationImage",{x:12,y:12},{w:96,h:96},8)),l===B.uS.Failure&&e.drawPath(V,{x:12,y:12},!0,2+2/3),e.drawRoundedImage("AvatarImage",{x:120,y:12},{w:32,h:32},50),e.setFont({size:16,family:er,weight:500,truncate:B.Kq.Wrap}),e.drawText(i,{x:120,y:64,h:32,w:260},!0),ea({canvas:e,badges:(t=[{iconPath:"M 4 1 C 2.3431 1 1 2.3431 1 4 V 13 C 1 14.6569 2.3431 16 4 16 H 20 C 21.6568 16 23 14.6569 23 13 V 4 C 23 2.3431 21.6568 1 20 1 H 4 Z M 6 18 C 5.4477 18 5 18.4477 5 19 C 5 19.5523 5.4477 20 6 20 H 18 C 18.5523 20 19 19.5523 19 19 C 19 18.4477 18.5523 18 18 18 H 6 Z",text:s}],null!=r&&t.push({iconPath:"M3.11 8H6v10.82c0 .86.37 1.68 1 2.27.46.43 1.02.71 1.63.84A1 1 0 0 0 9 22h10a4 4 0 0 0 4-4v-1a2 2 0 0 0-2-2h-1V5a3 3 0 0 0-3-3H4.67c-.87 0-1.7.32-2.34.9-.63.6-1 1.42-1 2.28 0 .71.3 1.35.52 1.75a5.35 5.35 0 0 0 .48.7l.01.01h.01L3.11 7l-.76.65a1 1 0 0 0 .76.35Zm1.56-4c-.38 0-.72.14-.97.37-.24.23-.37.52-.37.81a1.69 1.69 0 0 0 .3.82H6v-.83c0-.29-.13-.58-.37-.8C5.4 4.14 5.04 4 4.67 4Zm5 13a3.58 3.58 0 0 1 0 3H19a2 2 0 0 0 2-2v-1H9.66ZM3.86 6.35ZM11 8a1 1 0 1 0 0 2h5a1 1 0 1 0 0-2h-5Zm-1 5a1 1 0 0 1 1-1h5a1 1 0 1 1 0 2h-5a1 1 0 0 1-1-1Z",text:r}),t),startPosition:120,maxWidth:260})},exportConfigs:{format:B.z5.CloudUpload,quality:1,fileName:`user-reacting-to-${u}.png`.toLowerCase(),fileType:"png",channelId:o}})}let n0=function(e){var t,n;let{channel:s,entry:r,onReaction:a,onVoiceChannelPreview:o}=e,c=(0,u.bG)([g.default],()=>g.default.getUser(r.author_id)),{largeImage:d}=(0,M.nO)({entry:r,trackingSource:"memberlist_watch_content_popout"}),{primaryColor:m,secondaryColor:h}=(0,J.A)(d?.src),p=(0,u.bG)([R.default],()=>R.default.locale),f=nd(eW.fg2.CRUNCHYROLL),E=(0,w.kR)(r.extra.media_assets_large_text),A=i.useCallback(e=>{if(null!=c&&d?.src!=null){var t,n,l;let i,a,o;return nQ({entry:r,mediaImageSrc:d?.src,avatarSrc:c.getAvatarURL(s?.guild_id,128),description:(t=r,n=s,l=c,i=eu.t.LHF6D9,a=L.Ay.getName(n?.guild_id,n?.id,l),o=t.extra.media_title,eu.intl.formatToMarkdownString(i,{mediaTitle:o,userName:a,episodeDescription:t.extra.media_subtitle}).replaceAll("*","")),timestamp:(0,w.As)(r,p),episodeDescription:E,colors:[m,h],channelId:e})}},[s,r,E,p,d?.src,m,h,c]);function C(){if(null==r.extra.url)return;let e=nX.A.safeParseWithQuery(r.extra.url);null!=e&&null!=e.protocol&&null!=e.hostname&&(0,nJ.h)({href:nX.A.format(e),trusted:!1})}return null==c?null:(0,l.jsxs)(tY,{children:[(0,l.jsx)(tQ,{channel:s,entry:r,userDescription:(0,w.JM)(r)?eu.t["LH+Z3y"]:eu.t.YuKgml,title:r.extra.media_title,subtitle:r.extra.media_subtitle,headerIcons:(0,l.jsx)(nm.A,{onClick:f,Icon:n$.k,"aria-label":eu.intl.string(eu.t.jdJYXw)}),badges:(0,l.jsx)(ed.mG,{location:ed.N5.POPOUT,children:nq.R.map((e,t)=>(0,l.jsx)(e,{entry:r},t))}),onClickTitle:C,onClickThumbnail:C}),(0,l.jsx)(tZ,{children:(0,l.jsx)(tq,{onReaction:a,onVoiceChannelPreview:o,user:c,channel:s,generateReactionImage:A,reactionImageAltText:(t=r,n=c,eu.intl.formatToPlainString(eu.t.kCbfbN,{username:n.username,activity:t.extra.media_title})),entry:r})})]})},n1=72;function n2(e){return e?.type===f.S9.CONTENT_INVENTORY?e.entry.content_type===o.ContentInventoryEntryType.PLAYED_GAME&&null!=e.entry.applicationWidgetPreview?n1+32:n1:0}function n3(e){let{entry:t,...n}=e;switch(t.content_type){case o.ContentInventoryEntryType.PLAYED_GAME:return(0,l.jsx)(t3.A,{...n,entry:t});case o.ContentInventoryEntryType.WATCHED_MEDIA:return(0,l.jsx)(nq.A,{...n,entry:t});case o.ContentInventoryEntryType.TOP_GAME:return(0,l.jsx)(nz.Ay,{...n,entry:t});case o.ContentInventoryEntryType.TOP_ARTIST:return(0,l.jsx)(nW,{...n,entry:t});case o.ContentInventoryEntryType.LISTENED_SESSION:return(0,l.jsx)(nC.Ay,{...n,entry:t});case o.ContentInventoryEntryType.LAUNCHED_ACTIVITY:return(0,l.jsx)(A.A,{...n,entry:t});default:return null}}function n4(e){let{entry:t,targetElementRef:n,...i}=e;return t.content_type===o.ContentInventoryEntryType.PLAYED_GAME?(0,l.jsx)(nA,{entry:t,targetElementRef:n,isFirstApplicationOccurrence:i.isFirstApplicationOccurrence??!1}):null}function n6(e){let{closePopout:t,...n}=e;return(0,l.jsx)(n5,{onReaction:(e,l)=>{n.trackRankingItemInteraction(e,{destinationChannelId:l.id,destinationGuildId:l.guild_id}),t()},closePopout:t,onVoiceChannelPreview:e=>{n.trackRankingItemInteraction(tF.PA.VOICE_CHANNEL_PREVIEWED,{destinationChannelId:e.id,destinationGuildId:e.guild_id})},...n})}function n5(e){let{entry:t,...n}=e;switch(t.content_type){case o.ContentInventoryEntryType.PLAYED_GAME:return(0,l.jsx)(nf,{...n,entry:t});case o.ContentInventoryEntryType.WATCHED_MEDIA:return(0,l.jsx)(n0,{...n,entry:t});case o.ContentInventoryEntryType.TOP_GAME:return(0,l.jsx)(nZ,{...n,entry:t});case o.ContentInventoryEntryType.TOP_ARTIST:return(0,l.jsx)(nY,{...n,entry:t});case o.ContentInventoryEntryType.LISTENED_SESSION:return(0,l.jsx)(nD,{...n,entry:t});case o.ContentInventoryEntryType.LAUNCHED_ACTIVITY:return(0,l.jsx)(t2,{...n,entry:t});default:return null}}let n7=i.createContext(void 0),n8=i.memo(function(e){let{index:t,ref:s,...o}=e,f=i.useRef(null),[A,C]=i.useState("default"),[x,I]=i.useState(!1),_=(0,a.rm)(`${t}`),S=g.default.getCurrentUser()?.isStaff(),{isRich:y,appName:v}=(0,t1.u)(o.entry);(0,p.T2)(o.entry.id);let T=i.useMemo(()=>({entry:o.entry,channelId:o.channel.id,guildId:o.channel.guild_id,requestId:o.requestId,richPresenceName:y?v:void 0}),[v,o.channel.guild_id,o.channel.id,o.entry,o.requestId,y]),N=i.useRef(!1),[j,b]=i.useState(!1),[R,P]=i.useState(!1),L=(0,u.bG)([h.Ay],()=>h.Ay.keyboardModeEnabled);i.useEffect(()=>{j&&L&&P(!0)},[j,L]),i.useLayoutEffect(()=>{null!=f.current&&I(!0)},[]);let M=i.useCallback(e=>{S&&(0,m.L3)(e,async()=>{let{default:e}=await Promise.all([n.e("86456"),n.e("89346")]).then(n.bind(n,949881));return()=>(0,l.jsx)(e,{entry:o.entry,requestId:o.requestId})})},[o,S]),O=i.useCallback(()=>{C(String(Date.now()))},[]),w=i.useCallback(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,E.I)(e,{...T,...t})},[T]),k=i.useMemo(()=>r().throttle(e=>{(0,E.I)(tF.PA.CARD_POPOUT_OPEN,e)},2e3,{leading:!0,trailing:!1}),[]);function D(){N.current=!1,setTimeout(()=>{N.current||(b(!1),P(L))},100)}return(0,l.jsxs)(l.Fragment,{children:[x&&(0,l.jsx)(n4,{...o,targetElementRef:f}),(0,l.jsx)("div",{ref:s,onMouseEnter:()=>{N.current=!0,setTimeout(()=>{N.current&&b(!0),k(T)},100)},onMouseLeave:D,children:(0,l.jsx)(c.Y,{targetElementRef:f,renderPopout:e=>{let{closePopout:t}=e;return(0,l.jsx)(n7.Provider,{value:D,children:(0,l.jsx)(n6,{closePopout:t,updatePopoutPosition:O,trackRankingItemInteraction:w,...o})})},position:"left",shouldShow:j,positionKey:A,onRequestOpen:()=>k(T),onRequestClose:()=>{R&&D()},spacing:8,children:(e,t)=>{let{isShown:n}=t;return(0,l.jsx)(d.D,{...e,..._,role:"button",innerRef:f,focusProps:{offset:{top:4,bottom:4,left:4,right:4}},onClick:()=>{j||b(!0)},onContextMenu:M,children:(0,l.jsx)(n3,{...o,selected:n,hovered:N.current,trackRankingItemInteraction:w})})}})})]})})}