1import{h as G,d as N,a_ as W,R as F,r as u,rl as $,dz as D,g as I,j as e,B as s,T as C,n as P,aW as M,b8 as O,a9 as Q,ri as U,o7 as V,q6 as z,ao as R,m as H,bf as K,bL as _,rm as Z,fL as J,rn as X,L as Y,oj as q,bn as ee,pQ as ae,cr as re}from"./index-DD7wEX2k.js";import{b as oe}from"./formik.esm-y-epKQ_W.js";import{d as v}from"./index-DmQCya3L.js";import{A,l as se,G as te,a as ne}from"./AuthDivider-XQEn_i2J.js";import{O as ce,S as h}from"./Lazy-B4elB764.js";import{a as ie}from"./installTiktokRedirect-BdoQMn9S.js";import{A as le}from"./AuthContainer-C3LK-5DD.js";import"./toString-BpP3vzIR.js";import"./formik-material-ui.es6-Brkbu6Gk.js";import"./RadioGroup-DH1Vw7cH.js";import"./RadioGroupContext-CcoEOJr4.js";import"./Switch-y6CmP1sJ.js";import"./loginBackground-DvgDqpLn.js";import"./Page-mik8EZ_Q.js";import"./Grid-eV9hG1VW.js";const B="6LduT10aAAAAANj3912_q6P7lLVEhokhARPvLZU3";function L({msgRequest:t,setMsgRequest:S,...b}){const a=G(),d=N(),{app_type:g}=W(),c=F.useRef(),[x,k]=u.useState(),i=localStorage.getItem("showGuide"),{getParamUrlString:n}=$(),{cart:o}=D(),m=I(r=>{var l;return(l=r==null?void 0:r.account)==null?void 0:l.token_tiktok}),y=n.includes("/merchant/squarespace/"),w=n.includes("merchants/woocommerce"),f=()=>{d.push(n||"/")};u.useEffect(()=>{v.loadReCaptcha(B)},[]);const j=r=>{k(r)};return e.jsx(oe,{initialValues:{name:"",email:"",new_pwd:"",whatsapp:"",skype:""},validationSchema:ce().shape({name:h().max(255).required("Name is required"),email:h().email("Must be a valid email").max(255).required("Email is required"),new_pwd:h().min(7,"At least 7 characters").max(255).required("Password is required"),skype:h().max(255),whatsapp:h().max(255)}),onSubmit:async(r,{setErrors:l,setStatus:T,setSubmitting:E})=>{try{if(x){const p={...r,pwd:r.new_pwd};if(y&&(p.market_app="squarespace"),w&&(p.market_app="wordpress"),g&&(p.market_app=g),localStorage.removeItem("openDrawer"),await a(O({...p,recaptcha:x})),o&&m)await Q.loginWithEmailAndPassword(r.email,r.new_pwd),await ie(o,m,d);else try{await a(U(r.email,r.new_pwd)),f(),a(V(!0)),i||(localStorage.setItem("showGuide","close"),a(z(!0)))}catch{T({success:!1}),E(!1)}}}catch(p){c.current.execute(),S(p),T({success:!1}),l({submit:p.message}),E(!1)}},children:({handleSubmit:r,isSubmitting:l})=>e.jsxs("form",{onSubmit:r,...b,children:[e.jsx(A,{label:"Name",name:"name"}),e.jsx(A,{label:"Email Address",name:"email",type:"email",placeholder:"e.g., [email protected]"}),e.jsx(A,{label:"Password",name:"new_pwd",type:"password",autoComplete:"new-password"}),e.jsx(v.ReCaptcha,{ref:c,sitekey:B,action:"Test",verifyCallback:j}),e.jsx(s,{justifyItems:"center",alignItems:"center",my:2,children:e.jsxs(C,{align:"center",variant:"body2",color:"textSecondary",style:{color:"#546e7a"},children:["By signing up, you agree to our ",e.jsx(P,{component:"a",color:"secondary",target:"_blank",href:"https://litcommerce.com/terms-and-conditions/",children:"Terms and Conditions "}),"and ",e.jsx(P,{component:"a",target:"_blank",href:"https://litcommerce.com/privacy-policy/",color:"secondary",children:"Privacy Policy"})]})}),e.jsx(s,{mt:2,children:e.jsx(M,{color:"secondary",disabled:l,fullWidth:!0,size:"large",type:"submit",text:"Create account"})})]})})}L.propTypes={onSubmitSuccess:R.func};L.default={onSubmitSuccess:()=>{}};const me=H(t=>({logoStyle:{height:60,margin:"auto",objectFit:"contain",[t.breakpoints.down("xs")]:{height:48}},logoBox:{margin:"auto",display:"flex",marginBottom:t.spacing(3)},formWrapper:{boxSizing:"border-box",width:"100%",maxWidth:500,padding:t.spacing(5),[t.breakpoints.down("sm")]:{padding:t.spacing(4)},[t.breakpoints.down("xs")]:{maxWidth:"100%",padding:t.spacing(3,2.5)}}})),pe=new ee,de=window.location.hostname==="localhost"?"localhost":".litcommerce.com";function Ee(){const t=me(),S=G(),b=K(),{notifiRequest:a,sale_data:d}=I(n=>n.account),g=n=>async()=>{["accessToken","refreshToken","loginByToken"].forEach(m=>pe.remove(m,{domain:de,path:"/"})),S({type:ae});const o=await re.get(`/merchant/${n}/login`);o!=null&&o.data&&(window.location.href=o==null?void 0:o.data)},[c,x]=u.useState({}),k=new Date(c==null?void 0:c.offer_ends).toDateString();u.useEffect(()=>{x(d)},[d]);const i=u.useMemo(()=>{var o,m,y,w,f,j,r,l;let n="";return a!=null&&a.error&&(a==null?void 0:a.type)==="registerFailure"&&(n=((m=(o=a==null?void 0:a.error)==null?void 0:o.errors)==null?void 0:m.email)||((w=(y=a==null?void 0:a.error)==null?void 0:y.errors)==null?void 0:w.captcha)||((f=a==null?void 0:a.error)==null?void 0:f.message)||((j=a==null?void 0:a.error)==null?void 0:j.errors)||((r=a==null?void 0:a.error)==null?void 0:r.msg)||((l=a==null?void 0:a.error)==null?void 0:l.error)||["Register Fail"]),n},[a]);return e.jsx(le,{title:"Register",children:e.jsxs(s,{className:t.formWrapper,children:[(c==null?void 0:c.offer_free_plan)==="1"&&e.jsx(s,{py:2,children:e.jsx(_,{icon:e.jsx(J,{}),content:`Special offer: get free Unlimited Plan for ${Z(c)} (ends in ${k}).`,type:"success"})}),(i==null?void 0:i.map)&&e.jsx(s,{py:2,children:e.jsx(_,{content:i.map((n,o)=>e.jsx(s,{children:n},o)),type:"warning"})}),!!i&&typeof i=="string"&&e.jsx(s,{py:2,children:e.jsx(_,{content:e.jsx(s,{children:i}),type:"warning"})}),e.jsx(s,{className:t.logoBox,children:e.jsx("img",{alt:"Logo",src:se,className:t.logoStyle})}),e.jsx(C,{variant:"h3",align:"center",style:{color:"#263238"},children:"Create your account"}),e.jsx(s,{mt:3,children:e.jsx(X,{})}),e.jsx(s,{my:3.5,children:e.jsx(te,{label:"Sign up with Google",onClick:g("google")})}),e.jsx(ne,{text:"or sign up with email address"}),e.jsx(s,{mt:2,children:e.jsx(L,{})}),e.jsx(s,{my:2,children:e.jsxs(C,{align:"center",variant:"body2",color:"textSecondary",style:{color:"#546e7a"},children:["Already have an account? ",e.jsx(Y,{component:q,to:`/login${b.search}`,variant:"body2",color:"primary",children:"Login here"})]})})]})})}export{Ee 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.