import{b as c,c as u,a as g}from"./vendor-redux-a1f00e6b.js";import{cQ as o,cR as n,F as y}from"./index-c62ac197.js";async function L(a){return(await o.apiV10SupportCategoryAddCategoryPost(a)).data}async function S(){return(await o.apiV10SupportCategoryGetCategoryPost()).data}async function b(a,e){return(await o.apiV10SupportCategoryUpdateCategoryIdPost(a,e)).data}async function R(a){return(await o.apiV10SupportCategoryDeleteCategoryIdPost(a)).data}async function C(a){return(await n.apiV10AdminSupportTicketsGet(void 0,a==null?void 0:a.registrationDate,a==null?void 0:a.status,a==null?void 0:a.company,1,1e3)).data}async function D(a){return(await n.apiV10AdminSupportTicketsTicketIdGet(a)).data}async function I(a,e,t,s){return(await n.apiV10AdminSupportTicketsTicketIdMessagesPost(a,t,e,s)).data}async function V(a,e){return(await n.apiV10AdminSupportTicketsTicketIdUpdateStatusPost(a,e)).data}const i="SupportData",r=c(`${i}/getAllTicketList`,async a=>(await C(a)).data),d=c(i+"/getTicketDetails",async a=>(await D(a.id)).data),p=c(i+"/getAllSupportCategories",async()=>(await S()).data),k={total:0,pageIndex:1,pageSize:10,query:"",sort:{order:"",key:""}},f={loading:!1,deleteConfirmation:!1,selectedRowData:"",detailsLoading:!1,tableData:k,filterData:{name:"",category:["bags","cloths","devices","shoes","watches"],status:[0,1,2],productStatus:0},ticketList:[],ticketDetails:{},categoryList:[]},l=u({name:`${i}`,initialState:f,reducers:{setTableData:(a,e)=>{a.tableData=e.payload},setFilterData:(a,e)=>{a.filterData=e.payload},toggleDeleteConfirmation:(a,e)=>{a.deleteConfirmation=e.payload},setSelectedRowData:(a,e)=>{a.selectedRowData=e.payload}},extraReducers:a=>{a.addCase(r.fulfilled,(e,t)=>{var s;e.ticketList=(s=t.payload.items)==null?void 0:s.$values,e.loading=!1}).addCase(r.pending,e=>{e.loading=!0}).addCase(r.rejected,e=>{e.loading=!1}).addCase(d.fulfilled,(e,t)=>{e.ticketDetails=t.payload,e.detailsLoading=!1}).addCase(d.pending,e=>{e.detailsLoading=!1}).addCase(p.fulfilled,(e,t)=>{var s;e.categoryList=(s=t.payload.finalResults)==null?void 0:s.$values,e.loading=!1}).addCase(p.pending,e=>{e.loading=!0}).addCase(p.rejected,e=>{e.loading=!1})}}),{setTableData:v,setFilterData:G,toggleDeleteConfirmation:P,setSelectedRowData:h}=l.actions,T=l.reducer,U=g({data:T}),$=y;export{S as a,d as b,I as c,V as d,L as e,b as f,r as g,p as h,R as i,U as r,h as s,$ as u};
