import{d as w,b6 as S,ly as T,r as b,lz as o,j as r,B as y,T as g}from"./index-e0c07a84.js";import{c as F,b as u,k as U,u as B}from"./index.esm-79617ba5.js";import{T as L}from"./index-94063e98.js";import{o as N}from"./yup-74a95d85.js";import{T as q}from"./TopComponent-df917583.js";import"./TableRow-248ce459.js";import"./useMediaQuery-61792d39.js";import"./TableContainer-84b94d99.js";import"./TableHead-3bf23892.js";import"./Grow-5c4c469c.js";import"./TablePagination-da0d0adf.js";import"./Select-a8f8fd6a.js";import"./index-e5978b8b.js";import"./KeyboardArrowRight-aeb4c8ed.js";import"./LastPage-d8600c66.js";import"./Toolbar-c85ba7f8.js";import"./MenuItem-9dcf8782.js";import"./dividerClasses-6c6c8dc7.js";import"./listItemTextClasses-e9c46ccd.js";import"./listItemIconClasses-129e65e5.js";import"./GenericThumbnailView-d192caf7.js";import"./index-c7a54fed.js";import"./createClass-1acb73b4.js";import"./popper-f3391c26.js";import"./InputAdornment-bf957c61.js";import"./TextField-23174150.js";import"./isMuiElement-953ce284.js";import"./ScrollableList-874c742d.js";import"./CircularProgress-cff840b0.js";import"./componentStyles-5432a72d.js";import"./PageBreadCrumb-6771b805.js";import"./PageMetaData-5fed2c1a.js";import"./TextArea-e9886f56.js";import"./Grid2-05f25635.js";import"./Badge-3eca5e1a.js";import"./FilterFilled-80640201.js";import"./AntdIcon-bc64d1d9.js";import"./objectSpread2-f946b5f0.js";import"./FilterOutlined-6138f61b.js";const ze=()=>{const a=w(),c=S(),{loggedUsers:{list:d,pageParams:t,loading:h,count:l,selectedData:A},system:{userAccessList:E}}=T(),x=[{title:"S.No"},{title:"UserName"},{title:"Full Name"},{title:"Email"},{title:"Phone"},{title:"Group",width:100}];function f(e,s,p,n,i,m){return{index:e,username:s,fullname:p,email:n,phone:i,group:m}}const P=d.map((e,s)=>{var i;const p=(t.page-1)*t.page_size+(s+1),n=(i=e==null?void 0:e.groups)==null?void 0:i.map(m=>m).join(", ");return f(p,e.username||"",e.full_name||"",e.email||"",e.phone||"",n||"")}),_=({search:e})=>{a(o({...t,search:e||"",page:1,page_size:10}))},j=(e,s)=>{a(o({...t,search:"",page:s+1}))},C=e=>{a(o({...t,search:"",page:1,page_size:parseInt(e.target.value)}))};b.useEffect(()=>{a(o({...t,search:"",page:1,page_size:10})),c.setTitle("Logged Users"),c.setSubtitle("Settings")},[]);const z=F().shape({newPassword:u().min(8,"Password must be at least 8 characters long").required("New Password is required"),confirmPassword:u().oneOf([U("newPassword"),""],"Passwords must match").required("Confirm Password is required")});B({resolver:N(z)});const v=e=>{const s=e.target.value;a(o({...t,search:s||"",page:1,page_size:10}))};return r.jsxs(r.Fragment,{children:[r.jsx(q,{permissionPreFix:"core_users",permissionPostFix:"current_logged_users",navigateLink:"/pages/settings/manage-users/0",showAddButton:!1,showFilterButton:!1,addButtonName:"Add User",handleSearch:_,handleInputChange:v,children:r.jsxs(y,{sx:{display:"flex",gap:2},children:[r.jsx(g,{variant:"h4",children:" Count"}),r.jsx(g,{variant:"subtitle1",color:"primary",children:l})]})}),r.jsx(L,{count:l,columns:x,rows:P,loading:h,page:t.page,pageSize:t.page_size,handleChangePage:j,handleChangeRowsPerPage:C})]})};export{ze as default};
