import{d as z,b6 as S,lq as T,r as b,lr as o,j as r,B as F,T as g}from"./index-6c48ebe4.js";import{c as U,b as u,k as q,u as y}from"./index.esm-fd3369ba.js";import{T as B}from"./index-f4e64c6d.js";import{o as L}from"./yup-75ac0470.js";import{T as N}from"./TopComponent-67802300.js";import"./TableRow-31f0a4a1.js";import"./useMediaQuery-00a4851f.js";import"./TableContainer-45046f6e.js";import"./TableHead-37e5318b.js";import"./Grow-3d640bff.js";import"./TablePagination-cd240560.js";import"./Select-c5c274bb.js";import"./index-e5978b8b.js";import"./KeyboardArrowRight-345292ac.js";import"./LastPage-6dc33080.js";import"./Toolbar-6122c8d7.js";import"./MenuItem-12bffc2f.js";import"./dividerClasses-28ddda01.js";import"./listItemTextClasses-6920789d.js";import"./listItemIconClasses-a3efc5a3.js";import"./GenericThumbnailView-e18774c4.js";import"./index-84485105.js";import"./createClass-8ad09c76.js";import"./popper-f3391c26.js";import"./InputAdornment-42748b9a.js";import"./TextField-3876249c.js";import"./isMuiElement-447b74a0.js";import"./ScrollableList-e9cb113e.js";import"./CircularProgress-7b4c6820.js";import"./componentStyles-1dd5fe29.js";import"./PageBreadCrumb-99fa2c5a.js";import"./PageMetaData-80da715a.js";import"./TextArea-4432195b.js";import"./Grid2-70d79e93.js";import"./Badge-16c8eac2.js";import"./FilterFilled-a2396aeb.js";import"./AntdIcon-3eb8cd38.js";import"./objectSpread2-31ff416c.js";import"./FilterOutlined-ff45270d.js";const ve=()=>{const a=z(),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 v=U().shape({newPassword:u().min(8,"Password must be at least 8 characters long").required("New Password is required"),confirmPassword:u().oneOf([q("newPassword"),""],"Passwords must match").required("Confirm Password is required")});y({resolver:L(v)});const w=e=>{const s=e.target.value;a(o({...t,search:s||"",page:1,page_size:10}))};return r.jsxs(r.Fragment,{children:[r.jsx(N,{permissionPreFix:"core_users",permissionPostFix:"current_logged_users",navigateLink:"/pages/settings/manage-users/0",showAddButton:!1,showFilterButton:!1,addButtonName:"Add User",handleSearch:_,handleInputChange:w,children:r.jsxs(F,{sx:{display:"flex",gap:2},children:[r.jsx(g,{variant:"h4",children:" Count"}),r.jsx(g,{variant:"subtitle1",color:"primary",children:l})]})}),r.jsx(B,{count:l,columns:x,rows:P,loading:h,page:t.page,pageSize:t.page_size,handleChangePage:j,handleChangeRowsPerPage:C})]})};export{ve as default};
