Build 576754stable
Module 540462
19,473 characters · in b75bc33ab94b4212.jsDependencies
Required by (1)
Lazily required by (0)none
Requires (93)
107161792819575204653802143189439904729464700713939556197483105225125248128286139286156652174459228366235986249288266626267102279250280450284009287809309010313961326567360729367513375708384059401685401843408278418126423562442433447404451988461782475743475815480890503698518530520006520698554146558076558845562708574172576705587837587895616356619344622770625494627968643501646865652215652896675853681281688810691540696451700948723702730852742023765671793574795816806931817281820284821747825860838409857250857253869146871237874739933958976860977997
Source Raw
function(e,t,n){n.r(t),n.d(t,{IDLE_TIMEOUT:()=>ez,default:()=>eZ});var i=n(627968),l=n(64700),a=n(503698),s=n.n(a),r=n(284009),o=n.n(r),c=n(562708),d=n(17928),u=n(554146),h=n(451988),p=n(408278),m=n(825860),A=n(43990),x=n(691540),g=n(857250),f=n(97483),C=n(38021),j=n(228366),y=n(367513),v=n(442433),E=n(730852),N=n(401843),I=n(817281),T=n(820284),_=n(765671),S=n(475743),b=n(646865),R=n(10716),P=n(795816),O=n(933958),L=n(47294),w=n(793574),D=n(95561),M=n(688810),U=n(139286),V=n(587895),k=n(235986),B=n(558845),G=n(643501),H=n(857253),F=n(652896),z=n(279250),W=n(558076),Y=n(360729),K=n(700948),X=n(418126),Z=n(266626),q=n(267102),$=n(574172),Q=n(869146),J=n(976860),ee=n(326567),et=n(742023),en=n(105225),ei=n(874739),el=n(461782),ea=n(447404),es=n(401685),er=n(20465),eo=n(156652),ec=n(622770),ed=n(423562),eu=n(520006),eh=n(128286),ep=n(619344),em=n(821747),eA=n(125248),ex=n(616356),eg=n(280450),ef=n(249288),eC=n(696451),ej=n(71393),ey=n(576705),ev=n(309010),eE=n(287809),eN=n(977997),eI=n(174459),eT=n(871237),e_=n(625494),eS=n(723702),eb=n(19575),eR=n(475815),eP=n(313961),eO=n(520698),eL=n(43189),ew=n(518530),eD=n(681281),eM=n(587837),eU=n(675853),eV=n(384059),ek=n(480890),eB=n(806931),eG=n(652215),eH=n(375708),eF=n(838409);let ez=2e3,eW={[eG.DUB.NORMAL]:eF.qb,[eG.DUB.MINIMUM]:eF.Bp,[eG.DUB.NO_CHAT]:eF.Oo,[eG.DUB.FULL_SCREEN]:eF.iy,[eG.DUB.HAVEN]:eF.VT},eY={[eG.BRT.POPOUT]:eF.SW,[eG.BRT.APP]:null,[eG.BRT.OVERLAY]:null,[eG.BRT.CALL_TILE_POPOUT]:null};function eK(e){let{layout:t,channel:n,selectedParticipant:l,canChangeLayout:a,canInvite:s,onToggleChat:r,maybeLeaveFullScreen:o}=e,c=(0,es.Bx)(),u=(0,d.bG)([V.A],()=>l?.type===eB.lp.ACTIVITY?V.A.getApplication(l.applicationId):void 0),h=t===eG.DUB.NO_CHAT?ec.A.Directions.UP:ec.A.Directions.DOWN,p=[eG.DUB.FULL_SCREEN,eG.DUB.NO_CHAT].includes(t);return(0,i.jsxs)(i.Fragment,{children:[s&&c<es.vs.NO_INVITE?(0,i.jsx)(eu.A,{channel:n,stream:l?.type===eB.lp.STREAM?(0,F.Iy)(l.id):void 0,className:eF.jZ,exitFullScreen:o,analyticsLocation:n.type===eG.rbe.GUILD_VOICE?eG.liQ.GUILD_CHANNEL:eG.liQ.DM_CHANNEL,applicationId:u?.id}):null,a?(0,i.jsx)(k.A,{className:eF.P0,align:k.A.Align.CENTER,grow:0,children:(0,i.jsx)(ec.A,{label:p?eH.intl.string(eH.t.kkKapG):eH.intl.string(eH.t["5MstTl"]),direction:h,className:eF.jZ,onClick:()=>{(0,eV.X)(w.A.VOICE_CONTROL_TRAY,eV.O.CHAT,p),r()}})}):null]})}class eX extends l.PureComponent{_prevLayout=eG.DUB.MINIMUM;_wrapperRef=l.createRef();_callContainerRef=l.createRef();_channelChatRef=l.createRef();_contentRef=l.createRef();_videoBackgroundTooltipTimeout=new h.Ep;_lastIdleProps=null;state={resizedHeight:et.Ay.callHeaderHeight};getRootNode(){return(this.props.popoutWindow?.window??window).document.getElementById("app-mount")}componentDidMount(){let{channel:e,layout:t}=this.props;this.currentDocument.addEventListener(eR.Wb,this.handleFullScreenChange),eI.default.track(eG.HAw.VIDEO_LAYOUT_TOGGLED,{video_layout:this.inPopout?"popout":t,...(0,D.QS)(e.id)})}componentWillUnmount(){this._videoBackgroundTooltipTimeout.stop(),this.currentDocument.removeEventListener(eR.Wb,this.handleFullScreenChange),this.inPopout&&(0,eS.isMac)()||this.maybeLeaveFullScreen()}componentDidUpdate(e){let{participantsOpen:t,inCall:n,mode:i,layout:l}=this.props,a=this.getRootNode();null!=a&&e.mode===eG._Of.VIDEO&&i===eG._Of.VOICE&&(0,eR._U)(a,this.currentDocument)&&(0,eR.sP)(a,this.currentDocument),(e.participantsOpen!==t||l!==e.layout)&&this._contentRef.current?.triggerResize(),e.inCall&&!n&&this.inPopout&&j.h.wait(()=>this.handleClosePopout())}get nativePopoutSupported(){return eS.isPlatformEmbedded&&eb.Ay.supportsFeature(eG.BYE.POPOUT_WINDOWS)}get popoutSupported(){return!eS.isPlatformEmbedded||this.nativePopoutSupported}get popoutOpen(){let{popoutWindow:e}=this.props;return null!=e&&!e.closed}get currentDocument(){let{popoutWindow:e}=this.props;return null!=e&&this.popoutOpen&&this.inPopout?e.document:document}get screenMessage(){return this.popoutOpen&&!this.inPopout&&this.props.inCall?{mainText:eH.intl.string(eH.t.J5bXZU)}:null}get inPopout(){return this.props.appContext===eG.BRT.POPOUT}get viewProperties(){let{layout:e,mode:t,channel:n,inCall:i,canPopout:l}=this.props,a=t===eG._Of.VIDEO&&i&&!(this.popoutOpen&&!this.inPopout),s=t===eG._Of.VIDEO&&i&&this.popoutSupported&&l,r=t!==eG._Of.VOICE&&n.isPrivate()&&!this.inPopout&&i,o=n.type===eG.rbe.GUILD_VOICE,c={renderHeader:!0,useTheme:!1,useExternalHeader:e===eG.DUB.MINIMUM||e===eG.DUB.NORMAL,canInvite:o,canPopout:s,canFullscreen:a,canChangeLayout:r,canStayOnTop:this.inPopout&&this.nativePopoutSupported};if(!i)return{...c,canFullscreen:a,useTheme:!0};switch(e){case eG.DUB.FULL_SCREEN:return{...c,canPopout:!this.inPopout&&this.popoutOpen&&c.canPopout};case eG.DUB.MINIMUM:return{...c,canPopout:!1,useTheme:!0};case eG.DUB.HAVEN:case eG.DUB.NO_CHAT:case eG.DUB.NORMAL:return{...c}}}handleFullScreenChange=()=>{let e=this.getRootNode();null!=e&&((0,eR._U)(e,this.currentDocument)||this.props.layout!==eG.DUB.FULL_SCREEN||this.handleFullScreen())};handleFullScreen=()=>{let e=this.getRootNode();null!=e&&(this.props.layout!==eG.DUB.FULL_SCREEN?(this._prevLayout=this.props.layout,this.handleChangeLayout(eG.DUB.FULL_SCREEN),(0,eR.tl)(e)):this.maybeLeaveFullScreen())};maybeLeaveFullScreen=()=>{let e=this.getRootNode();null==e||this.props.layout===eG.DUB.FULL_SCREEN&&(this.handleChangeLayout(this._prevLayout),(0,eR.sP)(e,this.currentDocument))};handleToggleLayout=()=>{this.handleChangeLayout(this.props.layout===eG.DUB.NORMAL?eG.DUB.NO_CHAT:eG.DUB.NORMAL)};handleHaven=()=>{this.props.layout===eG.DUB.HAVEN?(this.handleChangeLayout(eG.DUB.NO_CHAT),X.Ay.disconnect(this.props.channel.id)):this.handleChangeLayout(eG.DUB.HAVEN)};handleChangeLayout=e=>{let{channel:t,appContext:n,layout:i}=this.props;i!==e&&(y.A.updateLayout(t.id,e,n),e===eG.DUB.FULL_SCREEN&&t.isPrivate()&&e_._.dispatch(eG.jej.TEXTAREA_BLUR))};handleDisconnect=()=>{this.props.layout===eG.DUB.FULL_SCREEN&&this.handleFullScreen()};trackCallTileContextMenuImpression=(e,t)=>{(0,U.x)({type:c.ImpressionTypes.MENU,name:c.ImpressionNames.CALL_TILE_CONTEXT_MENU,properties:{location:"ChannelCall",is_tile_owner:e.type!==eB.lp.ACTIVITY&&e.user.id===this.props.currentUserId,tile_type:t}})};getCallTileMenuActionHandler=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:eB.GK.CONTEXT_MENU;return(0,ek.s)(e,w.A.CHANNEL_CALL,{entrypoint:i,tileType:n,targetUserId:t.type!==eB.lp.ACTIVITY?t.user.id:void 0})};handleContextMenu=(e,t,l,a)=>{let{channel:s,appContext:r,layout:c}=this.props,d={onClose:()=>this._lastIdleProps?.onAllowIdle("menu"),context:r};switch(this._lastIdleProps?.onPreventIdle("menu"),this._lastIdleProps?.onActive(),e.type){case eB.lp.HIDDEN_STREAM:case eB.lp.STREAM:this.trackCallTileContextMenuImpression(e,eB.qs.STREAM),(0,v.L3)(t,async()=>{let{default:t}=await Promise.all([n.e("89673"),n.e("45996"),n.e("29422"),n.e("58315"),n.e("66692")]).then(n.bind(n,796175));return n=>(0,i.jsx)(t,{...n,stream:e.stream,exitFullscreen:this.maybeLeaveFullScreen,appContext:r,minimal:l,onInteraction:this.getCallTileMenuActionHandler("StreamContextMenu",e,eB.qs.STREAM,a)})},d);return;case eB.lp.USER:this.trackCallTileContextMenuImpression(e,eB.qs.USER);let u=eE.default.getUser(e.id);if(null!=u){if(l)return(0,ee.r)(t,u,s,d,(e,t)=>(0,ek.Y)({menuItemProps:t,menuName:e,entrypoint:eB.GK.THREE_DOT,tileType:eB.qs.USER,targetUserId:u.id,location:w.A.CHANNEL_CALL}));switch(s.type){case eG.rbe.DM:return(0,v.L3)(t,async()=>{let{default:t}=await Promise.all([n.e("10570"),n.e("98273"),n.e("26132"),n.e("46652"),n.e("93190"),n.e("91763"),n.e("8757"),n.e("85968"),n.e("38730"),n.e("89673"),n.e("52168"),n.e("82073"),n.e("97558"),n.e("91994"),n.e("76665"),n.e("76273"),n.e("34971"),n.e("45996"),n.e("23427"),n.e("29422"),n.e("7059"),n.e("95264"),n.e("42339"),n.e("21106"),n.e("40175"),n.e("42613"),n.e("90554"),n.e("17244"),n.e("98199"),n.e("41175"),n.e("39778")]).then(n.bind(n,385913));return n=>(0,i.jsx)(t,{...n,showChannelCallItems:!0,showMediaItems:!0,user:u,channel:s,showModalItems:!0,onInteraction:this.getCallTileMenuActionHandler("DMUserContextMenu",e,eB.qs.USER)})},d);case eG.rbe.GROUP_DM:return(0,v.L3)(t,async()=>{let{default:t}=await Promise.all([n.e("10570"),n.e("98273"),n.e("26132"),n.e("46652"),n.e("93190"),n.e("8757"),n.e("85968"),n.e("89673"),n.e("52168"),n.e("82073"),n.e("97558"),n.e("91994"),n.e("76665"),n.e("76273"),n.e("24198"),n.e("45996"),n.e("23427"),n.e("29422"),n.e("7059"),n.e("95264"),n.e("28864")]).then(n.bind(n,778595));return n=>(0,i.jsx)(t,{...n,showChannelCallItems:!0,showMediaItems:!0,showChatItems:c===eG.DUB.MINIMUM||c===eG.DUB.NORMAL,user:u,channel:s,showModalItems:!0,onInteraction:this.getCallTileMenuActionHandler("GroupDMUserContextMenu",e,eB.qs.USER)})},d);case eG.rbe.GUILD_VOICE:case eG.rbe.PUBLIC_THREAD:case eG.rbe.PRIVATE_THREAD:let a=s.getGuildId();return o()(null!=a,"GuildID null for guild voice channel"),(0,v.L3)(t,async()=>{let{default:t}=await Promise.all([n.e("98273"),n.e("26132"),n.e("46652"),n.e("93190"),n.e("8757"),n.e("85968"),n.e("89673"),n.e("52168"),n.e("82073"),n.e("97558"),n.e("91994"),n.e("76665"),n.e("24198"),n.e("45996"),n.e("23427"),n.e("49145"),n.e("29422"),n.e("7059"),n.e("43116"),n.e("70314"),n.e("70515"),n.e("4524"),n.e("54148"),n.e("66939"),n.e("17334"),n.e("84841")]).then(n.bind(n,107632));return n=>(0,i.jsx)(t,{...n,showMediaItems:!0,showChannelCallItems:!0,showChatItems:!1,user:u,channel:s,guildId:a,showModalItems:!0,onInteraction:this.getCallTileMenuActionHandler("GuildChannelUserContextMenu",e,eB.qs.USER)})},d)}}}};handleCallResize=e=>{this.setState({resizedHeight:e})};handleSelectParticipant=(e,t)=>{let{channel:n,selectedParticipant:i,allActiveStreams:l,inCall:a,mode:s}=this.props;(0,eB.Ay)(e)&&(0,z.eo)(n,eN.A,ej.A,ey.A,G.default)[0]&&(E.default.selectVoiceChannel(n.id),0===l.filter(t=>(0,F._z)(t)===e.id&&t.state!==eG.XYD.ENDED).length&&(0,N.A9)((0,F.Iy)(e.id),{forceMultiple:t.shiftKey})),a&&s===eG._Of.VIDEO&&(i?.id===e.id?y.A.selectParticipant(n.id,null):y.A.selectParticipant(n.id,e.id))};handleOpenPopout=()=>{let{channel:e,connectedEmbeddedActivity:t}=this.props,n=async()=>{t?.applicationId!=null&&await (0,P.od)(t.applicationId,e.id);let n=e.getGuildId();null==n||eC.Ay.isCurrentUserGuest(n)||(0,J.pX)((0,eT.vJ)(n)),$.openChannelCallPopout(e)};null==t||(0,b.f)()?n():(0,L.A)({onConfirm:n})};handleStayOnTop=e=>{(0,eV.X)(w.A.VOICE_CONTROL_TRAY,eV.O.STAY_ON_TOP,e),$.setAlwaysOnTop(eG.MLl.CHANNEL_CALL_POPOUT,e)};handleClosePopout=()=>{$.close(eG.MLl.CHANNEL_CALL_POPOUT)};handleFullscreenParticipant=(e,t)=>{let{layout:n,selectedParticipant:i}=this.props,l=n===eG.DUB.FULL_SCREEN;(!l&&i?.id!==e.id||l&&i?.id===e.id)&&this.handleSelectParticipant(e,t),this.handleFullScreen()};renderBottomCenter=()=>{let{channel:e,inCall:t,layout:n}=this.props;return t||n===eG.DUB.MINIMUM||n===eG.DUB.NORMAL?(0,i.jsx)(en.Ay,{exitFullScreen:this.maybeLeaveFullScreen,channel:e,onDisconnectCall:this.handleDisconnect,idleProps:this._lastIdleProps}):null};renderBottomLeft=()=>{let{layout:e,channel:t,selectedParticipant:n,inCall:l}=this.props,{canChangeLayout:a,canInvite:s}=this.viewProperties,r=e===eG.DUB.FULL_SCREEN?()=>{this._prevLayout=eG.DUB.NORMAL,this.handleFullScreen()}:this.handleToggleLayout;return l?(0,i.jsx)(eK,{layout:e,channel:t,selectedParticipant:n,canChangeLayout:a,canInvite:s,onToggleChat:r,maybeLeaveFullScreen:this.maybeLeaveFullScreen}):null};renderBottomRight=()=>{let{popoutWindow:e,popoutWindowAlwaysOnTop:t,currentUserId:n,selectedParticipant:l,inCall:a,canUseHaven:s}=this.props,{canFullscreen:r,canStayOnTop:o,canPopout:c,useTheme:d}=this.viewProperties;return(0,i.jsxs)(i.Fragment,{children:[null!=l&&l.type!==eB.lp.ACTIVITY&&l.user.id!==n?(0,i.jsx)(em.A,{context:(0,eO.A)(l.type),userId:l.user.id,currentWindow:this.inPopout?e??void 0:window,sliderClassName:eF.MQ,className:eF.iq,location:w.A.VOICE_CONTROL_TRAY}):null,o?(0,i.jsx)(ep.A,{className:eF.iq,popoutWindowAlwaysOnTop:t,onToggleStayOnTop:this.handleStayOnTop}):null,s&&a&&(0,i.jsx)(p.K,{variant:"icon-only","aria-label":"Haven",icon:m.Y,onClick:this.handleHaven}),c?(0,i.jsx)(eh.A,{themeable:d,popoutOpen:this.popoutOpen,className:eF.iq,onOpenPopout:()=>{(0,eV.X)(w.A.VOICE_CONTROL_TRAY,eV.O.POPOUT,!0),this.handleOpenPopout()},onClosePopout:()=>{(0,eV.X)(w.A.VOICE_CONTROL_TRAY,eV.O.POPOUT,!1),this.handleClosePopout()}}):null,r?(0,i.jsx)(ed.A,{themeable:d,node:this.getRootNode(),guestWindow:e,className:eF.iq,onClick:()=>{(0,eV.X)(w.A.VOICE_CONTROL_TRAY,eV.O.FULL_SCREEN,this.props.layout!==eG.DUB.FULL_SCREEN),this.handleFullScreen()}}):null]})};renderChatToasts=()=>{let{showChatToasts:e,chatOpen:t,channel:n,inCall:l}=this.props;return!e||t||this.popoutOpen&&!this.inPopout&&l?null:(0,i.jsx)(eL.Ay,{children:(0,i.jsx)(er.A,{className:eF.T6,channelId:n.id})})};renderVoiceChannelEffects=()=>{let{channel:e,callContainerDimensions:t}=this.props;return(0,i.jsx)(eU.Ay,{children:(0,i.jsx)(eA.A,{callHeight:t.height,channelId:e.id})})};renderHeader=()=>{let{renderExternalHeader:e,channel:t,guild:n,appContext:l,chatOpen:a,inCall:s}=this.props,{useExternalHeader:r,renderHeader:o}=this.viewProperties;return o?(0,i.jsx)(ea.A,{children:(0,i.jsx)("div",{className:eF.dL,children:r?e?.():(0,i.jsx)(eD.A,{channel:t,guild:n,appContext:l,inCall:s,isChatOpen:a||this.popoutOpen&&!this.inPopout&&s,exitFullScreen:this.maybeLeaveFullScreen,guildRoomVisible:this.props.guildRoomVisible})})}):null};renderContent(e){let{popoutType:t,selectedParticipant:n,inCall:l,hasConnectPermission:a,mode:s,participantsOpen:r,participants:o,filteredParticipants:c,participantsVersion:d,channel:u,guild:h,layout:p,forceShowControls:m,awaitingRemoteSessionInfo:A,currentChannelActivities:x,callContainerDimensions:g,guildRoomVisible:f}=this.props,C=p===eG.DUB.MINIMUM,j=C||p===eG.DUB.NORMAL,y=l&&s===eG._Of.VIDEO,v=(x?.length??0)>0&&u.isPrivate();this._lastIdleProps=e;let E=!l||!(this.popoutOpen&&!this.inPopout),N=f?(0,i.jsx)(K.A,{channelId:u.id,popoutType:t}):(0,i.jsx)(ei.A,{ref:this._contentRef,inCall:l,channel:u,hasConnectPermission:a,guild:h,participants:o,filteredParticipants:c,participantsVersion:d,selectedParticipant:y?n:null,layout:p,idle:e.idle,mode:s,onSelectParticipant:this.handleSelectParticipant,onContextMenuParticipant:this.handleContextMenu,showParticipants:r&&(!j||v),popoutType:t,awaitingRemoteSessionInfo:A,callContainerDimensions:g});return(0,i.jsx)(eo.A,{renderHeader:this.renderHeader,renderBottomLeft:this.renderBottomLeft,renderBottomCenter:this.renderBottomCenter,renderBottomRight:this.renderBottomRight,renderChatToasts:u.isGuildVoiceOrThread()?this.renderChatToasts:void 0,renderVoiceChannelEffects:this.renderVoiceChannelEffects,...e,screenMessage:this.screenMessage,disableGradients:!l||C,idle:!m&&l&&!C&&e.idle,children:E&&N})}render(){let{layout:e,channel:t,guild:n,mode:l,chatOpen:a,appContext:r,maxSidebarWidth:o,maxHeight:c,inCall:d}=this.props,{resizedHeight:u}=this.state,h=l===eG._Of.VIDEO,p=e!==eG.DUB.HAVEN&&e!==eG.DUB.NO_CHAT&&e!==eG.DUB.FULL_SCREEN&&null!=c,m=eG.NJ8.MIDNIGHT;return(0,i.jsxs)("div",{className:s()(eF.iE,eW[e],eY[r],{[eF.XW]:this.popoutOpen&&!this.inPopout&&e!==eG.DUB.NO_CHAT&&t.isPrivate(),[eF.Ki]:h,[eF.vc]:a,[eF.ty]:p}),ref:e=>{this._wrapperRef.current=e,this.props.wrapperRef.current=e},style:p&&null!=u?{minHeight:230,maxHeight:c,height:u}:void 0,children:[(0,i.jsx)(A.N,{theme:m,children:t=>(0,i.jsx)("div",{className:s()(eF.ik,a||e!==eG.DUB.FULL_SCREEN?void 0:eF.iy,t),ref:e=>{this._callContainerRef.current=e,this.props.callContainerRef.current=e},children:(0,i.jsx)(el.Ay,{timeout:ez,children:e=>this.renderContent(e)})})}),p&&(0,i.jsx)(eM.A,{minHeight:230,maxHeight:c,resizableNode:this._wrapperRef,onResize:this.handleCallResize,onResizeEnd:this.props.updateStoredCallHeaderHeight}),(0,i.jsx)("div",{className:eF.B2,ref:e=>{this._channelChatRef.current=e,this.props.channelChatRef.current=e},children:(!d||!this.popoutOpen||this.inPopout)&&a&&(0,i.jsx)(ew.A,{channel:t,guild:n,maxWidth:o})})]})}}let eZ=function(e){let{channel:t,renderExternalHeader:n,maxHeight:a,canPopout:s=!0,popoutType:r}=e,{width:o=0,ref:c}=(0,_.Ay)(),{width:h=0,height:p=0,ref:m}=(0,_.Ay)(),{ref:A}=(0,_.Ay)(),j=(0,q.Us)(),y=(0,H.A)(),v=(0,d.bG)([ev.A],()=>(y?.channelId??ev.A.getVoiceChannelId())===t.id),{participants:E,filteredParticipants:N,participantsVersion:b,mode:P,layout:L,participantsOpen:D,chatOpen:U,selectedParticipant:V}=(0,d.cf)([eP.A],()=>{let e=j===eG.BRT.POPOUT,n=eP.A.getMode(t.id),i=eP.A.getLayout(t.id,j);e&&(n=eG._Of.VIDEO);let l=n===eG._Of.VIDEO?i:eG.DUB.MINIMUM;return e&&l!==eG.DUB.FULL_SCREEN&&(l=eG.DUB.NO_CHAT),i===eG.DUB.HAVEN&&(l=i),{mode:n,layout:l,selectedParticipant:n!==eG._Of.VOICE?eP.A.getSelectedParticipant(t.id):null,participants:eP.A.getParticipants(t.id),filteredParticipants:eP.A.getFilteredParticipants(t.id),participantsOpen:eP.A.getParticipantsOpen(t.id),chatOpen:eP.A.getChatOpen(t.id),participantsVersion:eP.A.getParticipantsVersion(t.id)}},[j,t.id]),k=(0,d.yK)([ex.A],()=>ex.A.getAllActiveStreams()),{selectedStream:F}=(0,d.cf)([ex.A],()=>({selectedStream:null!=V?ex.A.getActiveStreamForStreamKey(V.id):null}),[V]),z=(0,d.bG)([ej.A],()=>ej.A.getGuild(t.getGuildId())),K=(0,d.bG)([eg.default],()=>eg.default.getId()),{popoutWindow:X,popoutWindowAlwaysOnTop:$}=(0,d.cf)([Q.A],()=>({popoutWindow:Q.A.getWindow(eG.MLl.CHANNEL_CALL_POPOUT),popoutWindowAlwaysOnTop:Q.A.getIsAlwaysOnTop(eG.MLl.CHANNEL_CALL_POPOUT)})),J=(0,d.bG)([ey.A],()=>ey.A.can(eG.xBc.CONNECT,t)),ee=(0,d.bG)([ef.A],()=>ef.A.getToastsEnabled(t.id)),en=(0,d.bG)([G.default],()=>G.default.getAwaitingRemoteSessionInfo()),ei=(0,d.bG)([et.Ay],()=>et.Ay.callHeaderHeight),el=l.useCallback(e=>{I.Ay.updatedUnsyncedSettings({callHeaderHeight:e})},[]),ea=(0,d.bG)([R.A],()=>R.A.getFetchState(),[]),es=(0,S.A)(ea);l.useEffect(()=>{ea===R.$.ERROR&&es!==R.$.ERROR&&(0,x.P0)((0,g.o)(eH.intl.string(eH.t["AlJyI+"]),f.Ck.FAILURE))},[ea,es]);let er=(0,d.bG)([O.Ay],()=>O.Ay.getSelfEmbeddedActivityForChannel(t.id),[t]);l.useEffect(()=>{let e=!1,t=null;return(async()=>{v&&P===eG._Of.VIDEO&&(t=await eb.Ay.blockDisplaySleep(),e&&null!=t&&eb.Ay.unblockDisplaySleep(t))})(),()=>{null!=t?eb.Ay.unblockDisplaySleep(t):e=!0}},[v,P]);let eo=(0,B.mB)(u.M.CALL_CHAT_BUTTON_TEXT_IN_VOICE_COACH_MARK),{analyticsLocations:ec}=(0,M.Ay)(w.A.CHANNEL_CALL),ed=O.Ay.getEmbeddedActivitiesForChannel(t.id),{enabled:eu}=Z.s.useConfig({location:"ChannelCall"}),{enabled:eh}=Y.A.useExperiment({guildId:t.guild_id,location:"ChannelCall"}),ep=(0,d.bG)([W.A],()=>W.A.isVisible(t.id)),{theme:em}=(0,C.wR)();return(0,i.jsx)(M.f5,{value:ec,children:(0,i.jsx)(T.A,{page:eG.liQ.CHANNEL_CALL,children:(0,i.jsx)(eL.qh,{children:(0,i.jsxs)(eU.CB,{children:[(0,i.jsx)(eX,{channel:t,guild:z,hasConnectPermission:J,participantsOpen:D,renderExternalHeader:n,appContext:j,popoutWindow:X,popoutWindowAlwaysOnTop:$,selectedStream:F,mode:P,inCall:v,participants:E,filteredParticipants:N,participantsVersion:b,layout:L,chatOpen:U,maxSidebarWidth:o-550,currentUserId:K,selectedParticipant:V,allActiveStreams:k,connectedEmbeddedActivity:er??void 0,showChatToasts:ee,storedCallHeaderHeight:ei,updateStoredCallHeaderHeight:el,wrapperRef:c,callContainerDimensions:{width:h,height:p},callContainerRef:m,channelChatRef:A,width:o,maxHeight:a,forceShowControls:eo,awaitingRemoteSessionInfo:en,currentChannelActivities:ed,theme:em,canPopout:s,popoutType:r,canUseHaven:eu,guildRoomVisible:eh&&ep}),!t.isPrivate()&&(0,i.jsx)(eU.wQ,{}),(0,i.jsx)(eL.WD,{})]})})})})}}