"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[4654],{94654:(e,t,n)=>{n.r(t),n.d(t,{default:()=>f}),n(3188),n(30973),n(17046),n(36169),n(43813),n(59297);var a=n(36418),s=n.n(a),o=n(14778),r=n(37270),i=n(81911),c=n(1418),l=n(17085),u=n(77440),d=n(7430),m=n(91767),E=n(65844),v=n(1396),p=n(78451),y=function(e){return e.PENDING="pending",e.SUCCESS="success",e.FAILURE="failure",e}(y||{});const f=()=>{var e;const{formatMessage:t}=(0,o.useIntl)(),n=(0,r.useDispatch)(),f=(0,i.useHistory)(),{search:g}=(0,i.useLocation)(),S=null!==(e=new URLSearchParams(g).get("token"))&&void 0!==e?e:"",_=Boolean((0,r.useSelector)(d.WR)),N=(0,r.useSelector)(u.Pu),[I,w]=(0,a.useState)(y.PENDING),[h,C]=(0,a.useState)("");(0,a.useEffect)((()=>{b()}),[]);const R=()=>{if(_)return N?void f.push("/"):void(0,m.tc)();const e=new URLSearchParams(g);e.set("extra",p.YM.SIGNIN_VERIFIED),f.push("/login?".concat(e))},b=async()=>{const{error:e}=await n((0,l.TB)(S));if(e)return w(y.FAILURE),void C(t({id:"signup_user_completed.invalid_invite.message",defaultMessage:"Please speak with your Administrator to receive an invitation."}));if(w(y.SUCCESS),await n((0,c.x8)()),!_)return void R();n((0,c.vV)({message:p.Xu.EMAIL_VERIFIED,type:p.cn.SUCCESS},{errorBarMode:c.tq.Always}));const{error:a}=await n((0,l.jp)());if(a)return w(y.FAILURE),void C(t({id:"signup_user_completed.failed_update_user_state",defaultMessage:"Please clear your cache and try to log in."}));R()};return I===y.FAILURE?s().createElement("div",{className:"do-verify-body"},s().createElement("div",{className:"do-verify-body-content"},s().createElement(E.A,{title:t({id:"signup_user_completed.invalid_invite.title",defaultMessage:"This invite link is invalid"}),message:h,extraContent:s().createElement("div",{className:"do-verify-body-content-button-container"},s().createElement("button",{className:"do-verify-body-content-button-return",onClick:()=>f.replace("/")},t({id:"signup_user_completed.return",defaultMessage:"Return to log in"})))}))):s().createElement(v.A,null)}},65844:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(62688),s=n.n(a),o=n(36418),r=n.n(o),i=n(78451);const c=e=>{let{title:t,message:n,SVGElement:a,extraContent:s,onEnterKeyDown:o}=e;return r().createElement("div",{className:"content-layout-column",onKeyDown:e=>{o&&e.key===i.Ay.KeyCodes.ENTER[0]&&o(e)},tabIndex:0},r().createElement("div",{className:"content-layout-column-svg"},a),r().createElement("h1",{className:"content-layout-column-title"},t),r().createElement("p",{className:"content-layout-column-message"},n),s&&r().createElement("div",{className:"content-layout-column-extra-content"},s))};c.propTypes={title:s().node.isRequired,message:s().node.isRequired,SVGElement:s().node,extraContent:s().node,onEnterKeyDown:s().func};const l=c}}]);
//# sourceMappingURL=4654.e564d40191c452b0d64a.js.map