"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[4231],{26452:(e,t,s)=>{s.d(t,{Z:()=>u});var a=s(23615),r=s.n(a),n=s(60042),l=s.n(n),i=s(84390),o=s.n(i),c=s(72060),d=s(9448);const m=e=>{let{url:t,className:s,onClick:a}=e;const{formatMessage:r}=(0,c.useIntl)();return o().createElement("div",{className:l()("signup-header",s)},o().createElement(d.Link,{"data-testid":"back_button",onClick:a,to:t},o().createElement("span",{id:"back_button_icon",className:"fa fa-1x fa-angle-left",title:r({id:"generic_icons.back",defaultMessage:"Back Icon"})}),o().createElement(c.FormattedMessage,{id:"web.header.back",defaultMessage:"Back"})))};m.propTypes={url:r().string,className:r().string,onClick:r().func},m.defaultProps={url:"/"};const u=m},48480:(e,t,s)=>{s.r(t),s.d(t,{default:()=>g});var a=s(70314),r=s(36891),n=s(31435),l=s(23615),i=s.n(l),o=(s(14078),s(61418),s(20266),s(92189),s(84390)),c=s.n(o),d=s(72060),m=s(65370),u=s(26452);function p(e,t,s){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var a=s.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}class f extends c().PureComponent{constructor(){super(...arguments),p(this,"state",{error:null,updateText:null}),p(this,"resetForm",c().createRef()),p(this,"emailInput",c().createRef()),p(this,"handleSendLink",(async e=>{e.preventDefault();const t=this.emailInput.current.value.trim().toLowerCase();if(!t||!(0,m.Jh)(t))return void this.setState({error:c().createElement(d.FormattedMessage,{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:c().createElement("div",{id:"passwordResetEmailSent",className:"reset-form alert alert-success"},c().createElement(d.FormattedMessage,{id:"password_send.link",defaultMessage:"If the account exists, a password reset email will be sent to:"}),c().createElement("div",null,c().createElement("b",null,t)),c().createElement("br",null),c().createElement(d.FormattedMessage,{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=c().createElement("div",{className:"form-group has-error"},c().createElement("label",{className:"control-label"},this.state.error)));let t="form-group";return e&&(t+=" has-error"),c().createElement("div",null,c().createElement(u.Z,null),c().createElement("div",{className:"col-sm-12"},c().createElement("div",{className:"signup-team__container"},c().createElement(d.FormattedMessage,{id:"password_send.title",tagName:"h1",defaultMessage:"Password Reset"}),this.state.updateText,c().createElement("form",{onSubmit:this.handleSendLink,ref:this.resetForm},c().createElement("p",null,c().createElement(d.FormattedMessage,{id:"password_send.description",defaultMessage:"To reset your password, enter the email address you used to sign up"})),c().createElement("div",{className:t},c().createElement("input",{id:"passwordResetEmailInput",type:"email",className:"form-control",name:"email",placeholder:this.props.intl.formatMessage({id:"password_send.email",defaultMessage:"Email"}),ref:this.emailInput,spellCheck:"false",autoFocus:!0})),e,c().createElement("button",{id:"passwordResetButton",type:"submit",className:"btn btn-primary"},c().createElement(d.FormattedMessage,{id:"password_send.reset",defaultMessage:"Reset my password"}))))))}}p(f,"propTypes",{actions:i().shape({sendPasswordResetEmail:i().func.isRequired}).isRequired});const h=(0,d.injectIntl)(f),g=(0,a.connect)(null,(e=>({actions:(0,r.bindActionCreators)({sendPasswordResetEmail:n.LS},e)})))(h)}}]);
//# sourceMappingURL=4231.27b0c37fcf4ddc51a033.js.map