1!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["unified-main-header"]=t():e["unified-main-header"]=t()}(window,()=>(()=>{var e={253:(e,t,n)=>{HtmlUtil=n(7978),e.exports=function(){this.pastOrderItems={pastOrderModal:".past-order-modal",orderTitle:".past-order-modal__title__content",orderStatus:".past-order-modal__details__order-status",orderDetails:".past-order-modal__details__order-details",orderButton:".past-order-modal__details__order-button",viewOrders:".past-order-modal__view-order",editOrderText:"Edit Order",addItemsText:"Add Items",pickingBehindSchedule:"picking-behind-schedule"},this.init=function(){HtmlUtil.readElement(this.pastOrderItems.pastOrderModal)&&this.setOrRefreshOrderStatus()},this.setOrRefreshOrderStatus=function(){$(".past-order-modal__inner")&&$(".past-order-modal__inner").length>0&&$(".reserve-nav__row")&&$(".reserve-nav__row").length>0&&$(".past-order-modal__inner").css("top",$(".reserve-nav__row").offset().top+$(".reserve-nav__row").height()+24);let e=!1;if((window.location.pathname.indexOf("account/orders.html")>-1||window.location.pathname.indexOf("order/confirmation")>-1)&&(e=!0),"R"===window.AB.userInfo.userType||"C"===window.AB.userInfo.userType&&window.AB.COMMON.isLSCompatible())if(localStorage.abActiveOrders){let t=JSON.parse(localStorage.abActiveOrders);if((new Date-new Date(t.timeStamp))/6e4>15||e){let e=this.getPastOrders();e.event?e.event===t.event&&e.orderNumber===t.orderNumber||!0!==e.activeOrder?this.changeTimeStamp():this.setPastOrders(e):(this.setPastOrders(e),HtmlUtil.getElement(this.pastOrderItems.pastOrderModal).addClass("d-none"))}this.showOrder()}else{let e=this.getPastOrders();"ERROR"!==e&&Object.keys(e).length>0&&this.setPastOrders(e)}else window.AB.COMMON.isLSCompatible()&&localStorage.abActiveOrders&&localStorage.removeItem("abActiveOrders")},this.setPastOrders=function(e){let t={};if(!0===e.activeOrder)e.banner.toLowerCase()===window.AB.userInfo.banner.toLowerCase()&&(t.orderNumber=e.orderNumber,t.storeNumber=e.storeNumber,t.fulfillmentOrderNumber=e.fulfillmentOrderNumber,t.deliveryType=e.deliveryType,t.banner=e.banner,t.url=e.url,t.urlType=e.urlType,t.message={},t.message.title=e.message[0],t.message.orderStatus=e.message[1],t.message.actionMessage=e.message[2],t.message.action=e.message[3],t.event=e.event,t.statusOfOrder=e.activeOrder,t.orderEdit=e.orderEdit,t.orderEditState=e.orderEditState,t.timeStamp=new Date,t.userActionClickX=!1,localStorage.setItem("abActiveOrders",JSON.stringify(t)),this.showOrder());else{t.statusOfOrder=!1,t.timeStamp=new Date,localStorage.setItem("abActiveOrders",JSON.stringify(t));const e=HtmlUtil.getElement(this.pastOrderItems.pastOrderModal);orderDetails=HtmlUtil.getElement(this.pastOrderItems.orderDetails),e.addClass("d-none"),orderDetails.addClass("d-none")}},this.getPastOrders=function(){let e={};if(window.AB.userInfo.SWY_SHOP_TOKEN&&window.AB.userInfo.customerId){let t="Bearer "+AB.userInfo.SWY_SHOP_TOKEN;const n=window.location.origin+AB.pastOrderStatusEndpoint+AB.userInfo.customerId+"/channel/web";$.ajax({type:"GET",headers:{"Content-Type":"application/json","Ocp-Apim-Subscription-Key":AB.pastOrderStatusApimKey,Authorization:t},url:n,dataType:"json",async:!1,success:function(t){e=t},error:function(t,n,r){e="ERROR"}})}return e},this.modifyMsg=function(e){let t=e.replace(/([\d]{1,2})\/([\d]{1,2})/g,function(e,t,n){let r=function(e){const t=new Date;return t.setMonth(e-1),t.toLocaleString("en-US",{month:"short"})}(t);return`${n+function(e){if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}(n)} ${r}`});return t=t.replace("-","to"),t},this.showOrder=function(){if(localStorage.abActiveOrders){let e=JSON.parse(localStorage.abActiveOrders);if(!e.userActionClickX&&e.statusOfOrder){const t=HtmlUtil.getElement(this.pastOrderItems.pastOrderModal),n=HtmlUtil.getElement(this.pastOrderItems.orderTitle),r=HtmlUtil.getElement(this.pastOrderItems.orderStatus),o=HtmlUtil.getElement(this.pastOrderItems.orderDetails),i=HtmlUtil.getElement(this.pastOrderItems.orderButton);HtmlUtil.getElement(this.pastOrderItems.viewOrders).hide();const s=40;let a=e.message.title.slice(0,s);switch(n.text(a),n.attr("aria-label",this.modifyMsg(a)),r.text(e.message.orderStatus),o.text(e.message.actionMessage),i.text(e.message.action),e.event){case"CREATED":case"IN-PROGRESS":case"LATE-PICK-ALERT":e.orderEdit?(i.text(this.pastOrderItems.editOrderText),i.attr("href","/erums/order/edit/cart/"+e.storeNumber+"/"+e.orderNumber)):i.addClass("d-none");break;case"CREATED-AFTER-CUTOFF":i.text(this.pastOrderItems.editOrderText),i.addClass("d-none"),i.attr("href","/erums/order/edit/cart/"+e.storeNumber+"/"+e.orderNumber);break;case"DELIVERY-ON-THE-WAY":e.deliveryType&&e.url?(i.attr("href",e.url),i.attr("target","_blank"),i.attr("aria-label",e.message.action+" - opens in a new tab")):i.addClass("d-none");break;case"BEHIND-SCHEDULE":o.addClass("d-none"),e.deliveryType?(i.attr("href",e.url),i.text(e.message.actionMessage),i.attr("target","_blank"),i.attr("aria-label",e.message.actionMessage+" - opens in a new tab")):i.addClass("d-none");break;case"DELIVERY-MISSED":case"PICKED-UP":case"ENROUTE-TO-PICKUP":case"PACKED":case"REFUNDED":i.addClass("d-none");break;case"DELIVERED":i.attr("href",e.url);break;case"PENDING-RESCHEDULE":o.addClass("d-none"),i.text(e.message.actionMessage),i.attr("href","/erums/order/reschedule/edit/slot/"+e.storeNumber+"/"+e.orderNumber);break;case"PICKING-BEHIND-SCHEDULE":r.addClass(this.pastOrderItems.pickingBehindSchedule),e.orderEdit?(i.text(this.pastOrderItems.editOrderText),i.attr("href","/erums/order/edit/cart/"+e.storeNumber+"/"+e.orderNumber)):i.addClass("d-none");break;case"PICKUP-READY":o.addClass("d-none"),i.text(e.message.actionMessage),i.attr("href","/instore-pickup.html?ffm="+e.fulfillmentOrderNumber);break;case"PICK-START":"Add"==e.orderEditState?(i.text(this.pastOrderItems.addItemsText),i.attr("href","/order-account/orders/"+e.orderNumber+"/item-details")):"Edit"==e.orderEditState?(i.text(this.pastOrderItems.editOrderText),i.attr("href","/erums/order/edit/cart/"+e.storeNumber+"/"+e.orderNumber)):i.addClass("d-none");break;case"TENDER-DECLINE":i.text(e.message.action),i.attr("href","/customer-account/payment.html")}(!window.AB.COMMON.checkForEditOrderMode()&&(window.location.pathname.indexOf("shop")>-1||"/"===window.location.pathname)||window.location.pathname.indexOf("home")>-1)&&t.removeClass("d-none")}}},this.closeModal=function(){const e=HtmlUtil.getElement(this.pastOrderItems.pastOrderModal);let t=JSON.parse(localStorage.getItem("abActiveOrders"));t.userActionClickX=!0,localStorage.setItem("abActiveOrders",JSON.stringify(t)),e.addClass("d-none")},this.changeTimeStamp=function(){const e=HtmlUtil.getElement(this.pastOrderItems.pastOrderModal);let t=JSON.parse(localStorage.getItem("abActiveOrders"));t.timeStamp=new Date,localStorage.setItem("abActiveOrders",JSON.stringify(t)),e.addClass("d-none")}}},458:(e,t,n)=>{const r=n(7978),o=n(7595),i=n(4794),s=n(8813);e.exports=function(){this.accountItems={myAccountFlyOutBackdrop:".myAccount-flyout-backdrop",signInBackdrop:".sign-in-background",myAccountFlyOutNavElement:".myaccount-flyout-wrapper div.sidebar",myAccountButton:".menu-nav__profile-button-sign-in-up",myAccountNavItem:".menu-nav__list-item.first__item",sidebarToggleClass:"sidebar--effect",ariaExpanded:"aria-expanded",sidebarSignInAccountLabel:".sidebar__sign
1InAccountLabel",sidebarHideSignInAccountLabel:"sidebar__hide-signInAccountLabel",sidebarUserWelcome:".sidebar__user-welcome",sidebarShowUserWelcome:"sidebar__show-user-welcome",sidebarSignOutLink:".sidebar__nav-signout-link",sidebarShowSignoutLink:"sidebar__nav-show-signout-link",userNameClass:".sidebar__user-welcome__message",signedInUserLabel:"Account",signInLabelCaretDown:".button__item.menu-nav__red-caret-down",signInLabelCaretUp:"menu-nav__red-caret-up",syndicated:"syndicated",sidebarWrapper:".myaccount-flyout-wrapper",myAccountLinkButton:".menu-nav__profile-button",menuNavWrapper:".menu-nav__wrapper",shopFlyoutOpenButtons:".menu-nav__left-container .shop-link, .menu-nav__mobile-menu-trigger .menu-nav__icon-container",rightFlyoutCloseElements:".myAccount-flyout-backdrop, .sidebar__user-welcome__close, .sidebar__user-signInLinks__close, .right-drawer__close, .substitution-list__close",rightDrawerClass:"sidebar__right-drawer",signInModalLink:"#sign-in-modal-link",sidebarCloseButton:"#sidebar__close-button",myAccountFlyoutMenu:"#menu",sidebarUserGreet:".sidebar__user-welcome.sidebar__show-user-welcome",inlineBlock:"d-lg-inline-block",displayFlex:"flex",searchContainerWrapper:".search-wrapper.search-nav",signInDropDown:".web-otp .sign-in-dropdown"},this.init=function(){this.removeAccountFlyoutLink(),this.toggleSideBar()},this.populateUserName=function(){const e=AB.COMMON.authorize();let t=!1;if(window.SWY&&window.SWY.CONFIGSERVICE?.featureToggleConfig?t=!window.SWY||!window.SWY.CONFIGSERVICE?.featureToggleConfig?.isNavigationEngineDisabled:SWY.configService?.isNavigationEngineDisabled&&"false"===SWY.configService?.isNavigationEngineDisabled&&(t=!0),e){const e=r.readElement(this.accountItems.myAccountNavItem),n=this.accountItems.syndicated;let o,i,s;if(window.innerWidth,this.accountItems.inlineBlock,this.accountItems.displayFlex,""!=AB.COMMON.getCookie("SWY_SHARED_PII_SESSION_INFO")?(o=AB.COMMON.getCookie("SWY_SHARED_PII_SESSION_INFO"),i=JSON.parse(o),s=i.name):""!=AB.COMMON.getCookie("SWY_SYND_USER_INFO")?(o=AB.COMMON.getCookie("SWY_SYND_USER_INFO"),i=JSON.parse(o),s=i.firstName):AB.userInfo&&AB.userInfo.firstName&&AB.userInfo.firstName.length>0&&(s=AB.userInfo.firstName),e&&!e.hasClass(n)){const e=r.getElement(this.accountItems.sidebarSignInAccountLabel),n=r.getElement(this.accountItems.sidebarUserWelcome),o=r.getElement(this.accountItems.sidebarSignOutLink),i=r.getElement(this.accountItems.userNameClass),a=this.accountItems.sidebarHideSignInAccountLabel,l=this.accountItems.sidebarShowUserWelcome,d=this.accountItems.sidebarShowSignoutLink;if(e.addClass(a),n.addClass(l),o.addClass(d),null!=s&&s.length>0)if(s.indexOf("+")>=1&&(s=s.replaceAll("+"," ")),t){let e=s;null!=e&&e.length>0&&($(".user-greeting").text(e).css({"text-decoration":"none"}),$(".account_menu__name").text("Hi "+e)),$(".user-greeting")?.width()>154&&$(".user-greeting")?.removeClass("d-inline-block")}else i.text("Hi, "+s+"!"),AB.COMMON.updateUserFirstName(s);else $("body")&&null!=$("body").on&&$("body").on("onGetUserInfoLoad",function(e,n){let r;try{r=JSON.parse(n)}catch(e){AB.COMMON.updateUserFirstName(t?"Member":"Account")}r.firstName&&r.firstName.length>0&&(s=r.firstName,AB.COMMON.updateUserFirstName(s))})}}},this.toggleSideBar=function(){const e=r.readElement(this.accountItems.myAccountNavItem),t=r.readElement(this.accountItems.myAccountButton),n=this.accountItems.syndicated,a=this.accountItems.signedInUserLabel,l=AB.COMMON.authorize(),d=this;let c=!1;if(window.SWY&&window.SWY.CONFIGSERVICE?.featureToggleConfig?c=!window.SWY||!window.SWY.CONFIGSERVICE?.featureToggleConfig?.isNavigationEngineDisabled:SWY.configService?.isNavigationEngineDisabled&&"false"===SWY.configService?.isNavigationEngineDisabled&&(c=!0),e&&t&&(l||e.hasClass(n))&&(t.text(c?"Member":a),myAccountLinkButton=r.getElement(this.accountItems.myAccountLinkButton),myAccountLinkButton.attr("title",""),myAccountLinkButton.attr("aria-label",a+" menu")),e&&!e.hasClass(n)&&t){const e=r.getElement(this.accountItems.myAccountFlyOutBackdrop),t=r.readElement(this.accountItems.signInBackdrop),n=r.getElement(this.accountItems.myAccountFlyOutNavElement),a=r.getElement(this.accountItems.myAccountButton),u=r.getElement(this.accountItems.myAccountNavItem),p=this.accountItems.sidebarToggleClass,m=this.accountItems.ariaExpanded,h=this.accountItems.sidebarShowUserWelc
1ome,f=r.getElement(this.accountItems.sidebarWrapper),g=r.getElement(this.accountItems.sidebarUserWelcome),y=r.getElement(this.accountItems.myAccountLinkButton),C=r.getElement(this.accountItems.menuNavWrapper),v=r.readElement(this.accountItems.shopFlyoutOpenButtons),b=r.readElement(this.accountItems.signInModalLink),_=$(this.accountItems.sidebarCloseButton),w=r.readElement(this.accountItems.myAccountFlyoutMenu),S=s.isMobile(),I=r.readElement(this.accountItems.signInDropDown);if(u.length>0&&a.length>0){const s=w.get(0),a=function(e){e.forEach(function(e){const t=window.innerWidth;"attributes"===e.type&&"class"===e.attributeName&&t<992&&(w.hasClass("sidebar--effect")?i.setAriaHidden(".menu-nav",!0,S):i.setAriaHidden(".menu-nav",!1,S)),"attributes"===e.type&&"style"===e.attributeName&&t>991&&i.setAriaHidden(".menu-nav",!1,S)})};S&&o.mutationObserver(a,s),t&&t.length>0&&$(".sign-in-background").on("click keypress",function(e){"click"!==e.type&&"Escape"!==e.key&&27!==e.keyCode&&"Enter"!==e.key&&13!==e.keyCode||($(".sign-in-background").hide(),$("#signin-dropdown").hide(),t.css("display","none"))}),u.on("click",function(s){if(s.stopPropagation(),s.preventDefault(),!l&&t&&t.length>0){if(c){function a(){let e=window.innerWidth,n=C.offset().top-$(window).scrollTop()+C.outerHeight();e<1025?(t.css("top",n-d.searchContainerHeight()),I.css("margin-top",n-d.searchContainerHeight()-1)):(t.css("top",n),I.css("margin-top",n-1))}a();const S=function(e){e.length&&a()};o.mutationObserver(S)}else{let E=C.offset().top-$(window).scrollTop()+C.height();t.css("top",E)}$("#signin-dropdown").show(),$("#signin-dropdown").focus(),$(".button__item.menu-nav__red-caret-down").addClass("menu-nav__red-caret-up"),t.css("display","block"),window.AB?.DATALAYER&&window.AB.DATALAYER.setSignInModalEvents("view","shopped-with-us-before|view","","account"),$("#signin-dropdown").click(function(e){e.target==this&&($("#signin-dropdown").hide(),t.css("display","none"),c&&I.removeClass("s-sign-in-dropdown"),$(".button__item.menu-nav__red-caret-down").removeClass("menu-nav__red-caret-up"),window.AB?.DATALAYER&&window.AB.DATALAYER.setSignInModalEvents("click","shopped-with-us-before|close"))}),b.focus(),window.AB.DIVISIONAL.modalTrapKeyboard("#signin-dropdown")}else{function w(){let t=C.offset().top-$(window).scrollTop()+(c?C.outerHeight():C.height());c&&(n.css("width",""),t=0),$(".sidebar-right-drawer").is(":visible")||(e.add(n).css("top",t),n.css("height",$(window).height()-t))}if(i.setAriaHidden(".menu-nav",!0),y.attr(m,(e,t)=>"true"==t?"false":"true"),rightDrawerComp.openRightFlyout("my-account"),w(),$(window).resize(function(){w()}),f.is(":visible")&&(g.hasClass(h)?$(".sidebar__show-user-welcome + .sidebar__nav li:first-child a").focus():b.focus()),d.populateUserName(),"none"!==v.css("display")&&(v.attr(m,(e,t)=>"true"==t?"false":"true"),v.hasClass("activeMenu")?(f.css("pointer-events","auto"),v.attr("aria-label","close account menu")):(u.css("pointer-events",""),f.css("pointer-events",""),v.attr("aria-label","Navigation menu"))),$("#shopFlyOutModal").modal("hide"),n.hasClass(p)?$(".body-wrapper").addClass("modal-open"):$(".body-wrapper").removeClass("modal-open")&&i.setAriaHidden(".menu-nav",!1),v.on("click",function(t){$("#shopFlyOutModal").modal("hide"),f.hide(),e.hide(),n.removeClass(p),u.css("pointer-events",""),f.css("pointer-events",""),$(".body-wrapper").removeClass("modal-open"),v.removeClass("activeMenu"),v.attr(m,!1),y.attr(m,!1),v.attr("aria-label","Navigation menu")}),c)if(e.focus(),e.on("click keydown",function(t){"click"!==t.type&&"Escape"!==t.key&&27!==t.keyCode&&"Enter"!==t.key&&13!==t.keyCode||(f.hide(),e.hide(),n.removeClass(p),u.css("pointer-events",""),f.css("pointer-events",""),$(".body-wrapper").removeClass("modal-open"),y.attr(m,!1),y.focus())}),window.AB.COMMON.authorize()){const A=r.readOneElement("div.sidebar__nav-signout-link .account_menu__list-items");A?.addEventListener("keydown",function(t){"Tab"!==t.key&&9!==t.keyCode||t.shiftKey||(t.preventDefault(),e.focus())})}else{const O=r.readElement("li.account_menu__list-items"),k=O?O[O.length-1]:null;k&&k?.addEventListener("keydown",function(t){"Tab"!==t.key&&9!==t.keyCode||t.shiftKey||(t.preventDefault(),e.focus())})}setTimeout(()=>{_.focus()},0)}}),_.on("click",function(e){e.stopPropagation(),e.preventDefault(),setTimeout(()=>{u.focus()},500)})}}},this.removeAccountFlyoutLink=function(){const e=r.readElement(this.accountItems.myAccountLinkButton),t=r.readElement(this.accountItems.myAccountNavItem),n=this.accountItems.syndicated;t&&t.length>0&&(t.hasClass(n)||e&&e.length>0&&e.attr("href","javascript:void(0)"))},this.searchContainerHeight=function(){const e=$(this.accountItems.searchContainerWrapper);return e.is(":visible")&&e?.outerHeight()>0?e.outerHeight():0}}},1316:(e,t,n)=>{const r=n(7978);e.exports=function(){this.yourstore={item_syndicated:"syndicatedHeader",item_selector:".yourstore-class"},r.readElement(this.yourstore.item_selector),this.init=function(){if("true"===r.getMetaElementContent(this.yourstore.item_syndicated)){let e=SWY.CONFIGSERVICE.getCookie("SWY_SYND_USER_INFO");""!==e&&(e=JSON.parse(e),this.isSyndicated=!0,this.storeId=e.storeId)}else{this.isSyndicated=!1,this.storeId=AB.userInfo.j4u.storeId;let e=SWY.CONFIGSERVICE.getCookie("SWY_SHARED_SESSION_INFO");SWY.CONFIGSERVICE.featureToggleConfig.enableCookieRestructure?""!==e&&Object.keys(e).length>0&&(e=JSON.parse(e),"dug"===e.info.COMMON.preference.toLowerCase()&&(this.storeId=e.info.COMMON.storeId)):""!==e&&Object.keys(e).length>0&&(e=JSON.parse(e),"dug"===e.info.COMMON.preference.toLowerCase()&&(this.storeId=e.info.SHOP.storeId))}let e=this;$(this.yourstore.item_selector).click(function(t){t.preventDefault();let n=e.getStoreAddress(e.storeId,e.isSyndicated);e.setYourStoreLink(n)})},this.setYourStoreLink=function(e){let t=e;this.isSyndicated,window.location.href=t}
1,this.getStoreAddress=function(e,t){let n=window.location.origin;const r=AB.storeResolverStoreAddressEndpoint,o={"Content-Type":"application/json","Ocp-Apim-Subscription-Key":SWY.CONFIGSERVICE.wcaxXapiConfig["wcax.xapi.apim.key"]},i={storeid:e};if(t){const e=document.getElementsByClassName("menu-nav__center-container")[0];let t=document.createElement("a");t.href=e.getElementsByTagName("a")[0].href,n=t.protocol+"//"+t.hostname}let s;return AB.COMMON.getStoreResolverPayload(n,r,i,o,!1,function(e){s=e.storeAddressModel.localPage},function(e,t,n){throw"The Store Resolver API returned error: "+n}),s}}},1779:e=>{e.exports=function(){this.a11yItems={modalReturnFocus:null,modalInitialFocusClass:".modal-init-focus",modalShownEvent:"shown.bs.modal",modalHiddenEvent:"hidden.bs.modal",keyDownEvent:"keydown",modalTriggerClass:".aria-modal",ariaHidden:"aria-hidden"},this.modalIds={rewardsSummaryModal:"rewards-selected-modal",myListPrintDesktopModal:"myListPrintDesktopModal",myListPrintMobileModal:"myListPrintMobileModal",sessionTimeoutModal:"sessionTimeoutModal"},this.handleModalFocus=function(){let e=this;$(document).on(this.a11yItems.modalShownEvent,this.a11yItems.modalTriggerClass,function(t){e.a11yItems.modalReturnFocus=t.relatedTarget;let n=$(t.target);n.attr(e.a11yItems.ariaHidden,!1),n.find(e.a11yItems.modalInitialFocusClass).focus(),n.prop("id")!==e.modalIds.sessionTimeoutModal&&$(".root").children().children().not(":nth-child(2)").attr(e.a11yItems.ariaHidden,!0),n.prop("id")===e.modalIds.rewardsSummaryModal&&(n.parent().children(":nth-child(1)").attr(e.a11yItems.ariaHidden,!0),n.parent().parent().parent().children(":nth-child(1)").attr(e.a11yItems.ariaHidden,!0),n.parent().parent().parent().parent().children().not(":last").attr(e.a11yItems.ariaHidden,!0),n.parent().parent().parent().parent().parent().parent().parent().parent().children().not(":nth-child(2)").attr(e.a11yItems.ariaHidden,!0),n.parent().parent().parent().parent().parent().parent().parent().parent().parent().children(":nth-child(1)").attr(e.a11yItems.ariaHidden,!0),$(".root").children().children(":nth-child(2)").children(":nth-child(1)").children(":nth-child(1)").attr(e.a11yItems.ariaHidden,!0)),n.prop("id")===e.modalIds.myListPrintDesktopModal&&(n.parent().children(":nth-child(1)").attr(e.a11yItems.ariaHidden,!0),n.parent().parent().children(":nth-child(2)").attr(e.a11yItems.ariaHidden,!0),n.parent().parent().parent().children(":nth-child(2)").attr(e.a11yItems.ariaHidden,!0),n.parent().parent().parent().parent().children(":nth-child(1)").attr(e.a11yItems.ariaHidden,!0)),n.prop("id")===e.modalIds.myListPrintMobileModal&&(n.parent().children(":nth-child(1)").attr(e.a11yItems.ariaHidden,!0),n.parent().parent().children(":nth-child(2)").attr(e.a11yItems.ariaHidden,!0),n.parent().parent().parent().parent().parent().children().not(":nth-child(2)").attr(e.a11yItems.ariaHidden,!0),n.parent().attr(e.a11yItems.ariaHidden,!1),n.parent().parent().parent().parent().attr(e.a11yItems.ariaHidden,!1)),n.prop("id")===e.modalIds.sessionTimeoutModal&&(n.parent().children().not(":nth-child(2)").attr(e.a11yItems.ariaHidden,!0),n.parent().parent().children().not(":nth-child(9)").attr(e.a11yItems.ariaHidden,!0),n.parent().parent().parent().children(":nth-child(2)").attr(e.a11yItems.ariaHidden,!0),$(".root").children().children().not(":nth-child(3)").attr(e.a11yItems.ariaHidden,!0),$(".session-expired-close-button").focus())}),$(document).on(this.a11yItems.modalHiddenEvent,this.a11yItems.modalTriggerClass,function(t){let n=$(t.target);n.attr(e.a11yItems.ariaHidden,!0),$(".root").children().children().not(":nth-child(2)").removeAttr(e.a11yItems.ariaHidden),n.prop("id")===e.modalIds.rewardsSummaryModal&&(n.parent().children(":nth-child(1)").removeAttr(e.a11yItems.ariaHidden),n.parent().parent().parent().children(":nth-child(1)").removeAttr(e.a11yItems.ariaHidden),n.parent().parent().parent().parent().children().not(":last").removeAttr(e.a11yItems.ariaHidden),n.parent().parent().parent().parent().parent().parent().parent().parent().children().not(":nth-child(2)").removeAttr(e.a11yItems.ariaHidden),n.parent().parent().parent().parent().parent().parent().parent().parent().parent().children(":nth-child(1)").removeAttr(e.a11yItems.ariaHidden),$(".root").children().children(":nth-child(2)").children(":nth-child(1)").children(":nth-child(1)").removeAttr(e.a11yItems.ariaHidden)),n.prop("id")===e.modalIds.myListPrintDesktopModal&&(n.parent().children(":nth-child(1)").removeAttr(e.a11yItems.ariaHidden),n.parent().parent().children(":nth-child(2)").removeAttr(e.a11yItems.ariaHidden),n.parent().parent().parent().children(":nth-child(2)").removeAttr(e.a11yItems.ariaHidden),n.parent().parent().parent().parent().children(":nth-child(1)").removeAttr(e.a11yItems.ariaHidden)),n.prop("id")===e.modalIds.myListPrintMobileModal&&(n.parent().children(":nth-child(1)").removeAttr(e.a11yItems.ariaHidden),n.parent().parent().children(":nth-child(2)").removeAttr(e.a11yItems.ariaHidden),n.parent().parent().parent().children().not(":nth-child(3)").removeAttr(e.a11yItems.ariaHidden),n.parent().parent().parent().parent().children().not(":nth-child(1)").removeAttr(e.a11yItems.ariaHidden),n.parent().parent().parent().parent().parent().children().not(":nth-child(2)").removeAttr(e.a11yItems.ariaHidden),n.parent().removeAttr(e.a11yItems.ariaHidden),n.parent().parent().parent().parent().removeAttr(e.a11yItems.ariaHidden)),n.prop("id")===e.modalIds.sessionTimeoutModal&&(n.parent().children().not(":nth-child(2)").removeAttr(e.a11yItems.ariaHidden),n.parent().parent().children().not(":nth-child(9)").removeAttr(e.a11yItems.ariaHidden),n.parent().parent().parent().children(":nth-child(2)").removeAttr(e.a11yItems.ariaHidden),$(".root").children().children().not(":nth-child(3)").removeAttr(e.a11yItems.ariaHidden)),$(e.a11yItems.modalReturnFocus).focus(),e.a11yItems.modalReturnFocus=null}),$(document).on(this.a11yItems.keyDownEvent,"#"+e.modalIds.sessionTimeoutModal+" .session-expired-close-button",function(e){9==e.which&&e.shiftKey&&($(".session-expired-sign-in-button").focus(),e.preventDefault())}),$(document).on(this.a11yItems.keyDownEvent,"#"+e.modalIds.sessionTimeoutModal+" .session-expired-sign-in-button",function(e){9!=e.which||e.shiftKey||($(".session-expired-close-button").focus(),e.preventDefault())})},this.init=function(){this.handleModalFocus()}}},2363:e=>{e.exports=function(){this.closedStoreObject={abs_session:"abs_gsession",ab_intent:"ab_intent"},this.init=function(){this.triggerFulfillmentModal()},this.triggerFulfillmentModal=function(){let e=AB.userInfo.isClosed;!0===e&&(this.removeCookie(this.closedStoreObject.abs_session),this.removeObjectFromLocalStorage(this.closedStoreObject.ab_intent),this.setModalDisplayTab(e))},this.setModalDisplayTab=function(e){window.storeFulfillmentModal&&window.storeFulfillmentModal.component.setModalDisplayData(3,null,null,e)},this.removeObjectFromLocalStorage=function(e){localStorage.removeItem(e)},this.removeCookie=function(e){document.cookie=e+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;",console.log(document.cookie)}}},2499:e=>{e.exports=function(){this.executeLazyScript=function(e){if(!window.lazyFunctions)return;let t=e.getAttribute("data-lazy-function"),n=window.lazyFunctions[t];return n?n(e):void 0},this.lazyLoadFunctionsInstance=function(){if("undefined"!=typeof LazyLoad){let e={elements_selector:".ab-lazy-function",unobserve_entered:!0,callback_enter:this.executeLazyScript,thresholds:"300px 10%"};
1return new LazyLoad(e)}return!1},this.init=function(){this.lazyLoadFunctionsInstance()}}},3083:e=>{const t={userIntentElements:{guestCookie:"abs_gsession",LSKey:"abintent",action:"action",intent:"intent",selection:"selection",errorMessage:"Error occurred: Precondition Failed"},setUserIntent:e=>{const n=AB.COMMON.isLSCompatible();let r={};if("object"==typeof e&&Object.entries(e).length>0&&n){let n={};Object.keys(e).forEach(r=>{r&&e[r]&&(r===t.userIntentElements.action||r===t.userIntentElements.intent||r===t.userIntentElements.selection)&&(n[r]=e[r])}),Object.entries(n).length>0?(n=JSON.stringify(n),localStorage.setItem(t.userIntentElements.LSKey,n),r={success:!0,parsedObj:n}):r={success:!1,message:t.userIntentElements.errorMessage}}else console.error("Error occurred: Precondition Failed to set abintent"),r={success:!1,message:t.userIntentElements.errorMessage};return r}};e.exports=t},3403:e=>{e.exports=function(){this.mergeAcctModalItems={mainId:"#merge-account-modal",successId:"#merge-account-success",title:"#merge-account-title",cookieName:"ACI_S_promptMergeAccount",successCookieName:"ACI_S_mergeAccountSuccess",mergeCloseBtnId:"#merge-account-close",successCloseBtnId:"#merge-success-close"},this.init=function(){let e=AB.COMMON.getCookie(this.mergeAcctModalItems.cookieName),t=AB.COMMON.getCookie(this.mergeAcctModalItems.successCookieName);if(e){let e,t=AB.userInfo.firstName,n=$(this.mergeAcctModalItems.title).text();e=t.length>0?n.replace("{firstName}",t):n.replace(", {firstName}",""),$(this.mergeAcctModalItems.title).text(e),this.deleteCookieAndShowModal(this.mergeAcctModalItems.cookieName,this.mergeAcctModalItems.mainId,this.mergeAcctModalItems.mergeCloseBtnId),this.analyticsTrackAction("to-merge")}t&&(this.deleteCookieAndShowModal(this.mergeAcctModalItems.successCookieName,this.mergeAcctModalItems.successId,this.mergeAcctModalItems.successCloseBtnId),this.analyticsTrackAction("success"))},this.checkIfMergeAcctCookieExists=function(){return AB.COMMON.getCookie(this.mergeAcctModalItems.cookieName)||AB.COMMON.getCookie(this.mergeAcctModalItems.successCookieName)},this.deleteCookieAndShowModal=function(e,t,n){document.cookie=e+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;",$(t).modal("show"),AB?.COMMON?.modalTrapKeyboard(t),setTimeout(function(){$(n).focus()},800)},this.closeModal=function(){let e=AB.mergeSkipPath.replace("{customerId}",AB.userInfo.UUID),t=AB.mergeAccountsHttpHeader;$.post({headers:t,url:e,dataType:"json",success:function(e){},error:function(e,t,n){}}),$(this.mergeAcctModalItems.mainId).modal("hide")},this.analyticsTrackAction=function(e){AB?.DATALAYER&&("to-merge"===e||"success"===e?AB.DATALAYER.setModalViewEvents(`account-merge-${"success"===e?"success":"to-merge"===e?`with ${AB.userInfo?.firstName?"f":"no-"}name`:"modal-error"}|view`):"close"===e||"do-this-later"===e?AB.DATALAYER.setModalClickEvents(`account-merge-with ${AB.userInfo?.firstName?"f":"no-"}name|${e}`):"sign-in-again"===e&&"G"===AB?.userInfo?.userType&&AB.DATALAYER.setModalClickEvents(`account-merge-success|${e}`))}}},3462:()=>{var e;e=window,e.AB?.sponsoredBeaconBridge?.register?.("sbcWebgen",{bridgeKey:"sbcWebgenBeaconBridge",customElementName:"webgen-shop-by-category-component",dataMethodName:"applyFeaturedCategoryData",componentName:"ShopByCategory",payloadIconsPath:"icons",payloadRequestIdPath:"requestId",categoryIdPath:"content.categoryId",eventTrackingPath:"eventTracking",categoryIdAttribute:"data-category-id",onloadEventName:"AD_ONLOAD_EVENTS",onloadContext:"sponsoredCategoryIconsLoaded",clickEventName:"AD_CLICK",clickContext:"sponsoredIconsClicked",impressionEventName:"AD_IMPRESSION",impressionContext:"sponsoredIconsImpression"})},3706:(e,t,n)=>{const r=n(7978);n(7878),e.exports=function(){this.editOrderItems={slotCookie:"SlotInfo",orderStoreCookie:"OrderStoreId",orderNumberCookie:"OrderNumber",slotCookieB2b:"B_SlotInfo",orderStoreCookieB2b:"B_OrderStoreId",orderNumberCookieB2b:"B_OrderNumber",slotInfo:"",orderStoreId:"",orderNumber:"",deliveryPrefVal:"delivery",eRumsDeliveryType:"eRumsDeliveryType",reserveNavEl:".reserve-nav",slotDisplay:"#po
1DeliveryDate",reviewCTA:"#poCancelLink",editOrderRowUI:"#pendingOrderAlert",reserveTimeEl:"#reserveCon",isSyndicatedHeader:"syndicatedHeader"},this.init=function(){},this.isB2B="B"===AB?.userInfo?.siteType,this.checkForEditOrderMode=function(){let e,t,n=!1;return this.isB2B?(e=AB.COMMON.getCookie(this.editOrderItems.slotCookieB2b),t=AB.COMMON.getCookie(this.editOrderItems.orderStoreCookieB2b)):(e=AB.COMMON.getCookie(this.editOrderItems.slotCookie),t=AB.COMMON.getCookie(this.editOrderItems.orderStoreCookie)),"undefined"!==e&&"undefined"!==t&&""!==e&&""!==t&&(this.editOrderItems.slotInfo=e,this.editOrderItems.orderStoreId=t,n=!0),n},this.editOrderSessionUpdate=function(){let e={info:{COMMON:{},J4U:{},SHOP:{}}},t=this.editOrderItems.orderStoreId;e.info.J4U.storeId=t,e.info.SHOP.storeId=t,e.info.COMMON.preference=this.editOrderItems.deliveryPrefVal,AB.userInfo.preferenceMode=this.editOrderItems.deliveryPrefVal,AB.COMMON.updateUserSession(e,!1)},this.checkPendingOrderAlert=function(){let e=this,t=r.readElement(this.editOrderItems.reserveNavEl);if(this.isB2B?e.editOrderItems.orderNumber=AB.COMMON.getCookie(this.editOrderItems.orderNumberCookieB2b):e.editOrderItems.orderNumber=AB.COMMON.getCookie(this.editOrderItems.orderNumberCookie),""!=e.editOrderItems.orderNumber&&AB.COMMON.authorize())if(t&&t.length>0&&(t=r.getElement(this.editOrderItems.reserveNavEl),t.hide()),e.checkForEditOrderMode()){if("true"!==r.getMetaElementContent(e.editOrderItems.isSyndicatedHeader)){let t=r.getElement(e.editOrderItems.slotDisplay),n=r.getElement(e.editOrderItems.reviewCTA),o=r.getElement(e.editOrderItems.editOrderRowUI);n&&n.attr("href",SWY.CONFIGSERVICE.erumsConfig["spa.editorder.endpoint"]+"/cart/"+e.editOrderItems.orderStoreId+"/"+e.editOrderItems.orderNumber),t&&t.html(e.editOrderItems.slotInfo),n&&n.prop("onclick",null).off("click"),o&&o.removeClass("mask")}e.eRumsDeliveryCheckCall(e.editOrderItems.orderNumber)}else e.eRumsDeliveryCheckCall(e.editOrderItems.orderNumber);else localStorage.getItem(e.editOrderItems.eRumsDeliveryType)&&localStorage.removeItem(e.editOrderItems.eRumsDeliveryType),$(e.editOrderItems.reserveTimeEl).show()},this.eRumsDeliveryCheckCall=function(e){let t=this,n="";localStorage.getItem(t.editOrderItems.eRumsDeliveryType)&&(n=JSON.parse(localStorage.getItem(t.editOrderItems.eRumsDeliveryType))),""!=n&&n.orderId==e&&"Unattended"==n.deliveryType?AB.ALERT.unattendedDeliveryWrapper(n.deliveryType):!0===SWY.CONFIGSERVICE.erumsConfig["editorder.oldversion"]?(url=AB.erumsOrderDelivery,eRumsHeaders=AB.ecommHttpOptionsErums,$.ajax({headers:eRumsHeaders,url:url+e,dataType:"json",success:function(e){localStorage.setItem(t.editOrderItems.eRumsDeliveryType,JSON.stringify({orderId:e.order.orderId,deliveryType:e.order.deliveryType})),t.setABCartLS(e),AB.ALERT.unattendedDeliveryWrapper(e.order.deliveryType)},error:function(e,t,n){}})):!1===SWY.CONFIGSERVICE.erumsConfig["editorder.oldversion"]&&(t.editOrderItems.orderStoreId=AB.COMMON.getCookie(this.isB2B?this.editOrderItems.orderStoreCookieB2b:this.editOrderItems.orderStoreCookie),url=AB.erumsOrderDelivery,eRumsHeaders=AB.ecommHttpOptionsErums,$.ajax({headers:eRumsHeaders,url:url+t.editOrderItems.orderStoreId+"/"+e,dataType:"json",success:function(e){let n,r,o;if(localStorage.setItem(t.editOrderItems.eRumsDeliveryType,JSON.stringify({orderId:e.orderId,deliveryType:e.deliveryType})),t.setABCartLS(e),e&&e.deliveryInfo&&e.deliveryInfo.slotInfo){const t=e.deliveryInfo.slotInfo;t.displayStartTS&&(n=t.displayStartTS,n=Date.parse(n)),t.slotId&&(r=t.slotId)}e&&e.serviceType&&(o=e.serviceType.toLowerCase(),o="dug"===o?"pickup":"delivery"),localStorage.setItem("abSlotEditOrder",JSON.stringify({timeSlot:n,slotId:r,serviceType:o})),t.editOrderZipCodeUpdate(e.customerInfo.zipCode),t.editOrderPreferenceUpdate(e.deliveryType),AB.ALERT.unattendedDeliveryWrapper(e.deliveryType)},error:function(e,t,n){}}))},this.editOrderZipCodeUpdate=function(e){let t={info:{COMMON:{},J4U:{},SHOP:{}}};t.info.COMMON.zipcode=e,t.info.J4U.zipcode=e,t.info.SHOP.zipcode=e,AB.COMMON.updateUserSession(t,!1)},this.editOrderPreferenceUpdate=function(e){let t={info:{COMMON:{},J4U:{},SHOP:{}}},n="";n=e?"delivery":"dug",AB.userInfo.preferenceMode=n,t.info.COMMON.preference=n,AB.COMMON.updateUserSession(t,!1)},this.setABCartLS=function(e){localStorage.setItem("abCart",JSON.stringify({branchId:e.storeId?e.storeId:"",cartItems:e.orderItems?e.orderItems:[],cartPrice:e.orderSummary?.estimatedSubTotal||e.wysiwygOrderSummary?.estimatedSubTotal||"",cartQty:e.orderSummary?.totalItemQuantity||e.wysiwygOrderSummary?.totalItemQuantity||0,erumsStore:!0,isWYSIWYGEnabled:e.isWYSIWYGEnabled,orderNumber:e.orderId?e.orderId:""})),this.loadPendingOrderData()},this.loadPendingOrderData=function(){null!=window.cartServiceRefAL&&window.cartServiceRefAL.zone.run(function(){window.cartServiceRefAL.service.loadPendingOrderData()})}}}
1,3743:(e,t,n)=>{const r=n(7978),o=n(4794),i=n(7595);e.exports=function(){this.rightDrawerItems={sidebar:".myaccount-flyout-wrapper div.sidebar",sidebarWrapper:".myaccount-flyout-wrapper",rightDrawer:".sidebar-right-drawer",myaccount:".sidebar-myaccount-flyout",backdrop:".myAccount-flyout-backdrop",signInLabelCaretDown:".button__item.menu-nav__red-caret-down",sidebarShoppingCartClose:".right-drawer__close",signInLabelCaretUp:"menu-nav__red-caret-up",sidebarToggleClass:"sidebar--effect",rightDrawerClass:"sidebar__right-drawer",rightDrawerMinicart:".sidebar-right-drawer .mini-cart, .sidebar-right-drawer mini-cart-v2",rightDrawerCouponList:".sidebar-right-drawer .coupon-list",miniCartWrapper:".sidebar-right-drawer mini-cart-wrapper",miniCartWrapperInnerContainer:".sidebar-right-drawer mini-cart-wrapper .marketplace-cart",rightDrawerOfferDetail:".sidebar-right-drawer .offer-detail",mobileHamBtn:".menu-nav__mobile-menu-trigger .menu-nav__icon-container",rightFlyoutCloseElements:".myAccount-flyout-backdrop, .sidebar__user-welcome__close, .sidebar__user-signInLinks__close, .right-drawer__close, .substitution-list__close, .s_nav_fulfillment_address div#openFulfillmentModalButton, button.svg-hamburger-icon.s_nav__hamburger_menu",mobileHamCloseBtnClass:"activeMenu",myAccountLinkButton:".menu-nav__profile-button"};const e=r.readElement(this.rightDrawerItems.sidebarWrapper),t=r.readElement(this.rightDrawerItems.rightDrawer),n=r.readElement(this.rightDrawerItems.myaccount),s=r.readElement(this.rightDrawerItems.backdrop),a=r.readElement(this.rightDrawerItems.signInLabelCaretDown),l=r.readElement(this.rightDrawerItems.sidebarShoppingCartClose),d=r.readElement(this.rightDrawerItems.mobileHamBtn),c=this.rightDrawerItems.rightDrawerClass,u=this.rightDrawerItems.mobileHamCloseBtnClass,p=this.rightDrawerItems.signInLabelCaretUp,m=this.rightDrawerItems.sidebarToggleClass;myAccountLinkButton=this.rightDrawerItems.myAccountLinkButton;let h=null,f=r.readElement(this.rightDrawerItems.sidebar);this.init=function(){this.closeSideBar(),this.handleMobileHamBtnAda()},this.openRightFlyout=function(o,i,g){const y=r.readElement(this.rightDrawerItems.rightDrawerMinicart),C=!window.SWY||!window.SWY.CONFIGSERVICE?.featureToggleConfig?.isNavigationEngineDisabled;switch(C&&f?.removeClass("mini-cart-nav"),h=document.activeElement,o){case"my-account":f.hasClass(m)&&1==t.is(":visible")?(t.hide(),n.show(),s.show(),f.removeClass(c),a.addClass(p),f.attr("aria-label","Account options"),d.attr("aria-label","close account menu")):f.hasClass(m)&&0==t.is(":visible")?(f.removeClass(m),setTimeout(()=>{e.hide()},300),s.hide(),d.removeClass("activeMenu"),a.removeClass(p),f.attr("aria-label","")):(e.show(),t.hide(),n.show(),s.show(),f.addClass(m),d.addClass(u),a.addClass(p),f.attr("aria-label","Account options"),d.attr("aria-label","close account menu"));break;case"mini-cart":!f.hasClass(m)||1!=n.is(":visible")&&null!==y?f.hasClass(m)&&null!==y?(this.closeDrawer(),s.hide(),d.removeClass(u),f.attr("aria-label",""),d.attr("aria-label","Navigation menu")):(this.callAngMinicartComp(),this.openDrawer(),d.addClass(u),f.attr("aria-label","Shopping cart"),l.attr("aria-label","close Shopping cart"),d.attr("aria-label","close Shopping cart"),this._modalShowADA(),C&&f?.addClass("mini-cart-nav")):(this.callAngMinicartComp(),n.hide(),t.show(),f.addClass(c),s.hide(),this.handleFocus(),a.removeClass(p),f.attr("aria-label","Shopping cart"),l.attr("aria-label","close Shopping cart"),d.attr("aria-label","close Shopping cart"),this._modalShowADA(),C&&f?.addClass("mini-cart-nav"));break;case"multiple-coupon":f.hasClass(m)||this.openDrawer(),0==d.hasClass("activeMenu")&&d.addClass(u),f.attr("aria-label","coupons list"),this.handleFocus(),l.attr("aria-label","close coupons list"),d.attr("aria-label","close coupons list");break;case"single-coupon":f.hasClass(m)||this.openDrawer(),0==d.hasClass("activeMenu")&&d.addClass(u),this.handleFocus(),f.attr("aria-label","offer details"),l.attr("aria-label","close offer details"),d.attr("aria-label","close offer details");break;case"coupon-list":this.callAngCouponComp(o,i,g),f.hasClass(m)||this.openDrawer(),0==d.hasClass("activeMenu")&&d.addClass(u),f.attr("aria-label","coupons list"),this.handleFocus(),l.attr("aria-label","close coupons list"),d.attr("aria-label","close coupons list");break;case"offer-detail":case"bogo-detail":this.callAngCouponComp(o,i,g),f.hasClass(m)||this.openDrawer(),0==d.hasClass("activeMenu")&&d.addClass(u),this.handleFocus(),f.attr("aria-label","offer details"),l.attr("aria-label","close offer details"),d.attr("aria-label","close offer details");break;case"substitution-list":f.hasClass(m)||this.openDrawer(),0==d.hasClass("activeMenu")&&d.addClass(u),this.handleFocus(),f.attr("aria-label","substitution list"),l.attr("aria-label","close substitution list"),d.attr("aria-label","close substitution list")}},this.callAngMinicartComp=function(){window.rightdrawerCompRef.zone.run(function(){window.rightdrawerCompRef.component.loadComponents("mini-cart")})},this.callAngSubstitutionListComp=function(){window.rightdrawerCompRef.zone.run(function(){window.rightdrawerCompRef.component.loadComponents("substitution-list")})},this.callAngCouponComp=function(e,t,n){window.rightdrawerCompRef.zone.run(function(){window.rightdrawerCompRef.component.renderCouponComponents(e,t,n
1)})},this.closeDrawer=function(){f.removeClass(m),f.removeClass("sidebar__ada-flag"),f.hasClass(c)&&f.removeClass(c)&&f.removeAttr("style"),s.is(":visible")&&s.hide()&&s.removeAttr("style"),a.hasClass(p)&&a.removeClass(p),1==d.hasClass("activeMenu")&&d.removeClass("activeMenu"),setTimeout(()=>{e.hide()},300),$("body").hasClass("modal-open")&&$("body").removeClass("modal-open"),$(myAccountLinkButton).attr("aria-expanded","false"),o.setAriaHidden(".menu-nav",!1)},this.openDrawer=function(){e.show(),n.hide(),t.show(),f.addClass(m),f.addClass(c),this.calculateFlyoutPosition(),this.handleFocus()},this.handleFocus=function(){setTimeout(()=>{f.addClass("sidebar__ada-flag")},500),window.innerWidth<992?(d.focus(),$(".root").children().children().not(":first").attr("aria-hidden","true"),$(".reserve-nav").attr("aria-hidden","true")):l.focus()},this.closeSideBar=function(){const e=r.readElement(this.rightDrawerItems.rightFlyoutCloseElements);null!==e&&e.length>0&&e.on("click",function(e){rightDrawerComp.closeDrawer(),f.attr("aria-label",""),null!=h&&h.focus(),$(".root").children().children().not(":first").removeAttr("aria-hidden"),$(".reserve-nav").removeAttr("aria-hidden")})},this.handleMobileHamBtnAda=function(){null!==d&&d.length>0&&d.on("click",function(e){d.hasClass("activeMenu")||($(".root").children().children().not(":first").removeAttr("aria-hidden"),$(".reserve-nav").removeAttr("aria-hidden"),setTimeout(()=>{null!=h&&h.focus()},50))})},this.calculateFlyoutPosition=function(){const e=r.getElement(".menu-nav__wrapper"),t=r.getElement(".myAccount-flyout-backdrop"),n=r.getElement(".myaccount-flyout-wrapper div.sidebar"),o=this;let s=!1;window.SWY&&window.SWY.CONFIGSERVICE?.featureToggleConfig?s=!window.SWY||!window.SWY.CONFIGSERVICE?.featureToggleConfig?.isNavigationEngineDisabled:SWY.configService?.isNavigationEngineDisabled&&"false"===SWY.configService?.isNavigationEngineDisabled&&(s=!0);let a=e.offset().top-$(window).scrollTop()+e.height();s&&$(window).innerWidth()<1025&&(a-=o.searchContainerHeight()),this.adjustFlyout(o,t,n,a),i.mutationObserver(function(r){r.length&&(a=e.offset().top-$(window).scrollTop()+e.height(),s&&$(window).innerWidth()<1025&&(a-=o.searchContainerHeight()),$(".sidebar-myaccount-flyout").is(":visible")||o.adjustFlyout(o,t,n,a))}),$(window).scroll(function(){if(!$(".sidebar-myaccount-flyout").is(":visible")){let r=e.offset().top-$(window).scrollTop()+e.height();t.add(n).css("top",r),n.css("height",$(window).height()-r)}})},this.adjustFlyout=function(e,t,n,r){if(e.isMiniCartFullScreen()){const e=t.add(n);!e.hasClass("mini-cart-nav")&&$(".sidebar-right-drawer").is(":visible")&&e.addClass("mini-cart-nav")}else{const e=t.add(n);e.css({top:r,width:""}),e.removeClass("mini-cart-nav"),n.css("height",$(window).height()-r)}},this.isMiniCartFullScreen=function(){return!SWY?.CONFIGSERVICE?.featureToggleConfig?.isNavigationEngineDisabled&&$(this.rightDrawerItems.miniCartWrapper)?.length>0&&$(window).innerWidth()<1025},this._modalShowADA=function(){if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){const t=".menu-nav__mobile-menu-trigger",n="aria-hidden",r=t,o="right-drawer .mini-cart .cart-item button:last",i=".unified-header-v2",a=".header-version-2,.header-version-4",l=".menu-nav",d=$("secondary-bar")?".s_nav_fulfillment":".menu-nav__wrapper",c=".menu-nav__content",u=".myaccount-flyout-wrapper",p=".sidebar__right-drawer",m=".sidebar-right-drawer",h="right-drawer",g="global-header",y=".secondary-bar-proxy",C=".experiencefragment";$(i).siblings().attr(n,!0),$(a).siblings().attr(n,!0),$(l).siblings().attr(n,!0),$(d).siblings().attr(n,!0),$(c).siblings().attr(n,!0),$(u).siblings().not(t).attr(n,!0),$(p).siblings().attr(n,!0),$(m).siblings().attr(n,!0),$(g).closest(C).siblings().attr(n,!0),$(y).siblings().attr(n,!0);var e=$(h).siblings();window.SWY&&window.SWY.CONFIGSERVICE?.featureToggleConfig?.isNavigationEngineDisabled?e.attr(n,!0):e.not("button").attr(n,!0),$(o).on("keydown keypress",function(e){$("this:focus")&&9===e.which&&$(r).focus()}),$(".menu-nav__mobile-menu-trigger,global-header .right-drawer__close").on("click",()=>{$(i).siblings().removeAttr(n),$(a).siblings().removeAttr(n),$(l).siblings().removeAttr(n),$(d).siblings().removeAttr(n),$(c).siblings().removeAttr(n),$(u).siblings().removeAttr(n),$(p).siblings().removeAttr(n),$(m).siblings().removeAttr(n),$(h).siblings().removeAttr(n),$(g).closest(C).siblings().removeAttr(n),$(y).siblings().removeAttr(n),f.removeClass("mini-cart-nav"),s.removeClass("mini-cart-nav")})}},this.searchContainerHeight=function(){const e=$(".search-wrapper.search-nav");return e.is(":visible")&&e?.outerHeight()>0?e.outerHeight():0}}},4016:(e,t,n)=>{const r=n(7878),o={updateUserSession:function(e,t,n,i,s){if("object"!=typeof e||""===e||void 0===e)return"Parameter passed is either empty or not an object";if(void 0===e.info||void 0===e.info.COMMON&&void 0===e.info.J4U&&void 0===e.info.SHOP&&void 0===e.info.offbanner)return"Parameter passed doesn't match appropriate format";{const a=AB.userInfo.userType.toLowerCase();let l,d,c,u,p,m=!!e.info.offbanner;if("g"===a||"a"===a)!0===m?window.location=window.location.protocol+"//"+r.buildHost(e.info.offbanner.banner)+"/?storeId="+e.info.offbanner.storeId+"&preference="+e.info.offbanner.preference:(l=["abs_gsession","SWY_SHARED_SESSION_INFO","abs_home-categories-carousel.htmlpreviouslogin","SWY_SYND_USER_INFO"],d=SWY.CONFIGSERVICE.getCookie(l[0]),c=SWY.CONFIGSERVICE.getCookie(l[1]),u=SWY.CONFIGSERVICE.getCookie(l[2]),p=SWY.CONFIGSERVICE.getCookie(l[3]),o.isCookieEmpty(d)&&o.createSessionCookie(l[0],e),o.isCookieEmpty(c)&&o.createSessionCookie(l[1],e),o.isCookieEmpty(u)&&o.createSessionCookie(l[2],e),o.isCookieEmpty(p)&&o.createSessionCookie(l[3],e),o.updateUserCookieList(l,e));else if("r"===a||"c"===a){l=["SWY_SHARED_SESSION_INFO","abs_previouslogin","SWY_SYND_USER_INFO"],c=SWY.CONFIGSERVICE.getCookie(l[0]);let r=!!SWY.CONFIGSERVICE.featureToggleConfig.enableCookieRestructure;if(!1!==t){if(!0!==m){let t=e.info.COMMON.preference.length>0?e.info.COMMON.preference:c.info.COMMON.preference,i=SWY.CONFIGSERVICE.getResolvedBanner(),a=r?e.info.COMMON.zipcode:"J4U"===t?e.info.J4U.zipcode:e.info.SHOP.zipcode,d=null,u=null;if("J4U"===t.toUpperCase()){let t="J4U",s=r?e.info.COMMON.storeId&&e.info.COMMON.storeId.length>0?e.info.COMMON.storeId:c.info.COMMON.storeId:e.info.J4U.storeId&&e.info.J4U.storeId.length>0?e.info.J4U.storeId:c.info.J4U.storeId;return o.updateUcaProfile(t,s,d,i,a,e,l,d,n)}if("DUG"===t.toUpperCase()){let t="DUG";return u=r?e.info.COMMON.storeId&&e.info.COMMON.storeId.length>0?e.info.COMMON.storeId:c.info.COMMON.storeId:e.info.SHOP.storeId&&e.info.SHOP.storeId.length>0?e.info.SHOP.storeId:c.info.SHOP.storeId,o.updateUcaProfile(t,d,u,i,a,e,l,d,n)}{let t="DELIVERY";return u=r?e.info.COMMON.storeId&&e.info.COMMON.storeId.length>0?e.info.COMMON.storeId:c.info.COMMON.storeId:e.info.SHOP.storeId&&e.info.SHOP.storeId.length>0?e.info.SHOP.storeId:c.info.SHOP.storeId,o.updateUcaProfile(t,d,u,i,a,e,l,d,n,null,s)}}{let t,r,s=e.info.offbanner.preference.length>0?e.info.offbanner.preference:function(){throw new Error("Preference is empty")}(),a=e.info.offbanner.storeId.length>0?e.info.offbanner.storeId:function(){throw new Error("StoreId is empty")}(),d=e.info.offbanner.banner.length>0?e.info.offbanner.banner:function(){throw new Error("Banner is empty")}(),c=e.info.offbanner.zipcode.length>0?e.info.offbanner.zipcode:function(){throw new Error("Zipcode is empty")}(),u=s.toUpperCase(),p=!0,m=null;
1return"J4U"===u?(t=a,r=m):(t=m,r=a),o.updateUcaProfile(u,t,r,d,c,e,l,p,n,i)}}o.updateUserCookieList(l,e)}}},updateUcaProfile:(e,t,n,r,i,s,a,l,d,c,u)=>{AB.userInfo.customerId,r=r.replace(/\s|-/g,"");let p=AB.userInfo.UUID;if(!p)throw new Error("CustomerId is not Available to Update Profile");{let m,h,f,g,y=i,C=!0,v="";"J4U"===e?(g=t,C=!1,m='{"stores":[{"storeId":"'+g+'","storePreference":"Preferred","address":{"zipCode":"'+y+'"},"banner":"'+r+'"}],"preferences":[{"categoryCode":"FULFILLMENT","subCategoryCode":"METHOD","value":"J4U","bannerId":"'+r+'"}]}'):"DUG"===e?(g=n,f="dug",m='{"stores":[{"storeId":"'+g+'","storePreference":"DriveUp","address":{"zipCode":"'+y+'"},"banner":"'+r+'"}],"preferences":[{"categoryCode":"FULFILLMENT","subCategoryCode":"METHOD","value":"DUG","bannerId":"'+r+'"}]}'):"DELIVERY"===e&&(g=n,v="attended",f="delivery",m='{"preferences":[{"categoryCode":"FULFILLMENT","subCategoryCode":"METHOD","value":"DELIVERY", "bannerId":"'+r+'"}],"postalCodes":[{"purposes":["DELIVERY"],"postalCode":"'+y+'","bannerId":"'+r+'"}]}'),null===AB.COMMON.getCartId("cartId")&&(C=!1);let b=o.updateUCAProfileAPIPath(p),_=AB.ucaHttpOptionsUpdateProfileV2;o.isGeoFlowEnabled(u)&&(b=o.updateFulFillmentServletPath(p),_=AB.ucaHttpOptionsFulfillmentServlet,m=o.createDataObject(e,t,n,r,u)),$.ajax({url:b,type:"POST",headers:_,dataType:"json",data:m,async:!1,success:function(e,t,n){if(SWY.ENFORCEMENTUTILS.updateReInitSite("slot"),AB.CART.removeLocalStorage(),AB.COMMON.removeP13nOOSLocalStorage(),C)cartServiceRefAL.service.updateStoreForExistingCart(g,f,v,l,function(e){if(!0===l)window.location=c?window.location.protocol+"//"+AB.COMMON.buildHost(r)+SWY.ssoPath+"?ml="+c:window.location.protocol+"//"+AB.COMMON.buildHost(r)+SWY.ssoPath;else{if(AB.COMMON.updateUserCookieList(a,s),h={success:!0,message:"We have Successfully updated your profile"},"function"!=typeof d)return h;d(h)}},y);else if(!0===l)window.location=c?window.location.protocol+"//"+AB.COMMON.buildHost(r)+SWY.ssoPath+"?ml="+c:window.location.protocol+"//"+AB.COMMON.buildHost(r)+SWY.ssoPath;else{if(AB.COMMON.updateUserCookieList(a,s),h={success:!0,message:"We have Successfully updated your profile"},"function"!=typeof d)return h;d(h)}},error:function(e,t,n){if(h={success:!1,message:e.statusText},401===e.status||403===e.status){var r=SWY.ENFORCEMENT.getCookie("SAFEWAY_KMSI");if(AB.COMMON.authorize()&&SWY.ENFORCEMENT.checkAuthorizedCookie())window.location.reload();else if(AB.COMMON.authorize()&&"true"===r){let e=SWY.ssoPath+"?goto="+window.location.href;SWY.ENFORCEMENT.sendRedirect(e)}else window.location.reload()}else{if("function"!=typeof d)return h;d(h)}}})}},isGeoFlowEnabled:e=>e?.adr1,updateUCAProfileAPIPath:e=>SWY.CONFIGSERVICE.datapowerConfig.cncCtxPath+"/ucaservice/api/uca/customers/"+e+"/stores",updateFulFillmentServletPath:()=>AB.fulfillmentServlet,createDataObject:(e,t,n,r,o)=>{let i={},s={preferenceDefId:"2f779a23-f979-4dac-8b67-ae8a4c469e16",value:e,banner:r};return"DELIVERY"===e?i={address:{addressName:o?.bName||null,address1:o?.adr1,address2:o?.adr2||null,city:o?.city,stateCode:o?.st,country:null,postalCode:o?.zip,postalCodeExtn:"",isSelectedAddress:"true",selectedAddressBanner:r,selectedAddressPurposes:[{name:"DELIVERY"}],addressTypes:[{type:o?.type}],purposes:[{name:"DELIVERY"}],addressHash:""},preferences:[{preferenceDefId:"2f779a23-f979-4dac-8b67-ae8a4c469e16",value:"DELIVERY",banner:r}]}:"DUG"===e?i={preferences:[{...s},{preferenceDefId:"8d17909f-9055-44dd-bc68-93f5fb63e616",value:n,banner:r}]}:"J4U"===e&&(i={preferences:[{...s},{preferenceDefId:"24c286a7-2e43-45f1-9c81-7238b93758ef",value:t}]}),JSON.stringify(i)},updateUserCookieList:(e,t)=>{$.each(e,function(e,n){let r=SWY.CONFIGSERVICE.getCookie(n);o.isCookieEmpty(r)||o.updateAbsCookies(n,t)})},isCookieEmpty:e=>{var t=!1;return""!==e&&null!=e||(t=!0),t},updateAbsCookies:(e,t)=>{var n,r=JSON.parse(SWY.CONFIGSERVICE.getCookie(e));if("abs_gsession"===(e=SWY.CONFIGSERVICE.getResolvedCookieName(e))||"SWY_SHARED_SESSION_INFO"===e||"abs_previouslogin"===e)r=o.compareAndUpdateObj(t,r),n=encodeURIComponent(JSON.stringify(r)),SWY.CONFIGSERVICE.tagCookiesSecure()?document.cookie=e+"="+n+";path=/;secure;":document.cookie=e+"="+n+";path=/;";else if("SWY_SYND_USER_INFO"===e&&(null!==t.info.J4U||null!==t.info.SHOP)&&null!==r){let n=t.info.COMMON.preference,o=void 0!==n?"j4u"===n.toLowerCase()?t.info.J4U.storeId:t.info.SHOP.storeId:"",c=void 0!==n?"j4u"===n.toLowerCase()?t.info.J4U.zipcode:t.info.SHOP.zipcode:"",u=void 0!==n?"j4u"===n.toLowerCase()?t.info.J4U.address:t.info.SHOP.address:"";c&&(r.storeZip=c),o&&(r.storeId=o),null!=u&&(r.storeAddress=u),n&&(r.preference=n);var i=encodeURIComponent(JSON.stringify(r)),s=SWY.CONFIGSERVICE&&SWY.CONFIGSERVICE.resolvedBanner+".com",a=SWY.CONFIGSERVICE&&SWY.CONFIGSERVICE.oktaConfig&&SWY.CONFIGSERVICE.oktaConfig.maxAge,l=new Date;l.setTime(l.getTime()+1e3*a);var d="expires="+l.toUTCString();SWY.CONFIGSERVICE.tagCookiesSecure()?document.cookie=e+"="+i+";"+d+";path=/;secure;domain=."+s:document.cookie=e+"="+i+";"+d+";path=/;domain=."+s}},compareAndUpdateObj:(e,t)=>(Object.keys(e).forEach(n=>{Object.keys(t).forEach(r=>{n===r&&("object"==typeof e[n]&&"object"==typeof t[r]?o.compareAndUpdateObj(e[n],t[r]):t[r]=e[n])})}),t),createSessionCookie:(e,t)=>{var n,r=new Date;if(n="abs_gsession"===e?r.setTime(r.getTime()+864e5):r.setTime(r.getTime()+27e5),"SWY_SYND_USER_INFO"===e){let n={storeAddress:"",storeZip:"",storeId:null,preference:""};if(null!==t.info.J4U||null!==t.info.SHOP){let e=t.info.COMMON.preference,r=void 0!==e?"j4u"===e.toLowerCase()?t.info.J4U.storeId:t.info.SHOP.storeId:"",o=void 0!==e?"j4u"===e.toLowerCase()?t.info.J4U.zipcode:t.info.SHOP.zipcode:"",i=void 0!==e?"j4u"===e.toLowerCase()?t.info.J4U.address:t.info.SHOP.address:"";o&&(n.storeZip=o),r&&(n.storeId=r),null!=i&&(n.storeAddress=i),e&&(n.preference=e),t=n}SWY.CONFIGSERVICE.setDomainCookie(e,encodeURIComponent(JSON.stringify(t)),SWY.CONFIGSERVICE.resolvedBanner+".com",0)}else{let r=encodeURIComponent(JSON.stringify(t));e=SWY.CONFIGSERVICE.getResolvedCookieName(e),SWY.CONFIGSERVICE.tagCookiesSecure()?document.cookie=e+"="+r+";expires="+n+";path=/;secure;":document.cookie=e+"="+r+";expires="+n+";path=/;"}}};e.exports=o},4131:(e,t,n)=>{const r=n(3083);e.exports=function(){this.init=function(){this.userActionResolvedOnGeoAndDefault()},this.triggerTwoTabModal=function(){setTimeout(function(){window.storeFulfillmentModal.zone.run(function(){window.storeFulfillmentModal.component.setModalDisplayData(2)})},1e3),this.deleteLocalStorageItems()},this.triggerThreeTabModal=function(){setTimeout(function(){window.storeFulfillmentModal.zone.run(function(){window.storeFulfillmentModal.component.setModalDisplayData()})},1e3),this.deleteLocalStorageItems()},this.triggerPopupWrapper=function(e,t=!0){setTimeout(function(){window.popupWrapModal.zone.runTask(()=>{window.popupWrapModal.component.showPopupWrapper(e,t)})},1e3),this.deleteLocalStorageItems()},this.setAbIntent=function(e){let t,n=SWY.CONFIGSERVICE.getCookie("abs_gsession"),o="addCart"===e?"action":"intent";if(n){let i={},s=localStorage.getItem("abintent");n=JSON.parse(n),t=n.info.COMMON.Selection,s?(s=JSON.parse(s),s[o]=e,r.setUserIntent(s)):(i.selection=t,i[o]=e,r.setUserIntent(i))}},this.deleteLocalStorageItems=function(){["abintent","notifyMessage"].forEach(e
1=>localStorage.removeItem(e))},this.userActionResolvedOnGeoAndDefault=function(){const e=AB.COMMON.authorize();if(AB.COMMON.isLSCompatible()){let t=!0;const n=this;if(t="a"===window.ABTestUtil.getABTestValue("abACIP295974","isGuestAddToCartDisabled","ACIP295974"),e||$(document).on("click",function(e){t&&("addButton"==$(e.target).attr("id")||"abCartMini"==$(e.target).attr("id")||$(e.target).hasClass("btn-add-card--signin")||$(e.target).hasClass("product-btn--signin"))&&n.setAbIntent("addCart"),"btnSignIn"==$(e.target).attr("id")&&n.setAbIntent("signIn"),"create-account-btn-unified"!=$(e.target).attr("id")&&"create-account-btn-webotp"!=$(e.target).attr("id")||n.setAbIntent("createAccount")}),e){const e=SWY.CONFIGSERVICE.getCookie("abs_gsession"),t=window.SWY?.CONFIGSERVICE?.featureToggleConfig?.enableOnboardingFramework,r=window.SWY?.CONFIGSERVICE?.featureToggleConfig?.enableSincerelyHealth,o=window.SWY.CONFIGSERVICE.featureToggleConfig.isReceiptsOnboardEventEnabled,i=window.AB?.onboardingEvent?.event||"",s=window.SWY?.CONFIGSERVICE?.featureToggleConfig?.enablePostAuthNotifyMessage?localStorage.getItem("postAuthNotifyMessage"):localStorage.getItem("notifyMessage");let a,l,d,c,u=localStorage.getItem("abintent"),p=!1,m=!!s;if(a=AB.userInfo.preferenceMode.toLowerCase(),u&&(abintent=JSON.parse(u),l=abintent.action,d=abintent.intent,void 0!==abintent.selection&&(c=abintent.selection.toLowerCase(),c="default"===c||"geo"===c)),!o||"STORE_ONLINE_USER_REG"!==i&&"STORE_ONLINE_USER_SIGN"!==i)if(t){if(!m||"addCart"!==l&&"createAccount"!==d||"socialReg"===i)"socialReg"===i&&(r?this.triggerPopupWrapper("social-sincerely-health-flow"):t&&this.triggerPopupWrapper("social-onboarding-flow"));else if(r)this.triggerPopupWrapper("sincerely-health-flow");else if(t){const e=window.AB.COMMON.isB2BSite()?"b2b-onboarding-flow":"";this.triggerPopupWrapper(e)}}else c&&0==e?"addCart"===l?("signIn"===d&&"j4u"===a||!0===m)&&(p=!0,n.triggerTwoTabModal()):"createAccount"===d&&!0===m&&(p=!0,n.triggerThreeTabModal()):c||"addCart"!==l||"signIn"!==d&&"createAccount"!==d||"j4u"!==a||0!=e||(p=!0,n.triggerTwoTabModal());else this.triggerPopupWrapper("preferred-store-flow",!1);p||n.deleteLocalStorageItems()}}}}},4794:e=>{const t={setAriaHidden:function(e,t,n){t?($(".root").children().children(":nth-child(2)").attr("aria-hidden",!0),$(".root").children().children(":nth-child(3)").attr("aria-hidden",!0),$(e).siblings().attr("aria-hidden",!0),n&&($(".root").children().children(":nth-child(2)").attr("hidden",!0),$(".root").children().children(":nth-child(3)").attr("hidden",!0),$(e).siblings().attr("hidden",!0),$(e).parent().parent().siblings().attr("aria-hidden",!0))):($(".root").children().children(":nth-child(2)").removeAttr("aria-hidden"),$(".root").children().children(":nth-child(3)").removeAttr("aria-hidden"),n&&($(".root").children().children(":nth-child(2)").removeAttr("hidden"),$(".root").children().children(":nth-child(3)").removeAttr("hidden"),$(e).siblings().removeAttr("hidden"),$(e).parent().parent().siblings().removeAttr("aria-hidden")),$(e).siblings().removeAttr("aria-hidden"))}};e.exports=t},4929:(e,t,n)=>{const r=n(8474);!function(e){const t=e.AB=e.AB||{},n=t.__sponsoredBeaconBridgeConfigRegistry||new Map;if(t.__sponsoredBeaconBridgeConfigRegistry=n,t.sponsoredBeaconBridge&&"function"==typeof t.sponsoredBeaconBridge.ensure&&"function"==typeof t.sponsoredBeaconBridge.register&&"function"==typeof t.sponsoredBeaconBridge.ensureRegistered)return;const o=function(e,t){if(e&&t)return t.split(".").reduce((e,t)=>{if(null!=e)return e[t]},e)},i=function(t){const n=function(e){return Object.assign({},{bridgeKey:"sponsoredBeaconBridge",customElementName:"",dataMethodName:"applyFeaturedCategoryData",observerThreshold:.3,patchRetries:20,patchRetryDelayMs:250,trackerRetries:10,trackerRetryDelayMs:300},e||{})}(t);if(!n.customElementName)return;const i=function(e){const t=String(e||"sponsoredBeaconBridge").replace(/[^a-zA-Z0-9]/g,"")||"sponsoredBeaconBridge";return{globalPatchedFlag:`__${t}Patched`,prototypePatchedFlag:`__${t}PrototypePatched`,eventMap:`__${t}EventMap`,onloadRequests:`__${t}OnloadRequests`,clickBoundCategoryIds:`__${t}ClickBoundCategoryIds`,impressionSentCategoryIds:`__${t}ImpressionSentCategoryIds`,impressionObserver:`__${t}ImpressionObserver`}}(n.bridgeKey);if(e[i.globalPatchedFlag])return;const s=function(){const t=e.customElements&&e.customElements.get(n.customElementName);if(!t||!t.prototype||t.prototype[i.prototypePatchedFlag])return!!t;const s=t.prototype[n.dataMethodName];return t.prototype[n.dataMethodName]=function(t){"function"==typeof s&&s.call(this,t),function(t,s){const a=o(s,n.payloadIconsPath);if(!Array.isArray(a)||0===a.length)return;t[i.eventMap]=t[i.eventMap]||new Map,t[i.onloadRequests]=t[i.onloadRequests]||new Set,t[i.clickBoundCategoryIds]=t[i.clickBoundCategoryIds]||new Set,t[i.impressionSentCategoryIds]=t[i.impressionSentCategoryIds]||new Set;const l=o(s,n.payloadRequestIdPath),d=r.buildOnloadDedupKey(a,l,e=>o(e,n.eventTrackingPath));r.sendOnloadEvent({global:e,entities:a,component:n.componentName,context:n.onloadContext,eventName:n.onloadEventName,dedupStore:t[i.onloadRequests],dedupKey:d,eventTrackingSelector:e=>o(e,n.eventTrackingPath),retries:n.trackerRetries,retryDelayMs:n.trackerRetryDelayMs}
1),a.forEach(e=>{const r=o(e,n.categoryIdPath),s=o(e,n.eventTrackingPath);r&&s&&t[i.eventMap].set(r,s)});const c=t.querySelectorAll(`[${n.categoryIdAttribute}]`);c.forEach(o=>{const s=o.getAttribute(n.categoryIdAttribute);if(s&&t[i.eventMap].has(s)&&!t[i.clickBoundCategoryIds].has(s)){const a=o.querySelector("a")||o.closest("a");a&&a.addEventListener("click",()=>{const o=t[i.eventMap].get(s);r.sendTrackingEvent({global:e,eventTracking:o,eventName:n.clickEventName,component:n.componentName,context:n.clickContext,retries:n.trackerRetries,retryDelayMs:n.trackerRetryDelayMs})},{passive:!0}),t[i.clickBoundCategoryIds].add(s)}}),t[i.impressionObserver]||"function"!=typeof e.IntersectionObserver||(t[i.impressionObserver]=new IntersectionObserver(o=>{o.forEach(o=>{if(!o.isIntersecting)return;const s=o.target?.getAttribute?.(n.categoryIdAttribute);if(!s||t[i.impressionSentCategoryIds].has(s))return;const a=t[i.eventMap].get(s);r.sendTrackingEvent({global:e,eventTracking:a,eventName:n.impressionEventName,component:n.componentName,context:n.impressionContext,retries:n.trackerRetries,retryDelayMs:n.trackerRetryDelayMs})&&t[i.impressionSentCategoryIds].add(s)})},{threshold:n.observerThreshold})),t[i.impressionObserver]&&c.forEach(e=>{t[i.impressionObserver].observe(e)})}(this,t)},t.prototype[i.prototypePatchedFlag]=!0,e[i.globalPatchedFlag]=!0,!0};if(!s()){let t=n.patchRetries;const r=e.setInterval(()=>{(s()||t<=0)&&e.clearInterval(r),t-=1},n.patchRetryDelayMs)}};t.sponsoredBeaconBridge={ensure:i,register:function(e,t){e&&t&&n.set(e,Object.assign({},t))},ensureRegistered:function(e,t){if(!e||!n.has(e))return;const r=n.get(e);i(Object.assign({},r,t||{}))}}}(window)},5341:(e,t,n)=>{const r=n(9071);e.exports=function(){this.navItems={userEotClassElem:".user-eot-link",dataEotFlagElem:"data-eot-flag",userArClassElem:".user-ar-link",hiddenClass:"d-none"},this.init=function(){this.unhideEOTDrivenLinks(),this.initAR()},this.initAR=function(){if(AB.showArlinks=!1,window.AB.COMMON.authorize()){const e=this.checkStoreFlagsInfo();e&&e.display?(AB.showArlinks=!0,this.unhideArLinks(),this.setArFlag(!0,e.version)):(window.AB.userInfo&&window.AB.userInfo.isARenrolled&&(AB.showArlinks=!0,this.unhideArLinks()),console.warn("== AR STORE FLAG IS NOT ENABLED"),this.setArFlag(!1,e.version))}else console.warn("== GLOBAL FLAG NOT ON OR NOT AUTHORIZED"),this.setArFlag(!1,"v2")},this.checkStoreFlagsInfo=function(){const e=window.AB.storeFlagsData;if(!AB.COMMON.isEmpty(e))return this.isStoreArEnabled(e);{const e=this;console.warn("== NAVIGATION JS RECEIVED storeFlagsLoadComplete EVENT"),document.addEventListener("storeFlagsLoadComplete",()=>{e.initAR()},{once:!0})}},this.isStoreArEnabled=function(e){const t=e&&e.flags&&e.flags.ecomStore.storeFeatures,n=t.isB2BStore==t.isSNSB2BEnabled,r=!!t.isAutoReplenishmentEnabled&&t.isAutoReplenishmentEnabled;return AB.COMMON.isB2BSite()?{display:window.AB.userInfo.branchId===e.storeId&&n,version:"v2"}:{display:window.AB.userInfo.branchId===e.storeId&&r,version:"v2"}},this.setArFlag=function(e,t){console.warn("== AR FINAL FLAG IS SET",e,t),AB.COMMON.checkPendingOrder()&&(e=!1),AB.arFlag.display=e,AB.arFlag.version=t,AB.arFlagLoaded=!0;const n=new CustomEvent("arFlagLoaded",{detail:{arFlag:{display:e,version:t}}});document.dispatchEvent(n),console.warn("== AR FINAL FLAG IS SET",e,"DISPATCHED THE EVENT")},this.unhideEOTDrivenLinks=function(){const e=HtmlUtil.readElement(this.navItems.userEotClassElem),t=this;e&&e.length>0&&$(e).each(function(){let e=$(this).attr(t.navItems.dataEotFlagElem);if(e){const n=e.split("_").pop();!0===r.getEOTFlag(n)?$(this).hasClass("shop-flyout-nav-element")?$(this).addClass("d-lg-flex"):$(this).hasClass("shop-flyout-nav-mobile-element")?$(this).removeClass("d-none").addClass("d-block"):$(this).removeClass("d-none"):$(window).on(e,function(n){!0===n.detail[e]&&t.unhideEOTDrivenLinks(),$(window).off(e)})}})},this.unhideArLinks=function(){const e=HtmlUtil.readElement(this.navItems.userArClassElem);e&&e.length>0&&e.removeClass(this.navItems.hiddenClass)}}},5648:e=>{e.exports=function(){this.setCookieConsent=function(){let e="";const t=window.dataLayer&&window.dataLayer.find(e=>"OneTrustGroupsUpdated"===e.event);if(t){let n=t.OnetrustActiveGroups?.toString();","===n?.charAt(0)&&(n=n.slice(1)),","===n?.charAt(n.length-1)&&(n=n.slice(0,-1)),e=this.getCookieConsent(n);let r=this;setTimeout(()=>{if(null==window._fwn)r.clearPlayerCookies(e);else{if(null===e)return void window._fwn?.cookies?.disableCookies("");""===e&&window._fwn?.cookies?.enableCookies(""),""!==e&&window._fwn?.cookies?.setConsent(e)}},5e3)}let n=this;window.addEventListener("OneTrustGroupsUpdated",function(t){const r=t&&t.detail?.toString();if(e=n.getCookieConsent(r),null==window._fwn)n.clearPlayerCookies(e);else{if(null===e)return void window._fwn?.cookies?.disableCookies("");""===e&&window._fwn?.cookies?.enableCookies(""),""!==e&&window._fwn?.cookies?.setConsent(e)}})},this.getCookieConsent=function(e){this.isEnabledFwEssentialCookie=!!window.SWY.CONFIGSERVICE?.featureToggleConfig?.enableFireworkEssentialCookie;const t=this.isEnabledFwEssentialCookie?"essential":null,n=new Map;n.set("C0001",t),n.set("C0001,C0002","essential,performance"),n.set("C0001,C0003","essential,functional"),n.set("C0001,C0004","essential,targeting"),n.set("C0001,C0002,C0004","essential,performance,targeting"),n.set("C0001,C0002,C0003","essential,performance,functional"),n.set("C0001,C0003,C0004","essential,functional,targeting"),n.set("C0001,C0004,C0003","essential,functional,targeting"),n.set("C0001,C0002,C0003,C0004",""),n.set("C0001,C0002,C0004,C0003","");const r=n.get(e);return void 0!==r?r:t},this.init=function(){this.setCookieConsent()},this.clearPlayerCookies=function(e){if(""!=e){const t=["essential","performance","functional"],n=null==e?[]:e.split(","),r=t.filter(e=>!n.includes(e)),o=window.SWY.CONFIGSERVICE.getResolvedBanner(),i={performance:["fw_lets","fw_utm","fw_attr_ref","fw_vid","fw_laewats","fw_abt","fw_bid"],functional:["fw_uid","fw_chid","fw_dsid","fw_bmid","fw_se","fw_asidwa","fw_cchid"]},s={performance:["fw_lets","fw_utm","fw_attr_ref","fw_vid","fw_bid"],functional:["fw_uid","fw_chid","fw_dsid","fw_bmid","fw_se","fw_cchid"],essential:["fw_gs","fw_ply_vclsa","fw_ply_vctc","fw_ply_vctct"]},a={essential:["fw_ads_spcfgchnl","fw_ply_coords","fw_ply_vast","fw_gs"]};for(let e of r){if(i[e])for(let t of i[e])document.cookie=t+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;",document.cookie=t+`=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.${o}.com`,document.cookie=t+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain="+location.hostname;if(s[e])for(let t of s[e])localStorage.removeItem(t);if(a[e])for(let t of a[e])sessionStorage.removeItem(t)}}}}},5746:e=>{e.exports=function(){this.init=function(){this.storeAddress()},this.storeAddress=function(e){let t=JSON.parse(localStorage.getItem("abStoreAddress"));return AB.storeInfo=t,t&&t.storeId===e&&""!==t.storeAddress&&"Store not found"!==t.storeAddress&&t.bannerId||(t={}
1,t.storeId=e,t.storeAddress="Store not found",this.getStoreAddressFromXapi(e,function(e){e&&"Store not found"!==e&&(t.storeAddress=e.storeAddressModel.address.line1,t.storeCity=e.storeAddressModel.address.city,t.storeState=e.storeAddressModel.address.state,t.storeZipcode=e.storeAddressModel.address.zipcode,e.storeAddressModel.bannerId&&(t.bannerId=e.storeAddressModel.bannerId),AB.storeInfo=t)}),localStorage.setItem("abStoreAddress",JSON.stringify(t))),t.storeAddress},this.getStoreAddressFromXapi=function(e,t){let n="";n=!0===window.SWY?.CONFIGSERVICE?.featureToggleConfig?.isB2BDisabled||"B"!==AB?.userInfo?.siteType?SWY.CONFIGSERVICE.bannerDomainMap["www-"+SWY.CONFIGSERVICE.resolvedBanner]:SWY.CONFIGSERVICE.bannerDomainMap["www-business-"+SWY.CONFIGSERVICE.resolvedBanner];const r={"Ocp-Apim-Subscription-Key":AB.wcaxXapiApimKey},o=AB.storeResolverStoreAddressEndpoint,i={storeid:e};let s;AB.COMMON.getStoreResolverPayload(n,o,i,r,!1,function(e){if(s=e,"function"!=typeof t)return s;t(s)},function(e){if(s="Store not found","function"!=typeof t)return s;t(s)})}}},5807:e=>{e.exports=function(){this.init=function(){this.orderSummary()},this.getAndSetOrderCount=function(){this.getOrderCount().then(e=>{this.setOrderCount(e)}).catch(e=>{this.setOrderCount(e)})},this.orderSummary=function(){!AB.COMMON.authorize()||"R"!==AB.userInfo.userType&&"C"!==AB.userInfo.userType||AB.isLSEnabled&&null==localStorage.getItem("abOrderCount")&&this.getAndSetOrderCount()},this.getOrderCount=function(){let e=0,t=AB.omsOrderSummaryBaseUrl+"/ordersummary/customer/{customerId}".replace("{customerId}",AB.userInfo.customerId);return new Promise((n,r)=>{$.ajax({type:"GET",url:t,dataType:"json",headers:{"ocp-apim-subscription-key":SWY.CONFIGSERVICE.omsConfig["oms.apim.key"]},success:function(t){e=t.OrderSummary.createdOrders-t.OrderSummary.cancelledOrders,n(e)},error:function(t){t.responseJSON&&"NOT_FOUND"===t.responseJSON.status&&r(e)}})})},this.setOrderCount=function(e){if(AB.isLSEnabled)localStorage.setItem("abOrderCount",e);else{let t="",n=AB.COMMON.getCookie("SWY_SHARED_SESSION_INFO"),r=!!SWY.CONFIGSERVICE.featureToggleConfig.enableCookieRestructure;if(n){try{t=JSON.parse(n)}catch(e){t=""}t&&t.info&&(t.info.SHOP||(t.info.SHOP={}),r?t.info.userData||(t.info.userData={}):t.info.SHOP.userData||(t.info.SHOP.userData={}),r?t.info.COMMON.userData.orderCount=e.toString():t.info.SHOP.userData.orderCount=e.toString())}AB.userInfo.updateSessionCookies(t),AB.userInfo.orderCount=e}AB.DATALAYER&&AB.DATALAYER.updateOrderCount(e)}}},6140:(e,t,n)=>{const r=n(7978),o=n(7878);e.exports=function(){this.shoppingPreferencesItems={instorePreferences:".reserve-nav__instore-display-preferences",deliveryPreferences:".reserve-nav__delivery-display-preferences",pickupPreferences:".reserve-nav__pickup-display-preferences",zipCode:".reserve-nav__current-zipcode",instoreText:".reserve-nav__current-instore-text",deliveryText:".reserve-nav__text-for-delivery",pickupText:".reserve-nav__current-pickup-text",rightGroup:".reserve-nav__group-2",rightGroupCTA:".reserve-nav__group-2 .reserve-nav__button",leftGroupCTA:".reserve-nav__group-1 .reserve-nav__button",reservePickupTimeText:".reserve-nav__text_pickup",reserveDeliveryTimeText:".reserve-nav__text_delivery",reserveNav:".reserve-nav",isSyndicatedHeader:"syndicatedHeader",urlForSyndicateHeader:".menu-nav__center-container",bannerLogoClass:".menu-nav__center-container .banner-logo",fulFillMentModalClass:".reserve-nav__row .open-fulfillment-modal",headerV1Class:".unified-header .header-version-1",b2bReserveNavBtn:".b2b-prebook-revised .reserve-nav__button",b2bRevisedPrebookCTA:"View {delivery} times",deliveryTimesText:"delivery",pickupTimesText:"pickup"},this.init=function(){this.isb2bPrebookRevisedEnabled=!(!window.SWY||!window.SWY.CONFIGSERVICE?.featureToggleConfig?.isB2BRevisedPreboookEnabled);let e=!1;window.SWY&&window.SWY.CONFIGSERVICE?.featureToggleConfig?e=!window.SWY||!window.SWY.CONFIGSERVICE?.featureToggleConfig?.isNavigationEngineDisabled:SWY.configService?.isNavigationEngineDisabled&&"false"===SWY.configService?.isNavigationEngineDisabled&&(e=!0),e||(this.deleteGeoCookie(),this.populateShoppingPreferences(),this.triggerFulFillMentModal())},this.triggerFulFillMentModal=function(){let e=r.readElement(this.shoppingPreferencesItems.fulFillMentModalClass);e&&e.length>0&&(e=r.getElement(this.shoppingPreferencesItems.fulFillMentModalClass),e.click(()=>{window.storeFulfillmentModal.zone.run(function(){window.storeFulfillmentModal.component.setModalDisplayData()}
1),AB.DATALAYER&&AB.DATALAYER.setLinkClickEvents("changeFulfillmentLink")}))},this.parseSessionCookie=function(e){if(!e)return null;try{return JSON.parse(decodeURIComponent(e))}catch(t){try{return JSON.parse(e)}catch(e){return null}}},this.getPendingConflictSession=function(e){const t=this.parseSessionCookie(SWY.CONFIGSERVICE.getCookie("abs_gsession")),n=SWY.CONFIGSERVICE.getResolvedBanner()?.toLowerCase(),r=t?.info?.COMMON?.banner?.toLowerCase(),o=e?.info?.J4U?.preferredBanner?.toLowerCase();return r&&n&&r===n&&o&&o!==n?t:null},this.populateShoppingPreferences=function(){const e=r.readElement(this.shoppingPreferencesItems.reserveNav);let t=SWY.CONFIGSERVICE.getCookie("SWY_SHARED_SESSION_INFO"),n=SWY.CONFIGSERVICE.getCookie("SWY_SYND_USER_INFO"),i=SWY.CONFIGSERVICE.getCookie("OrderNumber"),s=!1;if(t.length>1||n.length>1?s=!0:swySharedSessionInfoObject={},e&&s){const e=r.getElement(this.shoppingPreferencesItems.instorePreferences),s=r.getElement(this.shoppingPreferencesItems.deliveryPreferences),a=r.getElement(this.shoppingPreferencesItems.pickupPreferences),l=r.getElement(this.shoppingPreferencesItems.zipCode),d=r.getElement(this.shoppingPreferencesItems.instoreText),c=r.getElement(this.shoppingPreferencesItems.deliveryText),u=r.getElement(this.shoppingPreferencesItems.pickupText),p=r.getElement(this.shoppingPreferencesItems.reserveNav),m=r.getMetaElementContent(this.shoppingPreferencesItems.isSyndicatedHeader),h=(r.getElement(this.shoppingPreferencesItems.urlForSyndicateHeader)[0],r.getElement(this.shoppingPreferencesItems.leftGroupCTA)),f=r.readElement(this.shoppingPreferencesItems.headerV1Class);let g,y;if(rightGroup=null,rightGroupCTA=null,reserveDeliveryTimeText=null,reservePickupTimeText=null,invisibleClass="invisible",null!==r.readElement(this.shoppingPreferencesItems.rightGroup)&&(rightGroup=r.getElement(this.shoppingPreferencesItems.rightGroup),rightGroupCTA=r.getElement(this.shoppingPreferencesItems.rightGroupCTA),reserveDeliveryTimeText=r.getElement(this.shoppingPreferencesItems.reserveDeliveryTimeText),reservePickupTimeText=r.getElement(this.shoppingPreferencesItems.reservePickupTimeText)),g=f&&f.length>0?"hidden":"d-none",s.addClass(g),a.addClass(g),"false"==m){let n=this.parseSessionCookie(t);const r=this.getPendingConflictSession(n);r&&(n.info=r.info);let o=!!SWY.CONFIGSERVICE.featureToggleConfig.enableCookieRestructure;if(o){if(Object.keys(n).length>0){let t=n.info.COMMON.storeId;"j4u"===n.info.COMMON.preference.toLowerCase()&&(t=n.info.COMMON.storeId),rightGroup.addClass(g),y=StoreAddressComp.storeAddress(t),""!==y&&"Store not found"!==y&&void 0!==y||("j4u"===n.info.COMMON.preference.toLowerCase()?(e.removeClass(invisibleClass),e.css("text-align","center")):"delivery"===n.info.COMMON.preference.toLowerCase()?(s.removeClass(g),e.addClass(g),rightGroup.css("display","none"),s.css("text-align","center"),this.isb2bPrebookRevisedEnabled&&this.setTextForRevisedB2bCTA(this.shoppingPreferencesItems.deliveryTimesText)):"dug"===n.info.COMMON.preference.toLowerCase()&&(a.removeClass(g),e.addClass(g),this.isb2bPrebookRevisedEnabled&&this.setTextForRevisedB2bCTA(this.shoppingPreferencesItems.pickupTimesText)))}}else if(Object.keys(n).length>0){let t=n.info.SHOP.storeId;"j4u"===n.info.COMMON.preference.toLowerCase()&&(t=n.info.J4U.storeId),rightGroup.addClass(g),y=StoreAddressComp.storeAddress(t),""!==y&&"Store not found"!==y&&void 0!==y||("j4u"===n.info.COMMON.preference.toLowerCase()?(e.removeClass(invisibleClass),e.css("text-align","center")):"delivery"===n.info.COMMON.preference.toLowerCase()?(s.removeClass(g),e.addClass(g),rightGroup.css("display","none"),s.css("text-align","center"),this.isb2bPrebookRevisedEnabled&&this.setTextForRevisedB2bCTA(this.shoppingPreferencesItems.deliveryTimesText)):"dug"===n.info.COMMON.preference.toLowerCase()&&(a.removeClass(g),e.addClass(g),this.isb2bPrebookRevisedEnabled&&this.setTextForRevisedB2bCTA(this.shoppingPreferencesItems.pickupTimesText)))}if(d.text(y),e.removeClass(g),o){if("j4u"===n.info.COMMON.preference.toLowerCase()){s.addClass(g),a.addClass(g),rightGroup.addClass(g);let t=y;t.indexOf(",")>
1-1&&(t=t.substring(0,t.indexOf(","))),t=t.replace(/\+/g," "),d.html(t),e.removeClass("invisible")}}else if("j4u"===n.info.COMMON.preference.toLowerCase()){s.addClass(g),a.addClass(g),rightGroup.addClass(g);let t=y;t.indexOf(",")>-1&&(t=t.substring(0,t.indexOf(","))),t=t.replace(/\+/g," "),d.html(t),e.removeClass("invisible")}if(o){if("delivery"===n.info.COMMON.preference.toLowerCase()){e.addClass(g),a.addClass(g),reservePickupTimeText.addClass(g);const t=this.getDeliveryAddress();t?l.html(t):l.html(window.AB.userInfo.zipcode),c.show(),reserveDeliveryTimeText.removeClass(g),reserveDeliveryTimeText.attr("id","reserveTime"),reservePickupTimeText.removeAttr("id"),s.removeClass(g),rightGroup.removeClass(g),this.isb2bPrebookRevisedEnabled&&this.setTextForRevisedB2bCTA(this.shoppingPreferencesItems.deliveryTimesText),rightGroupCTA.click(()=>{if(window.AB.COMMON.authorize()){if(!SWY.CONFIGSERVICE.enablePrebookSlotModal()){const e=AB.COMMON.removeURLParameterByName(window.location.search,"q");window.location=`/erums/store/prebook${e}`}}else this.openSignInModal(),AB.isLSEnabled&&localStorage.setItem("redirectToErums",1)})}}else if("delivery"===n.info.COMMON.preference.toLowerCase()){e.addClass(g),a.addClass(g),reservePickupTimeText.addClass(g);const t=this.getDeliveryAddress();t?l.html(t):l.html(window.AB.userInfo.zipcode),c.show(),reserveDeliveryTimeText.removeClass(g),reserveDeliveryTimeText.attr("id","reserveTime"),reservePickupTimeText.removeAttr("id"),s.removeClass(g),rightGroup.removeClass(g),this.isb2bPrebookRevisedEnabled&&this.setTextForRevisedB2bCTA(this.shoppingPreferencesItems.deliveryTimesText),rightGroupCTA.click(()=>{if(window.AB.COMMON.authorize()){if(!SWY.CONFIGSERVICE.enablePrebookSlotModal()){const e=AB.COMMON.removeURLParameterByName(window.location.search,"q");window.location=`/erums/store/prebook${e}`}}else this.openSignInModal(),AB.isLSEnabled&&localStorage.setItem("redirectToErums",1)})}if(o){if("dug"===n.info.COMMON.preference.toLowerCase()){e.addClass(g),s.addClass(g),c.addClass(g),reserveDeliveryTimeText.addClass(g),reservePickupTimeText.removeClass(g),reservePickupTimeText.attr("id","reserveTime"),reserveDeliveryTimeText.removeAttr("id");let t=y;t.indexOf(",")>-1&&(t=t.substring(0,t.indexOf(","))),t=t.replace(/\+/g," "),u.html(t),rightGroup.removeClass(g),a.removeClass(g),this.isb2bPrebookRevisedEnabled&&this.setTextForRevisedB2bCTA(this.shoppingPreferencesItems.pickupTimesText),rightGroupCTA.click(()=>{if(window.AB.COMMON.authorize()){if(!SWY.CONFIGSERVICE.enablePrebookSlotModal()){const e=AB.COMMON.removeURLParameterByName(window.location.search,"q");window.location=`/erums/store/prebook${e}`}}else this.openSignInModal(),AB.isLSEnabled&&localStorage.setItem("redirectToErums",1)})}}else if("dug"===n.info.COMMON.preference.toLowerCase()){e.addClass(g),s.addClass(g),c.addClass(g),reserveDeliveryTimeText.addClass(g),reservePickupTimeText.removeClass(g),reservePickupTimeText.attr("id","reserveTime"),reserveDeliveryTimeText.removeAttr("id");let t=y;t.indexOf(",")>-1&&(t=t.substring(0,t.indexOf(","))),t=t.replace(/\+/g," "),u.html(t),rightGroup.removeClass(g),this.isb2bPrebookRevisedEnabled&&this.setTextForRevisedB2bCTA(this.shoppingPreferencesItems.pickupTimesText),a.removeClass(g),rightGroupCTA.click(()=>{if(window.AB.COMMON.authorize()){if(!SWY.CONFIGSERVICE.enablePrebookSlotModal()){const e=AB.COMMON.removeURLParameterByName(window.location.search,"q");window.location=`/erums/store/prebook${e}`}}else this.openSignInModal(),AB.isLSEnabled&&localStorage.setItem("redirectToErums",1)})}AB.COMMON.isErumsPage()&&p.addClass(g)}else if(null!=n){let t=JSON.parse(n);if(Object.keys(t).length>0){let n=t.storeId,m=r.readElement(this.shoppingPreferencesItems.bannerLogoClass);if(m&&(m=r.getElement(this.shoppingPreferencesItems.bannerLogoClass).attr("href"),m=o.getDomain(m)),y=StoreAddressComp.storeAddress(n),""!==y&&"Store not found"!==y&&void 0!==y||("j4u"===t.preference.toLowerCase()?(e.removeClass(g),e.css("text-align","center")):"delivery"===t.preference.toLowerCase()?(s.removeClass(g),s.css("text-align","center")):"dug"===t.preference.toLowerCase()&&(a.removeClass(g),a.css("text-align","center")),h.css("float","none")),t&&"j4u"===t.preference.toLowerCase()&&y){s.addClass(g),a.addClass(g);let t=y;t&&t.indexOf(",")>
1-1&&(t=t.substring(0,t.indexOf(","))),t=t&&t.replace(/\+/g," "),d.html(t),e.removeClass(g),e.removeClass(invisibleClass)}if(t&&"delivery"===t.preference.toLowerCase()&&t.storeZip&&(e.addClass(g),a.addClass(g),l.html(t.storeZip),c.removeClass(g),s.removeClass(g)),t&&"dug"===t.preference.toLowerCase()&&y){e.addClass(g),s.addClass(g),c.addClass(g);let t=y;t&&t.indexOf(",")>-1&&(t=t.substring(0,t.indexOf(","))),t=t.replace(/\+/g," "),u.html(t),u.removeClass(g),a.removeClass(g)}setTimeout(()=>{AB.COMMON.authorize()&&""!=i&&p&&p.length>0&&p.hide()},500)}}}},this.openSignInModal=function(){AB.COMMON.openAuthenticateModal("signIn")},this.setTextForRevisedB2bCTA=function(e){const t=r.readElement(this.shoppingPreferencesItems.b2bReserveNavBtn),n=this.shoppingPreferencesItems.b2bRevisedPrebookCTA.replace("{delivery}",e);t&&t.length>0&&t.text(n)},this.getDeliveryAddress=function(){if("delivery-addr"===AB?.userInfo?.resolvedBy){if(window.AB?.COMMON?.authorize()){const e=SWY.CONFIGSERVICE.getCookie("SWY_SHARED_PII_SESSION_INFO");let t={};try{t=e?JSON.parse(e):{}}catch(e){console.error("Error parsing cookie value:",e)}const n=t?.deliveryAddr;let r=n?.split(",")?.[0];return r="null"===r?n.match(/\d+/g)?.[0]:r.replace(/\+/g," "),r}{const e=AB.COMMON.getGeoCookieName(),t=SWY.CONFIGSERVICE.getCookie(e);let n={};try{n=t?JSON.parse(t):{}}catch(e){console.error("Error parsing cookie value:",e)}return this.updateGeoCookieExpirationTime(e,n),n?.adr1}}},this.deleteGeoCookie=function(){window.addEventListener("OneTrustGroupsUpdated",e=>{const t=e&&e.detail;!t||t.includes("C0003")||window.AB.COMMON.authorize()||(document.cookie=AB.COMMON.getGeoCookieName()+"=; expires=Thu, 05-Mar-1992 00:00:01 GMT; path=/;",r.getElement(this.shoppingPreferencesItems.zipCode).html(window.AB?.userInfo?.zipcode))},{once:!0})},this.updateGeoCookieExpirationTime=function(e,t){if(t&&t.adr1){const n=new Date,r=45;n.setTime(n.getTime()+60*r*1e3);const o=`expires=${n.toUTCString()}`,i=encodeURIComponent(JSON.stringify(t));document.cookie=`${e}=${i}; ${o}; path=/;`}}}},6482:(e,t,n)=>{const r=n(7978);e.exports=function(){this.menuNavigationItems={categoryItem:".t_nav__categories_item",categoryL2list:".t_nav__dd",categoryL2item:".t_nav__dd__item",fulfillmentDetails:".s_nav__channel",parentList:".t_nav__categories",toolBoxMobile:".t_nav__toolbox-mobile",campaignLink:".t_nav__campaign",backBtn:".categories-item__drilldown .s_nav_back_arrow",mobileCategoryHeader:".s_nav_mobile_header",localStorageName:"abNavEngineData"},this.init=function(){this.orientation=this.getOrientation(),this.controller=new AbortController;let e=!1;if(window.SWY&&window.SWY.CONFIGSERVICE?.featureToggleConfig?e=!window.SWY||!window.SWY.CONFIGSERVICE?.featureToggleConfig?.isNavigationEngineDisabled:SWY.configService?.isNavigationEngineDisabled&&"false"===SWY.configService?.isNavigationEngineDisabled&&(e=!0),e&&document.querySelector("global-header tertiary-bar")){const e=this.validateLocalStorageData();e?this.processTertiaryData(e):this.getCategoriesData()}this.debugHideElements(),e&&this.hideADASearchLink()},this.debugHideElements=function(){window?.location?.search?.split("&")?.forEach(e=>{e.indexOf("hidee")>=0&&$(e?.split("=")[1]).removeClass("d-inline-flex").addClass("d-none")})},this.hideADASearchLink=function(){const e=$(".search-wrapper.search-nav");e.is(":visible")&&e?.outerHeight()>0||$("#skipToSearchContent").remove()},this.getScrollbarWidth=()=>window.innerWidth-document.documentElement.clientWidth,this.disableScroll=()=>{const e=this.getScrollbarWidth(),t=document.querySelectorAll(".sticky-secondary-bar, .sticky-tertiary-bar, .sticky-primary-bar"),n=document.getElementById("promptMessageModal"),r=document.getElementById("past-order-modal"),o=document.getElementsByTagName("tertiary-bar"),i=document.getElementById("onetrust-banner-sdk");if(t.forEach(t=>{if(t){const n=window.getComputedStyle(t).paddingRight,r=parseFloat(n)+e;t.dataset.originalPaddingRight=n,t.style.paddingRight=`${r}px`}}),window.outerWidth>1024){if(n){let t=window.getComputedStyle(n).right;t=parseInt(t.substring(0,t.indexOf("px"))),n.style.right=t+e+"px"}i&&(i.style.right=e+"px"),r&&o.length>0&&(r.style.position="relative",r.style.top=-1*o[0].getBoundingClientRect().bottom+"px")}document.body.style.overflow="hidden",document.body.style.setProperty("padding-right",`${e}px`,"important")},this.enableScroll=()=>{document.body.style.overflow="",document.body.style.paddingRight="";const e=this.getScrollbarWidth(),t=document.querySelectorAll(".sticky-secondary-bar, .sticky-tertiary-bar, .sticky-primary-bar"),n=document.getElementById("promptMessageModal"),r=document.getElementById("onetrust-banner-sdk");
1if(t.forEach(e=>{e&&e.dataset.originalPaddingRight&&(parseFloat(e.dataset.originalPaddingRight),e.style.paddingRight="",delete e.dataset.originalPaddingRight)}),window.outerWidth>1024){if(n){let t=window.getComputedStyle(n).right;t=parseInt(t.substring(0,t.indexOf("px"))),n.style.right=t-e+"px"}r&&(r.style.right=0)}},this.handleResize=()=>{this.orientation!==this.getOrientation()&&(this.controller.abort("Window resized"),this.orientation=this.getOrientation(),this.init())},this.getOrientation=function(){return window.innerWidth>1024?"desktop":"mobile"},window.addEventListener("resize",this.handleResize),this.validateLocalStorageData=function(){const e=localStorage?.getItem(this.menuNavigationItems.localStorageName);if(!e)return!1;try{const t=JSON.parse(e),{tertiary:n,expiry:r,storeId:o,zipcode:i,user:s,preferenceMode:a}=t||{},{categories:l}=n||{};if(Array.isArray(l)&&l.length>0&&r>Date.now()&&o===this.getStoreId()&&i===this.getZipCode()&&s===window.AB.COMMON?.authorize()&&a===this.getChannel())return t}catch(e){console.error("Error parsing data from local storage:",e)}return!1},this.validateLocalStorageDataForError=function(){const e=localStorage?.getItem(this.menuNavigationItems.localStorageName);if(!e)return!1;try{const t=JSON.parse(e),n=t?.tertiary?.categories;if(Array.isArray(n)&&n.length>0&&t?.expiry>Date.now())return t}catch(e){console.error("Error parsing data from local storage:",e)}return!1},this.getDomain=function(){let e="";return window.location.host.includes("local-origin")?e=window.location.protocol+"//www-qa1."+window.AB?.userInfo?.banner+".com":(e=window.location.protocol+"//"+window.location.host,SWY?.CONFIGSERVICE?.bannerDomainMap&&(e="B"===AB?.userInfo?.siteType?SWY.CONFIGSERVICE.bannerDomainMap["www-business-"+SWY.CONFIGSERVICE.resolvedBanner]:SWY.CONFIGSERVICE.bannerDomainMap["www-"+SWY.CONFIGSERVICE.resolvedBanner])),e},this.isSyndicateHeader=function(){return!!document.querySelector("global-header.syndicate-header")},this.getSyndicateCookie=function(){let e=window.SWY&&SWY?.CONFIGSERVICE?.getCookie("SWY_SYND_USER_INFO");if(e&&e?.length>0){const t=JSON.parse(e)||{};if(t&&Object.keys(t).length>0)return t}return{}},this.getEditOrderStoreId=()=>AB?.COMMON?.checkPendingOrder()?"B"===AB?.userInfo?.siteType?AB.COMMON.getCookie("B_OrderStoreId")||"":AB.COMMON.getCookie("OrderStoreId")||"":"",this.getStoreId=function(){const e=this.getEditOrderStoreId();return e&&""!=e?e:this.isSyndicateHeader()?this.getSyndicateCookie()?.storeId||"":window.AB?.userInfo?.branchId||""},this.getZipCode=function(){return this.isSyndicateHeader()?this.getSyndicateCookie()?.storeZip||"":window.AB?.userInfo?.zipcode||""},this.getChannel=function(){if(this.isSyndicateHeader()){const e=this.getSyndicateCookie()?.preference?.toLowerCase()||"";switch(e){case"j4u":return"instore";case"dug":return"pickup";default:return e}}return window.AB?.COMMON?.getUserChannel()?.toLowerCase()||""},this.getCategoriesData=function(){const e=this.getStoreId(),t=this.getZipCode(),n=this.getChannel(),r=document.querySelector("global-header.syndicate-header");if(""===e||""===t||""===n)return r?r.classList.add("api-error"):this.handleError(),void(console?.warn&&console.warn("StoreId, Zipcode or Channel is missing in the request. Skipping the getNav API call","storeId: "+e,"zipcode: "+t,"channel: "+n));const o=this.getDomain()+window.AB?.globalHeaderGetNavigationEndpoint,i={storeId:e,screenName:"global-header",banner:window.SWY&&window.SWY.CONFIGSERVICE?.getResolvedBanner(),zipcode:t,channel:n,bannerType:"B"===window.AB?.userInfo?.siteType?"b2b":"b2c",deliveryTimeZone:window.AB?.storeFlagsData?.flags?.timezone||"America/Los_Angeles"},s={"Ocp-Apim-Subscription-Key":window.AB?.globalHeaderGetNavigationSubKey,"x-swy-correlation-id":window.AB?.COMMON.generateUUID(),"Content-Type":"application/json",platform:"web",screenName:"global-header",banner:window.SWY&&window.SWY.CONFIGSERVICE?.getResolvedBanner(),storeId:this.getStoreId()};window.AB?.COMMON.authorize()&&(s["X-access-token"]=window.AB?.userInfo?.SWY_SHOP_TOKEN);const a=+(/^-?\d+$/.test(window.AB?.globalHeaderGetNavigationTimeout)&&window.AB?.globalHeaderGetNavigationTimeout||3e3),l=AbortSignal.timeout(a);fetch(o,{method:"POST",headers:s,body:JSON.stringify(i),signal:AbortSignal.any([this.controller.signal,l])}).then(async e=>{let t=await e.json();!e.ok||t?.items[0]?.errors?this.handleError():(this.orientation=this.getOrientation(),t=this.updateLSSuccess(t),this.processTertiaryData(t))}).catch(e=>{this.handleError(),console.error("There has been a problem with fetch operation:",e)})},this.handleError=function(){if(data=this.updateLSError(),!1!==data)return void this.processTertiaryData(data);const e=document.querySelector("tertiary-bar");e.classList.add("dapi-error");const t=document.querySelector("global-header.syndicate-header");t&&t.classList.add("api-error");const n=e.querySelectorAll(".t_nav__categories .t_nav__categories_item"),r=document?.querySelector(".global-header .categories-flyout-backdrop");document.querySelector("tertiary-bar .t_nav__primary").addEventListener("mouseleave",e=>{r.style.display="none"}
1),n.length&&n.forEach(e=>{const t=e.querySelector(".t_nav__categories_error");e.addEventListener("mouseenter",()=>{this.applyShowAttributes(e.querySelector(".t_nav__categories_error")),r.style.display="block"}),e.addEventListener("mouseleave",()=>setTimeout(()=>{this.applyHideAttributes(e.querySelector(".t_nav__categories_error"))},20)),e.addEventListener("keydown",e=>{const{key:n}=e;switch(n){case" ":case"Enter":case"ArrowDown":e.preventDefault(),t.classList.contains("d-none")?($(".t_nav__categories_error").removeClass("d-inline-flex").addClass("d-none"),this.applyShowAttributes(t),r.style.display="none"):t.classList.contains("d-inline-flex")&&(this.applyHideAttributes(t),r.style.display="block")}});const n=e.querySelector(".t_nav__categories_error-btn");n&&n.addEventListener("keydown",e=>{const{key:t}=e;switch(t){case" ":case"Enter":e.preventDefault(),r.style.display="block",n.click()}})});const o=document.querySelector("tertiary-bar"),i=document.querySelector(".t_nav_mobile");if(!i.querySelector("tertiary-bar")){const e=o.cloneNode(!0);e.classList.remove("t_nav"),i.appendChild(e)}const s=this.initializeMenuNavigationItems(this.menuNavigationItems);window.outerWidth<=1024&&(s.categoryItem?.children(".categories-item")?.on("click",e=>{this.handleCategoryItemClick(e,s);const t=Array.from(s.categoryItem);t.length&&t.forEach(e=>{this.applyHideAttributes(e.querySelector(".t_nav__dd")),this.applyHideAttributes(e.querySelector(".t_nav__dd__parent-list")),e.querySelector(".categories-item__drilldown").style.display="block",this.applyShowAttributes(e.querySelector(".t_nav__categories_error"))})}),s?.backBtn?.on("click",function(){const e=Array.from(s.categoryItem);e.length&&e.forEach(e=>{e.querySelector(".categories-item__drilldown").style.display="none"})})),console&&console.warn("Error fetching data from getNavigation API")},this.updateLSSuccess=function(e){const t=Date.now()+144e5,n={...e.items[0],expiry:t,storeId:this.getStoreId(),zipcode:this.getZipCode(),user:window.AB.COMMON?.authorize(),preferenceMode:this.getChannel()};return localStorage.setItem(this.menuNavigationItems.localStorageName,JSON.stringify(n)),n},this.updateLSError=function(){const e=this.validateLocalStorageDataForError();if(!1===e)return localStorage?.removeItem(this.menuNavigationItems.localStorageName),!1;const t=Date.now()+3e5,n={...e,expiry:t,error:!0,zipcode:this.getZipCode(),storeId:this.getStoreId(),user:window.AB.COMMON?.authorize(),preferenceMode:this.getChannel()};return localStorage.setItem(this.menuNavigationItems.localStorageName,JSON.stringify(n)),n},this.processTertiaryData=function(e){let t=this.processCategories(e),n=this.filterPromos(t);document.querySelector("global-header.syndicate-header")&&(n=this.handleLinksForSyndicateHeader(n,this.getDomain()));let r={tertiary:n.tertiary};this.renderContent(r)},this.handleLinksForSyndicateHeader=function(e,t){if(!t)return e;const n=e=>t+e,r=e=>{e&&e.targetURL&&(e.targetURL=n(e.targetURL))},o=e=>{e&&(e.url&&(e.url=n(e.url)),e.promo&&e.promo.forEach(r),e.items&&e.items.forEach(o))};return e&&e.tertiary&&e.tertiary.categories&&(e.tertiary.categories.forEach(e=>{e&&e.items&&e.items.forEach(o)}),e.tertiary.campaignLinks&&e.tertiary.campaignLinks.forEach(e=>{e&&e.campaignLinkUrl&&(e.campaignLinkUrl=n(e.campaignLinkUrl))}),e.tertiary.toolboxLinks&&e.tertiary.toolboxLinks.forEach(e=>{e&&e.toolboxLinkUrl&&(e.toolboxLinkUrl=n(e.toolboxLinkUrl))})),e},this.isValidFlexModule=function(e){return e.exportedType?.includes("flex-module")&&("medium"===e.designType||"medium-full-width"===e.designType)&&("transparentTextPlate"===e.displayType||"colorTextPlate"===e.displayType)},this.getValidFlexPromo=function(e,t,n){const r=e?.flex_module||e?.["flex-module"];return!t&&r&&n(r)?r:null},this.filterPromos=function(e){var t=this;if(!e||!e.tertiary||!Array.isArray(e.tertiary.categories))return console.error("Invalid data structure"),e;const n=Date.now(),r=window.SWY.CONFIGSERVICE?.featureToggleConfig?.isPromoAsFlexDisabled;return e.tertiary.categories.forEach((e,o)=>{e&&Array.isArray(e.items)&&(e.items.forEach((o,i)=>{if(o){if(o.title&&(o.title=t.truncatedMenuText(o.title)),Array.isArray(o.promo)){let e=null,t=null;for(let i=0;i<o.promo.length;i++){const s=o.promo[i];if(t=this.getValidFlexPromo(s,r,this.isValidFlexModule.bind(this)),t)break;if(s?.endDate>n){e=s;break}}!r&&t?(o.flexPromo=[t],delete o.promo):e?o.promo=[e]:delete o.promo}if(Array.isArray(o.items))if(0!=o.items.length||void 0!==o.url&&null!=o.url&&""!=o.url){if(o.items=o.items.map(e=>(e.title&&e?.items?.length>0&&(e.title=t.truncatedMenuText(e.title)),e)),o.items[0]?.promo){let e=o.items[0].promo,t=null;t=this.getValidFlexPromo(e[0],r,this.isValidFlexModule.bind(this)),t&&(o.flexPromo=[t],delete o.items[0].promo)}}else delete e.items[i]}}),e.items=e.items.filter(e=>null!=e))}),e},this.processCategories=function(e){if(e.tertiary&&e.tertiary.categories&&e.tertiary.categories.length>e.tertiary.categoryTabsCount){const t={title:e.tertiary.categoryOverflowLabel,altText:e.tertiary.categoryOverflowLabel,category:"overflow",categoryName:e.tertiary.categoryOverflowLabel,categoryType:"overflow",items:[]},n=e.tertiary.categoryTabsCount;t.items=e.tertiary.categories.slice(n),e.tertiary.categories=e.tertiary.categories.slice(0,n),e.tertiary.categories.push(t)}
1return e&&e?.tertiary&&Array.isArray(e?.tertiary?.categories)&&e?.tertiary?.categories.length>0&&e.tertiary.categories.forEach(e=>{e?.items&&Array.isArray(e.items)&&e.items.forEach(e=>{e?.items&&Array.isArray(e.items)?e.items.forEach(e=>{e?.items&&Array.isArray(e.items)?e.items.forEach(e=>{e?.category&&e.category.includes("_")?2===e.category.split("_").length&&(e.viewAll="true"):"custom"===e?.categoryType&&e.title.startsWith("All ")&&(e.viewAll="true")}):e?.category&&e.category.includes("_")&&!e?.items?2===e.category.split("_").length&&(e.viewAll="true"):"custom"===e?.categoryType&&e.title.startsWith("All ")&&!e?.items&&(e.viewAll="true")}):e?.category&&e.category.includes("_")&&!e?.items?2===e.category.split("_").length&&(e.viewAll="true"):"custom"===e?.categoryType&&e.title.startsWith("All ")&&!e?.items&&(e.viewAll="true")})}),e},this.renderContent=function(e){let t=window?.WEBGEN_HANDLEBARS?.GlobalHeader?.TertiaryBar?.getHtml(e);const n=document.querySelector("global-header");t&&n&&([n.querySelector("tertiary-bar"),n.querySelector(".t_nav_mobile")].forEach(e=>{e&&(e.innerHTML=t)}),this.expandMenu())},this.initializeMenuNavigationItems=function(e){return{categoryItem:r.getElement(e?.categoryItem)??null,fulfillmentDetails:r.getElement(e?.fulfillmentDetails)??null,toolBoxMobile:r.getElement(e?.toolBoxMobile)??null,campaignLink:document.querySelector(e?.campaignLink)?r.getElement(e?.campaignLink):null,backBtn:r.getElement(e?.backBtn)??null,mobileCategoryHeader:r.getElement(e?.mobileCategoryHeader)??null}},this.expandMenu=function(){let e=window.outerWidth/window.innerWidth*100;if(0!==window.outerWidth&&window.outerWidth<=1024||e>=150){var t=this;const y=this.initializeMenuNavigationItems(this.menuNavigationItems);y.categoryItem?.children(".categories-item")?.on("click keydown",function(e){("click"===e.type||"keydown"===e.type&&"Enter"===e.key)&&t.handleCategoryItemClick(e,y)})}else{function n(e){e.target.parentElement.classList.contains("t_nav__categories_item")&&null===e.target.parentElement.querySelector(".t_nav__dd.d-inline-flex")&&($(".t_nav__dd.d-inline-flex").removeClass("d-inline-flex").addClass("d-none"),e.target.setAttribute("aria-expanded","false"))}function r(e){o(e,!1)}function o(e,t=!0){const{key:n}=e,r=t?e.target.parentElement:e.target;let o,d;if(r.classList.contains("t_nav__categories_item"))o=r.closest('[role="menubar"]'),d=Array.from(r.querySelectorAll(".t_nav__dd__parent-list"));else if(r.parentElement.parentElement.classList.contains("t_nav__dd__parent-list-2")){o=r.closest('[role="menu"]');const e=Array.from(o.querySelector(".t_nav__dd__parent-list-2").querySelectorAll('a[role="menuitem"]'));if(d=Array.from(e).filter(e=>e.parentElement.parentElement.parentElement===o),r.parentElement.children.length>1){const e=r.parentElement.querySelector('t_nav__dd__parent-list-3 a[role="menuitem"]');e&&e.focus()}}else if(r.parentElement.parentElement.classList.contains("t_nav__dd__parent-list-3")){o=r.closest('[role="menu"]');const e=Array.from(o.querySelector(".t_nav__dd__parent-list-3").querySelectorAll('a[role="menuitem"]'));d=Array.from(e).filter(e=>e.parentElement.parentElement.parentElement===o)}else{o=r.closest('[role="menu"]');const e=o.querySelector(".t_nav__dd__parent-list");if(e){const t=e.querySelectorAll('a[role="menuitem"]');d=Array.from(t).filter(e=>e.parentElement.parentElement.parentElement===o)}else d=[]}const c=d.indexOf(r);switch(n){case" ":case"Enter":e.preventDefault(),s(r),r.classList.contains("t_nav__categories_item")?a(d,r,c):(l(r),"A"===r.tagName&&("javascript:void(0)"!==r.getAttribute("href")?r.click():l(r)),"DIV"===r.tagName&&r.classList.contains("t_nav__dd__authored__content__pds_button")&&r.querySelector("button").click(),"BUTTON"===r.tagName&&r.click());break;case"ArrowRight":e.preventDefault(),s(r),l(r);break;case"ArrowLeft":e.preventDefault(),function(e){if(e.classList.contains("t_nav__categories_item")){const t=e.previousElementSibling;t&&t.focus()}else{const t=e.parentElement.parentElement.parentElement;t&&"menuitem"===t.previousElementSibling.getAttribute("role")&&(t.previousElementSibling.focus(),s(t.previousElementSibling))}}(r);break;case"ArrowUp":e.preventDefault(),function(e,t,n){t.parentElement.parentElement.classList.contains("t_nav__dd__parent-list")?(n=(e=i(t.parentElement.parentElement)).indexOf(t),e[(n-1+e.length)%e.length].focus()):e[(n-1+e.length)%e.length].focus()}(d,r,c);break;case"ArrowDown":e.preventDefault(),a(d,r,c);break;case"Home":e.preventDefault(),d[0].focus();break;case"End":e.preventDefault(),d[d.length-1].focus();break;case"Escape":e.preventDefault();const t=document?.querySelector(".global-header .categories-flyout-backdrop");t.style.display="none"}}function i(e){const t=e.querySelectorAll('[role="menuitem"]');return Array.from(t).filter(t=>t.parentElement.parentElement===e)}function s(e){const t=e.nextElementSibling;if(e&&"none"===e.getAttribute("role")){g(e.querySelector("li .categories-item"),0,null,!0);const t="false"===e?.querySelector('[role="menuitem"]')?.getAttribute("aria-expanded");e?.querySelector('[role="menuitem"]')?.setAttribute("aria-expanded",t)}else if(t&&"menu"===t.getAttribute("role")){const n="false"===e.getAttribute("aria-expanded");e.setAttribute("aria-expanded",!n),Array.from(e.parentElement.parentElement.children).forEac
1h(e=>u(e)),n?(h(t),d(e.parentElement)):(f(t),u(e.parentElement))}}function a(e,t,n){let r=(n+1)%e.length;e=i(t.parentElement.parentElement),t.parentElement.parentElement.classList.contains("t_nav__dd__parent-list-3")||t.parentElement.parentElement.classList.contains("t_nav__dd__parent-list-2")?(r=((n=e.indexOf(t))+1)%e.length,e[r].focus()):t.parentElement.parentElement.classList.contains("t_nav__dd__parent-list")?(r=(n+1)%e.length,e[r].focus()):t.classList.contains("t_nav__categories_item")?(e=t.querySelectorAll(".t_nav__dd__parent-list>li")).length>0&&e[0].querySelector("a").focus():console.warn("unknown level")}function l(e){const t=e.nextElementSibling;t&&"none"===t.getAttribute("role")&&t.focus()}function d(e,n=!1){const r=e?.parentElement?.parentElement,o=e.querySelector(".t_nav__dd-child"),i=e.querySelector("a");i&&o&&i.setAttribute("aria-expanded","true"===i.getAttribute("aria-expanded")?"false":"true"),r&&o&&(h(o),r.style.height=Math.max(44*r.querySelector("ul.t_nav__dd__parent-list").children.length+50,r.clientHeight)+"px"),r.classList.contains("t_nav__dd-child")||(r.classList.contains("t_nav__dd-single")||e.classList.add("t_nav__dd__item__active-parent"),r.style.display="block",r.querySelector(".t_nav__dd__authored")&&(r.style.width=e.clientWidth+211+"px"));const s=e.querySelector(".t_nav__dd__item-list");s&&!n?m(r,s,o).then(()=>{if(e.querySelector(".t_nav__dd-child .t_nav__dd__authored")){const t=o.querySelectorAll(".t_nav__dd-child"),n=Array.from(t).filter(e=>"none"===e.style.display);0!==t.length&&n.length===t.length?r.style.width=s.clientWidth+e.clientWidth+"px":r.style.width=s.clientWidth+e.clientWidth+211+"px"}else r.style.width=s.clientWidth+e.clientWidth+"px";t.adjustScrollbars()}):t.adjustScrollbars(),r.classList.contains("t_nav__dd-single")||function(e){const t=e.querySelector(".t_nav__dd__item__color");if(t&&!t.parentElement.parentElement.parentElement.classList.contains("t_nav__dd-child")){t.classList.remove("t_nav__dd__item__color"),t.classList.add("t_nav__dd__item__active-list-item");const n=e.querySelector("a");n&&n.setAttribute("aria-expanded",!0)}}(e)}async function c(e){const t=e.parentElement.parentElement,n=e.querySelector(".t_nav__dd-child"),r=e.querySelector("a");r&&n&&r.setAttribute("aria-expanded",!0),t&&n&&h(n);const o=Array.from(t.querySelector("ul").children).filter(e=>e.children.length>1);t.classList.contains("t_nav__dd")||(o.length>0&&e.classList.add("t_nav__dd__item__active-parent"),t.style.display="block");const i=e.querySelector(".t_nav__dd__item__color");i&&i.parentElement.parentElement.classList.contains("t_nav__dd__parent-list-2")&&!i.parentElement.parentElement.classList.contains("t_nav__dd__parent-list-3")&&o.length>0&&(i.classList.remove("t_nav__dd__item__color"),i.classList.add("t_nav__dd__item__active-list-item"),i.setAttribute("aria-expanded",!0));const s=e.querySelector(".t_nav__dd__item-list");s&&m(t,s,n)}function u(e){const t=e.parentElement.parentElement,n=e.querySelector("a");t.classList.contains("t_nav__dd-child")||(e.classList.remove("t_nav__dd__item__active-parent"),t.style.display="none");const r=e.querySelector(".t_nav__dd-child");r&&f(r);const o=e.querySelector(".t_nav__dd__item-list");o&&f(o),n&&r&&n.setAttribute("aria-expanded",!1),function(e){const t=e.querySelector(".t_nav__dd__item__active-list-item");if(t&&!t.parentElement.parentElement.parentElement.classList.contains("t_nav__dd-child")){t.classList.remove("t_nav__dd__item__active-list-item"),t.classList.add("t_nav__dd__item__color");const n=e.querySelector("a");n&&n.setAttribute("aria-expanded",!1)}}(e);const i=e.querySelectorAll(".t_nav__dd-child"),s=Array.from(i).filter(e=>e.classList.contains("d-none"));if(0!==i.length&&s.length===i.length){let n=e.parentElement.clientWidth;0===n?(t.style.removeProperty("width"),t.style.removeProperty("min-width")):(t.style.width=n+"px",t.style["min-width"]=n+"px"),t.children.length>1&&t.querySelector(".t_nav__dd__authored")&&(t.style.width=e.parentElement.clientWidth+t.querySelector(".t_nav__dd__authored").clientWidth+"px")}}function p(e){const t=e.parentElement.parentElement,n=e.querySelector("a");t.classList.contains("t_nav__dd-child")&&(e.classList.remove("t_nav__dd__item__active-parent"),t.style.display="none");const r=e.querySelector(".t_nav__dd-child");r&&f(r);const o=e.querySelector(".t_nav__dd__item-list");o&&f(o),n&&r&&n.setAttribute("aria-expanded",!1);const i=e.querySelector(".t_nav__dd__item__active-list-item");i&&(i.classList.remove("t_nav__dd__item__active-list-item"),i.classList.add("t_nav__dd__item__color"));const s=t.querySelectorAll("ul.t_nav__dd__parent-list-3"),a=Array.from(s).filter(e=>e.classList.contains("d-none"));0!==s.length&&a.length===s.length&&(t.parentElement.parentElement.parentElement.style.width=t.parentElement.parentElement.clientWidth+t.clientWidth+"px")}async function m(e,n,r){h(n);const o=e.getBoundingClientRect(),i=r.getBoundingClientRect().top-o.top;let s,a,l;if(i>1&&(r.style.top=-1*i+"px"),e.style.height=n.clientHeight+"px",e.style.minHeight=44*e.querySelector("ul").children.length+50+"px",e.style.maxHeight="780px",e.style.minWidth="143px",s=Promise.resolve(e.querySelector("ul.t_nav__dd__parent-list")),a=Promise.resolve(e.querySelector("ul.t_nav__dd__parent-list-2")),l=Promise.resolve(e.querySelector("ul.t_nav__dd__parent-list-3")),n.classList.contains("t_nav__dd__parent-list-2")){n.style.minHeight=Math.max(e.clientHeight,n.clientHeight)+"px";const t=Array.from(n.children).filter(e=>e.classList.contains("t_nav__dd__item__active-parent"));t.length>
10&&t.forEach(e=>p(e)),n.querySelector(".t_nav__dd__item-pad")&&n.classList.add("p-0"),await c(n.children[0])}n.classList.contains("t_nav__dd__parent-list-3")&&(n.style.minHeight=Math.max(e.clientHeight,n.clientHeight)+"px",c(n.children[0]).then(()=>{Promise.all([s,a,l]).then(([o,i,s])=>{if(i){i.classList.add("t_nav__dd__border-right");let t=e.parentElement.parentElement?.clientWidth+(n.classList.contains("d-inline-flex")?n.clientWidth:0)+Math.max(s?.clientWidth,190);e.parentElement.parentElement.parentElement.style.width=t+"px",n.parentElement.parentElement.style.minWidth="143px",r.querySelector(".t_nav__dd-child .t_nav__dd__authored")&&(e.parentElement.parentElement.parentElement.style.width=t+211+"px"),e.parentElement.parentElement.parentElement.style.height=Math.max(o?.clientHeight?o?.clientHeight:0,i?.clientHeight?i?.clientHeight:0,s?.clientHeight?s?.clientHeight:0,n.clientHeight)+"px"}t.adjustScrollbars()})}))}function h(e){e.style.display="inline-flex",e.classList.remove("d-none"),e.classList.add("d-inline-flex")}function f(e){e.style.display="none",e.classList.remove("d-inline-flex"),e.classList.add("d-none")}function g(e,t,n,r=!1){const o=document.querySelector(".search-suggestion-container")?.style?.display,i=document.querySelector(".search-suggestion-container-auto")?.style?.display,s=document?.querySelector(".global-header .categories-flyout-backdrop");if("block"!==o&&"block"!==i)if(e?.nextElementSibling){const t=e.nextElementSibling.querySelectorAll(".t_nav__dd__parent-list>li");s.style.display="block",Array.from(t).filter(e=>
1e.classList.contains("t_nav__dd__item__active-parent")).forEach(e=>u(e)),t.forEach(e=>{null!=e.querySelector("ul")&&e.querySelector("ul").classList.add("d-none")}),clearTimeout(n),setTimeout(()=>{var n;n=e.nextElementSibling,document.querySelectorAll(".t_nav__dd").forEach(e=>{e!==n&&(e.classList.add("d-none"),e.classList.remove("d-inline-flex"),e.style.display="")});const o=e.nextElementSibling.querySelector(".t_nav__dd");o&&(h(o),0!==Array.from(t).filter(e=>e.classList.contains("t_nav__dd__item__active-parent")).length||r||d(t[0]))},1)}else s.style.display="none"}t=this,function(){const e=document.querySelectorAll("tertiary-bar .t_nav__categories_item .categories-item");e?.forEach(e=>{e.addEventListener("keydown",o),e.addEventListener("focus",n)});const t=document.querySelectorAll("tertiary-bar .t_nav__categories_item .categories-item__drilldown");t?.forEach(e=>{e.addEventListener("keydown",r)})}();const C=document.querySelector("tertiary-bar .t_nav__primary");C?.addEventListener("mouseenter",()=>{this.disableScroll()}),C?.parentElement.addEventListener("mouseleave",()=>{this.enableScroll()});const v=document.querySelectorAll("tertiary-bar .t_nav__categories .categories-item");let b,_;const w=document?.querySelector(".global-header .categories-flyout-backdrop");if(document.querySelector("tertiary-bar .t_nav__primary").addEventListener("mouseleave",e=>{const t=e.target.querySelectorAll(".categories-item");w.style.display="none",t.forEach(e=>{e.setAttribute("aria-expanded","false"),clearTimeout(b),clearTimeout(_);const t=e.parentElement.querySelector(".t_nav__dd");t&&f(t)})}),v.length){v.forEach(e=>{e.addEventListener("mouseenter",()=>{w.style.display="block",e.setAttribute("aria-expanded","true"),clearTimeout(b),clearTimeout(_),b=setTimeout(()=>g(e,0,_),400)}),e.addEventListener("click",()=>{clearTimeout(b),b=setTimeout(()=>g(e,0,_),400)})});const S=e=>{e&&(function(e){const t=e.querySelector(".t_nav__dd__authored__image__container");if(t){const e=t.querySelector("img");if(e){const n=document.createElement("div");n.classList.add("hero-canvas__loading-animation","hero-canvas__loading-animation--collections"),t.appendChild(n),e.onerror=function(){f(e)},e.onload=function(){const e=t.querySelector(".hero-canvas__loading-animation");t.removeChild(e)}}}}(e),e.classList.contains("t_nav__dd__item-child")?(e.addEventListener("mouseenter",()=>{clearTimeout(b),clearTimeout(_),b=setTimeout(()=>{Array.from(e.parentElement.children).forEach(e=>p(e)),c(e)},400)}),e.addEventListener("mouseleave",()=>{clearTimeout(b),_=setTimeout(()=>{},400)}),e.addEventListener("keydown",t=>{const{key:n}=t;"ArrowRight"===n&&(Array.from(e.parentElement.children).forEach(e=>p(e)),c(e)),"ArrowLeft"===n&&p(e)})):(e.addEventListener("mouseenter",()=>{clearTimeout(b),b=setTimeout(()=>{Array.from(e.parentElement.children).forEach(e=>u(e)),d(e)},400)}),e.addEventListener("mouseleave",()=>{clearTimeout(b),_=setTimeout(()=>{},400)})))},I=document.querySelectorAll("tertiary-bar .t_nav__dd__parent-list .t_nav__dd__item.nav-item");I?.forEach(S);const E=document.querySelectorAll("tertiary-bar .t_nav__dd__parent-list-2 .t_nav__dd__item.nav-item");E?.forEach(S)}}},this.applyShowAttributes=function(e){e.style.display="inline-flex",e.classList.remove("d-none"),e.classList.add("d-inline-flex")},this.applyHideAttributes=function(e){e.style.display="none",e.classList.remove("d-inline-flex"),e.classList.add("d-none")},this.handleCategoryItemClick=function(e,t){const n=e.target?.closest(".t_nav__categories_item"),r=document.querySelectorAll(".t_nav__categories_item");if(!$(n)?.is(t.categoryItem))return;e.stopPropagation();const o=n,i=o?.closest(".t_nav__categories"),s=o?.querySelector(".categories-item__drilldown"),a=s?.querySelector(".t_nav__dd"),l=s?.querySelectorAll(".t_nav__dd__parent-list > li"),d=Array.from(l||[]).filter(e=>e.querySelector("ul")),c=s?.querySelectorAll(".t_nav__dd__parent-list-2 > li.t_nav__dd__item-child "),u=Array.from(c||[]).filter(e=>e.querySelector("ul"));this.drilldownOnCategoryClick(t,i,s,d,u,r,n,a),this.addEventListenersToL2Items(d,u),this.addEventListenersToL3Items(u)},this.handleBackButtonClick=function(e,t,n,r){e.stopPropagation(),$(".t_nav__categories")?.css("visibility","visible"),$(".categories-item__drilldown")?.css("visibility","hidden"),t?.fulfillmentDetails?.removeClass("d-none")?.addClass("d-flex"),t?.toolBoxMobile?.removeClass("d-none"),t?.campaignLink?.removeClass("d-none").addClass("d-flex"),t?.mobileCategoryHeader?.addClass("d-none"),n?.forEach(e
1=>{e?.classList?.remove("d-none")}),r?.forEach(e=>{e?.classList?.remove("active");const t=e?.querySelector(".t_nav__dd-child"),n=e?.querySelector(".t_nav__dd__item__color"),r=e?.querySelector(".t_nav__dd__item__color span");t&&t.style.setProperty("display","none","important"),r.classList.remove("s-accordion-expand-icon"),r.classList.add("s-accordion-collapse-icon"),n.setAttribute("aria-expanded",!1)})},this.drilldownOnCategoryClick=function(e,t,n,r,o,i,s,a){var l=this;t?.style?.setProperty("visibility","hidden"),e?.fulfillmentDetails?.removeClass("d-flex")?.addClass("d-none"),e?.toolBoxMobile?.addClass("d-none"),e?.campaignLink?.removeClass("d-flex")?.addClass("d-none"),e?.mobileCategoryHeader?.removeClass("d-none"),s?.querySelector(".s_nav_mobile_header")?.classList?.remove("d-none"),setTimeout(function(){s?.querySelector(".s_nav_back_arrow").focus()},100),s?.querySelector(".categories-item").setAttribute("aria-expanded","true"),i?.forEach(e=>{e!==s&&e?.classList?.add("d-none")}),n&&(n.style.display="block",n.style.visibility="visible",n.style.height="auto",n.style.width="auto",n.querySelector(".s_nav_mobile_header")?.classList?.remove("d-none"));const d=s?.querySelector(".s_nav_back_arrow"),c=t=>{l.handleBackButtonClick(t,e,i,r),setTimeout(()=>{const e=s?.querySelector(".categories-item");e?.setAttribute("aria-expanded","false"),e?.focus()},500)};d?.addEventListener("click",c),d?.addEventListener("keydown",e=>{"Enter"===e.key&&c(e)}),a&&(a.removeAttribute("style"),a?.classList?.remove("d-inline-flex","align-items-start"))},this.addEventListenersToL2Items=function(e,t){var n=this;e?.forEach(e=>{e?.hasAttribute("data-event-listener-added")||(e?.setAttribute("data-event-listener-added",!0),e?.addEventListener("click",function(r){n.handleL2ItemClick(r,e,t)}))})},this.handleL2ItemClick=function(e,t){const n=$(e.target?.closest(".t_nav__dd__item"));if(!$(n)?.is(t))return;e.stopPropagation(),e.stopImmediatePropagation(),t?.classList?.toggle("active");const r=t?.querySelector(".t_nav__dd-child"),o=t?.querySelector(".t_nav__dd__item__color"),i=t?.querySelector(".t_nav__dd__item__color span");if($(r).removeClass("d-inline-flex align-items-start"),i?.classList?.contains("s-accordion-collapse-icon")){i.classList.remove("s-accordion-collapse-icon"),i.classList.add("s-accordion-expand-icon");const e="true"===o.getAttribute("aria-expanded");o.setAttribute("aria-expanded",!e)}else{i.classList.remove("s-accordion-expand-icon"),i.classList.add("s-accordion-collapse-icon");const e="true"===o.getAttribute("aria-expanded");o.setAttribute("aria-expanded",!e)}r.style.display="block"===r?.style?.display?"none":"block";const s=t?.querySelectorAll(".t_nav__dd__parent-list-2 > li.t_nav__dd__item-child "),a=Array.from(s||[]).filter(e=>e.querySelector("ul"));if(a[0]){const e=a[0];e?.classList?.add("active");const t=e?.querySelector(".t_nav__dd-child"),n=e?.querySelector(".t_nav__dd__item__color"),r=e?.querySelector(".t_nav__dd__item__color span");$(t).removeClass("d-inline-flex align-items-start"),r.classList.remove("s-accordion-collapse-icon"),r.classList.add("s-accordion-expand-icon"),n.setAttribute("aria-expanded",!0),t.style.display="block"}},this.addEventListenersToL3Items=function(e){var t=this;e?.forEach(e=>{e?.hasAttribute("data-event-listener-added")||(e?.setAttribute("data-event-listener-added",!0),e?.addEventListener("click",function(n){t.handleL3ItemClick(n,e)}))})},this.handleL3ItemClick=function(e,t){e.stopPropagation(),t?.classList?.toggle("active"),t?.querySelector("ul");const n=t?.querySelector(".t_nav__dd__item__color"),r=t?.querySelector(".t_nav__dd-child");r&&$(r).removeClass("d-inline-flex align-items-start");const o=t?.querySelector(".t_nav__dd__item__color span");if(o?.classList?.contains("s-accordion-collapse-icon")){o.classList.remove("s-accordion-collapse-icon"),o.classList.add("s-accordion-expand-icon");const e="true"===n.getAttribute("aria-expanded");n.setAttribute("aria-expanded",!e)}else{o.classList.remove("s-accordion-expand-icon"),o.classList.add("s-accordion-collapse-icon");const e="true"===n.getAttribute("aria-expanded");n.setAttribute("aria-expanded",!e)}r.style.display="block"===r?.style?.display?"none":"block"},this.truncatedMenuText=(e,t=188)=>{const n=document.createElement("div");n.style.position="absolute",n.style.visibility="hidden",n.style.whiteSpace="nowrap",n.style.width="auto",n.style.height="auto",n.style.display="inline-block";const r=document.createElement("span");if(n.appendChild(r),document.body.appendChild(n),r.textContent=e,r.offsetWidth<=t)return document.body.removeChild(n),e;let o=e;for(let n=e.length-1;n>=0&&(o=e.substring(0,n)+"...",r.textContent=o,!(r.offsetWidth<=t));n--);return document.body.removeChild(n),o},this.adjustScrollbars=()=>
1{if(window.SWY&&window.SWY.CONFIGSERVICE?.featureToggleConfig&&(isNavScrollEnabled="true"!==window.SWY.CONFIGSERVICE?.featureToggleConfig?.isNavScrollDisabled),!isNavScrollEnabled)return;const e=$(".t_nav__dd-single ul:visible:last,.t_nav__dd-child.d-inline-flex ul:visible:last");if(!e||e.length<0)return;const t=.9*Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)-142,n=e.closest(".t_nav__dd")[0];n&&(n.classList.add("parent-container-scroll"),n.style.maxHeight=t+"px");const r=e[0];r&&(r.style.maxHeight=t+"px",r.classList.add("last-menu-scroll"),r.style.flexWrap="nowrap",r.style.flex="none",r.style.overflowY="auto",r.style.overflowX="hidden",r.style.minHeight="auto",r.style.paddingBottom="initial");const o=e.siblings(".t_nav__dd__authored")[0];o&&(o.style.maxHeight=t+"px",o.style.overflow="hidden");const i=e.parents(".t_nav__dd__item-list")[0];if(i)i.style.maxHeight=t+"px";else{const t=e.closest(".t_nav__dd"),n=t.find(".t_nav__dd__parent-list").width(),r=t.find(".t_nav__dd-child.align-items-start.d-inline-flex:visible").width();if(n&&r){const e=n+r;t.width(e)}}}}},6592:(e,t,n)=>{const r=n(7978),o=n(7878),i=n(4016);e.exports=function(){this.conflictModalItems={conflictModalMainId:"#fulfillment-conflict-modal",zipCodeModalContainer:".zip-code-modal-container",modalShopImage:".fulfillment-conflict-modal__shop-image",preferenceText:".fulfillment_preference-txt",addressText:".fulfillment_address-txt",inStoreIconClass:"svg-icon-store-header-mobile",inStoreText:"In Store at ",deliveryIconClass:"svg-icon-Delivery-pref-page",deliveryText:"Delivery to ",dugiconClass:"svg-icon-DUG-pref-page",dugText:"Pickup at",previousSessionRadio:".previousSessionRadio",currentSessionRadio:".currentSessionRadio",conflictModalButton:".fulfillment-conflict-modal__button",conflictModalClose:"#conflict-modal-close",currentBanner:".fulfillment-conflict-modal__currentBanner",previousBanner:".fulfillment-conflict-modal__previousBanner",previouslyShoppedId:"#previouslyShopped",currentlyShoppingId:"#currentlyShopping",noPreferenceErrorMessage:"Preferences Not found in Session Cookie",isSyndicatedHeader:"syndicatedHeader",modalFadeClass:".modal-backdrop",deliveryTextGeo:"Delivery at "},this.triggerConflictModal=function(){const e=AB.userInfo.userType.toLowerCase();if("r"===e||"c"===e){let e=SWY.CONFIGSERVICE.getCookie("abs_gsession"),t=SWY.CONFIGSERVICE.getCookie("SWY_SHARED_SESSION_INFO"),n=SWY.CONFIGSERVICE.featureToggleConfig?.isCookieACIPrefixEnabled?"ACI_S_B_convt_acc_success":"B_convt_acc_success";if(convertB2bAccountCookie=SWY.CONFIGSERVICE.getCookie(n),hasConflict=!1,sessionObj={},guestObj={},conflictModalMainId=r.getElement(this.conflictModalItems.conflictModalMainId),conflictModalMainId.modal("hide"),i.isCookieEmpty(e)||i.isCookieEmpty(t)){if(!i.isCookieEmpty(t)){let e=this.mapAttributesFromCookie(t,sessionObj,"session");!this.isObjectEmpty(AB.storeFlagsData)&&null!=AB.storeFlagsData.flags.ecomStore.polarisBannerName&&this.checkForReBanneredFlow(e,{},AB.storeFlagsData.flags.ecomStore.polarisBannerName,!1)?window.storeFulfillmentModal.component.setModalDisplayData(3,null,null,!1,!1,!0):SplashModalService.dispatchSplashModalEvent("conflictFlowComplete"),window.MergeAcctModalComp.checkIfMergeAcctCookieExists()&&window.MergeAcctModalComp.init()}}else{let n=this.mapAttributesFromCookie(e,guestObj,"guest"),r=this.mapAttributesFromCookie(t,sessionObj,"session");if(!this.isObjectEmpty(AB.storeFlagsData)&&null!=AB.storeFlagsData.flags.ecomStore.polarisBannerName&&this.checkForReBanneredFlow(r,n,AB.storeFlagsData.flags.ecomStore.polarisBannerName,!0))window.storeFulfillmentModal.component.setModalDisplayData(3,null,null,!1,!1,!0);else if(n&&r&&n.preference&&r.preference){if("delivery"===n.preference&&"delivery-addr"===n.resolvedBy&&0===Object.keys(this.getResolvedAddress()).length)return hasConflict=!1,this.deleteGuestData("abs_gsession"),void this.deleteGeoCookie();if("j4u"===r.preference)if(String(r.banner).toLowerCase()!==String(n.banner).toLowerCase()){if(!0===window.SWY?.CONFIGSERVICE?.featureToggleConfig?.disableB2BConflictModal||convertB2bAccountCookie)return this.populateConflictModalData(n,r),localStorage.removeItem("redirectToErums"),localStorage.removeItem("triggerSlotModal"),void this.saveStoreData();hasConflict=!0,this.renderBanner(n.banner,r.banner),this.diplayConflictModal(n,r)}else r.j4uStoreId===n.j4uStoreId?r.preference!==n.preference&&(hasConflict=!0,this.diplayConflictModal(n,r)):"default"!==n.selection&&"Geo"!==n.selection&&(hasConflict=!0,this.diplayConflictModal(n,r));else if(("delivery"===r.preference||"dug"===r.preference)&&"default"!==n.selection&&"Geo"!==n.selection){let e="delivery"===r.preference?n.shopzipcode:n.shopStoreId;(("delivery"===r.preference?r.shopzipcode:r.shopStoreId)!==e||r.preference!==n.preference)&&(hasConflict=!0,this.diplayConflictModal(n,r))}}else console.error(this.conflictModalItems.noPreferenceErrorMessage);hasConflict?(localStorage.removeItem("redirectToErums"),localStorage.removeItem("triggerSlotModal")):(this.deleteGuestData("abs_gsession"),this.deleteGeoCookie(),!this.isObjectEmpty(AB.storeFlagsData)&&null!=AB.storeFlagsData.flags.ecomStore.polarisBannerName&&this.checkForReBanneredFlow(r,{},AB.storeFlagsData.flags.ecomStore.polarisBannerName,!1)?window.storeFulfillmentModal.component.setModalDisplayData(3,null,null,!1,!1,!0):AB.isLSEnabled&&"1"==localStorage.getItem("redirectToErums")?(localStorage.removeItem("redirectToErums"),window.AB.COMMON.authorize()&&!SWY.CONFIGSERVICE.enablePrebookSlotModal()&&(window.location.pathname="/erums/store/prebook")):SplashModalService.dispatchSplashModalEvent("conflictFlowComplete"),window.MergeAcctModalComp.checkIfMergeAcctCookieExists()&&window.MergeAcctModalComp.init())}}if("g"===e){let e=SWY.CONFIGSERVICE.getCookie("SWY_SHARED_SESSION_INFO"),t={};if(!i.isCookieEmpty(e)){let n=this.mapAttributesFromCookie(e,t,"session");!this.isObjectEmpty(AB.storeFlagsData)&&null!=AB.storeFlagsData.flags.ecomStore.polarisBannerName&&this.checkForReBanneredFlow(n,{},AB.storeFlagsData.flags.ecomStore.polarisBannerName,!1)&&window.storeFulfillmentModal.component.setModalDisplayData(3,null,null,!1,!1,!0)}}},this.init=function(){const e=r.getMetaElementContent(this.conflictModalItems.isSyndicatedHeader);AB.COMMON.isErumsPage()||"false"===e&&(this.triggerConflictModal(),this.saveSession())},this.mapAttributesFromCookie=function(e,t,n){const r=JSON.parse(e);let o,i,s;if(r.info.COMMON.preference){if("guest"===n){if(o=SWY.CONFIGSERVICE.getResolvedBanner(),"j4u"===r.info.COMMON.preference.toLowerCase()||"dug"===r.info.COMMON.preference.toLowerCase()){let e="j4u"===r.info.COMMON.preference.toLowerCase()?r.info.J4U.storeId:r.info.SHOP.storeId;if(SWY.CONFIGSERVICE.isLSCompatible()){const t=JSON.parse(localStorage.getItem("previousStoreData"));if(t&&t.storeLocation.storeId===e)s=t.storeLocation.address+"+"+t.storeLocation.city+"+"+t.storeLocation.state+"+"+t.storeLocation.zipcode;else{const t=this.getStoreDetailsFromXapi(e);s=t?.streetAddress}}else{const t=this.getStoreDetailsFromXapi(e);s=t?.streetAddress}}}else{if(o=r.info.J4U.preferredBanner||r.info.COMMON.banner,("j4u"===r.info.COMMON.preference.toLowerCase()||"dug"===r.info.COMMON.preference.toLowerCase())&&(s="j4u"===r.info.COMMON.preference.toLowerCase()?r.info.J4U.address:r.info.SHOP.address,!s)){let e=(r.info.COMMON.preference,r.info.J4U.storeId);const t=this.getStoreDetailsFromXapi(e);s=t?.streetAddress}i=r.info.COMMON.banner}return t.preference=r.info.COMMON.preference.toLowerCase(),t.selection=r.info.COMMON.Selection,t.banner=o,t.j4uStoreId=r.info.J4U.storeId,t.j4uzipcode=r.info.J4U.zipcode,t.shopStoreId=r.info.SHOP.storeId,t.shopzipcode=r.info.SHOP.zipcode,t.address=s,t.commonBanner=i,t.resolvedBy=r.info.COMMON.resolvedBy||"",t}},this.renderCurrentlyShopping=function(e){const t=r.getElement(this.conflictModalItems.currentlyShoppingId),n=r.getElement(this.conflictModalItems.modalShopImage),o=r.getElement(this.conflictModalItems.currentlyShoppingId),i=t.find(n),s=t.find(this.conflictModalItems.preferenceText),a=t.find(this.conflictModalItems.addressText),l=e.preference;if("j4u"===l||"instore"===l){i.addClass(this.conflictModalItems.inStoreIconClass),s.text(this.conflictModalItems.inStoreText);const t=e.address;t&&a.text(t.split("+").join(" "))}else if("delivery"===l)if("delivery-addr"===e?.resolvedBy&&Object.keys(this.getResolvedAddress()).length>0){let{adr1:e,adr2:t,city:n,st:r,zip:o}=this.getResolvedAddress(),a=`${e}${t?", "+t+", ":""} ${n}, ${r}, ${o}`;i.addClass(this.conflictModalItems.deliveryIconClass),s.text(this.conflictModalItems.deliveryTextGeo+a)}else i.addClass(this.conflictModalItems.deliveryIconClass),s.text(this.conflictModalItems.deliveryText+e.shopzipcode);else if("dug"===l){i.addClass(this.conflictModalItems.dugiconClass),s.text(this.conflictModalItems.dugText);const t=e.address;t&&a.text(t.split("+").join(" "))}o.attr("make-mystore-btn",encodeURIComponent(JSON.stringify(e)))},this.renderPreviouslyShopped=function(e){const t=r.getElement(this.conflictModalItems.previouslyShoppedId),n=r.getElement(this.conflictModalItems.modalShopImage),o=r.getElement(this.conflictModalItems.previouslyShoppedId),i=t.find(n),s=t.find(this.conflictModalItems.preferenceText),a=t.find(this.conflictModalItems.addressText),l=e.preference,d=SWY?.CONFIGSERVICE?.getCookie("SWY_SHARED_PII_SESSION_INFO");if("j4u"===l||"instore"===l){i.addClass(this.conflictModalItems.inStoreIconClass),s.text(this.conflictModalItems.inStoreText);const t=e.address;t&&a.text(t.split("+").join(" "))}else if("delivery"===l){let t=!1;if("delivery-addr"===AB?.userInfo?.resolvedBy&&d){let e,n,r=JSON.parse(d);r.deliveryAddr&&(e=r.deliveryAddr.split("+").join(" "),"null"===e?.split(",")?.[0]&&(n=e.match(/\d+/g),n&&(e=n[0])),i.addClass(this.conflictModalItems.deliveryIconClass),s.text(this.conflictModalItems.deliveryTextGeo+e),t=!0)}t||(i.addClass(this.conflictModalItems.deliveryIconClass),s.text(this.conflictModalItems.deliveryText+e.shopzipcode))}else if("dug"===l){i.addClass(this.conflictModalItems.dugiconClass),s.text(this.conflictModalItems.dugText);const t=e.address;t&&a.text(t.split("+").join(" "))}o.attr("make-mystore-btn",encodeURIComponent(JSON.stringify(e)))},this.getResolvedAddress=function(){let e=AB?.COMMON?.getGeoCookieName(),t=SWY.CONFIGSERVICE.getCookie(e),n={};return t&&(n=JSON.parse(t)),n},this.renderBanner=function(e,t){if(e&&t&&e!==t){const n=r.getElement(this.conflictModalItems.currentBanner),o=r.getElement(this.conflictModalItems.previousBanner);"B"===AB?.userInfo?.siteType&&(e=`${e}_b2b`,t=`${t}_b2b`),n.attr("src",this.getBannerLogo(e)),n.attr("alt",e),n.addClass(`${e}-logo`),o.attr("src",this.getBannerLogo(t)),o.attr("alt",t),o.addClass(`${t}-logo`),n.show(),o.show()}},this.saveStoreData=function(e){const t=r.getElement(this.conflictModalItems.currentSessionRadio),n=r.getElement(this.conflictModalItems.previousSessionRadio),s=r.getElement(this.conflictModalItems.currentlyShoppingId),a=r.getElement(this.conflictModalItems.previouslyShoppedId),l=r.getElement(this.conflictModalItems.conflictModalButton),d=this;let c=s.attr("make-mystore-btn"),u=a.attr("make-mystore-btn"),p=t.is(":checked"),m=n.is(":checked"),h={info:{COMMON:{userData:{}},J4U:{},SHOP:{}}},f=!!SWY.CONFIGSERVICE.featureToggleConfig.enableCookieRestructure;c=JSON.parse(decodeURIComponent(c)),u=JSON.parse(decodeURIComponent(u));const g=c.preference.toUpperCase(),y=c?.resolvedBy;let C=this.getResolvedAddress();if(p||"close-action"===e){if(h.info.COMMON.preference=g,wfcStoreId=this.checkIsWineShopEnabled(),h.info.COMMON.wfcStoreId=wfcStoreId,h.info.J4U.zipcode=c.j4uzipcode,h.info.J4U.storeId=c.j4uStoreId,h.info.J4U.banner=c.banner,h.info.SHOP.zipcode=c.shopzipcode,h.info.SHOP.storeId=c.shopStoreId,f&&(h.info.COMMON.banner=c.banner,h.info.COMMON.storeId=c.shopStoreId,h.info.COMMON.zipcode=c.shopzipcode),AB.DATALAYER&&("close-action"===e?AB.DATALAYER.setModalClickEvents("storeConflict|close"):AB.DATALAYER.setModalClickEvents("storeConflict|currentlyShopping")),"J4U"===g){const e=c.address.split("+").join(", ");h.info.J4U.address=e,f&&(h.info.COMMON.address=e),h.info.COMMON.resolvedBy="zipcode",C={}}else if("DUG"===g){const e=c.address.split("+").join(", ");h.info.SHOP.address=e,f&&(h.info.COMMON.address=e),h.info.COMMON.resolvedBy="zipcode",C={}}else"DELIVERY"===g&&("delivery-addr"===y?h.info.COMMON.resolvedBy=y:(h.info.COMMON.resolvedBy="zipcode",C={}));if(String(c.banner).toLowerCase()!==String(u.banner).toLowerCase()&&String(c.banner).toLowerCase()!==AB.userInfo.banner){let e={};"J4U"===g?(e.storeId=c.j4uStoreId,e.zipcode=c.j4uzipcode,e.preference=g,e.banner=c.banner,e.wfcStoreId=wfcStoreId):(e.storeId=c.shopStoreId,e.zipcode=c.shopzipcode,e.preference=g,e.banner=c.banner,e.wfcStoreId=wfcStoreId),h.info.offbanner=e,h.info.COMMON.resolvedBy="zipcode",C={},d.deleteGuestData("abs_gsession",!0),d.deleteGeoCookie(),i.updateUserSession(h,null,function(e){e.success||this.attr("disabled",!1)},null,C)}else i.updateUserSession(h,null,function(e){!0===e.success?(d.deleteGuestData("abs_gsession"),d.deleteGeoCookie(),location.reload()):l.attr("disabled",!1)},null,C)}else if(m)if("J4U"===u.preference.toUpperCase()&&c.banner!==u.banner){const e="storeConflict%7CpreviouslyShopped";location.replace("https://"+o.getHost()+"."+u.banner+".com"+SWY.ssoPath+"?ml="+e)}else d.deleteGuestData("abs_gsession"),d.deleteGeoCookie(),AB.DATALAYER&&AB.DATALAYER.setModalClickEvents("storeConflict|previouslyShopped")},this.checkIsWineShopEnabled=function(){let e,t,n=window.AB.storeFlagsData;if(this.isObjectEmpty(n)?$(document).on("storeFlagsLoadComplete",()=>{n=window.AB.storeFlagsData,t=n&&n.flags&&n.flags.ecomStore&&n.flags.ecomStore.storeFeatures&&n.flags.ecomStore.storeFeatures.isWineD2CEnabled,e=n&&n.flags&&n.flags.ecomStore&&n.flags.ecomStore.wfcStoreId}):(t=n&&n.flags&&n.flags.ecomStore&&n.flags.ecomStore.storeFeatures&&n.flags.ecomStore.storeFeatures.isWineD2CEnabled,e=n&&n.flags&&n.flags.ecomStore&&n.flags.ecomStore.wfcStoreId),t)return e||""},this.saveSession=function(){const e=r.readElement(this.conflictModalItems.conflictModalButton),t=r.readElement(this.conflictModalItems.conflictModalClose);e.click(()=>{e.attr("disabled",!0),this.saveStoreData()}),t.click(()=>{e.attr("disabled",!0),this.saveStoreData("close-action")})},this.getBannerLogo=function(e){const t=r.getElement(this.conflictModalItems.conflictModalMainId).attr("data-bannerlogomap");let n;return t&&(n=JSON.parse(decodeURIComponent(t))[e=e.toLowerCase().split(" ").join("")]),n},this.diplayConflictModal=function(e,t){const n=r.getElement(this.conflictModalItems.conflictModalMainId);this.renderCurrentlyShopping(e),this.renderPreviouslyShopped(t),this.setEscapeKeyListener(),n.modal("show"),AB.DATALAYER&&AB.DATALAYER.setModalViewEvents("storeConflict|view")},this.populateConflictModalData=function(e,t){r.getElement(this.conflictModalItems.conflictModalMainId),this.renderCurrentlyShopping(e),this.renderPreviouslyShopped(t)},this.setEscapeKeyListener=function(){const e=this,t=r.getElement(this.conflictModalItems.conflictModalButton);document.onkeydown=function(n){("key"in(n=n||window.event)?"Escape"===n.key||"Esc"===n.key:27===n.keyCode)&&$("#fulfillment-conflict-modal").hasClass("in")&&(n.preventDefault(),console.debug("escape key is pressed while conflict modal is shown"),t.attr("disabled",!0),e.saveStoreData("close-action"))}},this.deleteGeoCookie=function(){AB?.COMMON?.getCookie(AB?.COMMON?.getGeoCookieName())&&this.deleteGuestData(AB.COMMON.getGeoCookieName())},this.deleteGuestData=function(e,t){conflictModalMainId=r.getElement(this.conflictModalItems.conflictModalMainId),t||conflictModalMainId.modal("hide"),e=SWY.CONFIGSERVICE.getResolvedCookieName(e),document.cookie=e+"=; expires=Mon, 19 Aug 2019 00:00:00 UTC; path=/;",localStorage.removeItem("previousStoreData")}
1,this.getStoreDetailsFromXapi=function(e){const t=window.location.origin,n=AB.storeResolverStoreAddressEndpoint,r={storeid:e},o=AB.xAPIstoreResolverHttpOptions;let i;return AB.COMMON.getStoreResolverPayload(t,n,r,o,!1,function(e,t,n){i=e.storeAddressModel.address.line1+"+"+e.storeAddressModel.address.city+"+"+e.storeAddressModel.address.state+"+"+e.storeAddressModel.address.zipcode},function(e,t,n){i="Sorry we have problem getting store address"}),{streetAddress:i}},this.isObjectEmpty=function(e){return null===e||0===Object.keys(e).length},this.checkForReBanneredFlow=function(e,t,n,r){let o=!1;return r?"j4u"==e.preference?e.j4uStoreId==t.j4uStoreId&&t.banner!=n&&(o=!0):e.shopStoreId==t.shopStoreId&&t.banner!=n&&(o=!0):e.commonBanner&&e.commonBanner.length>0&&("j4u"==e.preference?e.j4uStoreId==AB.storeFlagsData.storeId&&e.commonBanner!=n&&(o=!0):e.shopStoreId==AB.storeFlagsData.storeId&&e.commonBanner!=n&&(o=!0)),o}}},6868:e=>{e.exports=function(){this.init=function(){this.wrapperName="targeted-wrapper",this.wrapperAttribute="data-targeted-component",window.lazyFunctions=window.lazyFunctions||{},document.querySelectorAll(".zone-component").forEach(e=>{let t=`lazyZoneContent${Math.random().toString(36).substring(2)}`;const n=e.getAttribute("data-zone-type");window.lazyFunctions[t]=t=>this.getTargetedZones(e,n),e.setAttribute("data-lazy-function",t)}),window.SWY.CONFIGSERVICE?.featureToggleConfig?.isZoneTargetedContentEnabled&&console.warn("zoneTargetedContentV2 initialized. Use zoneInit(zoneRef, zone_type) to load targeted content in a zone.")},this.zoneInit=function(e,t){this.wrapperName="targeted-wrapper",this.wrapperAttribute="data-targeted-component",this.getTargetedZones(e,t)},this.getZoneContentFromApi=function(e,t){throw new Error("getZoneContentFromApi method must be implemented in a subclass.")},this.getProductBPNFromCartObj=function(){let e=[];
1if(AB.COMMON.isLSCompatible()){let t=localStorage.getItem("abCart"),n=JSON.parse(localStorage.getItem("oosBPNs")),r=n?.data;n?.expirationTimeStamp<(new Date).getTime()&&(localStorage.removeItem("oosBPNs"),r=[]),t&&(t=JSON.parse(t),t.cartItems?.length>0&&"ABS"==t.cartSource&&"1P"==t.cartCategory&&t.cartItems.forEach(t=>{if(t.itemId){let n={bpn:t.itemId.toString()};e.push(n)}})),r&&r.length>0&&e.push(...r)}return e},this.customComponentCallbacks={},this.registerCustomComponentCallback=function(e,t){this.customComponentCallbacks[e]=t},this.populateZone=function(e,t,n=!1,r=!1){if(t&&t.items&&t.items.length>0){const o=n&&r;t.items.forEach(t=>{switch(t.type){case"nextgen-banner-unit-proxy":"MediumBanner"==t.variation&&this.renderMediumBannerWebgen(e,t);break;case"master-product-carousel":"smartBasket"===t.designType?this.renderSmartBasket(e,t):this.renderProductCarousel(e,t,o);break;case"smartBasket":this.renderSmartBasket(e,t);break;case"meal-carousel":this.renderMealsCarousel(e,t,o);break;case"title-header":this.renderTitleHeader(e,t);break;case"nextgen-abs-carousel-proxy":this.renderAbsCarouselProxy(e,t);break;case"deals-module":this.renderDealsCarousel(e,t,o);break;case"collections":switch(t.designType){case"standardBundleCollectionTextPlateWithBG":case"standardBundleCollectionTextPlateWithTransparent":this.renderBundlesFullWidth(e,t);break;default:console.warn(`Unknown designType for collections: ${t.designType}`)}break;case"container-unit":if("standardBundle"===t.imageSize&&"carousel"===t.bannerViewType){this.renderBundlesCarousel(e,t,o);break}if(t.componentType&&"flexModule"===t.componentType&&"carousel"!==t.bannerViewType)this.renderFlexComponentWebgen(e,t);else if("flexModule"===t?.componentType&&"carousel"===t?.bannerViewType)this.renderFlexModuleCarousel(e,t);else if(t.componentType&&"utilityBar"===t.componentType)this.renderUtilityBar(e,t);else if(t.designType&&"containerCarouselCollectionsHeroCanvas"===t.designType)this.renderHeroCanvasCarousel(e,t);else{if(!t.designType||"bentoCardCarousel"!==t.designType){console.warn(`Unknown designType for container-unit: ${t.designType}`);break}this.renderBentoCardCarousel(e,t)}break;case"flex-module":this.renderFlexComponentWebgen(e,t);break;case"blog":this.renderBlogComponent(e,t);break;case"shopbycategory":this.renderShopByCategory(e,t);break;case"richtext":this.renderRteComponentWebgen(e,t);break;case"bundle":this.renderBundle(e,t);break;case"accordion-container":this.renderWebgenAccordion(e,t);break;case"perks-panel":this.renderPerksPanel(e,t);break;case"list-card":this.renderListCardWebgen(e,t);break;default:try{this.customComponentCallbacks[t.type]?this.customComponentCallbacks[t.type](e,t):console.error(`No custom callback defined for component type: ${t.type}`)}catch(e){console.error(`Error in custom callback for ${t.type}:`,e)}}})}},this.renderAbsCarouselProxy=function(e,t){t.flexLayoutType&&"selectLayout"!==t.flexLayoutType?this.renderFlexComponentWebgen(e,t):this.renderAbsCarouselComponentWebgen(e,t)},this.renderTitleHeader=function(e,t){switch(t.designType){case"headlineTextPlateWithBG":case"headlineTextPlateWithTransparent":this.renderHeadlineWebgen(e,t);break;case"heroIntroHeadlineTextPlateWithTransparent":case"heroIntroHeadlineTextPlateWithBG":case"heroIntroHeadlineImageOnly":this.renderHeroIntroWebgen(e,t);break;case"standardIntroHeadlineTextPlateWithTransparent":case"standardIntroHeadlineTextPlateWithBG":case"standardIntroHeadlineImageOnly":this.renderStandardIntroWebgen(e,t);break;default:return}},this.getTargetedZones=function(e,t){if(!t)return;const n=document.querySelector(`.preset-zone-block-height [id*="${t}"]`)?.closest(".preset-zone-block-height"),r=this.getZoneContentFromApi(e,t),o=()=>{n&&n.classList.remove("preset-zone-block-height")};r&&"function"==typeof r.then?r.then(n=>{this.removeLoading(t),this.populateZone(e,n)}).catch(e=>{console.error(t,"Error occurred while rendering the Zone component."),this.hideZoneComponent(t)}).finally(()=>{o()}):(console.warn("getZoneContentFromApi did not return a Promise."),this.hideZoneComponent(t),o())},this.removeLoading=function(e){let t=document.getElementById(e);t&&t.classList.remove("zone__loading-animation")},this.hideZoneComponent=function(e){let t=document.getElementById(e);t&&t.remove()},this.renderProductCarousel=function(e,t,n=!1){if(e)if(t)if(t?.response?.docs&&!(t.response.docs.length<=0)||t?.productsinfo&&!(t.productsinfo.length<=0)){n&&(t.behaviourType="dynamic-grid-with-facets");try{const n=this.prepareJSON(t),r=this.addPrdCrslCtaLink(t,e?.id);e.insertAdjacentHTML("beforeend",`<div class="slick-product-carou
1sel master-product-carousel clearfix pc-slick-carousel">\n <div class="carousel-nav d-flex align-items-start py-2">\n <div class="d-flex carousel-nav__header">\n <span role="heading" aria-level="2" class="carousel-nav__header-title color-neutral-90">${t.carouselTitle}</span>\n ${r}\n </div>\n </div>\n <${this.wrapperName}\n ${this.wrapperAttribute}="product-carousel"\n data-home-targeted="true"\n data-carousel-type="generic-products"\n data-carousel-title="${t.carouselTitle}"\n data-carousel-users="${"mask"==t.hideOnLoading?t.userType:"false"}"\n data-carousel-action="${null==t.actionButton?"qty-stepper":t.actionButton}"\n data-carousel-behaviour="${null==t.behaviourType?"BIA_REALTIME_HOMEPAGE"==t.modelId?"buy-it-again":"false":t.behaviourType}"\n data-experimentation="${t.webExperimentation}"\n data-experimentation-id="${t.webExperimentationId}"\n data-experimentation-type="${t.webExperimentationType}"\n data-impression-tracking="${t.webIsImpTrackEnabled}"\n data-products='${n}'\n data-carousel-max-products="${t.maxNumOfProducts}"\n data-navigation-type="${t.navigationType}"\n data-cart-type="${t.cartType}"\n data-filter-cart-items="${t.filterCartItems}"\n data-seller-type="${t.sellerType}"\n data-carousel-pdp="false"\n id="${t.itemName}">\n </${this.wrapperName}>\n </div>`),this.bootstrapAngular()}catch(e){console.error(`Failed to render product carousel "${t?.carouselTitle}":`,e)}}else console.warn(`No products available for carousel: ${t?.carouselTitle||"unknown"}`);else console.error("component is null - cannot render product carousel");else console.error("zoneRef is null - cannot render product carousel")},this.renderSmartBasket=function(e,t){if(!t?.productsinfo||t?.productsinfo?.length<=0)return;const n=this.prepareJSON(t);e.insertAdjacentHTML("beforeend",`<div class="mb-3">\n <${this.wrapperName}\n ${this.wrapperAttribute}="instant-grocery-basket"\n data-home-targeted="true"\n id="${t.itemName}"\n data-zone-response='${n}'>\n </${this.wrapperName}>\n </div>`),this.bootstrapAngular()},this.renderMealsCarousel=function(e,t,n=!1){"p13n-generic"===t?.mealCarouselType&&(t.webUri=t.ctaLink?t.ctaLink:"");let r=this.prepareJSON(t);if("plannedMealsApi"==t.mealCarouselType){if(!t?.plannedMeals||t?.plannedMeals?.length<=0)return;e.insertAdjacentHTML("beforeend",`<div class="slick-meal-carousel">\n <${this.wrapperName}\n data-targeted-content="true"\n ${n?'data-carousel-behaviour="dynamic-grid-with-facets"':""}\n ${this.wrapperAttribute}="meal-carousel"\n data-carousel-title="${t.title||""}"\n data-carousel-page="${t.pageName}"\n data-carousel-cta-title="${t.mealCarouselCtaTitle||""}"\n data-carousel-cta-link= "${t.mealCarouselCtaLink||""}"data-meals='${r}'\n data-plannedmeals-web="true">\n </${this.wrapperName}>\n </div>`),this.bootstrapAngular()}(t?.hits?.length||t?.savedRecipes?.thumbs?.length)&&("curatedWeb"==t.mealCarouselType&&e.insertAdjacentHTML("beforeend",`<div class="slick-meal-carousel">\n <${this.wrapperName}\n data-targeted-content="true"\n ${this.wrapperAttribute}="meal-carousel"\n ${n?'data-carousel-behaviour="dynamic-grid-with-facets"':""}\n data-carousel-title="${t.title||""}"\n data-carousel-page="${t.pageName}"\n data-carousel-cta-title="${t.curatedWebCtaTitle||""}"\n data-carousel-cta-link="${t.curatedWebCtaLink||""}"\n data-recipe-ids="${t.mealRecipeIds}"\n data-personalized-checkbox="${t.personalizedMeal}"\n data-carousel-max-recipes="${t.totalCount}"data-meals='${r}'data-curated-web="true"\n data-plannedmeals-web="false"\n id="${t.itemName}">\n </${this.wrapperName}>\n </div>`),t.mealCarouselType||"dataDriven"!=t.carouselType||(e.insertAdjacentHTML("beforeend",`<div class="slick-meal-carousel">\n <${this.wrapperName}\n data-targeted-content="true"\n data-carousel-behaviour="dynamic-grid-with-facets"}\n ${this.wrapperAttribute}="meal-carousel"\n data-carousel-title="${t.title||""}"\n data-carousel-page="${t.pageName}"\n data-carousel-cta-title="${t.webCtaText||""}"\n data-carousel-cta-link= "${t.webCtaLink||""}"data-meals='${r}'data-driven-recipes="true"\n data-plannedmeals-web="false">\n </${this.wrapperName}>\n </div>`),this.bootstrapAngular()),"mealsCookbook"===t.mealCarouselType&&e.insertAdjacentHTML("beforeend",`<div class="slick-meal-carousel">\n <${this.wrapperName}\n data-targeted-content="true"\n ${n?'data-carousel-behaviour="dynamic-grid-with-facets"':""}\n ${this.wrapperAttribute}="meal-carousel"\n data-carousel-title="${t.title||""}"\n data-carousel-page="${t.pageName}"\n data-cookbook-id="${t.cookbookId}"\n data-personalized-checkbox="${t.personalizedMeal}"\n data-carousel-max-recipes="${t.totalCount}"data-meals='${r}'data-cookbook-web="true"\n data-plannedmeals-web="false"\n id="${t.itemName}">\n </${this.wrapperName}>\n </div>`),"p13n-generic"===t.mealCarouselType&&e.insertAdjacentHTML("beforeend",`<div class="slick-meal-carousel">\n <${this.wrapperName}\n ${n?'data-carousel-behaviour="dynamic-grid-with-facets"':""} \n data-targeted-content="true"\n ${this.wrapperAttribute}="meal-carousel"\n data-carousel-title="${t.title||""}"\n data-carousel-page="${t.pageName}"\n data-cookbook-id="${t.cookbookId}"\n data-personalized-checkbox="${t.personalizedMeal}"\n data-carousel-max-recipes="${t.totalCount}"data-meals='${r}'data-cookbook-web="true"\n data-plannedmeals-web="false"\n id="${t.itemName}">\n </${this.wrapperName}>\n </div>`),this.bootstrapAngular())},this.bootstrapAngular=function(){let e=0;const t=()=>{const n=window.appConfigServiceRef;if(n?.zone?.run&&n?.service?.initTargetedWrapper)try{n.zone.run(function(){n.service.initTargetedWrapper()}),console.debug("ProductCarousel initialized successfully")}catch(e){console.error("Error initializing ProductCarousel:",e)}else++e<50?setTimeout(t,100):console.warn("appConfigServiceRef not available after 5 seconds - ProductCarousel may not render")};t()}
1,this.renderDealsCarousel=function(e,t,n=!1){const r=this.prepareJSON(t);e.insertAdjacentHTML("beforeend",`<div>\n <${this.wrapperName}\n data-targeted-content="true"\n ${this.wrapperAttribute}="deals-carousel"\n data-carousel-title="${t.title||""}"\n ${n?'data-carousel-behaviour="dynamic-grid-with-facets"':""}\n data-deals-carousel-content='${r}'>\n </${this.wrapperName}>\n </div>`),this.bootstrapAngular()},this.renderMediumBannerWebgen=function(e,t){const n=this.prepareJSON(t);e.insertAdjacentHTML("beforeend",`<div><webgen-banner-unit data-banner-type="medium-banner" class="" data-banner-unit-content='${n}'></webgen-banner-unit></div>`)},this.renderBundlesFullWidth=function(e,t){const n=this.prepareJSON(t);e.insertAdjacentHTML("beforeend",`<div><webgen-bundles data-bundles-content='${n}'></webgen-bundles></div>`)},this.renderBundlesCarousel=function(e,t,n=!1){const r=this.prepareJSON(t);e.insertAdjacentHTML("beforeend",`<div><webgen-bundles-carousel data-bundles-carousel-content='${r}' ${n?'data-carousel-behaviour="dynamic-grid-with-facets"':""}></webgen-bundles-carousel></div>`)},this.addPrdCrslCtaLink=function(e,t){return e.linkTarget&&e.linkText?`<a class="link-sm links__action ml-2" href="${e.linkTarget}" \n aria-label="${e.linkText} - ${e.carouselTitle}${"true"==e.linkOpenMethod?" - opens in a new tab":""}" \n target="${"true"==e.linkOpenMethod?"_blank":"_self"}"\n onclick="window.AB.DATALAYER.setLinkClickViewAllAEMZone('${e.carouselTitle}', '${e.linkText}', '${t}')">\n ${e.linkText}\n </a>`:""},this.renderFlexComponentWebgen=function(e,t){const n=this.prepareJSON(t);e.insertAdjacentHTML("beforeend",`<div><webgen-flex-module class="" data-flex-module-content='${n}'></webgen-flex-module></div>`)},this.renderAbsCarouselComponentWebgen=function(e,t){const n=this.prepareJSON(t);e.insertAdjacentHTML("beforeend",`<div><webgen-abs-carousel data-abs-carousel-content='${n}'></webgen-abs-carousel></div>`)},this.renderHeroIntroWebgen=function(e,t){const n=window.SWY?.CONFIGSERVICE?.featureToggleConfig?.heroIntroV2Enabled&&t.webImageAsset&&new URL(t.webImageAsset)?"webgen-hero-intro-v2":"webgen-hero-intro";e.insertAdjacentHTML("beforeend",`<div><${n} data-hero-intro-content='${this.prepareJSON(t)}'></${n}></div>`)},this.renderStandardIntroWebgen=function(e,t){const n=window.SWY?.CONFIGSERVICE?.featureToggleConfig?.standardIntroV2Enabled&&t.webImageAsset&&new URL(t.webImageAsset)?"webgen-standard-intro-v2":"webgen-standard-intro";e.insertAdjacentHTML("beforeend",`<div><${n} data-standard-intro-content='${this.prepareJSON(t)}'></${n}></div>`)},this.renderHeadlineWebgen=function(e,t){const n=this.prepareJSON(t);e.insertAdjacentHTML("beforeend",`<div><webgen-headline data-headline-content='${n}'></webgen-headline>`)},this.renderBlogComponent=function(e,t){const n=this.prepareJSON(t);e.insertAdjacentHTML("beforeend",`<div><webgen-blog-component data-blog-component='${n}'></webgen-blog-component></div>`)},this.renderRteComponentWebgen=function(e,t){const n=this.prepareJSON(t);e.insertAdjacentHTML("beforeend",`<div><webgen-rich-text data-richtext-content='${n}'></webgen-rich-text></div>`)},this.renderWebgenAccordion=function(e,t){const n=this.prepareJSON(t);e.insertAdjacentHTML("beforeend",`<div><webgen-accordion data-accordion-content='${n}'></webgen-accordion></div>`)},this.renderPerksPanel=function(e,t){const n=this.prepareJSON(t);e.insertAdjacentHTML("beforeend",`<div><webgen-pds-perks-panel data-pds-perks-panel-content='${n}'></webgen-pds-perks-panel></div>`)},this.renderListCardWebgen=function(e,t){const n=this.prepareJSON(t);e.insertAdjacentHTML("beforeend",`<div><webgen-list-card-container data-list-card-container-content='${n}'></webgen-list-card-container></div>`)},this.renderShopByCategory=function(e,t){if(!window.SWY?.CONFIGSERVICE?.featureToggleConfig?.enableShopByCategoryWebgen)return;window.AB?.sponsoredBeaconBridge?.ensureRegistered?.("sbcWebgen");const n=this.prepareJSON(t);e.insertAdjacentHTML("beforeend",`<div><webgen-shop-by-category-component data-shop-by-category='${n}'></webgen-shop-by-category-component></div>`)},this.renderUtilityBar=function(e,t){Array.isArray(t.containerItems)&&t.containerItems.length>
10&&t.containerItems.forEach(t=>{try{t&&"profile"===t.utility?this.renderMeDashboardProfile(e,t):t&&"preferences"===t.utility&&this.customComponentCallbacks.preferences(e,t)}catch(e){console.error("Error rendering utility-bar item",e)}})},this.renderMeDashboardProfile=function(e,t){const n=this.prepareJSON(t);e.insertAdjacentHTML("beforeend",`<div class="pds-me-dashboard-column-container flex-fill">\n <${this.wrapperName}\n data-targeted-content="true"\n ${this.wrapperAttribute}="me-dashboard-profile"\n data-profile-content='${n}'>\n </${this.wrapperName}>\n </div>`),this.bootstrapAngular()},this.renderFlexModuleCarousel=function(e,t){if(0!=window.SWY?.CONFIGSERVICE?.featureToggleConfig?.disableFlexModuleCarousel)return;const n=this.prepareJSON(t);e.insertAdjacentHTML("beforeend",`\n <webgen-carousel data-carousel-content='${n}'></webgen-carousel>\n `)},this.renderHeroCanvasCarousel=function(e,t){const n=this.prepareJSON(t);e.insertAdjacentHTML("beforeend",`<div><webgen-hero-canvas-carousel data-hero-canvas-content='${n}'></webgen-hero-canvas-carousel></div>`)},this.renderBentoCardCarousel=function(e,t){const n=window?.HeroBentoUtils?.transformBentoContainer(t)||[],r=this.prepareJSON({items:n});e.insertAdjacentHTML("beforeend",`<div class="position-relative"><hero-bento-carousel data-props='${r}'></hero-bento-carousel></div>`)},this.renderBundle=function(e,t){const n=this.prepareJSON(t);e.insertAdjacentHTML("beforeend",`<div>\n <${this.wrapperName}\n data-targeted-content="true"\n data-bundle-content='${n}'\n ${this.wrapperAttribute}="bundle">\n </${this.wrapperName}>\n </div>`),this.bootstrapAngular()},this.prepareJSON=function(e){return JSON.stringify(e)?.replace(/'/g,"'")}}},6922:e=>{e.exports=function(){this.init=function(){if(window.AB.COMMON.sessionNotExpired()&&window.AB.COMMON.authorize()){const e="abNgSubscriptions";let t=JSON.parse(localStorage.getItem(e));t&&0==t.isNewSnSUser&&1==t.showHeaderTooltip&&($("#headerTooltip").tooltip("show"),$(document).on("click",function(){$("#headerTooltip").tooltip("hide"),localStorage.setItem(e.showHeaderTooltip,"false")}))}}}},7492:(e,t,n)=>{const r=n(7978);e.exports=function(){let e=this;this.notificationItems={mainSection:".notification-alert",wrapperID:"#notification-alert-wrapper-id",alignmentsList:["middle","left","right"],carouselAlignment:"middle",bodyClass:".notification-alert-wrapper",mobileClose:".notification-alert-wrapper__mobile-close",closeButton:".notification-alert-wrapper__close-button",activePanelSelector:".slick-active .notification-alert-wrapper",visibleMessage:".notification-alert-wrapper:visible",hiddenMessages:".notification-alert-wrapper:hidden",slickArrow:".slick-arrow",slickCurrent:".slick-current",slickActive:".slick-active .notification-alert-wrapper",displayNotification:"displayNotificationComponent"},this.attributes={none:"d-none",defaultAttr:"default",dataPreference:"data-preference",instore:"instore",all:"all",j4u:"j4u",tabindex:"tabindex",top:"top",height:"height",guestUser:"G"};let t={speed:600,slidesToShow:1,arrows:!0,autoplay:!0,autoplaySpeed:6e3,prevArrow:'<button class="slick-prev slick-arrow" aria-label="Previous Notification" type="button" style="">\n<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">\n <g fill-rule="evenodd">\n <g>\n <path d="M17 5.553L9.984 12 17 18.447 15.706 20 7 12 15.706 4z"/>\n </g>\n </g>\n</svg>\n</button>',nextArrow:'<button class="slick-next slick-arrow" aria-label="Next Notification" type="button" style="">\n<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">\n <g fill-rule="evenodd">\n <g>\n <path d="M7 5.553L8.294 4 17 12 8.294 20 7 18.447 14.016 12z"/>\n </g>\n </g>\n</svg>\n</button>'};this.init=()=>{e.notificationAlertAvailable()&&r.readElement(this.notificationItems.mainSection).each(function(){let t=$(this).find(e.notificationItems.wrapperID);e.setMessageBaseOfPreference(t);let n=$(this).find(e.notificationItems.wrapperID)[0],r=$(this).find(e.notificationItems.bodyClass).not(".d-none");if("header"===(n&&n.getAttribute("data-alert-type"))){let o=null===sessionStorage.getItem(e.notificationItems.displayNotification)?"block":"none";if(e.initShowHideComponent(n,o),"block"==o){if(0===r.length)return;1===r.length?e.setTabIndex(n,[e.notificationItems.closeButton],0):e.detachItems(t,n)}}else r.length>0&&e.detachItems(t,n)})},this.initShowHideComponent=(t,n)=>{t.style.display=n,$(this.notificationItems.closeButton).add($(this.notificationItems.mobileClose)).each((t,n)=>{$(n).on("click keypress",t=>
1{("click"===t.type||"keypress"===t.type&&13===t.keyCode)&&(sessionStorage.setItem(e.notificationItems.displayNotification,"false"),document.querySelector(e.notificationItems.wrapperID).style.display="none",setTimeout(()=>{$(".nextgen-abs-carousel-wrapper")[0].focus()},"500"),$(e.notificationItems.wrapperID).hasClass("slick-initialized")&&$(e.notificationItems.wrapperID).slick("unslick"))})})},this.setMessageBaseOfPreference=t=>{let n=AB.userInfo,r=n.preferenceMode.toLowerCase(),o=r===e.attributes.j4u?e.attributes.instore:r;(t&&t.find(e.notificationItems.bodyClass)).each(function(t,r){let i=$(r),s=i.attr(e.attributes.dataPreference);e.checkDefaultUser(n,o)?s.toLowerCase()===e.attributes.defaultAttr&&i.removeClass(e.attributes.none):s&&s.toLowerCase()===o?i.removeClass(e.attributes.none):i.addClass(e.attributes.none),e.showAllPreference(i,s)})},this.checkDefaultUser=function(t,n){let r=AB.userInfo.selectionType,o=SWY.CONFIGSERVICE.storeResolutionConfig;return n===e.attributes.instore&&t.userType===e.attributes.guestUser&&t.branchId===o.bannerDefaultStoreId&&r===e.attributes.defaultAttr},this.detachItems=(t,n)=>{t.find(this.notificationItems.hiddenMessages).each(function(e,t){$(t).detach()}),e.initSlick(t,n)},this.showAllPreference=function(t,n){n===this.attributes.all&&t.removeClass(e.attributes.none)},this.initSlick=(n,r)=>{let o=e.notificationItems.activePanelSelector;n.slick(t),e.slickManipulation(n,r,o),n.on("beforeChange",{that:e},function(e){e.data.that.slickCloseButtonTabIndex(-1,r)}),n.on("afterChange",{that:e,notificationAlertComp:r},function(e){let t=e.data.that,r=e.data.notificationAlertComp,o=t.notificationItems.activePanelSelector;t.slickManipulation(n,r,o)}),e.slickSlidePanelsManipulation(r)},this.slickManipulation=(t,n,r)=>{let o=parseInt(t.find(this.notificationItems.slickActive).css(e.attributes.height))/2;$(e.notificationItems.slickArrow,t).css(this.attributes.top,o+"px"),e.slickArrowsManipulation(n,e.getBackgroundColor(n,r)),e.slickCloseButtonTabIndex(0,n)},this.setTabIndex=(e,t,n)=>{[...e.querySelectorAll(t.join(", "))].forEach(e=>{e.setAttribute("tabindex",n)})},this.slickCloseButtonTabIndex=(t,n)=>{const r=e.notificationItems.wrapperID+" "+e.notificationItems.slickCurrent+" "+e.notificationItems.mobileClose,o=e.notificationItems.wrapperID+" "+e.notificationItems.slickCurrent+" "+e.notificationItems.closeButton;e.setTabIndex(n,[r,o],t)},this.slickArrowsManipulation=(t,n)=>{[...t.querySelectorAll(e.notificationItems.slickArrow)].forEach(t=>{t.style.fill=e.lightOrDark(n||"#000000")})},this.lightOrDark=e=>{var t,n,r;return e.match(/^rgb/)?(t=(e=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/))[1],n=e[2],r=e[3]):(t=(e=+("0x"+e.slice(1).replace(e.length<5&&/./g,"$&$&")))>>16,n=e>>8&255,r=255&e),Math.sqrt(t*t*.299+n*n*.587+r*r*.114)>127.5?"#4B4B4B":"#FFFFFF"},this.slickSlidePanelsManipulation=t=>{[...t.querySelectorAll(e.notificationItems.bodyClass)].forEach(t=>{t.classList.remove(...e.notificationItems.alignmentsList),t.classList.add(e.notificationItems.carouselAlignment)})},this.notificationAlertAvailable=()=>null!==r.readElement($(this.notificationItems.bodyClass)),this.getBackgroundColor=(e,t)=>{e.querySelector(t).style.backgroundColor}}},7595:e=>{const t={preventScroll:function(e){return e.preventDefault(),e.stopPropagation(),!1},mutationObserver:function(e,t){let n=t?$(t).get(0):$("body").get(0);const r=new MutationObserver(e);return r.observe(n,{attributes:!0,childList:!0,subtree:!0}),r}};e.exports=t},7836:(e,t,n)=>{const r=n(7978);e.exports=function(){this.prebookItems={classprebook:".prebook-integration",prebookButton:".reserve-nav__group-2 .reserve-nav__button",slotModalClass:".prebook-slot-modal",prebookSlotTagElem:"app-prebook"};const e="triggerSlotModal";this.init=function(){AB.COMMON.authorize()&&"j4u"!==AB.userInfo.preferenceMode.toLowerCase()&&(this.invokePrebookModal(),this.checkSlotModalLS())},this.invokePrebookModal=function(){let e=r.readElement(this.prebookItems.prebookButton),t=r.readElement(this.prebookItems.slotModalClass);if(e&&t){e=r.getElement(e);const t=this;e.click(function(){let e=$(t.prebookItems.prebookSlotTagElem).get();e.length>
10&&($(e).remove(),e=$(t.prebookItems.prebookSlotTagElem).get()),0===e.length&&t.appendPrebookAttribute()})}},this.checkSlotModalLS=function(){let t=localStorage.getItem(e);t&&"true"===t&&(localStorage.removeItem(e),this.appendPrebookAttribute())},this.getSessionObj=function(){let e={};return e.storeId=AB.userInfo.branchId,e.preference=AB.userInfo.preferenceMode.toUpperCase(),e.expireTime=AB.userInfo.expireTime,e.token=AB.userInfo.SWY_SHOP_TOKEN,JSON.stringify(e)},this.appendPrebookAttribute=function(){let e=r.getElement(this.prebookItems.slotModalClass);const t="<app-prebook data-obj="+this.getSessionObj()+"></app-prebook>";e.append(t)}}},7878:e=>{const t={getHost:function(){let e=window.location.hostname;return e.substr(0,e.indexOf("."))},getDomain:function(e){let t=e.match(/^https:\/\/[^/]+/);return t?t[0]:null},buildHost:function(e){let n=t.getHost(),r=window.location.port,o="";return o=r&&r.length>0?n+"."+e+".com:"+r:n+"."+e+".com",o}};e.exports=t},7978:e=>{const t={readElement:function(e){const t=$(e);return t&&t.length?t:null},readOneElement:function(e){const t=$(e);return t&&t.length?t[0]:null},getElement:function(e){const n=t.readElement(e);if(null===n)throw new Error("Cannot find element: "+e);return n},getMetaElementContent:function(e){const t=$("meta[name="+e+"]");if(null===t)throw new Error("Cannot find element: "+e);return t.attr("content")}};e.exports=t},8474:e=>{const t=function(e,t){if(!Array.isArray(e)||0===e.length)return[];const n=t||(e=>e&&e.eventTracking);return e.map(e=>n(e)).filter(e=>!!e)},n=function(e,t){return!(!e||!t)&&(e instanceof Set?e.has(t):!!Array.isArray(e)&&e.includes(t))},r=function(e,t){e&&t&&!n(e,t)&&(e instanceof Set?e.add(t):Array.isArray(e)&&e.push(t))},o=function({global:e,eventTracking:t,eventName:n,component:r,context:o,retries:i=0,retryDelayMs:s=0}){if(!t)return!1;const a=e||window,l=function(e){return"function"==typeof a.citrusAdTracker?(a.citrusAdTracker(t,n,{component:r,context:o}),!0):(e>0&&a.setTimeout(()=>{l(e-1)},s),!1)};return l(i)};e.exports={buildOnloadDedupKey:function(e,n,r){return n||t(e,r).map(e=>function(e){if(!e)return"";if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(t){return String(e)}}(e)).filter(e=>!!e).sort().join("|")},getEntityTrackingList:t,hasRecord:n,recordKey:r,sendOnloadEvent:function({global:e,entities:i,component:s,context:a,eventName:l="AD_ONLOAD_EVENTS",dedupStore:d,dedupKey:c,eventTrackingSelector:u,retries:p=0,retryDelayMs:m=0}){const h=t(i,u);if(0===h.length)return!1;if(d&&c&&n(d,c))return!1;const f=o({global:e,eventTracking:h,eventName:l,component:s,context:a,retries:p,retryDelayMs:m});return f&&d&&c&&r(d,c),f},sendTrackingEvent:o}},8504:(e,t,n)=>{const r=n(7978),o=n(8813);e.exports=function(){this.stickyItems={header:".unified-header",search:".search-nav",sticky:".unified-header--sticky",stickyClass:"unified-header--sticky",stickyEnabled:".unified-header--sticky-enabled",hidden:"d-none",AISLE_TYPE:".walled-aisle-type"},this.mktpItems={unifiedHeader:".unified-marketplace-header",headerExp:".marketplace-header-expanded",headerCol:".marketplace-header-collapsed",headerExpFull:".marketplace-header-expanded .marketplace-header",headerSticky:".marketplace-header-collapsed--sticky",headerSClass:"marketplace-header-collapsed--sticky",headerAnimation:".marketplace-header__loading-animation",headerColLight:".marketplace-header__header-collapsed-light",categories:".marketplace-header__categories",triggerHeight:".marketplace-header-expanded .marketplace-header__categories"},this.walledItems={unifiedHeader:".unified-walled-header",headerExp:".walled-header-expanded",headerCol:".walled-header-collapsed",headerExpFull:".walled-header-expanded .walled-header__full",headerSticky:".walled-header-collapsed--sticky",headerSClass:"walled-header-collapsed--sticky",headerAnimation:".walled-header__loading-animation",headerColLight:".walled-header__header-collapsed-light",categories:".walled-header__categories",triggerHeight:".walled-header-expanded .walled-categories",searchListCol:".walled-header-collapsed .walled-header__search-list",searchListExp:".walled-header-expanded .walled-header__search-list"},this.crossSellerItems={unifiedHeader:".unified-walled-header",headerExp:".mktp-listing-header-expanded",headerCol:".mktp-listing-header-collapsed",headerExpFull:".mktp-listing-header-expanded .mktp-listing-header__full",headerSticky:".mktp-listing-header-collapsed--sticky",headerSClass:"mktp-listing-header-collapsed--sticky",headerAnimation:".walled-header__loading-animation",headerColLight:".cross-search__header-collapsed-light",categories:".walled-header__categories",triggerHeight:".mktp-listing-header__search__input",searchListCol:".mktp-listing-header-collapsed .mktp-listing-header__search-list",searchListExp:".mktp-listing-header-expanded .mktp-listing-header__search-list"},this.pageItems={persistentBanner:".persistent-promo-banner"},this.init=function(){const e=this;this.zoomLevel,this.isNavigationEngineEnabled=!1,window.SWY&&window.SWY.CONFIGSERVICE?.featureToggleConfig?this.isNavigationEngineEnabled=!window.SWY||!window.SWY.CONFIGSERVICE?.featureToggleConfig?.isNavigationEngineDisabled:SWY.configService?.isNavigationEngineDisabled&&"false"===SWY.configService?.isNavigationEngineDisabled&&(this.isNavigationEngineEnabled=!0),this.stickyHeaderEvent(),this.isNavigationEngineEnabled&&($(document).ready(function(t){if($(window).scrollTop()>0){const t=r.readElement(e.crossSellerItems.headerSticky),n=r.readElement(e.walledItems.headerSticky),o=$(".cross-seller-listing-header"),i=$("#wine-shop-walled-header"),s=$("#marketplace-walled-header");e.scrollDownContent(t,n,o,i,s)}}),window.onload=function(){e.zoomLevel=e.getZoomLevel()},this.applyWindowResize())},this.stickyHeaderEvent=function(){const e=r.readElement(this.stickyItems.stickyEnabled),t=r.readElement(this.stickyItems.search),n=r.readElement(this.mktpItems.unifiedHeader),i=r.readElement(this.mktpItems.headerCol),s=r.readElement(this.walledItems.unifiedHeader),a=r.readElement(this.walledItems.headerCol),l=r.readElement(this.crossSellerItems.unifiedHeader),d=r.readElement(this.crossSellerItems.headerCol);let c,u;if(e&&0!==e.length||t&&0!==t.length)try{let e,p=$(window).scrollTop(),m=0;o.isMobile&&!$("body").hasClass("shop-open")&&$(window).scroll(()=>{null!=t&&(e=t.offset().top),c=r.readElement(this.mktpItems.headerAnimation),u=r.readElement(this.walledItems.headerAnimation),crossAnimation=r.readElement(this.crossSellerItems.headerAnimation);let o=!1;n?.length>0&&i&&!c?(p=this.stickyItemsHandler(p,this.mktpItems),o=!0):s?.length>0&&a&&!u?(p=this.stickyItemsHandler(p,this.walledItems),o=!0):l?.length>0&&d&&!crossAnimation?(p=this.stickyItemsHandler(p,this.crossSellerItems),o=!0):(p=this.stickyHeaderHandler(e,p),o=!1);let h=0;if($(".alerts").length>=1&&(h+=$(".alerts").height()),$(".persistent-promo-banner").length>=1&&(h+=$(".persistent-promo-banner").height()),$(".activeMenu").length>0&&(h=-1),this.isNavigationEngineEnabled){const e=r.readElement(this.crossSellerItems.headerSticky),t=r.readElement(this.walledItems.headerSticky),n=$(".cross-seller-listing-header"),i=$("#wine-shop-walled-header"),s=$("#marketplace-walled-header");if($(".walled-header-collapsed .walled-header")?.removeClass("d-none"),this.zoomLevel<200){(n.length>0||i.length>0)&&($(".s_nav__logo").show(),$(".s_bar__account_link").removeAttr("style"),$(".menu-nav__list-item.last__item").css("margin-top","0px"));const r=window.pageYOffset||document.documentElement.scrollTop;$(".nextgen-abs-carousel-wrapper").length>=1&&(h+=$(".nextgen-abs-carousel-wrapper").height()),$(".notification-alert ").length>=1&&(h+=$(".notification-alert ").height()),r>m?this.scrollDownContent(e,t,n,i,s):r<=h?0!=r&&r>0?this.scrollTopContentWithOffset(e,t):this.scrollTopContentWithZeroOffset():r<m&&(o&&!(e?.length>0||t?.length>0)?this.scrollTopContentWithZeroOffset():this.scrollTopContentWithOffset(e,t)),m=r<=0?0:r}else this.zoomLevel>=200&&($(".s_nav-container").css("position","relative"),i.length>0&&$("#wine-shop-walled-header .walled-header").addClass("d-none").find(".walled-header-collapsed").removeClass("walled-header-collapsed--sticky"),n.length>0&&$(".cross-seller-listing-header").addClass("d-none"),this.scrollTopContentWithZeroOffset())}else $(window).scrollTop()<=h?$(".menu-nav__wrapper").css("position","relative"):$(".menu-nav__wrapper").css("position","fixed")})}catch(e){throw e}},this.getZoomLevel=function(){return window.outerWidth/window.innerWidth*100},this.applyWindowResize=function(){const e=this;$(window).resize(function(){e.zoomLevel=e.getZoomLevel(),console.warn("Zoom Level: ",e.zoomLevel)})},this.scrollTopContentWithOffset=function(e,t){window.innerWidth<=1024?($(".s_nav__logo").show(),$(".svg-hamburger-icon").show(),$(".s_bar__account_link").removeAttr("style"),$("secondary-bar").removeClass("unified-header--sticky").addClass("slide-down"),(e?.length>0||t?.length>0)&&($("secondary-bar").removeClass("slide-down"),$(e)?.css("top","84px"),$(t)?.css("top","84px"),$(".menu-nav__list-item.last__item").css("margin-top","0px"))):($(".s_nav_fulfillment-desktop").removeClass("d-none"),$(".tertiary-bar-proxy.tertiary-bar").addClass("sticky-tertiary-bar"),$("secondary-bar .search-nav__search-form").removeClass("slide-left").addClass("slide-right"),$(e)?.css("top","108px"),$(t)?.css("top","108px")),$(".s_nav-container").addClass("sticky-secondary-bar"),$(".primary-bar-proxy.primary").addClass("sticky-primary-bar")},this.scrollTopContentWithZeroOffset=function(){window.innerWidth<=1024?($(".s_nav__logo").show(),$(".svg-hamburger-icon").show(),$(".s_bar__account_link").removeAttr("style"),$("secondary-bar").removeClass("unified-header--sticky").addClass("slide-down"),$(".primary-bar-proxy.primary").removeClass("sticky-primary-bar")):($(".
1s_nav_fulfillment-desktop").removeClass("d-none"),$("secondary-bar .search-nav__search-form").removeClass("slide-left").addClass("slide-right"),$(".tertiary-bar-proxy.tertiary-bar").removeClass("sticky-tertiary-bar")),$(".s_nav-container").removeClass("sticky-secondary-bar"),$(".primary-bar-proxy.primary").removeClass("sticky-primary-bar"),$(".s_nav-container").css("position","relative")},this.scrollDownContent=function(e,t,n,r,o){window.innerWidth<=1024?(n?.length>0||r?.length>0||o?.length>0?($("secondary-bar").css("padding","4px 8px"),$(".s_nav__logo").show(),$(".s_bar__account_link").removeAttr("style"),$(".menu-nav__list-item.last__item").css("margin-top","0px"),$(t)?.css("top","40px"),$(e)?.css("top","40px")):($(".s_nav__logo").hide(),$(".svg-hamburger-icon").hide(),$(".s_bar__account_link").attr("style","display: none !important")),$("secondary-bar").addClass("unified-header--sticky")):($(".s_nav_fulfillment-desktop").addClass("d-none"),$("secondary-bar .search-nav__search-form").addClass("slide-left").removeClass("slide-right"),$(".tertiary-bar-proxy.tertiary-bar").removeClass("sticky-tertiary-bar"),$(t)?.css("top","72px"),$(e)?.css("top","72px")),$(".s_nav-container").removeClass("sticky-secondary-bar slide-down"),$(".primary-bar-proxy.primary").removeClass("sticky-primary-bar"),$(".s_nav-container").css("position","fixed")},this.stickyHeaderHandler=function(e,t){const n=r.getElement(this.stickyItems.header),o=this.stickyItems.stickyClass;let i=r.readElement(this.stickyItems.sticky);e=e||0,t=t||0;let s=Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop),a=!1;null!=i&&(a=i.length>0);let l=t>s;return t<s&&!a&&e<=s?(n.addClass(o),i=r.getElement(this.stickyItems.sticky)):l&&a&&e>s||0===e&&0===s?n.removeClass(o):l&&a&&this.isNavigationEngineEnabled,s},this.stickyItemsHandler=function(e,t){const n=r.readElement(t.headerCol),o=r.readElement(t.headerExp),i=t.headerSClass,s=r.readElement(t.headerExpFull),a=r.readElement(t.headerColLight),l=r.readElement(this.pageItems.persistentBanner),d=r.readElement(this.stickyItems.stickyEnabled),c=r.readElement(t.searchListCol),u=r.readElement(t.searchListExp),p=r.readElement(t.unifiedHeader);let m,h=r.readElement(t.headerSticky);const f=window.SWY&&window.SWY.CONFIGSERVICE&&window.SWY.CONFIGSERVICE.featureToggleConfig&&window.SWY.CONFIGSERVICE.featureToggleConfig.isAisleL2L4Disabled,g=document.querySelector(this.stickyItems.AISLE_TYPE);let y=r.readElement(t.triggerHeight);f&&g&&!y&&(y=r.readElement(this.walledItems?.triggerHeight)),s?.length>0&&(m=y?.hasClass(this.stickyItems.hidden)?s?.offset().top:y?.offset().top),a?.length>0&&(m=a?.offset().top),m=m||0,e=e||0;let C=Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop),v=!1;h?.length&&(v=h.length>0);let b=e>C;if(e<C&&!v&&m<=C){let e;n.addClass(i),a||(n.parent().removeClass(this.stickyItems.hidden),u&&u.addClass(this.stickyItems.hidden)),h=r.readElement(t.headerSticky),this.isNavigationEngineEnabled?(e=p?.height(),p&&p.length>0?this.stickyTopHandler(h,e):d?.length&&this.stickyTopHandler(h,d.height())):(e=l?o?.offset().top-l.height():o?.offset().top,o&&o.length>0?this.stickyTopHandler(h,e):d?.length&&this.stickyTopHandler(h,d.height()))}else(b&&v&&m>C||0===m&&0===C)&&this.scrollUpHandler(n,a,i,c);return C},this.stickyTopHandler=function(e,t){e.attr("style","top:"+t+"px")},this.scrollUpHandler=function(e,t,n,r){e.removeClass(n),t||(e.parent().addClass(this.stickyItems.hidden),r&&r.addClass(this.stickyItems.hidden))}}},8813:e=>{const t={isMobile:function(){let e=navigator.userAgent;return device=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e),!!device}};e.exports=t},9071:e=>{const t={isABTestEnabled:(e="",n="",r="")=>{let o=!1;if(""===window.AB[n])try{if(t.isLSCompatible()){const t=localStorage.getItem(`EOT_${e}`);window.AB[n]=t?t===`EOT-${e}_${r}_New`:o}else window.analyticsSwy&&window.analyticsSwy.testFlags&&window.analyticsSwy.testFlags[`EOT_${e}`]?window.AB[n]=window.analyticsSwy.testFlags[`EOT_${e}`]===`EOT-${e}_${r}_New`:window.AB[n]=o}catch(e){window.AB[n]=o}return window.AB[n]},getABtestGroup:(e="",n="")=>{if(""===window.AB[n]){let r=-1;if(t.isLSCompatible()&&(r=localStorage.getItem(`EOT_${e}`)),-1==r||null==r||""===r)try{r=window.analyticsSwy.testFlags[`EOT_${e}`]}catch(e){r="control"}window.AB[n]=r}return window.AB[n]},getEOTFlag:(e="")=>{let t;return t=window.analyticsSwy&&window.analyticsSwy.testFlags&&window.analyticsSwy.testFlags["EOT_"+e]?window.analyticsSwy.testFlags["EOT_"+e]:"EOT_"+e+"_false",t},getEOTValueById:(e="")=>{let t=null;return""===e?t:window.analyticsSwy&&window.analyticsSwy.testFlags&&window.analyticsSwy.testFlags[e]?(t=window.analyticsSwy.testFlags[e],t):t},checkABTestCategoryTilesL3:()=>{const e="1038",n=`EOT-${e}_show_images`,r=`EOT-${e}_show_texttiles`,o="defaultView",i="circleView",s="rectangleView",a=(e="")=>{switch(!0){case e===n:return i;case e===r:return s;default:return o}};if(""===window.AB.categoryTileL3Test)try{if(window.analyticsSwy&&window.analyticsSwy.testFlags&&window.analyticsSwy.testFlags[`EOT_${e}`])window.AB.categoryTileL3Test=a(window.analyticsSwy.testFlags[`EOT_${e}`]);else if(t.isLSCompatible()){const t=localStorage.getItem(`EOT_${e}`);window.AB.categoryTileL3Test=t?a(t):o}else window.AB.categoryTileL3Test=o}catch(e){window.AB.categoryTileL3Test=o}return window.AB.categoryTileL3Test},isLSCompatible:()=>window.SWY.CONFIGSERVICE.isLSCompatible(),dispatchCustomEvent:(e,t)=>
1{const n=new CustomEvent(e,t);document.dispatchEvent(n)},checkEOTEnableByIdAndValue:(e,n)=>{let r;const o="ABTest_"+e,i=t.getEOTValueById(e);null!=i?(r=i===n,t.dispatchCustomEvent(o,{detail:{eotflag:r}})):window.addEventListener(e,function(i){console.warn("== AR TARGET "+e+" EVENT RECEIVED",i),r=i.detail[e]===n,t.dispatchCustomEvent(o,{detail:{eotflag:r}})},{once:!0})},getABTestValue:(e,t,n)=>{if(window.SWY.CONFIGSERVICE.featureToggleConfig?.[t])return localStorage.removeItem(e),"a";{const t=localStorage.getItem(e);return t||(window?.analyticsSwy?.testFlags?.[n]?window.analyticsSwy.testFlags[n]:"a")}}};e.exports=t},9455:e=>{e.exports=function(){this.init=()=>{if(this.getInstorePickupComp()){const e=new Headers({"Ocp-Apim-Subscription-Key":window.SWY?.CONFIGSERVICE?.bringgConfig?.["apim.key.pickup"]}),t=new URLSearchParams(window.location.search),n=t.get("ffm")?t.get("ffm"):"";if(!n)return document.querySelector(".instore-pickup__order-ID-missing").classList.remove("d-none"),document.querySelector(".instore-pickup__details-wrapper").classList.add("d-none"),document.querySelector("#instore-pickup-component").classList.remove("d-none"),document.querySelector("#instore-pickup-spinner").classList.add("d-none"),void document.querySelector(".instore-pickup__order-scan").classList.add("d-none");const r=`${window.SWY?.CONFIGSERVICE?.bringgConfig?.basepath}${window.SWY?.CONFIGSERVICE?.bringgConfig?.["instore.pickup.path"]}?ffmOrderId=${n}`;fetch(r,{method:"GET",headers:e}).then(e=>(e.ok||(document.querySelector("#instore-pickup-component").classList.remove("d-none"),document.querySelector("#instore-pickup-spinner").classList.add("d-none"),document.querySelector(".instore-pickup__server-down-wrapper").classList.remove("d-none"),document.querySelector(".instore-pickup__details-wrapper").classList.add("d-none"),document.querySelector(".instore-pickup__order-scan").classList.add("d-none")),e.json())).then(function(e){if(document.querySelector("#instore-pickup-component").classList.remove("d-none"),document.querySelector("#instore-pickup-spinner").classList.add("d-none"),"Completed"===e.customerPickupStatus){document.querySelector(".instore-pickup__order-completed").classList.remove("d-none"),document.querySelector(".instore-pickup__details-wrapper").classList.add("d-none"),document.querySelector(".instore-pickup__order-scan").classList.add("d-none");const t=document.querySelector("#instore-pickup-number"),n=e.storeInfo.dugVirtualNumber.toString();t.innerHTML=`+1${n.substring(0,3)}-${n.substring(3,6)}-${n.substring(6)}`,t.setAttribute("href",`tel:+1${n}`)}else{const t=document.querySelector("#instore-pickup-component");t.querySelector("#pickup-location").innerHTML=e.name,t.querySelector("#pickup-code").innerHTML=e.pickupCode,t.querySelector("#instore-pickup-image").src=e.qrCodeUrl,t.querySelector("#pickup-order-fulfillement-id").innerHTML=e.ffmOrderId,t.querySelector("#pickup-order-id").innerHTML=e.orderId,t.querySelector("#pickup-order-street1").innerHTML=e.storeInfo.storeAddress.addressLine1;const n=`${e.storeInfo.storeAddress.city}, ${e.storeInfo.storeAddress.state} ${e.storeInfo.storeAddress.zip}`;t.querySelector("#pickup-order-street2").innerHTML=n}}).catch(e=>{})}},this.getInstorePickupComp=()=>document.querySelector("#instore-pickup-component")}},9579:(e,t,n)=>{const r=n(7978),o=n(9744),i=n(1316),s=o.createSafely(i.prototype);e.exports=function(){this.shoppingPreferencesItems={fulFillMentModalClass:".reserve-nav__row .open-fulfillment-modal",fulFillMentModalClassNav:".s_nav_fulfillment_address-container.open-fulfillment-modal",fulfillment_storeAddr:".s_nav_fulfillment_address .s_nav_fulfillment_address-container span.address-text",fulfillment_link_reserve:".s_nav_fulfillment_link.fulfillment_link_reserve",fulfillment_link_storeInfo:".s_nav_fulfillment_link.fulfillment_link_storeInfo",fulfillment_linkSprtr:".s_nav_fulfillment_links .fulfillment_link-separator",fulfillment_addressSkeleton:".s_nav_fulfillment_address-skeleton",fullfilment_store_lg:".s_nav_fullfilment_store_lg",fulfillment_flashIcon:".svg-flash-icon",fulfilment_right_icon:".s-nav-icon-right",fulfillment_loading_text:".s_nav_fulfillment_loading-text",instorePreference:"j4u",pickupPreference:"dug",hamburgerMenuIcon:".svg-hamburger-icon.s_nav__hamburger_menu, .secondary-bar-hamburger",fulfillmentContainer:".drawer.sidebar_drawer .s_nav_fulfillment",sidebar_drawer:".drawer.sidebar_drawer",sidebar_drawer_channel:".drawer.sidebar_drawer .s_nav__channel",chooseStoreText:"Cho
1ose store",chooseStorePickupText:"Choose store for pickup",storeInfoText:"Hours & info",storeInfoTextDelivery:"Store hours & info",reserveText:"Reserve",reserveTextDeliveryB2b:"View delivery times",reserveTextPickupB2b:"View pickup times",fulfillment_nav:".s_nav_fulfillment",zipCode:".s_nav_fulfillment_address-text"},this.init=function(){this.isb2bPrebookRevisedEnabled=!(!window.SWY||!window.SWY.CONFIGSERVICE?.featureToggleConfig?.isB2BRevisedPreboookEnabled);let e=!1;if(window.SWY&&window.SWY.CONFIGSERVICE?.featureToggleConfig?e=!window.SWY||!window.SWY.CONFIGSERVICE?.featureToggleConfig?.isNavigationEngineDisabled:SWY.configService?.isNavigationEngineDisabled&&"false"===SWY.configService?.isNavigationEngineDisabled&&(e=!0),e&&null!==r.readElement(this.shoppingPreferencesItems.fulfillment_nav)){const e=document.querySelector("global-header.syndicate-header");this.deleteGeoCookie(),this.populateShoppingPreferences(),e||this.triggerFulFillMentModal(),this.toggleSideBarDrawer(),this.handleResize(),this.showHideFulfillment(),this.restoreReserveSlotAfterRefresh()}},this.restoreReserveSlotAfterRefresh=function(){window?.AB?.ALERT?.checkReserveTime?.()},this.handleEditOrderFlow=()=>{AB?.COMMON?.checkPendingOrder()&&($(".s_nav_fulfillment-container.s_nav_fulfillment-desktop")?.hide(),$(".s_nav__channel")?.[0]?.style.setProperty("display","none","important"))},this.setAdaVisibilityOfNonModalElements=function(e){$("h1.hidden-title, .notification-alert").attr("aria-hidden",e),$('[data-section-name="home-hero-carousel"]').closest(".responsivegrid").attr("aria-hidden",e)},this.triggerFulFillMentModal=function(){const e=this.shoppingPreferencesItems.fulFillMentModalClassNav,t=r.getElement("#fulFillMentAddressNav"),n=r.getElement("#fulFillMentAddressNavMobile"),o=r.getElement(this.shoppingPreferencesItems.fulfillment_link_reserve);let i=r.getElement(e);if(i&&i.length>0){const e=()=>{window.storeFulfillmentModal&&window.storeFulfillmentModal.zone.run(()=>{window.storeFulfillmentModal.component.setModalDisplayData()}),AB.DATALAYER&&AB.DATALAYER.setLinkClickEvents("changeFulfillmentLink"),$("#fulfillmentSidebar").addClass("d-none").modal("hide"),this.setAdaVisibilityOfNonModalElements("false")};i.on("click",e);const r=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e())};t.on("keydown",r),n.on("touchstart",function(t){document.activeElement===this&&e()}),n.on("keypress",r)}o.click(e=>{e?.preventDefault(),this.viewportSize=$(window).width(),this.viewportSize>=372&&this.viewportSize<=1024&&($("#fulfillmentSidebar").addClass("d-none").modal("hide"),this.setAdaVisibilityOfNonModalElements("false"))})},this.parseSessionCookie=function(e){if(!e)return null;try{return JSON.parse(decodeURIComponent(e))}catch(t){try{return JSON.parse(e)}catch(e){return null}}},this.getPendingConflictSession=function(e){const t=this.parseSessionCookie(SWY.CONFIGSERVICE.getCookie("abs_gsession")),n=SWY.CONFIGSERVICE.getResolvedBanner()?.toLowerCase(),r=t?.info?.COMMON?.banner?.toLowerCase(),o=e?.info?.J4U?.preferredBanner?.toLowerCase();return r&&n&&r===n&&o&&o!==n?t:null},this.mapSessionToSyndUserInfo=function(e){const t=e?.info?.COMMON?.preference||"",n="j4u"===t.toLowerCase()?e.info.J4U:e.info.SHOP;return{storeAddress:n.address||"",storeId:n.storeId||"",storeZip:n.zipcode||"",preference:t}},this.populateShoppingPreferences=function(){const e=r.getElement(this.shoppingPreferencesItems.fulfillment_storeAddr),t=r.getElement(this.shoppingPreferencesItems.fulfillment_link_reserve),n=r.getElement(this.shoppingPreferencesItems.fulfillment_link_storeInfo),o=r.getElement(this.shoppingPreferencesItems.fulfillment_linkSprtr),i=r.getElement(this.shoppingPreferencesItems.fulfillment_addressSkeleton),a=r.getElement(this.shoppingPreferencesItems.fulfillment_loading_text),l=r.getElement(this.shoppingPreferencesItems.fulfilment_right_icon);let d=SWY.CONFIGSERVICE.getCookie("SWY_SHARED_SESSION_INFO"),c=SWY.CONFIGSERVICE.getCookie("SWY_SYND_USER_INFO");const u=this.parseSessionCookie(d)||{},p=this.getPendingConflictSession(u),m=document.querySelector("global-header.syndicate-header");let h=!1;if(d.length>1||c.length>1?h=!0:(u={},m&&m.classList.add("fulfillment-error")),["/erums/store/prebook","/erums/order/edit/checkout/confirmation","/erums/order/confirmation"].some(e=>window.location.pathname.includes(e))&&$("global-header").addClass("erums-header"),s.init(),h)if(m){let r=p?this.mapSessionToSyndUserInfo(p):c?.length>0?JSON.parse(c):{},s="d-none";if(Object.keys(r).length>0){let d=r.storeId;storeAddress=StoreAddressComp.storeAddress(d);let c=r.preference.toLowerCase();this.toggleLoading(c,a,i,l,o,!0),""!==storeAddress&&"Store not found"!==storeAddress&&"undefined"!=typeof storeAddress||(this.toggleLoading(c,a,i,l,o,!1),"j4u"===r.preference.toLowerCase()?(storeAddress=this.shoppingPreferencesItems.chooseStoreText,e.html(storeAddress),storeInfoText=this.shoppingPreferencesItems.storeInfoText,n.html(storeInfoText),o.addClass(s),$(".s_nav_fulfillment_links > *").css("margin-right","0px"),$(".s_nav_intent-icon").addClass("svg-instore-icon"),t.addClass(s)):"delivery"===r.preference.toLowerCase()?(address=r.storeZip,storeAddress=`Delivery to ${address}`,storeInfoText=this.shoppingPreferencesItems.storeInfoTextDelivery,$(".s_nav_intent-icon").addClass("svg-delivery-icon"),reserveText="B"===AB.userInfo.siteType?this.shoppingPreferencesItems.reserveTextDeliveryB2b:this.shoppingPreferencesItems.reserveText,this.handlePreference(e,t,n,storeAddress,reserveText,storeInfoText)):"dug"===r.preference.toLowerCase()&&(storeAddress=this.shoppingPreferencesItems.chooseStorePickupText,reserveText="B"===AB.userInfo.siteType?this.shoppingPreferencesItems.reserveTextPickupB2b:this.shoppingPreferencesItems.reserveText,storeInfoText=this.shoppingPreferencesItems.storeInfoText,$(".s_nav_intent-icon").addClass("svg-pickup-icon"),this.handlePreference(e,t,n,storeAddress,reserveText,storeInfoText))),r&&"j4u"===r.preference.toLowerCase()&&storeAddress&&(this.toggleLoading(c,a,i,l,o,!1),storeInfoText=this.shoppingPreferencesItems.storeInfoText,n.html(storeInfoText),o.addClass(s),t.addClass(s),e.html(storeAddress),$(".s_nav_intent-icon").addClass("svg-instore-icon"),$(".s_nav_fulfillment_links > *").css("margin-right","0px"),e.attr("aria-label",`Instore at ${storeAddress}`)),r&&"delivery"===r.preference.toLowerCase()&&r.storeZip&&(this.toggleLoading(c,a,i,l,o,!1),address=r.storeZip,storeAddress=`Delivery to ${address}`,reserveText="B"===AB.userInfo.siteType?this.shoppingPreferencesItems.reserveTextDeliveryB2b:this.shoppingPreferencesItems.reserveText,storeInfoText=this.shoppingPreferencesItems.storeInfoTextDelivery,$(".s_nav_intent-icon").addClass("svg-delivery-icon"),e.attr("aria-label",storeAddress),t.attr("tab-index","0"),this.handlePreference(e,t,n,storeAddress,reserveText,storeInfoText),t.attr("aria-label",reserveText)),r&&"dug"===r.preference.toLowerCase()&&storeAddress&&(this.toggleLoading(c,a,i,l,o,!1),storeAddress=`Pickup at ${storeAddress}`,reserveText="B"===AB.userInfo.siteType?this.shoppingPreferencesItems.reserveTextPickupB2b:this.shoppingPreferencesItems.reserveText,storeInfoText=this.shoppingPreferencesItems.storeInfoText,$(".s_nav_intent-icon").addClass("svg-pickup-icon"),e.attr("aria-label",storeAddress),t.attr("tab-index","0"),this.handlePreference(e,t,n,storeAddress,reserveText,storeInfoText),t.attr("aria-label",reserveText)),a?.addClass("d-none"),i?.addClass("d-none")}else m.classList.add("fulfillment-error")}else{p&&(u.info=p.info);let r="d-none",s="",d="",c="",m=u.info.SHOP.storeId;if("j4u"===u.info.COMMON.preference.toLowerCase()&&(m=u.info.J4U.storeId),Object.keys(u).length>0){let p=u.info.COMMON.preference.toLowerCase();if(this.toggleLoading(p,a,i,l,o,!0),c=StoreAddressComp.storeAddress(m),""===c||"Store not found"===c||void 0===c){if(this.toggleLoading(p,a,i,l,o,!1),p===this.shoppingPreferencesItems.instorePreference)c=this.shoppingPreferencesItems.chooseStoreText,e.html(c),s=this.shoppingPreferencesItems.storeInfoText,n.html(s),o.addClass(r),$(".s_nav_fulfillment_links > *").css("margin-right","0px"),$(".s_nav_intent-icon").addClass("svg-instore-icon"),t.addClass(r);else if(p===this.shoppingPreferencesItems.pickupPreference)c=this.shoppingPreferencesItems.chooseStorePickupText,d="B"===AB.userInfo.siteType?this.shoppingPreferencesItems.reserveTextPickupB2b:this.shoppingPreferencesItems.reserveText,s=this.shoppingPreferencesItems.storeInfoText,$(".s_nav_intent-icon").addClass("svg-pickup-icon"),this.handlePreference(e,t,n,c,d,s);else if("delivery"===p){const r=this.getDeliveryAddress();address=r||window.AB.userInfo.zipcode,c=`Delivery to ${address}`,s=this.shoppingPreferencesItems.storeInfoTextDelivery,$(".s_nav_intent-icon").addClass("svg-delivery-icon"),d="B"===AB.userInfo.siteType?this.shoppingPreferencesItems.reserveTextDeliveryB2b:this.shoppingPreferencesItems.reserveText,this.handlePreference(e,t,n,c,d,s)}}else{if(this.toggleLoading(p,a,i,l,o,!1),c.indexOf(",")>-1&&(c=c.substring(0,c.indexOf(","))),c=c.replace(/\+/g," ").substring(0,26),"j4u"===p)s=this.shoppingPreferencesItems.storeInfoText,n.html(s),o.addClass(r),t.addClass(r),e.html(c),$(".s_nav_intent-icon").addClass("svg-instore-icon"),$(".s_nav_fulfillment_links > *").css("margin-right","0px"),e.attr("aria-label",`Instore at ${c}`);else if("delivery"===p){const r=this.getDeliveryAddress();address=r?r.substring(0,26):window.AB.userInfo.zipcode,c=`Delivery to ${address}`,d="B"===AB.userInfo.siteType?this.shoppingPreferencesItems.reserveTextDeliveryB2b:this.shoppingPreferencesItems.reserveText,s=this.shoppingPreferencesItems.storeInfoTextDelivery,$(".s_nav_intent-icon").addClass("svg-delivery-icon"),e.attr("aria-label",c),t.attr("tab-index","0"),this.handlePreference(e,t,n,c,d,s)}else"dug"===p&&(c=`Pickup at ${c}`,d="B"===AB.userInfo.siteType?this.shoppingPreferencesItems.reserveTextPickupB2b:this.shoppingPreferencesItems.reserveText,s=this.shoppingPreferencesItems.storeInfoText,$(".s_nav_intent-icon").addClass("svg-pickup-icon"),e.attr("aria-label",c),t.attr("tab-index","0"),this.handlePreference(e,t,n,c,d,s));t.attr("aria-label",d)}}}},this.handlePreference=function(e,t,n,r,o,i){e.html(r),t.click(e=>{e?.preventDefault(),window.AB.COMMON.authorize()?SWY.CONFIGSERVICE.enablePrebookSlotModal()||this.redirectToPrebookPage():this.handleUnauthorizedUser()}),t.html(o),n.html(i)},this.handleUnauthorizedUser=function(){AB.COMMON.openAuthenticateModal("signIn"),AB.isLSEnabled&&localStorage.setItem("redirectToErums",1)},this.redirectToPrebookPage=function(){const e=AB.COMMON.removeURLParameterByName(window.location.search,"q");window.location=`/erums/store/prebook${e}`},this.setTextForRevisedB2bCTA=function(e){const t=r.readElement(this.shoppingPreferencesItems.b2bReserveNavBtn),n=this.shoppingPreferencesItems.b2bRevisedPrebookCTA.replace("{delivery}",e);t&&t.length>0&&t.text(n)},this.getDeliveryAddress=function(){if("delivery-addr"===AB?.userInfo?.resolvedBy){if(window.AB?.COMMON?.authorize()){const e=SWY.CONFIGSERVICE.getCookie("SWY_SHARED_PII_SESSION_INFO");let t={};try{t=e?JSON.parse(e):{}}catch(e){console.error("Error parsing cookie value:",e)}const n=t?.deliveryAddr;let r=n?.split(",")?.[0];return r="null"===r?n.match(/\d+/g)?.[0]:r.replace(/\+/g," "),r}{const e=AB.COMMON.getGeoCookieName(),t=SWY.CONFIGSERVICE.getCookie(e);let n={};try{n=t?JSON.parse(t):{}}catch(e){console.error("Error parsing cookie value:",e)}return this.updateGeoCookieExpirationTime(e,n),n?.adr1}}},this.toggleLoading=function(e,t,n,r,o,i){let s="";"delivery"===e?s="Delivery to":"dug"===e&&(s="Pickup at");const a=i?"removeClass":"addClass";t[a]("d-none"),n[a]("d-none"),r[i?"addClass":"removeClass"]("d-none"),o[i?"addClass":"removeClass"]("d-none"),i&&t.html(s)},this.deleteGeoCookie=function(){window.addEventListener("OneTrustGroupsUpdated",e=>{const t=e&&e.detail;!t||t.includes("C0003")||window.AB.COMMON.authorize()||(document.cookie=AB.COMMON.getGeoCookieName()+"=; expires=Thu, 05-Mar-1992 00:00:01 GMT; path=/;",!document.querySelector("global-header.syndicate-header")&&"delivery"===AB?.userInfo?.preferenceMode?.toLowerCase()&&$(this.shoppingPreferencesItems.zipCode)?.length>0&&r.getElement(this.shoppingPreferencesItems.zipCode).html("Delivery to "+window.AB?.userInfo?.zipcode))},{once:!0})},this.updateGeoCookieExpirationTime=function(e,t){if(t&&t.adr1){const n=new Date,r=45;n.setTime(n.getTime()+60*r*1e3);const o=`expires=${n.toUTCString()}`,i=encodeURIComponent(JSON.stringify(t));document.cookie=`${e}=${i}; ${o}; path=/;`}},this.toggleSideBarDrawer=function(){const e=r.getElement(this.shoppingPreferencesItems.hamburgerMenuIcon),t=r.getElement(this.shoppingPreferencesItems.sidebar_drawer),n=r.getElement(this.shoppingPreferencesItems.sidebar_drawer_channel);e?.click(o=>{o.stopPropagation(),$("#fulfillmentSidebar").removeClass("d-none").modal("show"),this.setAdaVisibilityOfNonModalElements("true"),$(".search-suggestion-container").hide(),$(".search-suggestion-container li").removeClass("selected"),$(".search-suggestion-container-auto").hide(),e.attr("aria-expanded","true");let i=window.outerWidth/window.innerWidth*100;if(window.outerWidth<=1024||i>=150){$(".closeBtn").focus(),$(".closeBtn").click(()=>{$(n).is(o.target)||0!==$(n).has(o.target).length||($(t).addClass("d-none"),$("#fulfillmentSidebar").modal("hide"),e.focus(),e.attr("aria-expanded","fal
1se"),this.setAdaVisibilityOfNonModalElements("false"))}),mobileCategoryHeader=r.getElement(".s_nav_mobile_header"),fulfillmentDetails=r.getElement(".s_nav__channel"),toolBoxMobile=r.getElement(".t_nav__toolbox-mobile"),campaignLink=document.querySelector(".t_nav__campaign")?r.getElement(".t_nav__campaign"):null;const i=document.querySelectorAll(".t_nav__categories_item");$(".t_nav__categories")?.css("visibility","visible"),$(".categories-item__drilldown")?.css("visibility","hidden"),fulfillmentDetails?.removeClass("d-none")?.addClass("d-flex"),toolBoxMobile?.removeClass("d-none"),campaignLink?.removeClass("d-none")?.addClass("d-flex"),mobileCategoryHeader?.addClass("d-none"),i?.forEach(e=>{e?.classList?.remove("d-none");const t=e?.querySelectorAll(".t_nav__dd__parent-list > li"),n=Array.from(t||[]).filter(e=>e.querySelector("ul"));n?.forEach(e=>{e?.classList?.remove("active");const t=e?.querySelector(".t_nav__dd-child"),n=e?.querySelector(".t_nav__dd__item__color"),r=e?.querySelector(".t_nav__dd__item__color span");t&&t.style.setProperty("display","none","important"),r?.classList.remove("s-accordion-expand-icon"),r?.classList.add("s-accordion-collapse-icon"),n.setAttribute("aria-expanded",!1)})})}}),document.addEventListener("keydown",function(t){"Escape"!==t.key&&27!==t.keyCode||e.attr("aria-expanded","false"),document.removeEventListener("keydown",arguments.callee)}),t.on("click",function(e){e.stopPropagation()})},this.handleResize=function(){$(window).resize(()=>{this.showHideFulfillment(),this.toggleSideBarDrawer()})},this.showHideFulfillment=function(){let e="d-none";r.getElement(this.shoppingPreferencesItems.fulfillmentContainer);const t=r.getElement(this.shoppingPreferencesItems.fullfilment_store_lg);this.viewportSize=$(window).width(),this.viewportSize>1024&&($("#fulfillmentSidebar").addClass("d-none").modal("hide"),this.setAdaVisibilityOfNonModalElements("false"),t.removeClass(e)),this.viewportSize>=372&&this.viewportSize<=1024&&t.addClass(e),this.handleEditOrderFlow()}}},9744:e=>{const t={createSafely:function(e){try{const t=Object.create(e);return t.constructor.apply(t),t}catch(t){return console.log(e.constructor.name+" creation failed",t),null}},getPathValue:(e,t)=>{const n=t?t.split("."):[];if(e&&n.length>0){let t=e;return n.forEach(e=>{t=t&&t.hasOwnProperty(e)&&t[e]?t[e]:null}),t||""}return""},isObjectEmpty:e=>null==e||0===Object.keys(e).length};e.exports=t}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}const r=n(9744),o=n(7978),i=n(458),s=n(8504),a=n(6140),l=n(1316),d=n(6592),c=n(253),u=n(5746),p=n(4131),m=n(5807),h=n(2363),f=n(3403),g=n(3706),y=n(7836),C=n(1779),v=n(3743),b=n(7492),_=n(9455),w=n(5341),S=n(2499),I=n(5648),E=n(6868),A=n(9579),O=n(6482),k=n(6922);n(4929),n(3462);let M=r.createSafely(i.prototype),T=r.createSafely(s.prototype),N=r.createSafely(l.prototype),x=r.createSafely(S.prototype),B=r.createSafely(a.prototype);NavShoppingPreferencesComp=r.createSafely(A.prototype),MenuNavigationComp=r.createSafely(O.prototype),PastOrdersComp=r.createSafely(c.prototype),StoreAddressComp=r.createSafely(u.prototype),conflictModalComp=r.createSafely(d.prototype),userActionComp=r.createSafely(p.prototype),closedStoreComp=r.createSafely(h.prototype),MergeAcctModalComp=r.createSafely(f.prototype),OMS_OrderSummaryComp=r.createSafely(m.prototype),editOrderComp=r.createSafely(g.prototype),a11yComp=r.createSafely(C.prototype),prebookSlotsInvoke=r.createSafely(y.prototype),rightDrawerComp=r.createSafely(v.prototype),NotificationAlertComp=r.createSafely(b.prototype),InstorePickupComp=r.createSafely(_.prototype),NavigationComp=r.createSafely(w.prototype),zoneTargetedContentV2Comp=r.createSafely(E.prototype),getFireworksComp=r.createSafely(I.prototype),initializeHeaderTooltipComp=r.createSafely(k.prototype);let L=o.readElement(".mini-header");return $(document).ready(function(e){function t(){null===L?(T.init(),x.init(),M.init(),rightDrawerComp.init(),N.init(),B.init(),a11yComp.init(),NotificationAlertComp.init(),InstorePickupComp.init(),$(".abs-short-videos").parent().css("display","block"),M.populateUserName(),initializeHeaderTooltipComp.init(),NavShoppingPreferencesComp.init(),MenuNavigationComp.init(),NavigationComp.init()):NotificationAlertComp.init()}UnsupportedBrowser.checkIEBrowser(),getFireworksComp.init(),window.location.pathname.includes("/freshpass/manage/subscribe")?function(){if($("body")?.[0]?.classList?.contains("ab-test-complete"))return;$(".global-header-proxy").remove();const e=window.SWY.CONFIGSERVICE;e&&(e.featureToggleConfig=e.featureToggleConfig||{},e.featureToggleConfig.isNavigationEngineDisabled=!0),t()}():$("body")?.[0]?.classList?.contains("ab-test-complete")||($(".sidebar-right-drawer").insertAfter(".sidebar-myaccount-flyout"),$(".unified-header-v3.unified-header").remove(),$("global-header,.global-header,.unified-header.unified-header--sticky-enabled").removeClass("d-none"),t())}),{}})());
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.