"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["components/pages/ChangeOwnerPage"],{933:(e,n,t)=>{t.r(n),t.d(n,{default:()=>d});var s=t(247),r=t.n(s),c=t(244),i=t(90),o=t(243);const a=i.Locale.getTranslate("components.forms.change-subscriptions-owner"),l=({clients:e,domains:n,onCancel:t,...s})=>(0,o.jsxs)(c.Form,{"data-type":"change-subscriptions-owner-form",submitButton:{children:(0,o.jsx)(a,{content:"submit"})},applyButton:!1,cancelButton:{onClick:t},...s,children:[(0,o.jsx)(c.Section,{title:(0,o.jsx)(a,{content:"infoTitle"}),children:(0,o.jsx)("p",{children:(0,o.jsx)(a,{content:"infoDescription",params:{total:n.length,active:n.length,diskSpace:"0 B",traffic:"0 B"}})})}),(0,o.jsx)(c.Section,{title:(0,o.jsx)(a,{content:"possibleOwnersTitle"}),children:(0,o.jsx)(c.FormFieldSelect,{name:"owner",label:null,children:e.map((({id:e,name:n})=>(0,o.jsx)(c.SelectOption,{value:e,children:n},e)))})}),(0,o.jsx)(c.Section,{title:(0,o.jsx)(a,{content:"selectedSubscriptions"}),children:(0,o.jsx)(c.List,{columns:[{key:"name",title:(0,o.jsx)(a,{content:"subscriptionName"})},{key:"owner",title:(0,o.jsx)(a,{content:"ownerName"}),render:({owner:e})=>e.name},{key:"currentIpAddress",title:(0,o.jsx)(a,{content:"currentIpAddress"}),render:({ipAddresses:e})=>e[0]?.ipAddress},{key:"newIpAddress",title:(0,o.jsx)(a,{content:"newIpAddress"})}],data:n})})]});l.propTypes={clients:r().array.isRequired,domains:r().array.isRequired,onCancel:r().func.isRequired};const d=l},932:(e,n,t)=>{t.r(n),t.d(n,{default:()=>l});var s=t(243),r=t(733),c=t(244),i=t(90),o=t(933);const a=i.Locale.getTranslate("components.pages.change-owner"),l=()=>{const e=(0,r.useNavigate)(),{viewer:n,domains:t}=(0,r.useLoaderData)(),i=(0,s.useMemo)((()=>{const e=n.client.clients.reduce(((e,{clients:n,...t})=>[...e,t,...n]),[]);return i.sort(((e,n)=>e.name<=n.name?-1:1)),e}),[n.client.clients]),l=(0,s.useCallback)((()=>{e(-1)}),[e]);return(0,s.jsx)(c.Drawer,{"data-type":"change-owner-drawer",isOpen:!0,onClose:l,title:(0,s.jsx)(a,{content:"title"}),form:(0,s.jsx)(o.default,{clients:i,domains:t,onCancel:l})})}}}]);
//# sourceMappingURL=ChangeOwnerPage.js.map?f6e8ed0d3000e9b38758