import{aR as a}from"./main-tangy-colts-beg.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,s){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,s),s)}};const n=()=>a("pro_fluent-cart/customers",void 0,void 0,"GET"),i=()=>a("pro_fluent-cart/products",void 0,void 0,"GET"),c=()=>a("pro_fluent-cart/product-categories",void 0,void 0,"GET"),r=()=>a("pro_fluent-cart/product-brands",void 0,void 0,"GET"),u=()=>a("pro_fluent-cart/shipping-class",void 0,void 0,"GET");globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,s){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,s),s)}};const d=async e=>{e.setComponent("customers",t=>{t.loading=!0});const{data:s,status:o}=await n();if(o==="error"){e.setComponent("customers",t=>{e.util.isSelectComponent(t)&&(t.status=o,t.loading=!1,t.invalidMessage=s)});return}e.setComponent("customers",t=>{e.util.isSelectComponent(t)&&(t.options=s,t.loading=!1,t.status=void 0)})},g=async e=>{e.setComponent("product-map",o=>{o.loading=!0});const{data:s}=await i();e.setComponent("product-map",o=>{if(!e.util.isRepeaterFieldComponent(o))return;const t=o.fieldsMetaData[0];t.options=s,o.loading=!1})},f=async e=>{e.setComponent("product-categories",t=>{t.loading=!0});const{data:s,status:o}=await c();if(o==="error"){e.setComponent("product-categories",t=>{e.util.isSelectComponent(t)&&(t.status=o,t.loading=!1,t.invalidMessage=s)});return}e.setComponent("product-categories",t=>{e.util.isSelectComponent(t)&&(t.options=s,t.loading=!1,t.status=void 0)})},p=async e=>{e.setComponent("product-brands",t=>{t.loading=!0});const{data:s,status:o}=await r();if(o==="error"){e.setComponent("product-brands",t=>{e.util.isSelectComponent(t)&&(t.status=o,t.loading=!1,t.invalidMessage=s)});return}e.setComponent("product-brands",t=>{e.util.isSelectComponent(t)&&(t.options=s,t.loading=!1,t.status=void 0)})},h=async e=>{e.setComponent("shipping-class",t=>{t.loading=!0});const{data:s,status:o}=await u();if(o==="error"){e.setComponent("shipping-class",t=>{e.util.isSelectComponent(t)&&(t.status=o,t.loading=!1,t.invalidMessage=s)});return}e.setComponent("shipping-class",t=>{e.util.isSelectComponent(t)&&(t.options=s,t.loading=!1,t.status=void 0)})};export{d as a,h as b,f as c,p as d,g as f};
