"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[5704],{745704:(e,t,l)=>{l.r(t),l.d(t,{default:()=>v});var n=l(296540),a=l(878538),r=l(582724),i=l(592510),s=l(687602),c=l(469733),o=l(459449),d=l(294303),m=l(566723),u=l(838963);var E=l(602021),A=l(905410),C=l(249304),p=l(98160),_=l(46420),h=l(342214),M=l(980648),w=l(185469),O=l(398300),g=l(845030),N=l(888247),S=l(816919),b=l(792073),R=l(959341);const f=[{id:"name",label:n.createElement(o.sA,{id:"COMMON_LABEL_USERNAME"}),minWidth:100,growthFactor:1,renderCell:({name:e})=>n.createElement(N.A,null,e||n.createElement(o.sA,{id:"COMMON_FALLBACK"}))},{id:"vlan",label:n.createElement(o.sA,{id:"COMMON_VLAN"}),minWidth:100,growthFactor:1,maxWidth:200,renderCell:({vlan:e})=>n.createElement(N.A,null,e||n.createElement(o.sA,{id:"COMMON_FALLBACK"}))},{id:"tunnel_type",label:n.createElement(o.sA,{id:"COMMON_TUNNEL_TYPE"}),minWidth:100,growthFactor:1,renderCell:({tunnel_type:e})=>n.createElement(N.A,null,n.createElement(o.sA,{id:S.vx[e],values:{id:e}}))},{id:"tunnel_medium_type",label:n.createElement(o.sA,{id:"COMMON_TUNNEL_MEDIUM_TYPE"}),minWidth:100,growthFactor:1,renderCell:({tunnel_medium_type:e})=>n.createElement(N.A,null,n.createElement(o.sA,{id:S.tI[e],values:{id:e}}))},{id:"x_password",label:n.createElement(o.sA,{id:"COMMON_PASSWORD"}),minWidth:100,growthFactor:1,renderCell:({x_password:e})=>n.createElement(d.A,{width:"100%",onClick:e=>e.stopPropagation()},n.createElement(M.A,{type:"password",value:e,passwordToggle:!0,style:{width:"100%",flex:1}}))}],L=({items:e})=>{const t=(0,c.useDispatch)(),l=(0,c.useSelector)(E.EL),r=(0,n.useCallback)(async e=>{t((0,a.Bv)(e.map(({_id:e})=>e)))},[t]);return n.createElement(b.Ay,{disableColumnFilters:!0,idField:"_id",items:e,onRowClick:({_id:e})=>t((0,g.XP)({type:O.H.RADIUS_USER,id:e})),columns:f,isRemovable:({_id:e})=>!!e,removeItems:r,showEmptyTable:!0,footerContent:l?null:n.createElement(w.A,{disabled:l,onClick:()=>t((0,g.XP)({type:O.H.RADIUS_USER,id:R.R6}))},n.createElement(o.sA,{id:"COMMON_CREATE_NEW"}))})},y=()=>{(0,c.useDispatch)();const{formatMessage:e}=(0,o.tz)(),t=(0,c.useSelector)(u.Of),[l,a]=((0,c.useSelector)(E.EL),(0,n.useState)(0)),[r,i]=(0,n.useState)(""),M=function(e,t){const[l,a]=(0,n.useState)(e);return(0,n.useEffect)(()=>{const l=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(l)}}),l}(r,100),w=(0,n.useMemo)(()=>{const e=M.toLowerCase();return t.filter(t=>t.name.toLowerCase().includes(e))},[t,M]);return n.createElement(p.A,null,n.createElement(_.R1,null,n.createElement(_.Iq,{wide:!0},n.createElement(d.A,{width:"100%",gap:m.kc,flexDirection:"column"},n.createElement(d.A,{gap:m.Ln},n.createElement(s.A,{"aria-label":e({id:"COMMON_SEARCH"}),width:344,placeholder:e({id:"COMMON_SEARCH"}),value:r,onChange:e=>{i(e),a(0)}})),n.createElement(h.j,{noMargin:!0},n.createElement(A.A,{itemCount:w.length,tableType:C.l.RADIUS_USERS,wrapperFlexProps:{padding:"none"},onPageChanged:a,pageNumber:l,onRenderTable:({from:e,rowsPerPage:t})=>n.createElement(L,{items:w.slice(e,e+t)})}))))))},v=()=>(0,r.A)([(0,a.xL)(void 0,{crudCacheStrategy:{type:i.e.CACHE}})],n.createElement(y,null))}}]);