1import{as as p,dC as c,u as m,dD as g,dH as y,H as u,dF as o,a6 as h,dI as A,dG as b}from"./CYRhJ6we.js";function f(t){return t==null?[]:!Array.isArray(t)||!t?.length?[]:t.filter(p).map(e=>({name:e.component,isAvailable:e.enabled}))}const B=c(async t=>{let e,s;const i=m(),{data:d,error:r}=([e,s]=g(()=>i.$apollo.default.query({query:y})),e=await e,s(),e);if(r)return u.error("[%s] (%s) Check apollo logs to see what went wrong. Error: %s",new Date().toLocaleString(),"category.ts (middleware)",r.message),o({statusCode:500,statusMessage:"Could not retrieve components availability for basket. Check logs."});if(!f(d.shop_getComponentsAvailability).find(a=>a.name==="BASKET"&&a.isAvailable))return o({statusCode:404,message:"Basket is not available"});if(t.path.includes(h.BASKET)){const{data:a,error:l}=([e,s]=g(()=>i.$apollo.default.query({query:A})),e=await e,s(),e);if(l)return u.error("[%s] (%s) Check apollo logs to see what went wrong. Error: %s",new Date().toLocaleString(),"category.ts (middleware)",l.message),o({statusCode:500,statusMessage:"Could not retrieve shopping possibility toggles for basket. Check logs"});if(!b(a.shop_shoppingPossibilityToggles).find(n=>n.name==="BASKET"&&n.isActivated))return o({statusCode:404,message:"Basket deactivated"})}});
1export{B as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.