import{u as g,b as C,d as c,aS as P,e as k,j as e,bB as M,R as v,c as B,bC as E,ai as f,B as D,bD as F,r as i,m as w,ad as G,a3 as $,bE as p,C as o,bF as L,bG as U,bH as z,a6 as H,bI as K,bJ as R}from"./index-gATdONBG.js";import{S as O,u as X,a as _,D as q,B as V,b as J}from"./scrolling-menu-CXMvOrQM.js";import{S as Q}from"./sitemap-DfQUEcHk.js";import{S as h,a as W}from"./skeleton-BCbRVFtH.js";import{P as Y}from"./product-card-C0BjlEPA.js";import"./lodash-BosuxZz1.js";import"./use-resolve-button-type-DGKa0DPW.js";const Z=()=>{const{t}=g("home"),s=C(),l=c(P),a=c(k),d=()=>{s(v.Address)};return e.jsx(e.Fragment,{children:(!(l!=null&&l.label)||!a)&&e.jsxs("div",{className:"relative flex w-full items-center justify-center py-4 md:py-6",children:[e.jsx("i",{className:"absolute left-4 items-center justify-start",children:e.jsx(M,{fill:"#00AC24"})}),e.jsx("input",{placeholder:`${t("home.field.address.placeholder")}`,type:"search",className:`box-border block w-full cursor-pointer rounded border
        border-bright-gray bg-white p-3 pl-11 placeholder:text-sm placeholder:font-normal placeholder:tracking-[0.005em] placeholder:text-taupe-gray focus:outline-none`,onFocus:d})]})})},ee=()=>{const t=C(),s=B();return e.jsxs("div",{className:"relative mx-4 py-4 xl:mx-0",children:[e.jsx("img",{src:"/images/bg/gag.webp",className:"h-20 w-full rounded-lg object-cover ",alt:"gag-bg"}),e.jsxs("div",{className:"absolute bottom-0 top-0 flex w-full  items-center justify-between gap-x-2 px-2 sm:px-4",children:[e.jsxs("div",{className:"flex items-center gap-x-1 sm:gap-x-2",children:[e.jsx(E,{className:"shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-black text-white md:text-2xl",children:e.jsx(f,{ns:"home",i18nKey:"home.gag",components:{x:e.jsx("span",{className:"text-pantone"})}})}),e.jsx("p",{className:"text-xs text-white",children:e.jsx(f,{ns:"home",i18nKey:"home.gagSub"})})]})]}),e.jsx(D,{"aria-label":"send-gift",className:"whitespace-nowrap border-white bg-transparent px-4 py-2 text-xs font-bold text-white transition-colors hover:bg-white/25 focus:bg-white/25 active:bg-white/50 sm:px-6 md:px-10 lg:px-16",variant:"secondary",onClick:()=>{s(F("gift")),t(v.Address)},children:e.jsx(f,{ns:"home",i18nKey:"home.gagSend"})})]})]})},se=({children:t,height:s})=>{const[l,a]=i.useState(0),[d,x]=i.useState(!1),m=i.Children.count(t),[j,N]=i.useState(null),b=n=>{a(n+1>m?0:n)},I=n=>{const r=n.touches[0].clientX;N(r)},T=n=>{const r=j;if(r===null)return;const A=n.touches[0].clientX,y=r-A;y>5&&l+1<m&&b(l+1),y<-5&&l-1>=0&&b(l-1),N(null)};return i.useEffect(()=>{if(m<=1)return;const n=setInterval(()=>{d||b(l+1)},5500);return()=>{clearInterval(n)}}),e.jsxs("div",{style:{height:s},className:"carousel relative overflow-hidden rounded-xl bg-chinese-black",onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),children:[e.jsx("div",{className:"whitespace-nowrap transition-transform duration-500",style:{transform:`translateX(-${l*100}%)`},children:i.Children.map(t,(n,r)=>e.jsx("div",{onTouchStart:I,onTouchMove:T,className:"inline-flex h-full w-full justify-center align-middle","data-test-id":`carousel-child-${r}`,children:n}))}),m>1&&e.jsx("div",{className:"absolute bottom-0 flex w-full items-center justify-center gap-x-2",children:i.Children.map(t,(n,r)=>e.jsx("button",{"aria-label":`carousel-image-${r+1}-button`,className:w("mb-3 h-2 w-2 rounded-full border-none bg-white p-0",r===l&&"bg-silver-sand"),onClick:()=>a(r)}))})]})};function te({sizes:t,description:s,path:l}){return e.jsx($,{to:l,children:e.jsxs("picture",{children:[e.jsx("source",{media:"(min-width: 0px) and (max-width: 767px)",srcSet:`${t[750]}?version=${p}`}),e.jsx("source",{media:"(min-width: 768px) and (max-width: 1439px)",srcSet:`${t[1024]}?version=${p}`}),e.jsx("source",{media:"(min-width: 1440px) and (max-width: 2560px)",srcSet:`${t[1152]}?version=${p}`}),e.jsx("img",{src:`${t[1280]}?version=${p}`,alt:s,width:"1280",height:"375"})]})})}const le=()=>{const{bannerImages:t}=c(G);return e.jsx(se,{children:t.filter(s=>s.active).map(s=>i.createElement(te,{...s,key:s.id}))})},ae=le,ne=()=>e.jsxs(o,{md:"full",sm:"full",className:"",children:[e.jsx(h,{className:"mx-4 mb-1.5 mt-2 h-5 w-1/3 rounded-lg xl:mx-0"}),e.jsx(W,{className:"flex w-auto flex-row gap-x-3 overflow-x-scroll p-4 scrollbar-hide lg:grid lg:grid-cols-5 xl:w-full xl:overflow-x-visible xl:px-0",children:Array.from({length:5}).map((t,s)=>e.jsxs("div",{className:"inline-flex min-w-[195px] max-w-[195px] flex-col gap-y-3 rounded-lg border border-bright-gray bg-white transition-all hover:shadow-xl lg:!w-auto lg:!min-w-0 lg:!max-w-none",children:[e.jsx(h,{className:"aspect-[1/0.75] w-full rounded-t-lg "}),e.jsxs("div",{className:"space-y-3 px-3 pb-4",children:[e.jsx(h,{className:"h-[14px] w-full rounded"}),e.jsx(h,{className:"h-[14px] w-full rounded"}),e.jsx(h,{className:"!mt-6 h-[14px] w-20 rounded"})]})]},s))})]}),re=({products:t,tag:s})=>{var l;return e.jsx("div",{className:"justify-left flex w-auto gap-x-3 overflow-x-scroll p-4 scrollbar-hide lg:grid lg:grid-cols-5 xl:w-full xl:overflow-x-visible xl:px-0",children:(l=t==null?void 0:t.slice(0,5))==null?void 0:l.map((a,d)=>e.jsx(Y,{...a,className:"lg:!w-auto lg:!min-w-0 lg:!max-w-none",onClickCallback:()=>L(a,s)},d))})},u=({heading:t,tag:s,className:l=""})=>{const{t:a}=g(["home","globals"]),d=c(U),x=c(z(s));return d?e.jsx("section",{id:`${s}-skeleton`,className:w("pt-4",l),children:e.jsx(ne,{})}):e.jsx(e.Fragment,{children:x.length>0&&e.jsx("section",{id:s,className:w("pt-4",l),children:e.jsxs(o,{md:"full",sm:"full",children:[e.jsxs("div",{className:"mx-4 flex items-center justify-between xl:mx-0",children:[e.jsx(O,{children:t}),e.jsx($,{"aria-label":`view-all-${s}`,className:"border-0 border-none p-0 text-xs font-semibold uppercase text-green",to:`${v.Menu}/${s}`,children:a("button.viewAll",{ns:"globals"})})]}),e.jsx(re,{products:x.sort((m,j)=>m.productSequence[s]-j.productSequence[s]),tag:s})]})})})},ie=()=>{var a;const{t}=g("home"),s=(a=c(H))==null?void 0:a.firstName,l=c(K);return e.jsx("p",{className:"whitespace-pre-line text-2xl font-semibold leading-9 text-dark-charcoal lg:whitespace-normal",children:e.jsx(f,{i18nKey:t(s&&!l?"home.greetingUser":"home.greetingGuest"),values:{name:s}})})},S=ie,oe=()=>{const{t}=g("globals"),s=J(["buy-one-take-one","new","best-seller","limited-time-offer","pizza"]);return i.useEffect(()=>{s&&R(s)},[s]),e.jsxs(e.Fragment,{children:[e.jsx(u,{className:"bg-white",tag:"buy-one-take-one",heading:t("menuCategory.feelsGDeals")}),e.jsx(u,{className:"bg-white",tag:"new",heading:t("menuCategory.new")}),e.jsx(u,{className:"bg-white",tag:"best-seller",heading:t("menuCategory.best")}),e.jsx(u,{className:"bg-honeydew",tag:"limited-time-offer",heading:t("menuCategory.limited")}),e.jsx(u,{className:"bg-white",tag:"pizza",heading:t("menuCategory.pizza")})]})};function pe(){const t=c(k),{t:s}=g("home");return X(),e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"sr-only",children:s("home.srHeading")}),e.jsxs("main",{id:"home",className:"grow",children:[e.jsx("section",{id:"addressing-field",className:"bg-white",children:e.jsx(o,{md:"full",children:e.jsx(Z,{})})}),e.jsx("section",{id:"greeting-mobile",className:"block bg-white p-4 pt-2 text-center md:hidden",children:e.jsx(S,{})}),e.jsx("section",{id:"banner",className:"bg-white py-6 md:pb-6 md:pt-2",children:e.jsx(o,{md:"full",sm:"full",className:"px-4 lg:px-0",children:e.jsx(ae,{})})}),e.jsxs("div",{className:"flex flex-col-reverse gap-y-6 md:flex-col md:gap-y-0",children:[e.jsx("div",{id:"scrolling-menu",className:"bg-cultured pb-8 md:p-0",children:e.jsx(o,{md:"full",sm:"full",children:e.jsx(_,{simple:!1})})}),e.jsxs("div",{children:[e.jsx("section",{id:"greeting",className:"bg-white pb-4 pt-6 md:pt-10",children:e.jsxs(o,{md:"full",sm:"full",className:"flex flex-col-reverse items-start justify-start gap-6 px-4 md:flex-row md:items-center md:justify-between md:gap-0 xl:px-0",children:[e.jsx("div",{className:"hidden md:block",children:e.jsx(S,{})}),!!t&&e.jsx(q,{className:"w-full md:w-fit"})]})}),e.jsx("section",{className:"bg-white",children:e.jsx(o,{md:"full",sm:"full",children:e.jsx(ee,{})})}),e.jsx(oe,{})]})]}),e.jsx("div",{className:"bg-white pt-6",children:e.jsx(o,{md:"full",children:e.jsx(V,{className:"pb-11 pt-9 md:pb-14 md:pt-11"})})}),e.jsx(Q,{})]})]})}export{pe as default};