import{ref as t}from"vue";import{defineStore as e}from"pinia";import{k as a}from"./server.mjs";const o=e("offers",(()=>{const{$axios:e}=a(),o=t({}),s=t(),r=t(!0),f=t(!0),u=t([]);return{errors:o,isLoading:r,isLoading2:f,getOffer:async function(t){const a=await e.get(`offer/show/${t}`);a.status>=200&&(s.value=a.data.data,f.value=!1),setTimeout((()=>{f.value=!0}),500)},getOfferBySlug:async function(t){const a=await e.get(`offer/show/${t}`);a.status>=200&&(s.value=a.data.data,f.value=!1),setTimeout((()=>{f.value=!0}),500)},getOffers:async function(){const t=await e.get("offers");t.status>=200&&(u.value=t.data.data,r.value=!1),setTimeout((()=>{r.value=!0}),500)},offers:u,offer:s,slugify:function(t){return t?t.toString().toLowerCase().trim().replace(/\s+/g,"-").replace(/[؟,،!%&]/g,"").replace(/-+/g,"-"):""}}}));export{o as L};
