"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[4654],{65844:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(36418),s=n.n(a),o=n(78451);const r=e=>{let{title:t,message:n,SVGElement:a,extraContent:r,onEnterKeyDown:c}=e;return s().createElement("div",{className:"content-layout-column",onKeyDown:e=>{c&&e.key===o.Ay.KeyCodes.ENTER[0]&&c(e)},tabIndex:0},s().createElement("div",{className:"content-layout-column-svg"},a),s().createElement("h1",{className:"content-layout-column-title"},t),s().createElement("p",{className:"content-layout-column-message"},n),r&&s().createElement("div",{className:"content-layout-column-extra-content"},r))}},94654:(e,t,n)=>{n.r(t),n.d(t,{default:()=>f}),n(15724),n(5673),n(30164),n(21279);var a=n(36418),s=n.n(a),o=n(14778),r=n(37270),c=n(81911),i=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=()=>{const{formatMessage:e}=(0,o.useIntl)(),t=(0,r.useDispatch)(),n=(0,c.useHistory)(),{search:f}=(0,c.useLocation)(),g=new URLSearchParams(f).get("token")??"",S=Boolean((0,r.useSelector)(d.WR)),_=(0,r.useSelector)(u.Pu),[N,I]=(0,a.useState)(y.PENDING),[h,w]=(0,a.useState)("");(0,a.useEffect)((()=>{C()}),[]);const b=()=>{if(S)return _?void n.push("/"):void(0,m.tc)();const e=new URLSearchParams(f);e.set("extra",p.YM.SIGNIN_VERIFIED),n.push(`/login?${e}`)},C=async()=>{const{error:n}=await t((0,l.TB)(g));if(n)return I(y.FAILURE),void w(e({id:"signup_user_completed.invalid_invite.message",defaultMessage:"Please speak with your Administrator to receive an invitation."}));if(I(y.SUCCESS),await t((0,i.x8)()),!S)return void b();t((0,i.vV)({message:p.Xu.EMAIL_VERIFIED,type:p.cn.SUCCESS},{errorBarMode:i.tq.Always}));const{error:a}=await t((0,l.jp)());if(a)return I(y.FAILURE),void w(e({id:"signup_user_completed.failed_update_user_state",defaultMessage:"Please clear your cache and try to log in."}));b()};return N===y.FAILURE?s().createElement("div",{className:"do-verify-body"},s().createElement("div",{className:"do-verify-body-content"},s().createElement(E.A,{title:e({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:()=>n.replace("/")},e({id:"signup_user_completed.return",defaultMessage:"Return to log in"})))}))):s().createElement(v.A,null)}}}]);
//# sourceMappingURL=4654.09dfc1ff7c5b25376e47.js.map