1import{_ as j}from"./SQvLma5_.js";import{_ as q}from"./D84xlgyt.js";import{_ as A}from"./B5eOhoWX.js";import{a as D}from"./DZzzsyWz.js";import{_ as G}from"./D7-5rZqu.js";import{_ as J}from"./cYNDVzUy.js";import{u as R}from"./BQe-uZ8M.js";import{e as T,f as W,W as Y,Y as z,P as b,i as K,E as Q,l as k,u as X,c as C,s as B,b as v,a as L,g as a,w as E,q as H,F as U,H as Z,o as i,r as ee}from"./BwpL3H6q.js";import{u as te}from"./C1rTX9M1.js";import"./Dd6rXT-4.js";import"./BwxRlocT.js";import"./DxFXXgQV.js";const ae={key:0,class:"container mb-6"},ne=["srcset"],ve=T({__name:"[category]",async setup(oe){var S;let l,N;const{t:re}=W(),o=Y(),I=Number(o.query.page||1),{apiFetch:M}=z(),V=b("categories"),t=K(()=>V.value.find(e=>e.slug===String(o.params.category))),{data:w}=([l,N]=Q(()=>Z(`categories/${o.params.category}/offers`,{page:I})),l=await l,N(),l),O=b(`categories-${o.params.category}-offers-page`,()=>{var e;return I+((e=w.value)!=null&&e.length?1:0)}),m=b(`categories-${o.params.category}-offers-list`,()=>w.value??[]),u=k(!1),$=k((((S=w.value)==null?void 0:S.length)??0)>0),P=k(null);R(P,async()=>{if(!(u.value||!$.value)){u.value=!0;try{const e=await M(`categories/${o.params.category}/offers`,{page:O.value});e.length>0?(m.value.push(...e),O.value++):$.value=!1}catch(e){console.error(e)}finally{u.value=!1}}},{distance:50});const x=te();return X(()=>{var _,f,d,y;const e=((_=t.value)==null?void 0:_.name)??"",p=(f=t.value)!=null&&f.description?t.value.description.slice(0,160).replace(/<[^>]*>/g,"").trim():"",g=((d=t.value)==null?void 0:d.image)??`${x}/og/default-1.jpg`,s=`${x}/categories/${((y=t.value)==null?void 0:y.slug)??o.params.category}`;return{title:e,link:[{rel:"canonical",href:s}],meta:[{name:"description",content:p},{property:"og:title",content:e},{property:"og:description",content:p},{property:"og:image",content:g},{property:"og:url",content:s},{property:"og:type",content:"CollectionPage"},{name:"twitter:card",content:"summary_large_image"},{name:"twitter:title",content:e},{name:"twitter:description",content:p},{name:"twitter:image",content:g}],script:[{type:"application/ld+json",innerHTML:JSON.stringify({"@context":"https://schema.org","@type":"CollectionPage",name:e,url:s,mainEntity:{"@type":"ItemList",numberOfItems:m.value.length,itemListElement:m.value.slice(0,12).map((r,h)=>{var c,n,F;return{"@type":"ListItem",position:h+1,item:{"@type":"Product",name:((c=r.product)==null?void 0:c.name)||r.name,url:`${x}/offers/${(F=(n=r.product)==null?void 0:n.provider)==null?void 0:F.slug}/${r.slug}`}}})}})}]}}),(e,p)=>{var r,h,c;const g=j,s=q,_=A,f=D,d=G,y=J;return i(),C(U,null,[(r=a(t))!=null&&r.banner?(i(),C("div",ae,[v(s,{to:a(t).url,class:"block"},{default:E(()=>{var n;return[L("picture",null,[L("source",{media:"(min-width:768px)",srcset:a(t).banner},null,8,ne),v(g,{src:((n=a(t))==null?void 0:n.smartphone_banner)||a(t).banner,class:"w-full rounded-lg",loading:"eager",fetchpriority:"high"},null,8,["src"])])]}),_:1},8,["to"])])):B("",!0),v(_,{msg:(h=a(t))==null?void 0:h.name,description:(c=a(t))==null?void 0:c.description},null,8,["msg","description"]),v(d,null,{default:E(()=>[(i(!0),C(U,null,ee(a(m),n=>(i(),H(f,{key:n.id,data:n},null,8,["data"]))),128))]),_:1}),L("div",{ref_key:"target",ref:P,class:"w-full py-4 text-center"},[a(u)&&a($)?(i(),H(y,{key:0})):B("",!0)],512)],64)}}});export{ve 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.