1import{k as f,r as c,l as u,q as s,v as _,D as y,N as a,O as l,K as n,u as i,t as p,m as b,w as V,x,E as C,o as m}from"./vendor-D0Q8KstH.js";import{_ as k}from"./sharedText512-eMELDve_.js";import{u as R}from"./index-DQqGazYE.js";const N={class:"register-container"},S={class:"register-card"},U={class:"form-group"},q={class:"form-group"},h={class:"form-group"},A={class:"form-group"},B={key:0,class:"error-message"},D=["disabled"],E={class:"login-link"},M={__name:"RegisterView",setup(P){const g=C(),t=R(),o=c({username:"",email:"",password:"",password2:""});async function v(){try{await t.register(o.value),g.push(`/s/${t.user.username}`)}catch(d){console.error("Registration error:",d)}}return(d,e)=>{const w=x("router-link");return m(),u("div",N,[s("div",S,[e[10]||(e[10]=s("div",{class:"logo-container"},[s("img",{src:k,alt:"Shared",class:"register-logo"})],-1)),s("form",{onSubmit:_(v,["prevent"])},[s("div",U,[e[4]||(e[4]=s("label",{for:"username"},"Username",-1)),a(s("input",{id:"username","onUpdate:modelValue":e[0]||(e[0]=r=>o.value.username=r),type:"text",required:"",placeholder:"Choose a username"},null,512),[[l,o.value.username]])]),s("div",q,[e[5]||(e[5]=s("label",{for:"email"},[n("Email "),s("span",{class:"optional"},"(optional)")],-1)),a(s("input",{id:"email","onUpdate:modelValue":e[1]||(e[1]=r=>o.value.email=r),type:"email",placeholder:"[email protected] (optional)"},null,512),[[l,o.value.email]])]),s("div",h,[e[6]||(e[6]=s("label",{for:"password"},"Password",-1)),a(s("input",{id:"password","onUpdate:modelValue":e[2]||(e[2]=r=>o.value.password=r),type:"password",required:"",placeholder:"Create a password"},null,512),[[l,o.value.password]])]),s("div",A,[e[7]||(e[7]=s("label",{for:"password2"},"Confirm Password",-1)),a(s("input",{id:"password2","onUpdate:modelValue":e[3]||(e[3]=r=>o.value.password2=r),type:"password",required:"",placeholder:"Confirm your password"},null,512),[[l,o.value.password2]])]),i(t).error?(m(),u("div",B,p(i(t).error),1)):y("",!0),s("button",{type:"submit",disabled:i(t).loading,class:"btn-primary"},p(i(t).loading?"Creating Account...":"Register"),9,D)],32),s("p",E,[e[9]||(e[9]=n(" Already have an account? ",-1)),b(w,{to:"/login"},{default:V(()=>[...e[8]||(e[8]=[n("Login",-1)])]),_:1})])])])}}},L=f(M,[["__scopeId","data-v-c2de3b2c"]]);export{L 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.