PageSourceSearch

https://live.magicc.org/assets/accept-invite-BqCFZXnr.js

js magicc.org collected 2026-10-04 00:23:25 UTC 3,630 bytes, 2 lines download raw bytes

1import{b as S,j as e,a7 as A,W as k,u as C,r as E,a8 as I,a9 as D,B as c,c as T,a1 as L,a as R}from"./index-CjVU7RJX.js";import{L as _}from"./Logo-2NLVLJmS.js";import{u as $}from"./useApiQuery-CyBBzKaQ.js";import{A as P}from"./Alert-p8mEXmQd.js";import"./XCircleIcon-DCcNVkFG.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"61deeeaade68dd91b27c04a9789aa675b15aa5d2"}}catch{}})();try{(function(){var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="27ec4243-3f6e-4e40-8f9d-8a48d584da71",t._sentryDebugIdIdentifier="sentry-dbid-27ec4243-3f6e-4e40-8f9d-8a48d584da71")})()}catch{}const u=({children:t,center:s=!0,className:r})=>{const i=S("flex gap-4",{"justify-center":s},r);return e.jsx("div",{className:i,children:t})},U=()=>e.jsx("div",{className:"relative py-8 mx-6",children:e.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true",children:e.jsx("div",{className:"w-full border-t border-gray-300"})})}),J=()=>{const{siteConfig:t}=R(),s=A({strict:!1}),r=s.memberId,i=s.token,o=k(),{userDetails:l,signOut:h,fetchUserDetails:g}=C(),[p,d]=E.useState({error:!1,accepting:!1}),{data:n,error:m}=$(`/v1/accept-invite/${r}/${i}`),f=a=>{const N=new URLSearchParams({next:window.location.pathname});return`${a}?${N.toString()}`},x=a=>{o({to:f(a)})},y=async()=>{d(a=>({...a,accepting:!0}));try{await T(`/v1/accept-invite/${r}/${i}`,{method:"POST"},!1),await g(),L.track("Signed Up",{type:"invite",email:l?.email,context:{groupId:l?.organisation?.slug}}),o({to:t.redirect||"/dashboard",replace:!0})}catch{d(a=>({...a,error:!0}))}d(a=>({...a,accepting:!1}))},b=async()=>{await h(),o({to:f("/auth/signin"),replace:!0})},j=()=>e.jsx(u,{center:!0,className:"mt-6",children:e.jsx(c,{variant:"primary",disabled:p.accepting,onClick:y,children:"Join"})}),v=()=>e.jsxs(e.Fragment,{children:[e.jsx("p",{children:"To continue, you must either create a new account, or login to an existing Climate Resource account."}),e.jsxs(u,{center:!0,className:"mt-6",children:[e.jsx(c,{variant:"primary",onClick:()=>x("/auth/register"),children:"Create a new account"}),e.jsx(c,{variant:"default",onClick:()=>x("/auth/signin"),children:"Login"})]})]}),w=()=>e.jsxs(P,{variant:"error",children:[e.jsxs("p",{children:["Your account (",l?.email,") is already a member of this organisation."]}),e.jsx(u,{center:!0,className:"mt-6",children:e.jsx(c,{variant:"error",onClick:b,children:"Switch Accounts"})})]});if(m){const a=m;return e.jsx(I,{message:a.info?.details,statusCode:400})}return n?e.jsxs("div",{className:"min-h-screen bg-gray-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8",children:[e.jsx("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:e.jsx(_,{height:80})}),e.jsx("div",{className:"mt-6 sm:mx-auto sm:w-full sm:max-w-md",children:e.jsxs("div",{className:"bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10",children:[e.jsxs("h2",{className:"mt-3 text-center text-2xl text-gray-900",children:[e.jsx("b",{className:"font-extrabold",children:n.inviter})," has invited you to join the ",e.jsx("b",{className:"font-extrabold",children:n.orgSlug})," team!"]}),e.jsx("div",{className:"mt-6",children:n.needsAuthentication?v():n.existingMember?w():j()}),e.jsx(U,{}),e.jsx("h3",{children:"Climate Resource is a platform for interacting with the latest climate science"})]})})]}):e.jsx(D,{})};export{J as default};
2//# sourceMappingURL=accept-invite-BqCFZXnr.js.map

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.