const r=e=>String(e||"").toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),a="shopSlugIdMap",n=()=>{try{return JSON.parse(localStorage.getItem(a))||{}}catch{return{}}},c=e=>{if(!(e!=null&&e.id)||!(e!=null&&e.name))return;const t=n();t[r(e.name)]=e.id,localStorage.setItem(a,JSON.stringify(t))},g=e=>n()[e]||null,l=e=>{c(e);const t=r(e==null?void 0:e.name);return t?`/shops/${t}`:`/shops/${e==null?void 0:e.id}`};export{r as a,c,g,l as s};
