1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8575],{38563:function(e,t,r){r.d(t,{r5:function(){return l},tJ:function(){return o},yj:function(){return n}});var i=r(29736);let n={Sun:i.zN2.Sunday,Mon:i.zN2.Monday,Tue:i.zN2.Tuesday,Wed:i.zN2.Wednesday,Thu:i.zN2.Thursday,Fri:i.zN2.Friday,Sat:i.zN2.Saturday};i.Aej.Wifi,i.Aej.BlazingRewards,i.Aej.GoLocation,i.Aej.ExpressLocation,i.Aej.UfcViewing,i.Aej.Delivery,i.Aej.DriveIn,i.Aej.DriveThru,i.Aej.OnlineOrdering,i.Aej.Stall,i.Aej.Patio,i.Aej.MobileExpress,i.Aej.CarryOut,i.tzv.DriveThrough,i.tzv.MobileExpress,i.tzv.Patio,i.tzv.Stall,i.tzv.CarryOut;let l="/locations",o=["FLS_LOCATION_NOT_FOUND","FLS_NO_PICKUP_LOCATIONS_FOUND"]},14653:function(e,t,r){r.d(t,{KJ:function(){return u},VD:function(){return o},_U:function(){return c},d9:function(){return a},eJ:function(){return s}});var i,n,l=r(72517);let o=l.default.Order.RECENT_ORDERS_TOAST_MESSAGE_ALL_ITEMS_UNAVAILABLE;l.default.Order.RECENT_ORDERS_TOAST_MESSAGE_ITEMS_NOT_IN_THE_MENU;let a=l.default.Order.RECENT_ORDERS_PRODUCT_NOT_FOUND||"Unknown Product",u=null!==(n=null===(i=l.default.Order)||void 0===i?void 0:i.REORDER_AUTO_STORE_TOAST)&&void 0!==n?n:"Ordering from {{locationName}}",s="hasProductsNotInMenu",c="hasSelectionsNotInMenu"},29783:function(e,t,r){var i=r(67294),n=r(91886),l=r(65504),o=r(29925),a=r(56494),u=r(92753),s=r(5901),c=r(63744),d=r(14653);t.Z=e=>{let{actions:{getProduct:t,getModifier:r,getProductGroupById:f,getModifierGroupById:v,getModifiersFromModifierGroup:p},isNationalMenu:y}=(0,o.Z)(),{availableItems:{categories:m}}=(0,a.Z)(),h=(0,i.useCallback)(function(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i={};for(let a of e){var o;let e=(0,l.V)("productGroups",a.productGroupId),u=r&&!a.productGroupId;if(!i[e]){u&&(i[(0,l.V)("products",a.productId)]={...t(a.productId),isDefault:!0});let r=f(a.productGroupId);if(!r)continue;i[e]={...r,childRefs:[]}}let s=t(a.productId);if(!s)continue;let c=(null===(o=a.selections)||void 0===o?void 0:o.length)?h(a.selections):{},d=a.action===n.rU7.Add;i[e].childRefs.push({...s,selected:d,quantity:{selected:Number(a.quantity)||1},ingredientRefs:c})}return i},[f,t]),A=(0,i.useCallback)(e=>{let t={};for(let o of e){var i,n;let e=(0,l.V)("modifierGroups",o.modifierGroupId);if(!t[e]){let r=v(o.modifierGroupId);if(!r){console.warn("Modifier group not found: ".concat(o.modifierGroupId));continue}t[e]={...r,childRefs:[]}}let a=p(o.modifierGroupId),u=r(o.modifierId);u&&t[e].childRefs.push({...u,isDefault:null!==(n=null===(i=a.find(e=>e.id===o.modifierId))||void 0===i?void 0:i.isDefault)&&void 0!==n?n:u.isDefault,selected:!0,quantity:{selected:1}})}return t},[v,r,p]),I=(0,i.useCallback)(e=>e.selections&&Array.isArray(e.selections)&&e.selections.length>0,[]),R=(0,i.useCallback)(e=>e.some(e=>I(e)),[I]),E=(0,i.useCallback)(e=>{let r={unavailableRootItems:[],availableItems:[],unavailableItems:[],notInTheMenuItems:[],migratedWithIssuesItems:[],itemWithAllUnavailableSelections:[]},i=e=>{let r=t(e.productId);return y||(null==r?void 0:r.isAvailable)===!0},l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.some(e=>!t(e.productId)||l((null==e?void 0:e.selections)||[]))};for(let o of e){if(o.conversionStatus===n.nc1.Failure){r.migratedWithIssuesItems.push(o);continue}let e=t(o.productId);if(!e){r.notInTheMenuItems.push(o);continue}l(o.selections)&&r.notInTheMenuItems.push(o);let a=y||e.isAvailable;a||r.unavailableRootItems.push(o);let{allUnavailable:u,hasUnavailable:s}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce((e,t)=>{let r=!i(t);return{allUnavailable:e.allUnavailable&&r,hasUnavailable:e.hasUnavailable||r}},{allUnavailable:!0,hasUnavailable:!1})}(o.selections);a&&!s?r.availableItems.push(o):(r.unavailableItems.push(o),u&&r.itemWithAllUnavailableSelections.push(o))}let o=r.unavailableItems.length>0,a=0===r.availableItems.length&&r.itemWithAllUnavailableSelections.length===e.length||r.unavailableRootItems.length===e.length,u=r.notInTheMenuItems.length>0,s=r.migratedWithIssuesItems.length>0;return{...r,hasUnavailableItems:o,allItemsUnavailable:e.length>0&&a,hasNotInMenuItems:u,hasOrderMigrationIssues:s}},[t,y]),T=(0,i.useCallback)((r,i)=>{let n=t(r.productId);if(!n)return console.warn("Product not found: ".concat(r.productId)),null;let l=(0,c.Sx)(n.groupIds),{category:o,subcategory:a}=(0,c.Rr)(l,m)||{},{selections:u=[],modifiers:d=[]}=r,f=h(u,(0,s.s)(n)),v=A(d),p=Number(r.quantity)||1;return{...n,quantity:{selected:p},ingredientRefs:f,modifierGroupRefs:v,isReorder:!0,index:i+1,listName:e||void 0,category:o||void 0,subcategory:a||void 0}},[t,h,A,e]),b=(0,i.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.map((e,r)=>T(e,r+t)).filter(e=>null!==e)},[T]),_=(0,i.useCallback)(e=>{let t=R(e),r=e=>{let r;return r=0+(e.price||0)*(Number(e.quantity)||1),e.modifiers&&Array.isArray(e.modifiers)&&(r+=e.modifiers.reduce((e,t)=>
1e+(t.price||0),0)),t&&e.selections&&Array.isArray(e.selections)&&(r+=_(e.selections)),r},i=e.reduce((e,t)=>e+r(t),0);return(0,u.h)(i)},[R]),O=(0,i.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=0;return e.offers&&Array.isArray(e.offers)&&(r+=e.offers.reduce((e,t)=>e+(Number(t.discountAmount)||0),0)),e.certificates&&Array.isArray(e.certificates)&&(r+=e.certificates.reduce((e,t)=>e+(Number(t.discountAmount)||0),0)),t&&e.selections&&Array.isArray(e.selections)&&(r+=e.selections.reduce((e,r)=>e+O(r,t),0)),r},[]),g=(0,i.useCallback)(e=>{let t=0,r="appliedOffers"in e?e.appliedOffers:e.offers;r&&Array.isArray(r)&&(t+=r.reduce((e,t)=>e+(Number(t.discountAmount)||0),0));let i="appliedCertificates"in e?e.appliedCertificates:e.certificates;if(i&&Array.isArray(i)&&(t+=i.reduce((e,t)=>e+(Number(t.discountAmount)||0),0)),e.selections&&Array.isArray(e.selections)){let r=R(e.selections);t+=e.selections.reduce((e,t)=>e+O(t,r),0)}return(0,u.h)(t)},[O,R]),C=(0,i.useCallback)(e=>{if(e.offers&&Array.isArray(e.offers)&&e.offers.length>0)return!0;let t=e=>e.some(e=>!!(e.offers&&Array.isArray(e.offers))&&e.offers.length>0||!!(e.selections&&Array.isArray(e.selections))&&t(e.selections));return!!(e.selections&&Array.isArray(e.selections))&&t(e.selections)},[]),N=(0,i.useCallback)(e=>{if(e.certificates&&Array.isArray(e.certificates)&&e.certificates.length>0)return!0;let t=e=>e.some(e=>!!(e.certificates&&Array.isArray(e.certificates))&&e.certificates.length>0||!!(e.selections&&Array.isArray(e.selections))&&t(e.selections));return!!(e.selections&&Array.isArray(e.selections))&&t(e.selections)},[]),S=(0,i.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{addedSelections:e.filter(e=>e.action===n.rU7.Add).map(e=>{var i;let n;let{productId:l}=e,o=t(l);if(!o)return{name:e.description||d.d9,quantity:1,productId:l,price:e.price||0,offers:e.offers,certificates:e.certificates};let a=((null==e?void 0:e.modifiers)||[]).map(t=>{let i=r(t.productId||t.modifierId);return{name:(null==i?void 0:i.displayName)||t.displayName||t.description,quantity:1,productId:l,price:t.price,offers:e.offers,certificates:e.certificates}});return(null==e?void 0:null===(i=e.selections)||void 0===i?void 0:i.length)&&(n=S(e.selections)),{name:(null==o?void 0:o.displayName)||e.description,quantity:+e.quantity,productId:l,price:e.price,modifiers:a.filter(e=>!!e.name),selections:n,offers:e.offers,certificates:e.certificates}}).filter(e=>null!==e),removedSelections:e.filter(e=>e.action===n.rU7.Remove).map(e=>{let{productId:r}=e,i=t(r);if(!i)return null;let n=((null==e?void 0:e.modifiers)||[]).map(e=>({name:e.displayName,quantity:1,productId:r,price:e.price})),l=+e.quantity;return{minQuantity:l,maxQuantity:l,name:(null==i?void 0:i.displayName)||e.description,defaultQuantity:l,productId:r,price:e.price,modifiers:n}}).filter(e=>null!==e),hasSubSelections:R(e)}},[t,R]);return{buildOrderSelections:S,mapAddToBagItem:T,mapOrderItemsToBagPayload:b,validateProductAvailability:E,buildIngredientRefs:h,buildModifierGroupRefs:A,calculateTotalSelectionPrice:_,calculateSelectionDiscount:O,calculateTotalOrderItemDiscountPrice:g,checkHasSubSelections:R,hasNestedSelections:I,hasOffersApplied:C,hasCertificatesApplied:N}}},48575:function(e,t,r){r.d(t,{P:function(){return Y}});var i=r(11163),n=r(67294),l=r(72517),o=r(73658),a=r(23630),u=r(29925),s=r(92250),c=r(56494),d=r(27439),f=r(57148),v=r(40757),p=r(65359),y=r(40647),m=r(64491),h=r(12405),A=r(63744),I=r(87586),R=r(10074),E=r(33148),T=r(65504),b=r(80839),_=r(42005),O=r(9118),g=r(31508),C=r(64583),N=r(79328),S=r(33896);let U=()=>{let e=(0,i.useRouter)(),t=(0,n.useRef)(null),r=(0,n.useRef)(!1);return(0,n.useCallback)((i,n)=>{t.current=null!=n?n:null,r.current=!1;let l=()=>{r.current=!0},o=i=>{if(t.current&&r.current){let n=t.current;t.current=null,r.current=!1,e.events.off("routeChangeStart",l),e.events.off("routeChangeComplete",o),null==n||n(i)}},a=()=>{t.current&&(t.current=null,r.current=!1,e.events.off("routeChangeStart",l),e.events.off("routeChangeComplete",o),e.events.off("routeChangeError",a))};e.events.on("routeChangeStart",l),e.events.on("routeChangeComplete",o),e.events.on("routeChangeError",a),e.replace(i.url,i.as,i.options)},[e])};var D=r(14653),k=r(29783),M=r(29736),L=r(32951),w=r(87042),q=r(86582),Z=r(38563),x=r(44241),G=r(12461),j=r(42759),P=r(65454),z=r(58503),V=r(83404),W=r(32249);let F="success-checkmark",B=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e4;return{message:e,autoHideDuration:r,data:{variant:"overlay",centerText:!0,showIcon:!0,icon:F},presentation:{presentationType:f.R.overlayAlert,message:e,callsToAction:{primary:{text:t,action:Z.r5,type:"primary",isExternal:!1}}}}},Q=()=>{var e,t;let r=(0,i.useRouter)(),{handleLocationSet:o}=(0,j.Z)(),{actions:{enqueueSuccess:a}}=(0,s.Z)(),{isDesktop:u}=(0,W.E)(),[c]=(0,z.Ym)(P.hy.AUTO_SELECT_REORDER_LOCATION),d=null!==(t=null==c?void 0:c.enabled)&&void 0!==t&&t,[f]=(0,z.Ym)(P.hy.REORDER_AUTO_STORE_TOAST_TIMEOUT),v=null==f?void 0:null===(e=f.variables)||void 0===e?void 0:e.timeoutValue,p="number"==typeof v?v:1e4,{trackReorderAutoStoreSelect:y,trackReorderAutoStoreFallback:m}=(0,V.Z)(),{pendingReorder:h,autoSelectedStore:A,actions:{setPendingReorder:I,clearPendingReorder:R,setAutoSelectedStore:E}}=(0,q.Z)();return{tryAutoSelectLocation:(0,n.useCallback)(async(e,t)=>{var i,n,s,c,f,v,h,A;let R=null===(n=e.fulfillment)||void 0===n?void 0:null===(i=n.location)||void 0===i?void 0:i.id,T=(null===(s=e.fulfillment)||void 0===s?void 0:s.type)==="DELIVERY",b=e.orderStatus===M.Nrh.Cancelled;if(!d)return!1;if(!R||T||b)return m(),r.push("".concat(Z.r5,"?reorderid=").concat(e.id)),!0;try{let i=await (0,G.Z)({locationId:R}),n=(0,w.gv)(i,void 0,!0,!0);if(!(0,L.Y)(!0,i,null!==(h=null==n?void 0:n.isOpen)&&void 0!==h&&h))return m(),r.push("".concat(Z.r5,"?reorderid=").concat(e.id)),!0;o(i),E(i);let s=(0,x._)(D.KJ,{locationName:null!==(A=null==i?void 0:null===(f=i.contactDetails)||void 0===f?void 0:null===(c=f.address)||void 0===c?void 0:c.line1)&&void 0!==A?A:""}),d=(null===(v=l.default.Location)||void 0===v?void 0:v.SMART_STORE_CHANGE_LINK_TEXT)||"Change";return u?a(B(s,d,p)):C.f.show({toastText:s,variant:"success",icon:F,timeout:p,linkText:d,onLinkClicked:()=>r.push(Z.r5)}),y(),I({order:e,orderIndex:t}),!0}catch(t){return m(),r.push("".concat(Z.r5,"?reorderid=").concat(e.id)),!0}},[d,u,p,o,r,a,y,m,E,I]),pendingReorder:h,autoSelectedStore:A,clearPendingReorder:R}},J={MENU:"/menu",BAG:"/bag",LOCATIONS:"/locations"},{Product:{MAX_QTY_REACHED:K}}=l.default,Y=e=>{let{bagEntries:t,entriesMarkedAsRemoved:r,actions:{addDefaultToBag:l}}=(0,o.Z)(),{actions:{getProduct:M},loading:L}=(0,u.Z)(),{actions:{getTotalCalories:w}}=(0,a.i)(),{transformFavoriteItemRequestToTallyItem:q}=(0,S.Z)(),{availableItems:{categories:Z},getOperationalRootProduct:x}=(0,c.Z)(),G=(0,i.useRouter)(),{isCurrentLocationOAAvailable:j,currentLocation:P}=(0,d.Z)(),{validateProductAvailability:z}=(0,k.Z)(e),V=(0,v.TL)(),{actions:{enqueueError:W}}=(0,s.Z)(),F=U(),{tryAutoSelectLocation:B,pendingReorder:Y,clearPendingReorder:H}=Q(),X=(0,n.useRef)(!1),{isAuthenticated:$}=(0,R.Z)(),{toast:ee}=(0,N.E)(),et=(0,n.useCallback)(e=>z(e.products),[z]),er=(0,n.useCallback)(function(i){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,{availableItems:o,allItemsUnavailable:a}=et(i),u=o.filter(e=>{var t;let r=null!==(t=M(x(e.productId)||e.productId))&&void 0!==t?t:M(e.productId);return!r||!(0,I.s2)(r)}),s=null;if(!0===a&&(s=D.VD),a||0===u.length){F({url:J.MENU,options:{shallow:!1}},e=>{e.includes(J.MENU)&&s&&(C.f.hide(),W({presentation:{presentationType:f.R.toast,superTitle:"",details:"",title:"",message:s},closeByDefault:!0}))});return}let c=0,d=!1,v=new Map;if(u.forEach((i,o)=>{var a,u,s,f,p,y,I,R,b;let _=M(i.productId),O=(0,T.I)(Object.keys((null==_?void 0:_.ingredientRefs)||{}).find(e=>(0,E.NQ)(e))),g=q({...i,isReorder:!0,listName:e,orderIndex:n,index:n+o+1,selections:null==i?void 0:null===(a=i.selections)||void 0===a?void 0:a.map(e=>e.productId===O?{...e,productGroupId:void 0}:e)},{remapProductGroupIds:!0}
1),C=w(g),N=x(i.productId)||i.productId,S=M(N),U=null!==(y=null!==(p=null==S?void 0:S.id)&&void 0!==p?p:null==_?void 0:_.id)&&void 0!==y?y:N,D=null!==(I=v.get(U))&&void 0!==I?I:(0,m.D)(t,r,U);if((0,h.U)({bagEntries:t,entriesMarkedAsRemoved:r,currentLocation:P,productId:U,maxQuantity:null!==(R=null==S?void 0:null===(u=S.quantity)||void 0===u?void 0:u.max)&&void 0!==R?R:null==_?void 0:null===(s=_.quantity)||void 0===s?void 0:s.max,currentProductQuantityInBag:D,quantity:g.quantity})){d=!0;return}if(v.set(U,D+(null!==(b=null===(f=g.quantity)||void 0===f?void 0:f.selected)&&void 0!==b?b:1)),!S){l({...g,totalCalories:C}),c++;return}let k=(0,A.Sx)(S.groupIds,S.categoryId),L=(0,A.Rr)(k,Z);l({...g,displayName:(null==S?void 0:S.displayName)||g.displayName||"",totalCalories:C,category:null==L?void 0:L.category,subcategory:null==L?void 0:L.subcategory}),c++}),d&&ee.show({toastText:K||p.hB,variant:"error",icon:"informational"}),0===c)return;let{reorderid:R,...N}=G.query;F({url:{pathname:G.pathname,query:N},as:void 0,options:{shallow:!0}},()=>{e===y.vd?(V({type:b.aw,payload:{order_interaction:b.OZ.REORDER_RECENT_ORDERS,order_placement:y.vd}}),V({type:g.bp.MPARTICLE_START_ORDER,payload:{orderInteraction:_.Ik,userType:(0,O.n)($)}})):e===y.ve?(V({type:b.aw,payload:{order_interaction:b.OZ.REORDER_RECENT_ORDERS,order_placement:y.ve}}),V({type:g.bp.MPARTICLE_START_ORDER,payload:{orderInteraction:_.ow,userType:(0,O.n)($)}})):e===y.lU&&(V({type:b.aw,payload:{order_interaction:b.OZ.REORDER_RECENT_ORDERS,order_placement:y.lU}}),V({type:g.bp.MPARTICLE_START_ORDER,payload:{orderInteraction:_.vs,userType:(0,O.n)($)}})),G.push(J.BAG)})},[et,F,W,l,G,e,V,Z,x,M,q,w,$,P,t,r,ee]);return(0,n.useEffect)(()=>{Y&&j&&!L&&X.current&&(X.current=!1,H(),er(Y.order,Y.orderIndex))},[Y,j,L,er,H]),{handleReorder:(0,n.useCallback)(async(t,r)=>{if(j){er(t,r);return}if(await B(t,r)){X.current=!0;return}let i=new URLSearchParams({reorderid:t.id});e&&i.set("listName",e),G.push("".concat(J.LOCATIONS,"?").concat(i.toString()))},[er,j,B,G,e]),executeReorderWithLocationAndMenu:er}}}}]); 2//# sourceMappingURL=8575-6bb9bfca664d77b0.js.map
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.