import{b as p,c as u,a as g}from"./vendor-redux-a1f00e6b.js";import{a as D}from"./DynamicTablesService-963fe77b.js";import{ab as f,F as y}from"./index-c62ac197.js";const d="dynamicTables",s=p(d+"/getDynamicTables",async a=>{var o,r,i,l;const{auth:e}=f.getState(),t=((r=(o=e==null?void 0:e.session)==null?void 0:o.tenantId)==null?void 0:r.toString())??"",m={searchString:"",userId:((l=(i=e==null?void 0:e.session)==null?void 0:i.userId)==null?void 0:l.toString())??"",tenantId:t,fromDate:null,toDate:null,sortBy:"",sortDirection:"",page:0,pageSize:20},n=await D(m);return{data:n.data.tables.$values,total:n.data.totalCount}}),b={loading:!1,deleteConfirmation:!1,selectedGrid:[],dynamicTableList:[],filterData:{tenantId:"",searchString:"",fromDate:"",toDate:""}},c=u({name:`${d}/state`,initialState:b,reducers:{updateUserList:(a,e)=>{a.dynamicTableList=e.payload},setTableData:(a,e)=>{a.dynamicTableList=e.payload},setFilterData:(a,e)=>{a.filterData=e.payload},toggleDeleteConfirmation:(a,e)=>{a.deleteConfirmation=e.payload},setSelectedGrid:(a,e)=>{a.selectedGrid=e.payload}},extraReducers:a=>{a.addCase(s.fulfilled,(e,t)=>{e.dynamicTableList=t.payload.data,e.loading=!1}).addCase(s.pending,e=>{e.loading=!0}).addCase(s.rejected,e=>{e.loading=!1})}}),{updateUserList:A,toggleDeleteConfirmation:F,setTableData:x,setFilterData:E,setSelectedGrid:R}=c.actions,S=c.reducer,U=g({data:S}),_=y;export{s as g,U as r,R as s,F as t,_ as u};
