(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[557],{96512:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o}),r(39714);var s=r(45697),a=r.n(s),i=r(67294),n=r(44012),l=r(73727);function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class o extends i.PureComponent{render(){return i.createElement("div",{id:"back_button",className:"signup-header"},i.createElement(l.Link,{onClick:this.props.onClick,to:this.props.url},i.createElement(n.Z,{id:"generic_icons.back",defaultMessage:"Back Icon"},(e=>i.createElement("span",{id:"back_button_icon",className:"fa fa-1x fa-angle-left",title:e.toString()}))),i.createElement(n.Z,{id:"web.header.back",defaultMessage:"Back"})))}}c(o,"propTypes",{url:a().string,onClick:a().func}),c(o,"defaultProps",{url:"/"})},90557:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var s=r(14890),a=r(37703),i=r(12543),n=r(78781),l=r(92701),c=r(94919),o=(r(88674),r(64765),r(33948),r(60285),r(45697)),u=r.n(o),d=r(67294),m=r(44012),p=r(59925),E=r(89262),h=r(78274),g=r(16406),f=r(96512),_=r(19476),v=r(34288);function b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class S extends d.PureComponent{constructor(e){super(e),b(this,"verifyEmail",(async()=>{const{actions:{verifyUserEmail:e}}=this.props,t=await e(new URLSearchParams(this.props.location.search).get("token")||"");"data"in t?this.handleSuccess():"error"in t&&this.handleError(h.cS.FAILED_EMAIL_VERIFICATION)})),this.state={verifyStatus:"pending",serverError:null}}componentDidMount(){this.verifyEmail()}handleRedirect(){if(this.props.isLoggedIn)v.mc();else{let e="/login?extra=verified";const t=new URLSearchParams(this.props.location.search).get("email");t&&(e+="&email="+encodeURIComponent(t));const r=new URLSearchParams(this.props.location.search).get("redirect_to");r&&(e+="&redirect_to="+r),E.m.push(e)}}async handleSuccess(){if(this.setState({verifyStatus:"success"}),this.props.actions.clearErrors(),this.props.isLoggedIn){this.props.actions.logError({message:h.MN.EMAIL_VERIFIED,type:h.Mw.SUCCESS},!0),(0,p.L9)("settings","verify_email");const e=await this.props.actions.getMe();"data"in e?this.handleRedirect():"error"in e&&this.handleError(h.cS.FAILED_USER_STATE_GET)}else this.handleRedirect()}handleError(e){let t=null;e===h.cS.FAILED_EMAIL_VERIFICATION?t=d.createElement(m.Z,{id:"signup_user_completed.invalid_invite",defaultMessage:"The invite link was invalid. Please speak with your Administrator to receive an invitation."}):e===h.cS.FAILED_USER_STATE_GET&&(t=d.createElement(m.Z,{id:"signup_user_completed.failed_update_user_state",defaultMessage:"Please clear your cache and try to log in."})),this.setState({verifyStatus:"failure",serverError:t})}render(){if("failure"!==this.state.verifyStatus)return d.createElement(_.Z,null);let e=null;return this.state.serverError&&(e=d.createElement("div",{className:"form-group has-error"},d.createElement("label",{className:"control-label"},this.state.serverError))),d.createElement("div",null,d.createElement(f.Z,null),d.createElement("div",{className:"col-sm-12"},d.createElement("div",{className:"signup-team__container"},d.createElement("img",{alt:"signup team logo",className:"signup-team-logo",src:g.Z}),d.createElement("div",{className:"signup__content"},d.createElement("h1",null,this.props.siteName),d.createElement("h4",{className:"color--light"},d.createElement(m.Z,{id:"web.root.signup_info",defaultMessage:"All team communication in one place, searchable and accessible anywhere"})),e))))}}b(S,"propTypes",{location:u().shape({search:u().string.isRequired}).isRequired,siteName:u().string,actions:u().shape({verifyUserEmail:u().func.isRequired,getMe:u().func.isRequired,logError:u().func.isRequired,clearErrors:u().func.isRequired}).isRequired,isLoggedIn:u().bool.isRequired});const y=(0,a.connect)((function(e){const t=(0,n.getConfig)(e).SiteName;return{isLoggedIn:Boolean((0,l.getCurrentUserId)(e)),siteName:t}}),(function(e){return{actions:(0,s.bindActionCreators)({verifyUserEmail:i.verifyUserEmail,getMe:i.getMe,logError:c.logError,clearErrors:c.clearErrors},e)}}))(S)},16406:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});const s=r.p+"files/ab8aa80cba445eb0fb75e6611c292567.png"}}]);
//# sourceMappingURL=557.bf99125f5a42e28b213a.js.map