PageSourceSearch

https://rocketwriter.ai/_nuxt/B6q8G_GR.js

js rocketwriter.ai collected 2026-10-05 13:39:51 UTC 9,925 bytes, 1 lines download raw bytes

1import{T as X}from"./BcXL8quQ.js";import{_ as Z}from"./BodJxGTV.js";import{e as ee,m as s,h as te,s as oe,E as se,i as ae,c as i,x as U,a as o,w as c,l as w,j as k,b as l,t as B,y as M,q as G,J as z,d as u,z as le,A,B as T,a8 as re,o as r}from"./D3mXZbvm.js";import{I as x}from"./CSXwf1OI.js";import{B as N}from"./CbyiM6aK.js";import"./D0HDmefO.js";const ne={class:"min-h-screen flex justify-center items-start px-4 pt-4 md:pt-8 pb-8 bg-gray-50"},ie={class:"w-full max-w-md rounded-2xl border border-gray-200 bg-white p-6 md:p-8 shadow-xl"},ue={class:"flex justify-center mb-6"},de={class:"inline-flex items-center rounded-full border border-gray-200 overflow-hidden bg-gray-50 p-1"},ce={key:0,class:"mb-8 p-4 bg-blue-50 border border-blue-100 rounded-xl text-center animate-in fade-in slide-in-from-top-4 duration-700"},me={class:"mt-1"},pe={key:0,class:"mt-2 text-xs text-red-500 text-center"},ge={class:"space-y-3"},ve={class:"flex items-center gap-2 cursor-pointer group"},fe={class:"flex items-center gap-2 cursor-pointer group"},xe={class:"text-xs text-gray-600 group-hover:text-gray-900 transition-colors"},ye={class:"flex justify-end"},be={key:0,class:"text-sm text-red-500 text-center font-medium"},we={key:2,class:"text-center py-4"},ke={class:"bg-gray-50 rounded-xl p-6 border border-gray-100"},he={key:0},Ve={key:0,class:"mt-2 text-xs text-red-500"},Ce={key:1,class:"text-sm text-green-600 font-medium"},Ne=ee({__name:"index",setup(_e){const h=s(""),p=s(""),g=s(""),y=s(""),V=s(!0),C=s(!1),_=s(!1),d=s(null),R=s(!1),v=s(""),S=s(!1),j=s(!1),m=s(null),b=s(null),f=s(""),E=s(!1),q=te(),O=re(),D=oe(),J=le();function L(){return D.query.redirect||"/"}const W=se(()=>g.value&&y.value&&g.value!==y.value);function P(t){if(!(typeof window>"u")){try{const e=window.fbq;typeof e=="function"&&e("track","CompleteRegistration")}catch(e){console.error("Meta CompleteRegistration tracking failed:",e)}O?.push({event:"complete_registration",meta_event_name:"CompleteRegistration",registration_method:t})}}async function F(){if(W.value){d.value="Passwords do not match.";return}if(!C.value){d.value="Please accept the terms and conditions.";return}_.value=!0,d.value="";try{const{request:t}=T(),e=await t("/api/v3/user",{method:"PUT",body:JSON.stringify({credential:{userIdentifier:p.value,password:g.value,provider:"password"},personalInfo:{name:h.value,email:p.value,subscribeToNewsletter:V.value}})});e.ok?(P("email"),R.value=!0,v.value=p.value):e.status===409?d.value="User already exists":d.value=e?.data?.message||"Registration failed."}catch(t){d.value=t?.message||"Unexpected error. Please try again later."}finally{_.value=!1}}async function Y(){if(v.value){S.value=!0,m.value=null;try{const{request:t}=T(),e=await t("/api/v3/user/registration/resend",{method:"POST",body:JSON.stringify({email:v.value})});e.ok?j.value=!0:e.status===404?m.value="Email not found.":m.value=e.data?.message||"Failed to resend email."}catch(t){m.value=t?.message||"Unexpected error."}finally{S.value=!1}}}function $(){return new Promise((t,e)=>{if(typeof window<"u"&&window.google?.accounts?.id){t();return}const n=document.createElement("script");n.src="https://accounts.google.com/gsi/client",n.async=!0,n.defer=!0,n.onload=()=>t(),n.onerror=()=>e(new Error("Failed to load Google script")),document.head.appendChild(n)})}async function H(){try{const t=J.public?.googleClientId;if(!t)return;await $();const e=window.google;e.accounts.id.initialize({client_id:t,callback:K,ux_mode:"popup"}),b.value&&e.accounts.id.renderButton(b.value,{theme:"outline",size:"large",text:"signup_with",width:b.value.offsetWidth||350})}catch(t){f.value=t?.message||"Google sign-up is temporarily unavailable."}}async function K(t){try{f.value="";const e=t?.credential;if(!e)throw new Error("No Google credential received");await q.googleRegister(e),P("google"),await Q()?await A("/my-books"):await A(L())}catch(e){f.value=e?.message||"Google registration failed."}}async function Q(){const t=localStorage.getItem("bookId");if(t){const{request:e}=T();return await e(`/api/v3/books/claim/${t}`,{method:"POST",headers:{Authorization:`Bearer ${q.token}`,"Content-Type":"application/json"}}),localStorage.removeItem("bookId"),!0}return!1}return ae(()=>{E.value=!!localStorage.getItem("bookId"),setTimeout(()=>{H()},100)}),(t,e)=>{const n=X,I=Z;return r(),i("div",ne,[E.value?(r(),U(n,{key:1},{default:c(()=>[...e[9]||(e[9]=[u("Congratulations | RocketWriter.ai",-1)])]),_:1})):(r(),U(n,{key:0},{default:c(()=>[...e[8]||(e[8]=[u("sign up | RocketWriter.ai",-1)])]),_:1}
1)),o("div",ie,[o("div",ue,[o("div",de,[e[11]||(e[11]=o("span",{class:"px-6 py-1.5 text-xs font-medium bg-primary text-white rounded-full shadow-sm"},"sign up",-1)),l(I,{to:"/login",class:"px-6 py-1.5 text-xs font-medium text-gray-500 rounded-full hover:text-gray-700 transition-colors"},{default:c(()=>[...e[10]||(e[10]=[u("log in",-1)])]),_:1})])]),e[23]||(e[23]=o("div",{class:"text-center mb-6"},[o("h1",{class:"text-2xl md:text-3xl font-bold text-gray-900"},"create your account"),o("p",{class:"mt-1 text-sm text-gray-600"},"Join us today! It only takes a minute.")],-1)),E.value&&!R.value?(r(),i("div",ce,[...e[12]||(e[12]=[k('<div class="w-16 h-16 bg-white rounded-full flex items-center justify-center mx-auto mb-3 shadow-sm"><span class="text-2xl animate-bounce">🚀</span></div><h2 class="text-lg font-bold text-secondary mb-1">Congratulations!</h2><p class="text-sm text-gray-600 leading-relaxed"> Your book is currently being generated.<br><span class="font-semibold text-gray-800">Register now to view and edit it!</span></p>',3)])])):w("",!0),o("div",null,[e[13]||(e[13]=k('<div class="relative mb-4"><div class="absolute inset-0 flex items-center" aria-hidden="true"><div class="w-full border-t border-gray-200"></div></div><div class="relative flex justify-center text-[10px] uppercase"><span class="bg-white px-2 text-gray-400">sign up with other account</span></div></div>',1)),o("div",me,[o("div",{ref_key:"googleBtnEl",ref:b,class:"h-10 w-full flex items-center justify-center rounded-md border border-gray-300 hover:bg-gray-50 transition-colors cursor-pointer",id:"google-register-btn"},null,512)]),f.value?(r(),i("p",pe,B(f.value),1)):w("",!0)]),e[24]||(e[24]=k('<div class="my-6 relative"><div class="absolute inset-0 flex items-center" aria-hidden="true"><div class="w-full border-t border-gray-200"></div></div><div class="relative flex justify-center text-[10px] uppercase"><span class="bg-white px-2 text-gray-400">Or continue with email</span></div></div>',1)),R.value?(r(),i("div",we,[e[22]||(e[22]=k('<div class="mb-4 flex justify-center"><div class="w-16 h-16 bg-green-100 text-green-600 rounded-full flex items-center justify-center"><svg xmlns="http://www.w3.org/2000/svg" class="h-10 w-10" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg></div></div><h2 class="text-xl font-bold text-gray-900 mb-2">Registration successful!</h2><p class="text-sm text-gray-600 mb-6">Please check your email to confirm your account.</p>',3)),o("div",ke,[e[20]||(e[20]=o("p",{class:"text-xs text-gray-500 mb-4 uppercase font-bold tracking-wider"},"Didn't receive it yet?",-1)),j.value?(r(),i("div",Ce," Email resent successfully! ")):(r(),i("div",he,[l(x,{type:"email",placeholder:"Enter your email",modelValue:v.value,"onUpdate:modelValue":e[7]||(e[7]=a=>v.value=a),class:"mb-3"},null,8,["modelValue"]),l(N,{variant:"secondary",block:"",size:"sm",onClick:Y,loading:S.value},{default:c(()=>[...e[19]||(e[19]=[u(" click here to resend ",-1)])]),_:1},8,["loading"]),m.value?(r(),i("p",Ve,B(m.value),1)):w("",!0)]))]),l(N,{variant:"ghost",block:"",class:"mt-6",to:"/login"},{default:c(()=>[...e[21]||(e[21]=[u(" Back to login ",-1)])]),_:1})])):(r(),i("form",{key:1,onSubmit:M(F,["prevent"]),class:"space-y-4"},[l(x,{type:"text",label:"Name",placeholder:"Your name",required:!0,modelValue:h.value,"onUpdate:modelValue":e[0]||(e[0]=a=>h.value=a),"label-class":"text-gray-700 font-semibold"},null,8,["modelValue"]),l(x,{type:"email",label:"Email",placeholder:"[email protected]",required:!0,modelValue:p.value,"onUpdate:modelValue":e[1]||(e[1]=a=>p.value=a),"label-class":"text-gray-700 font-semibold"},null,8,["modelValue"]),l(x,{type:"password",label:"Password",placeholder:"Minimum 8 characters",required:!0,modelValue:g.value,"onUpdate:modelValue":e[2]||(e[2]=a=>g.value=a),"label-class":"text-gray-700 font-semibold"},null,8,["modelValue"]),l(x,{type:"password",label:"Confirm Password",placeholder:"Retype your password",required:!0,modelValue:y.value,"onUpdate:modelValue":e[3]||(e[3]=a=>y.value=a),"label-class":"text-gray-700 font-semibold"},null,8,["modelValue"]),o("div",ge,[o("label",ve,[G(o("input",{type:"checkbox","onUpdate:modelValue":e[4]||(e[4]=a=>V.value=a),class:"w-4 h-4 rounded border-gray-300 text-primary focus:ring-primary curs
1or-pointer"},null,512),[[z,V.value]]),e[14]||(e[14]=o("span",{class:"text-xs text-gray-600 group-hover:text-gray-900 transition-colors"},"Subscribed to newsletter",-1))]),o("label",fe,[G(o("input",{type:"checkbox","onUpdate:modelValue":e[5]||(e[5]=a=>C.value=a),required:"",class:"w-4 h-4 rounded border-gray-300 text-primary focus:ring-primary cursor-pointer"},null,512),[[z,C.value]]),o("span",xe,[e[16]||(e[16]=u(" I accept the ",-1)),l(I,{to:"/terms",class:"text-blue-600 hover:underline",onClick:e[6]||(e[6]=M(()=>{},["stop"]))},{default:c(()=>[...e[15]||(e[15]=[u("terms and conditions",-1)])]),_:1})])])]),o("div",ye,[l(I,{to:"/login",class:"text-xs font-medium text-blue-600 hover:text-blue-500"},{default:c(()=>[...e[17]||(e[17]=[u("Already have an account? Log in",-1)])]),_:1})]),l(N,{type:"submit",variant:"primary",block:"",class:"py-3",loading:_.value},{default:c(()=>[...e[18]||(e[18]=[u(" sign up ",-1)])]),_:1},8,["loading"]),d.value?(r(),i("p",be,B(d.value),1)):w("",!0)],32))])])}}});export{Ne 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.