"use strict";(globalThis.webpackChunkPlesk=globalThis.webpackChunkPlesk||[]).push([["views/smb/dns-zone/acl-records"],{1620(e,t,s){s.r(t),s.d(t,{default:()=>c});var r=s(786),i=s.n(r),a=s(95),d=s(1621);const o={id:i().string,dataUrl:i().string,operations:i().array,itemActions:i().object,columns:i().array,data:i().shape({data:i().array,state:i().object,pager:i().object,locale:i().object,additional:i().object,pathbar:i().any}),searchFilters:i().object,searchOveral:i().string,disabledSelectHint:i().string,isDisabledItem:i().func,onRedraw:i().func,emptyViewMode:i().oneOf(["all","items"]),emptyView:i().any},n={id:void 0,dataUrl:void 0,operations:void 0,itemActions:void 0,columns:void 0,data:void 0,searchFilters:void 0,searchOveral:void 0,disabledSelectHint:void 0,isDisabledItem:void 0,onRedraw:void 0,emptyViewMode:void 0,emptyView:void 0},l=(0,d.default)(a.List,{propsList:Object.keys(o),defaultProps:n});l.displayName="JswList",l.propTypes=o;const c=l},1722(e,t,s){s.r(t),s.d(t,{default:()=>c});var r=s(786),i=s.n(r),a=s(397),d=s(95),o=s(831),n=s(396);const l=({items:e})=>e&&e.length>1?(0,n.jsx)(a.Tabs,{active:e.findIndex(({containerCls:e})=>"active"===e)+1,children:e.map(({title:e,href:t},s)=>(0,n.jsx)(a.Tab,{title:e,component:o.default,to:(0,d.prepareUrl)(t)},s))}):null;l.propTypes={items:i().arrayOf(i().shape({title:i().string.isRequired,href:i().string.isRequired,containerCls:i().string}))};const c=l},1621(e,t,s){s.r(t),s.d(t,{default:()=>a});var r=s(396),i=s(95);const a=(e,{propsList:t=[],setters:s={},defaultProps:a={}})=>d=>{const o=(0,r.useRef)(),n=(0,r.useRef)(),[l,c]=Object.entries({...a,...d}).reduce((e,[s,r])=>(e[t.includes(s)?0:1][s]=r,e),[{},{}]),p=t.map(e=>{const t=l[e];return s[e]?(n.current?.[s[e]](t),null):t});return(0,r.useLayoutEffect)(()=>(n.current=new e(l),(0,i.render)(o.current,n.current),()=>{n.current.remove(),n.current=null}),[c.key,...p]),(0,r.jsx)("div",{ref:o,...c})}},2432(e,t,s){s.r(t),s.d(t,{default:()=>u});var r=s(396),i=s(786),a=s.n(i),d=s(397),o=s(95),n=s(1620),l=s(831);const c=o.Locale.getSection("smb.components.lists.dnsaclrecords"),p=({owner:e,data:t,searchFilters:s})=>{const i=(0,l.useNavigateCallback)(),a=(0,r.useMemo)(()=>[o.list.COLUMN_SELECTION,{header:c.lmsg("value"),sortable:!0,dataIndex:"value"}],[]),p=(0,r.useMemo)(()=>[{componentType:o.SmallButton,id:"buttonAddRecord",title:c.lmsg("add"),addCls:"sb-add-new btn-primary",href:`/smb/dns-zone/add-acl-record/id/${e.id}/type/${e.type}`,handler:i},{componentType:o.SmallButton,id:"buttonRemoveRecord",title:c.lmsg("remove"),description:c.lmsg("hintRemove"),addCls:"sb-remove-selected",handler(t){(0,o.getComponent)("dns-zone-acl-records").execGroupOperation({url:`/smb/dns-zone/delete-acl-record/id/${e.id}/type/${e.type}`,subtype:o.messageBox.SUBTYPE_DELETE,mouseEvent:t,locale:{confirmOnGroupOperation:c.lmsg("confirmOnDelete")}})}}],[i,e]),u=(0,r.useMemo)(()=>(0,r.jsx)(d.ListEmptyView,{title:c.lmsg("emptyViewTitle"),description:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{children:c.lmsg("emptyViewDescription1")}),(0,r.jsx)("p",{children:c.lmsg("emptyViewDescription2")})]}),actions:(0,r.jsx)(d.Button,{id:"buttonAddRecord",intent:"primary",component:"a",href:`/smb/dns-zone/add-acl-record/id/${e.id}/type/${e.type}`,onClick:i,children:c.lmsg("add")})}),[i,e]);return(0,r.jsx)(n.default,{id:"dns-zone-acl-records",data:t,dataUrl:`/smb/dns-zone/acl-records-data/id/${e.id}/type/${e.type}`,searchOveral:"value",searchFilters:s,columns:a,operations:p,emptyViewMode:"all",emptyView:u})};p.propTypes={owner:a().shape({id:a().string.isRequired,type:a().string.isRequired}).isRequired,data:n.default.propTypes.data.isRequired,searchFilters:n.default.propTypes.searchFilters.isRequired};const u=p},2431(e,t,s){s.r(t),s.d(t,{default:()=>c});var r=s(786),i=s.n(r),a=s(1722),d=s(800),o=s(2432),n=s(396);const l=({params:{id:e,type:t},tabs:s,aclRecordsList:r})=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.default,{items:s}),(0,n.jsx)(o.default,{owner:{id:e,type:t},...r})]});l.propTypes={params:i().shape({id:i().string.isRequired,type:i().oneOf(["domain","alias"]).isRequired}).isRequired,tabs:a.default.propTypes.items.isRequired,aclRecordsList:i().object.isRequired};const c=(0,d.withPageLayout)(l)},2430(e,t,s){s.r(t),s.d(t,{default:()=>r.default});var r=s(2431)}}]);
//# sourceMappingURL=acl-records.js.map?f28f8777b7bb60497683