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