import{ab as u,v as r,V as i,ac as s,j as c}from"./entry.e017eb4f.js";const p=u(async(d,v)=>{var l;let e,n;const a=r("apiToken"),o=r("activeVendor");if(!a.value)return typeof localStorage<"u"&&(localStorage==null||localStorage.setItem("apiToken",""),localStorage==null||localStorage.setItem("activeVendor","")),a.value=null,o.value=null,i("/haendlerlogin");const t=([e,n]=s(()=>$fetch(c().public.API_URL+"/api/vendors/auth",{headers:{Authorization:"Bearer "+a.value}})),e=await e,n(),e);if(!((l=t==null?void 0:t.vendor)!=null&&l.id))return typeof localStorage<"u"&&(localStorage==null||localStorage.setItem("apiToken",""),localStorage==null||localStorage.setItem("activeVendor","")),a.value=null,o.value=null,i("/haendlerlogin");o.value=t.vendor});export{p as default};