PageSourceSearch

https://grow.yesimadesigner.com/assets/creative-lobby-U-QGLQmP.js

js yesimadesigner.com collected 2026-09-26 06:16:51 UTC 23,401 bytes, 1 lines download raw bytes

1import{r as t,A as V,j as e,au as D,av as z,B as p,aw as $,q,cj as he,ae as me,t as se,cn as ce,cQ as xe,am as fe,aF as Q,h as le,W as ae,Y as ne,$ as ie,y as oe,a9 as de,bP as pe,bQ as be,a6 as ge,bR as je,bY as ve,bZ as ye,bS as we,C as Ne,a3 as Se,an as ke,I as Ce,bW as Pe}from"./index-7Izc5KgZ.js";import{a as Me,A as Ie,b as Ee}from"./app-sidebar-n9IJfrsG.js";import{T as E,R as Le,a as T}from"./livekit-client.esm-B3rKy7H9.js";import{S as Te}from"./slider-CjNth_CL.js";import{S as De}from"./square-DCKY1Rb5.js";import{L as ze}from"./layout-grid-C-htEVmA.js";import{R as $e,M as Ae,a as ee}from"./rows-3-DD3eVeEB.js";import{I as Oe}from"./info-B4tfAgJC.js";import{P as Re}from"./trending-up-DX_dWBUS.js";import{S as Fe}from"./shield-alert-BMIsRhdc.js";import{P as Ue,M as te,a as Ke,V as Ve}from"./volume-x-DFkxciHI.js";import{M as re}from"./mic-DaIF_LHM.js";import{U as qe}from"./user-x-BO-8LwX8.js";import{B as We}from"./ban-DpQ3Vvx5.js";import"./separator-CGtSkfMf.js";import"./panel-left-ChViDpDK.js";import"./users-round-DlcqbIJG.js";import"./lightbulb-C33cTmyv.js";function Ye({lobbyType:s}){const n=t.useRef(null),[h,c]=t.useState(!1),[y,o]=t.useState(!1),[b,d]=t.useState(null),[k,v]=t.useState(!1),[m,r]=t.useState(!1),[j,A]=t.useState(!1),[L,F]=t.useState([]),[M,w]=t.useState([]),[O,C]=t.useState(!1),[U,W]=t.useState(!1),[J,Y]=t.useState([]),[R,K]=t.useState("default"),N=t.useCallback(u=>{const x=[];
1u.remoteParticipants.forEach(i=>{const l=i.getTrackPublication(E.Source.Microphone);x.push({identity:i.identity,name:i.name||i.identity,isSpeaking:i.isSpeaking,micMuted:!l||l.isMuted,isSharingScreen:!!i.getTrackPublication(E.Source.ScreenShare)})}),F(x)},[]),P=t.useCallback(async()=>{try{if(!navigator.mediaDevices?.enumerateDevices)return;const u=await navigator.mediaDevices.enumerateDevices();Y(u.filter(x=>x.kind==="audioinput"))}catch{}},[]);t.useEffect(()=>{if(P(),!!navigator.mediaDevices?.addEventListener)return navigator.mediaDevices.addEventListener("devicechange",P),()=>navigator.mediaDevices.removeEventListener("devicechange",P)},[P]);const G=t.useCallback(()=>{const u=n.current;n.current=null,u?.disconnect(),c(!1),v(!1),r(!1),F([]),w([])},[]),B=t.useCallback(async()=>{if(!(!s||n.current)){o(!0),d(null),W(!1);try{const x=await(await V("POST",`/api/creative-lobby/${s}/token`)).json();A(!!x.canScreenShare);const i=new Le({adaptiveStream:!0,dynacast:!0});n.current=i,i.on(T.ParticipantConnected,()=>N(i)),i.on(T.ParticipantDisconnected,()=>N(i)),i.on(T.ActiveSpeakersChanged,()=>N(i)),i.on(T.TrackMuted,(l,I)=>{N(i),I.identity===i.localParticipant.identity&&l.source===E.Source.Microphone&&(v(!1),C(!0))}),i.on(T.TrackUnmuted,()=>N(i)),i.on(T.TrackSubscribed,(l,I,S)=>{if(N(i),l.kind===E.Kind.Audio){const g=l.attach();g.autoplay=!0,g.dataset.lobbyVoiceIdentity=S.identity,g.style.display="none",document.body.appendChild(g)}else l.kind===E.Kind.Video&&l.source===E.Source.ScreenShare&&w(g=>[...g.filter(a=>a.identity!==S.identity),{identity:S.identity,name:S.name||S.identity,track:l}])}),i.on(T.TrackUnsubscribed,(l,I,S)=>{N(i),l.detach().forEach(g=>g.remove()),l.kind===E.Kind.Video&&l.source===E.Source.ScreenShare&&w(g=>g.filter(a=>a.identity!==S.identity))}),i.on(T.LocalTrackPublished,(l,I)=>{N(i),l.track&&l.source===E.Source.ScreenShare&&l.kind===E.Kind.Video&&w(S=>[...S.filter(g=>g.identity!==I.identity),{identity:I.identity,name:I.name||"You",track:l.track,isLocal:!0}])}),i.on(T.LocalTrackUnpublished,(l,I)=>{N(i),l.source===E.Source.ScreenShare&&(w(S=>S.filter(g=>g.identity!==I.identity)),r(!1))}),i.on(T.Disconnected,l=>{c(!1),F([]),w([]),n.current=null}),await i.connect(x.url,x.token),c(!0),N(i),P()}catch(u){d(u?.message||"Failed to connect to the lobby"),n.current=null,(u?.message?.includes("banned")||u?.message?.includes("403"))&&W(!0)}finally{o(!1)}}},[s,N,P]),_=t.useCallback(async()=>{const u=n.current;if(!u)return;const x=!u.localParticipant.isMicrophoneEnabled;try{await u.localParticipant.setMicrophoneEnabled(x,R!=="default"?{deviceId:R}:void 0),v(x),x&&C(!1),P()}catch(i){i?.name==="NotAllowedError"||i?.message?.toLowerCase().includes("permission denied")?d("Microphone access was blocked. Click the camera/mic icon in your browser's address bar and allow access, then try again."):d(i?.message||"Failed to access microphone")}},[R,P]),X=t.useCallback(async()=>{const u=n.current;if(!u||!j)return;const x=!u.localParticipant.isScreenShareEnabled;try{await u.localParticipant.setScreenShareEnabled(x,{audio:!0}),r(x)}catch(i){i?.name!=="NotAllowedError"&&d(i?.message||"Failed to share screen")}},[j]),Z=t.useCallback(async u=>{K(u);const x=n.current;if(x)try{await x.switchActiveDevice("audioinput",u)}catch(i){d(i?.message||"Failed to switch microphone")}},[]);return t.useEffect(()=>()=>{n.current?.disconnect(),n.current=null},[]),{isConnected:h,isConnecting:y,error:b,connect:B,disconnect:G,micEnabled:k,toggleMic:_,screenShareEnabled:m,toggleScreenShare:X,canScreenShare:j,participants:L,remoteScreenShares:M,wasForceMuted:O,dismissForceMutedNotice:()=>C(!1),wasKicked:U,micDevices:J,selectedMicId:R,selectMic:Z}}function Ge({lobbyType:s}){const n=t.useRef(null),[h,c]=t.useState(!1),[y,o]=t.useState([]),[b,d]=t.useState([]),k=t.useCallback(m=>{n.current?.readyState===WebSocket.OPEN&&n.current.send(JSON.stringify(m))},[]);t.useEffect(()=>{if(!s)return;let m=!1,r=null,j=2e3;const A=()=>{if(m)return;const F=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/creative-lobby/${s}`,M=new WebSocket(F);n.current=M,M.onopen=()=>
1{if(m){M.close();return}c(!0),j=2e3},M.onclose=()=>{m||(c(!1),n.current=null,r=setTimeout(()=>{j=Math.min(j*2,3e4),A()},j))},M.onerror=w=>console.error("[Creative Lobby WS] error:",w),M.onmessage=w=>{try{const{type:O,data:C}=JSON.parse(w.data);switch(O){case"init":o(C.chatHistory||[]),d(C.presence||[]);break;case"chat":o(U=>[...U,C]);break;case"presence_update":d(C.presence||[]);break}}catch(O){console.error("[Creative Lobby WS] parse error:",O)}}};return A(),()=>{m=!0,r!==null&&clearTimeout(r),n.current&&(n.current.close(),n.current=null),c(!1),o([]),d([])}},[s]);const v=t.useCallback(m=>{k({type:"chat",message:m})},[k]);return{connected:h,chatMessages:y,presence:b,sendChat:v}}function H({share:s,className:n,onClick:h}){const c=t.useRef(null);return t.useEffect(()=>(c.current&&s.track.attach(c.current),()=>{c.current&&s.track.detach(c.current)}),[s.track]),e.jsxs("div",{className:q("relative rounded-lg overflow-hidden bg-black border group",h&&"cursor-pointer",n),onClick:h,"data-testid":`tile-screenshare-${s.identity}`,children:[e.jsx("video",{ref:c,autoPlay:!0,playsInline:!0,className:"w-full h-full object-contain"}),e.jsx("div",{className:"absolute top-0 left-0 right-0 px-2 py-1 bg-gradient-to-b from-black/70 to-transparent",children:e.jsxs("span",{className:"text-xs text-white font-medium truncate",children:[s.name,"'s screen"]})}),h&&e.jsx("div",{className:"absolute top-1.5 right-1.5 opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx(he,{className:"w-3.5 h-3.5 text-white drop-shadow"})})]})}function Be({screenShares:s,layoutMode:n,onLayoutModeChange:h,gridSize:c,onGridSizeChange:y,spotlightId:o,onSpotlightChange:b}){const[d,k]=t.useState(null),v=s.find(r=>r.identity===d)||s[0],m=s.find(r=>r.identity===o)||s[0];return t.useEffect(()=>{s.length>0&&!s.some(r=>r.identity===o)&&b(s[0].identity)},[s.map(r=>r.identity).join(",")]),e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 px-2 py-1.5 border-b bg-background/60",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs(D,{children:[e.jsx(z,{asChild:!0,children:e.jsx(p,{size:"icon",variant:n==="single"?"default":"ghost",className:"h-7 w-7",onClick:()=>h("single"),"data-testid":"button-layout-single",children:e.jsx(De,{className:"w-3.5 h-3.5"})})}),e.jsx($,{children:"Single large view"})]}),e.jsxs(D,{children:[e.jsx(z,{asChild:!0,children:e.jsx(p,{size:"icon",variant:n==="grid"?"default":"ghost",className:"h-7 w-7",onClick:()=>h("grid"),"data-testid":"button-layout-grid",children:e.jsx(ze,{className:"w-3.5 h-3.5"})})}),e.jsx($,{children:"Grid view"})]}),e.jsxs(D,{children:[e.jsx(z,{asChild:!0,children:e.jsx(p,{size:"icon",variant:n==="spotlight"?"default":"ghost",className:"h-7 w-7",onClick:()=>h("spotlight"),"data-testid":"button-layout-spotlight",children:e.jsx($e,{className:"w-3.5 h-3.5"})})}),e.jsx($,{children:"Spotlight + thumbnails"})]})]}),n==="grid"&&s.length>1&&e.jsxs("div",{className:"flex items-center gap-2 w-32",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:"Size"}),e.jsx(Te,{min:1,max:4,step:1,value:[c],onValueChange:r=>y(r[0]),"data-testid":"slider-grid-size"})]})]}),e.jsxs("div",{className:"flex-1 min-h-0 p-2",children:[n==="single"&&v&&e.jsxs("div",{className:"h-full flex flex-col gap-2",children:[e.jsx(H,{share:v,className:"flex-1"}),s.length>1&&e.jsx("div",{className:"flex gap-1.5 overflow-x-auto shrink-0",children:s.map(r=>e.jsx("button",{onClick:()=>k(r.identity),className:q("text-xs px-2 py-1 rounded border shrink-0",(d||s[0]?.identity)===r.identity?"bg-primary text-primary-foreground border-primary":"bg-muted/40"),"data-testid":`button-select-screenshare-${r.identity}`,children:r.name},r.identity))})]}),n==="grid"&&e.jsx("div",{className:"h-full grid gap-2",style:{gridTemplateColumns:`repeat(${Math.min(c,Math.max(1,s.length))||1}, minmax(0, 1fr))`},children:s.map(r=>e.jsx(H,{share:r},r.identity))}),n==="spotlight"&&m&&e.jsxs("div",{className:"h-full flex flex-col gap-2",children:[e.jsx(H,{share:m,className:"flex-1"}),s.length>1&&e.jsx("div",{className:"flex gap-1.5 overflow-x-auto shrink-0 h-20",children:s.filter(r=>r.identity!==m.identity).map(r=>e.jsx(H,{share:r,className:"w-32 h-full shrink-0",onClick:()=>b(r.identity)},r.identity))})]})]})]})}function He({isAdmin:s}){const{toast:n}=se(),[h,c]=t.useState(!1),[y,o]=t.useState(!1),[b,d]=t.useState(""),[k,v]=t.useState(!1),{data:m}=le({queryKey:["/api/creative-lobby/helper-text"]}),r=m?.helperText??"";if(!s&&!r)return null;const j=L=>{L&&d(r),o(L)},A=async()=>{v(!0);try{await V("PATCH","/api/admin/creative-lobby/helper-text",{helperText:b}),await de.invalidateQueries({queryKey:["/api/creative-lobby/helper-text"]}),o(!1),n({title:"Helper text updated"})}catch{n({title:"Failed to save helper text",variant:"destructive"})}finally{v(!1)}};return e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 ml-auto",children:[r&&e.jsxs(ae,{open:h,onOpenChange:c,children:[e.jsx(ne,{asChild:!0,children:e.jsx("button",{className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors","data-testid":"button-info-lobby-helper",children:e.jsx(Oe,{className:"w-4 h-4"})})}),e.jsx(ie,{align:"end",className:"w-[500px] max-w-[calc(100vw-2rem)]",children:e.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap","data-testid":"text-lobby-helper",children:r})})]}),s&&e.jsxs(ae,{open:y,onOpenChange:j,children:[e.jsx(ne,{asChild:!0,children:e.jsx("button",{className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors","data-testid":"button-edit-lobby-helper",children:e.jsx(Re,{className:"w-3.5 h-3.5"})})}),e.jsxs(ie,{align:"end",className:"w-96 space-y-2",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Creative Lobby helper text"}),e.jsx("textarea",{className:"w-full text-sm border rounded-md px-2 py-1.5 resize-none focus:outline-none focus:ring-1 focus:ring-ring bg-background",rows:5,maxLength:500,value:b,onChange:L=>d(L.target.value),placeholder:"e.g. Join our live weekly hangout!","data-testid":"input-lobb
1y-helper-text"}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(p,{size:"sm",variant:"outline",onClick:()=>o(!1),"data-testid":"button-cancel-lobby-helper",children:"Cancel"}),e.jsx(p,{size:"sm",onClick:A,disabled:k,"data-testid":"button-save-lobby-helper",children:k?e.jsx(oe,{className:"w-3.5 h-3.5 animate-spin"}):"Save"})]})]})]})]})}function ft(){const{user:s,isAdmin:n}=me();se();const[h,c]=t.useState("general"),{guardAction:y}=ce(),o=!!(n||s?.isProMember),b=d=>{d!==h&&y(()=>c(d))};return e.jsx(xe,{children:e.jsxs(Me,{style:{"--sidebar-width":"19rem","--sidebar-width-icon":"3rem"},children:[e.jsx(Ie,{}),e.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 md:px-6 pt-4 pb-2 shrink-0",children:[e.jsx(Ee,{"data-testid":"button-mobile-sidebar",className:"h-8 w-8 md:hidden shrink-0"}),e.jsx(fe,{className:"w-5 h-5 text-primary"}),e.jsx("h1",{className:"text-lg font-semibold",children:"Creative Lobby"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-4 md:px-6 pb-3 shrink-0 flex-wrap",children:[e.jsx(p,{size:"sm",variant:h==="general"?"default":"outline",onClick:()=>b("general"),"data-testid":"button-tab-general-lobby",children:"General Lobby"}),e.jsxs(D,{children:[e.jsx(z,{asChild:!0,children:e.jsx("span",{children:e.jsxs(p,{size:"sm",variant:h==="pro"?"default":"outline",onClick:()=>b("pro"),className:q("gap-1.5",!o&&"opacity-70"),"data-testid":"button-tab-pro-lobby",children:[e.jsx(Q,{className:"w-3.5 h-3.5"}),"Pro Lobby"]})})}),!o&&e.jsx($,{children:"Pro members and admins only"})]}),e.jsx(He,{isAdmin:!!n})]}),e.jsx("div",{className:"flex-1 min-h-0 px-4 md:px-6 pb-4 md:pb-6",children:h==="pro"&&!o?e.jsx(Qe,{}):e.jsx(Je,{lobbyType:h,isAdmin:n,currentUserId:s?.id},h)})]})]})})}function Qe(){const{data:s}=le({queryKey:["/api/settings/pro-membership-url"],select:n=>(typeof n=="string"?n:n?.url)||"/become-pro"});return e.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-3 text-center border rounded-xl bg-muted/10 p-6",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center",children:e.jsx(Q,{className:"w-6 h-6 text-primary"})}),e.jsx("p",{className:"text-sm font-semibold","data-testid":"text-pro-lobby-gate-title",children:"Pro Lobby is a Pro Member perk"}),e.jsx("p",{className:"text-xs text-muted-foreground max-w-sm",children:"Upgrade to Pro to screen share, hop into the Pro-only room, and connect with other Pro members. You can still join the General Lobby anytime."}),e.jsx("div",{className:"flex items-center gap-2 mt-1",children:e.jsx(p,{size:"sm",className:"gap-1.5",asChild:!0,"data-testid":"button-pro-lobby-upgrade",children:e.jsxs("a",{href:s||"/become-pro",children:[e.jsx(Q,{className:"w-3.5 h-3.5"}),"Upgrade to Pro"]})})})]})}function Je({lobbyType:s,isAdmin:n,currentUserId:h}){const{toast:c}=se(),{setIsInLiveLobbySession:y}=ce(),{isConnected:o,isConnecting:b,error:d,connect:k,disconnect:v,micEnabled:m,toggleMic:r,screenShareEnabled:j,toggleScreenShare:A,canScreenShare:L,participants:F,remoteScreenShares:M,wasForceMuted:w,dismissForceMutedNotice:O,wasKicked:C,micDevices:U,selectedMicId:W,selectMic:J}=Ye({lobbyType:s}),{connected:Y,chatMessages:R,presence:K,sendChat:N}=Ge({lobbyType:s}),[P,G]=t.useState(""),B=t.useRef(null),[_,X]=t.useState("grid"),[Z,u]=t.useState(2),[x,i]=t.useState(null);t.useEffect(()=>(k(),()=>v()),[s]),t.useEffect(()=>(y(o),()=>y(!1)),[o,y]),t.useEffect(()=>{if(!o)return;const a=f=>{f.preventDefault(),f.returnValue=""};return window.addEventListener("beforeunload",a),()=>window.removeEventListener("beforeunload",a)},[o]),t.useEffect(()=>{d&&c({title:"Voice chat error",description:d,variant:"destructive"})},[d,c]),t.useEffect(()=>{w&&(c({title:"You were muted by an admin"}),O())},[w,O,c]),t.useEffect(()=>{C&&c({title:"Access denied",description:"You've been banned from this lobby.",variant:"destructive"})},[C,c]),t.useEffect(()=>{const a=B.current;a&&(a.scrollTop=a.scrollHeight)},[R]);const l=t.useCallback(async a=>{try{await V("POST",`/api/creative-lobby/${s}/mute`,{userId:a})}catch(f){c({title:"Failed to mute",description:f?.message,variant:"destructive"})}},[s,c]),I=t.useCallback(async a=>{try{await V("POST",`/api/creative-lobby/${s}/kick`,{userId:a}),c({title:"Participant removed"})}catch(f){c({title:"Failed to kick",description:f?.message,variant:"destructive"})}},[s,c]),S=t.useCallback(async a=>{try{await V("POST",`/api/creative-lobby/${s}/ban`,{userId:a}),de.invalidateQueries({queryKey:[`/api/creative-lobby/${s}/bans`]}),c({title:"Participant banned from this lobby"})}catch(f){c({title:"Failed to ban",description:f?.message,variant:"destructive"})}},[s,c]);
1function g(a){a.preventDefault();const f=P.trim();if(f){if(!Y){c({title:"Not connected",description:"Chat is still connecting, please try again in a moment.",variant:"destructive"});return}N(f),G("")}}return C?e.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-3 text-center border rounded-xl",children:[e.jsx(Fe,{className:"w-10 h-10 text-destructive"}),e.jsx("p",{className:"text-sm font-medium",children:"You can't join this lobby"}),e.jsx("p",{className:"text-xs text-muted-foreground max-w-sm",children:"You have been banned from this lobby by an admin."})]}):e.jsxs("div",{className:"h-full flex flex-col lg:flex-row gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-3",children:[e.jsx("div",{className:"flex items-center gap-1.5 flex-wrap rounded-xl border p-2 bg-background",children:o?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center rounded-md border overflow-hidden",children:[e.jsxs(D,{children:[e.jsx(z,{asChild:!0,children:e.jsx(p,{size:"icon",variant:m?"default":"outline",className:"h-8 w-8 rounded-none border-0",onClick:r,"data-testid":"button-lobby-toggle-mic",children:m?e.jsx(re,{className:"w-4 h-4"}):e.jsx(te,{className:"w-4 h-4"})})}),e.jsx($,{children:m?"Mute mic":"Unmute mic"})]}),e.jsxs(pe,{children:[e.jsx(be,{asChild:!0,children:e.jsx(p,{size:"icon",variant:m?"default":"outline",className:"h-8 w-5 rounded-none border-0 border-l","data-testid":"button-lobby-mic-devices",children:e.jsx(ge,{className:"w-3 h-3"})})}),e.jsxs(je,{align:"start",className:"w-64",children:[e.jsx(ve,{children:"Microphone"}),e.jsx(ye,{}),U.length===0?e.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No microphones found"}):U.map((a,f)=>e.jsxs(we,{onClick:()=>J(a.deviceId),className:"gap-2","data-testid":`option-lobby-mic-${a.deviceId||f}`,children:[e.jsx(Ne,{className:q("w-3.5 h-3.5 shrink-0",W===a.deviceId?"opacity-100":"opacity-0")}),e.jsx("span",{className:"truncate",children:a.label||`Microphone ${f+1}`})]},a.deviceId||f))]})]})]}),L&&e.jsxs(D,{children:[e.jsx(z,{asChild:!0,children:e.jsxs(p,{size:"sm",variant:j?"default":"outline",className:"gap-1.5",onClick:A,"data-testid":"button-lobby-toggle-screenshare",children:[j?e.jsx(Ae,{className:"w-3.5 h-3.5"}):e.jsx(ee,{className:"w-3.5 h-3.5"}),j?"Stop Sharing":"Share Screen"]})}),e.jsx($,{children:j?"Stop sharing your screen":"Share your screen"})]}),e.jsxs(D,{children:[e.jsx(z,{asChild:!0,children:e.jsx(p,{size:"icon",variant:"ghost",className:"h-8 w-8 text-destructive",onClick:v,"data-testid":"button-lobby-leave",children:e.jsx(Ke,{className:"w-4 h-4"})})}),e.jsx($,{children:"Leave the lobby"})]})]}):e.jsxs(p,{size:"sm",className:"gap-1.5",onClick:k,disabled:b,"data-testid":"button-lobby-join",children:[b?e.jsx(oe,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(Ue,{className:"w-3.5 h-3.5"}),b?"Connecting…":"Join Lobby"]})}),e.jsx("div",{className:"flex-1 min-h-[240px] rounded-xl border bg-muted/20 overflow-hidden",children:M.length>0?e.jsx(Be,{screenShares:M,layoutMode:_,onLayoutModeChange:X,gridSize:Z,onGri
1dSizeChange:u,spotlightId:x,onSpotlightChange:i}):e.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-2 text-muted-foreground",children:[e.jsx(ee,{className:"w-8 h-8 opacity-40"}),e.jsx("p",{className:"text-sm",children:"No one is sharing their screen"}),L&&e.jsx("p",{className:"text-xs opacity-70",children:"Use the Share Screen button above to present."})]})})]}),e.jsxs("div",{className:"flex flex-col gap-4 w-full lg:w-72 shrink-0 min-h-0",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx(Se,{className:"w-3.5 h-3.5 text-muted-foreground"}),e.jsxs("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:["In this lobby (",K.length,")"]})]}),e.jsx("div",{className:"flex flex-col gap-1.5 max-h-48 overflow-y-auto",children:K.length===0?e.jsx("p",{className:"text-xs text-muted-foreground py-2 text-center",children:"No one else is here yet"}):K.map(a=>{const f=F.find(ue=>ue.identity===a.userId);return e.jsxs("div",{className:"flex items-center justify-between gap-2 px-1.5 py-1 rounded hover:bg-muted/60","data-testid":`row-lobby-participant-${a.userId}`,children:[e.jsxs("span",{className:q("text-sm truncate flex items-center gap-1.5",f?.isSpeaking&&"text-green-600 dark:text-green-400 font-medium"),children:[f?f.micMuted?e.jsx(te,{className:"w-3 h-3 text-muted-foreground shrink-0"}):e.jsx(re,{className:"w-3 h-3 shrink-0 text-green-600"}):e.jsx(te,{className:"w-3 h-3 text-muted-foreground/40 shrink-0"}),a.userName,a.isAdmin&&e.jsx(Q,{className:"w-3 h-3 text-amber-500 shrink-0"}),f?.isSharingScreen&&e.jsx(ee,{className:"w-3 h-3 text-primary shrink-0"})]}),n&&a.userId!==h&&e.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[e.jsxs(D,{children:[e.jsx(z,{asChild:!0,children:e.jsx(p,{size:"icon",variant:"ghost",className:"h-6 w-6",onClick:()=>l(a.userId),"data-testid":`button-lobby-mute-${a.userId}`,children:e.jsx(Ve,{className:"w-3.5 h-3.5"})})}),e.jsx($,{children:"Force mute"})]}),e.jsxs(D,{children:[e.jsx(z,{asChild:!0,children:e.jsx(p,{size:"icon",variant:"ghost",className:"h-6 w-6",onClick:()=>I(a.userId),"data-testid":`button-lobby-kick-${a.userId}`,children:e.jsx(qe,{className:"w-3.5 h-3.5"})})}),e.jsx($,{children:"Kick"})]}),e.jsxs(D,{children:[e.jsx(z,{asChild:!0,children:e.jsx(p,{size:"icon",variant:"ghost",className:"h-6 w-6 text-destructive",onClick:()=>S(a.userId),"data-testid":`button-lobby-ban-${a.userId}`,children:e.jsx(We,{className:"w-3.5 h-3.5"})})}),e.jsx($,{children:"Ban from lobby"})]})]})]},a.userId)})})]}),e.jsxs("div",{className:"flex-1 min-h-0 flex flex-col border rounded-lg overflow-hidden",children:[e.jsxs("div",{className:"px-3 py-2 border-b bg-muted/30 flex items-center gap-1.5",children:[e.jsx(ke,{className:"w-3.5 h-3.5 text-muted-foreground"}),e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Chat"})]}),e.jsx("div",{ref:B,className:"flex-1 min-h-0 overflow-y-auto p-3 flex flex-col gap-1.5","data-testid":"lobby-chat-messages",children:R.length===0?e.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"No messages yet"}):R.map(a=>e.jsxs("div",{className:"text-xs","data-testid":`chat-msg-${a.id}`,children:[e.jsxs("span",{className:"font-medium text-foreground",children:[a.userName,": "]}),e.jsx("span",{className:"text-muted-foreground",children:a.message})]},a.id))}),e.jsxs("form",{onSubmit:g,className:"flex gap-1.5 p-2 border-t bg-background",children:[e.jsx(Ce,{value:P,onChange:a=>G(a.target.value),placeholder:"Send a message...",className:"text-xs h-8","data-testid":"input-lobby-chat"}),e.jsx(p,{type:"submit",size:"sm",className:"h-8 w-8 p-0 shrink-0",disabled:!Y||!P.trim(),"data-testid":"button-lobby-chat-send",children:e.jsx(Pe,{className:"w-3.5 h-3.5"})})]})]})]})]})}export{ft as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.