1import{_ as M}from"./vbOd8O7M.js";import{d as D,u as B,q,r as L,z as x,e as p,v as P,f as S,c as u,m as t,p as y,t as s,l as e,F as z,C as T,h as R,k as V,w as j,_ as F,j as b,i as H,o as r}from"#entry";import{s as O}from"./Cys_x7Ek.js";import{u as U}from"./B29cEXwN.js";import"./bX8llkta.js";import"./DlAUqK2U.js";import"./BinvN-Tu.js";import"./B3TgFKA1.js";import"./EBWz68Us.js";import"./D3TkpJc1.js";const E={class:"bg-mono-200"},Q={class:"container max-w-screen-xl p-4 xl:px-0 pt-20 lg:pt-[90px]"},W={class:"font-primary font-average text-subtitle leading-[1.16] uppercase"},G={class:"mt-2 text-body-1 leading-[1.18] text-mono-500"},J={key:0,class:"text-center py-52"},K={class:"text-primary font-primary font-average text-h2 leading-[1.19] tracking-[-0.47px] uppercase"},X={key:1,class:"max-w-[500px] mx-auto text-center py-52"},Y={class:"text-primary font-primary font-average text-h2 leading-[1.19] tracking-[-0.47px] uppercase"},Z={class:"mt-2 text-body-1 leading-[1.21] tracking-[0.53px]"},ee={key:2},te={class:"pt-4 lg:pt-10"},ae={class:"flex flex-col gap-4 xl:flex-row xl:flex-wrap xl:gap-6"},se={class:"flex justify-center mt-6 md:mt-12 pb-4"},fe=D({__name:"search-results",setup(oe){const{t:a,locale:k}=B(),m=b(),{competitionSlug:l}=q(),h=b(),w=L(),d=x(0),_=x(!1),n=p(()=>w.query.search),C=()=>{d.value++,_.value=!0,g()},$=p(()=>{const{categoryIds:c}=h.public;return c[l.value]}),{data:o,refresh:g}=U(`searchResult-${l.value}`,async()=>{if(!n.value.trim())return{data:[],searchResultPage:d.value};const c={page:d.value,size:9,query:`NOT categories.id:${h.public.categoryIds.utility} AND ${n.value} AND categories.id:${$.value} AND language:${k.value}`},i=await O({params:c}),f=[..._.value&&o!==null?[...o.value?.data]:[],...i.data?.articles];return _.value=!1,{data:f,searchResultMeta:i.metadata,searchResultPage:d.value}}),A=p(()=>{const c=o?.value?.data?.length||0,i=+(o?.value?.searchResultMeta?.totalItems||0);return c<i});P(n,()=>{g()},{immediate:!0});const I=p(()=>H({title:`${a("Search Results")} | ${m.public.meta[l.value].suffix}`,description:a(m.public.meta[l.value].description.default),image:m.public.meta[l.value].image},""));return S(I),(c,i)=>{const f=M,N=F;return r(),u("div",E,[t("div",Q,[t("div",W,[y(s(e(a)("Search Results for"))+" ",1),t("span",null,"â"+s(e(n))+"â",1)]),t("div",G,s(e(o)?.searchResultMeta?.totalItems||0)+" "+s(e(a)("Results")),1),e(n)?e(o)?.data?.length?(r(),u("div",ee,[t("div",te,[t("div",ae,[(r(!0),u(z,null,T(e(o).data,v=>(r(),R(f,{key:v.id,article:v,class:"basis-full xl:basis-[calc((100%-48px)/3)] shadow-md"},null,8,["article"]))),128))]),t("div",se,[e(A)?(r(),R(N,{key:0,onClick:C},{default:j(()=>[y(s(e(a)("Load More")),1)]),_:1})):V("",!0)])])])):(r(),u("div",X,[t("div",Y,s(e(a)("No Results")),1),t("div",Z,s(e(a)("We couldn't find what you were looking for. Try a different search.")),1)])):(r(),u("div",J,[t("h1",K,s(e(a)("Please enter query")),1)]))])])}}});export{fe 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.