PageSourceSearch

https://aiwebtools.app/assets/JoinPage-CRen_H9S.js

js aiwebtools.app collected 2026-10-09 21:32:39 UTC 5,777 bytes, 1 lines download raw bytes

1import{r,j as e}from"./vendor-react-Z2RftVxc.js";import{ai as E}from"./vendor-misc-B0U2KBRw.js";import{e as W,u as B,L as _}from"./vendor-router-DoK6ukT0.js";import{s as c}from"./index-D_zk9FO7.js";import{u as D,b as F,B as w,a as g}from"./App-D4nr5zpi.js";import{L as f}from"./label-D4dRN36h.js";import{C as v}from"./checkbox-TNGc4njX.js";import{u as G}from"./useAuthSession-CiOKBv1y.js";import{S as $,M,V as R,L as U}from"./vendor-icons-BkJZPRIs.js";import"./vendor-charts-DdPZUasU.js";import"./vendor-motion-D_Ul-5sB.js";import"./vendor-supabase-CyYD06OP.js";import"./vendor-overlay-BW9kSCRI.js";import"./vendor-radix-celtryLs.js";import"./vendor-query-C9Mf4eMT.js";const re=()=>{const[j]=W(),m=B(),{toast:d}=D(),{session:b,loading:y}=G(),o=j.get("next")||"/account",[t,N]=r.useState(j.get("mode")==="signin"?"signin":"signup"),[i,k]=r.useState(""),[u,C]=r.useState(""),[p,S]=r.useState(""),[h,I]=r.useState(!0),[x,T]=r.useState(!0),[n,l]=r.useState(!1);r.useEffect(()=>{!y&&b&&m(o,{replace:!0})},[b,y,m,o]);const A=async s=>{if(s.preventDefault(),!n){l(!0);try{if(t==="signup"){const{error:a}=await c.auth.signUp({email:i.trim(),password:u,options:{emailRedirectTo:`${window.location.origin}${o}`,data:{display_name:p.trim().slice(0,60)}}});if(a)throw a;(h||x)&&await c.functions.invoke("subscribe-email",{body:{email:i.trim(),name:p.trim()||void 0,source:"member-signup",pref_new_tools:h,pref_weekly_digest:x}}).catch(()=>{}),d({title:"Welcome to the collective",description:"Check your email to confirm your account, then your in-site tools unlock."})}else{const{error:a}=await c.auth.signInWithPassword({email:i.trim(),password:u});if(a)throw a;m(o,{replace:!0})}}catch(a){const P=a instanceof Error?a.message:"Something went wrong. Please try again.";d({title:"We could not do that",description:P,variant:"destructive"})}finally{l(!1)}}},L=async()=>{l(!0);const{error:s}=await c.auth.signInWithOAuth({provider:"google",options:{redirectTo:`${window.location.origin}${o}`}});s&&(d({title:"Google sign-in unavailable",description:s.message,variant:"destructive"}),l(!1))};return e.jsxs("div",{className:"min-h-screen bg-background text-foreground px-4 py-14",children:[e.jsxs(E,{children:[e.jsx("title",{children:"Join AIWebTools — Free Access to In-Site AI Tools"}),e.jsx("meta",{name:"description",content:"Create a free AIWebTools.ai account to run our hosted custom GPTs right on the site and get the weekly AI digest."}),e.jsx("link",{rel:"canonical",href:F("/join")}),e.jsx("meta",{name:"robots",content:"noindex,follow"})]}),e.jsxs("div",{className:"mx-auto w-full max-w-md rounded-2xl border border-primary/30 bg-card/70 p-7 shadow-lg backdrop-blur",children:[e.jsxs("div",{className:"mb-6 text-center",children:[e.jsx($,{className:"mx-auto mb-2 h-7 w-7 text-primary","aria-hidden":"true"}),e.jsx("h1",{className:"text-2xl font-bold text-primary",children:t==="signup"?"Create your free account":"Welcome back"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Unlock the in-site versions of our custom GPTs. Browsing stays free and open for everyone."})]}),e.jsx(w,{variant:"outline",className:"w-full",onClick:L,disabled:n,children:"Continue with Google"}),e.jsxs("div",{className:"my-5 flex items-center gap-3 text-xs text-muted-foreground",children:[e.jsx("span",{className:"h-px flex-1 bg-border"})," or use email ",e.jsx("span",{className:"h-px flex-1 bg-border"})]}),e.jsxs("form",{onSubmit:A,className:"space-y-4",children:[t==="signup"&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(f,{htmlFor:"displayName",children:"Your name"}),e.jsx(g,{id:"displayName",value:p,onChange:s=>S(s.target.value),maxLength:60,placeholder:"Seeker",autoComplete:"name"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(f,{htmlFor:"email",children:"Email"}),e.jsxs("div",{className:"relative",children:[e.jsx(M,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground","aria-hidden":"true"}),e.jsx(g,{id:"email",type:"email",required:!0,value:i,onChange:s=>k(s.target.value),className:"pl-9",autoComplete:"email",maxLength:320})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(f,{htmlFor:"password",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(R,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground","aria-hidden":"true"}),e.jsx(g,{id:"password",type:"password",required:!0,minLength:8,value:u,onChange:s=>C(s.target.value),className:"pl-9",autoComplete:t==="signup"?"new-password":"current-password"})]})]}),t==="signup"&&e.jsxs("div",{className:"space-y-2 rounded-lg border border-border/60 p-3",children:[e.jsxs("label",{className:"flex items-start gap-2 text-sm",children:[e.jsx(v,{checked:h,onCheckedChange:s=>I(s===!0)}),e.jsx("span",{children:"Email me when new AI tools land in the directory"})]}),e.jsxs("label",{className:"flex items-start gap-2 text-sm",children:[e.jsx(v,{checked:x,onCheckedChange:s=>T(s===!0)}),e.jsx("span",{children:"Send me the weekly AI digest (news, trends, new tools)"})]})]}),e.jsxs(w,{type:"submit",className:"w-full",disabled:n,children:[n&&e.jsx(U,{className:"mr-2 h-4 w-4 animate-spin","aria-hidden":"true"}),t==="signup"?"Create free account":"Sign in"]})]}),e.jsxs("p",{className:"mt-5 text-center text-sm text-muted-foreground",children:[t==="signup"?"Already have an account?":"New here?"," ",e.jsx("button",{type:"button",className:"font-semibold text-primary underline-offset-2 hover:underline",onClick:()=>
1N(t==="signup"?"signin":"signup"),children:t==="signup"?"Sign in":"Create one free"})]}),e.jsx("p",{className:"mt-3 text-center text-xs text-muted-foreground",children:e.jsx(_,{to:"/",className:"hover:text-primary",children:"← Back to the directory"})})]})]})};export{re 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.