1(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/login/recovery-password"],{1123:(e,t,s)=>{"use strict";s.r(t);var n=s(89),i=s(205),r=s(204),a=s(206),o=s.n(a),l=s(85);class c extends r.Component{constructor(e){if(super(e),(0,n.default)(this,"state",{recoveryLink:"",recoveryEmail:"",isActionInProgress:!1,isDialogOpen:!1,sendButtonState:"active"}),(0,n.default)(this,"recoveryLinkContainer",(0,r.createRef)()),(0,n.default)(this,"setLinkSelection",(()=>{setTimeout((()=>{try{const e=document.createRange();e.selectNode(this.recoveryLinkContainer.current);const t=window.getSelection();t.removeAllRanges(),t.addRange(e)}catch{}}),200)})),(0,n.default)(this,"handleAction",(()=>{if(this.state.isActionInProgress)return;if(this.state.recoveryLink)return this.setState({isDialogOpen:!0}),void this.setLinkSelection();this.setState({isActionInProgress:!0});const{userType:e,userId:t}=this.props;l.api.post((0,l.prepareUrl)(`${this.endpoint}/generate-secret`),{userType:e,userId:t}).then((e=>{"success"===e.status?(this.setState({recoveryLink:e.link,recoveryEmail:e.email,isActionInProgress:!1,isDialogOpen:!0}),this.setLinkSelection()):location.reload()}))})),(0,n.default)(this,"handleSend",(()=>{if("active"!==this.state.sendButtonState)return;this.setState({sendButtonState:"loading"});const{messages:e}=this.props,{userType:t,userId:s}=this.props;l.api.post((0,l.prepareUrl)(`${this.endpoint}/send-secret`),{userType:t,userId:s,secret:this.state.recoveryLink}).then((t=>{"success"===t.status?(this.setState({isDialogOpen:!1}),(0,l.clearStatusMessages)(),(0,l.addStatusMessage)("info",e.linkSendedMessage),this.setState({sendButtonState:"active",recoveryLink:null})):location.reload()}))})),(0,n.default)(this,"handleClose",(()=>{this.setState({isDialogOpen:!1,recoveryLink:null})})),2===this.props.userType)this.endpoint="/admin/reseller";else if(4===this.props.userType)this.endpoint="/admin/customer";else if(8===this.props.userType)this.endpoint="/smb/user";else{if(32!==this.props.userType)throw new Error("Unexpected user type.");this.endpoint="/smb/email-address"}}render(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Action,{onClick:this.handleAction,progress:this.state.isActionInProgress,children:(0,r.jsx)(i.Translate,{content:"action"})}),(0,r.jsxs)(i.Dialog,{isOpen:this.state.isDialogOpen,buttons:[this.state.recoveryEmail?(0,r.jsx)(i.Button,{intent:"primary",onClick:this.handleSend,state:this.state.sendButtonState,children:(0,r.jsx)(i.Translate,{content:"sendButton"})},"sendButton"):null],title:(0,r.jsx)(i.Translate,{content:"title"}),cancelTitle:(0,r.jsx)(i.Translate,{content:"closeButton"}),onClose:this.handleClose,children:[this.state.recoveryEmail?(0,r.jsx)(i.Paragraph,{children:(0,r.jsx)(i.Translate,{content:"text",params:{email:(0,r.jsx)(i.Text,{bold:!0,children:this.state.recoveryEmail})}})}):null,(0,r.jsx)(i.Alert,{children:(0,r.jsx)("span",{ref:this.recoveryLinkContainer,children:this.state.recoveryLink})})]})]})}}c.propTypes={messages:o().object.isRequired,userType:o().number.isRequired,userId:o().number.isRequired},t.default=c},1122:(e,t,s)=>{"use strict";s.r(t);var n=s(205),i=s(204),r=s(85),a=s(1123);t.default=({renderTo:e,...t})=>{const s=r.Locale.getSection("components.login.recovery-password").messages;(0,i.render)((0,i.jsx)(n.LocaleProvider,{messages:s,children:(0,i.jsx)(a.default,{messages:s,...t})}),document.getElementById(e))}}}]); 2//# sourceMappingURL=recovery-password.js.map?2b207b9634598b7996d2
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.