import{r as o,h as r,H as a}from"./p-9576a29b.js";import{c as m}from"./p-d8e783d1.js";import"./p-0bc4f624.js";import{s}from"./p-17b7253a.js";import"./p-b423423b.js";import{r as t}from"./p-a6974d5a.js";import{a as e}from"./p-539e53cb.js";import{d as i}from"./p-c7f96882.js";const p=class{constructor(r){o(this,r),this.formId="register"}async formEventHandler({detail:o}){o.formId==this.formId&&((await m.client.mutate({mutation:s(i),variables:{data:{email:o.email.value,password:o.password.value,passwordConfirm:o.passwordConfirm.value}}})).data.userRegister?this.onSuccess?this.onSuccess():t.router.push("/login"):this.onFail&&this.onFail())}componentWillLoad(){e.identity&&t.router.push("/")}render(){return r(a,null,r("corejam-box",{p:8,max:"md",mx:"auto",px:4,lgPx:0,flex:!0,justify:"between",mb:24},r("corejam-box",{w:5,mx:"auto"},r("corejam-form-container",{name:this.formId},r("corejam-box",null,r("corejam-form-input",{required:!0,name:"email",type:"email",formId:this.formId,label:"Email"}),r("corejam-box",null,r("corejam-form-input",{name:"password",type:"password",formId:this.formId,label:"Password"})),r("corejam-box",null,r("corejam-form-input",{name:"passwordConfirm",type:"password",formId:this.formId,label:"Confirm Password"})),r("corejam-box",null,r("corejam-form-input",{type:"checkbox",formId:this.formId,label:"I agree to the terms & conditions"})),r("corejam-box",null,r("corejam-form-submit",{formId:this.formId},r("button",{type:"submit"},"Register"))))))))}};export{p as auth_form_register}