1import{d as v,K as y,R as l,P as h,a1 as S,L as k,_ as C,c,a as s,v as g,x as f,E as L,t as E,y as x,f as b,n as o,z as A,a0 as P,D as _,N as U,G as $,o as w}from"./D-uLEkMY.js";import{_ as R}from"./ou0V5kub.js";import{_ as B}from"./Cz0V1cHQ.js";import{v as M}from"./DvPO6GVX.js";import{u as O}from"./BW-h8pph.js";import"./x_rD_Ya3.js";const N=v({name:"SignUp",data(){return{userStore:k(),email:"",password:"",showPassword:!1,isDarkMode:!1,touched:{email:!1,password:!1},attemptedSubmit:!1}},computed:{emailOk(){const e=l.trim(this.email||"");return e?M.isEmail(e,{require_tld:!0,allow_utf8_local_part:!0,require_display_name:!1}):!1},shouldShowPasswordValidation(){return this.attemptedSubmit||this.touched.password||(this.password||"").length>0},passwordRules(){const e=this.password||"",t=l.trim(this.email||"").toLowerCase(),n=l.includes(t,"@")&&t.split("@")[1]||"",p=e.length===0?!1:/^[\x20-\x7E]+$/.test(e),m=e.length>=8&&e.length<=72,a=e.toLowerCase(),i=!t||a!==t&&!l.includes(a,t),d=!n||!l.includes(a,n),u=e.length===0||e[0]!==" "&&e[e.length-1]!==" ";return{lengthOk:m,hasUpper:/[A-Z]/.test(e),hasLower:/[a-z]/.test(e),hasNumber:/\d/.test(e),hasSymbol:/[^A-Za-z0-9]/.test(e),printableAscii:p,notContainsEmail:i,notContainsDomain:d,noLeadingTrailingSpace:u}},passwordAllOk(){const e=this.passwordRules;return e.lengthOk&&e.hasUpper&&e.hasLower&&e.hasNumber&&e.hasSymbol&&e.printableAscii&&e.notContainsEmail&&e.notContainsDomain&&e.noLeadingTrailingSpace},passwordError(){if(!this.shouldShowPasswordValidation||!this.password)return"";const e=this.passwordRules;return e.printableAscii?e.noLeadingTrailingSpace?!e.notContainsEmail||!e.notContainsDomain?"Password cannot contain your email address (or domain).":"":"Your password can't start or end with a blank space.":"Password can only include standard characters (no emoji or special whitespace like tabs/new lines)."},canContinue(){this.passwordRules;const e=!!this.password&&this.passwordAllOk;return this.emailOk&&e}},beforeRouteLeave(e){["/sign-up","/sign-up/details","/check-email","/auth/verify-callback"].some(n=>e.path.startsWith(n))||localStorage.removeItem("alttextstudio:selected_plan")},mounted(){O({title:"Sign Up",meta:[{name:"description",content:"Create your free Alt Text Studio account. Get 25 free credits to generate AI-powered alt text for your images. Sign up with email or Google."}]}),typeof document<"u"&&(this.isDarkMode=document.documentElement.classList.contains("dark")),S((this._.provides[h]||this.$route).query);const e=(this._.provides[h]||this.$route).query.email;e&&(this.email=decodeURIComponent(e));{const t=l.trim(this.email||"");t&&window.localStorage.setItem("pending_signup_email",t)}},methods:{handleSignUp(){if(this.attemptedSubmit=!0,this.touched.email=!0,this.touched.password=!0,!!this.canContinue){this.userStore.setEmail(this.email),this.userStore.setPassword(this.password);{const e=l.trim(this.email||"");e&&window.localStorage.setItem("pending_signup_email",e);const t=(this._.provides[h]||this.$route).query.redirect;t&&window.localStorage.setItem("post_signup_redirect",t)}this.$router.push("/sign-up/details")}},async handleGoogleSignUp(e){try{const t=await this.userStore.googleLogin(e);if(!this.userStore.authenticated){console.error("Failed to authenticate with Google");return}if(t&&(t.is_new_user===!0||t.is_new_user===1||t.is_new_user==="1"))this.$router.push("/sign-up/details");else{const p="alttextstudio:selected_plan",m=localStorage.getItem(p);if(m)try{const a=JSON.parse(m);localStorage.removeItem(p);const i=y(),d=localStorage.getItem("auth_token"),u=d?{Authorization:`Bearer ${d}`}:{};if(a.priceId){const r=await $fetch(`${i.public.apiBaseUrl}/checkout/subscription`,{method:"POST",headers:u,body:{price_id:a.priceId}});if(r.url){window.location.href=r.url;return}}else if(a.quantity){const r=await $fetch(`${i.public.apiBaseUrl}/checkout/pay-as-you-go`,{method:"POST",headers:u,body:{quantity:a.quantity}});if(r.url){window.location.href=r.url;return}}else if(a.url){window.location.href=a.url;return}}catch{}this.$router.push("/create")}}catch(t){console.error("Google sign up error:",t)}},handleGoogleError(e){console.error("Google OAuth error:",e)}}}),G={class:"text-foreground relative m-0 flex min-h-screen w-full flex-col items-center justify-center px-4 pt-24 pb-12 sm:px-6"},I={class:"text-center text-sm"},D={class:"flex w-full max-w-[26.5rem] flex-col items-center"},Z={class:"flex w-full flex-col"},V={class:"relative"},T=["type"],q={class:"absolute inset-y-0 right-2 flex items-center gap-2"},j={key:0,class:"text-emerald-600","aria-hidden":"true"}
1,z=["title","aria-label"],F={key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"h-5 w-5"},H={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"h-5 w-5"},K={key:0,class:"mt-2.5 text-sm text-red-700"},Y={class:"mt-2"},J={class:"mt-2 space-y-2 text-sm"},W={class:"flex items-start gap-2"},Q={class:"flex items-start gap-2"},X={class:"flex items-start gap-2"},ee={class:"flex items-start gap-2"},te={class:"flex items-start gap-2"},se=["disabled"];function oe(e,t,n,p,m,a){const i=$,d=R,u=B;return w(),c("div",G,[t[19]||(t[19]=s("h1",{class:"mb-4 text-3xl font-bold sm:text-5xl"},"Sign Up",-1)),s("h2",I,[t[6]||(t[6]=f(" Already have an account? ",-1)),g(i,{to:"/sign-in",class:"text-accent underline"},{default:L(()=>t[5]||(t[5]=[f(" Sign in ",-1)])),_:1,__:[5]})]),g(d,{class:"mt-6"}),s("form",{class:"border-border bg-surface mx-4 mt-2 flex w-full max-w-[30rem] flex-col items-center justify-center rounded-xl border p-6 shadow-sm sm:mx-0 sm:p-8",autocomplete:"on",onSubmit:t[4]||(t[4]=U((...r)=>e.handleSignUp&&e.handleSignUp(...r),["prevent"]))},[s("div",D,[g(u,{"button-text":"Continue with Google",theme:e.isDarkMode?"dark":"light",onSuccess:e.handleGoogleSignUp,onError:e.handleGoogleError},null,8,["theme","onSuccess","onError"]),t[18]||(t[18]=E('<div class="my-5 flex w-full items-center gap-3"><div class="bg-border h-px flex-1"></div><span class="text-muted text-xs font-medium">or</span><div class="bg-border h-px flex-1"></div></div><div class="mb-4 w-full text-left"><p class="text-foreground text-sm font-semibold"> Sign up with email </p></div>',2)),s("div",Z,[t[17]||(t[17]=s("label",{class:o(["mb-2.5 block text-sm font-medium","text-foreground"]),for:"email"}," Email address ",-1)),x(s("input",{id:"email","onUpdate:modelValue":t[0]||(t[0]=r=>e.email=r),autocomplete:"email",class:o(["block w-full rounded-lg px-3 py-2.5 text-sm shadow-xs","border-border bg-surface-2 text-foreground placeholder:text-muted-2 focus:border-accent focus:ring-accent border"]),placeholder:"[email protected]",type:"email",maxlength:"254"},null,512),[[A,e.email]]),s("label",{class:o(["mt-4 mb-2.5 block text-sm font-medium",e.passwordError?"text-red-700":"text-foreground"]),for:"password"}," Password ",2),s("div",V,[x(s("input",{id:"password","onUpdate:modelValue":t[1]||(t[1]=r=>e.password=r),autocomplete:"new-password",class:o(["block w-full rounded-lg px-3 py-2.5 pr-20 text-sm shadow-xs",e.passwordError?"border border-red-300 bg-red-50 text-red-700 placeholder:text-red-400 focus:border-red-500 focus:ring-red-500 dark:border-red-500/40 dark:bg-red-500/10 dark:text-red-300 dark:placeholder:text-red-400/60":e.passwordAllOk&&e.shouldShowPasswordValidation?"border border-green-300 bg-green-50 text-green-700 placeholder:text-green-400 focus:border-green-500 focus:ring-green-500 dark:border-emerald-500/40 dark:bg-emerald-500/10 dark:text-emerald-300 dark:placeholder:text-emerald-400/60":"border-border bg-surface-2 text-foreground placeholder:text-muted-2 focus:border-accent focus:ring-accent border"]),placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",type:e.showPassword?"text":"password",maxlength:"72",onBlur:t[2]||(t[2]=r=>e.touched.password=!0)},null,42,T),[[P,e.password]]),s("div",q,[e.passwordAllOk?(w(),c("span",j,t[7]||(t[7]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",class:"h-5 w-5"},[s("path",{"fill-rule":"evenodd",d:"M16.704 5.293a1 1 0 0 1 .003 1.414l-7.25 7.292a1 1 0 0 1-1.417.002L3.296 9.266a1 1 0 0 1 1.414-1.414l4.03 4.03 6.542-6.589a1 1 0 0 1 1.422 0Z","clip-rule":"evenodd"})],-1)]))):b("",!0),s("button",{type:"button",class:"text-muted hover:bg-surface-2 hover:text-foreground focus:ring-brand-blue/30 cursor-pointer rounded-lg p-1 focus:ring-2 focus:outline-none",title:e.showPassword?"Hide password":"Show password","aria-label":e.showPassword?"Hide password":"Show password",onClick:t[3]||(t[3]=r=>e.showPassword=!e.showPassword)},[e.showPassword?(w(),c("svg",F,t[8]||(t[8]=[s("path",{d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7Z"},null,-1),s("path",{d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"},null,-1)]))):(w(),c("svg",H,t[9]||(t[9]=[s("path",{d:"M10.733 5.08A10.744 10.744 0 0 1 12 5c4.478 0 8.268 2.943 9.542 7a10.71 10.71 0 0 1-4.111 5.155"},null,-1),s("path",{d:"M6.61 6.61A10.7 10.7 0 0 0 2.458 12c1.274 4.057 5.064 7 9.542 7 1.264 0 2.476-.235 3.6-.665"},null,-1),s("path",{d:"M14.12 14.12a3 3 0 0 1-4.24-4.24"},null,-1),s("path",{d:"m3 3 18 18"},null,-1)])))],8,z)])]),e.passwordError?(w(),c("p",K,_(e.passwordError),1)):b("",!0),s("div",Y,[t[15]||(t[15]=s("p",{class:"text-foreground mt-4 text-sm font-semibold"}," Create a password that contains: ",-1)),s("ul",J,[s("li",W,[s("span",{class:o(["mt-0.5",e.passwordRules.lengthOk?"text-emerald-600":"text-gray-300"]),"aria-hidden":"true"},t[10]||(t[10]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",class:"h-4 w-4"},[s("path",{"fill-rule":"evenodd",d:"M16.704 5.293a1 1 0 0 1 .003 1.414l-7.25 7.292a1 1 0 0 1-1.417.002L3.296 9.266a1 1 0 0 1 1.414-1.414l4.03 4.03 6.542-6.589a1 1 0 0 1 1.422 0Z","clip-rule":"evenodd"})],-1)]),2),s("span",{class:o(e.passwordRules.lengthOk?"text-emerald-700":"text-gray-700")}," At least 8 characters. ",2)]),s("li",Q,[s("span",{class:o(["mt-0.5",e.passwordRules.hasLower?"text-emerald-600":"text-gray-300"]),"aria-hidden":"true"},t[11]||(t[11]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",class:"h-4 w-4"},[s("path",{"fill-rule":"evenodd",d:"M16.704 5.293a1 1 0 0 1 .003 1.414l-7.25 7.292a1 1 0 0 1-1.417.002L3.296 9.266a1 1 0 0 1 1.414-1.414l4.03 4.03 6.542-6.589a1 1 0 0 1 1.422 0Z","clip-rule":"evenodd"})],-1)]),2),s("span",{class:o(e.passwordRules.hasLower?"text-emerald-700":"text-gray-700")}," At least 1 lower case letter (a-z). ",2)]),s("li",X,[s("span",{class:o(["mt-0.5",e.passwordRules.hasUpper?"text-emerald-600":"text-gray-300"]),"aria-hidden":"true"},t[12]||(t[12]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",class:"h-4 w-4"},[s("path",{"fill-rule":"evenodd",d:"M16.704 5.293a1 1 0 0 1 .003 1.414l-7.25 7.292a1 1 0 0 1-1.417.002L3.296 9.266a1 1 0 0 1 1.414-1.414l4.03 4.03 6.542-6.589a1 1 0 0 1 1.422 0Z","clip-rule":"evenodd"})],-1)]),2),s("span",{class:o(e.passwordRules.hasUpper?"text-emerald-700":"text-gray-700")}," At least 1 upper case letter (A-Z). ",2)]),s("li",ee,[s("span",{class:o(["mt-0.5",e.passwordRules.hasNumber?"text-emerald-600":"text-gray-300"]),"aria-hidden":"true"},t[13]||(t[13]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",class:"h-4 w-4"},[s("path",{"fill-rule":"evenodd",d:"M16.704 5.293a1 1 0 0 1 .003 1.414l-7.25 7.292a1 1 0 0 1-1.417.002L3.296 9.266a1 1 0 0 1 1.414-1.414l4.03 4.03 6.542-6.589a1 1 0 0 1 1.422 0Z","clip-rule":"evenodd"})],-1)]),2),s("span",{class:o(e.passwordRules.hasNumber?"text-emerald-700":"text-gray-700")}," At least one number (0-9). ",2)]),s("li",te,[s("span",{class:o(["mt-0.5",e.passwordRules.hasSymbol?"text-emerald-600":"text-gray-300"]),"aria-hidden":"true"},t[14]||(t[14]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",class:"h-4 w-4"},[s("path",{"fill-rule":"evenodd",d:"M16.704 5.293a1 1 0 0 1 .003 1.414l-7.25 7.292a1 1 0 0 1-1.417.002L3.296 9.266a1 1 0 0 1 1.414-1.414l4.03 4.03 6.542-6.589a1 1 0 0 1 1.422 0Z","clip-rule":"evenodd"})],-1)]),2),s("span",{class:o(e.passwordRules.hasSymbol?"text-emerald-700":"text-gray-700")}," At least one symbol (!@#$%^&*). ",2)])])]),s("button",{type:"submit",class:"bg-accent text-on-accent focus:ring-brand-blue/30 mt-6 flex h-16 w-full cursor-pointer items-center justify-center gap-x-2 rounded-lg px-4 hover:opacity-95 focus:ring-4 focus:outline-none disabled:cursor-not-allowed disabled:opacity-60",disabled:!e.canContinue},t[16]||(t[16]=[s("div",{class:"flex flex-col items-center"},[s("span",{class:"font-bold"},"Sign Up")],-1)]),8,se)])])],32)])}const ue=C(N,[["render",oe]]);export{ue 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.