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]=`157c2d1d-0b38-4980-9f29-bb91aaca797b`,e._sentryDebugIdIdentifier=`sentry-dbid-157c2d1d-0b38-4980-9f29-bb91aaca797b`)}catch{}import"./rolldown-runtime-nx40z1zs.js";import{Ag as e,H as t,Oi as n,Qm as r,Yh as i,Zm as a,_r as o,mp as s,ng as c,op as l}from"./entry.client-mpghtlrl.js";import{n as u,t as d}from"./guideRouterEnvironmentHooks-h2xlfina.js";import{t as f}from"./useChatStrings-f6vrmnim.js";import{t as p}from"./GuidePageLayout-eh7novzv.js";import{t as m}from"./useCreateGroupAndNavigate-idhg8dbq.js";import{t as h}from"./GuideL2Header-a2pogkf0.js";import{n as g,r as _,t as v}from"./GuideFriendsPicker-hl7nx5ln.js";var y=e(),b=c(),x=e=>{let n=(0,y.c)(15),{onSelect:r}=e,{locAddPeople:i}=t(),{locAddToChatByCount:a}=f(),o;n[0]===i?o=n[1]:(o=i(),n[0]=i,n[1]=o);let s;n[2]===o?s=n[3]:(s=(0,b.jsx)(h,{title:o}),n[2]=o,n[3]=s);let c;n[4]===a?c=n[5]:(c=(0,b.jsx)(v,{getSelectButtonLabel:a}),n[4]=a,n[5]=c);let l;n[6]!==s||n[7]!==c?(l=(0,b.jsxs)(`div`,{className:`flex flex-col gap-layout-vertical-title-and-row-regular`,children:[s,c]}),n[6]=s,n[7]=c,n[8]=l):l=n[8];let u;n[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,b.jsx)(g,{}),n[9]=u):u=n[9];let d;n[10]===l?d=n[11]:(d=(0,b.jsx)(p,{id:`guide-invite-to-chat-page`,header:l,children:u}),n[10]=l,n[11]=d);let m;return n[12]!==r||n[13]!==d?(m=(0,b.jsx)(_,{onSelect:r,children:d}),n[12]=r,n[13]=d,n[14]=m):m=n[14],m},S=o(x,()=>{let{conversation:e}=a(),t=u(),n=d(),{groupId:o}=s({from:l.dialog.guide.chat.inviteToChat.id}),{mutate:c}=i(e.mutations.addPeopleToGroup.getActiveUserMutation().getOptions()),{trackUserAction:f}=r(),p=(e,t,n)=>{f(`ChatInteractionWithCount`,{type:e,wasSuccessful:t,count:n},`Press`)},{createGroupAndNavigate:h}=m();return{onSelect:e=>{let r=e.map(e=>e.xuid);o===`new`?r.length===1?n({to:l.dialog.guide.chat.directChat.fullPath,params:{participantXuid:r[0]},replace:!0}):r.length>1&&h(r,{replace:!0}):c({groupId:o,xuids:r},{onSuccess:()=>p(`AddToGroup`,!0,r.length),onError:()=>p(`AddToGroup`,!1,r.length),onSettled:()=>t()})}}}),C=n(()=>(0,b.jsx)(S.useComponent(),{}),`InviteToChatPage`);export{C as InviteToChatPage,C as default,S as InviteToChatPageConnection,x as PureInviteToChatPage};