Module 197808

3,143 characters · in no known chunk
Dependencies
Source Raw
function(e,t,n){"use strict";n.d(t,{A:()=>G});var i=n(627968),r=n(64700),s=n(17928),a=n(31728),o=n(933958),l=n(216418),u=n(969151),c=n(108959),d=n(449571),_=n(313961),h=n(71855),f=n(91242),E=n(210954),p=n(26113),m=n(205297),g=n(699426),A=n(979186),I=n(869146),T=n(363195),S=n(742023),N=n(806911),C=n(734057),y=n(334463),O=n(309010),R=n(531685),v=n(403362),b=n(652215),L=n(5867),D=n(806931),w=n(165610),P=n(201181);let M={[b.o1q.VIDEO]:N.A,[b.o1q.ACTIVITY]:d.A,[b.o1q.FRAME]:E.A,[b.o1q.HAVEN]:p.A},x={minWidth:D.mn[D.R8.VIDEO],maxWidth:D.cF[D.R8.VIDEO]},U=[];class k extends r.PureComponent{render(){let{selectedPIPWindow:e,pipWindows:t,pipWidth:n,maxX:r,maxY:s,theme:a,dockedRect:o,appContext:l,roundCorners:u,getDockedRectPositionY:c,windowSize:d,inPopoutWindow:_,activityPIPWindow:h,chatOpen:f,callChatSidebarWidth:E}=this.props,p=document.body.style.getPropertyValue("--custom-guild-sidebar-width"),A=""!==p?parseInt(p,10):b.MdR,I=d.width-A-(f?E:0);return(0,i.jsxs)(g.ic,{children:[(0,i.jsx)(m.A,{pictureInPictureComponents:M,selectedPIPWindow:e,pipWindows:t,pipWidth:n,maxX:r,maxY:s,dockedRect:o,theme:a,onWindowMove:this.handleWindowMove,onWindowResize:this.handleWindowResize,appContext:l,roundCorners:u,resizeConfig:x,getDockedRectPositionY:c}),(0,i.jsx)(g.Md,{className:!_&&null!=h&&f&&I<550?P.ah:void 0})]})}handleWindowMove=(e,t)=>{a.tw(e,t)};handleWindowResize=e=>{a.EB(e,D.R8.VIDEO)}}let G=s.Ay.connectStores([I.A,o.Ay,R.A,T.A,C.A,O.A,y.A,_.A,S.Ay,f.A],e=>{let t,{popoutWindowKey:n,popoutWindowHasTitleBar:i=!1}=e,r=I.A.getWindowOpen(b.MLl.CHANNEL_CALL_POPOUT),s=I.A.getWindowOpen(b.MLl.ACTIVITY_POPOUT),a=o.Ay.getCurrentEmbeddedActivity(),d=(0,u.H)(a?.location),E=null!=a&&!(0,c.A)(d,C.A,O.A),p=o.Ay.getActivityPanelMode(),m=E&&p===L.Gd.PANEL,g=null!=a&&null!=d&&_.A.getSelectedParticipant(d)?.type===D.lp.ACTIVITY,N=f.A.getConnectedFrame(),P=f.A.getFrameLayoutMode()===w.y.FOCUSED,M=null!=n,x=M?I.A.getWindow(n):null,k=!!M&&I.A.isWindowFullScreen(n),G=R.A.windowSize();M&&(G=null==x?G:{width:x.innerWidth,height:x.innerHeight});let V=M?b.BRT.POPOUT:b.BRT.APP;t=null!=a&&s||M&&E||M&&null!=N?null:M||!r||E||null!=N?null!=a&&m?y.A.pipActivityWindow??y.A.pipVideoWindow:null!=N&&P?y.A.pipFrameWindow??y.A.pipVideoWindow??y.A.pipActivityWindow:y.A.pipHavenWindow??y.A.pipVideoWindow??y.A.pipActivityWindow??y.A.pipFrameWindow:null;let F=Array.from(y.A.pipWindows.values()),B=y.A.pipWidth(D.R8.VIDEO),H=F.find(e=>e.component===b.o1q.VIDEO),j=F.find(e=>e.component===b.o1q.ACTIVITY),W=F.find(e=>e.component===b.o1q.FRAME),Y=[F.find(e=>e.component===b.o1q.HAVEN),H,j,W].filter(v.Vq),K=S.Ay.callChatSidebarWidth,$=O.A.getVoiceChannelId(),z=O.A.getChannelId()===$,q=null!=$&&_.A.getChatOpen($),Z=m||g,X=Z&&null!=a&&(0,l.q)(a.applicationId),Q=!Z&&null!=t&&z;return{selectedPIPWindow:t,pipWindows:0===Y.length?U:Y,pipWidth:B,maxX:G.width-(Q&&q?K:0),maxY:G.height,theme:T.A.theme,dockedRect:y.A.getDockedRect(t?.id??""),getDockedRectPositionY:e=>M&&(0,A.q)({withTitleBar:i,isFullScreen:k})?e-(0,h.LI)({isPopoutWindow:M}):e,appContext:V,roundCorners:!X,windowSize:G,inPopoutWindow:M,activityPIPWindow:j,chatOpen:q,callChatSidebarWidth:K}})(k)}