import{j as e,d as f,r as C,W as w,I as y,fB as P,_ as A,T as h,B as b,b as L,eb as v,a as B,sN as z,g as E,sO as l}from"./index-d2b25495.js";import{T as _}from"./TopComponent-23a44952.js";import{T,t as c,a as j}from"./TableRow-74f9cf3b.js";import{T as R}from"./TableContainer-dd7cf0ce.js";import{T as k,a as O,b as U}from"./TableHead-fac214d3.js";import{u as S}from"./index-38f860bc.js";import{C as D}from"./CardContent-be810fe0.js";import{T as I}from"./TablePagination-2c2a1682.js";import"./yup-267e586f.js";import"./index.esm-ce3c2c20.js";import"./componentStyles-0e851d91.js";import"./index-709861af.js";import"./popper-f3391c26.js";import"./OutlinedInput-86f3ec98.js";import"./useFormControl-2b068664.js";import"./InputAdornment-d0c3ebef.js";import"./InputLabel-bb6ab40e.js";/* empty css                   */import"./PageBreadCrumb-02480d86.js";import"./PageMetaData-7797a3b7.js";import"./ScrollableList-fc1de312.js";import"./Loader-1b927baf.js";import"./List-863f013e.js";import"./index.esm-3043d6d4.js";import"./TextField-e155d2be.js";import"./FormControl-73683015.js";import"./Select-ef36a2b2.js";import"./Menu-337a466b.js";import"./Grow-8719411b.js";import"./useControlled-8d737f13.js";import"./createSvgIcon-e39ae511.js";import"./FilterFilled-4dfce120.js";import"./AntdIcon-8449be55.js";import"./objectSpread2-b41ee31b.js";import"./FilterOutlined-653b7cb0.js";import"./useMediaQuery-b1fbc166.js";import"./MenuItem-2bdddad4.js";import"./dividerClasses-02a44d89.js";import"./listItemTextClasses-cadd4b00.js";import"./KeyboardArrowRight-7e978a8a.js";const M=S.createSvgIcon(e.jsx("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess"),F=S.createSvgIcon(e.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),a=f(T)(({theme:t})=>({[`&.${c.head}`]:{backgroundColor:t.palette.background.paper,fontSize:"14px",textAlign:"start"},[`&.${c.body}`]:{textAlign:"start",fontSize:"14px",BorderBottom:"0.8px solid #0000004D"}})),N=({data:t,pageParams:i})=>{const[d,x]=C.useState(null),s=o=>{x(d===o?null:o)},n=["S.No","Code","Type","Table","User Name","Created On","More"];return e.jsx(R,{component:w,sx:{borderRadius:0,overflow:"hidden",boxShadow:0},children:e.jsxs(k,{children:[e.jsx(O,{children:e.jsx(j,{sx:{backgroundColor:"#f5f5f5"},children:n==null?void 0:n.map(o=>e.jsx(a,{children:o}))})}),e.jsx(U,{children:t.map((o,m)=>{var p;const g=(i.page-1)*i.page_size+(m+1);return e.jsxs(e.Fragment,{children:[e.jsxs(j,{children:[e.jsx(a,{children:g}),e.jsx(a,{children:o.record_code}),e.jsx(a,{children:o.type_name}),e.jsx(a,{children:o.tablename}),e.jsx(a,{children:(p=o==null?void 0:o.user)==null?void 0:p.username}),e.jsx(a,{children:new Date(o.created_on).toLocaleString()}),e.jsx(a,{children:e.jsx(y,{onClick:()=>s(o.id),children:d===o.id?e.jsx(M,{}):e.jsx(F,{})})})]},o.id),e.jsx(j,{children:e.jsx(a,{colSpan:n==null?void 0:n.length,sx:{padding:0},children:e.jsx(P,{in:d===o.id,timeout:"auto",unmountOnExit:!0,children:e.jsx(A,{variant:"outlined",sx:{margin:2,padding:3,backgroundColor:"#f9fafb",borderLeft:"5px solid #1976d2",boxShadow:2},children:e.jsxs(D,{children:[e.jsx(h,{variant:"h6",gutterBottom:!0,sx:{color:"#1976d2",fontWeight:"bold"},children:"Log Data"}),e.jsx(b,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:2},children:Object.entries(o.log_data).map(([r,u])=>e.jsxs(b,{sx:{padding:1,backgroundColor:"white",borderRadius:1,boxShadow:1},children:[e.jsxs(h,{variant:"body2",sx:{fontWeight:"bold",color:"#555"},children:[r,":"]}),e.jsx(h,{variant:"body2",sx:{color:"#333",wordWrap:"break-word"},children:String(u)})]},r))})]})})})})})]})})})]})})};f(T)(({theme:t})=>({[`&.${c.head}`]:{backgroundColor:t.palette.grey[100],color:t.palette.primary},[`&.${c.body}`]:{fontSize:14}}));function ve(){const t=L(),i=v(),{manageUser:{userAuditCount:d,userAuditList:x,userAuditParams:s,auditLoading:n},system:{userAccessList:o}}=B(r=>({manageUser:z(r),system:E(r)})),m=({search:r})=>{t(l({...s,search:r||"",page:1,page_size:10}))},g=(r,u)=>{t(l({...s,page:u+1}))},p=r=>{t(l({...s,page:1,page_size:parseInt(r.target.value)}))};return C.useEffect(()=>{t(l({...s,search:"",page:1,page_size:10})),i.setTitle("Audit"),i.setSubtitle("Settings")},[]),e.jsxs(b,{children:[e.jsx(_,{permissionPreFix:"System",permissionPostFix:"user",navigateLink:"/pages/settings/manage-users/0",showAddButton:!1,showFilterButton:!1,addButtonName:"Add User",handleSearch:m,filteredData:s}),e.jsx(N,{data:x,pageParams:s}),e.jsx(I,{rowsPerPageOptions:[10,20,50,100,{label:"All",value:-1}],component:"div",count:d,rowsPerPage:s.page_size,page:s.page-1,onPageChange:g,onRowsPerPageChange:p})]})}export{ve as default};
