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