PageSourceSearch

https://chemillusion.com/assets/QuickConnectPage-D8K-u0cN.js

js chemillusion.com collected 2026-10-08 23:52:49 UTC 4,023 bytes, 1 lines download raw bytes

1import{u as q,s as B,b as r,j as e,h as L,C as V,B as l,V as g,H,A as x,c as p,d as j,e as f,S as D,T as _,F as z,g as M,I as Q,f as C,D as N,w as U,i as O}from"./index-DN2b6gf5.js";import{u as R}from"./formik.esm-Dn56bB-F.js";import{u as W,a as $,r as c}from"./react-vendor-DRshJiK8.js";import{c as Y,a as G}from"./index.esm-Dd3eVCBp.js";import{S as J}from"./SetupOtpCredentialForm-Bo6VCA0_.js";import{F as K}from"./form-error-Cu8GFuSj.js";import"./cloneDeep-2vYR875i.js";import"./toString-D3VAsmdj.js";import"./_baseClone-Dpvoxo03.js";import"./clone-C10WcAk9.js";import"./passwordPolicy-CYRtBnUA.js";const X=Y().shape({email:G().email("Please enter a valid email address").required("Email is required")});function Z(i,o){var n,t;return((t=(n=i.response)==null?void 0:n.data)==null?void 0:t.detail)||o}const de=()=>{const[i]=W(),o=$(),u=q(),n=B(i.get("next")),[t,b]=c.useState(!0),[d,y]=c.useState("pending"),w=r("white","gray.800"),S=r("gray.200","gray.600"),h=r("gray.900","gray.100"),v=r("white","gray.700"),A=r("gray.500","gray.400"),F=r("gray.600","gray.400"),a=i.get("token"),m=i.get("source"),k=c.useMemo(()=>m==="teacher-dashboard"||m==="learn-to-draw"?"After you sign in, you can turn on teacher mode on the Teacher Dashboard and build class links.":null,[m]);c.useEffect(()=>{a?(y("valid"),b(!1)):(y("quick"),b(!1))},[a]);const s=R({initialValues:{email:""},validationSchema:X,onSubmit:async(E,{resetForm:P})=>{try{await O.quickConnect(E.email),u({title:"Check your email",description:"We sent a link to finish setting up your free ChemIllusion account.",status:"success",duration:6e3,isClosable:!0}),P()}catch(T){const I=Z(T,"Failed to start sign-up. Please try again.");u({title:"Error",description:I,status:"error",duration:5e3,isClosable:!0})}}});return e.jsxs(e.Fragment,{children:[e.jsx(L,{title:a?"Complete Account Setup - ChemIllusion":"Quick connect - ChemIllusion",description:a?"Finish setting up your account":"Create a free ChemIllusion account or log in",canonical:"https://chemillusion.com/quick-connect"}),e.jsx(V,{maxW:"md",py:12,children:e.jsx(l,{bg:w,p:8,borderRadius:"lg",boxShadow:"lg",border:"1px solid",borderColor:S,children:e.jsxs(g,{spacing:6,align:"stretch",children:[e.jsx(H,{as:"h1",textAlign:"center",color:h,children:a?"Complete Account Setup":"Quick connect"}),t&&e.jsxs(x,{status:"info",children:[e.jsx(p,{}),e.jsxs(l,{children:[e.jsx(j,{children:"Loading…"}),e.jsxs(f,{children:[e.jsx(D,{size:"sm",mr:2}),"Please wait."]})]})]}),d==="quick"&&!t?e.jsxs(e.Fragment,{children:[e.jsxs(x,{status:"info",children:[e.jsx(p,{}),e.jsxs(l,{children:[e.jsx(j,{children:"Create a free account"}),e.jsx(f,{children:"Enter your email and we will send you a link to finish setup. Already registered? Use Log in below."})]})]}),k?e.jsx(_,{fontSize:"sm",color:F,children:k}):null,e.jsx(l,{as:"form",onSubmit:s.handleSubmit,children:e.jsxs(g,{spacing:4,align:"stretch",children:[e.jsxs(z,{isInvalid:s.touched.email&&!!s.errors.email,children:[e.jsx(M,{color:h,children:"Email"}),e.jsx(Q,{id:"quick-email",name:"email",type:"email",value:s.values.email,onChange:s.handleChange,onBlur:s.handleBlur,placeholder:"[email protected]",color:h,bg:v,borderColor:S,_placeholder:{color:A},_focus:{borderColor:"blue.500",boxShadow:"0 0 0 1px blue.500"}}),e.jsx(K,{children:s.errors.email})]}),e.jsx(C,{type:"submit",colorScheme:"blue",size:"lg",isLoading:s.isSubmitting,loadingText:"Sending…",children:"Email me a sign-up link"})]})})]}):null,d==="valid"&&!t&&a?e.jsx(J,{token:a,onComplete:()=>o(n||N,{replace:!0})}):null,d==="expired"&&e.jsxs(x,{status:"warning",children:[e.jsx(p,{}),e.jsxs(l,{children:[e.jsx(j,{children:"Setup Link Expired"}),e.jsx(f,{children:"Your setup link has expired. Please contact support for a new link."})]})]}),e.jsxs(g,{spacing:3,children:[e.jsx(C,{variant:"outline",onClick:()=>o(U("/login",n)),width:"full",children:"Already have an account? Log In"}),e.jsx(C,{variant:"ghost",onClick:()=>o("/"),width:"full",children:"Back to Home"})]})]})})})]})};export{de 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.