(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/admin/domain/list"],{763:(e,t,n)=>{"use strict";n.r(t),n.d(t,{useAddDomainFormInDrawer:()=>P});var a=n(153),o=n.n(a),i=n(154),l=n(261),r=n.n(l),s=n(302),m=n(405),d=n(556),c=n(144),p=n(155),u=n(764),g=n(720),b=n(765),f=n(576),E=n(767),h=n(768),w=n(770);const S=s.gql`
    query GetWebspaceIpAddress($id: ID!) {
        domain: node(id: $id) {
            ... on Domain {
                ipAddresses {
                    ipAddress(publicIp: true)
                }
            }
        }
    }
`,v=c.Locale.getSection("smb.components.forms.web.add-domain"),y=c.Locale.getTranslate("smb.components.forms.web.add-domain"),T=c.Locale.getTranslate("smb.components.forms.domain-info-section"),k=c.Locale.getTranslate("components.forms.ip-addresses-selector"),D=c.Locale.getTranslate("smb.components.forms.web._shared"),C=c.Locale.getTranslate("smb.components.forms.web.seo-settings"),N=c.Locale.getTranslate("admin.components.forms.admin-panel.form.contact-info"),F=c.Locale.getTranslate("components.buttons"),I=({id:e,showDomainRegistrationPromo:t,ipAddresses:n,allowCustomerCreation:a,allowWebspaceCreation:l,subscriptionsLookUpParams:r,canManageMailSettings:s,maxSysnameSize:h,isWindows:I,techDomain:P,settingsEnabled:x,settingsCollapsed:A,applicationWizardConfig:H,embeddedForms:$,applicationWizardEmbeddedForms:q,cancelLink:R,className:L,render:U,onProcess:B,...O})=>{var V;const _=(0,m.useApolloClient)(),z=(0,d.useHistory)(),[j,M]=(0,i.useState)(O.values),[W,J]=(0,i.useState)(Boolean(O.values.hostingSettings.root)),[Y,G]=(0,i.useState)(!O.values.domainInfo),[Z,K]=(0,i.useState)(O.webspaceIpAddress);(0,i.useEffect)((()=>{if(W)return;let e=/^[a-zA-Z0-9\.\-\*]+$/.match(j.domainName.name)?j.domainName.name.replace(/\*/g,"_"):"";-1!==j.hostingSettings.rootPattern.indexOf("<domain>")&&(e=j.hostingSettings.rootPattern.replace("<domain>",e)),M((0,p.setIn)(j,"hostingSettings[root]",e))}),[j.domainName.name]),(0,i.useEffect)((()=>{j.domainName.webspace&&"new"!==j.domainName.webspace.id&&_.query({query:S,variables:{id:btoa(`Domain:${j.domainName.webspace.id}`)}}).then((({data:{domain:{ipAddresses:e}}})=>{K(e[0].ipAddress)}))}),[j.domainName.webspace]);const Q=(e,t)=>{switch(M((n=>{if(n=(0,p.setIn)(n,e,t),"domainName[name]"===e&&!Y){let e=/^[a-zA-Z0-9_.\-]+$/.match(t)?n.domainName.type===u.TYPE_TECH?t.split(".")[0]:t:"";e=e.toLowerCase().substr(0,h),I&&"."===e.substr(-1)&&(e=e.substr(0,e.length-1)),n=(0,p.setIn)(n,"domainInfo[userName]",e||O.values.domainInfo.userName)}return n})),["domainInfo[ipSelector][ipv4]","domainInfo[ipSelector][ipv6]","domainInfo[userName]","domainInfo[password]"].includes(e)&&c.UAT.dispatchAction("CUSTOM-VALUE",{name:e}),e){case"hostingSettings[root]":J(!0);break;case"domainInfo[userName]":G(!0)}},X="1"===j.domainName.assignToCustomer||void 0!==j.domainName.targetWebspace||void 0!==j.domainName.webspace&&(null===j.domainName.webspace||"new"===j.domainName.webspace.id),ee=X||!Z?Object.keys(n).map((e=>{const t=j.domainInfo.ipSelector[e];return"none"===t?null:n[e][t].split(" ")[0]})).filter(Boolean)[0]:Z,te=H.enabled?w.default:g.default;return(0,i.createElement)(te,{vertical:!0,id:e,className:L,render:U,values:j,onFieldChange:Q,onSubmit:e=>(e.domainName.customer&&(e=(0,p.setIn)(e,"domainName[customer]",e.domainName.customer.id)),e.domainName.webspace&&(e=(0,p.setIn)(e,"domainName[webspace]",e.domainName.webspace.id)),e),onLongTask:B,embeddedForms:$,wizardConfig:H,wizardEmbeddedForms:q,submitButton:{id:"btn-send",children:(0,i.createElement)(y,{content:"buttonAddDomain"})},applyButton:!1,cancelButton:!!R&&{id:"btn-cancel",children:(0,i.createElement)(F,{content:"cancel"}),onClick:()=>{z.push(R)}}},t?(0,i.createElement)(f.default,null,(()=>new Jsw.Panel({cls:"tools-box",items:[{componentType:"Jsw.Hint",hint:v.lmsg("formRegistrationHint",{link:`<a href="${(0,c.prepareUrl)("/mpc/register-domains")}" target="_blank">${v.lmsg("portalLink")}</a>`})}]}))):null,(0,i.createElement)(u.default,o()({isEnabled:void 0!==j.domainName.type,isDefault:j.domainName.type===u.TYPE_TECH,typeName:"domainName[type]",name:"domainName[name]",ipAddress:ee,onTypeChange:e=>Q("domainName[type]",e),onDomainNameChange:e=>Q("domainName[name]",e)},P)),void 0===j.domainName.assignToCustomer?null:(0,i.createElement)(p.Section,null,(0,i.createElement)(p.FormFieldCheckbox,{name:"domainName[assignToCustomer]",label:(0,i.createElement)(y,{content:"assignToCustomer"}),checkedValue:"1",uncheckedValue:"0"}),"1"===j.domainName.assignToCustomer?(0,i.createElement)(p.Section,{collapsible:!0},void 0===j.domainName.customer?null:(0,i.createElement)(b.default,{name:"domainName[customer]",label:(0,i.createElement)(y,{content:"customer"}),dataUrl:"/admin/customer/look-up",newItemValue:a?{id:"new",title:v.lmsg("createNewCustomer")}:null,locale:{label:v.lmsg("selectExistingCustomer")},required:!0}),void 0===j.domainName.customer||"new"===(null===(V=j.domainName.customer)||void 0===V?void 0:V.id)?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(p.FormFieldText,{name:"customerInfo[customerContactInfo][contactName]",label:(0,i.createElement)(N,{content:"contactName"}),required:!0}),(0,i.createElement)(p.FormFieldText,{name:"customerInfo[customerContactInfo][email]",label:(0,i.createElement)(N,{content:"email"}),required:!0}),(0,i.createElement)("br",null),(0,i.createElement)(p.Heading,{level:"4"},(0,i.createElement)(y,{content:"customerLoginInfoHint"})),(0,i.createElement)(E.default,{prefix:"customerInfo[customerLoginInfo]"})):null):null),void 0===j.domainName.webspace||"1"===j.domainName.assignToCustomer?null:(0,i.createElement)(p.Section,null,(0,i.createElement)(b.default,{name:"domainName[webspace]",label:(0,i.createElement)(y,{content:"target"}),dataUrl:"/smb/web/subscription-look-up",newItemValue:l?{id:"new",title:v.lmsg("createNewTarget")}:null,locale:{label:v.lmsg("selectExistingTarget")},lookUpParams:r,required:!0})),X?x?(0,i.createElement)(p.Section,{id:"domainInfo",title:(0,i.createElement)(y,{content:"webspaceLegend"}),collapsible:!0,collapsed:A},Object.keys(n).map((e=>(0,i.createElement)(p.FormFieldSelect,{key:e,name:`domainInfo[ipSelector][${e}]`,label:(0,i.createElement)(k,{content:Object.keys(n).length>1?`${e}Address`:"ipAddress"}),required:!0},Object.keys(n[e]).map((t=>(0,i.createElement)(p.SelectOption,{key:t,value:t},n[e][t])))))),(0,i.createElement)("br",null),(0,i.createElement)(p.Heading,{level:"4"},(0,i.createElement)(y,{content:"credentials"})),(0,i.createElement)(p.Text,{component:"p",intent:"muted"},(0,i.createElement)(y,{content:"credentialsHint"})),(0,i.createElement)(p.FormFieldText,{name:"domainInfo[userName]",label:(0,i.createElement)(T,{content:"userName"}),required:!0}),(0,i.createElement)(p.FormFieldPassword,{name:"domainInfo[password]",label:(0,i.createElement)(T,{content:"password"}),required:!0})):null:(0,i.createElement)(p.Section,null,(0,i.createElement)(p.FormFieldSelect,{name:"hostingType[hosting]",label:(0,i.createElement)(y,{content:"hostingManagementOptions"})},(0,i.createElement)(p.SelectOption,{value:"hosting",label:"hosting"},(0,i.createElement)(y,{content:"websiteHosting"})),(0,i.createElement)(p.SelectOption,{value:"forwarding",label:"forwarding"},(0,i.createElement)(y,{content:"websiteForwarding"})),(0,i.createElement)(p.SelectOption,{value:"none",label:"none"},(0,i.createElement)(y,{content:"websiteNoHosting"}))),void 0===j.dnsSettings?null:(0,i.createElement)(p.FormFieldCheckbox,{name:"dnsSettings[dns]",label:(0,i.createElement)(y,{content:"dns"}),description:(0,i.createElement)(y,{content:"dnsHint"}),disabled:j.domainName.type===u.TYPE_TECH,checkedValue:"master",uncheckedValue:"none"}),void 0===j.mailSettings?null:(0,i.createElement)(p.FormFieldCheckbox,{name:"mailSettings[mail]",label:(0,i.createElement)(y,{content:"mail"}),description:s?(0,i.createElement)(y,{content:"mailHint"}):(0,i.createElement)(y,{content:"mailHintNoPermission"}),disabled:j.domainName.type===u.TYPE_TECH,checkedValue:"1",uncheckedValue:"0"}),"hosting"===j.hostingType.hosting?(0,i.createElement)(p.Section,{id:"hostingSettings",title:(0,i.createElement)(y,{content:"hostingSettingsSectionLegend"}),collapsible:!0,collapsed:!0},(0,i.createElement)(p.FormField,{name:"hostingSettings[root]",label:(0,i.createElement)(D,{content:"documentRoot"}),description:(0,i.createElement)(D,{content:"documentRootHint"}),required:!0},(({getId:e,getName:t,getValue:n,setValue:a})=>(0,i.createElement)(i.Fragment,null,(0,i.createElement)(p.Icon,{name:"home"})," / ",(0,i.createElement)(p.Input,{id:e(),name:t(),value:n(),onChange:({target:e})=>a(e.value)})))),(0,i.createElement)(p.FormFieldRadioButtons,{name:"hostingSettings[seoRedirectDirection]",label:(0,i.createElement)(C,{content:"seoRedirectDirection"}),description:(0,i.createElement)(C,{content:"seoRedirectDirectionHint"}),required:!0,options:[{value:"www",label:`www.${j.domainName.name||"<your_domain>"}`},{value:"non-www",label:j.domainName.name||"<your_domain>"},{value:"none",label:(0,i.createElement)(C,{content:"seoRedirectDirectionNone"})}]})):null,"forwarding"===j.hostingType.hosting?(0,i.createElement)(p.Section,{id:"forwardingSettings",title:(0,i.createElement)(D,{content:"forwardingSettingsSectionLegend"}),collapsible:!0,collapsed:!0},(0,i.createElement)(p.FormFieldText,{name:"forwardingSettings[forwardTo]",label:(0,i.createElement)(D,{content:"forwardDestination"}),description:(0,i.createElement)(D,{content:"forwardDestinationHint"}),required:!0}),(0,i.createElement)(p.FormFieldRadioButtons,{name:"forwardingSettings[forwardingType]",label:(0,i.createElement)(D,{content:"forwardingTypeOptions"}),options:[{value:"std_fwd301",label:(0,i.createElement)(D,{content:"forwardingHttpCode301"}),description:(0,i.createElement)(D,{content:"forwardingHttpCode301Hint"})},{value:"std_fwd302",label:(0,i.createElement)(D,{content:"forwardingHttpCode302"}),description:(0,i.createElement)(D,{content:"forwardingHttpCode302Hint"})},{value:"frm_fwd",label:(0,i.createElement)(D,{content:"forwardingFrame"}),description:(0,i.createElement)(D,{content:"forwardingFrameHint"})}]})):null))};I.propTypes={id:r().string.isRequired,showDomainRegistrationPromo:r().bool,values:r().object.isRequired,ipAddresses:r().shape({ipv4:r().object,ipv6:r().object}).isRequired,allowCustomerCreation:r().bool,allowWebspaceCreation:r().bool,subscriptionsLookUpParams:r().object,webspaceIpAddress:r().string,canManageMailSettings:r().bool,maxSysnameSize:r().number.isRequired,isWindows:r().bool.isRequired,techDomain:r().object.isRequired,settingsEnabled:r().bool,settingsCollapsed:r().bool,applicationWizardConfig:r().object,cancelLink:r().string,embeddedForms:r().array,applicationWizardEmbeddedForms:r().array,className:r().string,render:r().func,onProcess:r().func},I.defaultProps={showDomainRegistrationPromo:!1,allowCustomerCreation:!1,allowWebspaceCreation:!1,subscriptionsLookUpParams:null,webspaceIpAddress:null,canManageMailSettings:!1,settingsEnabled:!1,settingsCollapsed:!1,applicationWizardConfig:{},cancelLink:null,embeddedForms:void 0,applicationWizardEmbeddedForms:void 0,className:void 0,render:void 0,onProcess:void 0};const P=(e,t)=>(0,h.default)(I,"add-domain",e,t);t.default=I},770:(e,t,n)=>{"use strict";n.r(t);var a=n(153),o=n.n(a),i=n(154),l=n(261),r=n.n(l),s=n(144),m=n(771),d=n(772);const c=s.Locale.getTranslate("components.domain-applications.applications"),p=({onFieldChange:e,formPrefix:t,wizardConfig:a,embeddedForms:l,wizardEmbeddedForms:r,values:s,children:p,...u})=>{const[g,b]=(0,i.useState)([]),f=t=>{e("applicationName",t),b([...r.filter((({ext:e,name:n})=>t===`ext-${e}-${n}`)).filter((({content:e})=>Boolean(e))).map((({ext:e,name:t,...n})=>({key:`ext-${e}-${t}`,children:"",embeddedForms:[{name:t,...n}]})))])},E=[a.blankSite&&{name:"blank-site",icon:n(773),title:(0,i.createElement)(c,{content:"blank-site.title"}),description:(0,i.createElement)(c,{content:"blank-site.description"})},a.uploadFiles&&{name:"upload-files",icon:n(774),title:(0,i.createElement)(c,{content:"upload-files.title"}),description:(0,i.createElement)(c,{content:"upload-files.description"})},...r.map((({ext:e,name:t,title:n,icon:a,description:o})=>({name:`ext-${e}-${t}`,icon:a,title:n,description:o})))].filter(Boolean),h=[E.length>1&&{key:"chooseApplicationStep",children:(0,i.createElement)(m.default,{onApplicationSelect:f,applicationsList:E}),nextButton:!1},{key:"addDomainStep",formPrefix:t,children:p,embeddedForms:l}].filter(Boolean);return(0,i.useEffect)((()=>{if(0===E.length&&f("blank-site"),1===E.length){const[{name:e}]=E;f(e)}}),[]),(0,i.createElement)(d.default,o()({},u,{values:s,onFieldChange:e,onStepChange:(t,n)=>0===n&&h.length>1?(e("applicationName",null),b([]),t):n,step:s.applicationName&&1!==h.length?1:0,steps:[...h,...g]}))};p.propTypes={values:r().object.isRequired,onFieldChange:r().func.isRequired,children:r().node,formPrefix:r().string,wizardConfig:r().shape({enabled:r().bool,blankSite:r().bool,uploadFiles:r().bool}),embeddedForms:r().array,wizardEmbeddedForms:r().array},p.defaultProps={children:null,formPrefix:"",wizardConfig:{enabled:!0,blankSite:!0,uploadFiles:!0},embeddedForms:[],wizardEmbeddedForms:[]},t.default=p},771:(e,t,n)=>{"use strict";n.r(t);var a=n(154),o=n(155),i=n(261),l=n.n(i);const r=n(144).Locale.getTranslate("components.domain-applications"),s=({onApplicationSelect:e,applicationsList:t})=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(o.Heading,{level:"3"},(0,a.createElement)(r,{content:"title"})),(0,a.createElement)(o.ItemList,{minColumnWidth:220,gap:"xs",selectable:!0},t.map((({name:t,icon:n,title:i,description:l})=>(0,a.createElement)(o.Item,{"data-action":t,key:t,icon:(0,a.createElement)(o.Icon,{src:n,intent:"info",size:"64"}),title:(0,a.createElement)(o.Heading,{level:"4"},i),onClick:()=>e(t)},(0,a.createElement)(o.Paragraph,null,l))))));s.propTypes={onApplicationSelect:l().func,applicationsList:l().arrayOf(l().shape({name:l().string.isRequired,icon:l().string.isRequired,title:l().node,description:l().node}))},s.defaultProps={onApplicationSelect:null,applicationsList:[]},t.default=s},775:(e,t,n)=>{"use strict";n.r(t);var a=n(154),o=n(261),i=n(556),l=n(144),r=n(576),s=n(582);const m=l.Locale.getSection("admin.components.lists.domains"),d=l.Locale.getSection("components.icp-permit"),c=({action:e}={})=>{const t=window.location.pathname.split("/");return e&&(t[3]=e),t.join("/")},p=({data:e,searchFilters:t,dataAction:o,deleteAction:p,allowCreateDomain:u,allowManageSubdomain:g,allowManageDomainAliases:b,showDeleteButton:f,isHomonymSearchEnabled:E,showOwnerName:h,showExpirationDate:w,userId:S,icpPermitSupported:v,icpPermitLink:y})=>{const T=(0,i.useHistory)(),k=(0,s.createNavigateHandler)(T);return(0,a.createElement)(r.default,null,(()=>new l.Panel({cls:"list-box",items:[new l.List({id:"domains-list",data:e,dataUrl:c({action:o}),searchFilters:t,searchOveral:"domainName",disabledSelectHint:m.lmsg("disabledSelectHint"),operations:[u?{componentType:l.SmallButton,id:"buttonAddDomain",cls:"s-btn sb-new-domain",title:m.lmsg("buttonAddDomain"),description:m.lmsg("hintAddDomain"),href:c({action:"add-domain"}),handler:k}:null,g?{componentType:l.SmallButton,id:"buttonAddSubDomain",cls:"s-btn sb-new-subdomain",title:m.lmsg("buttonAddSubdomain"),description:m.lmsg("hintAddSubdomain"),href:c({action:"add-subdomain"})}:null,b?{componentType:l.SmallButton,id:"buttonAddDomainAlias",cls:"s-btn sb-new-domain-alias",title:m.lmsg("buttonAddDomainAlias"),description:m.lmsg("hintAddDomainAlias"),href:c({action:"add-domain-alias"})}:null,u||g||b?{componentType:l.bar.Separator}:null,{componentType:l.list.AdditionalActions,title:m.lmsg("buttonChangeStatus"),operations:[{componentType:l.SmallButton,id:"buttonSuspendDomains",title:m.lmsg("buttonSuspendDomains"),description:m.lmsg("hintSuspendDomains"),addCls:"sb-suspend",cls:"sb-btn",handler(){(0,l.getComponent)("domains-list").execGroupOperation({url:`/domain/suspend/?redirect=${c()}`,skipConfirmation:!0})}},{componentType:l.SmallButton,id:"buttonDisableDomains",title:m.lmsg("buttonDisableDomains"),description:m.lmsg("hintDisableDomains"),addCls:"sb-turn-off",cls:"sb-btn",handler(){(0,l.getComponent)("domains-list").execGroupOperation({url:`/domain/disable/?redirect=${c()}`,skipConfirmation:!0})}},{componentType:l.SmallButton,id:"buttonActivateDomains",title:m.lmsg("buttonActivateDomains"),description:m.lmsg("hintActivateDomains"),addCls:"sb-activate",cls:"sb-btn",handler(){(0,l.getComponent)("domains-list").execGroupOperation({url:`/domain/activate/?redirect=${c()}`,skipConfirmation:!0})}}]},f?{componentType:l.bar.Separator}:null,f?{componentType:l.SmallButton,id:"buttonRemoveSite",title:l.Locale.getSection("components.buttons").lmsg("remove"),description:m.lmsg("hintRemove"),cls:"s-btn sb-remove-selected",handler(e){var t;const n=(0,l.getComponent)("domains-list").getSelectedItems(),a=n.reduce(((e,{relatedDomains:t})=>e.concat(t)),[]).filter((e=>n.every((({domainDisplayName:t})=>t!==e))));(0,l.getComponent)("domains-list").execGroupOperation({url:c({action:p}),subtype:l.messageBox.SUBTYPE_DELETE,mouseEvent:e,text:m.formatMessage("removeConfirmation",{name:`<b>${(0,l.escapeHtml)(null===(t=n[0])||void 0===t?void 0:t.domainDisplayName)}</b>`,count:n.length}),description:a.length?m.lmsg("removeConfirmationSubscription",{domains:a.join(", ")}).replace(/\n/gm,"<br>"):"",isAjax:E,requestUrl:c({action:"search-homonym-data"}),loadingTitle:l.Locale.getSection("components.homonyms").lmsg("loading")})}}:null].filter(Boolean),columns:[l.list.COLUMN_SELECTION,{header:m.lmsg("domainName"),sortable:!0,dataIndex:"domainDisplayName",renderer(e){let t="";if(parseInt(e.domainStatus)){let a=m.lmsg("statusDisabled"),o=n(776),i="disabled";"suspend"===e.turnOffAction&&(a=m.lmsg("statusSuspended"),o=n(777),i="suspended"),t+=`<div class="b-indent"><span class="b-indent-icon"><span><span class="tooltipData">${a}</span><img src="${o}" alt="${i}" title=""></span>`}t+=e.overviewUrl?`<a href="${(0,l.prepareUrl)(e.overviewUrl)}">${(0,l.escapeHtml)(e.domainDisplayName)}</a>`:(0,l.escapeHtml)(e.domainDisplayName),parseInt(e.domainStatus)&&(t+="</span></div>");let a="";if(e.adminDescription&&(a+=`<div class="hint">${(0,l.escapeHtml)(e.adminDescription.truncate(50,"..."))}<span class="tooltipData">${(0,l.escapeHtml)(e.adminDescription)}</span></div>`),e.resellerDescription){a+=`<div class="hint">${e.hideResellerTitleDescription?"":`${m.lmsg("resellerDescription")}: `}${(0,l.escapeHtml)(e.resellerDescription.truncate(50,"..."))}<span class="tooltipData">${(0,l.escapeHtml)(e.resellerDescription)}</span></div>`}return e.ownerDescription&&(a+=`<div class="hint">${m.lmsg("ownerDescription")}: ${(0,l.escapeHtml)(e.ownerDescription.truncate(50,"..."))}<span class="tooltipData">${(0,l.escapeHtml)(e.ownerDescription)}</span></div>`),t+=a,t}},v?{header:d.lmsg("icpPermit"),sortable:!0,dataIndex:"icpStatus",renderer({icpStatus:e,icpPermit:t}){const a=1==e?d.lmsg("icpStatusAllowedDescription"):d.lmsg("icpStatusNotAllowedDescription"),o=n(1==e?778:779);let i=t?(0,l.escapeHtml)(t):1==e?"":d.lmsg("icpStatusNotAllowed");return y&&(i=`<a href="${y}" target="_blank">${i}</a>`),`<span class="tooltipData">${a}</span><img src="${o}" alt="" /> ${i}`}}:null,{header:m.lmsg("hostingType"),sortable:!0,dataIndex:"hostingType",renderer(e){let t="";return"alias"===e.hostingType?t=`<img src="${n(780)}"/> ${m.lmsg("aliasFor")} <a href="http://${(0,l.escapeHtml)(e.realDomainName)}" target="_blank">${(0,l.escapeHtml)(e.realDomainDisplayName)}</a>`:"vrt_hst"===e.hostingType?t=`<img src="${n(781)}"/> ${m.lmsg(e.parentDomainId>0?"subdomainWebsite":"website")}`:"none"===e.hostingType?t=`<img src="${n(782)}"/><em class="hint">${m.lmsg("noHosting")}</em>`:"frm_fwd"!==e.hostingType&&"std_fwd"!==e.hostingType||(t=`<img src="${n(783)}"/> ${m.lmsg("forwardingTo")} <a href="${(0,l.escapeHtml)(e.forwardingUrl)}" target="_blank">${(0,l.escapeHtml)(e.forwardingDisplayUrl)}</a>`),t}},h?{header:m.lmsg("ownerName"),sortable:!0,dataIndex:"ownerName",renderer({ownerId:e,ownerType:t,ownerName:n,ownerCompanyName:a}){let o=null;return parseInt(e)!==S&&("client"===t?o=`/admin/customer/overview/id/${e}`:"reseller"===t&&(o=`/admin/reseller/overview/id/${e}`)),[o?(0,l.createElement)("a",{href:o,onclick:k},(0,l.escapeHtml)(n)):(0,l.escapeHtml)(n),a?`, ${(0,l.escapeHtml)(a)}`:null]}}:null,w?{header:m.lmsg("expirationDate"),sortable:!1,dataIndex:"expirationDate",renderer:({expirationDateString:e})=>e?(0,l.escapeHtml)(e):"&mdash;"}:null,{header:m.lmsg("diskUsage"),sortable:!0,dataIndex:"realSize",renderer:({diskUsage:e})=>(0,l.escapeHtml)(e)},{header:m.lmsg("traffic"),sortable:!0,dataIndex:"traffic"},{header:"",sortable:!1,renderer:({hostingType:e,siteUrl:t})=>"none"===e?"":(0,l.createElement)("a.s-btn.sb-publish",{href:t,target:"_blank"},(0,l.createElement)("span",m.lmsg("openSite")))},{header:"",sortable:!1,renderer({previewSupported:e,domainId:t}){if(!e)return"";const n=`/admin/domain/preview?domainId=${t}`;return(0,l.createElement)("a.s-btn.sb-view-site",{href:n,target:"_blank"},(0,l.createElement)("span",m.lmsg("previewSite")))}},{header:"",sortable:!1,renderer({manageUrl:e,ownerId:t,ownerType:n}){if(!e||parseInt(t)===S)return"";const a=`/admin${"reseller"===n?"/reseller":"/customer"}/login/id/${t}?pageUrl=${encodeURIComponent(e)}`;return(0,l.createElement)("a.s-btn.sb-login",{href:a},(0,l.createElement)("span",m.lmsg("reseller"===n?"manageInResellerPanel":"manageInCustomerPanel")))}}].filter(Boolean)})]})))};p.propTypes={data:o.PropTypes.object.isRequired,searchFilters:o.PropTypes.object.isRequired,dataAction:o.PropTypes.string.isRequired,deleteAction:o.PropTypes.string.isRequired,allowCreateDomain:o.PropTypes.bool,allowManageSubdomain:o.PropTypes.bool,allowManageDomainAliases:o.PropTypes.bool,showDeleteButton:o.PropTypes.bool,isHomonymSearchEnabled:o.PropTypes.bool,showOwnerName:o.PropTypes.bool,showExpirationDate:o.PropTypes.bool,userId:o.PropTypes.number,icpPermitSupported:o.PropTypes.bool,icpPermitLink:o.PropTypes.string},p.defaultProps={allowCreateDomain:!1,allowManageSubdomain:!1,allowManageDomainAliases:!1,showDeleteButton:!1,isHomonymSearchEnabled:!1,showOwnerName:!1,showExpirationDate:!1,userId:void 0,icpPermitSupported:!1,icpPermitLink:void 0},t.default=p},769:(e,t,n)=>{"use strict";n.r(t);var a=n(153),o=n.n(a),i=n(154),l=n(155),r=n(144),s=n(261),m=n.n(s),d=n(615),c=n(635);const p="running",u=()=>(0,r.getComponent)("asyncProgressBarWrapper"),g=({children:e,dataType:t,isOpen:n,onClose:a,task:s,...m})=>{const[g,b]=(0,i.useState)([]),[f,E]=(0,i.useState)(null),[h,w]=(0,i.useState)(null),[S,v]=(0,i.useState)(null),y=s?s.id:null,{addToast:T}=(0,c.useToaster)(),k=({id:e,steps:t,status:a,errors:o,output:l,progressValue:s,progressTitle:m,progressTitleHtml:d})=>{if(!n||y!==e)return;const c=d||m,u=r.Task.STATUS_STARTED===a?p:a,g=e=>(e||[]).map((e=>(0,i.createElement)("div",{key:e},e)));v(u),t&&t.length?(E(c),b(t.map((({errors:e,...t})=>({children:g(e),...t}))))):b([{title:c,status:u,progress:Number(s),children:(0,i.createElement)(i.Fragment,null,g(o),g(l))}])};(0,i.useEffect)((()=>{const e=u();n?(null==e||e.hide(),b([]),E(null),w(null),v(null)):(async()=>{D()||await C(),null==e||e.show()})()}),[n]),(0,i.useEffect)((()=>{var e;y&&(null===(e=u())||void 0===e||e.update(),k(s))}),[y,s]),(0,d.default)("plesk:taskStepUpdate",k,r.Observer),(0,d.default)("plesk:taskComplete",(({id:e,redirect:t,status:a})=>{n&&y===e&&r.Task.STATUS_DONE===a&&w(t)}),r.Observer);const D=()=>r.Task.STATUS_NOT_STARTED===S||p===S,C=()=>{var e,t;return y&&(null===(e=u())||void 0===e||null===(t=e.getItems().find((e=>e.getId()===y)))||void 0===t?void 0:t.remove())};return(0,i.createElement)(l.Drawer,o()({"data-type":t,isOpen:n,onClose:()=>{h?(0,r.redirect)(h):a()},progress:g.length?{cancelable:!1,title:f,steps:g,onFinish:()=>{C(),T({intent:"success",message:f||g[0].title})}}:null,hideButton:D()},m),e)};g.propTypes={children:m().node,dataType:m().string.isRequired,isOpen:m().bool,onClose:m().func.isRequired,task:m().shape({id:m().string.isRequired,steps:m().array,status:m().string,progressTitle:m().string,progressTitleHtml:m().string})},g.defaultProps={children:null,isOpen:!1,task:null},t.default=g},765:(e,t,n)=>{"use strict";n.r(t);var a=n(154),o=n(261),i=n.n(o),l=n(155),r=n(766);const s=n(144).Locale.getSection("components.elements.lookup"),m=({data:e,dataUrl:t,lookUpParams:n,newItemValue:o,locale:i,placeholder:m,...d})=>(0,a.createElement)(l.FormField,d,(({getId:l,getName:d,getValue:c,setValue:p,isDisabled:u})=>(0,a.createElement)(r.default,{id:l(),name:d(),value:c(),onChange:e=>p(e),data:e,dataUrl:t,lookUpParams:n,newItemValue:o,locale:{...s.messages,...i},disabled:u(),placeholder:m})));m.propTypes={locale:i().object,data:i().array,dataUrl:i().string,lookUpParams:i().object,newItemValue:i().object,placeholder:i().string},m.defaultProps={locale:void 0,data:void 0,dataUrl:void 0,lookUpParams:void 0,newItemValue:void 0,placeholder:void 0},t.default=m},766:(e,t,n)=>{"use strict";n.r(t);var a=n(154),o=n(144),i=n(576);t.default=e=>{const[t,n]=(0,a.useState)(null);return(0,a.useEffect)((()=>{const t=new o.LookUp(e);return n(t),()=>{t.remove(),n(null)}}),[]),t?(0,a.createElement)(i.default,null,t):null}},772:(e,t,n)=>{"use strict";n.r(t);var a=n(153),o=n.n(a),i=n(155),l=n(154),r=n(720),s=n(144),m=n(261),d=n.n(m);const c=s.Locale.getTranslate("components.buttons"),p=({step:e,steps:t,onStepChange:n,onSubmit:a,submitButton:s,cancelButton:m,...d})=>{const p=(0,l.useRef)(),[u,g]=(0,l.useState)(0),b=u+e,{children:f,formPrefix:E,embeddedForms:h,backButton:w,nextButton:S}={backButton:{},nextButton:{},...t[b]},v=b===t.length-1,y=0===b,T=()=>{p.current.handleEmbeddedFormValues(),g((t=>n(t+e,t+e+1)-e))};return(0,l.createElement)(r.default,o()({},d,{ref:p,additionalButtons:[y&&m&&(0,l.createElement)(i.Button,o()({key:"cancel",children:(0,l.createElement)(c,{content:"cancel"})},m)),!y&&w&&(0,l.createElement)(i.Button,o()({key:"back",arrow:"backward",onClick:()=>{p.current.handleEmbeddedFormValues(),g((t=>n(t+e,t+e-1)-e))},children:(0,l.createElement)(c,{content:"back"})},w)),!v&&S&&(0,l.createElement)(i.Button,o()({key:"next",intent:"primary",onClick:T,arrow:"forward",children:(0,l.createElement)(c,{content:"nextWithoutArrow"})},S)),v&&s&&(0,l.createElement)(i.Button,o()({key:"submit",intent:"primary",arrow:"forward",onClick:()=>p.current.submit(),children:(0,l.createElement)(c,{content:"ok"})},s))],onSubmit:v?a:T,onError:a=>{const o=t.findIndex((({formPrefix:e})=>""===e)),i=Object.keys(a).map((e=>{const n=t.findIndex((({formPrefix:t,embeddedForms:n=[]})=>t===e||n.any((({name:t})=>t===e))));return n>=0?n:o}));g(n(b,i.length>0?Math.min(...i):e)-e)},applyButton:!1,submitButton:!1,cancelButton:!1,formPrefix:E,embeddedForms:h}),f)};p.propTypes={step:d().number,steps:d().arrayOf(d().shape({formPrefix:d().string,embeddedForms:d().array,children:d().node,nextButton:d().bool,backButton:d().bool})),onStepChange:d().func,onSubmit:d().func,submitButton:d().object,cancelButton:d().object},p.defaultProps={step:0,steps:[],onStepChange:(e,t)=>t,onSubmit:void 0,submitButton:{},cancelButton:{}},t.default=p},767:(e,t,n)=>{"use strict";n.r(t);var a=n(154),o=n(155),i=n(144),l=n(261),r=n.n(l);const s=i.Locale.getTranslate("admin.components.forms.admin-panel.form.login-info"),m=({prefix:e})=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(o.FormFieldText,{name:"".concat(e,"[userName]"),label:(0,a.createElement)(s,{content:"userName"}),required:!0,autoComplete:"off"}),(0,a.createElement)(o.FormFieldPassword,{name:"".concat(e,"[password]"),label:(0,a.createElement)(s,{content:"password"}),required:!0,autoComplete:"off"}),(0,a.createElement)(o.FormFieldCheckbox,{name:"".concat(e,"[isActivationRequired]"),label:(0,a.createElement)(s,{content:"emailActivation"}),description:(0,a.createElement)(s,{content:"emailActivationHint"}),checkedValue:"1",uncheckedValue:"0"}));m.propTypes={prefix:r().string.isRequired},t.default=m},764:(e,t,n)=>{"use strict";n.r(t),n.d(t,{TYPE_TECH:()=>d,TYPE_CUSTOM:()=>c});var a=n(153),o=n.n(a),i=n(155),l=n(154),r=n(261),s=n.n(r),m=n(144);const d="tech",c="custom",p=m.Locale.getTranslate("components.forms.domain.tech-domain-name"),u=({isEnabled:e,isDefault:t,url:n,vendor:a,typeName:o,name:r,ipAddress:s,onDomainNameChange:m,onTypeChange:u})=>{const[f,E]=(0,l.useState)(e&&t?d:c);if(!e)return(0,l.createElement)(g,{name:r,isEnabled:!1,onDomainNameChange:m});const h=[{key:c,icon:(0,l.createElement)(i.Icon,{name:"ribbon",intent:"success"})},{key:d,icon:(0,l.createElement)(i.Icon,{name:"rocket",intent:"info"})}];return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(i.Section,{title:(0,l.createElement)(p,{content:"title"}),vertical:!0},(0,l.createElement)(i.FormField,{name:o,onChange:e=>(e=>{E(e),u(e),m("")})(e)},(({getId:e,getName:t,getValue:n,setValue:a,isDisabled:o})=>(0,l.createElement)(l.Fragment,null,(0,l.createElement)(i.ItemList,{stretchable:!0,selectable:!0,minColumnWidth:270,gap:"sm",value:n(),onSelect:e=>a(e)},h.map((({key:e,icon:t})=>(0,l.createElement)(i.Item,{icon:t,key:e,value:e,"data-action":`use-${e}-domain`,title:(0,l.createElement)(i.Heading,{level:"4"},(0,l.createElement)(i.Paragraph,null,(0,l.createElement)(p,{content:`${e}DomainTitle`}))),disabled:o()},(0,l.createElement)(i.Text,{fontSize:"md"},(0,l.createElement)(p,{content:`${e}DomainText`})))))),(0,l.createElement)("input",{hidden:!0,id:e(),name:t(),value:n(),readOnly:!0}))))),f===d?(0,l.createElement)(b,{name:r,ipAddress:s,url:n,vendor:a,onDomainNameChange:m}):(0,l.createElement)(g,{name:r,isEnabled:!0,onDomainNameChange:m}))},g=({name:e,isEnabled:t,onDomainNameChange:n})=>(0,l.createElement)(i.Section,{vertical:!0},(0,l.createElement)(i.FormField,{name:e,label:t?(0,l.createElement)(p,{content:"customDomain"}):(0,l.createElement)(p,{content:"domainName"}),onChange:e=>n(e),required:!0},(({getId:e,getName:t,getValue:n,setValue:a,isDisabled:o})=>(0,l.createElement)(l.Fragment,null,(0,l.createElement)("span",{dir:"ltr"},"www. ",(0,l.createElement)(i.Input,{id:e(),name:t(),value:n(),placeholder:"domain.name",size:"lg",onChange:e=>a(e.target.value),disabled:o()}))))));g.propTypes={name:s().string.isRequired,isEnabled:s().bool.isRequired,onDomainNameChange:s().func.isRequired};const b=({name:e,onDomainNameChange:t,...n})=>(0,l.createElement)(i.Section,{vertical:!0},(0,l.createElement)(l.Fragment,null,(0,l.createElement)(i.FormField,{label:(0,l.createElement)(p,{content:"techDomain"}),name:e,onChange:e=>t(e)},(({getId:e,getName:t,...a})=>(0,l.createElement)(f,o()({id:e(),name:t()},a,n)))),(0,l.createElement)(i.Cuttable,{maxHeight:24},(0,l.createElement)(i.Paragraph,null,(0,l.createElement)(p,{content:"techDomainDesc"})),(0,l.createElement)("ul",null,(0,l.createElement)("li",null,(0,l.createElement)(p,{content:"techDomainRandom"})),(0,l.createElement)("li",null,(0,l.createElement)(p,{content:"techDomainDns"})),(0,l.createElement)("li",null,(0,l.createElement)(p,{content:"techDomainMail"}))),(0,l.createElement)(i.Paragraph,null,(0,l.createElement)(p,{content:"techDomainSwitch"})))));b.propTypes={name:s().string.isRequired,onDomainNameChange:s().func.isRequired};const f=({id:e,name:t,ipAddress:n,url:a,vendor:o,getValue:r,setValue:s})=>{const[m,d]=(0,l.useState)(!1),[c,u]=(0,l.useState)(n),[g,b]=(0,l.useState)({}),f=(0,l.useCallback)((async()=>{if(b({}),!r()||n!==c)if(n){d(!0);try{const e=await fetch(a,{method:"POST",body:JSON.stringify({ip_address:n,vendor:o})}),{subdomain:t}=await e.json();if(!t)return void b({error:(0,l.createElement)(p,{content:"error"})});s(t),u(n)}catch{b({error:(0,l.createElement)(p,{content:"error"})})}finally{d(!1)}}else b({noIpAddress:(0,l.createElement)(p,{content:"errorNoIpAddress"})})}),[r,s,n,c,a,o]);return(0,l.useEffect)((()=>{f()}),[n]),(0,l.createElement)(l.Fragment,null,m?(0,l.createElement)(i.Status,{progress:!0},(0,l.createElement)(p,{content:"generating"})):(0,l.createElement)(i.Text,{bold:!0},r()),(0,l.createElement)("input",{hidden:!0,id:e,name:t,value:r(),readOnly:!0}),Object.keys(g).map((e=>(0,l.createElement)(i.Alert,{key:e,intent:"danger"},(0,l.createElement)(i.Icon,{name:"exclamation-mark-circle-filled",intent:"danger"})," ",g[e]))))};f.propTypes={id:s().string.isRequired,name:s().string.isRequired,ipAddress:s().string,url:s().string.isRequired,vendor:s().string.isRequired,getValue:s().func.isRequired,setValue:s().func.isRequired},f.defaultProps={ipAddress:null},u.propTypes={isEnabled:s().bool.isRequired,isDefault:s().bool.isRequired,url:s().string.isRequired,vendor:s().string.isRequired,typeName:s().string.isRequired,name:s().string.isRequired,ipAddress:s().string,onDomainNameChange:s().func.isRequired,onTypeChange:s().func.isRequired},u.defaultProps={ipAddress:null},t.default=u},768:(e,t,n)=>{"use strict";n.r(t);var a=n(153),o=n.n(a),i=n(154),l=n(302),r=n(405),s=n(556),m=n(155),d=n(144),c=n(769);const p=l.gql`
    query GetAddDomainData {
        config {
            domainManagement {
                settings {
                    enabled
                    collapsed
                }
                applicationWizard {
                    enabled
                    blankSite
                    uploadFiles
                }
            }
            techDomain {
                url
                vendor
            }
        }
    }
`;t.default=(e,t,n,a)=>{const l=(0,r.useApolloClient)(),u=!!(0,s.useRouteMatch)(a),g=(0,s.useHistory)(),[b,f]=(0,i.useState)(null),[E,h]=(0,i.useState)(null);(0,i.useEffect)((()=>{u&&(f(null),h(null),Promise.all([d.api.get(a),l.query({query:p})]).then((([e,{data:{config:t}}])=>{e.redirect?(0,d.redirect)(e.redirect):f({...e,techDomain:{url:`${t.techDomain.url}/api/subdomain`,vendor:t.techDomain.vendor},settingsEnabled:t.domainManagement.settings.enabled,settingsCollapsed:t.domainManagement.settings.collapsed,applicationWizardConfig:t.domainManagement.applicationWizard})})))}),[u,a,l]);const w=()=>{g.push(n)};return[(0,i.createElement)(c.default,{dataType:t,title:b?b.pageTitle:"",size:"sm",isOpen:u,onClose:w,form:b?(0,i.createElement)(e,o()({onCancel:w,onProcess:h},b)):null,task:E},b?null:(0,i.createElement)(m.ContentLoader,null))]}},762:(e,t,n)=>{"use strict";n.r(t);var a=n(153),o=n.n(a),i=n(154),l=n(261),r=n.n(l),s=n(144),m=n(602),d=n(647),c=n(763),p=n(775),u=n(576);const g=s.Locale.getSection("admin.controllers.domain.list"),b=e=>{const[t]=(0,c.useAddDomainFormInDrawer)("/admin/domain/list","/admin/domain/add-domain");return(0,i.createElement)(i.Fragment,null,t,(0,i.createElement)(u.default,null,(()=>new s.Hint({hint:g.lmsg("hint")}))),(0,i.createElement)(p.default,o()({dataAction:"list-data",deleteAction:"delete",showOwnerName:!0,showExpirationDate:!0},e)))};b.propTypes={tabs:r().array.isRequired},t.default=(0,m.withPageLayout)((0,d.withPageContent)(b))},761:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>a.default});var a=n(762)},779:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/att-tr.png?f00bf7056f997d02b1565fff15ed7ab7"},780:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/dns.png?d10cfc4afe5c5c040eaf99c3ea14429d"},783:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/forward-to-dom.png?761778de5722f4bb1f3611d27968cb0f"},776:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/off.png?84d64d1bd3267c21795505b7daa43800"},782:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/spacer.png?4710d0e07ee1a4d7ebdb1972701168fa"},778:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/subscription-status-ok.png?6d52f91c87cbdc73b4ef0b5ded92c441"},777:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/subscription-status-suspended.png?7968ea094f0aa3fdced5d59b0c7f3196"},781:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/website.png?ac6aa9eaf06048cbd5799a61daad9766"},773:e=>{e.exports=Jsw.skinUrl+"/images/code.svg?e9fb9feb605b8cf334414f688a603918"},774:e=>{e.exports=Jsw.skinUrl+"/images/upload-files.svg?e6091d3474a27a3eafe63b2d09b1b943"}}]);
//# sourceMappingURL=list.js.map?bd668a816ecfbdfd42ec