"use strict";(self.webpackChunk_mattermost_webapp=self.webpackChunk_mattermost_webapp||[]).push([[557],{96512:(e,t,r)=>{r.d(t,{Z:()=>u});var s=r(45697),a=r.n(s),i=r(67294),n=r(86896),o=r(44012),c=r(73727);const l=e=>{const{formatMessage:t}=(0,n.Z)();return i.createElement("div",{id:"back_button",className:"signup-header"},i.createElement(c.Link,{onClick:e.onClick,to:e.url},i.createElement("span",{id:"back_button_icon",className:"fa fa-1x fa-angle-left",title:t({id:"generic_icons.back",defaultMessage:"Back Icon"})}),i.createElement(o.Z,{id:"web.header.back",defaultMessage:"Back"})))};l.propTypes={url:a().string,onClick:a().func},l.defaultProps={url:"/"};const u=l},90557:(e,t,r)=>{r.r(t),r.d(t,{default:()=>R});var s=r(97779),a=r(14494),i=r(33383),n=r(22742),o=r(89754),c=r(12707),l=r(10386),u=r(45697),d=r.n(u),m=(r(88674),r(33948),r(41637),r(74916),r(64765),r(67294)),p=r(44012),h=r(59925),E=r(89262),g=r(65714),f=r(16406),_=r(96512),b=r(19476),v=r(34288);function S(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class I extends m.PureComponent{constructor(e){super(e),S(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(g.cS.FAILED_EMAIL_VERIFICATION)})),this.state={verifyStatus:"pending",serverError:null}}componentDidMount(){this.verifyEmail()}handleRedirect(){if(this.props.isLoggedIn)this.props.useCaseOnboarding?E.m.push("/"):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:g.MN.EMAIL_VERIFIED,type:g.Mw.SUCCESS},!0),(0,h.L9)("settings","verify_email");const e=await this.props.actions.getMe();"data"in e?this.handleRedirect():"error"in e&&this.handleError(g.cS.FAILED_USER_STATE_GET)}else this.handleRedirect()}handleError(e){let t=null;e===g.cS.FAILED_EMAIL_VERIFICATION?t=m.createElement(p.Z,{id:"signup_user_completed.invalid_invite",defaultMessage:"The invite link was invalid. Please speak with your Administrator to receive an invitation."}):e===g.cS.FAILED_USER_STATE_GET&&(t=m.createElement(p.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 m.createElement(b.Z,null);let e=null;return this.state.serverError&&(e=m.createElement("div",{className:"form-group has-error"},m.createElement("label",{className:"control-label"},this.state.serverError))),m.createElement("div",null,m.createElement(_.Z,null),m.createElement("div",{className:"col-sm-12"},m.createElement("div",{className:"signup-team__container"},m.createElement("img",{alt:"signup team logo",className:"signup-team-logo",src:f.Z}),m.createElement("div",{className:"signup__content"},m.createElement("h1",null,this.props.siteName),m.createElement("h4",{className:"color--light"},m.createElement(p.Z,{id:"web.root.signup_info",defaultMessage:"All team communication in one place, searchable and accessible anywhere"})),e))))}}S(I,"propTypes",{location:d().shape({search:d().string.isRequired}).isRequired,siteName:d().string,actions:d().shape({verifyUserEmail:d().func.isRequired,getMe:d().func.isRequired,logError:d().func.isRequired,clearErrors:d().func.isRequired}).isRequired,isLoggedIn:d().bool.isRequired,useCaseOnboarding:d().bool.isRequired});const R=(0,a.connect)((function(e){const t=(0,n.iE)(e).SiteName,r=(0,o.NC)(e);return{isLoggedIn:Boolean((0,c.rc)(e)),siteName:t,useCaseOnboarding:r}}),(function(e){return{actions:(0,s.bindActionCreators)({verifyUserEmail:i.NH,getMe:i.jo,logError:l.H,clearErrors:l.b9},e)}}))(I)},16406:(e,t,r)=>{r.d(t,{Z:()=>s});const s=r.p+"files/ab8aa80cba445eb0fb75e6611c292567.png"}}]);
//# sourceMappingURL=557.9f389eb965f300372942.js.map