"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[4557],{54557:(e,s,t)=>{t.r(s),t.d(s,{default:()=>E});var a=t(70314),r=t(36891),o=t(31435),n=t(19601),l=t(86332),m=t.n(l),c=(t(14078),t(61418),t(68581),t(52077),t(83526),t(60042)),i=t.n(c),u=t(84390),d=t.n(u),p=t(72060),f=t(9448),w=t(23712);const g=e=>{let{location:s,siteName:t,actions:a}=e;const r=(0,p.useIntl)(),o=(0,f.useHistory)(),[n,l]=(0,u.useState)(null),m=(0,u.useRef)(null),c=n?d().createElement("div",{className:"form-group has-error"},d().createElement("label",{className:"control-label"},n)):null;return d().createElement("div",{className:"col-sm-12"},d().createElement("div",{className:"signup-team__container"},d().createElement(p.FormattedMessage,{id:"password_form.title",tagName:"h1",defaultMessage:"Password Reset"}),d().createElement("form",{onSubmit:async e=>{e.preventDefault();const t=m.current.value,r=new URLSearchParams(s.search).get("token");if("string"!=typeof r)throw new Error("token must be a string");const{data:n,error:c}=await a.resetUserPassword(r,t);n?(o.push("/login?extra="+w.default.PASSWORD_CHANGE),l(null)):c&&l(c.message)}},d().createElement("p",null,d().createElement(p.FormattedMessage,{id:"password_form.enter",defaultMessage:"Enter a new password for your {siteName} account.",values:{siteName:t}})),d().createElement("div",{className:i()("form-group",{"has-error":n})},d().createElement("input",{id:"resetPasswordInput",type:"password",className:"form-control",name:"password",ref:m,placeholder:r.formatMessage({id:"password_form.pwd",defaultMessage:"Password"}),spellCheck:"false",autoFocus:!0})),c,d().createElement("button",{id:"resetPasswordButton",type:"submit",className:"btn btn-primary"},d().createElement(p.FormattedMessage,{id:"password_form.change",defaultMessage:"Change my password"})))))};g.propTypes={location:m().shape({search:m().string.isRequired}).isRequired,actions:m().shape({resetUserPassword:m().func.isRequired}).isRequired,siteName:m().string};const h=(0,u.memo)(g),E=(0,a.connect)((function(e){return{siteName:(0,n.iE)(e).SiteName}}),(e=>({actions:(0,r.bindActionCreators)({resetUserPassword:o.h8},e)})))(h)}}]);
//# sourceMappingURL=4557.c65ef8f44b47d5b2414c.js.map