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