PageSourceSearch

https://www.komeykaya.cl/_next/static/chunks/3023-72604ff70201b86a.js?dpl=dpl_2JjKdRRaZyiHYwX5xSV6NiroSJrW

js komeykaya.cl collected 2026-09-24 11:07:18 UTC 76,848 bytes, 3 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3023],{70405:function(e,t,r){r.d(t,{Z:function(){return o}});var n=r(85893),i=r(1412),l=r(13180);function o(e){let{foodType:t}=e,r=(null!=t?t:[]).filter(e=>e in l.o);return 0===r.length?null:(0,n.jsx)("div",{className:"mt-3",children:(0,n.jsx)(i.Z,{foodTypes:r,showLabel:!0})})}},79819:function(e,t,r){r.d(t,{ib:function(){return l},Cj:function(){return a},pC:function(){return d.pC},rC:function(){return c.r},Ir:function(){return h},OV:function(){return b.O},Yt:function(){return g.Y}});var n=r(79911),i=r(67294);function l(e){var t;return(0,i.useMemo)(()=>e.map(e=>{var r;return"".concat(null!==(t=null===(r=e.product)||void 0===r?void 0:r.id)&&void 0!==t?t:"",":").concat(e.count,":").concat(JSON.stringify(e.items))}).join("|"),[e])}var o=r(26628),s=r(1832);function a(){let e=(0,o.v9)(e=>e.cart.cart),t=(0,o.v9)(e=>e.cart.subtotal),r=(0,o.v9)(e=>e.cart.delivery),n=(0,o.v9)(e=>e.cart.discount),l=(0,o.v9)(e=>e.cart.coupon),a=(0,o.v9)(e=>e.cart.subtotalLoading),d=(0,i.useMemo)(()=>e.reduce((e,t)=>e+t.count,0),[e]),c=(0,i.useMemo)(()=>e.reduce((e,t)=>e+(0,s.xj)(t.items,t.count,t.basePrice),0),[e]),u=t||c;return{cart:e,itemCount:d,subtotal:u,delivery:r,discount:n,total:u+r-n,coupon:l,subtotalLoading:a,hasItems:e.length>0}}r(5190);var d=r(84029),c=r(11731);r(29821);var u=r(11163),m=r(80286),x=r(37453),f=r(2919);let v={price:null,quantity:1,modifiers:{},instructions:"",attempted:!1,editingItem:null},p=(e,t)=>e.name===t.name;function h(){var e;let t=(0,o.I0)(),r=(0,u.useRouter)(),[l,a]=(0,i.useState)(v),{ensureCanAddToCart:d}=(0,n.N)(),c=(0,o.v9)(t=>{var r;return null!==(e=null===(r=t.menu)||void 0===r?void 0:r.priceDetail)&&void 0!==e?e:null});(0,i.useEffect)(()=>{l.price&&!l.price.product&&(null==c?void 0:c.product)&&c.id===l.price.id&&a(e=>({...e,price:c}))},[c,l.price]);let{enabled:h,maxLength:b}=(0,x.y)(),g=(0,i.useCallback)((e,t)=>{var n,i;let l=(null===(n=e.product)||void 0===n?void 0:n.name)||"",o=null===(i=e.product)||void 0===i?void 0:i.id;if(!o)return;let s="".concat((0,m.lV)(l),"-").concat(o),a=(0,m.lV)(t||""),d=[a,s].filter(Boolean);r.push({pathname:r.pathname,query:{...r.query,all:d}},"/product/".concat(d.join("/")),{shallow:!0})},[r]),y=(0,i.useCallback)((e,t)=>{a({...v,price:e}),g(e,t)},[g]),j=(0,i.useCallback)((e,t)=>{let r={id:e.product.id,price:e.basePrice,discountPrice:e.basePrice,menuDiscount:"",stock:!0,hidden:!1,product:e.product};a({price:r,quantity:e.count,modifiers:e.items,instructions:e.instructions||"",attempted:!1,editingItem:e}),g(r,t)},[g]),N=(0,i.useCallback)(()=>{a(v),r.query.all&&r.push({pathname:r.pathname,query:{...r.query,all:void 0}},"/",{shallow:!0})},[r]),P=(0,i.useCallback)(e=>{a(t=>({...t,quantity:Math.max(1,e)}))},[]),C=(0,i.useCallback)(e=>{a(t=>({...t,instructions:e}))},[]),S=(0,i.useCallback)((e,t,r)=>{a(n=>{let i=String(e.id),l=n.modifiers[i]||[];if(r)return{...n,modifiers:{...n.modifiers,[i]:[{...t,quantity:1}]}};let o=l.some(e=>p(e,t)),s=l.reduce((e,t)=>e+(t.quantity||1),0);return o?{...n,modifiers:{...n.modifiers,[i]:l.filter(e=>!p(e,t))}}:1===e.maxQuantityModifiers?{...n,modifiers:{...n.modifiers,[i]:[{...t,quantity:1}]}}:e.maxQuantityModifiers&&s>=e.maxQuantityModifiers?n:{...n,modifiers:{...n.modifiers,[i]:[...l,{...t,quantity:1}]}}})},[]),k=(0,i.useCallback)((e,t,r)=>{a(n=>{let i=String(e.id),l=n.modifiers[i]||[];if(r<=0)return{...n,modifiers:{...n.modifiers,[i]:l.filter(e=>!p(e,t))}};let o=l.filter(e=>!p(e,t)).reduce((e,t)=>e+(t.quantity||1),0),s=t.maxQuantityModifiers||e.maxQuantityModifiers,a=s?Math.min(s,e.maxQuantityModifiers-o):e.maxQuantityModifiers-o,d=e.maxQuantityModifiers?Math.min(r,a):r,c=l.some(e=>p(e,t)),u=c?l.map(e=>p(e,t)?{...e,quantity:d}:e):[...l,{...t,quantity:d}];return{...n,modifiers:{...n.modifiers,[i]:u}}})},[]),w=(0,i.useCallback)((e,t)=>{var r;let n=l.modifiers[String(e)];return null!==(r=null==n?void 0:n.some(e=>p(e,t)))&&void 0!==r&&r},[l.modifiers]),O=(0,i.useCallback)((e,t)=>{var r,n;let i=l.modifiers[String(e)];return null!==(n=null===(r=null==i?void 0:i.find(e=>p(e,t)))||void 0===r?void 0:r.quantity)&&void 0!==n?n:0},[l.modifiers]),I=(0,i.useCallback)(e=>{var t;let r=l.modifiers[String(e)];return null!==(t=null==r?void 0:r.reduce((e,t)=>
1e+(t.quantity||1),0))&&void 0!==t?t:0},[l.modifiers]),M=(0,i.useCallback)(()=>l.price?(0,s.xj)(l.modifiers,l.quantity,l.price.discountPrice):0,[l]),Z=(0,i.useCallback)(()=>{var e;return l.price?(null!==(e=l.price.product.modifiers)&&void 0!==e?e:[]).filter(e=>{if(e.minQuantityModifiers<=0)return!1;let t=l.modifiers[String(e.id)]||[],r=t.reduce((e,t)=>e+(t.quantity||1),0);return r<e.minQuantityModifiers}).map(e=>e.id):[]},[l]),E=(0,i.useCallback)(()=>0===Z().length&&!!l.price,[Z,l.price]),T=(0,i.useCallback)(()=>{if(!l.price)return null;let e=Z();if(e.length>0){a(e=>({...e,attempted:!0}));let t=document.querySelector('[data-modifier-id="'.concat(e[0],'"]'));return t&&t.scrollIntoView({behavior:"smooth",block:"start"}),null}let{product:t}=l.price,r={count:l.quantity,product:t,specialRequirement:"",category:"",basePrice:l.price.discountPrice,instructions:l.instructions,items:l.modifiers,hash:""};return r.hash=(0,s.XR)(r),{...r,dispatchMethod:t.dispatchMethod}},[l,Z]),D=(0,i.useCallback)(()=>{let e=T();if(!e)return;if(l.editingItem){t(f.ZP.modifyItem({item:e,outdatedItem:l.editingItem,checkCart:!1})),N();return}let r=d(e,{checkCart:!1});if(!r){N();return}t(f.ZP.addItem({item:e,closeUrl:void 0,checkCart:!1})),N()},[l.editingItem,t,N,T,d]);return{price:l.price,isOpen:null!==l.price,quantity:l.quantity,modifiers:l.modifiers,instructions:l.instructions,productInstructionsEnabled:h,productInstructionsMaxLength:b,attempted:l.attempted,editingItem:l.editingItem,isEditing:null!==l.editingItem,open:y,openForEdit:j,close:N,setQuantity:P,setInstructions:C,toggleModifier:S,setModifierQuantity:k,isModifierSelected:w,getModifierQuantity:O,getGroupTotalQuantity:I,calculateTotal:M,canAddToCart:E,getIncompleteModifiers:Z,buildItem:T,addToCart:D}}r(22131);var b=r(22216),g=r(75704)},79911:function(e,t,r){r.d(t,{N:function(){return d}});var n=r(67294),i=r(26628),l=r(18672),o=r(2919),s=r(63253),a=r(4376);function d(){var e;let t=(0,i.I0)(),r=(0,i.v9)(e=>e.searchStore.dispatchType),d=(0,i.v9)(e=>e.searchStore.currentSubsidiary),c=(0,i.v9)(e=>{var t;return null===(t=e.auth.address)||void 0===t?void 0:t.current}),u=(0,i.v9)(e=>{var t;return null===(t=e.menu)||void 0===t?void 0:t.isPreview}),m=(0,i.v9)(t=>{var r,n;return null!==(e=null===(r=t.cart)||void 0===r?void 0:null===(n=r.cart)||void 0===n?void 0:n.length)&&void 0!==e?e:0}),x=r===l.CK.DELIVERY,f=!!c&&!c.isStoreAddress,v=!!(null==d?void 0:d.id),p=(x?f:v)&&(m>0||!u),h=(0,n.useCallback)(function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(p)return!0;let n={item:e,closeUrl:r.closeUrl,checkCart:r.checkCart};return t(o.ZP.setPendingAddToCart(n)),t(s.ZP.openModal(a.ee.DELIVERY_OR_PICKUP)),!1},[p,t]);return{canAddToCart:p,ensureCanAddToCart:h}}},5190:function(e,t,r){r.d(t,{_:function(){return l}});var n=r(26628),i=r(18672);function l(){let e=(0,n.v9)(e=>e.searchStore.dispatchType),t=(0,n.v9)(e=>e.searchStore.currentSubsidiary),r=(0,n.v9)(e=>e.searchStore.deliveryOptions),l=(0,n.v9)(e=>e.searchStore.deliveryOptionsLoading),o=(0,n.v9)(e=>{var t;return null===(t=e.auth.address)||void 0===t?void 0:t.current});if(e!==i.CK.DELIVERY||!o||o.isStoreAddress||!(null==t?void 0:t.id)||l||!r||"boolean"!=typeof r.hasDelivery)return{hasMismatch:!1,outOfCoverage:!1};let s=!r.hasDelivery||!r.store,a=r.store,d=s||!!a&&a.id!==t.id;return{hasMismatch:d,alternateStore:a||void 0,outOfCoverage:s}}},92182:function(e,t,r){let n;r.d(t,{j:function(){return b}});let i=e=>`The setOptions() function should only be called once. The options passed to the additional call (${JSON.stringify(e)}) will be ignored.`,l=e=>`The google.maps.importLibrary() function is already defined, and @googlemaps/js-api-loader will use the existing function instead of overwriting it. The options passed to setOptions (${JSON.stringify(e)}) will be ignored.`,o=(e,t)=>`Failed to create Trusted Types policy "${e}": ${t instanceof Error?t.message:String(t)}.
2
3If your Content Security Policy uses "require-trusted-types-for 'script'", allow this policy with "trusted-types ${e} google-maps-api-loader google-maps-api#html lit-html". The "google-maps-api-loader", "lit-html", and "google-maps-api#html" policies are required for full Maps JavaScript API execution. Falling back to a string script URL.`,s=()=>{},a=()=>{},d="@googlemaps/js-api-loader",c={createScriptURL:e=>e},u=e=>{var t,r,i,l="The Google Maps JavaScript API",a="google",u="importLibrary",m="__ib__",x=document,f=window,v=f[a]||(f[a]={}),p=v.maps||(v.maps={}),h=new Set,b=new URLSearchParams,g=()=>t||(t=new Promise(async(u,f)=>{for(i in await (r=x.createElement("script")),b.set("libraries",[...h]+""),e)b.set(i.replace(/[A-Z]/g,e=>"_"+e[0].toLowerCase()),e[i]);b.set("callback",a+".maps."+m),r.src=(function(){if(n)return n;let e=globalThis.trustedTypes;if(!e)return n=c;try{n=e.createPolicy(d,{createScriptURL:e=>e})}catch(e){s(o(d,e)),n=c}return n}
3)().createScriptURL("https://maps.googleapis.com/maps/api/js?"+b),p[m]=u,r.onerror=()=>t=f(Error(l+" could not load.")),r.nonce=x.querySelector("script[nonce]")?.nonce||"",x.head.append(r)}));p[u]?console.warn(l+" only loads once. Ignoring:",e):p[u]=(e,...t)=>h.add(e)&&g().then(()=>p[u](e,...t))},m=!1;async function x(e){if(m||s("No options were set before calling importLibrary. Make sure to configure the loader using setOptions()."),!window?.google?.maps?.importLibrary)throw Error("google.maps.importLibrary is not installed.");return await google.maps.importLibrary(e)}var f=r(67294),v=r(82892);let p=!1,h=null;function b(){let[e,t]=(0,f.useState)(()=>{var e;return!!(null===(e=window.google)||void 0===e?void 0:e.maps)}),[r,n]=(0,f.useState)(null),o=(0,f.useCallback)(()=>{e||(h||(p||(function(e){if(m){s(i(e));return}e.apiKey&&(s("The 'apiKey' parameter was used in setOptions(), but 'key' is the correct parameter name. Please update your configuration."),e.key||(e.key=e.apiKey)),function(e){let t=!!window.google?.maps?.importLibrary;t&&a(l(e)),t||u(e)}(e),m=!0}
3({key:"AIzaSyCog-DSUAvTeLmHQGiV50_TAeQu8W1dM0Q",language:v.N.language}),p=!0),h=Promise.all([x("maps"),x("marker"),x("places"),x("geocoding")]).then(()=>void 0).catch(e=>{throw h=null,e})),h).then(()=>t(!0)).catch(e=>n(e instanceof Error?e:Error(String(e))))},[e]);return{google:window.google,isLoaded:e,error:r,load:o}}},84029:function(e,t,r){r.d(t,{GH:function(){return x},le:function(){return f},pC:function(){return v}});var n=r(67294),i=r(26628),l=r(13180),o=r(97844),s=r(4450),a=r(34484),d=r(62993),c=r(22216),u=r(24398),m=r(60589);function x(e,t){var r,n,i;let l=(0,d.t)(e,t.futureOrder,t.futureOrdersEnabled,t.businessHours,t.maxDaysAvailableFutureOrder),o=!l.hasStock&&!!l.enableFutureOrder&&!!l.backToStockDate;return{hasStock:l.hasStock,isAvailable:null!==(r=l.isAvailable)&&void 0!==r?r:l.hasStock,reservable:o,backToStockDate:null!==(n=l.backToStockDate)&&void 0!==n?n:null,availableOnDaysString:null!==(i=l.availableOnDaysString)&&void 0!==i?i:""}}function f(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c.a;return e&&Array.isArray(e)?e.reduce((e,r)=>{if(!r.prices)return e;let n=Array.isArray(r.prices)?r.prices:[],i=n.filter(e=>!e.hidden&&!e.__isDummyPlaceholder).map(e=>(function(e,t){var r,n,i,o,a,d,c,u,x,f,v;let p=!!e.menuDiscount||null!=e.discountPrice&&e.discountPrice<e.price,h=(0,s.p)(e),b=!t.hasStock&&!t.reservable,g=(null==(v=e.product)?void 0:v.label)&&(0,m.todayIsInRange)(v.startDatetimeLabel,v.endDatetimeLabel)?{label:v.label,labelType:v.labelType}:null;return{priceId:e.id,productId:e.product.id,name:e.product.name,description:e.product.description,price:e.price,discountPrice:e.discountPrice,hasDiscount:p,hasOptions:h,imageUrl:(null===(r=e.product.pictures)||void 0===r?void 0:null===(n=r[0])||void 0===n?void 0:null===(i=n.cropperUrl)||void 0===i?void 0:i.small)||(null===(o=e.product.pictures)||void 0===o?void 0:null===(a=o[0])||void 0===a?void 0:a.url),hasModifiers:(null!==(c=null===(d=e.product.modifiers)||void 0===d?void 0:d.length)&&void 0!==c?c:0)>0,disabled:b,stock:e.stock,hidden:e.hidden,foodTypes:(null!==(u=e.product.foodType)&&void 0!==u?u:[]).filter(e=>e in l.o),label:null!==(x=null==g?void 0:g.label)&&void 0!==x?x:null,labelType:null!==(f=null==g?void 0:g.labelType)&&void 0!==f?f:null,rawPrice:e,stockStatus:t}})(e,x(e,t)));return 0===i.length?e:[...e,{id:r.id,name:r.name,slug:(0,u.$)(r.name,r.id),products:i}]},[]):[]}function v(){let e=(0,i.v9)(o.r3),t=(0,i.v9)(o.VL),r=(0,i.v9)(o.Rc),l=(0,i.v9)(o.az),s=(0,i.v9)(o.O8),d=(0,i.v9)(e=>{var t;return null===(t=e.searchStore.currentSubsidiary)||void 0===t?void 0:t.id}
3),u=(0,c.O)(),m=(0,a.w)(),[x,v]=(0,n.useState)(!1);(0,n.useEffect)(()=>{v(!0)},[]);let p=e?t||[]:m.menu||[],h=e?r:m.loading,b=!x||h||!d&&0===p.length,g=(0,n.useMemo)(()=>f(p,u),[p,u]);return{categories:g,loading:b,isSplitMenu:e,priceGroups:l,selectedPriceGroupId:s}}},11731:function(e,t,r){r.d(t,{r:function(){return i}});var n=r(26628);function i(){let e=(0,n.v9)(e=>e.cart.cartLoading),t=(0,n.v9)(e=>e.cart.pricingError);return!!t&&!e}},29821:function(e,t,r){r.d(t,{H:function(){return i}});var n=r(26628);function i(e){var t,r;return(0,n.v9)(n=>{var i;return(null!==(t=null===(i=n.cart)||void 0===i?void 0:i.cart)&&void 0!==t?t:[]).filter(t=>{var r;return(null===(r=t.product)||void 0===r?void 0:r.id)===e}).reduce((e,t)=>e+(null!==(r=t.count)&&void 0!==r?r:0),0)})}},37453:function(e,t,r){r.d(t,{y:function(){return i}});var n=r(26628);function i(){let e=(0,n.v9)(e=>{var t,r;return(null===(t=null===(r=e.core)||void 0===r?void 0:r.settings)||void 0===t?void 0:t.productInstructions)===!0}),t=(0,n.v9)(e=>{var t,r;return(null===(t=null===(r=e.core)||void 0===r?void 0:r.settings)||void 0===t?void 0:t.productInstructionsMaxLength)||30});return{enabled:e,maxLength:t}}},93098:function(e,t,r){r.d(t,{t:function(){return m}});var n=r(67294),i=r(26628),l=r(2919),o=r(63253),s=r(4376),a=r(19034),d=r(84029),c=r(22216);let u={hasStock:!0,isAvailable:!0,reservable:!1,backToStockDate:null,availableOnDaysString:""};function m(e){let t=(0,c.O)(),r=(0,i.I0)(),m=(0,n.useMemo)(()=>e?(0,d.GH)(e,t):u,[e,t]),x=(0,n.useCallback)(e=>{if(!m.backToStockDate)return;let{item:t,onBeforeOpen:n}=null!=e?e:{};r(a.default.setPreselectedFutureOrderDate({date:m.backToStockDate.format("YYYY-MM-DD"),time:m.backToStockDate.format("HH:mm")})),t&&r(l.ZP.setPendingScheduledAdd({item:t})),null==n||n(),r(o.ZP.openModal(s.ee.FUTURE_ORDER))},[r,m.backToStockDate]);return{stockStatus:m,reserve:x}}},22216:function(e,t,r){r.d(t,{O:function(){return o},a:function(){return l}});var n=r(67294),i=r(26628);let l={futureOrder:null,futureOrdersEnabled:!1,businessHours:[],maxDaysAvailableFutureOrder:0};function o(){var e,t,r,o;let s=(0,i.v9)(t=>{var r;return null!==(e=null===(r=t.order)||void 0===r?void 0:r.futureOrder)&&void 0!==e?e:null}),a=(0,i.v9)(e=>{var r;return null!==(t=null===(r=e.searchStore.currentSubsidiary)||void 0===r?void 0:r.futureOrdersEnabled)&&void 0!==t&&t}),d=(0,i.v9)(e=>{var t;return null!==(r=null===(t=e.searchStore.currentSubsidiary)||void 0===t?void 0:t.businessHours)&&void 0!==r?r:l.businessHours}),c=(0,i.v9)(e=>{var t,r;return null!==(o=null===(t=e.core)||void 0===t?void 0:null===(r=t.settings)||void 0===r?void 0:r.maxDaysAvailableFutureOrder)&&void 0!==o?o:0});return(0,n.useMemo)(()=>({futureOrder:s,futureOrdersEnabled:a,businessHours:d,maxDaysAvailableFutureOrder:c}),[s,a,d,c])}},75704:function(e,t,r){r.d(t,{Y:function(){return c}});var n=r(26982),i=r(26628),l=r(18672),o=r(31089),s=r(40250),a=r(79345),d=r(67921);function c(){let e=(0,i.v9)(e=>e.searchStore.currentSubsidiary),t=(0,i.v9)(e=>e.searchStore.dispatchType),r=(0,i.v9)(e=>e.order.futureOrder),c=(0,i.v9)(e=>{var t,r;return null===(t=e.core)||void 0===t?void 0:null===(r=t.settings)||void 0===r?void 0:r.subscriptionStatus});if(!(null==e?void 0:e.id))return{kind:"no-store",color:"gray",label:n.ZP.t("V2StoreStatus:noStore"),canCheckout:!1,isOpenNow:!1,clickAction:"none"};if((0,s.o)(c))return{kind:"closed",color:"red",label:n.ZP.t("V2StoreStatus:temporarilyClosed"),canCheckout:!1,isOpenNow:!1,clickAction:"none"};let u=e.businessHours||[],m=t===l.CK.DELIVERY,{deliveryOpen:x}=e,{pickUpOpen:f}=e,v=!!e.futureOrdersEnabled,p=e.orderMethod===o.pO.NEITHER,h=!p&&!!(m?x:f);if(null==r?void 0:r.date)return{kind:"scheduled",color:"blue",label:n.ZP.t("V2StoreStatus:scheduledShort"),canCheckout:!0,isOpenNow:h,clickAction:"schedule"};if(h){let e=(0,a.hM)(u,t),r=(null==e?void 0:e.openingTime)?(0,d.m)(e.openingTime):"",i=(null==e?void 0:e.closingTime)?(0,d.m)(e.closingTime):"";return{kind:"open",color:"green",label:r&&i?n.ZP.t("V2StoreStatus:openRange",{opening:r,closing:i}):n.ZP.t("V2StoreStatus:openNow"),canCheckout:!0,isOpenNow:h,clickAction:"hours"}}let b=function(e,t){if(!e||0===e.length)return null;let r=(0,a.a8)(),n=r.day(),i=60*r.hour()+r.minute();for(let r=0;r<7;r+=1){let l=a.Dm[(n+r)%7]||"",o=e.find(e=>{var n;if((null===(n=e.day)||void 0===n?void 0:n.toLowerCase())!==l||e.dispatchMethod!==t&&"both"!==e.dispatchMethod)return!1;let o=(0,a.xM)(e.openingTime);return null!=o&&(r>0||o>i)});if(o)return{dayOffset:r,openingTime:o.openingTime,dayName:l}}return null}(u,t),g=function(e){if(!e)return n.ZP.t("V2StoreStatus:opensSoon");let t=(0,d.m)(e.openingTime);if(0===e.dayOffset)return n.ZP.t("V2StoreStatus:opensToday",{time:t});if(1===e.dayOffset)return n.ZP.t("V2StoreStatus:opensTomorrow",{time:t});let r=n.ZP.t("V2Days:".concat(e.dayName));return n.ZP.t("V2StoreStatus:opensOn",{day:r,time:t})}(b);return!p&&v&&b?{kind:"closed-with-futures",color:"amber",label:n.ZP.t("V2StoreStatus:closedReopens",{opens:g}),canCheckout:!1,isOpenNow:h,clickAction:"schedule"}:{kind:"closed",color:"red",label:p?n.ZP.t("V2StoreStatus:temporarilyClosed"):n.ZP.t("V2StoreStatus:closedReopens",{opens:g}),canCheckout:!1,isOpenNow:h,clickAction:"hours"}}},98609:function(e,t,r){r.d(t,{O:function(){return ew}});var n=r(85893),i=r(26982),l=r(11163),o=r(67294),s=r(26628),a=r(63253),d=r(4376),c=r(31842),u=r(80006),m=r(62609),x=r(18672),f=r(2919),v=r(97844),p=r(24754);r(3547);var h=r(46485),b=r(40250),g=r(94651),y=r(4606),j=r(60589),N=r(92852),P=r(74134),C=r(59074);function S(){let e=(0,s.I0)(),t=(0,s.v9)(e=>e.modal["".concat(d.ee.STORE_CLOSED,"ModalIsOpen")]),r=(0,s.v9)(e=>!!e.modal["".concat(d.ee.DELIVERY_OR_PICKUP,"ModalIsOpen")]),{currentSubsidiary:l}=(0,s.v9)(e=>e.searchStore),{tenant:m}=(0,s.v9)(e=>e.core.settings),f=(0,s.v9)(e=>e.searchStore[y.mq]),v=(0,s.v9)(e=>e.core.settings.subscriptionStatus||b.q.ACTIVE),{closedByAttribute:p,deliveryOpe
3n:S,pickUpOpen:k,futureOrdersEnabled:w}=(0,g.Z)(),O=(0,b.o)(v),I=S&&!k,M=k&&!S,Z=M||I,E=!!t&&!r,T=(0,o.useRef)(!1);(0,o.useEffect)(()=>{E&&!T.current&&N.Z.storeClosedViewed({tenant:m,storeId:null==l?void 0:l.id,storeName:null==l?void 0:l.name}),T.current=E},[E]);let D=(0,o.useMemo)(()=>{let e=null==l?void 0:l.businessHours;if(!(null==e?void 0:e.length))return[];let t=C.S.serialize((0,j.normalizeBusinessHours)(e,null,!0)),r=t&&Object.keys(t)[0]===h.V.both,n=r?h.V.both:h.V[f],i=null==t?void 0:t[n];return(null==i?void 0:i.length)?(0,j.mergeSchedules)(i):[]},[null==l?void 0:l.businessHours,f]),L=()=>{O||e(a.ZP.closeModal(d.ee.STORE_CLOSED))};return!t||r?null:(0,n.jsx)(u.u_,{open:t,onClose:L,title:"",maxWidth:"md",children:(0,n.jsxs)("div",{className:"flex flex-col items-center p-2 text-center",children:[(0,n.jsx)("div",{className:"mb-3 flex h-20 w-20 items-center justify-center rounded-full !bg-warning-soft",children:(0,n.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-warning",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,n.jsx)("polyline",{points:"12 6 12 12 16 14"})]})}),(0,n.jsx)("h2",{className:"mb-2 font-title text-xl font-bold text-content",children:O?i.ZP.t("StoreInfo:titleStoreClosed"):M?i.ZP.t("StoreInfo:titleStoreClosedDelivery"):I?i.ZP.t("StoreInfo:titleStoreClosedPickup"):i.ZP.t("StoreInfo:titleStoreClosed")}),I&&!O&&(0,n.jsxs)("p",{className:"mb-3 text-sm text-content-tertiary",children:[i.ZP.t("StoreInfo:availableTitle")," ",(0,n.jsx)("strong",{className:"font-semibold",children:i.ZP.t("StoreInfo:availableDelivery")})]}),M&&!O&&(0,n.jsxs)("p",{className:"mb-3 text-sm text-content-tertiary",children:[i.ZP.t("StoreInfo:availableTitle")," ",(0,n.jsx)("strong",{className:"font-semibold",children:i.ZP.t("StoreInfo:availablePickup")})]}),!p&&!O&&D.length>0&&(0,n.jsxs)("div",{className:"mb-5 w-full text-left",children:[(0,n.jsx)("p",{className:"mb-2 text-xs font-medium uppercase tracking-wide text-content-muted",children:f===x.CK.PICKUP?i.ZP.t("StoreInfo:subtitleStoreClosedLocal"):i.ZP.t("StoreInfo:subtitleStoreClosedDelivery")}),(0,n.jsx)("ul",{"data-testid":"business-hours",className:"divide-y divide-line-subtle overflow-hidden rounded-2xl border border-line-subtle bg-surface",children:D.map(e=>(0,n.jsxs)("li",{className:"flex items-center justify-between px-4 py-2.5 text-sm",children:[(0,n.jsx)("span",{className:"font-medium capitalize text-content",children:e.endDay?"".concat(e.startDay," - ").concat(e.endDay):e.startDay}),(0,n.jsx)("span",{className:"tabular-nums text-content-tertiary",children:e.range})]},e.startDay))})]}),(0,n.jsxs)("div",{className:"flex w-full flex-col gap-2",children:[Z&&!O&&(0,n.jsx)(P.z,{variant:"primary",fullWidth:!0,onClick:()=>{e(c.default.getStoreData({id:l.id,dispatchType:I?x.CK.DELIVERY:x.CK.PICKUP})),e(a.ZP.closeModal(d.ee.STORE_CLOSED))},children:i.ZP.t("StoreInfo:".concat(I?"continueDelivery":"continuePickup"))}),!O&&!!w&&!p&&(0,n.jsx)(P.z,{variant:Z?"secondary":"primary",fullWidth:!0,onClick:()=>{(null==l?void 0:l.id)&&e(c.default.getStoreData({id:l.id,dispatchType:f||x.CK.PICKUP})),e(a.ZP.closeModal(d.ee.STORE_CLOSED)),e(a.ZP.openModal(d.ee.FUTURE_ORDER))},children:i.ZP.t("StoreInfo:scheduleOrder")}),!O&&(0,n.jsx)(P.z,{variant:"ghost",fullWidth:!0,onClick:L,className:"border border-line",children:i.ZP.t("StoreInfo:close")})]})]})})}function k(){let e=(0,s.I0)(),t=(0,s.v9)(e=>e.modal["".concat(d.ee.SESSION_CLOSED,"ModalIsOpen")]),r=()=>{e(a.ZP.closeModal(d.ee.SESSION_CLOSED))};return t?(0,n.jsx)(u.u_,{open:t,onClose:r,maxWidth:"sm",children:(0,n.jsxs)("div",{className:"flex flex-col items-center px-2 py-4 text-center",children:[(0,n.jsx)("div",{className:"mb-2 flex h-16 w-16 items-center justify-center rounded-full !bg-surface-muted",children:(0,n.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-content-muted",children:[(0,n.jsx)("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),(0,n.jsx)("polyline",{points:"16 17 21 12 16 7"}),(0,n.jsx)("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]})}),(0,n.jsx)("h2",{className:"mb-4 font-title text-xl font-bold text-content",children:i.ZP.t("CloseSession:sessionClosed")}),(0,n.jsx)(P.z,{variant:"primary",fullWidth:!0,onClick:r,children:i.ZP.t("CloseSession:close")})]})}):null}
3r(45936),r(99730);var w=r(27484),O=r.n(w),I=r(19034),M=r(61820),Z=r(36512),E=r.n(Z),T=r(18413),D=r(67921);function L(){var e,t;let r=(0,s.I0)(),{handleSelectHours:l,handleSelectTime:o,selectedTime:c,selectedDate:m,parsedOptions:x,timeOptions:v,timeIsAvailable:p,unavailableFutureHours:h,setIsScheduled:b,isScheduled:y,showCancelBtn:j,shouldOpenProductDetails:P}=(0,M.Z)(),C=(0,s.v9)(e=>e.modal["".concat(d.ee.FUTURE_ORDER,"ModalIsOpen")]),{onlyScheduledOrders:S}=(0,g.Z)(),{tenant:k}=(0,s.v9)(e=>e.core.settings),w=(0,s.v9)(e=>null!==(t=e.cart.pendingScheduledAdd)&&void 0!==t?t:null),Z=()=>{r(I.default.setPreselectedFutureOrderDate(null)),r(a.ZP.closeModal(d.ee.FUTURE_ORDER)),P&&r(a.ZP.openModal(d.ee.PRODUCT_DETAIL))},L=!(0,T.Ip)(x),_=()=>{w&&r(f.ZP.clearPendingScheduledAdd()),L&&h&&(r(I.default.setFutureOrderDate(null)),E().removeFutureOrderDate()),Z()};return(0,n.jsx)(u.u_,{open:!!C,onClose:!h||L?_:()=>{},title:i.ZP.t("FutureOrder:whenYouWantYourOrder"),maxWidth:"sm",children:(0,n.jsxs)("div",{className:"space-y-5",children:[(0,n.jsxs)("div",{className:"flex overflow-hidden rounded-xl border border-line",children:[(0,n.jsxs)(A,{active:!y,onClick:()=>b(!1),disabled:S,children:[(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 256 256",fill:"currentColor",className:"shrink-0",children:(0,n.jsx)("path",{d:"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17Z"})}
3),i.ZP.t("FutureOrder:asap")]}),(0,n.jsxs)(A,{active:y,onClick:()=>b(!0),children:[(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 256 256",fill:"currentColor",className:"shrink-0",children:(0,n.jsx)("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm68-84a12,12,0,0,1-12,12H128a12,12,0,0,1-12-12V72a12,12,0,0,1,24,0v44h44A12,12,0,0,1,196,128Z"})}),i.ZP.t("FutureOrder:scheduleOrder")]})]}),(0,n.jsx)(R,{}),h&&(0,n.jsx)("div",{className:"rounded-xl !bg-warning-soft p-3 text-sm text-warning-strong",children:i.ZP.t("FutureOrder:selectOtherOption")}),y&&(0,T.Ip)(x)&&(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"mb-1.5 block text-sm font-medium text-content-secondary",children:i.ZP.t("FutureOrder:date")}),(0,n.jsx)("select",{className:"w-full rounded-xl border border-line !bg-surface-subtle px-4 py-3 text-sm font-medium text-content outline-none transition-colors focus:border-primary focus:!bg-surface",onChange:l,value:m||(null===(e=x[0])||void 0===e?void 0:e.value),children:x.map(e=>(0,n.jsx)("option",{value:e.value,children:e.label},e.value))})]}),p&&(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"mb-1.5 block text-sm font-medium text-content-secondary",children:i.ZP.t("FutureOrder:time")}),(0,n.jsx)("select",{className:"w-full rounded-xl border border-line !bg-surface-subtle px-4 py-3 text-sm font-medium text-content outline-none transition-colors focus:border-primary focus:!bg-surface",onChange:o,value:c||"",children:(v||[]).map(e=>(0,n.jsx)("option",{value:e.label,children:(0,D.m)(e.label)},e.value||e.label))})]})]}),y&&!(0,T.Ip)(x)&&(0,n.jsxs)("div",{className:"flex items-start gap-3 rounded-xl border border-warning/30 !bg-warning-soft p-4 text-sm text-warning-strong",children:[(0,n.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"mt-0.5 shrink-0 text-warning",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,n.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,n.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),(0,n.jsx)("p",{children:i.ZP.t("FutureOrder:notAvailableHours")})]}),(0,n.jsx)("button",{type:"button",disabled:S&&!y||y&&L,onClick:()=>{m&&c&&y?(r(I.default.setFutureOrderDate({date:m,time:c})),r(f.ZP.checkItemsAvailability()),E().setFutureOrderDate({date:m,time:c,expiryTime:O()("".concat(m," ").concat(c))}),N.Z.submitScheduleInfo({selectedDate:m,selectedTime:c,isScheduled:!0,tenant:k}),w&&(r(f.ZP.addItem({item:w.item,closeUrl:void 0,checkCart:!1})),r(f.ZP.clearPendingScheduledAdd()),r(a.ZP.openModal(d.ee.MINI_CART)))):(r(I.default.setFutureOrderDate(null)),r(f.ZP.checkItemsAvailability()),E().removeFutureOrderDate(),N.Z.submitScheduleInfo({isScheduled:!1,tenant:k}),w&&r(f.ZP.clearPendingScheduledAdd())),Z()},className:"w-full rounded-xl !bg-primary py-3 text-base font-semibold text-content-inverse transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:i.ZP.t("Delivery:confirmButton")}),j&&(0,n.jsx)("button",{type:"button",disabled:S&&!y,onClick:_,className:"w-full rounded-xl border border-line !bg-surface py-3 text-base font-semibold text-content-secondary transition-colors hover:!bg-surface-subtle disabled:cursor-not-allowed disabled:opacity-50",children:i.ZP.t("FutureOrder:cancel")})]})})}function A(e){let{active:t,onClick:r,disabled:i=!1,children:l}=e;return(0,n.jsx)("button",{type:"button",onClick:r,disabled:i,className:"flex flex-1 items-center justify-center gap-1.5 py-2.5 text-sm font-semibold transition-colors ".concat(t?"!bg-primary text-content-inverse":"!bg-surface text-content-tertiary hover:!bg-surface-subtle"," disabled:cursor-not-allowed disabled:opacity-50"),children:l})}function R(){let e=(0,s.v9)(e=>e.searchStore.currentSubsidiary);return e?(0,n.jsxs)("div",{className:"flex items-center gap-2 rounded-xl !bg-surface-subtle p-3",children:[(0,n.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"shrink-0 text-primary",children:[(0,n.jsx)("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"}),(0,n.jsx)("circle",{cx:"12",cy:"10",r:"3"})]}),(0,n.jsxs)("span",{className:"text-sm text-content-tertiary",children:[e.name,e.textAddress?" \xb7 ".concat(e.textAddress):""]})]}):null}
3r(95445);var _=r(85388),V=r(83765),U=r(30433),q=r(82892),F=r(8949),Q=r(78599),W=r(53218),z=r(32927);let B={NAME:"name",EMAIL:"email",PHONE:"phone",VERIFICATION_CODE:"verificationCode"},H=/[^a-zA-ZÑñáÁéÉíÍóÓúÚüÜçÇ ]/g,G=e=>e.replace(H,""),Y=e=>(0,F.Y1)(e,q.N,q.N.phoneValidation),K={name:"",email:"",phone:"",verificationCode:""};function $(e){let{label:t,name:r,type:i="text",prefix:l,value:o,onChange:s,error:a,maxLength:d}=e;return(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"mb-1 block text-sm font-medium text-content-secondary",children:t}),(0,n.jsxs)("div",{className:"flex",children:[l&&(0,n.jsx)("span",{className:"flex items-center rounded-l-lg border border-r-0 border-line bg-surface-subtle px-3 text-sm text-content-muted",children:l}),(0,n.jsx)("input",{name:r,type:i,value:o,onChange:e=>s(e.target.value),maxLength:d,className:"w-full rounded-lg border px-3 py-2.5 text-sm focus:outline-none focus:ring-1 ".concat(l?"rounded-l-none":""," ").concat(a?"border-error/40 focus:border-error-strong focus:ring-error-strong":"border-line focus:border-primary focus:ring-primary")})]}),a&&(0,n.jsx)("p",{className:"mt-1 text-xs text-error",children:a})]})}function J(){let e=(0,s.I0)(),[t,r]=(0,o.useState)(K),[l,c]=(0,o.useState)([]),[m,x]=(0,o.useState)({}),[f,v]=(0,o.useState)(!1),[p,h]=(0,o.useState)(!1),{startGoogleLogin:b,isLoading:g,error:y}=(0,_.Z)({onSuccess:t=>{h(!0),e(V.default.signInWithToken(t,U.eo.GOOGLE))},onError:()=>{}}),j=(0,s.v9)(e=>e.modal["".concat(d.ee.LOGIN,"ModalIsOpen")]),N=(0,s.v9)(e=>
3e.auth),{sendSignInCodeToEmail:C,sendSignInCodeToEmailLoading:S,signInWithEmailCode:k,signInWithEmailCodeLoading:w,signInWithEmailCodeError:O,currentUser:I,currentUserLoading:M,registerUserLoading:Z}=N,E=!!C,T=(!!k||p)&&!!I&&(!I.name||!I.phone),D=w||M,L=(e,t)=>{r(r=>({...r,[e]:t})),m[e]&&x(t=>{let r={...t};return delete r[e],r})},A=async()=>{try{let e=(0,z.c)(q.N),r=T?(0,z.r)({[B.NAME]:e.name,[B.PHONE]:e.phone}):(0,z.r)({[B.EMAIL]:e.email});return await r.validate(t,{abortEarly:!1}),x({}),!0}catch(r){var e;let t={};return null===(e=r.inner)||void 0===e||e.forEach(e=>{e.path&&(t[e.path]=e.message)}),x(t),!1}},R=async r=>{r.preventDefault(),v(!0);let n=await A();n&&(T?p?e(V.default.updateUser(t)):k?e(V.default.registerFromEmailCode(t,e=>c(e))):e(V.default.signInWithCode(t.email,t.verificationCode)):E?e(V.default.signInWithCode(t.email,t.verificationCode)):e(V.default.sendSignInCodeToEmail(t.email)))};return((0,o.useEffect)(()=>{j&&(null==I?void 0:I.email)&&(null==I?void 0:I.name)&&(null==I?void 0:I.phone)&&(e(a.ZP.closeModal(d.ee.LOGIN)),e(V.default.signInEmaillCodeDismiss({skipRedirectHome:!0})))},[j,I,e]),(0,o.useEffect)(()=>{j&&(r(K),v(!1),x({}),c([]),h(!1))},[j]),j)?(0,n.jsx)(u.u_,{open:j,onClose:()=>{T||(e(a.ZP.closeModal(d.ee.LOGIN)),e(V.default.signInEmaillCodeDismiss({skipRedirectHome:!0})),r(K),v(!1),x({}),c([]),h(!1))},title:i.ZP.t("Login:title"),maxWidth:"sm",dismissible:!T,children:(0,n.jsx)("form",{onSubmit:R,className:"flex flex-col gap-4",children:T?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)($,{label:i.ZP.t("Login:name"),name:B.NAME,value:t.name,onChange:e=>L(B.NAME,G(e)),error:f?m[B.NAME]:void 0}),(0,n.jsx)($,{label:i.ZP.t("Login:phone"),name:B.PHONE,type:"tel",prefix:q.N.phonePrefix,value:t.phone,onChange:e=>L(B.PHONE,Y(e)),error:f?m[B.PHONE]:void 0,maxLength:q.N.phoneValidation+4}),f&&Object.keys(m).length>0&&(0,n.jsx)("p",{className:"text-sm text-error",children:i.ZP.t("Login:error")}),l.map(e=>(0,n.jsx)("p",{className:"text-sm text-error",children:e},e)),(0,n.jsx)(P.z,{type:"submit",fullWidth:!0,loading:Z,children:i.ZP.t("Login:start")}),(0,n.jsxs)("p",{className:"text-center text-xs text-content-subtle",children:[i.ZP.t("Login:acceptanceText"),(0,n.jsx)("button",{type:"button",onClick:()=>window.open(W.IQ.TERMS_AND_CONDITIONS.path),className:"text-primary underline",children:i.ZP.t("Login:termsAndConditions")}),i.ZP.t("Login:endingText")]})]}):E?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"text-sm text-content-tertiary",children:i.ZP.t("Login:enterYourCode")}),(0,n.jsx)("div",{className:"flex justify-center gap-2",onPaste:e=>{var t;e.preventDefault();let r=e.clipboardData.getData("text")||"",n=r.replace(/[^a-zA-Z0-9]/g,"").slice(0,5);if(!n)return;L(B.VERIFICATION_CODE,n);let i=e.currentTarget.querySelectorAll("input"),l=Math.min(n.length,4);null===(t=null==i?void 0:i[l])||void 0===t||t.focus()},children:Array.from({length:5}).map((e,r)=>(0,n.jsx)("input",{type:"text",autoComplete:"one-time-code",disabled:D,"aria-label":"C\xf3digo de verificaci\xf3n d\xedgito ".concat(r+1," de 5"),className:"h-12 w-10 rounded-lg border border-line text-center text-lg font-semibold focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary disabled:bg-surface-subtle disabled:text-content-subtle",value:t.verificationCode[r]||"",onChange:e=>{let n=e.target.value;if(n.length>1){var i,l;let t=n.replace(/[^a-zA-Z0-9]/g,"").slice(0,5);if(!t)return;L(B.VERIFICATION_CODE,t);let r=null===(i=e.target.parentElement)||void 0===i?void 0:i.querySelectorAll("input"),o=Math.min(t.length,4);null===(l=null==r?void 0:r[o])||void 0===l||l.focus();return}let o=n.slice(-1),s=t.verificationCode.split("");s[r]=o,L(B.VERIFICATION_CODE,s.join("").slice(0,5)),o&&e.target.nextElementSibling&&e.target.nextElementSibling.focus()},onKeyDown:e=>{"Backspace"===e.key&&!t.verificationCode[r]&&e.currentTarget.previousElementSibling&&e.currentTarget.previousElementSibling.focus()}},r))}),O&&(0,n.jsx)("p",{className:"text-center text-sm text-error",children:i.ZP.t("Login:errorCode")}),(0,n.jsx)("button",{type:"button",onClick:()=>{e(V.default.signInEmaillCodeDismiss()),r(K),v(!1),x({}),c([]),h(!1)},disabled:D,className:"text-center text-sm text-content-subtle underline disabled:opacity-50",children:i.ZP.t("Login:retryOtherEmail")}),(0,n.jsx)(P.z,{type:"submit",fullWidth:!0,loading:D,children:i.ZP.t("Login:enter")})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{type:"button",onClick:b,disabled:g,className:"flex w-full items-center justify-center gap-2 rounded-lg border border-gray-200 bg-white px-4 py-2.5 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-50 disabled:opacity-50",children:[(0,n.jsx)(Q._,{}),g?"...":i.ZP.t("Login:continueWithGoogle")]}),y&&(0,n.jsx)("p",{className:"text-center text-sm text-red-500",children:i.ZP.t("popupBlocked"===y?"Login:popupBlocked":"Login:googleLoginError")}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("div",{className:"h-px flex-1 bg-gray-200"}),(0,n.jsx)("span",{className:"text-xs text-gray-400",children:i.ZP.t("Login:or")}),(0,n.jsx)("div",{className:"h-px flex-1 bg-gray-200"})]}),(0,n.jsx)("p",{className:"text-sm text-content-tertiary",children:i.ZP.t("Login:enterYourEmail")}),(0,n.jsx)($,{label:i.ZP.t("Login:placeholder"),name:B.EMAIL,type:"email",value:t.email,onChange:e=>L(B.EMAIL,e),error:f?m[B.EMAIL]:void 0}),(0,n.jsx)(P.z,{type:"submit",fullWidth:!0,loading:S,children:i.ZP.t("Login:enter")}),(0,n.jsx)("p",{className:"text-center text-xs text-content-subtle",children:i.ZP.t("Login:text")})]})})}):null}
3r(30);var X=r(79011);function ee(){let e=(0,s.I0)(),[t,r]=(0,o.useState)(!0),l=(0,s.v9)(e=>e.modal["".concat(d.ee.PLUS_18_MODAL,"ModalIsOpen")]),c=(0,s.v9)(e=>e.core.settings.over18Restriction),[m={target:""}]=(0,s.v9)(e=>e.nextUp.nextActions),x=E().getPlus18ModalShown();return((0,o.useEffect)(()=>{if(m.target==="".concat(d.ee.PLUS_18_MODAL,"ModalIsOpen")){if(c&&!x){e(m);return}e(X.ZP.clearAction(m))}},[e,m,c,x]),(0,o.useEffect)(()=>{c&&e(X.ZP.setNextAction(a.ZP.openModal(d.ee.PLUS_18_MODAL)))},[e,c]),l)?(0,n.jsx)(u.u_,{open:l,onClose:()=>{},maxWidth:"sm",children:(0,n.jsx)("div",{className:"flex flex-col items-center px-2 py-4 text-center",children:t?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"!bg-primary/10 mb-2 flex h-16 w-16 items-center justify-center rounded-full",children:(0,n.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-primary",children:(0,n.jsx)("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})})}),(0,n.jsx)("h2",{className:"mb-1 font-title text-xl font-bold text-content",children:i.ZP.t("Plus18Modal:welcome")}),(0,n.jsx)("p",{className:"mb-1 text-lg font-semibold text-content",children:i.ZP.t("Plus18Modal:areOlder")}),(0,n.jsx)("p",{className:"mb-6 text-sm text-content-muted",children:i.ZP.t("Plus18Modal:subtitle")}),(0,n.jsxs)("div",{className:"flex w-full flex-col gap-3",children:[(0,n.jsx)("button",{type:"button","data-testid":"plus18-confirm",className:"w-full rounded-xl !bg-primary py-3 font-title text-base font-semibold text-content-inverse transition-opacity hover:opacity-90",onClick:()=>{E().setPlus18ModalShown(!0),e(a.ZP.closeModal(d.ee.PLUS_18_MODAL)),e(X.ZP.clearAction(m))},children:i.ZP.t("Plus18Modal:positive")}),(0,n.jsx)("button",{type:"button","data-testid":"plus18-deny",className:"w-full rounded-xl border-2 border-line !bg-surface py-3 font-title text-base font-semibold text-content-secondary transition-colors hover:!bg-surface-subtle",onClick:()=>{E().setPlus18ModalShown(!1),r(!1)},children:i.ZP.t("Plus18Modal:negative")})]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"mb-2 flex h-16 w-16 items-center justify-center rounded-full !bg-error-soft",children:(0,n.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-error",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,n.jsx)("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),(0,n.jsx)("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]})}),(0,n.jsx)("h2",{className:"mb-1 font-title text-xl font-bold text-content",children:i.ZP.t("Plus18Modal:sorry")}),(0,n.jsx)("p",{className:"text-base text-content-muted",children:i.ZP.t("Plus18Modal:noAgeEnough")})]})})}):null}var et=r(9008),er=r.n(et),en=r(25675),ei=r.n(en),el=r(44674),eo=r(1832),es=r(70405),ea=r(29215),ed=r(79911),ec=r(37453),eu=r(93098),em=r(4122),ex=r(57709),ef=r(48456),ev=r(44035);function ep(e){let{currentProduct:t,detailState:r,setDetailState:n,editingItem:i}=e,{product:l}=t,o=l.modifiers.filter(e=>{if(e.minQuantityModifiers<=0)return!1;let t=r.modifiers[String(e.id)]||[],n=t.reduce((e,t)=>e+(t.quantity||1),0);return n<e.minQuantityModifiers}).map(e=>e.id);if(o.length>0){n(e=>({...e,attempted:!0}));let e=document.querySelector('[data-modifier-id="'.concat(o[0],'"]'));return e&&e.scrollIntoView({behavior:"smooth",block:"center"}),null}let s={count:r.quantity,product:l,specialRequirement:(null==i?void 0:i.specialRequirement)||"",category:(null==i?void 0:i.category)||"",basePrice:t.discountPrice||t.price||0,instructions:r.instructions,items:r.modifiers,hash:"",dispatchMethod:l.dispatchMethod};return s.hash=(0,eo.XR)(s),s}function eh(e){let{modifier:t,state:r,onToggle:l,onSetQuantity:o}=e,s=t.minQuantityModifiers>0&&1===t.maxQuantityModifiers,a=!s&&t.maxQuantityModifiers>1,d=r.modifiers[String(t.id)]||[],c=d.reduce((e,t)=>e+(t.quantity||1),0),u=t.minQuantityModifiers>0,m=u&&c<t.minQuantityModifiers,x=m&&r.attempted,f=u?m?(0,n.jsx)("span",{className:"font-medium ".concat(x?"text-error-strong":"text-error"),children:1===t.minQuantityModifiers?"".concat(i.ZP.t("V2ProductDetail:choose")," 1"):i.ZP.t("V2ProductDetail:chooseAtLeast",{count:t.minQuantityModifiers})}):(0,n.jsxs)("span",{className:"text-success",children:[c,"/",t.maxQuantityModifiers||c]}):(0,n.jsx)("span",{children:i.ZP.t("V2ProductDetail:optional")});return(0,n.jsxs)("div",{className:"rounded-xl border p-3 transition-colors ".concat(x?"border-error/40 bg-error-soft":"border-line-subtle"),"data-modifier-id":t.id,children:[(0,n.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,n.jsx)("h4",{className:"text-sm font-semibold ".concat(x?"text-content":"text-card-text"),children:t.name}),(0,n.jsx)("span",{className:"text-xs ".concat(x?"text-content-muted":"text-card-text-muted"),children:f})]}),(0,n.jsx)("div",{className:"space-y-1",children:t.children.map(e=>{var r,i;let u=d.some(t=>t.name===e.name),m=null!==(i=null===(r=d.find(t=>t.name===e.name))||void 0===r?void 0:r.quantity)&&void 0!==i?i:0;return(0,n.jsxs)("div",{className:"flex w-full items-center justify-between rounded-xl px-3 py-2.5 transition-colors ".concat(u?"!bg
3-card-text/10 ring-1 ring-card-text/30":"!bg-card-text/5 hover:!bg-card-text/10"),children:[(0,n.jsxs)("button",{type:"button",onClick:()=>l(e,s),className:"flex min-w-0 flex-1 items-center gap-3 text-left",children:[(0,n.jsx)("div",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-colors ".concat(u?"border-primary !bg-primary":"border-line-strong bg-surface"),children:u&&(0,n.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polyline",{points:"20 6 9 17 4 12"})})}),(0,n.jsx)("span",{className:"min-w-0 text-sm text-card-text line-clamp-2",children:e.name})]}),(0,n.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[u&&a&&(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("button",{type:"button",onClick:()=>o(e,m-1),className:"flex h-6 w-6 items-center justify-center rounded-full border border-card-text/30 text-card-text-muted hover:!bg-card-text/10",children:(0,n.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,n.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})}),(0,n.jsx)("span",{className:"w-5 text-center text-sm font-semibold text-card-text",children:m}),(0,n.jsx)("button",{type:"button",onClick:()=>o(e,m+1),disabled:t.maxQuantityModifiers>0&&c>=t.maxQuantityModifiers,className:"flex h-6 w-6 items-center justify-center rounded-full border border-card-text/30 text-card-text-muted hover:!bg-card-text/10 disabled:opacity-40",children:(0,n.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,n.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,n.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]}),e.price>0&&(0,n.jsxs)("span",{className:"text-xs font-medium text-card-text-muted",children:["+",(0,el.T4)(e.price)]})]})]},e.id)})})]})}function eb(){var e,t,r,c;let m=(0,s.I0)(),x=(0,l.useRouter)(),{query:p,push:h,pathname:b}=x,g=(0,o.useRef)(!1),y=(0,o.useRef)(null),[,j]=(null==p?void 0:p.all)||[],P=j?(0,T.Ik)(j.split("-")).replace("/",""):null,C=P?parseInt(P,10):NaN,{tenant:S}=(0,s.v9)(e=>e.core.settings),k=(0,s.v9)(e=>e.searchStore.currentSubsidiary),w=(0,s.v9)(v.r3),O=(0,s.v9)(v.VL),I=(0,s.v9)(v.Rc),M=(0,s.v9)(e=>e.menu.menu),Z=(0,s.v9)(e=>e.menu.menuLoading),E=(0,s.v9)(e=>e.product.product),D=(0,s.v9)(e=>e.product.productLoading),L=(0,s.v9)(e=>{var t;return null===(t=e.menu)||void 0===t?void 0:t.priceDetail}),A=(0,s.v9)(e=>{var t;return(null===(t=e.menu)||void 0===t?void 0:t.priceDetailLoading)||!1}),R=(0,s.v9)(e=>{var t;let r=null===(t=e.menu)||void 0===t?void 0:t.searchResults;return Array.isArray(r)?r:[]}),_=(0,s.v9)(e=>w&&P?(0,v._7)(e,P):null),V=(0,s.v9)(e=>{var t;return null===(t=e.cart)||void 0===t?void 0:t.item}),{enabled:U,maxLength:q}=(0,ec.y)(),{ensureCanAddToCart:F}=(0,ed.N)(),Q=(0,o.useMemo)(()=>{let e=O||M||[];return Array.isArray(e)?e:[]},[O,M]);(0,o.useEffect)(()=>{y.current=null},[P]),(0,o.useEffect)(()=>{let e;if(!w||!P||A||y.current===C)return;let t=e=>Number(e)===C,r=Q.flatMap(e=>(null==e?void 0:e.prices)||[]).find(e=>{var r;return t(null==e?void 0:null===(r=e.product)||void 0===r?void 0:r.id)}),n=!r&&_?_.flatMap(e=>(null==e?void 0:e.prices)||[]).find(e=>{var r;return t(null==e?void 0:null===(r=e.product)||void 0===r?void 0:r.id)}):null;R.length>0&&(e=R.find(e=>(null==e?void 0:e.product)&&t(e.product.id))||R.find(e=>t((null==e?void 0:e.productId)||(null==e?void 0:e.product_id))));let i=(null==r?void 0:r.id)||(null==n?void 0:n.id)||(null==e?void 0:e.id);i&&(y.current=C,m(em.default.getPrice(i)))},[w,P,C,A,Q,_,R,m]),(0,o.useEffect)(()=>{if(P&&!w){let e=Q.flatMap(e=>(null==e?void 0:e.prices)||[]).find(e=>{var t;return Number(null==e?void 0:null===(t=e.product)||void 0===t?void 0:t.id)===C});e||m(ex.Z.getProductById(P))}},[P,w,Q,C,m]);let W=(0,o.useMemo)(()=>{var e,t;if(!P||Number.isNaN(C))return;let r=e=>Number(e)===C;if(w)return L&&(r(L.id)||r(null===(t=L.product)||void 0===t?void 0:t.id))?L:void 0;if(L&&(r(L.id)||r(null===(e=L.product)||void 0===e?void 0:e.id)))return L;let n=Q.flatMap(e=>(null==e?void 0:e.prices)||[]).find(e=>{var t;return r(null==e?void 0:null===(t=e.product)||void 0===t?void 0:t.id)});return n||((null==E?void 0:E.id)?{product:E,isAvailable:!1,priceGroup:{name:""}}:void 0)},[P,C,w,L,Q,E]);(0,o.useEffect)(()=>{W&&!g.current&&P&&(g.current=!0,ev.Z.selectItemEvent(W,S),N.Z.productView({item:W,tenant:S,storeId:null==k?void 0:k.id,storeName:null==k?void 0:k.name}))},[W,P,S]);let z=b.includes("/v2/product/"),{stockStatus:B,reserve:H}=(0,eu.t)(null!=W?W:null),G=(0,o.useCallback)(()=>{z?h("/").then(()=>{g.current=!1}):h({pathname:b,query:{...p,all:["",""]}},p.path?"/".concat(p.path):"/",{shallow:!0}).then(()=>{g.current=!1}),m(a.ZP.closeModal(d.ee.PRODUCT_DETAIL)),m(f.ZP.setItem(null)),m(ex.Z.cleanProduct())},[m,z,b,h,p]),Y=(0,o.useRef)();(0,o.useEffect)(()=>
3{if(!0===Y.current&&!D&&!W){G(),Y.current=!1;return}Y.current=D},[D,W,G]);let[K,$]=function(){let[e,t]=(0,o.useState)({quantity:1,modifiers:{},instructions:"",attempted:!1});return[e,t]}();(0,o.useEffect)(()=>{if((null==W?void 0:W.product)&&P){var e;V&&Number(null===(e=V.product)||void 0===e?void 0:e.id)===Number(W.product.id)?$({quantity:V.count||1,modifiers:V.items||{},instructions:V.instructions||"",attempted:!1}):$({quantity:1,modifiers:{},instructions:"",attempted:!1})}},[null==W?void 0:null===(e=W.product)||void 0===e?void 0:e.id,P,V]);let J=(w?I:Z)||D||A,X=!!P,ee=b.includes("/v2")&&!b.includes("/v2/product/");if(!X||ee)return null;let et=null==W?void 0:W.product;return(0,n.jsx)(u.dy,{open:X,onClose:G,title:(null==et?void 0:et.name)||"",tone:"card",children:!J&&W&&et?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(er(),{children:(0,n.jsx)("title",{children:et.name})}),(0,n.jsxs)("div",{className:"pb-28",children:[(null===(t=et.pictures)||void 0===t?void 0:null===(r=t[0])||void 0===r?void 0:r.url)&&(0,n.jsx)("div",{className:"px-4 pt-4",children:(0,n.jsx)("div",{className:"relative aspect-square w-full overflow-hidden rounded-xl bg-card-text/5",children:(0,n.jsx)(ei(),{src:et.pictures[0].url,alt:et.name,fill:!0,className:"object-cover",sizes:"(max-width: 640px) 100vw, 448px"})})}),(0,n.jsxs)("div",{className:"px-4 pt-3",children:[!B.hasStock&&(0,n.jsx)("div",{className:"mb-2",children:(0,n.jsx)(u.Ct,{variant:B.reservable?"warning":"error",className:"!text-sm",children:i.ZP.t(B.reservable?"ModifierGroup:outOfStockUntil":"ModifierGroup:outOfStock")})}),B.reservable&&B.backToStockDate&&(0,n.jsx)("div",{className:"mb-3 rounded-lg bg-info-soft p-3 text-sm text-info-strong","data-testid":"v2-product-detail-reserve-alert",children:B.availableOnDaysString?i.ZP.t("ModifierGroup:availableOnlyOn",{days:B.availableOnDaysString}):i.ZP.t("ModifierGroup:willBeAbleOn",{ableOn:i.ZP.t("ModifierGroup:date",{...(0,ef.os)(B.backToStockDate)})})}),et.description&&(0,n.jsx)("p",{className:"whitespace-pre-line text-sm text-card-text-muted",children:et.description}),(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsx)("span",{className:"text-lg font-bold text-card-text",children:(0,el.T4)(W.discountPrice||W.price||0)}),W.menuDiscount&&(0,n.jsx)("span",{className:"ml-2 text-sm text-card-text-subtle line-through",children:(0,el.T4)(W.price)})]}),(0,n.jsx)(es.Z,{foodType:et.foodType}),(null===(c=et.modifiers)||void 0===c?void 0:c.length)>0&&(0,n.jsx)("div",{className:"mt-4 space-y-3",children:et.modifiers.map(e=>(0,n.jsx)(eh,{modifier:e,state:K,onToggle:(t,r)=>{$(n=>{let i=String(e.id),l=n.modifiers[i]||[];if(r)return{...n,modifiers:{...n.modifiers,[i]:[{...t,quantity:1}]}};let o=l.some(e=>e.name===t.name),s=l.reduce((e,t)=>e+(t.quantity||1),0);return o?{...n,modifiers:{...n.modifiers,[i]:l.filter(e=>e.name!==t.name)}}:e.maxQuantityModifiers&&s>=e.maxQuantityModifiers?n:{...n,modifiers:{...n.modifiers,[i]:[...l,{...t,quantity:1}]}}})},onSetQuantity:(t,r)=>{$(n=>{let i=String(e.id),l=n.modifiers[i]||[];if(r<=0)return{...n,modifiers:{...n.modifiers,[i]:l.filter(e=>e.name!==t.name)}};let o=l.filter(e=>e.name!==t.name).reduce((e,t)=>e+(t.quantity||1),0),s=t.maxQuantityModifiers||e.maxQuantityModifiers,a=e.maxQuantityModifiers?Math.min(s||1/0,e.maxQuantityModifiers-o):1/0,d=Math.min(r,a),c=l.some(e=>e.name===t.name),u=c?l.map(e=>e.name===t.name?{...e,quantity:d}:e):[...l,{...t,quantity:d}];return{...n,modifiers:{...n.modifiers,[i]:u}}})}},e.id))}),U&&(0,n.jsx)(u.Xi,{labelClassName:"text-card-text",id:"v2-product-instructions",value:K.instructions,onChange:e=>$(t=>({...t,instructions:e})),maxLength:q})]})]}),(0,n.jsx)("div",{className:"sticky bottom-0 z-modal border-t border-card-text/10 bg-card-bg p-4",children:(0,n.jsx)("div",{className:"mx-auto flex max-w-app items-center gap-4",children:B.reservable?(0,n.jsx)(u.zx,{fullWidth:!0,size:"lg","data-testid":"v2-product-detail-schedule",onClick:()=>{let e=ep({currentProduct:W,detailState:K,setDetailState:$,editingItem:V});e&&H({item:e,onBeforeOpen:G})},children:i.ZP.t("ProductDetail:scheduleOrder")}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u.cw,{value:K.quantity,onChange:e=>$(t=>({...t,quantity:Math.max(1,e)}))}),(0,n.jsxs)(u.zx,{fullWidth:!0,size:"lg",disabled:!B.hasStock,onClick:()=>(function(e){let{currentProduct:t,detailState:r,setDetailState:n,dispatch:i,closeModal:l,ensureCanAddToCart:o,editingItem:s}=e,a=ep({currentProduct:t,detailState:r,setDetailState:n,editingItem:s});if(!a)return;
3if(s){i(f.ZP.modifyItem({item:a,outdatedItem:s,checkCart:!1})),l();return}let d=o(a,{checkCart:!1});if(!d){l();return}i(f.ZP.addItem({item:a,closeUrl:void 0,checkCart:!1})),l()})({currentProduct:W,detailState:K,setDetailState:$,dispatch:m,closeModal:G,ensureCanAddToCart:F,editingItem:V}),children:[V?i.ZP.t("V2ProductDetail:update"):i.ZP.t("V2ProductDetail:add")," ",(0,el.T4)((0,eo.xj)(K.modifiers,K.quantity,W.discountPrice||W.price||0))]})]})})})]}):(0,n.jsxs)("div",{className:"space-y-4 p-4",children:[(0,n.jsx)(ea.O,{className:"aspect-video w-full rounded-xl"}),(0,n.jsx)(ea.O,{className:"h-6 w-3/4"}),(0,n.jsx)(ea.O,{className:"h-4 w-full"}),(0,n.jsx)(ea.O,{className:"h-4 w-2/3"})]})})}r(4421);var eg=r(48562),ey=r(90425),ej=r(8297);function eN(e){var t;let{isCheckout:r}=e,c=(0,s.I0)(),{push:m}=(0,l.useRouter)(),{items:x,modifiers:v,cartItems:p}=(0,eg.$)(),h=(0,s.v9)(e=>e.cart.serverUnavailable),b=(0,s.v9)(e=>e.modal["".concat(d.ee.UNAVAILABLE_PRODUCTS,"ModalIsOpen")]),g=(0,s.v9)(e=>e.cart.cart),y=(0,s.v9)(e=>{var t;return null===(t=e.pages)||void 0===t?void 0:t.builderPages})||[],j=(0,ey.LI)(y),N=(0,T.Ip)(x)||(0,T.Ip)(v)||h;(0,o.useEffect)(()=>{N&&!h&&c(f.ZP.checkItemsAvailability())},[N,h,c]);let C=N&&b;return C?(0,n.jsx)(u.u_,{open:C,onClose:()=>{},maxWidth:"md",children:(0,n.jsxs)("div",{className:"flex flex-col items-center px-2 py-4 text-center",children:[(0,n.jsx)("div",{className:"mb-3 flex h-16 w-16 items-center justify-center rounded-full !bg-error-soft",children:(0,n.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-error",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,n.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,n.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}),(0,n.jsx)("h2",{className:"mb-1 font-title text-xl font-bold text-content",children:i.ZP.t("UnavailableProducts:error")}),(0,n.jsx)("p",{className:"mb-4 text-sm text-content-muted",children:i.ZP.t("UnavailableProducts:unavailable")}),(0,n.jsxs)("div",{className:"mb-5 w-full space-y-2",children:[null==x?void 0:x.map(e=>{let t=e.product,r=e.items,i=r?(0,eo.Jt)(r,e=>e.name):[];return(0,n.jsxs)("div",{className:"flex items-start gap-3 rounded-lg bg-surface-subtle px-3 py-2 text-left",children:[(0,n.jsx)("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-surface-strong text-xs font-semibold text-content-secondary",children:e.count}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"font-semibold text-content",children:null==t?void 0:t.name}),i.map(e=>(0,n.jsx)("p",{className:"text-xs text-content-muted",children:e},e))]})]},e.hash)}),null===(t=(0,T.vB)(null==v?void 0:v.filter(Boolean),"id"))||void 0===t?void 0:t.map(e=>(0,n.jsx)("div",{className:"flex items-start gap-3 rounded-lg bg-surface-subtle px-3 py-2 text-left",children:(0,n.jsx)("p",{className:"font-semibold text-content",children:e.name})},e.name))]}),(0,n.jsx)(P.z,{variant:"danger",fullWidth:!0,onClick:()=>{let e=(0,ej.d)(v,p),t=[...x||[],...e],n=r&&t.length===(null==g?void 0:g.length);c(f.ZP.removeItem({item:t,onPostSuccess:()=>{c(f.ZP.setServerUnavailable(!1)),c(a.ZP.closeModal(d.ee.UNAVAILABLE_PRODUCTS)),r&&c(f.ZP.checkCart())},mapper:eo.Sg},{skipRemoveFromCartEvent:!0})),n&&(null==j?void 0:j.url)&&m(j.url)},children:i.ZP.t("UnavailableProducts:removeProducts")})]})}):null}var eP=r(35111),eC=r(58883),eS=r(2570);d.ee.PRODUCT_DETAIL,d.ee.UNAVAILABLE_PRODUCTS,d.ee.LOGIN,d.ee.SESSION_CLOSED,d.ee.STORE_CLOSED,d.ee.FUTURE_ORDER,d.ee.PLUS_18_MODAL,d.ee.MINI_CART,d.ee.DELIVERY_OR_PICKUP,d.ee.ADD_TIP,d.ee.SET_CVC,d.ee.CONFIRMATION_ORDER,d.ee.ORDER_CREATION_STATUS,d.ee.PAYMENT_METHOD,d.ee.ADD_CARD,d.ee.ERROR_CHECK_CART,d.tW,d.ee.POP_UP_BANNERS,d.ee.TOP_SITE_MESSAGE;let ek=[d.ee.STORE_CLOSED,d.ee.LOGIN,d.ee.UNAVAILABLE_PRODUCTS,d.ee.FUTURE_ORDER,d.ee.PLUS_18_MODAL,d.ee.SESSION_CLOSED,d.ee.DELIVERY_OR_PICKUP];function ew(){let e=(0,s.I0)(),t=(0,s.v9)(e=>e.modal);(0,o.useRef)(new Set);let{pathname:r}=(0,l.useRouter)(),h=r.includes("/checkout"),b=!!t["".concat(d.tW,"ModalIsOpen")],g=ek.some(e=>!!t["".concat(e,"ModalIsOpen")]),y=(0,o.useCallback)(()=>{e(c.c.setAddress({})),e(a.ZP.closeModal(d.tW))},[e]),{unavailableProductName:j,dismissUnavailable:N}=function(){var e;let t=(0,s.I0)(),[r,n]=(0,o.useState)(null),i=(0,s.v9)(e=>e.cart.pendingAddToCart),l=(0,s.v9)(e=>e.searchStore.dispatchType),c=(0,s.v9)(e=>e.searchStore.currentSubsidiary),u=(0,s.v9)(e=>{var t;return null===(t=e.auth.address)||void 0===t?void 0:t.current}),m=(0,s.v9)(t=>{var r;return null!==(e=null===(r=t.menu)||void 0===r?void 0:r.menu)&&void 0!==e?e:[]}),p=(0,s.v9)(v.r3),h=(0,s.v9)(v.VL),b=(0,s.v9)(v.Rc);return(0,o.useEffect)(()=>{var e,r,o,s,v,g;if(!i)return;let y=l===x.CK.DELIVERY,j=!!u&&!u.isStoreAddress,N=!!(null==c?void 0:c.id);if(!(y?j:N)||p&&b)return;let P=null===(e=i.item)||void 0===e?void 0:null===(r=e.product)||void 0===r?void 0:r.id,C=p&&h?h:m,S=C.some(e=>(null!==(o=null==e?void 0:e.prices)&&void 0!==o?o:[]).some(e=>{var t;return Number(null==e?void 0:null===(t=e.product)||void 0===t?void 0:t.id)===Number(P)}));if(!S){n(null===(s=i.item)||void 0===s?void 0:null===(v=s.product)||void 0===v?void 0:v.name),t(f.ZP.clearPendingAddToCart());return}t(f.ZP.addItem({item:i.item,closeUrl:i.closeUrl,checkCart:null!==(g=i.checkCart)&&void 0!==g&&g})),t(f.ZP.clearPendingAddToCart()),t(a.ZP.closeModal(d.ee.DELIVERY_OR_PICKUP)),window.setTimeout(()=>{t(a.ZP.openModal(d.ee.MINI_CART))},250)},[i,l,c,u,m,p,h,b,t]),{unavailableProductName:r,dismissUnavailable:()=>n(null)}}();return(0,o.useEffect)(()=>{},[t]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(m.KU,{scope:"CartSheet",children:(0,n.jsx)(p.gR,{})}),(0,n.jsx)(eb,{}),(0,n.jsx)(eN,{isCheckout:h}),(0,n.jsx)(J,{}),(0,n.jsx)(k,{}),(0,n.jsx)(S,{}),(0,n.jsx)(L,{}),(0,n.jsx)(ee,{}),(0,n.jsx)(eP.Z,{}),!g&&(0,n.jsx)(eC.Z,{}),(0,n.jsx)(u.u_,{open:b,onClose:y,title:"",maxWidth:"md",children:(0,n.jsx)(eS.Z,{})}),(0,n.jsx)(u.u_,{open:!!j,onClose:N,title:"",maxWidth:"sm",children:(0,n.jsx)("p",{className:"py-2 text-center text-sm text-content",children:i.ZP.t("V2Common:productNotAvailableAtStore",{productName:j})})})]})}},24754:function(e,t,r){r.d(t,{d6:function(){return x},gR:function(){return S}});
3var n=r(85893),i=r(26982),l=r(25675),o=r.n(l),s=r(26628),a=r(6728),d=r(44674),c=r(1832),u=r(80006),m=r(2919);function x(e){var t,r,l,x,f;let{item:v,onModify:p}=e,h=(0,s.I0)(),b=(null===(t=v.product.pictures)||void 0===t?void 0:null===(r=t[0])||void 0===r?void 0:null===(l=r.cropperUrl)||void 0===l?void 0:l.small)||(null===(x=v.product.pictures)||void 0===x?void 0:null===(f=x[0])||void 0===f?void 0:f.url),g=(0,c.Jt)(v.items,e=>e.name),y=(0,c.xj)(v.items,v.count,v.basePrice),j=!v.addedByCoupon&&(0,a.g$)(v);return(0,n.jsxs)("div",{className:"flex gap-3 border-b border-line-subtle py-3",children:[b?(0,n.jsx)("div",{className:"relative h-14 w-14 shrink-0 overflow-hidden rounded-lg bg-surface-muted",children:(0,n.jsx)(o(),{src:b,alt:v.product.name,fill:!0,className:"object-cover",sizes:"56px"})}):(0,n.jsx)("div",{className:"flex h-14 w-14 shrink-0 items-center justify-center rounded-lg bg-surface-muted",children:(0,n.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-content-faint",children:[(0,n.jsx)("path",{d:"M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z"}),(0,n.jsx)("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),(0,n.jsx)("path",{d:"M16 10a4 4 0 0 1-8 0"})]})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("h4",{className:"truncate text-sm font-semibold text-content",children:v.product.name}),g.length>0&&(0,n.jsx)("p",{className:"mt-0.5 truncate text-xs text-content-muted",children:g.join(", ")}),v.instructions&&(0,n.jsx)("p",{className:"mt-0.5 truncate text-xs italic text-content-subtle",children:v.instructions}),j&&(0,n.jsx)("p",{className:"mt-0.5 text-xs font-medium text-warning",children:i.ZP.t("V2Cart:completeOptions",{defaultValue:"Falta elegir modificadores"})})]}),(0,n.jsx)("span",{className:"ml-2 shrink-0 text-sm font-semibold text-content",children:(0,d.T4)(y)})]}),(0,n.jsxs)("div",{className:"mt-2 flex items-center gap-2 ".concat(p&&!v.addedByCoupon?"justify-between":"justify-end"),children:[p&&!v.addedByCoupon&&(0,n.jsx)("button",{type:"button",onClick:p,className:j?"rounded-md !bg-primary px-3 py-1 text-xs font-semibold text-content-inverse":"text-xs font-semibold text-primary underline",children:j?i.ZP.t("V2Cart:completeOptionsCta",{defaultValue:"Completar"}):i.ZP.t("V2Cart:modify",{defaultValue:"Modificar"})}),(0,n.jsx)(u.cw,{value:v.count,onChange:e=>{e>v.count?h(m.ZP.sumItem(v)):e<v.count&&h(m.ZP.removeItem({item:v,mapper:c.Cn,onPostSuccess:()=>{}}))},min:0,size:"sm",disabled:v.addedByCoupon})]})]})]})}r(519);var f=r(11163),v=r(67294),p=r(4376),h=r(92852),b=r(79819),g=r(9643),y=r(81044),j=r(63253);function N(){let{subtotal:e,delivery:t,discount:r,total:i}=(0,b.Cj)(),l=i>0;return(0,n.jsxs)("div",{className:"space-y-2 border-t border-line-subtle pt-3",children:[(0,n.jsxs)("div",{className:"flex justify-between text-sm text-content-tertiary",children:[(0,n.jsx)("span",{children:"Subtotal"}),(0,n.jsx)("span",{children:(0,d.T4)(e)})]}),t>0&&(0,n.jsxs)("div",{className:"flex justify-between text-sm text-content-tertiary",children:[(0,n.jsx)("span",{children:"Despacho"}),(0,n.jsx)("span",{children:(0,d.T4)(t)})]}),r>0&&(0,n.jsxs)("div",{className:"flex justify-between text-sm text-success",children:[(0,n.jsx)("span",{children:"Descuento"}),(0,n.jsxs)("span",{children:["-",(0,d.T4)(r)]})]}),l&&(0,n.jsxs)("div",{className:"flex justify-between border-t border-line-subtle pt-2 text-base font-bold text-content",children:[(0,n.jsx)("span",{children:"Total"}),(0,n.jsx)("span",{children:(0,d.T4)(i)})]})]})}var P=r(4122);function C(e){var t,r;let{onProductClick:i}=e,l=(0,s.I0)(),o=(0,s.v9)(e=>e.cart.cart.length),a=(0,s.v9)(e=>{var t;return null===(t=e.searchStore)||void 0===t?void 0:t.currentSubsidiary}),m=(0,s.v9)(e=>null!==(t=e.menu.upsellings)&&void 0!==t?t:[]),x=(0,s.v9)(e=>null!==(r=e.menu.upsellingsLoading)&&void 0!==r&&r);return((0,v.useEffect)(()=>{o>0&&a&&l(P.default.getUpsellings())},[o,a,l]),x||0!==m.length)?(0,n.jsxs)("div",{className:"mt-6",children:[(0,n.jsx)("h3",{className:"mb-3 text-sm font-semibold uppercase tracking-wide text-content-muted",children:"\xbfQuieres agregar algo m\xe1s?"}),x&&(0,n.jsx)("div",{className:"flex gap-3 overflow-hidden",children:[1,2,3].map(e=>(0,n.jsxs)("div",{className:"w-32 shrink-0",children:[(0,n.jsx)(u.Od,{className:"aspect-square w-full",rounded:"lg"}),(0,n.jsx)(u.Od,{className:"mt-2 h-3 w-3/4"}),(0,n.jsx)(u.Od,{className:"mt-1 h-3 w-1/2"})]},e))}),!x&&m.length>0&&(0,n.jsx)("div",{className:"scrollbar-hide -mx-4 flex gap-3 overflow-x-auto px-4 pb-1",children:m.map(e=>{var t,r,l,o,s;let a=(null===(t=e.pictures)||void 0===t?void 0:null===(r=t[0])||void 0===r?void 0:null===(l=r.cropperUrl)||void 0===l?void 0:l.small)||(null===(o=e.pictures)||void 0===o?void 0:null===(s=o[0])||void 0===s?void 0:s.url),u=(0,c.eZ)(e);return(0,n.jsxs)("button",{type:"button",onClick:()=>{var t,r;let n={id:e.id,price:null!==(t=e.price)&&void 0!==t?t:0,discountPrice:u,menuDiscount:null!==(r=e.menuDiscount)&&void 0!==r?r:"",stock:void 0===e.stock||e.stock,hidden:!1,product:e};i(n)},className:"w-28 shrink-0 text-left",children:[(0,n.jsxs)("div",{className:"relative aspect-square w-full overflow-hidden rounded-xl bg-surface-muted",children:[a?(0,n.jsx)("img",{src:a,alt:e.name,className:"h-full w-full object-cover"}):(0,n.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,n.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-content-faint",children:(0,n.jsx)("path",{d:"M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"})})}),(0,n.jsx)("div",{className:"absolute bottom-1 right-1 flex h-6 w-6 items-center justify-center rounded-full bg-secondary text-[color:var(--brand-secondary-text)] shadow-sm",children:(0,n.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[(0,n.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,n.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]}),(0,n.jsx)("p",{className:"mt-1.5 text-xs font-medium text-content line-clamp-2",children:e.name}),(0,n.jsx)("p",{className:"mt-0.5 text-xs font-semibold text-primary",children:(0,d.T4)(u)})]},e.id)})})]}):null}function S(){var e;let t=(0,s.I0)(),{push:r,pathname:l}=(0,f.useRouter)(),{cart:o,hasItems:a,subtotal:d}=(0,b.Cj)(),c=(0,b.Ir)(),P=(0,b.Yt)(),S=l.includes("/checkout"),k=!!(0,s.v9)(e=>e.modal["".concat(p.ee.MINI_CART,"ModalIsOpen")]),w=(0,s.v9)(e=>e.core.settings.tenant),O=(0,s.v9)(e=>e.searchStore.currentSubsidiary),I=(0,s.v9)(e=>e.cart.loyaltyPoints),M=(0,s.v9)(t=>{var r,n;return null!==(e=null===(r=t.cart.coupon)||void 0===r?void 0:null===(n=r.appliedCoupon)||void 0===n?void 0:n.code)&&void 0!==e?e:""}),Z=(0,v.useMemo)(()=>({points:I,coupon:M,paymentMethod:void 0}),[I,M]),E=(0,v.useRef)(!1);(0,v.useEffect)(()=>
3{if(S){E.current=k;return}k&&!E.current&&o.length>0&&O&&t(m.ZP.checkCart({discount:Z})),E.current=k},[k,S,o.length,O,Z,t]);let T=(0,b.ib)(o),D=(0,y.Z)(T,300),L=(0,v.useRef)(!0);(0,v.useEffect)(()=>{if(L.current){L.current=!1;return}!S&&k&&o.length&&O&&t(m.ZP.checkCart({showModalError:!1,discount:Z}))},[D]);let A=(0,v.useRef)(!1);(0,v.useEffect)(()=>{k&&!A.current&&a&&h.Z.viewCart({subtotal:d,cartItems:o,discount:null,discountValue:0,tenant:w,storeId:null==O?void 0:O.id,storeName:null==O?void 0:O.name}),A.current=k},[k]);let R=()=>{t(j.ZP.closeModal(p.ee.MINI_CART))},{canCheckout:_}=P,V=!_&&"closed-with-futures"===P.kind,U=i.ZP.t("V2Cart:goToCheckout"),q=()=>{h.Z.startCheckout({subtotal:d,cartItems:o,tenant:w}),R(),r("/checkout")},F=!1;_||(V?(U=i.ZP.t("V2Cart:schedulePrompt"),q=()=>{t(j.ZP.openModal(p.ee.FUTURE_ORDER))}):(U=i.ZP.t("V2Cart:storeNotAcceptingOrders"),F=!0));let Q=(0,v.useCallback)(e=>{c.open(e)},[c]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u.dy,{open:k,onClose:R,title:i.ZP.t("V2Cart:title"),footer:a&&!S?(0,n.jsx)("div",{className:"border-t border-line-subtle bg-surface p-4",children:(0,n.jsx)("div",{className:"mx-auto max-w-app",children:(0,n.jsx)(u.zx,{fullWidth:!0,size:"lg","data-testid":"cart-checkout-button","data-checkout-state":_?"open":V?"schedule":"blocked",disabled:F,onClick:q,children:U})})}):void 0,children:(0,n.jsx)("div",{className:"px-4 pb-4",children:a?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"divide-y-0",children:o.map(e=>(0,n.jsx)(x,{item:e,onModify:()=>c.openForEdit(e)},e.hash||e.product.id))}),(0,n.jsx)(C,{onProductClick:Q}),(0,n.jsx)("div",{className:"mt-4",children:(0,n.jsx)(N,{})})]}):(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,n.jsx)("div",{className:"flex h-20 w-20 items-center justify-center rounded-full bg-surface-muted",children:(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-content-subtle",children:[(0,n.jsx)("path",{d:"M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z"}),(0,n.jsx)("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),(0,n.jsx)("path",{d:"M16 10a4 4 0 0 1-8 0"})]})}),(0,n.jsx)("p",{className:"mt-4 text-base font-semibold text-content-secondary",children:i.ZP.t("V2Cart:empty")}),(0,n.jsx)("p",{className:"mt-1 text-sm text-content-muted",children:i.ZP.t("V2Cart:emptyHint",{defaultValue:"Agrega productos del men\xfa para empezar"})}),(0,n.jsx)(u.zx,{variant:"primary",size:"md",onClick:R,className:"mt-6",children:i.ZP.t("V2Cart:browseMenu",{defaultValue:"Ver men\xfa"})})]})})}),(0,n.jsx)(g.e,{detail:c})]})}},9643:function(e,t,r){r.d(t,{e:function(){return x}});var n=r(85893),i=r(26982),l=r(25675),o=r.n(l),s=r(44674),a=r(80006),d=r(70405),c=r(93098),u=r(48456);function m(e){let{modifier:t,detail:r}=e,i=t.minQuantityModifiers>0&&1===t.maxQuantityModifiers,l=!i&&t.maxQuantityModifiers>1,o=r.getGroupTotalQuantity(t.id),a=t.minQuantityModifiers>0,d=a&&o<t.minQuantityModifiers,c=d&&r.attempted;return(0,n.jsxs)("div",{className:"scroll-mt-3 rounded-xl border p-3 transition-colors ".concat(c?"border-error/40 bg-error-soft":"border-card-text/10"),"data-modifier-id":t.id,children:[(0,n.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,n.jsx)("h4",{className:"text-sm font-semibold ".concat(c?"text-content":"text-card-text"),children:t.name}),(0,n.jsx)("span",{className:"text-xs ".concat(c?"text-content-muted":"text-card-text-muted"),children:a?(0,n.jsx)(n.Fragment,{children:d?(0,n.jsxs)("span",{className:"font-medium ".concat(c?"text-error-strong":"text-error"),children:["Elige"," ",1===t.minQuantityModifiers?"1":"al menos ".concat(t.minQuantityModifiers)]}):(0,n.jsxs)("span",{className:"text-success",children:[o,"/",t.maxQuantityModifiers||o]})}):"Opcional"})]}),(0,n.jsx)("div",{className:"space-y-1",children:t.children.map(e=>{let a=r.isModifierSelected(t.id,e),d=r.getModifierQuantity(t.id,e);return(0,n.jsxs)("div",{className:"flex w-full items-center justify-between rounded-xl px-3 py-2.5 transition-colors ".concat(a?"!bg-card-text/10 ring-1 ring-card-text/30":"!bg-card-text/5 hover:!bg-card-text/10"),children:[(0,n.jsxs)("button",{type:"button",onClick:()=>r.toggleModifier(t,e,i),"aria-label":"".concat(a?"Deseleccionar":"Seleccionar"," ").concat(e.name),className:"flex min-w-0 flex-1 items-center gap-3 text-left",children:[(0,n.jsx)("div",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-colors ".concat(a?"border-primary !bg-primary":"border-line-strong bg-surface"),children:a&&(0,n.jsx)("svg",{"aria-hidden":"true",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polyline",{points:"20 6 9 17 4 12"})})}),(0,n.jsx)("span",{className:"min-w-0 text-sm text-card-text line-clamp-2",children:e.name})]}),(0,n.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[a&&l&&(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("button",{type:"button",onClick:()=>r.setModifierQuantity(t,e,d-1),"aria-label":"Disminuir cantidad de ".concat(e.name),className:"flex h-6 w-6 items-center justify-center rounded-full border border-card-text/30 text-card-text-muted hover:!bg-card-text/10",children:(0,n.jsx)("svg",{"aria-hidden":"true",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,n.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})}),(0,n.jsx)("span",{className:"w-5 text-center text-sm font-semibold text-card-text",children:d}),(0,n.jsx)("button",{type:"button",onClick:()=>r.setModifierQuantity(t,e,d+1),disabled:t.maxQuantityModifiers>0&&o>=t.maxQuantityModifiers,"aria-label":"Aumentar cantidad de ".concat(e.name),className:"flex h-6 w-6 items-center justify-center rounded-full border border-card-text/30 text-card-text-muted hover:!bg-card-text/10 disabled:opacity-40",children:(0,n.jsxs)("svg",{"aria-hidden":"true",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,n.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,n.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]}),e.price>0&&(0,n.jsxs)("span",{className:"text-xs font-medium text-card-text-muted",children:["+",(0,s.T4)(e.price)]})]})]},"".concat(e.id,"-").concat(e.position))})})]})}function x(e){var t,r,l,x,f,v;let{detail:p}=e,h=null===(t=p.price)||void 0===t?void 0:t.product,{stockStatus:b,reserve:g}=(0,c.t)(p.price);if(p.isOpen&&!h)return(0,n.jsx)(a.dy,{open:!0,onClose:p.close,title:null!==(v=null===(f=p.price)||void 0===f?void 0:f.productName)&&void 0!==v?v:"",children:(0,n.jsx)("div",{className:"flex h-40 items-center justify-center",role:"status","aria-label":i.ZP.t("Common:loading",{defaultValue:"Cargando"}),children:(0,n.jsx)("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-line-strong border-t-primary"})})});if(!h)return null;let y=null===(r=h.pictures)||void 0===r?void 0:null===(l=r[0])||void 0===l?void 0:l.url;return(0,n.jsxs)(a.dy,{open:p.isOpen,onClose:p.close,title:h.name,tone:"card",children:[(0,n.jsxs)("div",{className:"pb-28",children:[y&&(0,n.jsx)("div",{className:"px-4 pt-4",children:(0,n.jsx)("div",{className:"relative aspect-square w-full overflow-hidden rounded-xl bg-card-text/5",children:(0,n.jsx)(o(),{src:y,alt:h.name,fill:!0,className:"object-cover",sizes:"(max-width: 640px) 100v
3w, 448px"})})}),(0,n.jsxs)("div",{className:"px-4 pt-3",children:[!b.hasStock&&(0,n.jsx)("div",{className:"mb-2",children:(0,n.jsx)(a.Ct,{variant:b.reservable?"warning":"error",className:"!text-sm",children:i.ZP.t(b.reservable?"ModifierGroup:outOfStockUntil":"ModifierGroup:outOfStock")})}),b.reservable&&b.backToStockDate&&(0,n.jsx)("div",{className:"mb-3 rounded-lg bg-info-soft p-3 text-sm text-info-strong","data-testid":"product-detail-reserve-alert",children:b.availableOnDaysString?i.ZP.t("ModifierGroup:availableOnlyOn",{days:b.availableOnDaysString}):i.ZP.t("ModifierGroup:willBeAbleOn",{ableOn:i.ZP.t("ModifierGroup:date",{...(0,u.os)(b.backToStockDate)})})}),h.description&&(0,n.jsx)("p",{className:"whitespace-pre-line text-sm text-card-text-muted",children:h.description}),(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsx)("span",{className:"text-lg font-bold text-card-text",children:p.price?(0,s.T4)(p.price.discountPrice):""}),(null===(x=p.price)||void 0===x?void 0:x.menuDiscount)&&(0,n.jsx)("span",{className:"ml-2 text-sm text-card-text-subtle line-through",children:(0,s.T4)(p.price.price)})]}),(0,n.jsx)(d.Z,{foodType:h.foodType}),h.modifiers.length>0&&(0,n.jsx)("div",{className:"mt-4",children:h.modifiers.map(e=>(0,n.jsx)(m,{modifier:e,detail:p},e.id))}),p.productInstructionsEnabled&&(0,n.jsx)(a.Xi,{labelClassName:"text-card-text",id:"instructions",value:p.instructions,onChange:p.setInstructions,maxLength:p.productInstructionsMaxLength})]})]}),(0,n.jsx)("div",{className:"sticky bottom-0 z-modal border-t border-card-text/10 bg-card-bg p-4",children:(0,n.jsx)("div",{className:"mx-auto flex max-w-app items-center gap-4",children:b.reservable?(0,n.jsx)(a.zx,{fullWidth:!0,size:"lg","data-testid":"product-detail-schedule",onClick:()=>{let e=p.buildItem();e&&g({item:e,onBeforeOpen:p.close})},children:i.ZP.t("ProductDetail:scheduleOrder")}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.cw,{value:p.quantity,onChange:p.setQuantity}),(0,n.jsxs)(a.zx,{fullWidth:!0,size:"lg","data-testid":"product-detail-add",onClick:p.addToCart,disabled:!b.hasStock,className:"hover:!bg-secondary hover:!opacity-100 hover:text-[color:var(--brand-secondary-text)]",children:[i.ZP.t("V2ProductDetail:".concat(p.isEditing?"update":"add"))," ",(0,s.T4)(p.calculateTotal())]})]})})})]})}},24398:function(e,t,r){r.d(t,{$:function(){return i}});var n=r(80286);let i=(e,t)=>(0,n.lV)("".concat(e," ").concat(t))},79345:function(e,t,r){r.d(t,{Dm:function(){return o},a8:function(){return s},hM:function(){return d},xM:function(){return a}});var n=r(27484),i=r.n(n),l=r(82892);let o={0:"sunday",1:"monday",2:"tuesday",3:"wednesday",4:"thursday",5:"friday",6:"saturday"};function s(){try{return(null===l.N||void 0===l.N?void 0:l.N.timezone)?i()().tz(l.N.timezone):i()()}catch(e){return i()()}}function a(e){let t=null==e?void 0:e.match(/(\d{1,2}):(\d{2})/);return t?60*parseInt(t[1]||"0",10)+parseInt(t[2]||"0",10):null}function d(e,t){var r,n;let i=s(),l=o[i.day()],d=60*i.hour()+i.minute(),c=e.filter(e=>{var r;return(null===(r=e.day)||void 0===r?void 0:r.toLowerCase())===l&&(e.dispatchMethod===t||"both"===e.dispatchMethod)});if(0===c.length)return;let u=c.find(e=>{let t=a(e.openingTime),r=a(e.closingTime);return null!=t&&null!=r&&d>=t&&d<=r});if(u)return u;let m=c.filter(e=>{let t=a(e.closingTime);return null!=t&&t>d}).sort((e,t)=>(null!==(r=a(e.openingTime))&&void 0!==r?r:0)-(null!==(n=a(t.openingTime))&&void 0!==n?n:0))[0];return null!=m?m:c[c.length-1]}},5625:function(e,t,r){function n(){var e,t;let r=null===(e=window.google)||void 0===e?void 0:null===(t=e.maps)||void 0===t?void 0:t.places;return(null==r?void 0:r.AutocompleteSessionToken)?new r.AutocompleteSessionToken:null}async function i(e,t,r){var n,i,l,o,s,a;let d=null===(n=window.google)||void 0===n?void 0:null===(i=n.maps)||void 0===i?void 0:i.places;if(!(null==d?void 0:d.AutocompleteSuggestion))return[];try{let{suggestions:n}=await d.AutocompleteSuggestion.fetchAutocompleteSuggestions({input:e,includedRegionCodes:[t],sessionToken:r});if(!Array.isArray(n))return[];return n.map(e=>e.placePrediction).filter(Boolean).map(e=>{var t,r,n,i;return{placeId:e.placeId,primaryText:null!==(o=null!==(l=null===(t=e.mainText)||void 0===t?void 0:t.text)&&void 0!==l?l:null===(r=e.text)||void 0===r?void 0:r.text)&&void 0!==o?o:"",secondaryText:null!==(s=null===(n=e.secondaryText)||void 0===n?void 0:n.text)&&void 0!==s?s:"",fullText:null!==(a=null===(i=e.text)||void 0===i?void 0:i.text)&&void 0!==a?a:""}})}catch(e){return[]}}r.d(t,{I:function(){return i},x:function(){return n}})},23019:function(e,t,r){function n(e){return null==e||""===e}function i(e){let{latitude:t,longitude:r}=e;if(n(t)||n(r))return null;let i=encodeURIComponent("".concat(t,",").concat(r));return"".concat("https://www.google.com/maps/search/?api=1","&query=").concat(i)}r.d(t,{v:function(){return i}})}}]);

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.