import{aR as a}from"./main-tangy-colts-beg.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(s,e){return this.cache.has(s)?this.cache.get(s):(this.cache.set(s,e),e)}};const i=()=>a("pro_mailerpress/lists",void 0,void 0,"GET"),n=()=>a("pro_mailerpress/tags",void 0,void 0,"GET");globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(s,e){return this.cache.has(s)?this.cache.get(s):(this.cache.set(s,e),e)}};const c=async s=>{s.setComponent("lists",t=>{t.loading=!0});const{data:e,status:o}=await i();if(o==="error"){s.setComponent("lists",t=>{s.util.isSelectComponent(t)&&(t.status=o,t.loading=!1,t.invalidMessage=e)}),console.error("Failed to fetch lists");return}s.setComponent("lists",t=>{s.util.isSelectComponent(t)&&(t.options=e,t.loading=!1,t.status=void 0)})},r=async s=>{s.setComponent("tags",t=>{t.loading=!0});const{data:e,status:o}=await n();if(o==="error"){s.setComponent("tags",t=>{s.util.isSelectComponent(t)&&(t.status=o,t.loading=!1,t.invalidMessage=e)}),console.error("Failed to fetch tags");return}s.setComponent("tags",t=>{s.util.isSelectComponent(t)&&(t.options=e,t.loading=!1,t.status=void 0)})};export{r as a,c as f};
