(window.webpackJsonp=window.webpackJsonp||[]).push([[28],{2217:function(e,a,s){"use strict";s.r(a);var t=s(7),r=s(290),o=s(14),n=s(15),l=(s(58),s(205),s(31),s(573),s(133)),c=s.n(l),i=s(4),d=s.n(i),u=s(1213),m=s(96),p=s(0),h=s(1234),w=s(12);function f(e,a,s){return a in e?Object.defineProperty(e,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[a]=s,e}class b extends d.a.PureComponent{constructor(e){super(e),f(this,"handlePasswordReset",async e=>{e.preventDefault();const a=this.passwordInput.current.value;if(!a||a.length<p.T.MIN_PASSWORD_LENGTH)return void this.setState({error:d.a.createElement(u.a,{id:"password_form.error",defaultMessage:"Please enter at least {chars} characters.",values:{chars:p.T.MIN_PASSWORD_LENGTH}})});this.setState({error:null});const s=new URLSearchParams(this.props.location.search).get("token"),{data:t,error:r}=await this.props.actions.resetUserPassword(s,a);t?(m.a.push("/login?extra="+p.T.PASSWORD_CHANGE),this.setState({error:null})):r&&this.setState({error:r.message})}),this.state={error:null},this.passwordInput=d.a.createRef()}render(){let e=null;this.state.error&&(e=d.a.createElement("div",{className:"form-group has-error"},d.a.createElement("label",{className:"control-label"},this.state.error)));let a="form-group";return e&&(a+=" has-error"),d.a.createElement("div",{className:"col-sm-12"},d.a.createElement("div",{className:"signup-team__container"},d.a.createElement("h3",null,d.a.createElement(u.a,{id:"password_form.title",defaultMessage:"Password Reset"})),d.a.createElement("form",{onSubmit:this.handlePasswordReset},d.a.createElement("p",null,d.a.createElement(u.a,{id:"password_form.enter",defaultMessage:"Enter a new password for your {siteName} account.",values:{siteName:this.props.siteName}})),d.a.createElement("div",{className:a},d.a.createElement(h.a,{id:"resetPasswordInput",type:"password",className:"form-control",name:"password",ref:this.passwordInput,placeholder:{id:Object(w.b)("password_form.pwd"),defaultMessage:"Password"},spellCheck:"false",autoFocus:!0})),e,d.a.createElement("button",{id:"resetPasswordButton",type:"submit",className:"btn btn-primary"},d.a.createElement(u.a,{id:"password_form.change",defaultMessage:"Change my password"})))))}}f(b,"propTypes",{location:c.a.object.isRequired,siteName:c.a.string,actions:c.a.shape({resetUserPassword:c.a.func.isRequired}).isRequired});a.default=Object(r.connect)(e=>{const{SiteName:a}=Object(o.getConfig)(e);return{siteName:a}},e=>({actions:Object(t.bindActionCreators)({resetUserPassword:n.resetUserPassword},e)}))(b)}}]);
//# sourceMappingURL=28.76fe25717c2886b1ea89.js.map