(window.webpackJsonpPlesk=window.webpackJsonpPlesk||[]).push([["views/smb/web/rename"],{1133:function(e,t,a){"use strict";a.r(t);var n=a(155),l=a(156),s=a(1134);t.default=e=>{Object(n.render)(Object(n.createElement)(l.LocaleProvider,{messages:e.locale},Object(n.createElement)(s.default,e)),document.createElement("div"))}},1134:function(e,t,a){"use strict";a.r(t);var n=a(155),l=a(276),s=a.n(l),r=a(156),c=a(145);const i=({id:e,domainName:t,isDomainAlias:a,parentDomain:l})=>{const[s,i]=Object(n.useState)(!0),[m,o]=Object(n.useState)(null),[u,b]=Object(n.useState)(null),[d,j]=Object(n.useState)(null),O=l&&!a;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(r.Dialog,{isOpen:s,closable:"submit"!==m,title:Object(n.createElement)(r.Translate,{content:a?"titleAlias":"title"}),size:"xs",onClose:()=>i(!1),form:{vertical:!0,state:m,errors:u,onSubmit:async({name:t})=>{if(o(null),b(null),j(null),!t)return void b({name:{isEmpty:Object(n.createElement)(r.Translate,{content:"domainNameIsRequired"})}});o("submit");const{statusMessages:l,formMessages:s,redirect:i}=await c.api.post("/smb/web/".concat(a?"rename-domain-alias":"rename-domain"),{id:e,name:t.trim()});i?Object(c.redirect)(i):(o(null),j(l),s&&Object.keys(s).forEach(e=>b({[e]:s[e]})))},submitButton:{children:Object(n.createElement)(r.Translate,{content:"submit"===m?"submitButtonProgress":"submitButton"})}}},d&&d.map(({content:e,title:t,status:a})=>Object(n.createElement)(r.StatusMessage,{intent:"error"===a?"danger":"success",key:t},Object(n.createElement)(r.Text,{bold:!0},"".concat(t,": ")),Object(n.createElement)("span",{dangerouslySetInnerHTML:{__html:e}}))),Object(n.createElement)(r.Paragraph,null,Object(n.createElement)(r.Translate,{content:a?"hintAlias":"hint",params:{domainName:Object(n.createElement)(r.Text,{bold:!0},t)}})),Object(n.createElement)(r.FormField,{name:"name",label:Object(n.createElement)(r.Translate,{content:a?"nameAlias":"name"})},({getValue:e,setValue:t})=>Object(n.createElement)("div",null,Object(n.createElement)(r.Input,{disabled:"submit"===m,value:e(),onChange:e=>t(e.target.value),size:O?"lg":"fill"}),O?Object(n.createElement)(r.Text,{bold:!0}," . ".concat(l.displayName)):null))))};i.propTypes={id:s.a.number.isRequired,domainName:s.a.string.isRequired,isDomainAlias:s.a.bool.isRequired,parentDomain:s.a.object},i.defaultProps={parentDomain:null},t.default=i}}]);
//# sourceMappingURL=rename.js.map?e2384d7ee1ec44e53f6f