import{c as a,f as e,d as s}from"./router.chunk.YsRm4bSN.js";import{_ as __}from"./wordpress.chunk.BVds2GcU.js";import{bj as n,aw as t,ax as d,w as i}from"./main.chunk.N-eZ2ybB.js";const r=e=>a({queryKey:["RewardItems",e],queryFn:()=>(n(e.campaign_id,__("Campaign ID is required","growfund")),(a=>t.get(d.CAMPAIGN_REWARD_ITEMS(a.campaign_id)).then(a=>a.data))({campaign_id:e.campaign_id})),enabled:!!e.campaign_id}),u=({campaign_id:a,...e})=>t.post(d.CAMPAIGN_REWARD_ITEMS(a),e).then(a=>a.data),c=()=>{const a=e();return s({mutationFn:u,onSuccess:()=>{a.invalidateQueries({queryKey:["RewardItems"]}),i.success(__("Reward item created successfully","growfund"))}})},m=({campaign_id:a,id:e,...s})=>t.put(d.CAMPAIGN_REWARD_ITEMS_WITH_ID(a,e),s),o=()=>{const a=e();return s({mutationFn:m,onSuccess:()=>{a.invalidateQueries({queryKey:["RewardItems"]}),i.success(__("Reward item updated successfully","growfund"))}})},_=({campaign_id:a,id:e})=>t.delete(d.CAMPAIGN_REWARD_ITEMS_WITH_ID(a,e)),I=()=>{const a=e();return s({mutationFn:_,onSuccess:()=>{a.invalidateQueries({queryKey:["RewardItems"]}),i.success(__("Reward item deleted successfully","growfund"))}})},p=async({uid:a,rewardItemId:e})=>(await t.get(d.REWARD_ITEM_DOWNLOAD(a,e))).data.download_link,w=()=>s({mutationFn:p});export{o as a,r as b,I as c,w as d,c as u};
