"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/smb/user/list"],{1060:(e,t,s)=>{s.r(t);var a=s(210),r=s.n(a),i=s(88),l=s(870);const n={hint:r().string.isRequired,expandable:r().bool},o=(0,l.default)(i.Hint,Object.keys(n),{hint:"setHint"});o.displayName="JswHint",o.propTypes=n,o.defaultProps={expandable:!1},t.default=o},869:(e,t,s)=>{s.r(t);var a=s(210),r=s.n(a),i=s(88),l=s(870);const n={id:r().string,dataUrl:r().string,operations:r().array,itemActions:r().object,columns:r().array,data:r().shape({data:r().array,state:r().object,pager:r().object,locale:r().object,additional:r().object,pathbar:r().any}),searchFilters:r().object,searchOveral:r().string,disabledSelectHint:r().string,isDisabledItem:r().func,onRedraw:r().func,emptyViewMode:r().oneOf(["all","items"]),emptyView:r().any},o={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},d=(0,l.default)(i.List,Object.keys(n));d.displayName="JswList",d.propTypes=n,d.defaultProps=o,t.default=d},873:(e,t,s)=>{s.r(t);var a=s(210),r=s.n(a),i=s(209),l=s(88),n=s(667),o=s(208);const d=({items:e})=>e&&e.length>1?(0,o.jsx)(i.Tabs,{active:e.findIndex((({containerCls:e})=>"active"===e))+1,children:e.map((({title:e,href:t},s)=>(0,o.jsx)(i.Tab,{title:e,component:n.default,to:(0,l.prepareUrl)(t)},s)))}):null;d.propTypes={items:r().arrayOf(r().shape({title:r().string.isRequired,href:r().string.isRequired,containerCls:r().string}))},d.defaultProps={items:void 0},t.default=d},870:(e,t,s)=>{s.r(t);var a=s(208),r=s(88);t.default=(e,t=[],s={})=>i=>{const l=(0,a.useRef)(),n=(0,a.useRef)(),[o,d]=Object.entries(i).reduce(((e,[s,a])=>(e[t.includes(s)?0:1][s]=a,e)),[{},{}]),c=t.map((e=>{const t=o[e];return s[e]?(n.current?.[s[e]](t),null):t}));return(0,a.useLayoutEffect)((()=>(n.current=new e(o),(0,r.render)(l.current,n.current),()=>{n.current.remove(),n.current=null})),[d.key,...c]),(0,a.jsx)("div",{ref:l,...d})}},1067:(e,t,s)=>{s.r(t);var a=s(208),r=s(210),i=s.n(r),l=s(88),n=s(869);const o=l.Locale.getSection("smb.components.lists.users"),d=({data:e,searchFilters:t,currentUserId:s})=>{const r=(0,a.useMemo)((()=>[l.list.COLUMN_SELECTION,{header:o.lmsg("contactName"),sortable:!0,dataIndex:"contactName",renderer(e){const t=e.contactName?e.contactName:e.login;return`<a href="/smb/user/overview/id/${e.id}">${(0,l.escapeHtml)(t)}</a>`+(1==e.isLocked?`<span class="hint-attention ">${o.lmsg("statusBlocked")}</span>`:"")}},{header:o.lmsg("email"),sortable:!0,cls:"minor",dataIndex:"email",renderer:e=>e.email?`<a href="mailto:${e.email}">${e.email}</a>`:""},{header:o.lmsg("role"),cls:"minor",sortable:!0,dataIndex:"roleName"}]),[]),i=(0,a.useMemo)((()=>[{componentType:l.SmallButton,title:o.lmsg("buttonAddNewUser"),description:o.lmsg("hintAddNewUser"),addCls:"sb-add-user btn-primary",href:"/smb/user/create"},{componentType:l.bar.Separator},{componentType:l.SmallButton,id:"buttonRemoveUser",title:o.lmsg("remove"),description:o.lmsg("hintRemove"),addCls:"sb-remove-selected",handler(e){(0,l.getComponent)("users-list").execGroupOperation({url:"/smb/user/delete/?redirect=/smb/user/list/",subtype:"delete",mouseEvent:e,locale:{confirmOnGroupOperation:o.lmsg("confirmOnDelete")}})}}]),[]),d=(0,a.useCallback)((e=>1==e.isBuiltIn||e.id==s),[s]);return(0,a.jsx)(n.default,{id:"users-list",data:e,dataUrl:"/smb/user/list-data",disabledSelectHint:o.lmsg("disabledSelectHint"),searchOveral:"name",searchFilters:t,isDisabledItem:d,columns:r,operations:i})};d.propTypes={data:n.default.propTypes.data.isRequired,searchFilters:n.default.propTypes.searchFilters.isRequired,currentUserId:i().string.isRequired},t.default=d},1066:(e,t,s)=>{s.r(t);var a=s(88),r=s(1060),i=s(873),l=s(697),n=s(1067),o=s(208);const d=a.Locale.getSection("smb.controllers.user.list"),c=({tabs:e,...t})=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.default,{items:e}),(0,o.jsx)(r.default,{hint:d.lmsg("hint"),expandable:!0}),(0,o.jsx)(n.default,{...t})]});c.propTypes={tabs:i.default.propTypes.items.isRequired},t.default=(0,l.withPageLayout)(c)}}]);
//# sourceMappingURL=list.js.map?c8e307f44908fbf9d62f