1import{u as U,r as a,j as e,S as _}from"./index-CiU28txl.js";import{C as K,R as q}from"./ContentPreviewDrawer-Bd73RjBq.js";const k={de:{title:"Rezepte",subtitle:"14'000+ Rezepte mit KI-Enrichment â Targeting-Signale für Agentic Commerce",searchPlaceholder:"Rezept suchen...",search:"Suchen",searching:"Suche...",allFilter:"Alle",filters:{cuisine:"Küche",meal:"Mahlzeit",difficulty:"Schwierigkeit",budget:"Budget",time:"Zeitaufwand",lang:"Sprache"},resultsOf:"von",results:"Rezepte",noResults:"Keine Rezepte gefunden.",loadMore:"Mehr laden",viewOriginal:"Original ansehen",targetingTitle:"Targeting-Signale",poweredBy:"Enriched by Nexbid AI â 10 Targeting-Dimensionen pro Rezept"},en:{title:"Recipes",subtitle:"14,000+ recipes with AI enrichment â targeting signals for agentic commerce",searchPlaceholder:"Search recipes...",search:"Search",searching:"Searching...",allFilter:"All",filters:{cuisine:"Cuisine",meal:"Meal Type",difficulty:"Difficulty",budget:"Budget",time:"Time",lang:"Language"},resultsOf:"of",results:"recipes",noResults:"No recipes found.",loadMore:"Load more",viewOriginal:"View original",targetingTitle:"Targeting Signals",poweredBy:"Enriched by Nexbid AI â 10 targeting dimensions per recipe"},fr:{title:"Recettes",subtitle:"14'000+ recettes enrichies par IA â signaux de ciblage pour le commerce agentique",searchPlaceholder:"Chercher une recette...",search:"Chercher",searching:"Recherche...",allFilter:"Toutes",filters:{cuisine:"Cuisine",meal:"Type de repas",difficulty:"Difficulté",budget:"Budget",time:"Temps",lang:"Langue"},resultsOf:"sur",results:"recettes",noResults:"Aucune recette trouvée.",loadMore:"Charger plus",viewOriginal:"Voir l'original",targetingTitle:"Signaux de ciblage",poweredBy:"Enrichi par Nexbid AI â 10 dimensions de ciblage par recette"},it:{title:"Ricette",subtitle:"14'000+ ricette arricchite dall'IA â segnali di targeting per il commercio agentivo",searchPlaceholder:"Cerca una ricetta...",search:"Cerca",searching:"Ricerca...",allFilter:"Tutte",filters:{cuisine:"Cucina",meal:"Tipo di pasto",difficulty:"Difficoltà ",budget:"Budget",time:"Tempo",lang:"Lingua"},resultsOf:"di",results:"ricette",noResults:"Nessuna ricetta trovata.",loadMore:"Carica altri",viewOriginal:"Vedi originale",targetingTitle:"Segnali di targeting",poweredBy:"Arricchito da Nexbid AI â 10 dimensioni di targeting per ricetta"}};function V({level:t}){const i={einfach:"bg-green-500/10 text-green-400",mittel:"bg-yellow-500/10 text-yellow-400",anspruchsvoll:"bg-red-500/10 text-red-400"};return e.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs font-medium ${i[t]??"bg-surface-sunken text-text-muted"}`,children:t})}function $(t){return{id:t.id,type:"recipe",title:t.title,description:t.description,imageUrl:t.imageUrl,sourceUrl:t.sourceUrl,prepTime:t.prepTime,cookTime:t.cookTime,totalTime:t.totalTime,servings:t.servings,cuisine:t.cuisine,rating:t.rating,ratingCount:t.ratingCount,dietaryTags:t.dietaryTags,targeting:t.targeting}}function H({recipe:t,t:i,onClick:c}){const l=t.targeting;return e.jsxs("div",{className:"group cursor-pointer rounded-lg border border-border-subtle/50 bg-surface-raised/50 p-4 transition hover:border-nexbid-600/30 hover:bg-surface-raised",onClick:c,role:"button",tabIndex:0,onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),c())},children:[t.imageUrl&&e.jsx("img",{src:t.imageUrl,alt:t.title,className:"mb-3 h-40 w-full rounded object-cover",loading:"lazy"}),e.jsxs("div",{className:"mb-2 flex items-start justify-between gap-2",children:[e.jsx("h3",{className:"text-sm font-semibold text-text-secondary line-clamp-2",children:t.title}),e.jsx("span",{className:"shrink-0 rounded bg-surface-overlay px-1.5 py-0.5 text-[10px] font-medium uppercase text-text-muted",children:t.language})]}),t.description&&e.jsx("p",{className:"mb-3 text-xs text-text-muted line-clamp-2",children:t.description}),e.jsxs("div",{className:"mb-3 flex flex-wrap gap-2 text-xs text-text-muted",children:[l?.difficulty&&e.jsx(V,{level:l.difficulty}),l?.time_category&&e.jsx("span",{className:"rounded-full bg-surface-overlay px-2 py-0.5",children:l.time_category}),l?.budget&&e.jsx("span",{className:"rounded-full bg-surface-overlay px-2 py-0.5",children:l.budget})]}),l&&e.jsxs("div",{className:"flex flex-wrap gap-1",children:[l.cuisine_style&&e.jsx("span",{className:"rounded bg-nexbid-500/10 px-1.5 py-0.5 text-[10px] text-nexbid-400",children:l.cuisine_style}),l.meal_type&&e.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:l.meal_type}),l.occasions?.slice(0,2).map(r=>e.jsx("span",{className:"rounded bg-purple-500/10 px-1.5 py-0.5 text-[10px] text-purple-400",children:r},r))]}),e.jsx(q,{recipeId:t.id,locale:"de",compact:!0}),e.jsxs("span",{className:"mt-3 block text-xs text-nexbid-500 opacity-0 transition group-hover:opacity-100",children:[i.viewOriginal," â"]})]})}function u({label:t,value:i,onChange:c,options:l,allLabel:r}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{className:"text-[10px] font-medium uppercase tracking-wider text-text-muted",children:t}),e.jsxs("select",{value:i,onChange:o=>c(o.target.value),className:"rounded-lg border border-border-subtle bg-surface-raised/50 px-3 py-1.5 text-xs text-text-secondary",children:[e.jsx("option",{value:"",children:r}),l.map(o=>e.jsxs("option",{value:o.value,children:[o.value," (",o.count,")"]},o.value))]})]})}function G(){const{locale:t}
1=U(),i=k[t]??k.en,[c,l]=a.useState(""),[r,o]=a.useState(""),[p,A]=a.useState(""),[f,E]=a.useState(""),[h,O]=a.useState(""),[b,z]=a.useState(""),[y,B]=a.useState(""),[j,S]=a.useState([]),[w,I]=a.useState(0),[T,C]=a.useState(0),[g,R]=a.useState(!1),[d,P]=a.useState(null),[v,F]=a.useState(null);a.useEffect(()=>{fetch("/api/recipes?stats=true").then(s=>s.ok?s.json():null).then(s=>{s&&P(s)}).catch(()=>null)},[]),a.useEffect(()=>{N(0)},[]);async function N(s){R(!0);const n=new URLSearchParams;c.trim()&&n.set("q",c.trim()),r&&n.set("cuisine",r),p&&n.set("meal",p),f&&n.set("difficulty",f),h&&n.set("budget",h),b&&n.set("time",b),y&&n.set("lang",y),n.set("limit","24"),n.set("offset",String(s));try{const x=await fetch(`/api/recipes?${n}`);if(!x.ok)throw new Error(`HTTP ${x.status}`);const m=await x.json();S(s===0?m.recipes:M=>[...M,...m.recipes]),I(m.total),C(s+m.recipes.length)}catch(x){console.error("Recipe search failed:",x)}finally{R(!1)}}function L(){C(0),N(0)}function D(s){s.preventDefault(),L()}return e.jsxs("div",{className:"mx-auto max-w-7xl px-4 pb-12 pt-24",children:[e.jsx(_,{title:"Rezepte",description:"14'000+ Rezepte mit KI-Enrichment â Targeting-Signale für Agentic Commerce.",path:"/rezepte"}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"mb-2 text-3xl font-bold text-text-secondary",children:i.title}),e.jsx("p",{className:"text-text-muted",children:i.subtitle})]}),e.jsxs("form",{onSubmit:D,className:"mb-6",children:[e.jsxs("div",{className:"mb-4 flex gap-3",children:[e.jsx("input",{type:"text",value:c,onChange:s=>l(s.target.value),placeholder:i.searchPlaceholder,className:"min-w-[200px] flex-1 rounded-lg border border-border-subtle bg-surface-raised/50 px-4 py-2 text-sm text-text-secondary placeholder:text-text-muted focus:border-nexbid-500 focus:ring-1 focus:ring-nexbid-500 focus:outline-none"}),e.jsx("button",{type:"submit",disabled:g,className:"rounded-lg bg-nexbid-600 px-6 py-2 text-sm font-medium text-white transition-colors hover:bg-nexbid-500 disabled:opacity-50",children:g?i.searching:i.search})]}),d&&e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsx(u,{label:i.filters.cuisine,value:r,onChange:s=>{o(s)},options:d.cuisineStyles,allLabel:i.allFilter}),e.jsx(u,{label:i.filters.meal,value:p,onChange:s=>{A(s)},options:d.mealTypes,allLabel:i.allFilter}),e.jsx(u,{label:i.filters.difficulty,value:f,onChange:s=>{E(s)},options:d.difficulties,allLabel:i.allFilter}),e.jsx(u,{label:i.filters.budget,value:h,onChange:s=>{O(s)},options:d.budgets,allLabel:i.allFilter}),e.jsx(u,{label:i.filters.time,value:b,onChange:s=>{z(s)},options:d.timeCategories,allLabel:i.allFilter}),e.jsx(u,{label:i.filters.lang,value:y,onChange:s=>{B(s)},options:d.languages.map(s=>({value:s.lang,count:s.count})),allLabel:i.allFilter}),e.jsx("div",{className:"flex items-end",children:e.jsx("button",{type:"button",onClick:L,className:"rounded-lg border border-nexbid-600 px-4 py-1.5 text-xs font-medium text-nexbid-400 transition hover:bg-nexbid-600/10",children:"Filter"})})]})]}),e.jsxs("p",{className:"mb-4 text-sm text-text-muted",children:[j.length," ",i.resultsOf," ",w.toLocaleString()," ",i.results]}),j.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:j.map(s=>e.jsx(H,{recipe:s,t:i,onClick:()=>F($(s))},s.id))}),T<w&&e.jsx("div",{className:"mt-8 text-center",children:e.jsx("button",{onClick:()=>N(T),disabled:g,className:"rounded-lg border border-border-subtle px-8 py-2 text-sm text-text-muted transition hover:border-border-default hover:text-text-secondary disabled:opacity-50",children:g?i.searching:i.loadMore})})]}):g?null:e.jsx("p",{className:"text-center text-text-muted",children:i.noResults}),e.jsx("div",{className:"mt-12 border-t border-border-subtle pt-6 text-center",children:e.jsx("p",{className:"text-xs text-text-muted",children:i.poweredBy})}),v&&e.jsx(K,{open:v!==null,onClose:()=>F(null),content:v,locale:t})]})}export{G as Component};
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.