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-458d5762.js";import{c as U,b as u,k as q,u as y}from"./index.esm-b1b14098.js";import{T as B}from"./index-7483f8f7.js";import{o as L}from"./yup-536c503d.js";import{T as N}from"./TopComponent-eac7a2e9.js";import"./TableRow-804f1ca0.js";import"./useMediaQuery-49fd660f.js";import"./TableContainer-e19f0ed8.js";import"./TableHead-f91d726f.js";import"./Grow-1b19ccc0.js";import"./TablePagination-a615fa80.js";import"./Select-1c8a1710.js";import"./index-e5978b8b.js";import"./KeyboardArrowRight-d389d7f9.js";import"./LastPage-ff5a6182.js";import"./Toolbar-866a7faf.js";import"./MenuItem-5cd95798.js";import"./dividerClasses-eff9af63.js";import"./listItemTextClasses-04d37f34.js";import"./listItemIconClasses-8da63284.js";import"./GenericThumbnailView-3cd8dbb5.js";import"./index-3b6e321a.js";import"./createClass-9305c513.js";import"./popper-f3391c26.js";import"./InputAdornment-84b43ef6.js";import"./TextField-e297d925.js";import"./isMuiElement-6ed6867f.js";import"./ScrollableList-ba92364a.js";import"./CircularProgress-cad31cee.js";import"./componentStyles-56425874.js";import"./PageBreadCrumb-935feb12.js";import"./PageMetaData-98466a56.js";import"./TextArea-233680fc.js";import"./Grid2-e3c9383e.js";import"./Badge-15ca6164.js";import"./FilterFilled-c223055e.js";import"./AntdIcon-99e065a0.js";import"./objectSpread2-cbe250a0.js";import"./FilterOutlined-41555a07.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};
