import{_ as d}from"./index-BiWH3VAt.js";const o=d.injectEndpoints({endpoints:a=>({saveLeadDetails:a.mutation({query:e=>({url:"lead",method:"POST",body:e})}),updateLeadDetails:a.mutation({query:e=>({url:"lead",method:"PUT",body:e})}),getLeadById:a.query({query:e=>`leads/${e}`}),getLeadFullById:a.query({query:e=>`lead/full/${e}`}),getLeadsByPage:a.mutation({query:({searchByName:e,page:t,size:u,includeCounts:s})=>({url:`lead/search-by-criteria?page=${t}&size=${u}${s===!1?"&includeCounts=false":""}`,method:"POST",body:e})}),getLeadsByPageForAc:a.mutation({query:({searchByName:e})=>({url:"lead/search-by-criteria?page=0&size=30",method:"POST",body:e})}),getLeadList:a.query({query:()=>"lead/list"}),deleteLead:a.mutation({query:e=>({url:`lead/${e}`,method:"DELETE"})}),convertLeadToCustomer:a.mutation({query:({id:e,...t})=>({url:`lead/${e}/convert-to-customer`,method:"POST",body:t})}),assignLead:a.mutation({query:({id:e,body:t})=>({url:`lead/${e}/assign`,method:"POST",body:t}),invalidatesTags:["Lead"]}),markLeadQualified:a.mutation({query:({id:e,reason:t})=>({url:`lead/${e}/mark-qualified`,method:"POST",body:t??""}),invalidatesTags:["Lead"]}),markLeadLost:a.mutation({query:({id:e,body:t})=>({url:`lead/${e}/mark-lost`,method:"POST",body:t}),invalidatesTags:["Lead"]}),updateLeadStatus:a.mutation({query:({id:e,body:t})=>({url:`lead/${e}/status`,method:"PATCH",body:t}),invalidatesTags:["Lead"]}),getLeadTimeline:a.query({query:e=>`lead/${e}/timeline`,providesTags:["LeadActivity"]}),getLeadDashboard:a.query({query:()=>"lead/dashboard",providesTags:["Lead"]}),linkLeadQuotation:a.mutation({query:({leadId:e,...t})=>({url:`lead/${e}/link-quotation`,method:"POST",body:t})}),getLeadAssignmentHistory:a.query({query:e=>`lead/${e}/assignment-history`,providesTags:["Lead"]}),resolveQuotationAddresses:a.query({query:({sourceType:e,sourceId:t,customerId:u})=>{const s=new URLSearchParams({sourceType:e});return t!=null&&s.set("sourceId",String(t)),u!=null&&s.set("customerId",String(u)),`quotation/addresses?${s.toString()}`}})}),overrideExisting:!1}),{useSaveLeadDetailsMutation:r,useUpdateLeadDetailsMutation:n,useGetLeadByIdQuery:y,useLazyGetLeadByIdQuery:L,useGetLeadFullByIdQuery:l,useLazyGetLeadFullByIdQuery:m,useGetLeadsByPageMutation:g,useGetLeadsByPageForAcMutation:q,useGetLeadListQuery:T,useDeleteLeadMutation:h,useConvertLeadToCustomerMutation:c,useAssignLeadMutation:Q,useMarkLeadQualifiedMutation:p,useMarkLeadLostMutation:v,useUpdateLeadStatusMutation:P,useGetLeadTimelineQuery:S,useLazyGetLeadTimelineQuery:$,useGetLeadDashboardQuery:M,useLinkLeadQuotationMutation:A,useGetLeadAssignmentHistoryQuery:G,useLazyGetLeadAssignmentHistoryQuery:f,useLazyResolveQuotationAddressesQuery:k}=o;export{h as a,r as b,n as c,Q as d,m as e,M as f,l as g,q as h,c as i,A as j,k,S as l,p as m,v as n,g as u};
