import{j as b,k as t,l as x,r as y,c as k,a,m as r,v as p,t as C,b as f,w as m,d as I,n as V,p as j,q as S,e as P,o as T,i as _,_ as B}from"./index-b3134325.js";import{g as E,p as L,s as N}from"./api-04371953.js";const h=o=>(j("data-v-2cfaf11a"),o=o(),S(),o),R={class:"page-wrapper",id:"app","data-layout":"horizontal","data-navbarbg":"skin6","data-sidebartype":"full","data-sidebar-position":"fixed","data-header-position":"fixed"},U=I('
',1),q={class:"body-wrapper overflow-hidden"},A={class:"position-relative overflow-hidden min-vh-100 d-flex align-items-center justify-content-center drawise-auth-bg"},D={class:"d-flex align-items-center justify-content-center w-100"},M={class:"row justify-content-center w-100"},z={class:"col-md-8 col-lg-6 col-xxl-3"},H={class:"card mb-0"},O={class:"card-body"},F={class:"mb-3"},G={class:"mb-4"},J={class:"mb-4"},K=["disabled"],Q={class:"d-flex align-items-center justify-content-center"},W=h(()=>a("p",{class:"fs-4 mb-0 fw-medium"}," Already have an account? ",-1)),X=h(()=>a("div",{class:"row"},null,-1)),Y=b({__name:"signup",setup(o){const l=t(!1),n=t("Register"),d=t(),i=t(),c=t(),w=async()=>{try{l.value=!0;var u=n.value;n.value="loading...",(await L)("/auth/signup/",{email:d.value,password:i.value,confirm_password:c.value}).then(e=>{console.log(e),e.data&&(N(e.data.token),console.log(e.data.token),V.push("dashboard"))}).catch(e=>{l.value=!1,window.alert(e.response.data),n.value=u})}catch(e){console.error("Error making POST request:",e)}};x(()=>{g()});const g=async()=>{(await E)("/auth/test-token/").then(()=>{window.location.replace("/dashboard")})};return(u,e)=>{const v=y("RouterLink");return T(),k("div",R,[U,a("div",q,[a("div",A,[a("div",D,[a("div",M,[a("div",z,[a("div",H,[a("div",O,[a("div",null,[a("div",F,[r(a("input",{"onUpdate:modelValue":e[0]||(e[0]=s=>d.value=s),type:"email",class:"form-control",id:"exampleInputEmail1","aria-describedby":"emailHelp",placeholder:"Email"},null,512),[[p,d.value]])]),a("div",G,[r(a("input",{"onUpdate:modelValue":e[1]||(e[1]=s=>i.value=s),type:"password",class:"form-control",id:"exampleInputPassword1",placeholder:"Password"},null,512),[[p,i.value]])]),a("div",J,[r(a("input",{"onUpdate:modelValue":e[2]||(e[2]=s=>c.value=s),type:"password",class:"form-control",id:"exampleInputPassword1",placeholder:"Confirm Password"},null,512),[[p,c.value]])]),a("button",{onClick:w,class:"btn btn-success w-100 py-8 mb-4 rounded-2",disabled:l.value},C(n.value),9,K),f(v,{to:"/terms",type:"button",class:"text-center d-block w-100 waves-effect"},{default:m(()=>[_(" Terms & privacy ")]),_:1}),a("div",Q,[W,f(v,{to:{name:"login"},class:"text-primary fw-medium ms-2"},{default:m(()=>[_("Login")]),_:1})])]),X])])])])])])])])}}});const aa=B(Y,[["__scopeId","data-v-2cfaf11a"]]);export{aa as default};