PageSourceSearch

https://giantsquare.app/assets/JoinPage-BgeBw3NM.js

js giantsquare.app collected 2026-09-24 11:06:43 UTC 3,454 bytes, 1 lines download raw bytes

1import{u as m,r as o,j as e,s as u}from"./index-Dd39P2ms.js";import{u as p}from"./useDocumentMeta-LWSX32k8.js";import{L as x}from"./loader-circle-kcI7m02z.js";const j="linear-gradient(135deg,#60a5fa,#3b82f6)";function b(){p("Join a team — Giant Square");const{user:a,loading:d}=m(),[t]=o.useState(()=>new URLSearchParams(window.location.search).get("token")??""),[i,n]=o.useState("idle"),[l,g]=o.useState("");o.useEffect(()=>{t&&sessionStorage.setItem("gs_pending_invite",t)},[t]);const f=async()=>{n("accepting");const{data:r,error:s}=await u.rpc("workspace_accept_invite",{_token:t});if(s){n("error"),g(s.message.includes("invalid")?"This invite is invalid or has expired.":s.message);return}sessionStorage.removeItem("gs_pending_invite");const c=r==null?void 0:r.workspace_id;c&&localStorage.setItem("gs_active_workspace",c),n("done"),setTimeout(()=>{window.location.href="/planner"},900)},h=()=>{window.location.href=`/auth?redirect=${encodeURIComponent("/join?token="+t)}`};return e.jsx("div",{style:{minHeight:"100vh",background:"#F5F5F0",display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:e.jsxs("div",{style:{width:400,maxWidth:"100%",background:"#fff",border:"1px solid #E8E8E3",borderRadius:12,boxShadow:"0 12px 40px -16px rgba(0,0,0,.3)",padding:"30px 28px",textAlign:"center"},children:[e.jsx("div",{style:{width:52,height:52,borderRadius:14,background:j,color:"#fff",fontWeight:800,fontSize:22,display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 16px"},children:"◍"}),t?d?e.jsx(x,{className:"animate-spin",style:{margin:"0 auto",color:"#888"}}):i==="done"?e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{fontSize:18,fontWeight:700,color:"#0f8a4d",marginBottom:5},children:"You’re in 🎉"}),e.jsx("div",{style:{fontSize:13,color:"#666"},children:"Taking you to the workspace…"})]}):i==="error"?e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{fontSize:18,fontWeight:700,color:"#1a1a1a",marginBottom:5},children:"Couldn’t join"}),e.jsx("div",{style:{fontSize:13,color:"#666"},children:l})]}):a?e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{fontSize:18,fontWeight:700,color:"#1a1a1a",marginBottom:5},children:"Join the team"}),e.jsx("div",{style:{fontSize:13,color:"#666",marginBottom:6},children:"You’ll be able to plan and publish for the accounts you’re assigned."}),e.jsxs("div",{style:{fontSize:12,color:"#999",marginBottom:20},children:["Signed in as ",a.email]}),e.jsx("button",{onClick:f,disabled:i==="accepting",style:{width:"100%",padding:12,borderRadius:8,background:"#3b82f6",color:"#fff",fontSize:14,fontWeight:700,border:0,cursor:"pointer"},children:i==="accepting"?"Joining…":"Accept invite"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{fontSize:18,fontWeight:700,color:"#1a1a1a",marginBottom:5},children:"You’re invited to a team"}),e.jsx("div",{style:{fontSize:13,color:"#666",marginBottom:22},children:"Sign in or create an account to accept."}),e.jsx("button",{onClick:h,style:{width:"100%",padding:12,borderRadius:8,background:"#3b82f6",color:"#fff",fontSize:14,fontWeight:700,border:0,cursor:"pointer"},children:"Sign in to accept"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{fontSize:18,fontWeight:700,color:"#1a1a1a",marginBottom:5},children:"Invite link incomplete"}),e.jsx("div",{style:{fontSize:13,color:"#666"},children:"This link is missing its token. Ask whoever invited you to resend it."})]})]})})}export{b 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.