"use strict";(self.webpackChunk_mattermost_webapp=self.webpackChunk_mattermost_webapp||[]).push([[679],{96512:(e,t,s)=>{s.d(t,{Z:()=>u});var a=s(45697),r=s.n(a),n=s(67294),l=s(86896),i=s(44012),o=s(73727),c=s(94184),d=s.n(c);const m=e=>{let{url:t,className:s,onClick:a}=e;const{formatMessage:r}=(0,l.Z)();return n.createElement("div",{id:"back_button",className:d()("signup-header",s)},n.createElement(o.Link,{onClick:a,to:t},n.createElement("span",{id:"back_button_icon",className:"fa fa-1x fa-angle-left",title:r({id:"generic_icons.back",defaultMessage:"Back Icon"})}),n.createElement(i.Z,{id:"web.header.back",defaultMessage:"Back"})))};m.propTypes={url:r().string,className:r().string,onClick:r().func},m.defaultProps={url:"/"};const u=m},95679:(e,t,s)=>{s.r(t),s.d(t,{default:()=>E});var a=s(97779),r=s(14494),n=s(33383),l=s(45697),i=s.n(l),o=(s(33948),s(88674),s(73210),s(67294)),c=s(44012),d=s(16794),m=s(96512),u=s(927),p=s(87993);function h(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}class f extends o.PureComponent{constructor(){super(...arguments),h(this,"state",{error:null,updateText:null}),h(this,"resetForm",o.createRef()),h(this,"emailInput",o.createRef()),h(this,"handleSendLink",(async e=>{e.preventDefault();const t=this.emailInput.current.value.trim().toLowerCase();if(!t||!(0,d.Jh)(t))return void this.setState({error:o.createElement(c.Z,{id:"password_send.error",defaultMessage:"Please enter a valid email address."})});this.setState({error:null});const{data:s,error:a}=await this.props.actions.sendPasswordResetEmail(t);s?(this.setState({error:null,updateText:o.createElement("div",{id:"passwordResetEmailSent",className:"reset-form alert alert-success"},o.createElement(c.Z,{id:"password_send.link",defaultMessage:"If the account exists, a password reset email will be sent to:"}),o.createElement("div",null,o.createElement("b",null,t)),o.createElement("br",null),o.createElement(c.Z,{id:"password_send.checkInbox",defaultMessage:"Please check your inbox."}))}),this.resetForm.current&&(this.resetForm.current.hidden=!0)):a&&this.setState({error:a.message,updateText:null})}))}render(){let e=null;this.state.error&&(e=o.createElement("div",{className:"form-group has-error"},o.createElement("label",{className:"control-label"},this.state.error)));let t="form-group";return e&&(t+=" has-error"),o.createElement("div",null,o.createElement(m.Z,null),o.createElement("div",{className:"col-sm-12"},o.createElement("div",{className:"signup-team__container"},o.createElement(c.Z,{id:"password_send.title",tagName:"h1",defaultMessage:"Password Reset"}),this.state.updateText,o.createElement("form",{onSubmit:this.handleSendLink,ref:this.resetForm},o.createElement("p",null,o.createElement(c.Z,{id:"password_send.description",defaultMessage:"To reset your password, enter the email address you used to sign up"})),o.createElement("div",{className:t},o.createElement(u.Z,{id:"passwordResetEmailInput",type:"email",className:"form-control",name:"email",placeholder:{id:(0,p.t)("password_send.email"),defaultMessage:"Email"},ref:this.emailInput,spellCheck:"false",autoFocus:!0})),e,o.createElement("button",{id:"passwordResetButton",type:"submit",className:"btn btn-primary"},o.createElement(c.Z,{id:"password_send.reset",defaultMessage:"Reset my password"}))))))}}h(f,"propTypes",{actions:i().shape({sendPasswordResetEmail:i().func.isRequired}).isRequired});const E=(0,r.connect)(null,(e=>({actions:(0,a.bindActionCreators)({sendPasswordResetEmail:n.LS},e)})))(f)}}]);
//# sourceMappingURL=679.3fda0a14f92401ff8091.js.map