try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`24251bf1-5601-4082-9748-c9d0b289b60a`,e._sentryDebugIdIdentifier=`sentry-dbid-24251bf1-5601-4082-9748-c9d0b289b60a`)}catch{}import"./rolldown-runtime-eb2nym32.js";import{Ag as e,Fg as t,ch as n,dn as r,k as i,mr as a,qp as o,sh as s,wg as c,zp as l}from"./entry.client-dr7r6s9a.js";import{n as u,t as d}from"./guideRouterEnvironmentHooks-gdtmgzra.js";import{t as f}from"./useChatStrings-ddn3ault.js";import{t as p}from"./GuidePageLayout-imh16gdu.js";import{t as m}from"./useCreateGroupAndNavigate-ebmfegn9.js";import{t as h}from"./GuideL2Header-b90pi17a.js";import{n as g,r as _,t as v}from"./GuideFriendsPicker-e05agpt5.js";var y=t(),b=e(),x=e=>{let t=(0,y.c)(15),{onSelect:n}=e,{locAddPeople:r}=i(),{locAddToChatByCount:a}=f(),o;t[0]===r?o=t[1]:(o=r(),t[0]=r,t[1]=o);let s;t[2]===o?s=t[3]:(s=(0,b.jsx)(h,{title:o}),t[2]=o,t[3]=s);let c;t[4]===a?c=t[5]:(c=(0,b.jsx)(v,{getSelectButtonLabel:a}),t[4]=a,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,b.jsxs)(`div`,{className:`flex flex-col gap-layout-vertical-related-content-in-a-section-tight`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,b.jsx)(g,{}),t[9]=u):u=t[9];let d;t[10]===l?d=t[11]:(d=(0,b.jsx)(p,{id:`guide-invite-to-chat-page`,header:l,children:u}),t[10]=l,t[11]=d);let m;return t[12]!==n||t[13]!==d?(m=(0,b.jsx)(_,{onSelect:n,children:d}),t[12]=n,t[13]=d,t[14]=m):m=t[14],m},S=r(x,()=>{let{conversation:e}=s(),t=u(),r=d(),{groupId:i}=o({from:l.dialog.guide.chat.inviteToChat.id}),{mutate:a}=c(e.mutations.addPeopleToGroup.getActiveUserMutation().getOptions()),{trackUserAction:f}=n(),p=(e,t,n)=>{f(`ChatInteractionWithCount`,{type:e,wasSuccessful:t,count:n},`Press`)},{createGroupAndNavigate:h}=m();return{onSelect:e=>{let n=e.map(e=>e.xuid);i===`new`?n.length===1?r({to:l.dialog.guide.chat.directChat.fullPath,params:{participantXuid:n[0]},replace:!0}):n.length>1&&h(n,{replace:!0}):a({groupId:i,xuids:n},{onSuccess:()=>p(`AddToGroup`,!0,n.length),onError:()=>p(`AddToGroup`,!1,n.length),onSettled:()=>t()})}}}),C=a(()=>(0,b.jsx)(S.useComponent(),{}),`InviteToChatPage`);export{C as InviteToChatPage,C as default,S as InviteToChatPageConnection,x as PureInviteToChatPage};