PageSourceSearch

https://www.foodboom.de/_nuxt/BJvRXfir.js

js foodboom.de collected 2026-09-24 22:23:36 UTC 3,684 bytes, 1 lines download raw bytes

1import{d as N,aj as S,u as j,i as B,X as T,w as $,c as b,j as K,O as M,o as l,H as r,L as d,e as t,f as h,J as y,K as x,Z as I,F as C,ar as O,aq as V,g as _,P as p,l as z,am as G}from"./D2ahkyPq.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};i.SENTRY_RELEASE={id:"e42604355e94feb1bc2c4427bdbce0c38b55293b"};var g=new i.Error().stack;g&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[g]="ba62a11f-a965-4b91-85cc-7d0fd96dd39a",i._sentryDebugIdIdentifier="sentry-dbid-ba62a11f-a965-4b91-85cc-7d0fd96dd39a")}catch{}})();const J={class:"mt-8"},Q={class:"fb-search flex items-center mt-4 overflow-x-auto"},X=["onClick"],Y={id:"recipes",class:"mt-8"},Z={class:"mr-2"},U={key:0,class:"flex justify-center"},te=N({__name:"search",async setup(i){let g,m;const{t:n}=S(),w=j(),{convertAlgoliaObject:R,searchDocuments:A}=B(),f=p(""),a=p({page:1,itemsPerPage:12,index:["Recipe"],filters:""}),c=p({totalHits:0,totalPages:0}),v=p(!1),o=p([]),q={Recipe:{title:n("search.resultIndices.PublicRecipe")},CollectionArticle:{title:n("search.resultIndices.PublicCollectionArticle")},KitchenKnowledgeArticle:{title:n("search.resultIndices.PublicKitchenKnowledgeArticle")},ReadingArticle:{title:n("search.resultIndices.PublicReadingArticle")},Page:{title:n("search.resultIndices.PublicPage")}},H=z(()=>a.value.page*a.value.itemsPerPage<c.value.totalHits);T(()=>w.query,()=>k());const k=async(e=!1)=>{if(f.value=G(w.query,"q",""),e?a.value.page++:E(),!f.value)return;const{results:u}=await A({query:f.value,indices:a.value.index,hitsPerPage:a.value.itemsPerPage,page:a.value.page,filters:a.value.filters});u[0].hits.forEach(s=>{o.value.push(L(R(s)))}),c.value.totalHits=u[0].nbHits,c.value.totalPages=u[0].nbPages},E=()=>{o.value=[],a.value.page=1,c.value.totalHits=0,c.value.totalPages=0},D=e=>a.value.index[0]===e,F=e=>{a.value.index[0]!==e&&(a.value.index[0]=e,v.value=!0,k(),v.value=!1)},L=e=>({kind:e.kind||a.value.index[0],title:e.title,slug:e.slug,image:e.headerImageMobile||e.headerImage,kicker:e.kickerName||"",isAd:e.isAd,aggregatedRating:e.aggregatedRating||0,ratingCount:e.ratingCount||0});return[g,m]=$(()=>k()),await g,m(),(e,u)=>(l(),b(M,null,{default:K(()=>[r("h1",J,d(t(n)("search.header")),1),r("div",Q,[(l(),h(y,null,x(q,(s,P)=>r("button",{key:P,class:I(["mr-6 last:mr-0 whitespace-nowrap focus:outline-none",{"font-bold":D(P)}]),onClick:W=>F(P)},d(s.title),11,X)),64))]),t(v)?(l(),b(C,{key:0,class:"mx-auto"})):!t(f)||!t(o).length?(l(),b(O,{key:1,class:"mt-8",query:t(f),"show-query-not-found":"","show-random-recipe":""},null,8,["query"])):(l(),h(y,{key:2},[t(o).length?(l(),h(y,{key:0},[r("h2",Y,d(t(n)(`search.resultIndices.Public${t(a).index[0]}`)),1),r("p",null,[r("b",Z,d(t(c).totalHits),1),r("span",null,d(t(n)("search.totalHits")),1)]),r("div",{class:I(["mt-8 grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-x-2 gap-y-4 sm:gap-x-4 sm:gap-y-8",`fb-search-results-${t(a).index[0].toLowerCase()}`])},[t(o).length?(l(!0),h(y,{key:0},x(t(o),s=>(l(),b(V,{key:s.slug,kind:s.kind,title:s.title,slug:s.slug,image:s.image,kicker:s.kickerName||s.kicker||"","is-ad":!!s.isAd,"rating-count":s.ratingCount,"aggregated-rating":s.aggregatedRating},null,8,["kind","title","slug","image","kicker","is-ad","rating-count","aggregated-rating"]))),128)):_("",!0),t(v)?(l(),b(C,{key:1,class:"mx-auto col-span-full"})):_("",!0)],2),t(o).length&&t(H)?(l(),h("div",U,[r("button",{class:"my-12 font-bold uppercase text-base md:text-lg border-b-3 border-black focus:outline-none",onClick:u[0]||(u[0]=s=>k(!0))},d(t(n)("recipes.loadMore")),1)])):_("",!0)],64)):_("",!0)],64))]),_:1}))}});export{te 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.