import{a as f,r as d,u as m,d as l,e as y,i as u,j as e,bK as C,p,bF as w,bG as h,bH as b,c as S,bd as N,bL as j,ag as k,bM as v,be as z,C as D,m as E,a2 as M,bJ as I}from"./index-gATdONBG.js";import{S as H,u as T,a as P,D as L,B as A,b as B}from"./scrolling-menu-CXMvOrQM.js";import{a as O,S as c}from"./skeleton-BCbRVFtH.js";import{P as q}from"./product-card-C0BjlEPA.js";import"./lodash-BosuxZz1.js";const F=(s,a=0)=>{const{sectionId:t}=f();d.useEffect(()=>{if(!t)return;const o=()=>t?document.getElementById(t):null,r=g=>{g&&window.scrollTo({top:g.offsetTop-a,behavior:"auto"})},i=o();i&&r(i)},[t,...s])};function G(){const{t:s}=m("qrc-ordering"),a=l(y);return u&&a?e.jsxs("div",{className:" flex flex-col bg-green px-4 py-2 text-center text-white",children:[e.jsxs("span",{className:" text-base font-semibold",children:[e.jsx(C,{fill:"white",height:24,width:24,className:" inline-block h-6 align-top"}),s("menu.storeName",{storeName:a==null?void 0:a.name})]}),e.jsx("span",{className:" text-[10px]",children:s("menu.storeAddress",{address:a==null?void 0:a.address})})]}):null}const V=()=>e.jsxs(O,{className:"p-6",children:[e.jsx(c,{className:"mb-4 h-6 w-1/3"}),e.jsx("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-3",children:Array.from({length:3}).map((s,a)=>e.jsxs("div",{className:"flex w-auto flex-col gap-y-3",children:[e.jsx(c,{className:"h-[115px] w-full"}),e.jsx(c,{className:"h-[14px] w-full"}),e.jsx(c,{className:"h-[10px] w-full"})]},a))})]}),$=({products:s,tag:a})=>{const t=l(p("showCartDrawer"));return e.jsx("div",{className:`grid grid-cols-2 gap-3 ${t?"lg:grid-cols-3 xl:grid-cols-4 3xl:grid-cols-4 5xl:grid-cols-5":"md:grid-cols-4 lg:grid-cols-5"}`,children:s==null?void 0:s.map((o,r)=>e.jsx(q,{...o,className:"!w-auto !min-w-0 !max-w-none",onClickCallback:()=>w(o,a)},r))})},n=({heading:s,tag:a})=>{const t=l(h),o=l(b(a));return t?e.jsx(V,{}):e.jsx(e.Fragment,{children:o.length>0&&e.jsxs("section",{id:a,children:[e.jsx(H,{className:"my-3",children:s}),e.jsx($,{products:o.sort((r,i)=>r.productSequence[a]-i.productSequence[a]),tag:a})]})})},x=({children:s})=>{const a=l(p("showCartDrawer"));return e.jsx(D,{lg:a?"full":"normal",sm:"full",className:E("!mt-0",a&&"md:!ml-4 md:w-menu-cart-open-md lg:!ml-16 lg:w-menu-cart-open-lg xl:!ml-32 xl:w-menu-cart-open-xl 3xl:!ml-52 3xl:w-menu-cart-open-xxl 5xl:!mx-auto"),children:s})},J=()=>{const{t:s}=m("globals"),{menuCategories:a}=l(M),t=B(a.map(r=>r.id)),o=d.useCallback(()=>{t&&I(t)},[t]);return d.useEffect(()=>{o()},[t,o]),e.jsxs("div",{id:"category-section",className:"flex flex-col gap-y-6",children:[e.jsx(n,{heading:s("menuCategory.feelsGDeals"),tag:"buy-one-take-one"}),e.jsx(n,{heading:s("menuCategory.limited"),tag:"limited-time-offer"}),e.jsx(n,{heading:s("menuCategory.new"),tag:"new"}),e.jsx(n,{heading:s("menuCategory.best"),tag:"best-seller"}),e.jsx(n,{heading:s("menuCategory.solo"),tag:"solo-meal"}),e.jsx(n,{heading:s("menuCategory.pizzaComboMeal"),tag:"pizza-combo-meals"}),e.jsx(n,{heading:s("menuCategory.bundles"),tag:"group-meal"}),e.jsx(n,{heading:s("menuCategory.pizza"),tag:"pizza"}),e.jsx(n,{heading:s("menuCategory.deals"),tag:"pizza-deal"}),e.jsx(n,{heading:s("menuCategory.snacks"),tag:"snacks"}),e.jsx(n,{heading:s("menuCategory.pasta"),tag:"pasta"}),e.jsx(n,{heading:s("menuCategory.chicken"),tag:"chicken-sides"}),e.jsx(n,{heading:s("menuCategory.drinks"),tag:"drinks"}),e.jsx(n,{heading:s("menuCategory.desserts"),tag:"desserts"})]})},K=({children:s})=>{const a=j(["app-header"]);return e.jsx("div",{id:"sticky-menu-header",style:{top:`${a}px`},className:"sticky z-menu bg-white shadow-card md:shadow-none",children:s})};function X(){const{t:s}=m("home");T();const a=S();d.useEffect(()=>{a(N(1))},[a]);const t=j(["sticky-menu-header","app-header"]),o=l(h),r=k("md");return F([o,t],t),e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"sr-only",children:s("menu.srHeading")}),e.jsxs("main",{id:"category",className:"grow space-y-4",children:[e.jsxs(K,{children:[e.jsx(v,{}),e.jsx(G,{}),e.jsx(x,{children:e.jsx(P,{simple:!0})})]}),e.jsxs(x,{children:[r&&e.jsx("div",{className:"mx-auto pb-14 pt-8 md:w-80",children:e.jsx(z,{})}),e.jsxs("div",{className:"flex flex-col gap-y-4 p-4 md:gap-y-10 md:p-0",children:[!u&&e.jsx("div",{className:"flex gap-x-6",children:e.jsx(L,{})}),e.jsx(J,{})]}),e.jsx(A,{className:"mx-4 mb-11 mt-9 md:mx-0 md:mb-14 md:mt-11"})]})]})]})}export{X as default};