import{n as e,r as t}from"./rolldown-runtime-DAXXjFlN.js";import{Fr as n,dn as r,gr as i}from"./vendor-6bGPahzI.js";import{A as a,g as o,i as s,j as c}from"./vendor-vue-DqH63YZy.js";import{$a as l,Qa as u,Sr as d,gr as f,xr as p}from"./ws-BfVPV0ME.js";var m=t({usePluginStore:()=>h}),h,g=e((()=>{s(),c(),l(),p(),r(),h=a(`plugin-store`,()=>{let e=u();n(0);let t=n([]),r=o(`c3api/applied-plugins`,[]);i(r,t=>{for(let n of t)if(!d(n))try{f(`${e}/plugins/${n}/plugin.js`)}catch(e){console.error(`Failed to load plugin ${n}`,e)}},{immediate:!0});function a(t){r.value.includes(t)||r.value.push(t),f(`${e}/plugins/${t}/plugin.js`)}function s(e){let t=r.value.indexOf(e);t!==-1&&r.value.splice(t,1)}async function c(){let n=`${e}/plugins/list`;t.value=await fetch(n).then(e=>e.json())}return{availPlugins:t,appliedPlugins:r,refreshList:c,enablePlugin:a,disablePlugin:s}})}));export{m as n,h as r,g as t};