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