import{i as e,n as t}from"./rolldown-runtime-ConPGZeh.js";import{Yn as n,cn as r}from"./vendor-other-CT05lTmi.js";import{i,r as a}from"./api-DvJuMrZn.js";import{i as o,n as s,r as c}from"./remoteConfig-BiMFcSmW.js";import{ao as l,ho as u,io as d,mi as f,mo as p,pi as m}from"./dialogService-DIdX_hbW.js";async function refreshRemoteConfig(){try{let e=await a.fetchApi(`/features`,{cache:`no-store`});if(e.ok){let t=await e.json();window.__CONFIG__=t,o.value=t;return}console.warn(`Failed to load remote config:`,e.statusText),(e.status===401||e.status===403)&&(window.__CONFIG__={},o.value={})}catch(e){console.error(`Failed to fetch remote config:`,e)}}var h=t((()=>{i(),s()}));t((()=>{r(),d(),p(),s(),h(),m(),f().registerExtension({name:`Comfy.Cloud.RemoteConfig`,setup:async()=>{let{isLoggedIn:e}=l(),{isActiveSubscription:t}=u();n([e,t],()=>{e.value&&refreshRemoteConfig()},{debounce:256,immediate:!0}),setInterval(()=>void c(),6e5)}})}))();
//# sourceMappingURL=cloudRemoteConfig-AdJSsqLF.js.map