PageSourceSearch

https://www.karispizza.fi/assets/RestaurantsDiscoveryPage-aee5f5c7.js

js karispizza.fi collected 2026-10-03 02:47:34 UTC 28,534 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-radix-08a60bdd.js";import{x as s,N as t,a6 as r,n as l,H as a,aa as n,K as i}from"./index-06245da3.js";import{u as o,r as c,L as d}from"./vendor-react-9016e4a2.js";import{u as x}from"./useLogoBackground-fd2af2c5.js";import{A as m}from"./AuthDialog-29fb468d.js";import{P as u}from"./PublicFooter-37632202.js";import{i as p,m as g}from"./workingHours-30e52d5c.js";import{J as f,aE as h,o as y,u as b,ae as v,bf as j,a7 as N,bw as w,bx as F,by as _}from"./vendor-icons-f2656d21.js";import"./vendor-supabase-36eb0853.js";import"./vendor-capacitor-43d743f6.js";import"./vendor-motion-a26fe6c4.js";import"./esm-bccdeced.js";import"./customerProfileService-80af6183.js";import"./addressService-7ed92d4c.js";const k="#FF5200",S="discovery_view_mode";function C(e){const s=Number(e||0);return s?`€${s%1==0?s:s.toFixed(2)}`:null}function M(e){const s=(Array.isArray(e.delivery_settings?.tiers)?e.delivery_settings.tiers:[]).map(e=>Number(e?.fee)).filter(e=>Number.isFinite(e));return s.length?Math.min(...s):null}function B(e){if(!e)return 1/0;const s=String(e).match(/\d+/);return s?Number(s[0]):1/0}function P({restaurant:s,language:t,t:r,onOpen:l,th:a,viewMode:o,index:c=0}){const d=n(s.header_image_url,900),m=s.logo_url?n(s.logo_url,160):null,u=x(m),p=u||"#FFFFFF",g=C(s.minimum_order_amount),f=M(s),h=0===f,y=h?r("discovery.free"):null!==f?C(f):null,b=Number(s.rating||0),v=s.review_count||null,j=!s.isOpen,w=!j&&Boolean(s.deliveryClosed),F=(()=>{const e=e=>e.toLowerCase().replace(/&apos;|&#0?39;/g,"'").trim(),t=(s.short_description||"").trim(),r=e(s.name).split(/\s+/).filter(Boolean),l=e(t).split(/\s+/).filter(Boolean),a=r.length>0&&r.every((e,s)=>{const t=l[s];return Boolean(t)&&((e,s)=>{let t=0;for(;t<e.length&&t<s.length&&e[t]===s[t];)t+=1;return t>=Math.max(3,Math.min(e.length,s.length)-2)})(e,t)});if(t&&!a){const e=t.split(/\s+/).filter(Boolean);if(e.length>0){const s=e.slice(0,4).join(" ");return e.length>4?`${s}…`:s}}return s.city||null})(),_={animationDelay:45*Math.min(c,11)+"ms"};return"list"===o?e.jsxs("button",{type:"button",onClick:l,className:"disco-card group text-left w-full rounded-2xl overflow-hidden border flex gap-3 p-3 items-center transition-all duration-200 hover:-translate-y-0.5 hover:shadow-[0_6px_18px_rgba(0,0,0,0.07)] dark:hover:shadow-[0_6px_18px_rgba(0,0,0,0.4)] active:scale-[0.99] focus:outline-none focus-visible:ring-2 focus-visible:ring-[#FF5200]",style:{background:a.cardBg,borderColor:a.border,..._},children:[e.jsxs("div",{className:"w-[78px] h-[78px] rounded-2xl shrink-0 relative overflow-hidden flex items-center justify-center",style:{background:d?"#000":a.fallbackImg},children:[d&&e.jsx("img",{src:d,alt:"",className:i("absolute inset-0 w-full h-full object-cover opacity-80",j&&"grayscale opacity-50"),loading:"lazy"}),e.jsx("div",{className:i("relative w-12 h-12 rounded-full overflow-hidden flex items-center justify-center border",j&&"grayscale"),style:{background:p,borderColor:u||a.logoCircleBorder},children:m?e.jsx("img",{src:m,alt:s.name,className:"w-full h-full object-contain p-0.5"}):e.jsx("span",{className:"text-[18px] font-bold leading-none",style:{color:a.textPrimary},children:s.name[0]})})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[15px] font-bold truncate",style:{color:a.textPrimary},children:s.name}),e.jsx("div",{className:"flex items-center gap-1.5 mt-0.5",children:b>0?e.jsxs(e.Fragment,{children:[e.jsx(N,{className:"w-3.5 h-3.5 fill-[#FFB800] text-[#FFB800]"}),e.jsx("span",{className:"text-[12px] font-bold",style:{color:a.textPrimary},children:b.toFixed(1)}),v&&e.jsxs("span",{className:"text-[11px]",style:{color:a.textSecondary},children:["(",v,")"]})]}):e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.08em] px-1.5 py-0.5 rounded-md",style:{background:`${k}1A`,color:k},children:r("discovery.newBadge")})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-0.5 mt-1 text-[11px]",style:{color:a.textSecondary},children:[j&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-semibold uppercase tracking-[0.06em] text-[10px]",children:r("discovery.closedForNow")}),e.jsx("span",{children:"·"})]}),e.jsx("span",{children:s.delivery_time_text||r("discovery.defaultDeliveryTime")}
1),y&&e.jsx("span",{children:"·"}),y&&e.jsx("span",{className:i(h&&"font-bold"),style:h?{color:k}:void 0,children:y}),w&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{className:"font-semibold",style:{color:a.warn},children:r("discovery.deliveryClosedNow")})]}),null!=s.distanceKm&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[s.distanceKm," km"]})]})]})]})]}):e.jsxs("button",{type:"button",onClick:l,className:"disco-card group text-left w-full rounded-2xl lg:rounded-[20px] overflow-hidden border transition-all duration-200 hover:-translate-y-1 lg:hover:shadow-[0_10px_28px_rgba(0,0,0,0.09)] dark:lg:hover:shadow-[0_10px_28px_rgba(0,0,0,0.45)] hover:border-[#FF5200]/50 active:scale-[0.99] focus:outline-none focus-visible:ring-2 focus-visible:ring-[#FF5200]",style:{background:a.cardBg,borderColor:a.border,..._},children:[e.jsxs("div",{className:"relative aspect-[5/3] lg:aspect-auto lg:h-[164px] w-full overflow-hidden flex items-center justify-center",style:{background:d?"#000":a.fallbackImg},children:[d&&e.jsx("img",{src:d,alt:"",className:i("absolute inset-0 w-full h-full object-cover transition-transform duration-500 group-hover:scale-105",j&&"grayscale opacity-60"),loading:"lazy"}),e.jsx("div",{className:"absolute inset-0",style:{background:a.cardOverlay}}),j&&e.jsx("span",{className:"absolute top-2.5 left-2.5 z-10 px-2.5 py-1 rounded-full text-[10px] lg:text-[11px] font-bold text-white",style:{background:"rgba(10,10,10,0.72)",backdropFilter:"blur(4px)"},children:r("discovery.closedForNow")}),e.jsx("div",{className:i("relative w-16 h-16 lg:w-[72px] lg:h-[72px] rounded-full overflow-hidden flex items-center justify-center border shadow-lg",j&&"grayscale"),style:{background:p,borderColor:u||a.logoCircleBorder},children:m?e.jsx("img",{src:m,alt:s.name,className:"w-full h-full object-contain p-0.5"}):e.jsx("span",{className:"text-[26px] lg:text-[28px] font-bold leading-none",style:{color:a.textPrimary},children:s.name[0]})})]}),e.jsxs("div",{className:"px-3 pt-2.5 pb-3 lg:px-[18px] lg:pt-[14px] lg:pb-[18px]",children:[e.jsxs("div",{className:"lg:hidden",children:[e.jsx("div",{className:"text-[14px] font-bold truncate leading-tight",style:{color:a.textPrimary},children:s.name}),e.jsx("div",{className:"flex items-center gap-1 mt-1.5",children:b>0?e.jsxs(e.Fragment,{children:[e.jsx(N,{className:"w-3 h-3 fill-[#FFB800] text-[#FFB800]"}),e.jsx("span",{className:"text-[11px] font-bold",style:{color:a.textPrimary},children:b.toFixed(1)}),v&&e.jsxs("span",{className:"text-[10px]",style:{color:a.textSecondary},children:["(",v,")"]})]}):e.jsx("span",{className:"text-[9px] font-bold uppercase tracking-[0.08em] px-1.5 py-0.5 rounded-md",style:{background:`${k}1A`,color:k},children:r("discovery.newBadge")})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-1 gap-y-0.5 text-[10px] mt-1",style:{color:a.textSecondary},children:[e.jsx("span",{className:"whitespace-nowrap",children:s.delivery_time_text||r("discovery.defaultDeliveryTime")}),y&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{className:i("whitespace-nowrap",h&&"font-bold"),style:h?{color:k}:void 0,children:y})]}),w&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{className:"whitespace-nowrap font-semibold",style:{color:a.warn},children:r("discovery.deliveryClosedNow")})]})]}),e.jsxs("div",{className:"flex gap-1 mt-2",children:[F&&e.jsx("span",{className:"text-[9px] font-medium px-1.5 py-0.5 rounded inline-block max-w-[140px] truncate align-middle",style:{background:a.surfaceMuted,color:a.textSecondary},children:F}),g&&e.jsxs("span",{className:"text-[9px] font-medium px-1.5 py-0.5 rounded",style:{background:a.surfaceMuted,color:a.textSecondary},children:["Min ",g]})]})]}),e.jsxs("div",{className:"hidden lg:block",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[e.jsx("div",{className:"text-[17px] font-bold leading-tight tracking-[-0.01em] min-w-0 truncate",style:{color:a.textPrimary},children:s.name}),b>0?e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.jsx(N,{className:"w-[13px] h-[13px] fill-[#FFB800] text-[#FFB800]"}),e.jsx("span",{className:"text-[13px] font-bold",style:{color:a.textPrimary},children:b.toFixed(1)}),v&&e.jsxs("span",{className:"text-[12px]",style:{color:a.textSecondary},children:["(",v,")"]})]}):e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.08em] px-2 py-0.5 rounded-md shrink-0",style:{background:`${k}1A`,color:k},children:r("discovery.newBadge")})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[13px] mb-2.5",style:{color:a.textSecondary},children:[e.jsx("span",{className:"whitespace-nowrap",children:s.delivery_time_text||r("discovery.defaultDeliveryTime")}
1),y&&e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsx("span",{className:i("whitespace-nowrap",h&&"font-bold"),style:h?{color:k}:void 0,children:h?r("discovery.freeDelivery"):y})]}),w&&e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsx("span",{className:"whitespace-nowrap font-semibold",style:{color:a.warn},children:r("discovery.deliveryClosedNow")})]}),null!=s.distanceKm&&e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsxs("span",{className:"whitespace-nowrap",children:[s.distanceKm," km"]})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[F&&e.jsx("span",{className:"text-[11px] font-medium px-2.5 py-1 rounded-lg inline-block max-w-[220px] truncate align-middle",style:{background:a.surfaceMuted,color:a.textSecondary},children:F}),g&&e.jsxs("span",{className:"text-[11px] font-medium px-2.5 py-1 rounded-lg",style:{background:a.surfaceMuted,color:a.textSecondary},children:["Min ",g]})]})]})]})]})}function D(){const x=o(),{t:D,language:A}=s(),{user:$}=t(),[E,O]=c.useState(!1),[z,I]=c.useState([]),[K,q]=c.useState(!0),[L,T]=c.useState(null),[Y,H]=c.useState(""),[J,R]=c.useState("all"),[U,G]=c.useState(null),[W,Q]=c.useState(null),[V,X]=c.useState(()=>"undefined"==typeof window?"grid":localStorage.getItem(S)||"grid"),{isDark:Z}=r(),ee=c.useMemo(()=>function(e){return e?{bg:"#0A0A0A",surface:"#161616",surfaceMuted:"#1A1A1A",border:"#222",textPrimary:"#F5F5F5",textSecondary:"#888",cardBg:"#161616",cardOverlay:"linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.55) 100%)",fallbackImg:"linear-gradient(135deg, #2c1c16 0%, #1a0e08 100%)",logoCircleBg:"#FFFFFF",logoCircleBorder:"#2a2a2a",warn:"#F5A623"}:{bg:"#FAFAF8",surface:"#FFFFFF",surfaceMuted:"#F0F0EE",border:"#EFEFEF",textPrimary:"#1A1A1A",textSecondary:"#777",cardBg:"#FFFFFF",cardOverlay:"linear-gradient(180deg, rgba(0,0,0,0.0) 0%, rgba(0,0,0,0.35) 100%)",fallbackImg:"linear-gradient(135deg, #FFE8D9 0%, #FFD5BD 100%)",logoCircleBg:"#FFFFFF",logoCircleBorder:"#EFEFEF",warn:"#C77700"}}(Z),[Z]);c.useEffect(()=>{if("undefined"==typeof window)return;const e=localStorage.getItem("discovery_user_location");if(e)try{const s=JSON.parse(e);Number.isFinite(s?.latitude)&&Number.isFinite(s?.longitude)&&G(s)}catch{localStorage.removeItem("discovery_user_location")}},[]),c.useEffect(()=>{"undefined"!=typeof window&&localStorage.setItem(S,V)},[V]),c.useEffect(()=>{let e=!1;return(async()=>{q(!0),T(null);const{data:s,error:t}=await l.from("restaurants").select("id, name, secret_url, rating, short_description, header_image_url, logo_url, delivery_time_text, is_accepting_orders, status, working_hours, timezone, minimum_order_amount, address, city, zip_code, delivery_settings, delivery_radius_km, delivery_cutoff_minutes, latitude, longitude, hide_from_discovery:settings->>hide_from_discovery").eq("status","active").or("account_status.is.null,account_status.neq.suspended").order("name");if(e)return;if(t)return T(t.message),I([]),void q(!1);const r=(s||[]).filter(e=>{return e.secret_url&&!((s=e)&&"object"==typeof s&&"true"===String(s.hide_from_discovery??"").trim().toLowerCase());var s}).map(e=>({...e,isOpen:p(e.working_hours,e.timezone),deliveryClosed:!!e.delivery_cutoff_minutes&&(g(e.working_hours,e.timezone)??1/0)<=Number(e.delivery_cutoff_minutes)})).sort((e,s)=>e.isOpen!==s.isOpen?e.isOpen?-1:1:Boolean(e.is_accepting_orders)!==Boolean(s.is_accepting_orders)?e.is_accepting_orders?-1:1:Number(s.rating||0)-Number(e.rating||0));I(r),q(!1)})(),()=>{e=!0}},[]),c.useEffect(()=>{if(!$?.id)return void Q(null);let e=!1;return(async()=>{const{data:s,error:t}=await l.from("orders").select("id, total_amount, total_price, created_at, status, restaurant_id, order_items(quantity, menu_items(name)), restaurants(name, secret_url, logo_url)").eq("user_id",$.id).neq("status","cancelled").order("created_at",{ascending:!1}).limit(1);if(e)return;if(t||!s||0===s.length)return void Q(null);const r=s[0];r.restaurants?.secret_url?Q(r):Q(null)})(),()=>{e=!0}},[$?.id]);const se=c.useMemo(()=>z.map(e=>{const s=function(e,s){if(!e||!Number.isFinite(Number(s?.latitude))||!Number.isFinite(Number(s?.longitude)))return null;const t=e=>Number(e)*Math.PI/180,r=t(Number(s.latitude)-Number(e.latitude)),l=t(Number(s.longitude)-Number(e.longitude)),a=Math.sin(r/2)**2+Math.cos(t(e.latitude))*Math.cos(t(s.latitude))*Math.sin(l/2)**2;return Number((12742*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))).toFixed(1))}(U,e);return{...e,distanceKm:s,isNearby:null!==s&&s<=35}}),[z,U]),te=c.useMemo(()=>{const e=[{id:"all",label:D("discovery.cat.all")},{id:"popular",label:D("discovery.cat.popular")},{id:"free_delivery",label:D("discovery.cat.freeDelivery")},{id:"fastest",label:D("discovery.cat.fastest")},{id:"open_now",label:D("discovery.cat.openNow")}];return U&&e.splice(1,0,{id:"nearby",label:D("discovery.cat.nearby")}),e},[U,D]),re=c.useMemo(()=>{const e=Y.trim().toLowerCase();let s=se.filter(s=>
1!e||[s.name,s.city,s.short_description].filter(Boolean).join(" ").toLowerCase().includes(e));return"nearby"===J?s=U?s.filter(e=>e.isNearby).sort((e,s)=>(e.distanceKm??999)-(s.distanceKm??999)):s:"popular"===J?s=[...s].sort((e,s)=>Number(s.rating||0)-Number(e.rating||0)):"free_delivery"===J?s=s.filter(e=>0===M(e)):"fastest"===J?s=[...s].sort((e,s)=>B(e.delivery_time_text)-B(s.delivery_time_text)):"open_now"===J&&(s=s.filter(e=>e.isOpen)),s},[se,Y,J,U]),le=c.useMemo(()=>"all"!==J?null:se.find(e=>e.isOpen&&e.is_accepting_orders&&Number(e.rating||0)>=4.5)||null,[se,J]),ae=(ne=(new Date).getHours())<12?"morning":ne<17?"afternoon":"evening";var ne;const ie=$?.user_metadata?.first_name||$?.user_metadata?.full_name?.split(" ")[0]||$?.email?.split("@")[0]||null,oe="all"===J?D("discovery.allRestaurants"):te.find(e=>e.id===J)?.label;return e.jsxs(e.Fragment,{children:[e.jsxs(a,{children:[e.jsx("title",{children:D("discovery.pageTitle")}),e.jsx("meta",{name:"description",content:D("discovery.pageDescription")})]}),e.jsx("style",{children:"\n        @keyframes discoFadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }\n        .disco-card { animation: discoFadeUp 0.45s cubic-bezier(0.21, 0.61, 0.35, 1) both; }\n        .no-scrollbar::-webkit-scrollbar { display: none; }\n        @media (prefers-reduced-motion: reduce) { .disco-card { animation: none; } }\n      "}),e.jsxs("div",{className:"min-h-screen flex flex-col antialiased transition-colors duration-300",style:{background:ee.bg,color:ee.textPrimary,fontFamily:"'DM Sans', system-ui, -apple-system, sans-serif"},children:[e.jsx("header",{className:"sticky top-0 z-40 backdrop-blur-md",style:{background:`${ee.bg}E6`,borderBottom:`1px solid ${ee.border}`},children:e.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 lg:px-12 h-14 lg:h-16 max-w-[1280px] mx-auto w-full",children:[e.jsxs("div",{className:"flex items-center gap-2 lg:gap-10",children:[e.jsx(d,{to:"/",children:e.jsxs("span",{className:"font-extrabold tracking-tight text-[22px] lg:text-[24px] leading-none",style:{color:ee.textPrimary},children:["pitza",e.jsx("span",{style:{color:k},children:".fi"})]})}),U&&e.jsxs("button",{type:"button",className:"hidden lg:flex items-center gap-1.5 cursor-default focus:outline-none",title:D("discovery.nearYou"),children:[e.jsx(f,{className:"w-[15px] h-[15px]",style:{color:k}}),e.jsx("span",{className:"text-[14px] font-semibold",style:{color:ee.textPrimary},children:D("discovery.nearYou")}),e.jsx(h,{className:"w-2.5 h-2.5",style:{color:ee.textSecondary}})]})]}),e.jsxs("div",{className:"flex items-center gap-2 lg:gap-5",children:[e.jsx(d,{to:"/for-restaurants",className:"hidden lg:inline-flex items-center text-[13px] font-semibold rounded-lg px-1 transition-opacity hover:opacity-70 focus:outline-none focus-visible:ring-2 focus-visible:ring-[#FF5200]/60",style:{color:ee.textSecondary},children:D("footer.forRestaurants")}),e.jsxs("div",{className:"hidden lg:flex items-center gap-2 px-4 py-2 rounded-full border w-[300px] transition-shadow focus-within:ring-2 focus-within:ring-[#FF5200]/30",style:{background:ee.surfaceMuted,borderColor:ee.border},children:[e.jsx(y,{className:"w-4 h-4 shrink-0",style:{color:ee.textSecondary}}),e.jsx("input",{type:"text",value:Y,onChange:e=>H(e.target.value),placeholder:D("discovery.searchPlaceholder"),className:"w-full bg-transparent border-none outline-none text-[13px]",style:{color:ee.textPrimary}})]}),$?e.jsx(d,{to:"/profile","aria-label":D("discovery.profileShort"),className:"w-9 h-9 rounded-xl flex items-center justify-center transition-transform hover:scale-105 active:scale-95 focus:outline-none focus-visible:ring-2 focus-visible:ring-[#FF5200]/60",style:{background:`${k}20`},children:e.jsx(b,{className:"w-4 h-4",style:{color:k}})}):e.jsx(m,{open:E,onOpenChange:O,trigger:e.jsx("button",{type:"button","aria-label":D("discovery.signIn"),className:"w-9 h-9 rounded-xl flex items-center justify-center transition-transform hover:scale-105 active:scale-95 focus:outline-none focus-visible:ring-2 focus-visible:ring-[#FF5200]/60",style:{background:`${k}20`},children:e.jsx(b,{className:"w-4 h-4",style:{color:k}})})})]})]})}),e.jsxs("main",{className:"flex-grow w-full max-w-[1280px] mx-auto px-4 sm:px-5 lg:px-12 pb-10",children:[e.jsxs("div",{className:"flex items-baseline justify-between pt-3 pb-2.5 lg:hidden",children:[e.jsxs("div",{className:"text-[15px]",style:{color:ee.textSecondary},children:[D(`discovery.greeting.${ae}`),ie?`, ${ie}`:""]}),U&&e.jsxs("div",{className:"flex items-center gap-1 cursor-default",title:D("discovery.nearYou"),children:[e.jsx(f,{className:"w-3 h-3",style:{color:k}}),e.jsx("span",{className:"text-[12px] font-semibold",style:{color:ee.textPrimary},children:D("discovery.nearYou")}),e.jsx(h,{className:"w-2.5 h-2.5",style:{color:ee.textSecondary}})]})]}),e.jsxs("div",{className:"hidden lg:block pt-8 pb-6",children:[e.jsxs("div",{className:"text-[32px] font-extrabold tracking-[-0.02em] leading-tight",style:{color:ee.textPrimary},children:[D(`discovery.greeting.${ae}`),ie?`, ${ie}`:""]}),e.jsx("div",{className:"text-[15px] mt-1.5",style:{color:ee.textSecondary},children:D("discovery.heroSubtitle")})]}),e.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2.5 rounded-full mb-3 lg:hidden transition-shadow focus-within:ring-2 focus-within:ring-[#FF5200]/30",style:{background:ee.surfaceMuted},children:[e.jsx(y,{className:"w-4 h-4 shrink-0",style:{color:ee.textSecondary}}),e.jsx("input",{type:"text",value:Y,onChange:e=>H(e.target.value),placeholder:D("discovery.searchPlaceholder"),className:"w-full bg-transparent border-none outline-none text-[13px] placeholder:opacity-100",style:{color:ee.textPrimary,fontSize:"16px"}})]}),W&&W.restaurants?.secret_url&&(()=>{const s=(W.order_items||[]).filter(e=>e.menu_items?.name).slice(0,2).map(e=>`${e.quantity}× ${e.menu_items.name}`).join(", "),t=Math.max(0,(W.order_items?.length||0)-2),r=s+(t>0?` +${t}`:""),l=C(W.total_amount||W.total_price),a=W.restaurants?.name||"";return e.jsxs("button",{type:"button",onClick:()=>x(`/menu/${W.restaurants.secret_url}`),className:"group w-full text-left mb-3 lg:mb-6 transition-transform hover:-translate-y-0.5 focus:outline-none focus-visible:ring-2 focus-visible:ring-[#FF5200]",children:[e.jsxs("div",{className:"lg:hidden flex items-center gap-2.5 px-3.5 py-2.5 rounded-xl border",style:{background:Z?"#1C1208":"#FFF8F0",borderColor:Z?"#3D2A10":"#FFE8D4"},children:[e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.1em] shrink-0",style:{color:k},children:D("discovery.reorder")}),e.jsx("span",{className:"w-px h-3.5 shrink-0",style:{background:Z?"#3D2A10":"#FFD4B8"}}),e.jsx("span",{className:"flex-1 text-[12px] font-semibold truncate",style:{color:ee.textPrimary},children:r||a}),l&&e.jsx("span",{className:"text-[11px] shrink-0",style:{color:ee.textSecondary},children:l}),e.jsx(h,{className:"w-3 h-3 shrink-0 -rotate-90",style:{color:ee.textSecondary}})]}),e.jsxs("div",{className:"hidden lg:flex items-center gap-4 px-5 py-4 rounded-2xl border",style:{background:Z?"#1C1208":"#FFF8F0",borderColor:Z?"#3D2A10":"#FFE8D4"},children:[e.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center shrink-0",style:{background:`${k}22`}
1,"aria-hidden":!0,children:e.jsx(v,{className:"w-5 h-5",style:{color:k}})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[11px] font-bold uppercase tracking-[0.12em]",style:{color:k},children:D("discovery.reorderHeading")}),r&&e.jsx("div",{className:"text-[14px] font-semibold mt-0.5 truncate",style:{color:ee.textPrimary},children:r}),e.jsxs("div",{className:"text-[12px] mt-0.5",style:{color:ee.textSecondary},children:[a,l?` · ${l}`:""]})]}),e.jsx("span",{className:"inline-flex items-center px-5 py-2.5 rounded-xl text-[13px] font-bold shrink-0",style:{background:k,color:"#fff"},children:D("discovery.reorder")})]})]})})(),e.jsx("div",{className:"no-scrollbar flex gap-1.5 lg:gap-2 overflow-x-auto pb-3 lg:pb-6 -mx-1 px-1",style:{scrollbarWidth:"none"},children:te.map(s=>{const t=J===s.id;return e.jsx("button",{type:"button",onClick:()=>R(s.id),className:"px-4 lg:px-5 py-2 lg:py-2.5 rounded-full whitespace-nowrap text-[13px] lg:text-[14px] font-semibold border transition-all duration-200 hover:-translate-y-px active:scale-95 focus:outline-none focus-visible:ring-2 focus-visible:ring-[#FF5200]/60",style:{background:t?k:ee.surfaceMuted,color:t?"#fff":ee.textSecondary,borderColor:t?k:ee.border},children:s.label},s.id)})}),le&&(()=>{const s=n(le.header_image_url,900),t=Number(le.rating||0);return e.jsxs("button",{type:"button",onClick:()=>x(`/menu/${le.secret_url}`),className:"disco-card group relative block w-full text-left rounded-2xl lg:rounded-3xl overflow-hidden cursor-pointer mb-4 lg:mb-7 transition-transform hover:-translate-y-0.5 active:scale-[0.995] focus:outline-none focus-visible:ring-2 focus-visible:ring-[#FF5200]",children:[s?e.jsxs(e.Fragment,{children:[e.jsx("img",{src:s,alt:"",className:"absolute inset-0 w-full h-full object-cover transition-transform duration-700 group-hover:scale-[1.03]",loading:"lazy"}),e.jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(95deg, rgba(8,8,8,0.85) 0%, rgba(8,8,8,0.6) 45%, rgba(8,8,8,0.2) 100%)"}})]}):e.jsx("div",{className:"absolute inset-0",style:{background:`linear-gradient(135deg, ${k} 0%, #C23D00 100%)`}}),e.jsxs("div",{className:"relative p-[22px_20px] lg:p-[36px_40px] flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4",children:[e.jsxs("div",{className:"lg:max-w-[520px]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] lg:text-[12px] font-bold uppercase tracking-[0.15em] text-white/80 mb-2 lg:mb-2.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-white/80","aria-hidden":!0}),D("discovery.featuredEyebrow")]}),e.jsx("div",{className:"text-[22px] sm:text-[24px] lg:text-[30px] font-extrabold text-white mb-1 lg:mb-1.5 tracking-tight [text-wrap:balance]",children:le.name}),e.jsx("div",{className:"text-[13px] lg:text-[15px] text-white/75 mb-3.5 lg:mb-5 leading-relaxed",children:le.short_description||le.delivery_time_text||D("discovery.defaultDeliveryTime")}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-4 lg:px-6 py-2 lg:py-2.5 rounded-full text-[12px] lg:text-[14px] font-bold bg-white text-[#141414] shadow-[0_2px_14px_rgba(0,0,0,0.25)] transition-transform duration-200 group-hover:translate-x-0.5",children:[D("discovery.featuredCta"),e.jsx(j,{className:"w-4 h-4",style:{color:k}})]})]}),t>0&&e.jsx("div",{className:"hidden lg:flex items-center shrink-0",children:e.jsxs("div",{className:"flex items-center gap-1.5 px-3.5 py-2 rounded-full",style:{background:"rgba(255,255,255,0.14)",backdropFilter:"blur(8px)"},children:[e.jsx(N,{className:"w-4 h-4 fill-[#FFD700] text-[#FFD700]"}),e.jsx("span",{className:"text-[16px] font-bold text-white",children:t.toFixed(1)})]})})]})]})})(),e.jsxs("div",{className:"flex items-center justify-between pt-2 pb-2.5 lg:pb-4",children:[e.jsxs("div",{className:"flex items-baseline gap-1.5 lg:gap-2.5 min-w-0",children:[e.jsx("span",{className:"text-[17px] lg:text-[20px] font-bold tracking-tight truncate",style:{color:ee.textPrimary},children:oe}),e.jsx("span",{className:"text-[13px] lg:text-[14px] font-medium shrink-0",style:{color:ee.textSecondary},children:re.length})]}),e.jsx("div",{className:"flex p-0.5 rounded-xl border shrink-0",style:{background:ee.surfaceMuted,borderColor:ee.border},children:[{id:"grid",Icon:w},{id:"list",Icon:F}].map(({id:s,Icon:t})=>{const r=V===s;return e.jsx("button",{type:"button","aria-label":D("grid"===s?"discovery.viewGrid":"discovery.viewList"),onClick:()=>X(s),className:i("w-8 h-7 lg:w-9 lg:h-8 rounded-[10px] flex items-center justify-center transition-all duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-[#FF5200]/60",r&&"shadow-sm"),style:{background:r?ee.cardBg:"transparent"},children:e.jsx(t,{className:"w-4 h-4 lg:w-[17px] lg:h-[17px]",style:{color:r?ee.textPrimary:ee.textSecondary}})},s)})})]}),K?e.jsx("div",{className:i("grid gap-2.5 lg:gap-5","grid"===V?"grid-cols-2 sm:grid-cols-3 lg:[grid-template-columns:repeat(auto-fill,minmax(280px,1fr))]":"grid-cols-1 max-w-[840px]"),children:Array.from({length:6}).map((s,t)=>e.jsxs("div",{className:"rounded-2xl overflow-hidden border",style:{background:ee.cardBg,borderColor:ee.border},children:[e.jsx("div",{className:"aspect-[5/3] animate-pulse",style:{background:ee.surfaceMuted}}),e.jsxs("div",{className:"p-3 space-y-2",children:[e.jsx("div",{className:"h-3 w-2/3 animate-pulse rounded",style:{background:ee.surfaceMuted}}),e.jsx("div",{className:"h-2.5 w-1/2 animate-pulse rounded",style:{background:ee.surfaceMuted}})]})]},t))}
1):L?e.jsxs("div",{className:"rounded-2xl border border-red-500/30 bg-red-500/10 p-6 text-red-500",children:[e.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.18em]",children:D("discovery.errorEyebrow")}),e.jsx("p",{className:"mt-2 text-base",children:D("discovery.loadError")})]}):0===re.length?e.jsxs("div",{className:"rounded-2xl border p-10 text-center",style:{background:ee.cardBg,borderColor:ee.border},children:[e.jsx("div",{className:"w-12 h-12 mx-auto rounded-full flex items-center justify-center",style:{background:ee.surfaceMuted},children:e.jsx(_,{className:"w-5 h-5",style:{color:ee.textSecondary}})}),e.jsx("h4",{className:"mt-4 text-2xl font-semibold tracking-tight",style:{color:ee.textPrimary},children:D("discovery.emptyTitle")}),e.jsx("p",{className:"mx-auto mt-2.5 max-w-xl text-sm leading-7",style:{color:ee.textSecondary},children:D("discovery.emptyDescription")}),e.jsx("button",{type:"button",onClick:()=>{H(""),R("all")},className:"mt-5 px-5 py-2.5 rounded-full text-[13px] font-bold text-white transition-all duration-200 hover:-translate-y-0.5 active:scale-95 focus:outline-none focus-visible:ring-2 focus-visible:ring-[#FF5200]/60",style:{background:k},children:D("discovery.clearFilters")})]}):e.jsx("div",{className:i("grid gap-2.5 lg:gap-5","grid"===V?"grid-cols-2 sm:grid-cols-3 lg:[grid-template-columns:repeat(auto-fill,minmax(280px,1fr))]":"grid-cols-1 max-w-[840px]"),children:re.map((s,t)=>e.jsx(P,{restaurant:s,language:A,t:D,th:ee,viewMode:V,index:t,onOpen:()=>x(`/menu/${s.secret_url}`)},s.id))})]}),e.jsx(u,{})]})]})}export{D 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.