import{r as e}from"./rolldown-runtime-DCMCV6zW.js";import{i as t,r as n}from"./remoteConfig-CNDr9CtS.js";import{r}from"./api-3C7_IVZO.js";async function refreshRemoteConfig(e={}){let{useAuth:i=!0}=e;try{let e=i?await r.fetchApi(`/features`,{cache:`no-store`}):await fetch(`/api/features`,{cache:`no-store`});if(e.ok){let r=await e.json();window.__CONFIG__=r,n.value=r,t.value=i?`authenticated`:`anonymous`;return}console.warn(`Failed to load remote config:`,e.statusText),(e.status===401||e.status===403)&&(window.__CONFIG__={},n.value={},t.value=`error`)}catch(e){console.error(`Failed to fetch remote config:`,e),window.__CONFIG__={},n.value={},t.value=`error`}}export{refreshRemoteConfig as t};
//# sourceMappingURL=refreshRemoteConfig-BG1v6jUH.js.map