Module 201349

35,584 characters · in 381faf2c40dd0284.js
Dependencies
Source Raw
function(e,t,n){"use strict";n.d(t,{HG:()=>na,Sk:()=>nm,C:()=>nr,v7:()=>nu,Zx:()=>nl,L0:()=>nd,N_:()=>no,MD:()=>np,Ay:()=>ng,uW:()=>nf,NO:()=>ns,ck:()=>nh,ml:()=>nc,Vu:()=>ni});var l=n(627968),i=n(64700),s=n(503698),r=n.n(s),a=n(143236),o=n(284009),c=n.n(o),u=n(942381),d=n(607399),h=n(136722),m=n(17928),p=n(192308),f=n(187322),g=n(511274),x=n(465532),A=n(765671),C=n(775602),E=n(793574),I=n(688810),y=n(177640),S=n(989837),v=n(289873),N=n(268218),_=n(750506),T=n(60809),j=n(375708),b=n(131552);let R={width:500,height:T.$V},O=(0,N.Fe)({createPromise:()=>Promise.all([n.e("83004"),n.e("67506"),n.e("93010"),n.e("86522"),n.e("23531"),n.e("15680"),n.e("63202"),n.e("34552"),n.e("93103"),n.e("71210"),n.e("88342"),n.e("42451"),n.e("98965"),n.e("71273"),n.e("35313"),n.e("80854"),n.e("35395"),n.e("43780"),n.e("54975"),n.e("8362"),n.e("71133"),n.e("54625"),n.e("49697"),n.e("27773"),n.e("52229"),n.e("61268"),n.e("18024"),n.e("78195"),n.e("37977"),n.e("22261"),n.e("41701"),n.e("74021"),n.e("37065"),n.e("22094"),n.e("83518"),n.e("61764"),n.e("59848"),n.e("68974"),n.e("56385"),n.e("59132"),n.e("66822"),n.e("35621")]).then(n.bind(n,854379)),webpackId:854379,renderLoader:()=>(0,l.jsx)("div",{className:b.R4,style:R,children:(0,l.jsx)(v.y,{})})}),M={height:T.$V},L=i.memo(function(e){let{positionTargetRef:t,align:n,...i}=e;return(0,l.jsx)("span",{style:T.sK,children:(0,l.jsx)(_.nE,{className:b.T8,targetRef:t,position:"top",align:n??"right",spacing:24,autoInvert:!0,nudgeAlignIntoViewport:!0,clickTrap:!0,children:e=>{let{isPositioned:t}=e;return(0,l.jsx)("section",{className:b.V6,role:"dialog",style:M,"aria-label":j.intl.string(j.t["3CNGLK"]),children:t&&(0,l.jsx)(O,{...i})})}})})});var w=n(861382),k=n(735438),P=n.n(k),D=n(537652),U=n(155718),G=n(95561),V=n(659280),F=n(579940),H=n(962125),B=n(915089),W=n(850992),K=n(464651),z=n(286509),Z=n(721768),Y=n(842209),q=n(210978),J=n(392054),$=n(168186),X=n(990078),Q=n(939249),ee=n(802019),et=n(649671),en=n(282214);let el=[16,8,8,8];function ei(e){let{className:t,channel:n,sections:s,activeCategoryIndex:a,filteredSectionId:o,onSectionClick:c,applicationCommandListRef:u}=e,d=i.useRef(null),h=i.useCallback((e,t)=>{let n=8;return s[t+1]?.type===J.Hf.BUILT_IN&&(n+=8),32+n},[s]),m=i.useCallback((e,t)=>t?8*(s[e+1]?.type!==J.Hf.BUILT_IN):8*(0!==e),[s]),p=i.useCallback((e,t)=>{let i=s[t];if(null==i)return;let r=(0,et.Rg)(i),u=4*(i.type===J.Hf.BUILT_IN),d=32-2*u,h=(0,l.jsx)(r,{channel:n,section:i,isSelected:null!=o?i.id===o:a===t,padding:u,width:d,height:d,selectable:!0}),m=i.type!==J.Hf.BUILT_IN&&t<s.length-1&&s[t+1].type===J.Hf.BUILT_IN;return(0,l.jsxs)("div",{className:en.uW,children:[(0,l.jsx)(X.m,{text:i.name,position:"right",asContainer:!0,children:(0,l.jsx)(Q.D,{"aria-label":i.name,onClick:()=>{c(i)},children:h})}),m?(0,l.jsx)("hr",{className:en.zQ}):null]},i.id)},[a,n,c,s,o]);return 0===s.length?null:(0,l.jsx)("div",{className:r()(t,en.iE),children:(0,l.jsx)(ee.A,{categoryListRef:d,expressionsListRef:u,store:W.LS,categories:s,className:en.p_,renderCategoryListItem:p,rowCount:s.length,categoryHeight:h,listPadding:el,getScrollOffsetForIndex:m})})}var es=n(746388),er=n(73510),ea=n(652215),eo=n(13297),ec=n(911385);let eu=[8,8,0,8],ed=P().debounce(()=>{(0,G.zV)(ea.HAw.APPLICATION_COMMAND_BROWSER_SCROLLED)},300),eh=i.forwardRef(function(e,t){let{channel:n,canOnlyUseTextCommands:s}=e,a=i.useRef(!1),o=i.useRef(0),[c,u]=i.useState(0),d=i.useRef(null),[h,m]=i.useState(!1),p=W.LS.useStore(e=>e.activeCategoryIndex);i.useEffect(()=>{(0,G.zV)(ea.HAw.APPLICATION_COMMAND_BROWSER_OPENED)},[]);let{sectionDescriptors:f,activeSections:g,commandsByActiveSection:x,hasMoreAfter:A,commands:C,filteredSectionId:E,scrollDown:I,filterSection:y}=Y.cu({context:{channel:n,type:"channel"},filters:{commandTypes:[U.kc.CHAT],builtIns:s?q.n.ONLY_TEXT:q.n.ALLOW,applicationCommands:!s},options:{placeholderCount:7,limit:er.Hi,includeFrecency:!0},allowFetch:!0}),S=(0,K.Fk)({activeCategoryIndex:p,isScrolling:a,listRef:d,onActiveCategoryIndexChange:e=>{let t=g[e];if(null!=t){let e=f.findIndex(e=>e.id===t.id);W.LS.setActiveCategoryIndex(e)}},scrollOffset:20,searchQuery:""}),v=e=>{let t=g.length,n=x.reduce((e,t)=>e+t.data.length,0)-7*!!A;A&&e+420>48*t+56*n-512&&I(),S(e),ed(),o.current=e},N=i.useRef(v);i.useEffect(()=>{N.current=v}),i.useEffect(()=>{N.current(o.current)},[C]);let _=i.useCallback(e=>e!==g.length-1||A?16:0,[g.length,A]),T=x.map(e=>e.data.length);i.useEffect(()=>{null!=d.current&&h&&null!=c&&d.current.scrollRowIntoView(c)},[h,c]),i.useLayoutEffect(()=>{null!=E&&d.current?.scrollToSectionTop(0)},[C,E]);let b=i.useCallback(e=>{e.id===E||e.id===er.Ik.FRECENCY?(y(null),d.current?.scrollToSectionTop(0)):y(e.id)},[y,E]),R=i.useCallback((e,t,l)=>{Z.Gf({channelId:n.id,command:e,section:t,location:J.Oh.DISCOVERY,triggerSection:l})},[n.id]);i.useImperativeHandle(t,()=>({onTabOrEnter:e=>{if(null==c)return!e&&(u(0),!0);if(null==c)return!1;let t=0,n=0;for(let e of x)if(t=n,c<(n+=e.data.length)){let n=e.data[c-t],l=f.find(e=>e.id===n.applicationId);R(n,l,(0,$.$S)(e.section));break}return!0},onMoveSelection:e=>{if(0===C.length)return!0;let t=7*!!A,n=C.length+t,l=null==c?0:c+e;return l>=n?l=n-1:l<0&&(l=0),u(l),m(!0),!0}}),[C.length,x,A,f,R,c]);let O=i.useCallback(e=>{let t=g[e];if(null==t)return null;let i=(0,et.Rg)(t),s=(0,l.jsx)(i,{channel:n,section:t,width:16,height:16,padding:0});return(0,l.jsx)(z.A,{className:eo.Km,icon:s,children:t.name},e)},[n,g]),M=i.useCallback((e,t)=>{let n=e===g.length-1,i=g[e],{data:s}=x[e];return(0,l.jsxs)("ul",{role:"group","aria-label":i.name,className:r()(eo.Wy,{[eo.YD]:n}),children:[t,0===s.length&&(0,l.jsx)(D.A,{message:j.intl.format(j.t.WoQXT6,{applicationName:i.name}),noResultsImageURL:ec,className:eo.qK})]},e)},[g,x]),L=i.useCallback((e,t)=>{let i=x[t.sectionIndex],s=i.data[t.sectionRowIndex],r=`${i.section.id}:${s?.id??e}`;if(null==s||i.section.id!==s.applicationId&&i.section.id!==er.Ik.FRECENCY||s.inputType===J.y$.PLACEHOLDER)return(0,l.jsx)(es.A,{},r);let a=f.find(e=>e.id===s.applicationId);return(0,l.jsx)(V.Ay.NewCommand,{index:e,command:s,channel:n,className:eo.D5,selected:c===e,showImage:i.section.id!==s.applicationId,section:a,onClick:()=>R(s,a,(0,$.$S)(i.section)),onHover:()=>{u(null),m(!1)}},r)},[n,x,R,f,c]),w=(0,B.GV)();return(0,F.gf)(w,!0,(0,V.aI)(c)),i.useEffect(()=>()=>{(0,F.nQ)()},[]),(0,l.jsxs)(V.Ay,{id:w,className:eo.x9,innerClassName:eo.iE,onMouseDown:em,children:[(0,l.jsx)(ei,{className:eo.H$,channel:n,sections:f,filteredSectionId:E,activeCategoryIndex:p,onSectionClick:b,applicationCommandListRef:d}),(0,l.jsx)(H.A,{role:"listbox",className:eo.p_,listPadding:eu,onScroll:v,renderRow:L,renderSection:M,renderSectionHeader:O,rowCount:g.length,rowCountBySection:T,rowHeight:56,sectionHeaderHeight:32,sectionMarginBottom:_,ref:d,stickyHeaders:!0})]})});function em(e){e.preventDefault()}var ep=n(702841),ef=n(305070),eg=n(31498),ex=n(598071),eA=n(151271),eC=n(731231),eE=n(256265),eI=n(703244),ey=n(857071),eS=n(135621),ev=n(105330),eN=n(495544),e_=n(559908),eT=n(620141),ej=n(224964),eb=n(31408),eR=n(536283);function eO(e){let{editorHeight:t,textValue:n,channelId:l}=e,s=i.useRef(n),r=(0,ev.l)({editorHeight:t}),a=(0,ej.A)(),o=(0,m.bG)([e_.Ay,eN.default],()=>e_.Ay.isComboing(eN.default.getId(),l)),c=r?.left??0,u=(r?.top??0)-16,d=0===n.length,h=i.useMemo(()=>.05>Math.random(),[d]);return i.useEffect(()=>{0!==n.length&&n!==s.current&&o&&(a.fire(c,u,h?{sprite:eR.dR}:null),s.current=n)},[n,o,c,u,h,a]),null}function eM(e){return(0,l.jsx)(eT.A,{confettiLocation:eb.k.CHAT_INPUT,children:(0,l.jsx)(eO,{...e})})}var eL=n(931664),ew=n(631576),ek=n(68935),eP=n(406704),eD=n(885386),eU=n(696451),eG=n(576705),eV=n(309010),eF=n(638128),eH=n(522602),eB=n(287809),eW=n(821102),eK=n(174459),ez=n(234320),eZ=n(625494),eY=n(488926),eq=n(723702),eJ=n(486319),e$=n(355622),eX=n(383442),eQ=n(834730),e0=n(140735),e1=n(463930),e2=n(935063),e6=n(252545),e3=n(763754),e7=n(967144),e4=n(118517),e5=n(976860),e8=n(747926),e9=n(232835),te=n(285796),tt=n(630816);function tn(e){let{onClick:t,"aria-label":n}=e;return(0,l.jsx)(Q.D,{className:tt.b,onClick:t,"aria-label":n,children:(0,l.jsx)(te.a,{size:"md",color:"currentColor",className:tt.u})})}var tl=n(1468);let ti="channel-reply-bar-a11y-description";function ts(e){let{channel:t,message:n,replyChainLength:s}=e,r=i.useRef(s);return i.useEffect(()=>{r.current=s}),i.useEffect(()=>{(0,G.zV)(ea.HAw.THREAD_NUDGE_SHOWN,{type:"Reply Chain (3)",reply_chain_length:r.current+1,channel_id:t.id,guild_id:t.guild_id})},[t]),(0,l.jsxs)(Q.D,{onClick:function(){(0,e4.Jx)(t.id),(0,e8.Tv)(t,n,"Reply Chain Nudge")},className:tl._r,focusProps:{offset:{right:-4,left:-4}},children:[(0,l.jsx)(eQ.E,{color:"text-default",className:tl.Qq,variant:"text-sm/normal",children:j.intl.format(j.t.B3V0FM,{count:Math.min(10,s+1)})}),(0,l.jsx)(eQ.E,{color:"text-link",className:tl.NG,variant:"text-sm/semibold",children:j.intl.string(j.t.rBIGBL)})]})}function tr(e){let t,n,{reply:i,chatInputType:s}=e,{channel:a,message:o,shouldMention:c,showMentionToggle:u}=i,{guildId:d,nick:h,colorString:p,colorStrings:f,colorRoleName:g,authorId:x,displayNameStyles:A}=(0,e3.Ay)(o),C=(0,e7.gn)(d,x,f),E=(0,e6.a)({displayNameStyles:A}),I=(t=a.id,n=o.id,(0,m.bG)([e9.A],()=>{let e=n;for(let n=0;n<10;n++){let l=e9.A.getMessage(t,e);if(l?.type!==ea.lAJ.REPLY||null==l.messageReference)return n;e=l.messageReference.message_id}return 10},[t,n])),y=(0,eP.n)(a,o),S=s.showThreadPromptOnReply&&I>=2&&y;return(0,l.jsx)("div",{className:tl.e1,children:(0,l.jsxs)("div",{className:tl.kL,children:[(0,l.jsxs)("div",{className:tl.eU,children:[(0,l.jsx)(e0.A,{id:ti,children:j.intl.formatToPlainString(j.t.EpJL4E,{username:h})}),(0,l.jsx)(Q.D,{onClick:()=>(0,e5.pX)(ea.BVt.CHANNEL(a.getGuildId(),a.id,o.id)),focusProps:{offset:{top:-8,right:-4,bottom:-8,left:-4}},children:(0,l.jsx)(eQ.E,{color:"text-default",className:r()(tl.Qq,tl.Fn),variant:"text-sm/normal",children:j.intl.format(j.t["8E4GxS"],{userHook:(e,t)=>(0,l.jsx)(e1.g,{className:tl.UU,name:h,colorString:p,colorStrings:C,roleName:g,displayNameStylesFont:E},t)})})}),(0,l.jsxs)("div",{className:tl.o1,children:[u&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(X.m,{asContainer:!0,text:c?j.intl.string(j.t.DH2o6R):j.intl.string(j.t.utGGIY),children:(0,l.jsx)(Q.D,{role:"switch","aria-checked":c,onClick:function(e){e.stopPropagation(),(0,e4.vz)(a.id,!c)},children:(0,l.jsxs)(eQ.E,{variant:"text-sm/bold",color:c?"text-link":"text-muted",className:tl.Z4,children:[(0,l.jsx)(e2.X,{size:"md",color:"currentColor","aria-label":j.intl.string(j.t.P8tvKG),className:tl.mM}),c?j.intl.string(j.t.p9jC2r):j.intl.string(j.t.U7f3bK)]})})}),(0,l.jsx)("div",{className:tl.me,"aria-hidden":!0})]}),(0,l.jsx)(tn,{onClick:function(e){e.stopPropagation(),(0,e4.Jx)(a.id)},"aria-label":j.intl.string(j.t.jSnJGT)})]})]}),S&&(0,l.jsx)(ts,{channel:a,message:o,replyChainLength:I})]})})}var ta=n(749314),to=n(148355),tc=n(74995);let tu=i.memo(function(e){let{channelId:t,chatInputType:n}=e,[s,r]=i.useState(null),a=(0,m.bG)([eL.A],()=>eL.A.getStickerPreview(t,n.drafts.type));return n.stickers?.allowSending&&null!=a&&0!==a.length?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:tc.Tz,children:a.map(e=>(0,l.jsxs)("div",{className:tc.dp,children:[(0,l.jsx)(Q.D,{onFocus:()=>r(e.id),onBlur:()=>r(null),className:tc.b,"aria-label":j.intl.formatToPlainString(j.t.BGAQRd,{name:e.name}),onClick:()=>(0,ew.x5)(t,n.drafts.type),children:(0,l.jsx)("div",{className:tc.Nk,children:(0,l.jsx)(te.a,{size:"md",color:"currentColor",className:tc.ut})})}),(0,l.jsx)(to.A,{isInteracting:s===e.id,className:tc.UV,size:48,sticker:e})]},e.id))}),(0,l.jsx)(ta.A,{className:tc.R})]}):null});var td=n(612394);n(321073);var th=n(442433);n(827669);var tm=n(448702);function tp(e){let t,s,a,{className:o,activeCommand:c,activeOption:u,optionStates:d,channelId:h}=e,m=i.useCallback(e=>{let t=c?.rootCommand?.id;null==t?e.preventDefault():(0,th.L3)(e,async()=>{let{default:e}=await n.e("15687").then(n.bind(n,646938));return n=>(0,l.jsx)(e,{...n,id:t,label:j.intl.string(j.t.oJ1Muw)})})},[c?.rootCommand?.id]),p=i.useCallback(()=>{Z.Gf({channelId:h,command:null,section:null})},[h]);if(null==c)return null;if(null!=u){let e=d[u.name].lastValidationResult;t=u.displayName,s=u.displayDescription,a=e?.success?null:e?.error}else t=`/${c.displayName}`,s=c.displayDescription,a=null;return(0,l.jsxs)("div",{className:r()(o,tm.M0),onContextMenu:m,children:[(0,l.jsxs)("div",{className:tm.iz,children:[(0,l.jsx)("span",{className:tm.UU,children:t}),null!=a?(0,l.jsx)("span",{className:tm.z3,children:a}):(0,l.jsx)("span",{className:tm.h_,children:s})]}),(0,l.jsx)("div",{className:tm.o1,children:(0,l.jsx)(tn,{onClick:p,"aria-label":j.intl.string(j.t.cpT0Cq)})})]})}var tf=n(228366),tg=n(734057);let tx=new Set;class tA extends m.Ay.PersistedStore{static displayName="PTOStore";static persistKey="PTOStore";initialize(e){this.waitFor(tg.A,eU.Ay,eV.A,eB.default),null!=e&&(tx=new Set(e))}hasId(e){return tx.has(e)}getState(){return[...tx]}}let tC=new tA(tf.h,{}),tE=()=>{let e=eV.A.getChannelId();if(null==e)return;let t=tg.A.getChannel(e);null!=t&&t.isPrivate()&&(tx.has(t.getRecipientId())||(tx.add(t.getRecipientId()),tC.emitChange()))},tI=()=>(0,l.jsxs)("div",{className:tl.eU,children:[(0,l.jsx)(eQ.E,{variant:"text-sm/medium",className:r()(tl.Qq,tl.Fn),children:j.intl.string(j.t["2UvR1E"])}),(0,l.jsx)("div",{className:tl.o1,children:(0,l.jsx)(tn,{onClick:tE,"aria-label":j.intl.string(j.t.cpT0Cq)})})]});var ty=n(278351);let tS=e=>{let{error:t}=e;return(0,l.jsxs)("div",{className:ty.M,children:[(0,l.jsx)(eQ.E,{variant:"text-xs/bold",color:"text-strong",children:j.intl.string(j.t["4VDCG0"])}),t?(0,l.jsx)(eQ.E,{variant:"text-xs/medium",className:ty.z,children:j.intl.string(j.t.qNorwt)}):(0,l.jsx)(eQ.E,{variant:"text-xs/medium",color:"text-muted",children:j.intl.string(j.t["260qZS"])})]})};var tv=n(575293),tN=n(151282),t_=n(1372);function tT(e){let{pendingScheduledMessage:t}=e,{channelId:n,scheduledTimestamp:i}=t;return(0,l.jsx)("div",{className:t_.e1,children:(0,l.jsx)("div",{className:t_.kL,children:(0,l.jsxs)("div",{className:t_.g3,children:[(0,l.jsx)(eQ.E,{color:"text-default",className:r()(t_.Qq,t_.a3),variant:"text-sm/normal",children:j.intl.formatToPlainString(j.t["MQcRX/"],{timestamp:new Date(i).valueOf()})}),(0,l.jsx)("div",{className:t_.o1,children:(0,l.jsx)(tn,{onClick:function(e){e.stopPropagation(),(0,tN.Ps)(n)},"aria-label":j.intl.string(j.t.cpT0Cq)})})]})})})}var tj=n(266599);function tb(e){let{bars:t}=e,n=t.stacked.map((e,t)=>(0,l.jsx)("div",{children:e},t)),s=t.floating.map((e,t)=>(0,l.jsx)(i.Fragment,{children:e},t));return 0===n.length&&0===s.length?null:(0,l.jsxs)(i.Fragment,{children:[s.length>0&&(0,l.jsx)("div",{className:tj.Vq,children:s}),n.length>0&&(0,l.jsx)("div",{className:tj.MD,children:n})]})}var tR=n(729666),tO=n(562708),tM=n(150934),tL=n(139286),tw=n(47167),tk=n(713654),tP=n(252263),tD=n(8455),tU=n(67259),tG=n(355026);function tV(e){let{thread:t,pendingScheduledMessage:n}=e,s=(0,tD.Vp)({location:"ThreadsAlsoSendToChannelArea"}),[r,a]=(0,m.yK)([tg.A,tU.A],()=>[t.isThread()?tg.A.getChannel(t.parent_id):null,tU.A.getAlsoSendToChannel(t.id)]),o=(0,tw.Ay)(r),c=i.useCallback(e=>{eK.default.track(ea.HAw.MESSAGE_ALSO_SEND_TO_CHANNEL_TOGGLED,{value:e,guild_id:t.guild_id,channel_id:t.id}),(0,tP.B)({channelId:t.id,enabled:e})},[t]);if((0,tL.A)({name:tO.ImpressionNames.MESSAGE_ALSO_SEND_TO_CHANNEL,type:tO.ImpressionTypes.VIEW},{disableTrack:null==r||!s.enabled},[r,s.enabled]),!s.enabled||null==r)return null;let u=(0,tk.gU)(r),d=j.intl.format(j.t.UqL10G,{callToActionHook:(e,t)=>(0,l.jsx)(eQ.E,{variant:"text-sm/normal",color:"text-subtle",lineClamp:1,className:tG.Pf,children:j.intl.string(j.t.Pi3JW7)},t),channelName:o,channelNameHook:(e,t)=>(0,l.jsxs)(eQ.E,{variant:"text-sm/normal",color:"text-subtle",lineClamp:1,className:tG.Pf,children:[null==u?null:(0,l.jsx)(u,{color:"currentColor",className:tG.Kk},t),e]},t)});return(0,l.jsx)("div",{className:tG.kL,children:(0,l.jsx)(tM.S,{checked:a,disabled:null!=n,onChange:c,label:d,labelType:"secondary"})})}function tF(e){let{channel:t,type:n,pendingScheduledMessage:i}=e,{shouldShow:s}=function(e){let{channel:t,type:n}=e,l=(0,m.bG)([tg.A],()=>{let e=tg.A.getChannel(t.parent_id);return e?.isForumLikeChannel()??!1}),i=[e$.oU.NORMAL,e$.oU.SIDEBAR].includes(n);return{shouldShow:t.isThread()&&!l&&i}}({channel:t,type:n});return s?(0,l.jsx)(tV,{thread:t,pendingScheduledMessage:i}):null}var tH=n(822610),tB=n(625928),tW=n(670482),tK=n(621466),tz=n(902001),tZ=n(899536),tY=n(74833),tq=n(216964),tJ=n(387758),t$=n(39623),tX=n(267102),tQ=n(186306),t0=n(339871),t1=n(820066),t2=n(128934);function t6(e){let{editorRef:t,options:n,iconClassName:i,dividerClassName:s}=e,a=t.current?.getSlateEditor();return null==a?null:(0,l.jsxs)("div",{className:t2.Uo,children:[(0,l.jsx)(t7,{slateEditor:a,markdownSyntax:"bold",children:(0,l.jsx)(tz.$,{size:"md",color:"currentColor",className:r()(t2.Kk,i)})}),(0,l.jsx)(t7,{slateEditor:a,markdownSyntax:"italics",children:(0,l.jsx)(tZ.y,{size:"md",color:"currentColor",className:r()(t2.Kk,i)})}),(0,l.jsx)(t7,{slateEditor:a,markdownSyntax:"strikethrough",children:(0,l.jsx)(tY.t,{size:"md",color:"currentColor",className:r()(t2.Kk,i)})}),(0,l.jsx)("div",{className:r()(t2.yF,s)}),!n?.disableBlockQuotes&&(0,l.jsx)(t4,{slateEditor:a,blockType:"blockQuote",children:(0,l.jsx)(tq.c,{size:"md",color:"currentColor",className:r()(t2.Kk,i)})}),!n?.disableInlineCode&&(0,l.jsx)(t7,{slateEditor:a,markdownSyntax:"inlineCode",children:(0,l.jsx)(tJ.G,{size:"custom",width:20,height:20,color:"currentColor",className:r()(t2.Kk,i)})}),(0,l.jsx)(t7,{slateEditor:a,markdownSyntax:"spoiler",children:(0,l.jsx)(t$.b,{size:"md",color:"currentColor",className:r()(t2.Kk,i)})})]})}let t3=i.forwardRef(function(e,t){let{editorRef:n,containerRef:s,options:r}=e,a=i.useRef(null),[o,c]=i.useState(!1),u=i.useRef(null),d=i.useContext(tX.Ay),h=i.useCallback(()=>{c(!1),clearTimeout(u.current)},[]),m=i.useCallback(e=>{let t=d.renderWindow;e.target instanceof t.Node&&a.current?.contains(e.target)||h()},[d,h]),p=i.useCallback(e=>{let t=d.renderWindow;if(e.target instanceof t.Element)if(0!==e.button)h();else{let n=e.target instanceof t.Node&&a.current?.contains(e.target);clearTimeout(u.current),u.current=setTimeout(()=>{let t=(0,tK.BF)(e)?.activeElement,l=s.current;c(n||null!=t&&null!=l&&l.contains(t))},100)}else h()},[d,s,h]);i.useImperativeHandle(t,()=>({hide:h}),[h]),i.useEffect(()=>{let e=d.renderWindow;return e.document.addEventListener("keydown",h),e.document.addEventListener("mousedown",m),e.document.addEventListener("mouseup",p),e.addEventListener("focus",h),e.addEventListener("blur",h),()=>{e.document.removeEventListener("keydown",h),e.document.removeEventListener("mousedown",m),e.document.removeEventListener("mouseup",p),e.removeEventListener("focus",h),e.removeEventListener("blur",h),clearTimeout(u.current)}},[d,h,m,p]);let{x:f,y:g}=i.useMemo(()=>{let e=n.current?.getSlateEditor();if(e?.selection==null||t1.ZF.isCollapsed(e.selection)||!o)return{x:null,y:null};let t=tW.rL.findDocumentOrShadowRoot(e),l=t.getSelection();if(null==l||null==l.focusNode||null==l.anchorNode||l.isCollapsed)return{x:null,y:null};let i=t.createRange();i.setStart(l.focusNode,l.focusOffset),i.setEnd(l.focusNode,l.focusOffset);let r=i.getBoundingClientRect(),a=t.createRange();a.setStart(l.anchorNode,l.anchorOffset),a.setEnd(l.anchorNode,l.anchorOffset);let c=a.getBoundingClientRect(),u=t.createRange();u.setStart(l.anchorNode,l.anchorOffset),u.setEnd(l.focusNode,l.focusOffset);let d=u.getBoundingClientRect(),h=r.x===c.x,m=h?d.x:Math.min(r.x,c.x);return{x:m+((h?d.x+d.width:Math.max(r.x,c.x))-m)/2,y:Math.max(s.current?.getBoundingClientRect()?.y??0,Math.min(c.y,r.y))}},[s,o,n]),[x,A]=i.useState(0),[C,E]=i.useState(0);return(i.useLayoutEffect(()=>{if(null==f||null==g||null==a.current)return;let e=a.current.getBoundingClientRect();E(e.width/2),A(e.height+12)},[f,g]),null==f||null==g||null==n.current?.getSlateEditor())?null:(0,l.jsx)(_.Ay,{children:(0,l.jsx)("div",{id:"slate-toolbar",ref:a,className:t2.KE,style:{top:g-x,left:f-C},onMouseDown:e=>{e.stopPropagation()},onMouseUp:e=>{e.stopPropagation()},children:(0,l.jsx)(t6,{editorRef:n,options:r})})})});function t7(e){let{slateEditor:t,markdownSyntax:n,children:i}=e,s=!1;if(t?.selection!=null){let[e,l]=t1.ZF.edges(t.selection);s=null!=(0,t0.Sx)(t,e,l).before[n]}return(0,l.jsx)(f.vN,{children:(0,l.jsx)("button",{"aria-pressed":s,className:t2.x6,onClick:()=>{null!=t&&tQ.o.withSingleEntry(t,()=>(0,t0.Px)(t,n))},children:i})})}function t4(e){let{blockType:t,slateEditor:n,children:i}=e,s=null!=n?t1.VW.getCurrentBlock(n):null,r=null!=s&&t1.AS.isType(s[0],t);return(0,l.jsx)(f.vN,{children:(0,l.jsx)("button",{"aria-pressed":r,className:t2.x6,onClick:()=>{null!=n&&tQ.o.withSingleEntry(n,()=>(0,t0.fO)(n,t))},children:i})})}var t5=n(922016),t8=n(375499),t9=n(267889),ne=n(307731);function nt(e){let{editorRef:t,type:n,channel:s}=e,r=t.current?.getSlateEditor(),a=i.useRef(null),o=i.useCallback(e=>{let{emoji:n,willClose:l}=e,i=t.current;null!=n&&null!=i&&i.insertEmoji({emoji:n,willClose:l}),l&&(0,eA.v8)()},[t]);return null==r?null:(0,l.jsxs)("div",{id:"slate-toolbar",className:t2.aL,children:[(0,l.jsx)("div",{className:t2.Wy,children:(0,l.jsx)(t6,{editorRef:t,options:n.markdown,iconClassName:t2.C7,dividerClassName:t2.us})}),(0,l.jsx)(t5.Y,{targetElementRef:a,renderPopout:e=>{let{closePopout:t}=e;return(0,l.jsx)(t9.A,{persistSearch:!0,channel:s,closePopout:t,onSelectEmoji:e=>{let{emoji:n,willClose:l}=e;o({emoji:n,willClose:l}),l&&t()},pickerIntention:n.expressionPicker?.emojiIntention??ne.EmojiIntention.COMMUNITY_CONTENT})},position:"bottom",animation:t5.Y.Animation.NONE,align:"left",children:(e,t)=>{let{isShown:n}=t;return(0,l.jsx)(t8.A,{...e,ref:a,active:n,className:t2.Z8,tabIndex:0})}})]})}var nn=n(698279);function nl(e,t,s,r,a){let[o,c]=i.useState(!1),u=i.useCallback((i,d,h,m,f,g)=>{if(o)return;c(!0);let A=eL.A.getStickerPreview(a,t.drafts.type)?.map(e=>e.id)??[],C=eH.A.getUploads(a,t.drafts.type)??[];if(null==d&&!m&&!f&&(0,eE.xz)(C,a)){c(!1),(0,p.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("67506"),n.e("55998"),n.e("93010"),n.e("32245"),n.e("75036"),n.e("24414"),n.e("80797"),n.e("64801"),n.e("12815"),n.e("49681"),n.e("76602"),n.e("34530"),n.e("28229"),n.e("21921"),n.e("39970"),n.e("72789"),n.e("65437"),n.e("79745"),n.e("5500"),n.e("32209"),n.e("49697"),n.e("68763"),n.e("58337"),n.e("18997"),n.e("26437"),n.e("98972"),n.e("12682"),n.e("33097"),n.e("99011"),n.e("36150"),n.e("15172"),n.e("10014"),n.e("86861"),n.e("70961"),n.e("23685"),n.e("42516"),n.e("84688")]).then(n.bind(n,538899));return t=>(0,l.jsx)(e,{...t,threadId:a,attachments:C,sendMessage:()=>u(i,void 0,void 0,void 0,!0)})});return}e({value:i,uploads:C,stickers:A,command:d,commandOptionValues:h,isGif:m,gifMetadata:g}).then(e=>{let{shouldClear:n,shouldRefocus:l}=e,i=(n&&t.submit?.clearOnSubmit)??!1,o=null!=s.current;i&&(a!==eV.A.getChannelId()?x.A.saveDraft(a,"",t.drafts.type):o&&(s.current?.clearValue(),r.current?.hide())),o&&(c(!1),(0,eA.v8)(),l&&s.current?.focus())})},[s,r,e,o,t,a]);return{submitting:o,submit:u,handleSubmit:i.useCallback(e=>{s?.current?.submit(e)},[s])}}function ni(e,t,n){return i.useCallback(l=>{if(t===e$.oU.CREATE_FORUM_POST||t===e$.oU.CREATE_ANNOUNCEMENT_POST)n.current?.insertGIF(l);else{let t={gif_provider:l.provider??(0,eI.cf)(),load_id:eW.A.getAnalyticsID(),source_object:"GIF Picker",gif_url:l.url,gif_id:l.id};e(l.url,void 0,void 0,!0,void 0,t)}(0,eA.v8)(),n.current?.focus()},[n,e,t])}function ns(e){return i.useCallback(t=>{let{emoji:n,willClose:l}=t,i=e.current;null!=n&&null!=i&&i.insertEmoji({emoji:n,willClose:l}),l&&(0,eA.v8)()},[e])}function nr(e){let{editorRef:t,disabled:n,textValue:l,channelId:s,chatInputType:r,submit:a}=e,{analyticsLocations:o}=(0,I.Ay)();return i.useCallback((e,i)=>{n||(r===e$.oU.CREATE_ANNOUNCEMENT_POST||(0,ek.YS)(i,l,s,r.drafts.type)?((0,td.fh)({sticker:e,stickerSelectLocation:i,isReplacement:null!=eL.A.getStickerPreview(s,r.drafts.type),analyticsLocations:o}),(0,ew.$x)(s,e,r.drafts.type)):(a({value:"",uploads:void 0,stickers:[e.id]}),t.current?.clearValue()),(0,eA.v8)(),t.current?.focus())},[n,l,s,t,o,a,r])}function na(e){return i.useCallback(t=>{let n=e.current;null!=n&&n.insertKaomoji(t),(0,eA.v8)(),n?.focus()},[e])}function no(e,t,n){let l=i.useCallback(()=>{t||(0,eA.r$)(nn.kx.EMOJI,e,n)},[t,e,n]),s=i.useCallback(()=>{!t&&e.gifs?.allowSending&&(0,eA.r$)(nn.kx.GIF,e,n)},[t,e,n]),r=i.useCallback(()=>{!t&&e.stickers?.allowSending&&(0,eA.r$)(nn.kx.STICKER,e,n)},[t,e,n]);(0,ez.Vo)({event:ea.jej.TOGGLE_EMOJI_POPOUT,handler:l}),(0,ez.Vo)({event:ea.jej.TOGGLE_GIF_PICKER,handler:s}),(0,ez.Vo)({event:ea.jej.TOGGLE_STICKER_PICKER,handler:r})}function nc(e,t,n){let[l]=i.useState(()=>new a.EventEmitter);return i.useEffect(()=>{l.emit("text-changed",t,n)},[t,n,l]),{eventEmitter:l,handleEditorSelectionChanged:t=>{null!=e.current&&l.emit("selection-changed",t)}}}function nu(){let e=i.useRef(null),t=i.useCallback(()=>{e.current?.onMaybeShowAutocomplete()},[]),n=i.useCallback(()=>{e.current?.onHideAutocomplete()},[]);return{autocompleteRef:e,handleMaybeShowAutocomplete:t,handleHideAutocomplete:n}}function nd(e){let t=i.useRef(null);if(null!=e&&"function"==typeof e)throw Error("Only Ref objects are supported");return null==e?t:e}function nh(e){let[t,n]=i.useState(0);return{editorHeight:t,handleResize:i.useCallback(t=>{n(t??0),e?.(t)},[e])}}function nm(e,t,n,l){let i=e.getGuildId(),s=(0,m.bG)([ey.A],()=>null!=i&&ey.A.isLurking(i),[i]),r=(0,m.bG)([eU.Ay,eB.default],()=>{let e=eB.default.getCurrentUser();return(null!=i&&null!=e?eU.Ay.getMember(i,e.id)?.isPending:null)??!1}),a=(0,m.cf)([eG.A],()=>{let i=e.isPrivate(),s=eG.A.computePermissions(e),a=h.zy(s,ea.xBc.CREATE_PUBLIC_THREADS)||h.zy(s,ea.xBc.CREATE_PRIVATE_THREADS),o=(!t.permissions?.requireCreateTherads||a)&&(!t.permissions?.requireSendMessages||h.zy(s,ea.xBc.SEND_MESSAGES)),c=o&&h.zy(s,ea.xBc.ATTACH_FILES),u=null!=n,d=(0,eP.UJ)(e);return{disabled:l||r||!i&&!o||d,canAttachFiles:!0===t.attachments&&(i||r||c||u),canCreateThreads:a,canEveryoneSendMessages:eY.MJ(ea.xBc.SEND_MESSAGES,e)}},[e,t.permissions.requireCreateTherads,t.permissions.requireSendMessages,t.attachments,n,l,r]);return{isLurking:s,isPendingMember:r,...a}}function np(e,t,n){let[l,s,r]=(0,eA.RQ)(e=>[e.activeView,e.activeViewType,e.activeChannelId],u.x),a=(0,m.bG)([S.A],()=>S.A.shouldShowPopup()&&S.A.activeViewType()===e&&S.A.activeChannelId()===n);i.useEffect(()=>()=>{(0,eA.v8)(e,n)},[e,n]);let o=i.useCallback(()=>{null!=l||a||t.current?.handleOuterClick()},[l,a,t]),c=null==l||null==s||s!==e||r!==n;return{expressionPickerView:l,shouldHideExpressionPicker:c,handleOuterClick:o}}let nf=(e,t)=>({handleAutocompleteVisibilityChange:i.useCallback(n=>{n&&(0,eA.v8)(e,t)},[e,t])}),ng=i.memo(i.forwardRef(function(e,t){let n,{textValue:s,richValue:a,className:o,innerClassName:u,editorClassName:h,id:p,required:x,disabled:v,placeholder:N,accessibilityLabel:_,channel:T,type:j,focused:b,error:R,renderAttachButton:O,renderApplicationCommandIcon:M,renderButtons:k,pendingReply:P,onChange:D,onResize:U,onBlur:G,onFocus:V,onKeyDown:F,onSubmit:H,promptToUpload:B,highlighted:W,canMentionRoles:K,canMentionChannels:z,maxCharacterCount:Z,showRemainingCharsAfterCount:Y,allowNewLines:q=!0,characterCountClassName:J,"aria-describedby":$,"aria-labelledby":X,setEditorRef:Q,autoCompletePosition:ee,children:et,disableThemedBackground:en=!1,emojiPickerCloseOnModalOuterClick:el,parentModalKey:ei,pendingScheduledMessage:es,showValueWhenDisabled:er=!1}=e;c()(null!=j,"chat input type must be set");let{analyticsLocations:eo}=(0,I.Ay)(E.A.CHANNEL_TEXT_AREA),ec=nd(t),eu=i.useRef(null),ed=i.useRef(null),em=i.useRef(null),eE=i.useRef(null),eI=i.useRef(null);Q?.(em.current);let ey=(0,y.A)(T),[ev,eN]=i.useState(!ey);(0,A.i4)(ec,e=>{let{width:t}=e;return eN(!ey&&(null==t||t>450))});let{activeCommand:e_,activeCommandSection:eT}=(0,m.cf)([w.A],()=>({activeCommand:j.commands?.enabled?w.A.getActiveCommand(T.id):null,activeCommandSection:j.commands?.enabled?w.A.getActiveCommandSection(T.id):null})),{isLurking:ej,isPendingMember:eb,disabled:eR,canAttachFiles:eO,canCreateThreads:eL,canEveryoneSendMessages:ew}=nm(T,j,e_,v),ek=j.toolbarType===e$.O1.STATIC,eP=!eD.D_.useSetting()&&!(0,eq.isAndroidWeb)()&&null!=window.ResizeObserver,eG=!eP||!j.commands?.enabled||!b||"/"!==s,eV=(0,eS.A)(),{fontSize:eH}=(0,m.cf)([C.A],()=>({fontSize:C.A.fontSize})),eW=(0,m.bG)([eF.A],()=>eF.A.isEnabled());no(j,eR,T.id);let{eventEmitter:ez,handleEditorSelectionChanged:eY}=nc(em,s,a),eQ=i.useRef(s);eQ.current=s;let e0=i.useCallback((e,t,n)=>{"/"===t&&""===eQ.current&&j.commands?.enabled&&ez.emit("command-sentinel-typed"),D?.(e,t,n)},[D,j.commands?.enabled,ez]),{submitting:e1,submit:e2,handleSubmit:e6}=nl(H,j,em,eI,T.id),{autocompleteRef:e3,handleMaybeShowAutocomplete:e7,handleHideAutocomplete:e4}=nu(),e5=ni(e2,j,em),e8=ns(em),e9=nr({editorRef:em,disabled:eR,textValue:s,channelId:T.id,chatInputType:j,submit:H}),te=i.useCallback((e,t,n)=>{let l=em.current;null!=e&&null!=l&&(eK.default.track(ea.HAw.SOUNDMOJI_SELECT,{channel_id:T.id,guild_id:T.guild_id,sound_guild_id:e.guildId,sound_id:e.soundId,source:t}),l.insertSound(e)),n&&(0,eA.v8)(),l?.focus()},[em,T.id,T.guild_id]),tt=na(em),tn=i.useCallback(()=>eI?.current?.hide(),[]),{editorHeight:tl,handleResize:ts}=nh(U),{handleTab:ta,handleEnter:to,handleMoveSelection:tc}=(n=i.useCallback(()=>!!(!eG&&eu.current?.onTabOrEnter(!1))||e3.current?.onTabOrEnter(!1)||!1,[eG,eu,e3]),{handleTab:n,handleEnter:i.useCallback(()=>!!(!eG&&eu.current?.onTabOrEnter(!0))||e3.current?.onTabOrEnter(!0)||!1,[eG,eu,e3]),handleMoveSelection:i.useCallback(e=>!!(!eG&&eu.current?.onMoveSelection(e))||e3.current?.onMoveSelection(e)||!1,[eG,eu,e3])}),{expressionPickerView:td,shouldHideExpressionPicker:th,handleOuterClick:tm}=np(j,em,T.id),{selectedAutocompleteInputType:tf,selectedAutocompleteInputError:tg}=function(e,t){let[n,l]=i.useState({selectedAutocompleteInputType:null,selectedAutocompleteInputError:!1}),s=i.useCallback(()=>{let e,n=t.current?.getSlateEditor();null!=n&&(e=t1.VW.getSelectedParentOfType(n,eg.mk)?.[0]),l({selectedAutocompleteInputType:e?.type??null,selectedAutocompleteInputError:e?.error??!1})},[t]);return i.useEffect(()=>(e.on("selection-changed",s),e.on("submit-failure",s),s(),()=>{e.off("selection-changed",s),e.on("submit-failure",s)}),[s,e]),n}(ez,em),{handleAutocompleteVisibilityChange:tA}=nf(j,T.id),tE=function(e){let{type:t,channelId:n}=e;return(0,ep.bG)([S.A],()=>{let e=S.A.activeViewType();return null!=e&&e===t&&S.A.activeChannelId()===n&&S.A.shouldShowPopup()},[t,n])}({type:j,channelId:T.id}),ty=i.useCallback(()=>{ez.emit("submit-failure")},[ez]);(0,eJ.R)(ez,T.guild_id,T.id);let tN=null!=P,t_=eR&&!((ej||eb)&&ew)||e1&&j.submit?.useDisabledStylesOnSubmit,tO=null;null!=e_?tO=M?.(e_,eT,tj.g$):(!eR||eL)&&(tO=O?.(tN,tj.g$));let tM=eP&&null!=a&&!eR&&j.showCharacterCount&&null==e_,tL=eP&&!__OVERLAY__&&null!=a&&null==e_&&j.toolbarType!==e$.O1.NONE&&!eR,tw=function(e){let{channel:t,type:n,activeCommand:s,pendingReply:r,pendingScheduledMessage:a,selectedAutocompleteInputType:o,selectedAutocompleteInputError:c}=e,{activeCommandOption:u,activeCommandOptionStates:d}=(0,m.cf)([w.A],()=>({activeCommandOption:w.A.getActiveOption(t.id),activeCommandOptionStates:w.A.getOptionStates(t.id)})),h=(0,m.bG)([eU.Ay,eB.default,tC],()=>{let e=eB.default.getCurrentUser();if(null==e||!e.isStaff()||!t.isDM())return!1;let n=eB.default.getUser(t.getRecipientId());if(!n?.isStaff())return!1;let l=eU.Ay.getNicknames(n.id).some(e=>e.endsWith("[PTO]")||e.endsWith("[OOO]"));return l?!tC.hasId(n.id)&&l:(tx.delete(n.id)&&tC.emitChange(),!1)});return i.useMemo(()=>{let e=[],i=[];return null!=t.guild_id&&n===e$.oU.NORMAL&&i.push((0,l.jsx)(tv.A,{guildId:t.guild_id,channel:t,className:tj.UW})),null!=s&&e.push((0,l.jsx)(tp,{activeCommand:s,activeOption:u??null,optionStates:d,channelId:t.id})),null!=r&&e.push((0,l.jsx)(tr,{reply:r,chatInputType:n})),h&&e.push((0,l.jsx)(tI,{})),null!=a&&e.push((0,l.jsx)(tT,{pendingScheduledMessage:a})),"timestampMentionInput"===o&&i.push((0,l.jsx)(tS,{error:c??!1})),{stacked:e,floating:i}},[s,u,d,t,r,h,n,a,o,c])}({channel:T,type:j,activeCommand:e_,pendingReply:P,pendingScheduledMessage:es,selectedAutocompleteInputType:tf,selectedAutocompleteInputError:tg}),tk=0===s.trim().length,tP=null!=P?[$,ti].filter(Boolean).join(" "):$,tD=j.layout===e$.wt.INLINE,tU=j.layout===e$.wt.FLUSH,tG=(0,l.jsx)("div",{ref:ed,className:tj.BW}),tV=tE?(0,l.jsx)(L,{align:"right",positionTargetRef:ed,channel:T}):null,tW=null!=k?k():(0,l.jsx)(tR.A,{type:j,disabled:eR,channel:T,handleSubmit:e6,isEmpty:tk,showAllButtons:ev}),tK=tM?(0,l.jsx)(tB.A,{type:j,textValue:s,className:J,maxCharacterCount:Z,showRemainingCharsAfterCount:Y}):null;return i.useEffect(()=>{b&&eZ._.dispatch(ea.jej.CHANNEL_TEXT_AREA_FOCUSED,{channelId:T.id})},[b,T.id]),(0,l.jsx)(ex.Sv,{value:ez,children:(0,l.jsxs)(I.f5,{value:eo,children:[tL&&ek?(0,l.jsx)(nt,{editorRef:em,type:j,channel:T}):tL?(0,l.jsx)(t3,{ref:eI,editorRef:em,containerRef:eE,options:j.markdown}):null,(0,l.jsxs)("div",{ref:ec,className:r()(o,{[tj.gM]:!0,[tj.h9]:t_,[tj.mr]:W,[tj.Wn]:d.Fr,[tj.Ls]:tD,[tj.AH]:tU,[tj.z3]:null!=R}),children:[tD||tU?null:(0,l.jsx)(tb,{bars:tw}),(0,l.jsxs)("div",{ref:eE,onScroll:tn,className:r()(u,{[tj.xx]:!0,[tj.k6]:!en,[tj.Ri]:tw.stacked.length>0}),children:[(0,l.jsx)(tu,{channelId:T.id,chatInputType:j}),j.hideAttachmentArea?null:(0,l.jsx)(tH.A,{channelId:T.id,type:j,canAttachFiles:eO}),(0,l.jsxs)("div",{className:r()(tj.vW,{[tj.BF]:t_,[tj.RL]:j!==e$.oU.EDIT&&(null!=tO||t_&&null==tO||ej),[tj.fk]:j===e$.oU.THREAD_CREATION,[tj.TZ]:j===e$.oU.CREATE_FORUM_POST||j===e$.oU.FORWARD_MESSAGE_INPUT,[tj.$i]:j===e$.oU.USER_PROFILE_REPLY}),onMouseDown:tm,children:[tV,tO,(0,l.jsx)(f.vN,{ringTarget:ec,ringClassName:tj.Rg,children:(0,l.jsx)(eX.A,{ref:em,id:p,focused:b,useSlate:eP,textValue:s,richValue:a,disabled:eR,placeholder:N,required:x,accessibilityLabel:_,isPreviewing:(ej||eb)&&ew,channel:T,type:j,canPasteFiles:eO,uploadPromptCharacterCount:ea.CS1,maxCharacterCount:Z??eV,allowNewLines:q,"aria-describedby":tP,onChange:e0,onResize:ts,onBlur:G,onFocus:V,onKeyDown:F,onSubmit:e2,onSubmitFailure:ty,onTab:ta,onEnter:to,onMoveSelection:tc,onSelectionChanged:eY,onMaybeShowAutocomplete:e7,onHideAutocomplete:e4,promptToUpload:B,fontSize:eH,spellcheckEnabled:eW,canOnlyUseTextCommands:tN,className:r()({[tj.QI]:j===e$.oU.THREAD_CREATION,[tj.AV]:j===e$.oU.PROFILE_BIO_INPUT,[tj.GR]:j===e$.oU.OVERLAY_INLINE_REPLY},h),"aria-labelledby":X,showValueWhenDisabled:er})}),tW,tG]})]}),(0,l.jsx)(tF,{channel:T,type:j,pendingScheduledMessage:es}),eG?null:(0,l.jsx)(eh,{ref:eu,channel:T,canOnlyUseTextCommands:tN}),(0,l.jsx)(ef.A,{ref:e3,channel:T,canMentionRoles:K,canMentionChannels:z,useNewSlashCommands:eP,canOnlyUseTextCommands:tN,canSendStickers:j.stickers?.allowSending,canSendSoundmoji:j.soundmoji?.allowSending,textValue:s,focused:b,expressionPickerView:td,type:j,targetRef:ec,editorRef:em,onSendMessage:e2,onSendSticker:e9,onVisibilityChange:tA,editorScrollerRef:eE,editorHeight:tl,barsHeight:40*tw.floating.length,setValue:(e,t)=>e0?.(null,e,t),position:ee}),(0,l.jsx)(eM,{textValue:s,editorHeight:tl,channelId:T.id}),tK,et]}),(0,l.jsx)(g.U,{error:R}),th?null:(0,l.jsx)(eC.A,{positionTargetRef:ec,type:j,onSelectGIF:e5,onSelectEmoji:e8,onSelectSticker:e9,onSelectSound:te,onSelectKaomoji:tt,channel:T,closeOnModalOuterClick:el,parentModalKey:ei,position:"top",align:"right",positionLayerClassName:tj.BD})]})})}))}