import{a as l,E as c,e as p}from"./index-B4UsuA0L.js";import{r as o,d as v,G as m,ae as y,u as f,am as b,e as _}from"./lucide-8Ndi-dzR.js";const n=o(null),r=o(!1),t=o(!1);let s=null;async function u(a=!1){return t.value&&!a?n.value:(s&&!a||(r.value=!0,s=(async()=>{try{const e=await l.sendCommand("party/config");return n.value=e,t.value=!0,e}catch{return n.value=null,t.value=!0,null}finally{r.value=!1,s=null}})()),s)}function i(){n.value=null,t.value=!1,s=null}let d=!1;function P(){d||(d=!0,l.subscribe(c.PROVIDERS_UPDATED,async()=>{Object.values(l.providers).some(e=>e.domain==="party")?(i(),await u(!0)):(n.value=null,t.value=!0)}),l.subscribe(c.CORE_STATE_UPDATED,async()=>{Object.values(l.providers).some(e=>e.domain==="party")&&(i(),await u(!0))}))}function z(){return P(),{config:n,loading:r,loaded:t,fetchConfig:u,invalidate:i}}const D=v({__name:"Spinner",props:{class:{type:[Boolean,null,String,Object,Array],default:void 0},size:{default:void 0}},setup(a){const e=a;return(h,g)=>(_(),m(f(b),{role:"status","aria-label":"Loading",size:e.size,class:y(f(p)("size-4 animate-spin",e.class))},null,8,["size","class"]))}});export{D as _,z as u};
