PageSourceSearch

https://ellapizzaria.com.br/assets/MainPage-CJiEiEiE.js

js ellapizzaria.com.br collected 2026-10-05 18:09:26 UTC 68,181 bytes, 6 lines download raw bytes

1
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f1397e53-b9fb-5298-b01d-76c60273cf1e")}catch(e){}}();
3const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Checkout-Eub9Fc76.js","assets/index-CVhO1mfm.js","assets/index-6WNQ_WJg.css","assets/index-C5Xw5HCy.js","assets/whatsappLink-CCcWEDnq.js","assets/Products-Clk528Gk.js","assets/index-BeW15Tmp.css","assets/PermissionRequest-ChLiACfX.js","assets/Checkout-B4wCvlUo.css","assets/Search-CTirrR14.js","assets/Tabs-BmQOOuI1.js"])))=>i.map(i=>d[i]);
4import{R as d,ai as se,j as e,I as F,d as _t,aj as O,W as q,L as G,U as z,X as Me,r as v,Y as H,Z as V,$ as B,q as g,ak as Se,c as P,P as m,al as Oe,am as St,y as S,an as kt,ao as Et,ap as Le,aq as ze,ar as Tt,as as $t,at as It,au as K,av as I,aw as Pt,ax as Rt,ay as D,az as At,aA as Dt,aB as ae,aC as re,a as M,k as qe,aD as L,aE as ne,aF as He,aG as Ve,aH as le,aI as Q,aJ as Be,B as Mt,N as We,aK as ie,aL as Ot,aM as oe,aN as ke,aO as Lt,aP as A,aQ as zt,aR as qt,aS as ce,E as Ht,F as Vt,aT as Bt,aU as Wt,aV as Ft,aW as Ut,aX as Yt,aY as Fe,aZ as Gt,a_ as Kt,a$ as Qt,b0 as Xt,b1 as Zt,b2 as Jt,b3 as es,b4 as ts,b5 as ss,b6 as as,b7 as rs,b8 as ns,b9 as ls,ba as is,ae as os,bb as de,ag as cs,bc as ds,G as ms,bd as us,be as xs,bf as Ee,bg as fs,bh as hs,bi as ps,bj as gs,bk as js,bl as vs,bm as ys,bn as bs,bo as ws,bp as Ns,bq as Cs,br as _s,bs as Ss,bt as ks,t as Es,b as Ts,u as $s,bu as Ue,bv as Ye,bw as Is,bx as Ps,by as Rs,bz as As,bA as Te,bB as Ds,bC as Ms,bD as Os,bE as Ls,bF as zs,bG as qs,bH as Hs}from"./index-CVhO1mfm.js";import{S as Vs,w as Bs}from"./whatsappLink-CCcWEDnq.js";import{T as Ws,a as J}from"./Tabs-BmQOOuI1.js";function Fs(){const[t,s]=d.useState(""),{imageViewer:a,setImageViewer:n}=d.useContext(se);d.useEffect(()=>{a&&!t?s(a):!a&&t&&setTimeout(()=>s(""),250)},[t,a]);const r=d.useCallback(()=>{n(null)},[n]),l=d.useCallback(()=>{r()},[r]),i=d.useCallback(c=>{c.key==="Escape"&&r()},[r]);return!a&&!t?null:e.jsxs("div",{onKeyDown:i,onClick:l,className:"fixed inset-0 flex max-h-screen items-center justify-center bg-gray-100 bg-opacity-30 transition-opacity duration-300",style:{zIndex:1e4,opacity:t&&a?1:0,backgroundColor:"rgba(0, 0, 0, 0.75)"},children:[e.jsx(F,{onClick:r,size:"small",className:"absolute right-0 top-0 mr-6 mt-6 bg-gray-300 p-2 text-2xl text-gray-600 transition-colors hover:bg-white hover:text-gray-700 sm:mr-8 sm:mt-8",children:e.jsx(_t,{fontSize:"inherit",color:"inherit"})}),e.jsx("div",{className:"h-full w-full p-4 md:p-8",children:e.jsx("div",{className:"flex h-full min-h-32 w-full min-w-32 items-center justify-center",children:e.jsx(O,{src:t,alt:"Visualização da imagem do produto",className:"max-h-full max-w-full overflow-hidden rounded-lg"})})})]})}const Us=d.lazy(()=>z.smartImport(()=>Me(()=>import("./Checkout-Eub9Fc76.js").then(t=>t.C),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ys="checkout";function Gs(){return e.jsx(q,{dialogPage:Ys,dialogProps:{maxWidth:"xs",fullWidth:!0,onClose:null},children:e.jsx(d.Suspense,{fallback:e.jsx("div",{className:"flex h-full min-h-96 w-full items-center justify-center",children:e.jsx(G,{color:"primary"})}),children:e.jsx(Us,{})})})}const Ks=d.memo(Gs);var me={},Qs=B,Xs=V;Object.defineProperty(me,"__esModule",{value:!0});var Ge=me.default=void 0,Zs=Xs(v),Js=Qs(H()),ea=(0,Js.default)(Zs.createElement("path",{d:"M19.23 15.26l-2.54-.29c-.61-.07-1.21.14-1.64.57l-1.84 1.84c-2.83-1.44-5.15-3.75-6.59-6.59l1.85-1.85c.43-.43.64-1.03.57-1.64l-.29-2.52c-.12-1.01-.97-1.77-1.99-1.77H5.03c-1.13 0-2.07.94-2 2.07.53 8.54 7.36 15.36 15.89 15.89 1.13.07 2.07-.87 2.07-2v-1.73c.01-1.01-.75-1.86-1.76-1.98z"}),"CallRounded");Ge=me.default=ea;const ta=t=>v.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 408.788 408.788",...t},v.createElement("path",{d:"M353.701 0H55.087C24.665 0 .002 24.662.002 55.085v298.616c0 30.423 24.662 55.085 55.085 55.085h147.275l.251-146.078h-37.951c-4.932 0-8.935-3.988-8.954-8.92l-.182-47.087c-.
4019-4.959 3.996-8.989 8.955-8.989h37.882v-45.498c0-52.8 32.247-81.55 79.348-81.55h38.65a8.96 8.96 0 0 1 8.955 8.955v39.704a8.96 8.96 0 0 1-8.95 8.955l-23.719.011c-25.615 0-30.575 12.172-30.575 30.035v39.389h56.285c5.363 0 9.524 4.683 8.892 10.009l-5.581 47.087c-.534 4.506-4.355 7.901-8.892 7.901h-50.453l-.251 146.078h87.631c30.422 0 55.084-24.662 55.084-55.084V55.085C408.786 24.662 384.124 0 353.701 0z",fill:"#475993"})),sa=t=>v.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 551.034 551.034",...t},v.createElement("linearGradient",{id:"A",gradientUnits:"userSpaceOnUse",x1:275.517,y1:549.43,x2:275.517,y2:4.28},v.createElement("stop",{offset:0,stopColor:"#e09b3d"}),v.createElement("stop",{offset:.3,stopColor:"#c74c4d"}),v.createElement("stop",{offset:.6,stopColor:"#c21975"}),v.createElement("stop",{offset:1,stopColor:"#7024c4"})),v.createElement("path",{d:"M386.878 0H164.156C73.64 0 0 73.64 0 164.156v222.722c0 90.516 73.64 164.156 164.156 164.156h222.722c90.516 0 164.156-73.64 164.156-164.156V164.156C551.033 73.64 477.393 0 386.878 0zM495.6 386.878c0 60.045-48.677 108.722-108.722 108.722H164.156c-60.045 0-108.722-48.677-108.722-108.722V164.156c0-60.046 48.677-108.722 108.722-108.722h222.722c60.045 0 108.722 48.676 108.722 108.722v222.722h0z",fill:"url(#A)"}),v.createElement("path",{d:"M275.517 133C196.933 133 133 196.933 133 275.516s63.933 142.517 142.517 142.517S418.034 354.1 418.034 275.516 354.101 133 275.517 133zm0 229.6c-48.095 0-87.083-38.988-87.083-87.083s38.989-87.083 87.083-87.083 87.083 38.988 87.083 87.083-38.989 87.083-87.083 87.083z",fill:"url(#A)"}),v.createElement("linearGradient",{id:"B",gradientUnits:"userSpaceOnUse",x1:418.31,y1:549.43,x2:418.31,y2:4.28},v.createElement("stop",{offset:0,stopColor:"#e09b3d"}),v.createElement("stop",{offset:.3,stopColor:"#c74c4d"}),v.createElement("stop",{offset:.6,stopColor:"#c21975"}),v.createElement("stop",{offset:1,stopColor:"#7024c4"})),v.createElement("circle",{cx:418.31,cy:134.07,r:34.15,fill:"url(#B)"})),U=({title:t,className:s})=>e.jsx("h3",{className:P("mt-8 text-lg font-medium text-gray-800",s),children:t});U.propTypes={title:m.string.isRequired,className:m.string};U.defaultProps={className:void 0};function aa(){var s;const t=g(({company:a})=>a.company);return t?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col items-center space-y-4 sm:flex-row sm:items-start sm:space-y-0",children:[t.logo&&e.jsx("div",{className:"mr-0 h-24 w-24 flex-shrink-0 overflow-hidden rounded-md sm:mr-6",children:e.jsx("div",{className:"h-full w-full",children:e.jsx(O,{src:t.logo,alt:`Logo da empresa - ${t.name}`,className:"h-full w-full object-cover object-center"})})}),((t==null?void 0:t.description)||(t==null?void 0:t.instagram)||(t==null?void 0:t.facebook))&&e.jsxs("div",{className:"w-full whitespace-pre-wrap",children:[t.description,e.jsxs("div",{className:"mt-5 flex items-center space-x-5",children:[t.instagram&&e.jsxs("a",{href:`http://www.instagram.com/${t.instagram}`,target:"_blank",rel:"noopener noreferrer nofollow",className:"flex items-center space-x-2.5",children:[e.jsx(sa,{className:"h-6 w-6 fill-current"}),e.jsxs("span",{children:["@",t.instagram]})]}),t.facebook&&e.jsxs("a",{href:`http://www.facebook.com/${t.facebook}`,target:"_blank",rel:"noopener noreferrer nofollow",className:"flex items-center space-x-2.5",children:[e.jsx(ta,{className:"h-6 w-6 fill-current"}),e.jsx("span",{className:"text-sm",children:t.facebook})]})]})]})]}),e.jsx(U,{title:"Contato",className:"mb-1"}),e.jsxs("div",{className:"flex flex-wrap",children:[t.order_whatsapp&&e.jsxs("a",{href:Bs(t.order_whatsapp),target:"_blank",rel:"noopener noreferrer nofollow",className:"button-outlined-primary mr-3 mt-3 flex items-center space-x-2.5 p-2.5",children:[e.jsx(Vs,{className:"h-5 w-5 fill-current"}),e.jsx("span",{className:"whitespace-nowrap text-sm",children:Se(t.order_whatsapp)})]}),t.phone_number&&e.jsxs("a",{href:`tel:${t.phone_number}`,rel:"nofollow",className:"button-outlined-primary mt-3 flex items-center space-x-2.5 p-2.5",children:[e.jsx(Ge,{className:"text-xl"}),e.jsx("span",{className:"whitespace-nowrap text-sm",children:Se(t.phone_number)})]})]}),!((s=t.flags)!=null&&s.hide_company_address)&&(t==null?void 0:t.city)&&(t==null?void 0:t.state)&&e.jsxs(e.Fragment,{children:[e.jsx(U,{title:"Endereço",className:"mb-4"}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:`${t.street}, ${t.address_number}`}),e.jsx("span",{children:`${t.neighborhood}, ${t.city} - ${t.state}`}),t.address_complement&&e.jsx("span",{children:t.address_complement})]})]})]}):null}var ue={},ra=B,na=V;
4Object.defineProperty(ue,"__esModule",{value:!0});var Ke=ue.default=void 0,la=na(v),ia=ra(H()),oa=(0,ia.default)(la.createElement("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm-.22-13h-.06c-.4 0-.72.32-.72.72v4.72c0 .35.18.68.49.86l4.15 2.49c.34.2.78.1.98-.24.21-.34.1-.79-.25-.99l-3.87-2.3V7.72c0-.4-.32-.72-.72-.72z"}),"QueryBuilderRounded");Ke=ue.default=oa;function ca(t){const s=[],a=Object.keys(t||{}).sort();let n=null;if(!(a!=null&&a.length))return[];a.forEach(i=>{const c=St(t[i].intervals).sort().join("")||"",o=t[i].observation||"",u=c+o;u===n&&S(i).diff(S(s[s.length-1].end),"days")===1?s[s.length-1].end=i:(n=u,s.push({start:i,end:i,intervals:t[i].intervals,observation:t[i].observation}))});const r=S().format("YYYY-MM-DD"),l=S().add(15,"day").format("YYYY-MM-DD");return s.filter(i=>i.start<=l&&i.end>=r)}function da(t,s){const a=S().startOf("day"),n=S(t).startOf("day"),r=S(s).startOf("day");return t===s?a.isSame(n)?"Hoje":a.add(1,"day").isSame(n)?"Amanhã":`${Le(ze[n.format("d")])}, dia ${n.format("DD/MM")}`:a.isSame(n)&&a.add(1,"day").isSame(r)?"Hoje e amanhã":n.add(1,"day").isSame(r)?`Nos dias ${n.format("DD/MM")} e ${r.format("DD/MM")}`:a.isSame(n)?`De hoje até o dia ${r.format("DD/MM")}`:a.add(1,"day").isSame(n)?`De amanhã até o dia ${r.format("DD/MM")}`:a.isSame(r)?`Do dia ${n.format("DD/MM")} até hoje`:a.add(1,"day").isSame(r)?`Do dia ${n.format("DD/MM")} até amanhã`:`Do dia ${n.format("DD/MM")} ao dia ${r.format("DD/MM")}`}function $e(t){const s=t.map(a=>`${a[0].replace(":","h")} às ${a[1].replace(":","h")}`);return s.length>1?[s.slice(0,-1).join(", de "),s.slice(-1)].join(" e de "):s}function ma(t){const{end:s,intervals:a}=t,n=(a==null?void 0:a.length)>0,r=s>S().format("YYYY-MM-DD");return n&&r?e.jsxs("span",{children:["estaremos abertos de ",e.jsx("span",{children:$e(a)})]}):n&&!r?e.jsxs("span",{children:["estamos abertos de ",e.jsx("span",{children:$e(a)})]}):!n&&r?e.jsx("span",{children:"estaremos fechados"}):e.jsx("span",{children:"estamos fechados"})}function ua(t){const s=S(`${t.nextChange.date}T${t.nextChange.time}:${t.open?"59":"00"}`);return["retornaremos",kt(s),Et(t.nextChange.time),t.nextChange.time.replace(":","h")].join(" ")}function X({className:t,onClick:s}){var i,c;const a=g(({company:o})=>o.company.business_hours),n=g(Oe),r=d.useMemo(()=>ca(a==null?void 0:a.custom_dates),[a==null?void 0:a.custom_dates]),l=((i=n.currentState)==null?void 0:i.type)==="temporary_state"&&!((c=n.currentState)!=null&&c.open);return!(r!=null&&r.length)&&!l?null:e.jsxs("div",{className:P("space-y-4 rounded-md border border-divider bg-white p-3 text-gray-700 sm:mx-0",s&&"cursor-pointer",t),onClick:s,children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"flex-shrink-0 rounded-full bg-yellow-500 p-1.5 text-white",children:e.jsx(Ke,{className:"",color:"inherit"})}),e.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Alterações nos horários de funcionamento"})]}),e.jsxs("div",{className:"space-y-3 text-msm text-gray-700 sm:text-sm",children:[l&&e.jsxs("div",{children:["Tivemos que pausar o recebimento de pedidos fora do horário previsto,"," ",e.jsx("span",{className:"font-medium",children:ua(n.currentState)}),"."]}),r.map(o=>e.jsxs("div",{children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:da(o.start,o.end)})," ",ma(o),"."]}),o.observation&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:"Motivo:"})," ",o.observation]})]},`${o.start}${o.end}`))]})]})}X.propTypes={className:m.string,onClick:m.func};X.defaultProps={className:void 0,onClick:void 0};const xa=(t,s)=>{const a=t&&t[Tt[s]];return a&&a.length>0?a.map(n=>`${n[0]} às ${n[1]}`):["Fechado"]};function fa(){const t=g(({company:a})=>a.company),s=S().get("day");return e.jsxs("div",{className:"space-y-6",children:[e.jsx(X,{}),e.jsx("div",{className:"space-y-2 sm:max-w-xs",children:[1,2,3,4,5,6,0].map(a=>e.jsxs("div",{className:P("flex items-start justify-between p-2.5 text-gray-700",s===a&&"rounded-md bg-gray-100"),children:[e.jsx("div",{className:"flex flex-shrink-0 items-center space-x-3",children:e.jsx("span",{children:Le(ze[a])})}),e.jsx("div",{className:"flex flex-col items-end space-y-1",children:xa(t.business_hours,a).map(n=>e.jsx("div",{className:"font-medium",children:n},n))})]},a))})]})}function ha(){const t=g($t).availablePaymentMethods;return e.jsx("div",{className:"flex flex-col space-y-3 p-3",children:t.map(s=>
4{const a=s.kind,n=It(s.kind,s.fiscal_kind),r=s.name;return e.jsx("div",{children:e.jsxs("div",{className:"inline-flex items-center space-x-3 rounded-md bg-gray-100 px-4 py-2",children:[e.jsx(n,{className:"text-3xl text-gray-700"}),e.jsx("span",{className:"text-sm text-gray-700",children:r})]})},a)})})}const pa=["Sobre","Horário","Pagamento"];function ga(){const t=g(({company:l})=>l.company),{handleClose:s}=d.useContext(K),[a,n]=d.useState(0);d.useEffect(()=>{I.customEvent("view_company_details",{company_details_tab:pa[a]})},[a]);const r=(l,i)=>{n(i)};return e.jsxs("div",{className:"flex min-h-128 w-full flex-col overflow-hidden",children:[e.jsx(Pt,{title:t.name,onClose:s,className:"text-xl shadow-none"}),e.jsxs(Ws,{value:a,indicatorColor:"primary",textColor:"primary",onChange:r,variant:"fullWidth",className:"mt-1 border-b border-gray-200",children:[e.jsx(J,{label:"Sobre"}),e.jsx(J,{label:"Horário"}),e.jsx(J,{label:"Pagamento"})]}),e.jsxs("div",{className:"thin-scrollbar overflow-y-auto",children:[!t&&e.jsx("div",{className:"flex h-72 w-72 items-center justify-center sm:h-100 sm:w-100",children:e.jsx(G,{color:"primary"})}),t&&e.jsxs("div",{className:"flex flex-col p-4 text-gray-700 sm:p-6",children:[a===0&&e.jsx(aa,{}),a===1&&e.jsx(fa,{}),a===2&&e.jsx(ha,{})]})]})]})}const Y="mais-informacoes";function ja(){return e.jsx(q,{dialogHash:Y,dialogProps:{maxWidth:"sm",fullWidth:!0,keepMounted:!0},children:e.jsx(d.Suspense,{fallback:e.jsx("div",{className:"flex h-full min-h-96 w-full items-center justify-center",children:e.jsx(G,{color:"primary"})}),children:e.jsx(ga,{})})})}const va=d.memo(ja),Qe="[ITEM_SUGGESTIONS] CLOSE";function Ie(){return{type:Qe}}const ya=({itemSuggestions:t})=>t||{triggerProductId:null,triggerProduct:null};function ba({rule:t,productsById:s,cartProductIds:a,triggerProductId:n,now:r,companyTimezone:l}){if(!t)return[];if(!Rt(t.schedules,r,l))return[];const i=new Set(a||[]);return[...t.suggested_items||[]].sort((c,o)=>(c.position??0)-(o.position??0)).map(({id:c})=>s==null?void 0:s[c]).filter(Boolean).filter(c=>c.id!==n).filter(c=>!i.has(c.id)).filter(c=>c.status!=="MISSING").filter(c=>!c.active_stock_control||c.stock>0)}S.extend(ae);S.extend(re);function wa(){const t=D(),{triggerProductId:s,triggerProduct:a}=g(ya),n=g(At),r=g(({catalog:y})=>y.products),l=g(Dt),i=g(({company:y})=>y.currentTime),c=g(({company:y})=>y.company.timeCorrection),o=g(({company:y})=>y.company.local_timezone),u=d.useMemo(()=>i?S(i).tz(o||void 0):S().add(c||0,"seconds").tz(o||void 0),[i,c,o]),x=d.useMemo(()=>l.map(y=>y.id),[l]),h=s?n[s]:null,f=d.useMemo(()=>ba({rule:h,productsById:r,cartProductIds:x,triggerProductId:s,now:u,companyTimezone:o}),[h,r,x,s,u,o]),p=!!(s&&f.length>0);d.useEffect(()=>{s&&(!h||f.length===0)&&t(Ie())},[t,s,h,f.length]);const N=d.useCallback(()=>{t(Ie())},[t]);return{open:p,triggerProduct:a,suggestedProducts:f,close:N}}function Na(t){var s;return t.kind==="combo"?!0:!!((s=t.add_ons)!=null&&s.length)}function Ca(){const t=M(),s=D(),a=qe(),n=L("(max-width:475px)"),{open:r,triggerProduct:l,suggestedProducts:i,close:c}=wa(),o=d.useCallback(u=>{if(!Na(u)){const x={productId:u.id,quantity:1,observation:"",addons:{},product:u};s(ne(x,"regular_item",{skipSuggestions:!0})),I.addProductToCart(u,x),a.success("Adicionado à sacola");return}c(),t.push({hash:`#${He}`,search:u.kind==="combo"?`?comboId=${u.id}&fromItemSuggestion=1`:`?id=${u.id}&fromItemSuggestion=1`})},[a,c,s,t]);return l?e.jsx(q,{dialogProps:{open:r,onClose:c,maxWidth:"md",fullWidth:!0,PaperProps:{className:n?"shadow-lg":"dialog max-w-2xl"}},children:e.jsxs("div",{className:"flex h-full flex-col overflow-hidden xs:h-auto xs:max-h-160",children:[e.jsxs("div",{className:"thin-scrollbar min-h-0 flex-1 overflow-y-auto px-3 pt-4 sm:px-4 sm:pt-5",children:[e.jsx("div",{className:"flex justify-end",children:e.jsx(Ve,{onClick:c})}),e.jsxs("div",{className:"mb-5 flex flex-col items-center space-y-3 text-center xs:mb-6",children:[e.jsx("div",{className:"flex h-20 w-20 items-center justify-center overflow-hidden rounded-lg bg-gray-50",children:l.thumbnail_url?e.jsx(le,{src:l.thumbnail_url,alt:l.name,className:"h-full w-full rounded-lg object-contain object-center"}):e.jsx("div",{className:"flex h-full w-full items-center justify-center bg-gray-100 text-gray-400",children:e.jsx(Q,{className:"h-10 w-10 fill-current"})})}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-sm leading-5 text-gray-500 xs:text-base",children:["Você adicionou"," ",e.jsx("span",{className:"font-medium text-gray-700",children:l.name})]}),e.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:"Que tal levar junto?"})]})]}),e.jsx("div",{className:"flex w-full flex-col gap-3 pb-4",children:i.map(u=>e.jsx(Be,{product:u,onSelect:o},u.id))})]}),e.jsx("div",{className:"z-30 flex-shrink-0 p-3 shadow-top sm:p-4",children:e.jsxs(Mt,{variant:"contained",color:"primary",fullWidth:!0,size:"large",className:"relative rounded-lg",onClick:c,children:["Continuar sem adicionar",e.jsx(We,{fontSize:"small",className:"absolute right-6"})]})})]})}):null}const _a=d.memo(Ca),Sa={triggerProductId:null,triggerProduct:null},ka=ie((t,s)=>{var a,n;switch(s.type){case Ot:{if(s.skipSuggestions){t.triggerProductId=null,t.triggerProduct=null;break}const r=(a=s.product)==null?void 0:a.productId,l=(n=s.product)==null?void 0:n.product;t.triggerProductId=r??null,l?t.triggerProduct={id:l.id,name:l.name,thumbnail_url:l.thumbnail_url,kind:l.kind}:r?t.triggerProduct={id:r}:t.triggerProduct=null;break}case Qe:t.triggerProductId=null,t.triggerProduct=null;break}},Sa);function Ea(){return e.jsx(_a,{})}const Ta=oe("itemSuggestions",ka)(d.memo(Ea));function $a(){const t=M(),[s,a]=d.useState(null),n=g(({company:i})=>i.company.events),{searchParams:r,handleClose:l}=d.useContext(K);return d.useEffect(()=>{if(r!=null&&r.id&&(n==null?void 0:n.length)>0){const i=n.find(c=>
4String(c.id)===(r==null?void 0:r.id));if(i){a(i),I.customEvent("open_notice",{notice_id:i.id});return}}t.replace({hash:null,search:null})},[r==null?void 0:r.id,n,t]),!n||n.length===0||!s?null:e.jsx("div",{className:"flex h-full overflow-hidden md:max-h-160",children:e.jsxs("div",{className:"thin-scrollbar flex w-full max-w-md flex-1 flex-col overflow-y-auto",children:[e.jsx(Ve,{onClick:l,className:"absolute right-0 top-0 mr-5 mt-4"}),e.jsx("div",{className:"flex flex-shrink-0 overflow-hidden",children:s.image_url?e.jsx(O,{src:s.image_url,alt:s.name,className:"h-full w-full object-contain object-center"}):e.jsx("div",{className:"flex h-20 w-full items-center bg-gray-100 pb-4 pl-4 font-medium text-gray-700",children:"Detalhes do aviso"})}),e.jsxs("div",{className:"z-10 -mt-4 flex flex-shrink-0 flex-col space-y-3 rounded-t-2xl bg-white p-4 shadow-top-sm",children:[e.jsx("h3",{className:"text-base font-medium leading-6 text-gray-700",children:s.name}),e.jsx("p",{className:"whitespace-pre-wrap text-sm font-light text-gray-500",children:s.description})]})]})})}const Xe="aviso";function Ia(){return e.jsx(q,{dialogHash:Xe,children:e.jsx($a,{})})}const Pa=d.memo(Ia),Ze=d.createContext({});function xe({setHighlightError:t,setCartInconsistencyError:s}){const a=D(),{searchParams:n,handleClose:r}=d.useContext(K),l=g(({comboDetails:w})=>w.comboDetails),i=g(({cart:w})=>w),c=g(({comboDetails:w})=>w.state),{quantity:o,steps:u}=c,x=g(({settings:w})=>w.menuMode),h=x===A.VIEW_ONLY,f=d.useContext(Ze),p=d.useCallback(()=>{a(ke("quantity",o-1))},[a,o]),N=d.useCallback(()=>{a(ke("quantity",o+1))},[a,o]),y=d.useCallback(()=>{if(l){const w=l.combo_steps.find(C=>!u[C.id]);if(w)return f(w.id),!0}return!1},[l,u,f]),_=d.useCallback(()=>{const w=Lt(i,l);if(x===A.DELIVERY&&w)return s({open:!0,...w}),!1;const C=zt(i,l);if(C)return s({open:!0,...C}),!1;if(y())t(!0);else{const E=!!n.fromItemSuggestion;a(ne({...c,productId:l.id,product:l},"combo",{skipSuggestions:E})),I.addProductToCart(l,c),r()}},[l,a,y,i,s,r,c,t,x,n]),j=d.useCallback(()=>{y()?t(!0):(a(qt({...c,productId:l.id,product:l},c.cartProductId,"combo")),I.addProductToCart(l,c),r())},[l,a,y,r,c,t]),b=d.useMemo(()=>{if(l!=null&&l.active_stock_control){const w=i.reduce((C,E)=>n.comboEdit?E.productId===l.id&&E.cartProductId!==c.cartProductId?C+E.quantity:C:E.productId===l.id?C+E.quantity:C,0);return Math.max((l.stock||0)-w,0)}},[i,l,c.cartProductId,n.comboEdit]);if(h)return null;const k=ce(l,u),R=o*k;return e.jsxs("div",{className:"z-30 border-t border-divider p-3 shadow-top-sm",children:[b!==void 0&&b<5?e.jsxs("div",{className:"textt-center flex w-full items-center justify-start pb-2 text-xs font-medium text-red-500",children:[b===0?"Esgotado":null,b===1?"Apenas 1 unidade restante":null,b>1?`Últimas ${b} unidades`:null]}):null,e.jsxs("div",{className:"flex items-center justify-between space-x-3",children:[e.jsxs("div",{className:"flex items-center space-x-4 rounded-md bg-gray-100 p-3 text-sm",children:[e.jsx(F,{onClick:p,size:"small",className:"p-0 text-xl text-gray-700",disableRipple:!0,disabled:o<=1,children:e.jsx(Ht,{fontSize:"inherit",color:"inherit"})}),e.jsx("span",{className:"min-w-4 text-center text-sm font-normal text-gray-700",children:o}),e.jsx(F,{onClick:N,size:"small",className:"p-0 text-xl text-gray-700",disableRipple:!0,disabled:b!==void 0&&b<=o,children:e.jsx(Vt,{fontSize:"inherit",color:"inherit"})})]}),e.jsxs("button",{className:"button-primary flex h-11 flex-1 items-center justify-between px-3 text-sm",onClick:n.comboEdit?j:_,disabled:b!==void 0&&o>b,children:[e.jsx("div",{children:n.comboEdit?"Atualizar":"Adicionar"}),e.jsx("div",{children:z.formatMonetaryValue(R)})]})]})]})}xe.propTypes={setHighlightError:m.func,setCartInconsistencyError:m.func};xe.defaultProps={setHighlightError:void 0,setCartInconsistencyError:void 0};const Ra=d.memo(xe),Aa=(t,s)=>{var n;const a=[];return(n=t==null?void 0:t.add_ons)==null||n.forEach(r=>{var l;s[r.id]&&((l=r.subitems)==null||l.forEach(i=>{const c=s[r.id][i.id];c===1?a.push(i.name):c>1&&a.push(`${c}x ${i.name}`)}))}),a.join(", ")};function Je({product:t,comboId:s,comboStepDetails:a,comboStepOption:n}){var p,N,y,_,j;const r=D(),l=M(),{setImageViewer:i}=d.useContext(se),c=g(({comboDetails:b})=>b.state.steps),{id:o,remove_add_on_prices:u}=a||{},x=((p=c[o])==null?void 0:p.productId)===(t==null?void 0:t.id),h=d.useCallback(()=>
4{if(t.status==="MISSING")return null;const{add_ons:b}=t||{};b!=null&&b.length?(r(Bt(a)),r(x?Wt(c[o]):Ft()),l.push({hash:`#${et}`,search:`?comboId=${s}&id=${t.id}&edit=true`})):r(Ut(o,{productId:t.id,product:t}))},[s,a,o,r,l,t,x,c]);if(!t)return null;const f=Object.keys(((N=c[o])==null?void 0:N.addons)||{}).length&&x&&!u?Yt(t,(y=c[o])==null?void 0:y.addons):0;return e.jsxs("div",{className:P("flex items-center justify-between p-4 hover:bg-gray-50",t.status!=="MISSING"&&"cursor-pointer"),onClick:h,children:[t.thumbnail_url&&e.jsx("div",{className:"mr-3 flex h-14 w-14 overflow-hidden rounded-md",onClick:b=>{b.stopPropagation(),i(t.image_url)},children:e.jsx(O,{src:t.thumbnail_url,alt:t.name,className:"h-full w-full object-contain object-center"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:P("flex items-center text-sm text-gray-700",x&&"font-medium"),children:t.name}),x&&Object.keys((_=c[o])==null?void 0:_.addons).length?e.jsx("div",{className:"line-clamp-2 text-xs font-light text-gray-700",children:Aa(t,(j=c[o])==null?void 0:j.addons)}):t.description&&e.jsx("div",{className:"line-clamp-2 text-xs font-light text-gray-700",children:Fe(t.description)}),n.additional_price||f?e.jsx("div",{className:"mt-1 text-xs font-medium text-gray-700",children:n.additional_price&&f?`+ ${z.formatMonetaryValue(n.additional_price)} (+ ${z.formatMonetaryValue(f)})`:`+ ${z.formatMonetaryValue(n.additional_price||f)}`}):null]}),e.jsx("div",{children:t.status==="MISSING"?e.jsx("span",{className:"ml-3 text-xs font-medium text-yellow-500",children:"EM FALTA"}):e.jsx(Gt,{checked:x,color:"primary",className:"ml-5 p-1"})})]})}Je.propTypes={comboId:m.number.isRequired,comboStepDetails:m.shape({id:m.number,remove_add_on_prices:m.bool}).isRequired,comboStepOption:m.shape({id:m.number,additional_price:m.number}).isRequired,product:m.shape({id:m.number,name:m.string,image_url:m.string,thumbnail_url:m.string,description:m.string,active_stock_control:m.bool,choice_type:m.string,max_quantity:m.number,stock:m.number,price:m.number,status:m.string}).isRequired};const Da=d.memo(Je),Ma={open:!1,thisProductRestriction:"",cartProductRestriction:"",cartProduct:""};function Oa(){const t=D(),{searchParams:s,handleClose:a}=d.useContext(K),n=g(({catalog:j})=>j.products),[r,l]=d.useState(Ma),i=g(({comboDetails:j})=>j.comboDetails),[c,o]=d.useState(!1),u=g(({comboDetails:j})=>j.state.steps),x=d.useRef(null),h=d.useRef([]),f=d.useCallback((j,b=!1)=>{var k,R,w;if(j){let C=null;if(b){const E=i.add_ons.findIndex($=>$.id===j),T=E!==-1&&E+1<i.add_ons.length?E+1:null;T&&(C=(k=h.current)==null?void 0:k.find($=>parseInt($.getAttribute("data-combo-step-id"))===i.add_ons[T].id))}else C=(R=h.current)==null?void 0:R.find(E=>parseInt(E.getAttribute("data-combo-step-id"))===j);C&&((w=x.current)!=null&&w.scrollTo)&&x.current.scrollTo({top:C.offsetTop-59,behavior:"smooth"})}},[i]),p=d.useCallback(j=>{j&&!h.current.includes(j)&&h.current.push(j)},[]),N=d.useRef(!1);d.useEffect(()=>{var j;if(s.comboId&&!N.current){if(s.comboEdit!=="true"&&t(Kt()),s.comboEdit==="true"&&!Object.keys(u).length){a();return}if(n&&((j=Object.keys(n))==null?void 0:j.length)>0){const b=n[parseInt(s.comboId)];(b==null?void 0:b.status)==="ACTIVE"?(t(Qt(s.comboId)),N.current=!0):a()}}},[t,a,n,s.comboEdit,s.comboId,s.edit,u]);const y=d.useMemo(()=>e.jsx(Ra,{setCartInconsistencyError:l,setHighlightError:o}),[]);if(!i)return null;if(r.open)return e.jsx(Xt,{cartError:r});const _=ce(i,u);return e.jsx(Ze.Provider,{value:f,children:e.jsxs(Zt,{ref:x,title:"Detalhes do combo",product:i,Footer:y,children:[e.jsx(Jt,{product:i,productPrice:_}),i==null?void 0:i.combo_steps.map(j=>{var b;return e.jsxs("ul",{"data-combo-step-id":j.id,ref:p,className:"p-0",children:[e.jsx(es,{className:"border-b border-t border-gray-200 bg-gray-100 px-4 py-3 text-gray-700",classes:{sticky:"top-14"},children:e.jsxs("div",{className:"flex items-center justify-between space-x-3",children:[e.jsxs("div",{className:"flex flex-col space-y-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:j.name}),e.jsx("span",{className:P("text-xs font-light",c&&!u[j.id]&&"font-medium text-red-500"),children:"Escolha uma das opções abaixo"})]}),u[j==null?void 0:j.id]&&e.jsx("div",{className:"flex",children:e.jsx(ts,{className:"mr-1 text-2xl text-green-600"})})]})}),e.jsx("div",{className:"divide-y divide-gray-200",children:(b=j==null?void 0:j.combo_step_items)==null?void 0:b.map(k=>e.jsx(Da,{comboId:i.id,comboStepDetails:j,comboStepOption:k,product:n==null?void 0:n[k==null?void 0:k.item_id]},k.id))})]},j.id)})]})})}const La={quantity:1,addons:{},observation:""}
4,Pe={comboDetails:null,state:{quantity:1,steps:{}}},za=ie((t,s)=>{switch(s.type){case ls:t.comboDetails=s.payload;break;case ns:t.state[s.field]=s.value;break;case rs:t.state={...Pe.state};break;case as:t.state=s.payload;break;case ss:s.comboStepId&&s.payload&&(t.state.steps[s.comboStepId]={...La,...s.payload});break}},Pe),et="produto";function qa(){return e.jsx(q,{dialogHash:et,dialogSearch:"comboId",children:e.jsx(Oa,{})})}const Ha=oe("comboDetails",za)(d.memo(qa)),Va="agendamento";function Ba(){return e.jsx(q,{dialogHash:Va,dialogProps:{maxWidth:"xs",fullWidth:!0},children:e.jsx(is,{})})}const Wa=d.memo(Ba),tt="[SEARCH] SET SEARCHED TEXT";function Br(t){return{type:tt,payload:t}}const Fa={searchedText:""},Ua=ie((t,s)=>{switch(s.type){case tt:t.searchedText=s.payload;break}},Fa),Ya=d.lazy(()=>z.smartImport(()=>Me(()=>import("./Search-CTirrR14.js"),__vite__mapDeps([9,1,2,4,10])))),st="busca";function Ga(){return e.jsx(q,{dialogHash:st,dialogProps:{maxWidth:"lg",fullWidth:!0},children:e.jsx(d.Suspense,{fallback:e.jsx("div",{className:"flex h-full min-h-96 w-full items-center justify-center",children:e.jsx(G,{color:"primary"})}),children:e.jsx(Ya,{})})})}const Ka=oe("search",Ua)(d.memo(Ga)),Qa=t=>v.createElement("svg",{id:"Capa_1",enableBackground:"new 0 0 512 512",height:512,viewBox:"0 0 512 512",width:512,xmlns:"http://www.w3.org/2000/svg",...t},v.createElement("g",null,v.createElement("g",null,v.createElement("g",null,v.createElement("g",null,v.createElement("path",{d:"m174.99 52.417h-55.519c-38.213 0-69.301 31.088-69.301 69.301v24.295c0 4.137 3.354 7.49 7.49 7.49 4.137 0 7.49-3.354 7.49-7.49v-24.295c0-29.953 24.368-54.321 54.321-54.321h55.519c29.952 0 54.32 24.368 54.32 54.321v84.409c0 14.022-11.408 25.431-25.431 25.431h-84.409c-28.596 0-52.408-22.328-54.211-50.832-.26-4.128-3.821-7.261-7.948-7.002-4.128.261-7.263 3.819-7.002 7.948 2.3 36.373 32.68 64.866 69.161 64.866h84.409c22.283 0 40.411-18.128 40.411-40.411v-84.409c.001-38.213-31.087-69.301-69.3-69.301z"}),v.createElement("path",{d:"m392.531 52.417h-55.52c-38.213 0-69.301 31.088-69.301 69.301v84.409c0 22.282 18.128 40.411 40.411 40.411h84.409c38.213 0 69.301-31.088 69.301-69.301v-55.519c.002-38.213-31.087-69.301-69.3-69.301zm54.321 124.82c0 29.953-24.368 54.321-54.321 54.321h-84.409c-14.023 0-25.431-11.408-25.431-25.431v-84.409c0-29.953 24.368-54.321 54.32-54.321h55.52c29.953 0 54.321 24.368 54.321 54.321z"}),v.createElement("path",{d:"m203.88 265.462h-84.409c-38.213 0-69.301 31.088-69.301 69.301v55.519c0 38.213 31.088 69.301 69.301 69.301h55.519c38.213 0 69.301-31.088 69.301-69.301v-84.409c0-22.282-18.128-40.411-40.411-40.411zm25.431 124.82c0 29.953-24.368 54.321-54.32 54.321h-55.519c-29.953 0-54.321-24.368-54.321-54.321v-55.519c0-29.953 24.368-54.321 54.321-54.321h84.409c14.023 0 25.431 11.408 25.431 25.431v84.409z"}),v.createElement("path",{d:"m364.772 265.895c-13.91 0-27.337 2.895-39.909 8.603-3.767 1.711-5.434 6.15-3.724 9.917 1.711 3.766 6.151 5.433 9.917 3.724 10.613-4.819 21.957-7.263 33.716-7.263 45.021 0 81.648 36.627 81.648 81.648s-36.627 81.648-81.648 81.648-81.648-36.627-81.648-81.648c0-20.854 7.859-40.704 22.13-55.894 2.833-3.015 2.685-7.755-.33-10.587-3.016-2.833-7.755-2.685-10.587.33-16.891 17.978-26.193 41.471-26.193 66.15 0 53.281 43.347 96.628 96.628 96.628s96.628-43.347 96.628-96.628-43.348-96.628-96.628-96.628z"}),v.createElement("path",{d:"m343.948 395.449c-3.462-2.265-8.104-1.295-10.369 2.168-2.265 3.462-1.294 8.104 2.168 10.369 8.182 5.353 13.87 7.089 20.951 7.591v6.148c0 4.137 3.353 7.49 7.49 7.49s7.49-3.353 7.49-7.49v-6.827c14.066-3.23 23.096-15.093 25.063-26.794 2.518-14.979-5.31-28-19.944-33.173-1.683-.595-3.401-1.215-5.118-1.858v-28.908c3.922 1.186 6.21 3.135 6.349 3.255l1.754 1.611c3.045 2.797 7.784 2.599 10.583-.448 2.799-3.046 2.598-7.784-.448-10.583l-1.743-1.601c-.373-.343-6.481-5.839-16.494-7.59v-5.486c0-4.137-3.354-7.49-7.49-7.49-4.137 0-7.49 3.353-7.49 7.49v6.028c-.746.179-1.5.375-2.266.606-9.677 2.915-16.907 11.187-18.866 21.586-1.793 9.514 1.276 18.704 8.009 23.986 3.366 2.64 7.512 5.059 13.123 7.593v37.429c-4.52-.465-7.643-1.759-12.752-5.102zm27.73-26.44c.043.015.083.03.126.045 11.341 4.009 10.647 13.693 10.164 16.565-.889 5.291-4.388 10.879-10.29 13.55zm-18.858-25.269c-2.281-1.789-3.276-5.489-2.534-9.425.618-3.277 2.621-7.145 6.411-9.163v21.176c-1.432-.838-2.744-1.7-3.877-2.588z"}),v.createElement("path",{d:"m505.579 29.838c-11.805-5.563-18.184-15.78-21.457-23.372-1.694-3.928-5.548-6.466-9.819-6.466s-8.125 2.538-9.819 6.467c-3.273 7.592-9.652 17.809-21.458 23.371-3.779 1.781-6.126 5.483-6.126 9.662s2.348 7.882 6.126 9.662c11.805 5.563 18.185 15.78 21.458 23.372 1.694 3.928 5.548 6.467 9.819 6.467s8.125-2.538 9.819-6.467c3.273-7.592 9.652-17.809 21.457-23.371 3.779-1.78 6.127-5.483 6.127-9.662s-2.348-7.883-6.127-9.663zm-31.276 28.991c-3.936-6.689-9.687-13.815-17.988-19.328 8.301-5.513 14.052-12.639 17.989-19.328 3.936 6.689 9.687 13.815 17.988 19.328-8.301 5.512-14.052 12.639-17.989 19.328z"}),v.createElement("path",{d:"m68.973 462.837c-11.805-5.563-18.185-15.78-21.457-23.37-1.694-3.929-5.547-6.468-9.818-6.468-4.271 0-8.125 2.539-9.819 6.467-3.273 7.592-9.652 17.809-21.458 23.371-3.779 1.781-6.126 5.483-6.126 9.662s2.347 7.882 6.126 9.662c11.805 5.563 18.185 15.78 21.458 23.372 1.694 3.928 5.548 6.467 9.82 6.467 4.271 0 8.125-2.539 9.818-6.467 3.273-7.592 9.652-17.809 21.457-23.371 3.779-1.78 6.127-5.483 6.127-9.662s-2.35-7.883-6.128-9.663zm-31.276 28.99c-3.936-6.689-9.688-13.816-17.988-19.328 8.301-5.512 14.052-12.639 17.988-19.328 3.936 6.689 9.688 13.815 17.988 19.328-8.301 5.513-14.052 12.639-17.988 19.328z"}))))));function at({category:t,onCategorySelected:s}){var n;if(!t||!((n=t.items)!=null&&n.length))return null;let a=t.image_url;if(!a){const r=t.items.find(l=>l.image_url);r&&(a=r.image_url)}return e.jsxs("div",{"data-key":"category-card",className:"card flex h-full cursor-pointer flex-col p-2",onClick:()=>s(t),children:[e.jsx("div",{className:"flex min-h-36 flex-1 items-center justify-center overflow-hidden rounded-lg",children:a?e.jsx(O,{src:a,alt:t.name,className:"h-full w-full object-cover object-center"}):e.jsx(Qa,{className:"h-3/5 w-3/5 fill-current text-primary opacity-50"})}),e.jsx("div",{className:"flex h-10 items-center px-1 pt-1 sm:h-12",children:e.jsx("div",{className:"line-clamp-2 text-msm font-medium text-gray-700 sm:text-base",children:t.name})})]})}at.propTypes={category:m.shape({items:m.arrayOf(m.shape({image_url:m.string})),image_url:m.string,name:m.string}).isRequired,onCategorySelected:m.func.isRequired};function fe({name:t,description:s}){return e.jsxs("div",{className:"mb-3 md:mb-5",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-800 md:text-2xl",children:t}),s&&e.jsx("p",{className:"mt-2 text-sm font-light text-gray-500 md:text-base",children:s})]})}fe.propTypes={name:m.string.isRequired,description:m.string};fe.defaultProps={description:void 0};const Z=d.memo(fe);function rt(){return e.jsxs("div",{className:"flex h-100 flex-1 flex-col items-center justify-center space-y-8 p-16 text-gray-400",children:[e.jsx(os,{className:"h-28 w-28 fill-current sm:h-32 sm:w-32"}),e.jsx("div",{className:"text-center text-xl font-semibold uppercase",children:"Nenhum produto encontrado"})]})}var he={},Xa=B,Za=V;
4Object.defineProperty(he,"__esModule",{value:!0});var nt=he.default=void 0,Ja=Za(v),er=Xa(H()),tr=(0,er.default)(Ja.createElement("path",{d:"M19 11H7.83l4.88-4.88c.39-.39.39-1.03 0-1.42a.9959.9959 0 00-1.41 0l-6.59 6.59c-.39.39-.39 1.02 0 1.41l6.59 6.59c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L7.83 13H19c.55 0 1-.45 1-1s-.45-1-1-1z"}),"ArrowBackRounded");nt=he.default=tr;var pe={},sr=B,ar=V;Object.defineProperty(pe,"__esModule",{value:!0});var lt=pe.default=void 0,rr=ar(v),nr=sr(H()),lr=(0,nr.default)(rr.createElement("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward");lt=pe.default=lr;var ge={},ir=B,or=V;Object.defineProperty(ge,"__esModule",{value:!0});var it=ge.default=void 0,cr=or(v),dr=ir(H()),mr=(0,dr.default)(cr.createElement("path",{d:"M15.5 14h-.79l-.28-.27c1.2-1.4 1.82-3.31 1.48-5.34-.47-2.78-2.79-5-5.59-5.34-4.23-.52-7.79 3.04-7.27 7.27.34 2.8 2.56 5.12 5.34 5.59 2.03.34 3.94-.28 5.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),"SearchRounded");it=ge.default=mr;const je=d.createContext({}),ve=d.forwardRef(({className:t,showLogo:s},a)=>{const n=M(),[r,l]=d.useState(!1),i=g(({company:w})=>w.company.logo),c=g(({company:w})=>w.company.name),o=d.useRef(null),u=g(({catalog:w})=>w.catalog),{selectedCategoryId:x,handleCategorySelect:h,onGoBack:f,goToStart:p}=d.useContext(je),N=d.useRef(document.getElementById("root")),y=d.useMemo(()=>u.filter(w=>w.items.length>0),[u]),_=d.useCallback(()=>{r&&l(!1)},[r]);de(_,N,3e4);const j=d.useCallback(()=>{l(w=>!w)},[]),b=()=>{l(!1)},k=d.useCallback(w=>{h(w),b()},[h]);d.useEffect(()=>{window.catId&&y.length>0&&h&&k(window.catId)},[k,y,h]),d.useEffect(()=>{x||l(!1)},[x]);const R=d.useMemo(()=>{if(x){const w=y==null?void 0:y.find(C=>C.id===x);if(w)return w.name}return null},[y,x]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:P("flex w-full max-w-full items-center justify-between space-x-2 truncate",t),ref:a,children:[s&&!f&&i&&e.jsx("div",{className:"flex items-center justify-center",children:e.jsx("div",{className:"h-9 w-9 overflow-hidden rounded-md md:h-12 md:w-12",children:e.jsx("img",{src:i,alt:`Logo da empresa - ${c}`,className:"h-full w-full object-cover object-center"})})}),f&&e.jsx(F,{"data-key":"go-back-header",size:"small",onClick:f,children:e.jsx(nt,{})}),e.jsx("div",{className:"relative inline-block w-full truncate text-left",children:e.jsxs("button",{type:"button",className:"inline-flex h-10 max-w-full items-center justify-center space-x-2 truncate rounded-md border border-divider bg-white pl-2.5 pr-1.5 text-sm font-medium text-gray-500 shadow-sm hover:bg-gray-50 sm:h-11 md:px-4","aria-expanded":"true","aria-haspopup":"true",ref:o,onClick:j,children:[e.jsx("span",{className:"truncate",children:R||"Lista de categorias"}),e.jsx(cs,{className:"text-xl"})]})}),e.jsxs("div",{className:"flex h-10 cursor-pointer items-center space-x-2 rounded-md border border-divider bg-white px-2 text-sm text-gray-500 shadow-sm hover:bg-gray-50 sm:h-11",onClick:()=>{n.push({hash:st}),I.customEvent("search_open")},children:[e.jsx("div",{className:"flex items-center",children:e.jsx(it,{className:"h-6 w-6 fill-current text-gray-500"})}),e.jsx("div",{className:"hidden w-full min-w-64 max-w-xs items-center sm:flex",children:"Busque por um produto"})]})]}),e.jsx(ds,{open:r,anchorEl:o.current,role:void 0,placement:"bottom-start",transition:!0,disablePortal:!0,className:"z-50",children:({TransitionProps:w})=>e.jsx(ms,{...w,children:e.jsx("div",{className:"mt-1 overflow-hidden rounded-md border border-divider bg-white shadow-lg",children:e.jsx(us,{onClickAway:b,children:e.jsxs(xs,{className:"thin-scrollbar max-h-80 min-w-60 max-w-xs divide-y divide-solid divide-divider overflow-y-auto py-1",children:[x&&e.jsx(Ee,{onClick:()=>{p(),b()},className:"px-5 py-3 text-sm text-gray-500",children:e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(lt,{style:{fontSize:"1.125rem"}})," ",e.jsx("span",{children:"Voltar ao início"})]})}),y.map(C=>e.jsx(Ee,{onClick:()=>{I.customEvent("select_category",{category_id:C.id,category_name:C.name}),I.viewCategory(C.name),k(C.id)},className:"px-5 py-3 text-sm text-gray-500",children:e.jsx("div",{className:P("flex items-center space-x-2 whitespace-normal",C.id===x&&"font-semibold"),children:C.name})},C.id))]})})})})})]})});ve.propTypes={className:m.string,showLogo:m.bool};ve.defaultProps={className:void 0,showLogo:void 0};const ot=d.memo(ve),ye=({children:t,onClick:s,Icon:a,active:n})=>e.jsxs("div",{className:P("flex w-20 cursor-pointer flex-col items-center justify-center space-y-1 rounded-md border-2 border-transparent p-1 transition-colors",n?"border-primary text-primary":"border bg-white text-gray-700 hover:border-primary"),onClick:s,children:[a&&e.jsx(a,{className:"h-5 w-5 fill-current"}),e.jsx("span",{className:"text-xxs font-medium leading-3",children:t})]});
4ye.propTypes={children:m.node.isRequired,onClick:m.func,Icon:m.elementType,active:m.bool};ye.defaultProps={onClick:void 0,Icon:void 0,active:!1};function be({show:t}){const s=L("(min-width:1024px)"),a=L("(max-width:768px)"),n=fs(),r=d.useMemo(()=>s?"min(calc(1280px - 320px), calc(100vw - 3rem - 288px))":a?"calc(100vw - 1rem)":"calc(100vw - 3rem)",[s,a]);return e.jsx("div",{className:P("fixed left-0 right-0 z-50 w-full bg-white shadow-md transition-all duration-300 ease-in-out sm:shadow",t?"top-0":"-top-16"),children:e.jsxs("div",{className:"mx-auto flex w-full items-center justify-center py-2.5 sm:py-2",children:[e.jsx("div",{className:"flex flex-1 items-center justify-center truncate lg:pr-7",style:{maxWidth:r},children:e.jsx(ot,{showLogo:!0})}),e.jsx("div",{className:"hidden w-72 items-center justify-around border-opacity-20 lg:flex xl:w-80",children:n.map(({id:l,label:i,Icon:c,active:o,onClick:u})=>e.jsx(ye,{Icon:c,active:o,onClick:u,children:i},l))})]})})}be.propTypes={show:m.bool};be.defaultProps={show:void 0};const ur=d.memo(be);function ct(){const[t,s]=d.useState(null),a=d.useRef(null),n=d.useRef(document.getElementById("root")),r=d.useCallback(({scroll:l})=>{if(a.current){const i=l>a.current.offsetTop+30;i!==t&&s(i)}},[t]);return de(r,n,500),e.jsxs(e.Fragment,{children:[e.jsx(ot,{ref:a}),e.jsx(ur,{show:t})]})}const dt=d.forwardRef(({category:t},s)=>{const{id:a,name:n,description:r,items:l}=t;return!l||!Array.isArray(l)||l.length===0?null:e.jsxs("div",{"data-category-id":a,className:"mt-8 px-2 sm:px-0 md:mt-10",ref:s,children:[e.jsx("div",{className:"px-1 sm:px-0",children:e.jsx(Z,{name:n,description:r})}),e.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 sm:gap-4",children:l.map(i=>e.jsx(Be,{product:i},i.id))})]})});dt.propTypes={category:m.shape({id:m.number,name:m.string,description:m.string,items:m.arrayOf(m.shape({id:m.number,name:m.string,description:m.string,image_url:m.string,price:m.number}))}).isRequired};const mt=d.memo(dt);function xr(){return e.jsxs("div",{className:"card flex h-full min-h-28 w-full cursor-pointer p-1 sm:p-2",children:[e.jsxs("div",{className:"flex flex-1 flex-col p-2",children:[e.jsx("div",{className:"my-0.5 h-5 w-full animate-pulse rounded-md bg-gray-200"}),e.jsx("div",{className:"my-0.5 h-5 w-3/5 animate-pulse rounded-md bg-gray-200"}),e.jsx("div",{className:"mb-0.5 mt-2.5 h-4 w-full animate-pulse rounded-md bg-gray-200"}),e.jsx("div",{className:"mb-1 mt-0.5 h-4 w-5/6 animate-pulse rounded-md bg-gray-200"}),e.jsx("div",{className:"mb-0.5 mt-6 h-5 w-24 animate-pulse rounded-md bg-gray-200"})]}),e.jsx("div",{className:"p-1",children:e.jsx("div",{className:"sm:w-30 sm:h-30 h-28 w-28 animate-pulse rounded-lg bg-gray-200 lg:h-32 lg:w-32"})})]})}function ut(){return e.jsxs("div",{className:"mt-8 px-2 sm:px-0 md:mt-10",children:[e.jsx("div",{className:"mb-3 md:mb-5",children:e.jsx("div",{className:"h-8 w-3/5 animate-pulse rounded-md bg-gray-200 sm:w-2/5"})}),e.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4",children:[...Array(12).keys()].map(t=>e.jsx(xr,{},t))})]})}var we={},fr=B,hr=V;Object.defineProperty(we,"__esModule",{value:!0});var xt=we.default=void 0,pr=hr(v),gr=fr(H()),jr=(0,gr.default)(pr.createElement("path",{d:"M16.62 2.99c-.49-.49-1.28-.49-1.77 0L6.54 11.3c-.39.39-.39 1.02 0 1.41l8.31 8.31c.49.49 1.28.49 1.77 0s.49-1.28 0-1.77L9.38 12l7.25-7.25c.48-.48.48-1.28-.01-1.76z"}),"ArrowBackIosRounded");xt=we.default=jr;const W=t=>{const{children:s,show:a,infiniteLoop:n}=t,[r,l]=v.useState(n?a:0),[i,c]=v.useState(s.length),[o,u]=v.useState(n&&s.length>a),[x,h]=v.useState(!0),[f,p]=v.useState(null),N=L("(max-width:768px)");v.useEffect(()=>{c(s.length),u(n&&s.length>a)},[s,n,a]),v.useEffect(()=>{o&&(r===a||r===i)&&h(!0)},[r,o,a,i]);const y=()=>{(o||r<i-a)&&l(T=>T+1)},_=()=>{(o||r>0)&&l(T=>T-1)},j=T=>{const $=T.touches[0].clientX;p($)},b=T=>{const $=f;if($===null)return;const Ct=T.touches[0].clientX,_e=$-Ct;_e>5&&y(),_e<-5&&_(),p(null)},k=()=>{o&&(r===0?(h(!1),l(i)):r===i+a&&(h(!1),l(a)))},R=()=>{const T=[];for(let $=0;$<a;$+=1)T.push(s[i-1-$]);return T.reverse(),T},w=()=>{const T=[];for(let $=0;$<a;$+=1)T.push(s[$]);return T},C=N?"210px":"260px",E=N?.75:1;return e.jsxs("div",{className:"relative",children:[(o||r>0)&&e.jsx("button",{onClick:_,className:"border-divider absolute -left-2.5 top-1/2 z-10 hidden h-8 w-8 -translate-y-1/2 transform items-center justify-center rounded-full border bg-white pr-0.5 hover:bg-gray-100 sm:flex md:-left-4 md:h-10 md:w-10",children:e.jsx(xt,{className:"text-lg text-gray-700 md:text-2xl"})}),e.jsx("div",{className:"relative h-full overflow-hidden py-2",children:e.jsxs("div",{className:"grid gap-3 transition-all duration-200 sm:gap-4",style:{gridTemplateColumns:`repeat(${i}, calc(max((100% - ${2*E}rem)/3, ${C})))`,transform:`translateX(calc(-${r}*max((100% - ${2*E}rem)/3, ${C}) - ${r} * ${E}rem))`,transition:x?void 0:"none"},onTouchStart:j,onTouchMove:b,onTransitionEnd:()=>k(),children:[i>a&&o&&R(),s,i>a&&o&&w()]})}),(o||r<i-a)&&e.jsx("button",{onClick:y,className:"border-divider absolute -right-2.5 top-1/2 z-10 hidden h-8 w-8 -translate-y-1/2 transform items-center justify-center rounded-full border bg-white pl-0.5 hover:bg-gray-100 sm:flex md:-right-4 md:h-10 md:w-10",children:e.jsx(We,{className:"text-lg text-gray-700 md:text-2xl"})})]})};W.propTypes={children:m.arrayOf(m.element).isRequired,show:m.number.isRequired,infiniteLoop:m.bool};W.defaultProps={infiniteLoop:!1};function ft({product:t}){const{isReward:s}=hs(),{id:a,name:n,description:r,image_url:l,status:i,active_stock_control:c,stock:o,badge:u}=t,x=M(),h=i==="MISSING"||c&&o<=0,f=s(a);
4return e.jsxs("div",{"data-key":"v-product-card","data-product-id":`${a}`,className:P("card relative flex h-full w-full flex-col",!h&&"cursor-pointer"),onClick:()=>{h?I.viewProductBlocked(t):(I.viewProduct(t),x.push({hash:`#${He}`,search:t.kind==="combo"?`?comboId=${a}`:`?id=${a}`}))},children:[e.jsx("div",{className:"p-1",children:e.jsx("div",{className:"h-36 w-full overflow-hidden rounded-lg md:h-56",children:l?e.jsx(le,{src:l,alt:n,className:"h-36 w-full object-cover object-center md:h-56"}):e.jsx("div",{className:"flex h-full w-full items-center justify-center bg-gray-100 text-gray-400",children:e.jsx(Q,{className:"h-28 w-28 fill-current"})})})}),e.jsxs("div",{className:"flex flex-1 flex-col justify-between p-2 pt-2 sm:p-2.5",children:[e.jsxs("div",{className:"w-full max-w-full space-y-1 sm:space-y-2",children:[u&&e.jsx(ps,{badge:u}),e.jsx("h3",{className:"line-clamp-2 text-base font-medium leading-6 text-gray-700",children:n}),e.jsx("p",{className:"line-clamp-2 text-sm font-light text-gray-500",children:Fe(r)}),e.jsx(gs,{product:t})]}),e.jsx(js,{product:t}),e.jsx(vs,{product:t,className:"mt-1 sm:mt-2"})]}),f&&e.jsx(ys,{className:"absolute right-2.5 top-2.5"}),h&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"absolute inset-0 rounded-md bg-white opacity-60"}),e.jsx("div",{className:"absolute right-0 top-0 h-32 w-32 overflow-hidden",children:e.jsx("span",{className:"absolute -left-6 top-6 w-56 rotate-45 transform bg-primary py-0.5 text-center text-primary-contrast shadow sm:-left-8 sm:top-8 sm:py-1",children:"Esgotado"})})]}),!h&&t.highlight_as_new_until&&!S(t.highlight_as_new_until).isBefore(new Date,"day")&&e.jsx("div",{className:"absolute right-0 top-0 h-32 w-32 overflow-hidden",children:e.jsx("span",{className:"absolute -left-6 top-6 w-56 rotate-45 transform bg-green-500 py-0.5 text-center text-white shadow sm:-left-8 sm:top-8 sm:py-1",children:"Novidade"})})]})}ft.propTypes={product:m.shape({id:m.number,name:m.string,kind:m.string,description:m.string,image_url:m.string,status:m.string,active_stock_control:m.bool,stock:m.number,highlight_as_new_until:m.string,badge:m.string}).isRequired};const Re=d.memo(ft),ht=d.forwardRef(({category:t},s)=>{const{name:a,description:n,items:r}=t,l=L("(max-width:768px)");return!r||!Array.isArray(r)||r.length===0?null:e.jsxs("div",{className:"mt-8 md:mt-10",ref:s,children:[e.jsx("div",{className:"px-3 sm:px-0",children:e.jsx(Z,{name:a,description:n})}),l?e.jsx("div",{className:"flex overflow-y-auto",children:r.map(i=>e.jsx("div",{className:"mr-2 w-44 flex-shrink-0 first:ml-2 last:w-48 last:pr-2",children:e.jsx(Re,{product:i})},i.id))}):e.jsx(W,{show:3,children:r.map(i=>e.jsx(Re,{product:i},i.id))})]})});ht.propTypes={category:m.shape({id:m.number,name:m.string,description:m.string,items:m.arrayOf(m.shape({id:m.number,name:m.string,description:m.string,image_url:m.string,price:m.number}))}).isRequired};const vr=d.memo(ht);function pt(){var a;const t=g(({catalog:n})=>n.catalog),s=d.useMemo(()=>{const n=[];return t==null||t.forEach(r=>{r.items.forEach(l=>{l.highlighted&&n.push(l)})}),{name:"Destaques",items:n.sort((r,l)=>bs(r,l,"highlight_position"))}},[t]);return!s||!((a=s==null?void 0:s.items)!=null&&a.length)?null:e.jsx(vr,{category:s})}function gt(){const t=ws("highlights");return t.length>0?e.jsx("div",{className:"mt-8 w-full px-2 sm:px-0 md:mt-10",children:e.jsx("div",{className:"h-40 w-full overflow-hidden rounded-xl shadow sm:h-60",children:e.jsx(Ns,{slides:t})})}):null}function ee({notice:t}){const s=M();if(!t)return null;const{id:a,name:n,description:r,image_url:l}=t;return e.jsxs("div",{className:"card relative flex h-full w-full cursor-pointer flex-col",onClick:()=>s.push({hash:`#${Xe}`,search:`?id=${a}`}),children:[e.jsx("div",{className:"p-1",children:e.jsx("div",{className:"h-36 w-full overflow-hidden rounded-lg md:h-56",children:l?e.jsx(O,{src:l,alt:n,className:"h-full w-full object-cover object-center"}):e.jsx("div",{className:"flex h-full w-full items-center justify-center bg-gray-100 text-gray-400",children:e.jsx(Q,{className:"h-28 w-28 fill-current"})})})}),e.jsxs("div",{className:"flex flex-1 flex-col justify-between space-y-1 p-2 pt-2 sm:sp
4ace-y-2 sm:p-2.5",children:[e.jsx("h3",{className:"line-clamp-2 text-base font-medium leading-6 text-gray-700",children:n}),e.jsx("p",{className:"line-clamp-2 text-sm font-light text-gray-500",children:r})]})]})}ee.propTypes={notice:m.shape({id:m.number,name:m.string,description:m.string,image_url:m.string}).isRequired};function jt({notices:t}){const s=L("(max-width:768px)");return!t||(t==null?void 0:t.length)===0?null:e.jsx("div",{className:"mt-8 md:mt-10",children:s?e.jsx("div",{className:"flex overflow-y-auto",children:t.map(a=>e.jsx("div",{className:"mr-2 w-44 flex-shrink-0 first:ml-2 last:w-48 last:pr-2",children:e.jsx(ee,{notice:a})},a.id))}):e.jsx(W,{show:3,children:t.map(a=>e.jsx(ee,{notice:a},a.id))})})}jt.propTypes={notices:m.arrayOf(m.shape({id:m.number,name:m.string,description:m.string,image_url:m.string})).isRequired};S.extend(ae);S.extend(re);function vt(){const t=g(({company:l})=>l.company.events),s=g(({company:l})=>l.company.timeCorrection),a=g(({company:l})=>l.company.local_timezone);if(!(t!=null&&t.length))return null;const n=S().add(s||0,"seconds").tz(a||void 0),r=t.filter(l=>Cs(l,n,a));return r.length?e.jsx(jt,{notices:r}):null}function Ne(t,s){return!(t!=null&&t.add_ons)||!Array.isArray(t.add_ons)?!s||Object.keys(s||{}).length===0:!s||typeof s!="object"?!0:Object.keys(s).every(r=>{const l=t.add_ons.find(o=>String(o.id)===String(r));if(!l)return!1;const i=s[r];return!i||typeof i!="object"?!1:Object.keys(i).every(o=>{var h;const u=i[o];if(!u||u<=0)return!0;const x=(h=l.subitems)==null?void 0:h.find(f=>String(f.id)===String(o));return!(!x||x.status==="MISSING"||x.active_stock_control&&(x.stock==null||x.stock<=0))})})}function yt(t,s,a){var i;if(!((i=t==null?void 0:t.combo_steps)!=null&&i.length)||!s||!a)return!1;const n=t.combo_steps.map(c=>String(c.id)).sort(),r=Object.keys(s).sort();return ks(n,r)?t.combo_steps.every(c=>{var f;const o=String(c.id),u=s[o];if(!u||u.productId==null)return!1;const x=a[u.productId]??a[String(u.productId)];return!x||x.status!=="ACTIVE"||x.active_stock_control&&(x.stock==null||x.stock<=0)||!((f=c.combo_step_items)==null?void 0:f.find(p=>String(p.item_id)===String(u.productId)))?!1:Ne(x,u.addons||{})}):!1}function yr(t){return!(!t||t.status!=="ACTIVE"||t.active_stock_control&&(t.stock==null||t.stock<=0))}function bt(t,s){if(!t||!s)return null;const a=t.kind||"regular_item",n=t.productId??t.product_id,r=s[n]??s[String(n)];if(!r||!yr(r))return null;if(a==="combo"){const i=t.steps||{};if(!yt(r,i,s))return null;const c={};return r.combo_steps.every(u=>{const x=String(u.id),h=i[x];if(!h)return!1;const f=s[h.productId]??s[String(h.productId)];return f?(c[x]={productId:f.id,product:f,quantity:1,observation:h.observation||"",addons:h.addons||{}},!0):!1})?{productId:r.id,product:r,quantity:1,observation:t.observation||"",steps:c}:null}const l=t.addons||{};return Ne(r,l)?{productId:r.id,product:r,quantity:1,observation:t.observation||"",addons:l}:null}function br(t,s){if(!t||!s)return null;const a=t.kind||"regular_item",n=t.productId??t.product_id,r=s[n]??s[String(n)];if(!r)return null;if(a==="combo"){const i=t.steps||{};if(!yt(r,i,s))return null;const c={};return _s(i,(o,u)=>{const x=s[o.productId]??s[String(o.productId)];x&&(c[u]={product:x,addons:o.addons||{}})}),ce(r,c)}const l=t.addons||{};return Ne(r,l)?Ss(r,l):null}const wr="Este item não está mais disponível no momento.";function wt({eligibleItem:t,productsById:s}){const a=D(),n=qe(),{lastItem:r,displayPrice:l,name:i,thumbnailUrl:c,summary:o}=t,u=d.useCallback(()=>{const x=bt(r,s);if(!x){n.error(wr);return}const h=r.kind==="combo"?"combo":"regular_item";a(ne(x,h)),I.addProductToCart(x.product,x),n.success("Adicionado à sacola")},[r,s,a,n]);return e.jsxs("div",{"data-key":"order-again-card",className:"card relative flex h-full min-h-28 w-full cursor-pointer flex-col",onClick:u,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),u())},role:"button",tabIndex:0,children:[e.jsx("div",{className:"p-1",children:e.jsx("div",{className:"h-36 w-full overflow-hidden rounded-lg md:h-56",children:c?e.jsx(le,{src:c,alt:i,className:"h-36 w-full object-cover object-center md:h-56"}):e.jsx("div",{className:"flex h-full w-full items-center justify-center bg-gray-100 text-gray-400",children:e.jsx(Q,{className:"h-28 w-28 fill-current"})})})}),e.jsxs("div",{className:"flex flex-1 flex-col justify-between p-2 pt-2 sm:p-2.5",children:[e.jsxs("div",{className:"w-full max-w-full space-y-1 sm:space-y-2",children:[e.jsx("h3",{className:"line-clamp-2 text-base font-medium leading-6 text-gray-700",children:i}),(o==null?void 0:o.kind)==="regular"&&e.jsxs("div",{className:"text-sm font-light text-gray-500",children:[o.addonsText&&e.jsx("p",{className:"line-clamp-2",title:o.addonsText,children:o.addonsText}),o.observation&&e.jsxs("p",{className:"mt-0.5 line-clamp-1",title:o.observation,children:["OBS: ",o.observation]})]}),(o==null?void 0:o.kind)==="combo"&&e.jsx("p",{className:"line-clamp-3 text-sm font-light text-gray-500",title:o.stepsText,children:o.stepsText})]}),l!=null&&e.jsx("div",{className:"mt-3 text-base text-gray-700 md:mt-6",children:z.formatMonetaryValue(l)}
4),e.jsx("div",{className:"mt-2 text-sm font-medium text-primary",children:"Adicionar à sacola"})]})]})}wt.propTypes={eligibleItem:m.shape({lastItem:m.shape({kind:m.string}).isRequired,displayPrice:m.number,name:m.string.isRequired,thumbnailUrl:m.string,summary:m.oneOfType([m.shape({kind:m.oneOf(["regular"]).isRequired,addonsText:m.string,observation:m.string}),m.shape({kind:m.oneOf(["combo"]).isRequired,stepsText:m.string.isRequired})])}).isRequired,productsById:m.objectOf(m.shape({})).isRequired};const Ae=d.memo(wt);function Nr(t){if(!t)return"";const s=t.addons||{},a=Object.keys(s).sort(),n=t.steps||{},r=Object.keys(n).sort();return[t.kind,t.productId,t.observation||"",a.join(","),r.join(",")].join("|")}function De(t,s){if(!(t!=null&&t.add_ons)||!Array.isArray(t.add_ons)||!s)return[];const a=[];return Object.keys(s).forEach(n=>{const r=t.add_ons.find(i=>String(i.id)===String(n));if(!(r!=null&&r.subitems))return;const l=s[n]||{};Object.keys(l).forEach(i=>{const c=l[i];if(!c||c<=0)return;const o=r.subitems.find(u=>String(u.id)===String(i));o!=null&&o.name&&a.push(c>1?`${c}x ${o.name}`:o.name)})}),a}function Cr(t,s){if(!t||!s)return null;if(t.kind==="combo"){const i=s.steps||{},c=Object.keys(i).map(o=>{var p;const u=i[o],x=((p=u==null?void 0:u.product)==null?void 0:p.name)||"",h=De(u==null?void 0:u.product,(u==null?void 0:u.addons)||{}),f=h.length>0?` (${h.join(", ")})`:"";return`${x}${f}`});return c.length===0?null:{kind:"combo",stepsText:c.join(", ")}}const a=s.product,n=De(a,t.addons||{}),r=n.length>0?n.join(", "):null,l=typeof t.observation=="string"&&t.observation.trim()?t.observation.trim():null;return!r&&!l?null:{kind:"regular",addonsText:r||null,observation:l}}function _r(){const t=g(({customerManagement:f})=>{var p;return(p=f==null?void 0:f.main)==null?void 0:p.currentState}),s=g(({customerManagement:f})=>{var p;return(p=f==null?void 0:f.main)==null?void 0:p.customerDetails}),a=g(({catalog:f})=>f.products),n=g(({settings:f})=>f.menuMode),r=s==null?void 0:s.last_ordered_items,l=t===Es.AUTHENTICATED,i=n!==A.VIEW_ONLY,c=a&&Object.keys(a).length>0,o=Array.isArray(r)&&r.length>0,u=l&&i&&c&&o,x=d.useMemo(()=>{if(!u)return[];const f=[];return r.forEach((p,N)=>{const y=bt(p,a);if(!y)return;const _=y.product,j=br(p,a),b=(_==null?void 0:_.name)||"",k=(_==null?void 0:_.thumbnail_url)||(_==null?void 0:_.image_url),R=Cr(p,y);f.push({key:`${Nr(p)}-${N}`,lastItem:p,cartPayload:y,displayPrice:j??null,name:b,thumbnailUrl:k,summary:R})}),f},[u,a,r]),h=L("(max-width:768px)");return x.length===0?null:e.jsxs("div",{className:"mt-8 md:mt-10",children:[e.jsx("div",{className:"px-3 sm:px-0",children:e.jsx(Z,{name:"Peça novamente"})}),h?e.jsx("div",{className:"flex overflow-y-auto",children:x.map(f=>e.jsx("div",{className:"mr-2 w-44 flex-shrink-0 first:ml-2 last:w-48 last:pr-2",children:e.jsx(Ae,{eligibleItem:f,productsById:a})},f.key))}):e.jsx(W,{show:3,children:x.map(f=>e.jsx(Ae,{eligibleItem:f,productsById:a},f.key))})]})}const Nt=d.memo(_r);function Sr(){var h;const t=g(({catalog:f})=>f.catalog),[s,a]=d.useState(null),n=d.useRef(document.getElementById("root")),r=d.useRef(null),l=M(),i=Ts("/:company/categoria/:categoryId"),c=d.useMemo(()=>{var f;return(f=l.location.pathname)==null?void 0:f.split("/")[1]},[l.location.pathname]),o=d.useCallback(()=>{n.current&&r.current&&setTimeout(()=>{n.current.scrollTo({top:r.current.offsetTop,behavior:"smooth"})},100)},[]);d.useEffect(()=>{var p;if(!t)return;const f=(p=i==null?void 0:i.params)==null?void 0:p.categoryId;if(f){const N=t==null?void 0:t.find(y=>String(y.id)===f);N?a(N):(l.replace(`/${c}`),a(null))}else a(null)},[t,c,l,i]);const u=d.useCallback(f=>{l.push(`/${c}/categoria/${f}`),o()},[c,o,l]),x=d.useMemo(()=>s?()=>{l.replace(`/${c}`),a(null),o()}:null,[c,o,l,s]);return e.jsxs(e.Fragment,{children:[(t==null?void 0:t.length)>0&&e.jsx("div",{className:"mt-3 px-2 pt-2 sm:px-0 md:mt-6",ref:r,children:e.jsx(je.Provider,{value:{selectedCategoryId:s==null?void 0:s.id,handleCategorySelect:u,onGoBack:x,goToStart:o},children:e.jsx(ct,{})})}),!!t&&!s&&e.jsx(gt,{}),!!t&&!s&&e.jsx(vt,{}),!!t&&!s&&e.jsx(Nt,{}),!!t&&!s&&e.jsx(pt,{}),!t&&e.jsx(ut,{}),!s&&(t==null?void 0:t.length)>0&&e.jsxs("div",{className:"mt-8 px-2 sm:px-0 md:mt-10",children:[e.jsx("div",{className:"px-1 sm:px-0",children:e.jsx(Z,{name:"Categorias"})}),e.jsx("div",{className:"grid grid-cols-2 gap-2 md:grid-cols-3 lg:grid-cols-4",children:t.map(f=>e.jsx(at,{category:f,onCategorySelected:()=>{I.customEvent("select_category",{category_id:f.id,category_name:f.name}),I.viewCategory(f.name),u(f.id)}},f.id))})]}),s&&e.jsx(mt,{category:s},s.id),((t==null?void 0:t.length)===0||s&&!((h=s==null?void 0:s.items)!=null&&h.length))&&e.jsx(rt,{})]})}const kr=d.memo(Sr);var Ce={},Er=B,Tr=V;
4Object.defineProperty(Ce,"__esModule",{value:!0});var te=Ce.default=void 0,$r=Tr(v),Ir=Er(H()),Pr=(0,Ir.default)($r.createElement("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 4.17 4.42 9.92 6.24 12.11.4.48 1.13.48 1.53 0C14.58 18.92 19 13.17 19 9c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"}),"RoomRounded");te=Ce.default=Pr;function Rr(){const t=D(),s=g(({company:o})=>o.company.url_name),a=d.useRef(!0),n=async()=>a.current?(a.current=!1,{ok:!0,ts:Date.now()}):s?(t(Ue({company:s},!1)),t(Ye(!1,!1)),{ok:!0,ts:Date.now()}):{ok:!1},{data:r,mutate:l,isValidating:i,error:c}=$s(s?["local-data",s]:null,n,{dedupingInterval:1*60*60*1e3,refreshInterval:1*60*60*1e3,revalidateOnFocus:!0,revalidateIfStale:!0,revalidateOnReconnect:!0,shouldRetryOnError:!1});return{data:r,mutate:l,isValidating:i,error:c}}S.extend(re);S.extend(ae);function Ar(){const t=D(),s=M(),a=g(({company:p})=>p.company.url_name),n=g(({company:p})=>p.company.name),r=g(({company:p})=>p.company.city),l=g(({company:p})=>
4p.company.state),i=g(({company:p})=>p.company.logo),c=g(({company:p})=>p.company.image),o=g(Oe),u=g(Is),x=g(({company:p})=>p.company.timeCorrection),h=g(({company:p})=>p.company.local_timezone);Rr();const f=o.scheduling?"text-yellow-500":"text-red-500";return d.useEffect(()=>{let p=null;const N=6*60*60*1e3,y=[o.timeToUpdate,u].filter(b=>typeof b=="number"&&b>0),_=y.length>0?Math.min(...y):null,j=_?Math.min(_+Math.floor(1500+Math.random()*2e3),N):null;return j&&a&&(clearTimeout(p),p=setTimeout(()=>{const b=S().add(x||0,"seconds").tz(h||void 0);t(Ps(b)),t(Ue({company:a},!1)),t(Ye(!1,!1))},j)),()=>clearTimeout(p)},[a,t,o.timeToUpdate,u,x,h]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden w-full space-x-6 sm:flex",children:[(i||c)&&e.jsx("div",{className:"z-20 -mt-8 h-20 w-20 flex-shrink-0 rounded-md bg-white p-0.5 shadow sm:ml-0 sm:h-32 sm:w-32 sm:rounded-lg sm:p-1 md:ml-4 lg:-mt-12 lg:ml-12 lg:h-40 lg:w-40 lg:rounded-xl",children:e.jsx("div",{className:"h-full w-full overflow-hidden rounded-md bg-gradient-to-t from-white to-header sm:rounded-lg lg:rounded-xl",children:e.jsx(O,{src:i||c,alt:`Logo da empresa - ${n}`,className:"h-full w-full object-cover object-center"})})}),e.jsxs("div",{className:"mt-6 cursor-pointer",onClick:()=>s.push({hash:`#${Y}`}),children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-800 sm:text-3xl lg:text-4xl",children:n}),e.jsxs("div",{className:"mt-1 flex flex-wrap items-center space-x-3 text-gray-600 lg:mt-2",children:[e.jsx("div",{className:"my-2 flex items-center space-x-1.5",children:e.jsx("span",{className:P("text-sm font-medium",o.open?"text-green-500":f),children:o.label})}),e.jsx("div",{className:"h-1.5 w-1.5 flex-shrink-0 rounded-full bg-gray-700"}),r&&l&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"my-2 flex items-center space-x-1.5",children:[e.jsx(te,{fontSize:"small"}),e.jsx("span",{className:"text-sm",children:`${r} - ${l}`})]}),e.jsx("div",{className:"h-1.5 w-1.5 flex-shrink-0 rounded-full bg-gray-700"})]}),e.jsx("div",{className:"my-2 flex items-center space-x-1.5",children:e.jsx("span",{className:"text-sm font-semibold hover:opacity-80",children:"Mais informações"})})]})]})]}),e.jsxs("div",{className:"relative z-20 -mt-4 flex w-full flex-col items-center rounded-2xl bg-white px-3 pb-3 shadow-sm sm:hidden",onClick:()=>s.push({hash:`#${Y}`}),children:[i||c?e.jsx("div",{className:"-mt-11 rounded-full bg-white p-1.5",children:e.jsx("div",{className:"z-20 h-20 w-20 flex-shrink-0 overflow-hidden rounded-full bg-gradient-to-t from-white to-header shadow",children:e.jsx(O,{src:i||c,alt:`Logo da empresa - ${n}`,className:"h-full w-full object-cover object-center"})})}):e.jsx("div",{className:"h-3"}),e.jsx("h1",{className:"text-xl font-semibold text-gray-800",children:n}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center justify-center text-gray-600",children:[r&&l&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(te,{fontSize:"small"}),e.jsx("span",{className:"text-msm",children:`${r} - ${l}`})]}),e.jsx("div",{className:"mx-2.5 h-1.5 w-1.5 flex-shrink-0 rounded-full bg-gray-700"})]}),e.jsx("div",{className:"flex items-center space-x-1.5 text-gray-600",children:e.jsx("span",{className:"text-msm font-medium",children:"Mais informações"})})]}),e.jsx("span",{className:P("mt-2 text-msm font-semibold",o.open?"text-green-500":f),children:o.label})]})]})}const Dr=d.memo(Ar);function Mr(){const t=g(({catalog:u})=>u.catalog),[s,a]=d.useState(null),n=d.useRef([]),r=d.useRef(document.getElementById("root")),l=d.useRef(null),i=d.useCallback(({scroll:u})=>{if(n.current){const x=n.current.findIndex(h=>{var f;return u>(((f=l.current)==null?void 0:f.offsetTop)||0)+100&&u+.25*window.innerHeight<=h.offsetTop+h.clientHeight});if(x!==-1){const h=parseInt(n.current[x].getAttribute("data-category-id"));h&&s!==h&&a(h)}else s!==null&&a(null)}},[s]);de(i,r,600);const c=d.useCallback(u=>{if(u){const x=n.current.findIndex(h=>h.getAttribute("data-category-id")===u.getAttribute("data-category-id"));x===-1?n.current.push(u):n.current[x]=u}},[]),o=d.useCallback(u=>{if(u===null){r.current.scrollTo({top:0,behavior:"smooth"});return}const x=n.current.find(h=>parseInt(h.getAttribute("data-category-id"))===parseInt(u));x&&r.current.scrollTo({top:x.offsetTop-72,behavior:"smooth"})},[]);return e.jsxs(e.Fragment,{children:[(t==null?void 0:t.length)>0&&e.jsx("div",{className:"mt-3 px-2 pt-2 sm:px-0 md:mt-6",ref:l,children:e.jsx(je.Provider,{value:{selectedCategoryId:s,handleCategorySelect:o,goToStart:()=>o(null)},children:e.jsx(ct,{})})}),e.jsx(gt,{}),e.jsx(vt,{}),e.jsx(Nt,{}),e.jsx(pt,{}),!t&&e.jsx(ut,{}),(t==null?void 0:t.length)>0&&t.map(u=>e.jsx(mt,{category:u,ref:c},u.id)),(t==null?void 0:t.length)===0&&e.jsx(rt,{})]})}const Or=d.memo(Mr),Lr=Hs(({company:t})=>{var s;return(s=t.company.flags)==null?void 0:s.work_with_scheduled_order},({company:t})=>t.company.schedule_setting,(t,s)=>t&&s);function zr(){const t=D(),s=M(),a=L("(min-width:1024px)"),[n,r]=d.useState(null),l=d.useMemo(()=>({imageViewer:n,setImageViewer:r}),[n]),i=g(Lr),c=g(({settings:p})=>
4p.menuMode),o=g(({company:p})=>p.company.events),u=g(({company:p})=>{var N;return(N=p.company.flags)==null?void 0:N.show_categories_first}),x=g(({company:p})=>{var N;return(N=p.company.flags)==null?void 0:N.hide_shipping_calculation_at_beginning_catalog});d.useEffect(()=>{t(Rs())},[t]);const h=d.useMemo(()=>a?"min(calc(1280px - 320px - 1.75rem), calc(100% - 288px - 1.75rem))":"100%",[a]),f=[A.DELIVERY,A.CASH_DESK].includes(c);return e.jsxs("div",{className:"flex w-full justify-center sm:px-4 md:px-5 lg:space-x-7 xl:px-0",children:[e.jsxs("div",{className:"flex-1",style:{maxWidth:h},children:[e.jsx(Dr,{}),e.jsx(X,{className:"mx-2 mt-5 sm:mt-8",onClick:()=>s.push({hash:`#${Y}`})}),c===A.DELIVERY&&!a&&!x&&e.jsx("div",{className:"mx-2 mt-5 overflow-hidden rounded-md border border-divider bg-white sm:mx-0",children:e.jsx(As,{})}),!a&&e.jsx("div",{className:"mx-2 mt-3",children:e.jsx(Te,{})}),u?e.jsx(kr,{}):e.jsx(Or,{}),e.jsxs(se.Provider,{value:l,children:[e.jsx(Ha,{}),e.jsx(Ds,{}),e.jsx(Fs,{})]}),e.jsx(Ms,{}),e.jsx(va,{}),e.jsx(Ka,{}),(o==null?void 0:o.length)>0&&e.jsx(Pa,{}),c===A.DELIVERY&&e.jsx(Os,{}),c===A.DELIVERY&&i&&e.jsx(Wa,{}),f&&e.jsx(Ls,{}),f&&e.jsx(Ta,{}),f&&e.jsx(Ks,{}),c!==A.VIEW_ONLY&&!a&&e.jsx(zs,{})]}),c!==A.VIEW_ONLY&&a&&e.jsxs("div",{className:"flex flex-col",children:[e.jsx(Te,{className:"mt-5 w-72 xl:w-80"}),e.jsx("aside",{className:"sticky top-14 flex w-72 flex-shrink-0 flex-col pb-3 pt-5 xl:w-80",style:{height:"calc(100vh - 3.5rem)"},children:e.jsx(qs,{})})]})]})}const Wr=Object.freeze(Object.defineProperty({__proto__:null,default:zr},Symbol.toStringTag,{value:"Module"}));export{xr as H,Wr as M,Va as S,it as a,xt as d,Br as s};
5
6//# debugId=f1397e53-b9fb-5298-b01d-76c60273cf1e

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.