text: "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[685],{379:(e,r,t)=>{t.r(r),t.d(r,{default:()=>c});var a=t(395),s=t(386),n=t(875),l=t(96),o=t(759),m=t(946);const c=(0,a.Ih)((function(){const e={userController:m.ZP,form:null,serverErrors:null,onEnter:()=>{if(o.a.isAuthenticated)return l.Z.transitionTo("/"),!1;r()}},r=()=>{e.form=new s.Z({children:[{name:"username",validate:(0,n.Uf)((0,n.C1)(),(0,m.xE)())},{name:"email",validate:(0,n.C1)()},{name:"password",validate:(0,n.Uf)((0,n.C1)(),(0,m.vx)())}],actions:{submit:()=>{e.register(e.form.getResult())}},onFormChange:()=>{e.serverErrors=null}})};return e.register=({username:r,email:t,password:a})=>(e.serverErrors=null,m.ZP.register({username:r,email:t,password:a}).then((()=>{l.Z.transitionTo("/")}),(r=>{e.serverErrors=r}))),e}))},795:(e,r,t)=>{t.r(r),t.d(r,{default:()=>i});var a=t(408),s=t(294),n=t(697),l=t.n(n),o=t(437),m=t(898);function c(){return(c=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e}).apply(this,arguments)}class i extends a.Component{constructor(){super(),this.onSubmit=e=>{e.preventDefault(),this.props.controller.form.submit()}}render(){const{form:e,serverErrors:r,isPending:t}=this.props.controller;return s.createElement("div",{className:"auth-page"},s.createElement("div",{className:"container page"},s.createElement("div",{className:"row"},s.createElement("div",{className:"col-md-6 offset-md-3 col-xs-12"},s.createElement("h1",{className:"text-xs-center"},"Sign up"),s.createElement("p",{className:"text-xs-center"},s.createElement(o.r,{to:"/login"},"Have an account?")),r&&s.createElement("ul",{className:"error-messages"},r.map(((e,r)=>s.createElement("li",{key:r},e)))),s.createElement("form",{onSubmit:this.onSubmit},s.createElement("fieldset",{className:"form-group"},s.createElement(m.Z,c({inputClassName:"form-control form-control-lg",type:"text",placeholder:"Your Name",disabled:t},e.get("username")))),s.createElement("fieldset",{className:"form-group"},s.createElement(m.Z,c({inputClassName:"form-control form-control-lg",type:"email",placeholder:"Email",disabled:t},e.get("email")))),s.createElement("fieldset",{className:"form-group"},s.createElement(m.Z,c({inputClassName:"form-control form-control-lg",type:"password",placeholder:"Password",disabled:t},e.get("password")))),s.createElement("button",{className:"btn btn-lg btn-primary pull-xs-right",disabled:t},"Sign up"))))))}}i.propTypes={controller:l().object.isRequired}}}]);
  //# sourceMappingURL=register.bundle-476218d7451dd2470e80.js.map