import{u as d,a7 as p}from"./BDl4c6dV.js";import{k as f,a as v,b as P}from"./DGQDO-VU.js";const L=()=>{const c=d(),l=f(()=>{var s,e,t;return(t=(e=(s=c.fullPath)==null?void 0:s.replaceAll("/"," "))==null?void 0:e.trim())==null?void 0:t.replaceAll(" ","/")}),{list:g,fetchByQuery:h}=p(`page|productListPage-${l.value}`),r=v(!1),o=async()=>{r.value=!0,await h({"fields.pageType[in]":["Content","Product List Page"],"fields.slug":l.value,limit:100},3),r.value=!1},m=f(()=>{var s;return((s=(g.value||[]).filter(e=>{var a;const t=new URLSearchParams(e.fields.slug.substring(l.value.length+1));for(const[u,n]of t.entries())if(((a=c.query)==null?void 0:a[u])!==n)return!1;return!0}).sort((e,t)=>{var a,u,n,i;return(((a=t.fields.slug.match(/\?/g))==null?void 0:a.length)||0)+(((u=t.fields.slug.match(/&/g))==null?void 0:u.length)||0)-(((n=e.fields.slug.match(/\?/g))==null?void 0:n.length)||0)-(((i=e.fields.slug.match(/&/g))==null?void 0:i.length)||0)}))==null?void 0:s[0])||null});return P(l,()=>{o()}),{data:m,fetchContent:o,fetching:r}};export{L as u};