Build 574548stable
Module 306852
1,349 characters · in 22b178fc711753f3.jsDependencies
Source Raw
function(e,t,n){n.d(t,{A:()=>C});var i=n(627968),l=n(64700),a=n(503698),s=n.n(a),r=n(17928),o=n(506774),c=n(31728),d=n(164617),u=n(205297),p=n(334463),h=n(175203),m=n(652215),A=n(806931),x=n(566555),g=n(604949);let f="CameraPreviewPosition";function C(e){let{width:t,onContextMenuParticipant:n,height:a,channel:C,participants:y,onSelectParticipant:E}=e,[N,j]=function(){let[e,t]=l.useState(()=>o.w.get(f,m.CUs.BOTTOM_RIGHT));return[e,l.useCallback(e=>{o.w.set(f,e),t(e)},[])]}(),v=l.useRef(null),I=null==C.getGuildId()?70:50,T=(0,r.bG)([p.A],()=>p.A.pipWidth(A.R8.CAMERA_PREVIEW)),_=y.length,S=T*_+8*(_-1),R=l.useMemo(()=>({minWidth:A.mn[A.R8.CAMERA_PREVIEW]*_+8*(_-1),maxWidth:A.cF[A.R8.CAMERA_PREVIEW]*_+8*(_-1)}),[_]);l.useLayoutEffect(()=>{v.current?.ensureIsInPosition()},[y.length]);let b=l.useCallback(e=>{let t=0===_?e:(e-8*(_-1))/_;c.EB(t,A.R8.CAMERA_PREVIEW)},[_]),P=l.useCallback((e,t)=>{j(t)},[j]);return(0,i.jsx)("div",{className:x.kL,children:(0,i.jsx)(u.S,{position:N,id:0,width:S,ref:v,onMove:P,onResize:b,maxX:t,maxY:a,edgeOffsetTop:I,edgeOffsetBottom:70,edgeOffsetLeft:16,edgeOffsetRight:16,resizeConfig:R,children:(0,i.jsx)("div",{className:x.iA,children:y.map(e=>(0,i.jsx)(h.Ay,{participant:e,channel:C,onContextMenu:n,className:s()(x.Vs,g.a8),fit:h.Yl.COVER,inCall:!0,popoutType:d.N.NO_POPOUT,width:160,onClick:E},e.id))})})})}}