https://www.shopunitedsupermarkets.com/foundation/js/unified-postload.bundle.1789973498729-84f310.js
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-postload"]=t():e["unified-postload"]=t()}(window,()=>(()=>{var e={1488:e=>{e.exports=function(){this.SELECTORS={HTML:{TARGETED_HERO_INTRO:"targeted-api-intro"},DATA_ATTR:{fragment:"data-fragment",zone:"data-zone"},PAGETYPE:{landing:"landing-pages",home:"home"}},this.init=function(){this.headline=document.getElementsByClassName(this.SELECTORS.HTML.TARGETED_HERO_INTRO)[0],this.headline&&(this.fragmentPath=this.headline.getAttribute(this.SELECTORS.DATA_ATTR.fragment),this.zoneType=this.headline.getAttribute(this.SELECTORS.DATA_ATTR.zone),this.fragmentPath&&this.zoneType?this.getTargetedHeadlineHeroIntro():this.removeUnusedTargetedElements())},this.getTargetedContentFromApi=function(){const e=this.getEndpoint("landing-pages"),t=this.getContentSubKey("landing-pages");if(AB&&e&&t){let o={"Content-Type":"application/json","Ocp-Apim-Subscription-Key":t,banner:AB.userInfo.banner,storeId:AB.userInfo.branchId,zone:this.zoneType},n={storeId:AB.userInfo.branchId,zipcode:AB.userInfo.zipcode,banner:AB.userInfo.banner,channel:this.getChannel(),fragment:this.fragmentPath,screenName:this.SELECTORS.PAGETYPE.landing,zone:this.zoneType};if(AB?.COMMON?.isLSCompatible&&"function"==typeof AB.COMMON.isLSCompatible&&AB.COMMON.isLSCompatible()){const e=localStorage.getItem("timezone");e&&(n.deliveryTimeZone=e)}return new Promise((t,a)=>{fetch(e,{method:"POST",headers:o,body:JSON.stringify(n)}).then(e=>{if(e&&200===e.status)return e.json()}).then(e=>t(e)).catch(e=>{this.removeUnusedTargetedElements(),a(e)})})}return this.removeUnusedTargetedElements(),Promise.reject(new Error("Path or subscription key missing in config"))},this.getEndpoint=function(e){return{[this.SELECTORS.PAGETYPE.landing]:(AB||{}).targetedContentLandingEndpoint,[this.SELECTORS.PAGETYPE.home]:(AB||{}).targetedContentV2Endpoint}[e]},this.getContentSubKey=function(e){return{[this.SELECTORS.PAGETYPE.landing]:(AB||{}).targetedContentLandingEndpointSubkey,[this.SELECTORS.PAGETYPE.home]:(AB||{}).targetedContentV2SubKey}[e]},this.populateTargetedComponents=function(e){if(e&&e.items){let t=e.items[0];if("title-header"==t.type)switch(t.designType){case"headlineTextPlateWithBG":case"headlineTextPlateWithTransparent":this.renderHeadlineWebgen(this.headline,t);break;case"heroIntroHeadlineTextPlateWithTransparent":case"heroIntroHeadlineTextPlateWithBG":case"heroIntroHeadlineImageOnly":this.renderHeroIntroWebgen(this.headline,t);break;case"standardIntroHeadlineTextPlateWithTransparent":case"standardIntroHeadlineTextPlateWithBG":case"standardIntroHeadlineImageOnly":this.renderStandardIntroWebgen(this.headline,t);break;default:return void this.removeUnusedTargetedElements()}else this.removeUnusedTargetedElements()}else this.removeUnusedTargetedElements()},this.renderHeroIntroWebgen=function(e,t){const o=window.SWY?.CONFIGSERVICE?.featureToggleConfig?.heroIntroV2Enabled&&t.webImageAsset&&new URL(t.webImageAsset)?"webgen-hero-intro-v2":"webgen-hero-intro";e.insertAdjacentHTML("beforeend",`<div><${o} data-hero-intro-content='${this.prepareJSON(t)}'></${o}></div>`)},this.renderStandardIntroWebgen=function(e,t){const o=window.SWY?.CONFIGSERVICE?.featureToggleConfig?.standardIntroV2Enabled&&t.webImageAsset&&new URL(t.webImageAsset)?"webgen-standard-intro-v2":"webgen-standard-intro";e.insertAdjacentHTML("beforeend",`<div><${o} data-standard-intro-content='${this.prepareJSON(t)}'></${o}></div>`)},this.renderHeadlineWebgen=function(e,t){const o=this.prepareJSON(t);e.insertAdjacentHTML("beforeend",`<div><webgen-headline data-headline-content='${o}'></webgen-headline></div>`)},this.prepareJSON=function(e){return JSON.stringify(e)?.replace(/'/g,"'")},this.getTargetedHeadlineHeroIntro=function(){this.getTargetedContentFromApi().then(e=>{this.populateTargetedComponents(e)}).catch(e=>{console.warn("getTargetedHeadlineHeroIntro ERROR : "+e),this.removeUnusedTargetedElements()})},this.removeUnusedTargetedElements=function(){document.getElementsByClassName(this.SELECTORS.HTML.TARGETED_HERO_INTRO)[0]?.remove()},this.getChannel=function(){const e=AB.userInfo.preferenceMode.toLowerCase();return"j4u"===e?"instore":"dug"===e?"pickup":e}}},1945:function(){const e=!(!SWY.CONFIGSERVICE.featureToggleConfig||!0===SWY.CONFIGSERVICE.featureToggleConfig.cookieConsentCheckDisable),t=["__pr.64lx72","cookies.js_dtest","_ga","_gat_gtag_xxxxxxxxxxxxxxxxxxxxxxxxxxx","__tld__","s_vncm","_gid","kampyle_userid","aam_uuid","_uetsid","___utmvxxxxxxxxxxxxxx","_gat_xxxxxxxxxxxxxxxxxxxxxxxxxx","mdLogger","ajs_anonymous_id","GoogleAdServingTest","ADRUM","_elevaate_session_id","kampyleUserSession","_hjSessionUser_xxxxxx","ajs_user_id","flipp-id","__bxtest","__bxcurr","__pr.jajwcg","flipp-merchant-id","s_nr30","flipp-gid","__gsas","kampyleUserSessionsCount","safeway_ga_gid","AMCV_","__pr.1q4uo4","flipp-sid","__bxprev","ahoy_track","_hjTLDTest","ADRUM_BTa","ADRUM_BT1","xdibx","_dd_s","__pr.htn9hh","ADRUM_BT","_bts","flipp-publication-run-id","hub
1spotutk","safeway_ga","__pr.ocu0wk","ahoy_visit","__lbxcid","ADRUM_BTs","_cs_nnnnnnnnnnnnn","__lbxevents","__pr.a2xdb2","btIdentify","__pr.36j1qk","_hjSession_xxxxxx","__bxevents","incap_ses_*","_hjFirstSeen","__pr.7euahf","__pr.50z2xd","_bti","_hjIncludedInSessionSample","_hjAbsoluteSessionInProgress","_gat_gtag_UA_","ai_session","thx_guid","___utmvc","AMCVS","APC","albertsons26741z-BrowserVersion","BTT_X0siD","BTT_Collect","BTT_WCD_Collect","albertsons26741z-campSource","pfmDetail","albertsons26741z-campaign","previousPageStatus","userInfo","pageNameTrackForLogout","albertsons26741z-0","abStoreAddress","albertsons26741z-datacenter","paymentsData","pageURLTrackForLogout","BTT_GUID_PV","tooltip_modal","albertsons26741z-campMedium","everest_g_v2","ev_sync_dd","enabled","sessionID","demdex","dextp","dpm","UULE","s_cc","_ttp","OTZ"],o=SWY.CONFIGSERVICE.getResolvedBanner();if(e){if(window.dataLayer){const e=window.dataLayer.find(e=>"OneTrustGroupsUpdated"===e.event);e&&e.OneTrustActiveGroups&&-1===e.OneTrustActiveGroups.indexOf("C0002")&&this.deleteCookies()}$(window).on("OneTrustGroupsUpdated",function(e){e&&e.originalEvent&&e.originalEvent.detail&&(e.originalEvent.detail.find(e=>"C0002"==e)||this.deleteCookies())})}function n(){for(let e=0;e<t.length;e++){let n=t[e];document.cookie=n+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/",document.cookie=n+`=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.${o}.com`}}$(document).ready(function(){setTimeout(function(){n()},3e3),setTimeout(function(){n()},1e4)})},2145:()=>{"use strict";(function(){let e=".fulfillment-conflict-modal__shop-image",t=".fulfillment_preference-txt",o=".fulfillment_address-txt",n="svg-icon-store-header-mobile",a="In Store at ",s="svg-icon-Delivery-pref-page",r="Delivery to ",i="svg-icon-DUG-pref-page",l="Pickup at",d="#previouslyShopped",c="#currentlyShopping";this.init=function(){this.makeProfileCall()},this.makeProfileCall=function(){SWY.CONFIGSERVICE.getCookie("abs_gsession");let e=SWY.CONFIGSERVICE.getCookie("OrderNumber");const t=AB.userInfo.userType;0!=AB.firstTimeLogin||!AB.COMMON.isCookieEmpty(e)||"C"!==t&&"R"!==t||this.checkAndSetSWYSessionCookie();let o=AB.COMMON.getURLParameterByName("sendToHealthApp",!1);1!=AB.firstTimeLogin||!o||"C"!==t&&"R"!==t||this.checkAndSetSWYSessionCookie()},this.checkAndSetSWYSessionCookie=function(){this.getFullProfileDetail().then(e=>{let t=AB.CHECKPROFILE.getUserPreference(e);AB.CHECKPROFILE.checkProfileAndUpdateSessionCookies(t)}).catch(e=>{})},this.getFullProfileDetail=function(){return new Promise((e,t)=>{let o=AB.userInfo.UUID?AB.userInfo.UUID:"11111111-1111-1111-1111-111111111111";AB.userInfo.customerId&&AB.userInfo.customerId;const n=o;let a=AB.ucaHttpOptionsGetProfileV2NoDate;a.Authorization="Bearer "+AB.userInfo.SWY_SHOP_TOKEN;const s=AB.storeAddressPathV2.replace("{UUID}",n);$.ajax({headers:a,url:s,dataType:"json",success:function(t){e(t)},error:function(e,o,n){401!==e.status||AB.userInfo.userId?t(n):AB.COMMON.reconcileExpiredTokenUserState()}})})},this.getUserPreference=function(e){let t={};if(e){let o=SWY.CONFIGSERVICE.getResolvedBanner().toLowerCase(),n=e.preferences,a=e.stores,s=e.postalCodes,r=null,i=null,l=null,d=null,c=e.selectedAddresses,p=null,u=null;if(n)for(let e=0;e<n.length;e++){let t=n[e];if("FULFILLMENT"===t.categoryCode&&"METHOD"===t.subCategoryCode&&o===t.bannerId.toLowerCase()){r=t.value.toLowerCase(),i=t.bannerId.toLowerCase();break}}let g="delivery"===r?s:a;if(r&&i&&g)if("delivery"===r){let e=g;for(let t=0;t<e.length;t++){let n=e[t];if(n.stores[0].banner.toLowerCase()===o){l=n.stores[0],d=n.postalCode;break}}}else for(let e=0;e<a.length;e++){let t=a[e];if(SWY?.CONFIGSERVICE?.featureToggleConfig?.isJ4UStoreEnabled){if("j4u"===r&&"Preferred"===t.storePreference){l=t;break}if("dug"===r&&"DriveUp"===t.storePreference&&t.banner.toLowerCase()===i){l=t;break}}else{if("j4u"===r&&"Preferred"===t.storePreference&&t.banner.toLowerCase()===i){l=t;break}if("dug"===r&&"DriveUp"===t.storePreference&&t.banner.toLowerCase()===i){l=t;break}}}if(c)for(let e=0;e<c.length;e++){let t=c[e];p=!!t.resetToDefault&&t.resetToDefault,u=t.addressId}t.userPreference=r,t.userPreferenceBanner=i,t.currentBanner=o,t.matchedStoreObject=l,t.deliveryPostalCode=d,t.resetToDefault=p,t.addressId=u}return t},this.checkProfileAndUpdateSessionCookies=function(e){let t=e.userPreference,o=e.userPreferenceBanner,n=e.matchedStoreObject,a=e.currentBanner,s=!0;if(n){let r={info:{COMMON:{},J4U:{},SHOP:{}}},i=AB.CHECKPROFILE.getSWYSharedSessionCookie();if("j4u"===t){let e=!1,t=n.address;n.services[0].type.forEach(function(t){"DRIVEUP"!==t&&"DELIVERY"!==t||(e=!0)}),n.banner.toLowerCase()===a?i.info.J4U.storeId===n.storeId&&"j4u"===AB.userInfo.preferenceMode.toLowerCase()||(r.info.COMMON.preference="J4U",r.info.J4U.storeId=n.storeId,r.info.SHOP.storeId=n.storeId,r=AB.CHECKPROFILE.refineStoreAddress(t,r,!1,"J4U"),AB.CHECKPROFILE.updateCookiesFromProfile(o,e,r)):(s=!1,AB.CHECKPROFILE.getSWYSharedSession(e,t,a,o,n))}else if("dug"===t){if(i.info.SHOP.storeId!==n.storeId||"dug"!==AB.userInfo.preferenceMode.toLowerCase()){let e=n.address;r.info.SHOP.storeId=n.storeId,r.info.COMMON.preference="DUG",r.info.J4U.storeId=n.storeId,r=AB.CHECKPROFILE.refineStoreAddress(e,r,!1,"DUG"),AB.CHECKPROFILE.updateCookiesFromProfile(o,!0,r)}}else if("delivery"===t){let t=e.deliveryPostalCode;i.info.SHOP.zipcode===t&&"delivery"===AB.userInfo.preferenceMode.toLowerCase()||(r.info.SHOP.storeId=n.storeId,r.info.COMMON.preference="DELIVERY",r.info.J4U.storeId=n.storeId,r.info.J4U.zipcode=t,r.info.SHOP.zipcode=t,AB.CHECKPROFILE.updateCookiesFromProfile(o,!0,r))}s&&(n.isClosed?window.storeFulfillmentModal.component.setModalDisplayData(3,null,null,!0):SplashModalService.dispatchSplashModalEvent("ucaProfileCheckComplete"));let l=AB.COMMON.getURLParameterByName("sendToHealthApp",!1),d=AB.COMMON.getURLParameterByName("sendToHealthAppAfterCookiesUpdated",!1);
1l&&!d&&(localStorage.getItem("previousSharedSessionInfo")&&localStorage.removeItem("previousSharedSessionInfo"),window.location=window.location+"&sendToHealthAppAfterCookiesUpdated=true");const c=localStorage.getItem("ucaResetToDefault"),p=window?.SWY?.CONFIGSERVICE?.featureToggleConfig?.isGiftingTooltipEnabled,u="delivery"===AB.userInfo.preferenceMode?.toLowerCase(),g=$("#toolTipModal"),f=$("#smalltoolTipModal");!c&&e.resetToDefault&&p&&u?this.callAddressAPI(e,g,f):e&&e.resetToDefault&&c&&"true"===c&&this.callAckApiAndHideTooltip(e,g,f)}else{let e=AB.COMMON.getURLParameterByName("sendToHealthApp",!1);if(e){if(localStorage.getItem("previousSharedSessionInfo")){let e=JSON.parse(localStorage.getItem("previousSharedSessionInfo"));localStorage.removeItem("previousSharedSessionInfo");let t=SWY.ENFORCEMENTUTILS.parseSessionCookie("SWY_SHARED_SESSION_INFO"),o=!!SWY.CONFIGSERVICE.featureToggleConfig.enableCookieRestructure;t.info.J4U=e.info.J4U,t.info.SHOP=e.info.SHOP,o&&(t.info.COMMON.storeId=e.info.COMMON.storeId,t.info.COMMON.zipCode=e.info.COMMON.zipCode,t.info.COMMON.userData=e.info.COMMON.userData),AB.userInfo.updateSessionCookies(t)}let t=AB.COMMON.getURLParameterByName("sendToHealthAppAfterCookiesUpdated",!1);e&&!t&&(window.location=window.location+"&sendToHealthAppAfterCookiesUpdated=true")}else SplashModalService.dispatchSplashModalEvent("ucaProfileCheckComplete")}},this.updateCookiesFromProfile=function(e,t,o){let n=o.info.SHOP.storeId;t?(AB.COMMON.updateUserSession(o,!1),location.reload()):AB.CHECKPROFILE.getDerivedEcomStore(e,n).then(e=>{e&&(!0===e.validRequest.isValid?(o.info.SHOP.storeId=e.validRequest.ecomStore.storeId,o.info.SHOP.zipcode=e.validRequest.ecomStore.zipcode):(o.info.SHOP.storeId=SWY.CONFIGSERVICE.storeResolutionConfig.bannerDefaultStoreId,o.info.SHOP.zipcode=SWY.CONFIGSERVICE.storeResolutionConfig.bannerDefaultZipcode),AB.COMMON.updateUserSession(o,!1),location.reload())}).catch(e=>{o.info.SHOP.storeId=SWY.CONFIGSERVICE.storeResolutionConfig.bannerDefaultStoreId,o.info.SHOP.zipcode=SWY.CONFIGSERVICE.storeResolutionConfig.bannerDefaultZipcode,AB.COMMON.updateUserSession(o,!1),location.reload()})},this.getDerivedEcomStore=function(e,t){const o=window.location.origin,n=AB.storeResolverValidateEndpoint,a={storeid:t,banner:e,preference:"instore"},s=AB.xAPIstoreResolverHttpOptions;return AB.COMMON.getStoreResolverPayload(o,n,a,s,!0)}
1,this.getStoreAddressFromXapi=function(e){const t=window.location.origin,o=AB.storeResolverStoreAddressEndpoint,n={storeid:e},a=AB.xAPIstoreResolverHttpOptions;return new Promise((e,s)=>{AB.COMMON.getStoreResolverPayload(t,o,n,a,!1,function(t,o,n){t.storeAddressModel&&(streetAddress=t.storeAddressModel.address.line1+"+"+t.storeAddressModel.address.city+"+"+t.storeAddressModel.address.state+"+"+t.storeAddressModel.address.zipcode,e(streetAddress))},function(e,t,o){s(null)})})},this.getSWYSharedSession=function(e,t,o,n,a){let s={},r=AB.CHECKPROFILE.getSWYSharedSessionCookie(),i=r.info.J4U.address;const l=!SWY?.CONFIGSERVICE?.featureToggleConfig?.enableSSONewConflictModal&&SWY?.CONFIGSERVICE?.featureToggleConfig?.isJ4UStoreEnabled;s.j4uStoreId=r.info.J4U.storeId,s.shopStoreId=r.info.SHOP.storeId,s.j4uzipcode=r.info.J4U.zipcode,s.shopzipcode=r.info.SHOP.zipcode,s.banner=o,s.preference=r.info.COMMON.preference.toLowerCase(),void 0===i?AB.CHECKPROFILE.getStoreAddressFromXapi(r.info.J4U.storeId).then(o=>{i=o.replace(/ /g,"+"),s.address=i,l&&conflictModalComp.init(),AB.CHECKPROFILE.callbackTriggerConflictModal(e,t,n,a,s)}).catch(e=>{}):(i=i.replace(/ /g,"+"),s.address=i,l&&conflictModalComp.init(),AB.CHECKPROFILE.callbackTriggerConflictModal(e,t,n,a,s))},this.renderCurrentlyShopping=function(d){const p=$(c),u=$(e),g=$(c),f=p.find(u),m=p.find(t),h=p.find(o),C=d.preference;if("j4u"===C||"instore"===C){f.addClass(n),m.text(a);const e=d.address;e&&h.text(e.split("+").join(" "))}else if("delivery"===C)f.addClass(s),m.text(r+d.shopzipcode);else if("dug"===C){f.addClass(i),m.text(l);const e=d.address;e&&h.text(e.split("+").join(" "))}g.attr("make-mystore-btn",encodeURIComponent(JSON.stringify(d)))},this.renderPreviouslyShopped=function(c){const p=$(d),u=$(e),g=$(d),f=p.find(u),m=p.find(t),h=p.find(o),C=c.preference;if("j4u"===C||"instore"===C){f.addClass(n),m.text(a);const e=c.address;e&&h.text(e.split("+").join(" "))}else if("delivery"===C)f.addClass(s),m.text(r+c.shopzipcode);else if("dug"===C){f.addClass(i),m.text(l);const e=c.address;e&&h.text(e.split("+").join(" "))}g.attr("make-mystore-btn",encodeURIComponent(JSON.stringify(c)))},this.refineStoreAddress=function(e,t,o,n){let a;return e&&(e.zipCode&&(o?(t.j4uzipcode=e.zipCode,t.shopzipcode=e.zipCode):(t.info.J4U.zipcode=e.zipCode,t.info.SHOP.zipcode=e.zipCode)),e.address1&&(a=e.address1.replace(/ /g,"+")+",+"),e.city&&(a=a+e.city.replace(/ /g,"+")+",+"),e.state&&(a=a+e.state+"+"),e.zipCode&&(a+=e.zipCode),o?t.address=a:"J4U"===n?t.info.J4U.address=a:"DUG"===n&&(t.info.SHOP.address=a)),t},this.callbackTriggerConflictModal=function(e,t,o,n,a){if(AB?.onBoardingSigninFlow||AB?.onUnitySigninFlow||AB?.noPreferenceSigninFlow)return;$("#fulfillment-conflict-modal");let s={};s.shopStoreId=n.storeId,s.j4uStoreId=n.storeId,s.banner=n.banner,s.preference="j4u",s=AB.CHECKPROFILE.refineStoreAddress(t,s,!0,"J4U"),e?(AB.CHECKPROFILE.showConflictModal(a,s),AB.DATALAYER&&AB.DATALAYER.setModalViewEvents("storeConflict|view")):AB.CHECKPROFILE.getDerivedEcomStore(o,n.storeId).then(e=>{e&&(!0===e.validRequest.isValid?(s.shopStoreId=e.validRequest.ecomStore.storeId,s.shopzipcode=e.validRequest.ecomStore.zipcode):(s.shopStoreId=SWY.CONFIGSERVICE.storeResolutionConfig.bannerDefaultStoreId,s.shopzipcode=SWY.CONFIGSERVICE.storeResolutionConfig.bannerDefaultZipcode),AB.CHECKPROFILE.showConflictModal(a,s),AB.DATALAYER&&AB.DATALAYER.setModalViewEvents("storeConflict|view"))}).catch(e=>{s.shopStoreId=SWY.CONFIGSERVICE.storeResolutionConfig.bannerDefaultStoreId,s.shopzipcode=SWY.CONFIGSERVICE.storeResolutionConfig.bannerDefaultZipcode,AB.CHECKPROFILE.showConflictModal(a,s),AB.DATALAYER&&AB.DATALAYER.setModalViewEvents("storeConflict|view")})},this.showConflictModal=function(e,t){const o=SWY?.CONFIGSERVICE?.featureToggleConfig?.enableSSONewConflictModal;o?(AB.POPUPCONFLICTDATA={currentSWYOBJ:e,previousSWYOBJ:t},this.triggerPopupWrapper("reload-flow")):(AB.CHECKPROFILE.renderBanner(e.banner,t.banner),AB.CHECKPROFILE.renderCurrentlyShopping(e),AB.CHECKPROFILE.renderPreviouslyShopped(t),conflictModalMainIdElement.modal("show"))},this.triggerPopupWrapper=function(e,t=!0){setTimeout(function(){window.popupWrapModal.zone.runTask(()=>{window.popupWrapModal.component.showPopupWrapper(e,t)})},1e3)}
1,this.getSWYSharedSessionCookie=function(){let e=SWY.CONFIGSERVICE.getCookie("SWY_SHARED_SESSION_INFO");return e=decodeURI(e),e=JSON.parse(e),e},this.renderBanner=function(e,t){if(e&&t&&e!==t){const o=$(".fulfillment-conflict-modal__currentBanner"),n=$(".fulfillment-conflict-modal__previousBanner");"B"===AB?.userInfo?.siteType&&(e=`${e}_b2b`,t=`${t}_b2b`),o.attr("src",AB.CHECKPROFILE.getBannerLogo(e)),o.attr("alt",e),o.addClass(`${e}-logo`),n.attr("src",AB.CHECKPROFILE.getBannerLogo(t)),n.attr("alt",t),n.addClass(`${t}-logo`),o.show(),n.show()}},this.getBannerLogo=function(e){const t=$("#fulfillment-conflict-modal").attr("data-bannerlogomap");let o;return t&&(o=JSON.parse(decodeURIComponent(t))[e=e.toLowerCase().split(" ").join("")]),o},this.callAckApiAndHideTooltip=function(e,t,o){var n=AB.userInfo.UUID,a=(window.APIM||"")+SWY.CONFIGSERVICE.datapowerConfig.cncCtxPath+"/ucaservice/api/uca/customers/"+n+"/addresses?type=userAck",s={},r=(new Date).toUTCString().replace("GMT","GMT").replace(/,\s/,", ");s.postalCode={postalCode:e.deliveryPostalCode,resetToDefault:!1},s.selectedAddress={addressId:e.addressId,resetToDefault:!1};var i={Accept:"application/vnd.safeway.v3+json","Content-Type":"application/vnd.safeway.v3.merge-patch+json","x-swy-correlation-id":AB.COMMON.generateUUID(),"x-swy-date":r,"x-swy-banner":SWY.CONFIGSERVICE.getResolvedBanner(),"x-swy-client-name":"web-portal","Ocp-Apim-Subscription-Key":SWY.CONFIGSERVICE.datapowerConfig.cncSubscriptionKey,Authorization:"Bearer "+AB.userInfo.SWY_SHOP_TOKEN};$.ajax({url:a,type:"PATCH",headers:i,data:JSON.stringify(s),success:function(){localStorage.removeItem("ucaResetToDefault")},complete:function(){const e=t.data("autoHideTimeout"),n=o.data("autoHideTimeout");e&&clearTimeout(e),n&&clearTimeout(n),window.innerWidth<=1024?(o.removeClass("d-block show"),o.addClass("d-none")):(t.removeClass("d-block show"),t.addClass("d-none"))}})},this.callAddressAPI=function(e,t,o){var n=AB.userInfo.UUID,a=(window.APIM||"")+SWY.CONFIGSERVICE.datapowerConfig.cncCtxPath+"/ucaservice/api/uca/customers/"+n+"/addresses?resolveStoresWithGeoCodes=false&includeDivestitureStores=false",s=(new Date).toUTCString().replace("GMT","GMT").replace(/,\s/,", "),r="",i={Accept:"application/vnd.safeway.v3+json","Content-Type":"application/vnd.safeway.v3.merge-patch+json","x-swy-correlation-id":AB.COMMON.generateUUID(),"x-swy-date":s,"x-swy-banner":SWY.CONFIGSERVICE.getResolvedBanner(),"x-swy-client-name":"web-portal","Ocp-Apim-Subscription-Key":SWY.CONFIGSERVICE.datapowerConfig.cncSubscriptionKey,Authorization:"Bearer "+AB.userInfo.SWY_SHOP_TOKEN};return $.ajax({url:a,type:"GET",headers:i,success:function(n){const a=n.addresses||[];for(const t of a)if(t.addressId===e.addressId){const e={address1:t.address1,address2:t.address2,zipCode:t.zipCode,state:t.state,city:t.city};if(AB.COMMON.updateUserDefaultAddress(e),AB.userInfo.zipcode!==t.zipCode)return;r=`${t.address1}, ${t.city}, ${t.state} ${t.zipCode}`;break}const s=document.getElementById("tooltipMessage"),i=document.getElementById("smalltooltipMessage"),l=$("#tooltip-address"),d=$("#small-tooltip-address");if(s.setAttribute("aria-label",`Tooltip, Welcome back! You're currently shopping with your default address ${r}.`),i.setAttribute("aria-label",`Tooltip, Welcome back! You're currently shopping with your default address ${r}.`),l.text(r),d.text(r),window.innerWidth<=1024){o.removeClass("d-none"),o.addClass("d-block show");const e=o.find(".address-modal-content__body");e?.attr("tabindex","0"),e?.focus()}else{t.removeClass("d-none"),t.addClass("d-block show");const e=t.find(".address-modal-content__body");e?.attr("tabindex","0"),e?.focus()}localStorage.setItem("ucaResetToDefault",!0),window.innerWidth<=1024?(o.find('[data-dismiss="modal"]').on("click",function(){AB.CHECKPROFILE.setFocusToPrimaryHeader(),AB.CHECKPROFILE.callAckApiAndHideTooltip(e,t,o)}),o.find('[data-dismiss="modal"]').on("keydown",function(e){AB.CHECKPROFILE.setFocusToAddressContent(e,o)}),o.find(".address-modal-content__body").on("keydown",function(e){AB.CHECKPROFILE.setFocusToGotItButton(e,o)})):(t.find('[data-dismiss="modal"]').on("click",function(){AB.CHECKPROFILE.setFocusToPrimaryHeader(),AB.CHECKPROFILE.
1callAckApiAndHideTooltip(e,t,o)}),t.find('[data-dismiss="modal"]').on("keydown",function(e){AB.CHECKPROFILE.setFocusToAddressContent(e,t)}),t.find(".address-modal-content__body").on("keydown",function(e){AB.CHECKPROFILE.setFocusToGotItButton(e,t)})),$(document).on("click",function(e){if(!$(e.target).closest(t).length){const e=t.data("autoHideTimeout");e&&clearTimeout(e),t.removeClass("d-block show"),t.addClass("d-none")}if(!$(e.target).closest(o).length){const e=o.data("autoHideTimeout");e&&clearTimeout(e),o.removeClass("d-block show"),o.addClass("d-none")}}),$(document).on("keydown",function(e){if("Escape"===e.key&&t.hasClass("show")){const e=t.data("autoHideTimeout");e&&clearTimeout(e),t.removeClass("d-block show"),t.addClass("d-none")}else if("Escape"===e.key&&o.hasClass("show")){const e=o.data("autoHideTimeout");e&&clearTimeout(e),o.removeClass("d-block show"),o.addClass("d-none")}});const c=setTimeout(function(){window.innerWidth<=1024&&o.hasClass("show")?(o.removeClass("d-block show"),o.addClass("d-none")):t.hasClass("show")&&(t.removeClass("d-block show"),t.addClass("d-none")),AB.CHECKPROFILE.setFocusToPrimaryHeader()},1e4);t.data("autoHideTimeout",c),o.data("autoHideTimeout",c)},error:function(e){console.warn("ACK API failed :",e)}})},this.setFocusToPrimaryHeader=function(){const e=$(".p_nav__link").first();e.length>0&&e.focus()},this.setFocusToAddressContent=function(e,t){if("Tab"===e.key){e.preventDefault();const o=t.find(".address-modal-content__body");o&&(o.attr("tabindex","0"),o.focus())}},this.setFocusToGotItButton=function(e,t){"Tab"===e.key&&(e.preventDefault(),t.find('[data-dismiss="modal"]').focus())}}).call(AB.CHECKPROFILE)},2167:e=>{e.exports=function(){function e(e,t){if(!t.includes("*"))return e.includes(t);const o=t.replace(/\*/g,".*");return new RegExp("^"+o).test(e)}const t=window?.location?.hostname?.split(".")?.[1],o={safeway:{formId:41252,surveyId:95097},randalls:{formId:41250,surveyId:92836},vons:{formId:41260,surveyId:94432},albertsons:{formId:40502,surveyId:94964},shopalbertsonsmarket:{formId:41175,surveyId:93235},jewelosco:{formId:41197,surveyId:94565},acmemarkets:{formId:44169,surveyId:94831},shaws:{formId:41254,surveyId:94698},tomthumb:{formId:41256,surveyId:92969},starmarket:{formId:41656,surveyId:94166},pavilions:{formId:41248,surveyId:92703},carrsqc:{formId:41180,surveyId:92570},shopunitedsupermarkets:{formId:41258,surveyId:94299},shopmarketstreet:{formId:41246,surveyId:94033},shopamigos:{formId:41173,surveyId:93368},andronicos:{formId:41177,surveyId:93501},balduccis:{formId:41179,surveyId:93634},haggen:{formId:41187,surveyId:93102},kingsfoodmarket:{formId:41241,surveyId:93767}}[t?.toLowerCase()],n=o.formId,a=o.surveyId;let s=!1,r=!1;function i(){window.KAMPYLE_ONSITE_SDK&&!0===window.KAMPYLE_ONSITE_SDK.loadForm(n)&&window.KAMPYLE_ONSITE_SDK.showForm(n)}var l=this;function d(){const e=document.querySelector(".pds-survey__container"),t=e?.closest(".pds-survey");t&&(t.style.display="none")}window.AB.handleSurveyButton=function(){document.getElementById("medallia-feedback-script")&&r&&window.KAMPYLE_ONSITE_SDK?i():(document.getElementById("medallia-feedback-script")||l.injectMedalliaScript(),window.addEventListener("neb_OnsiteLoaded",function(){i()},{once:!0}))},this.injectMedalliaScript=function(){if(!s){s=!0;const e="https://resources.digital-cloud-west.medallia.com/wdcwest/"+a+"/onsite/embed.js",t=document.createElement("script");t.id="medallia-feedback-script",t.src=e,t.onload=function(){r=!0},t.onerror=function(){console.error("Failed to load Medallia script - check network/URL");const e=document.querySelector(".pds-survey__container"),t=e?.closest(".pds-survey");t&&(t.style.display="none")};const o=document.querySelector(".survey-wrapper");o?o.appendChild(t):document.head.appendChild(t)}},this.init=function(){const t=document.querySelector(".pds-survey__container");if(!t)return;const o=t.getAttribute("data-exclusion-paths");if(!o)return void this.initializeSurveyWithCookieConsent();const n=o?.split(",");if(function(t,o){if(window.location.hostname.includes("business"))return!0;for(let n=0;n<o.length;n++){const a=o[n];if(a&&e(t,a))return!0}return!1}(window.location.pathname,n)){const e=t.closest(".pds-survey");e&&(e.style.display="none")}else this.initializeSurveyWithCookieConsent()},this.initializeSurveyWithCookieConsent=function(){const e=this,t=window.dataLayer&&window.dataLayer.find(function(e){return"OneTrustGroupsUpdated"===e.event});t?t.OnetrustActiveGroups&&t.OnetrustActiveGroups.includes("C0002")?e.initializeMedaliaScript():d():window.addEventListener("OneTrustGroupsUpdated",function(t){const o=t?.detail||[];o&&o.includes("C0002")?e.initializeMedaliaScript():d()},{once:!0})},this.initializeMedaliaScript=function(){const e=this;window.lazyFunctions=window.lazyFunctions||{},window.lazyFunctions.surveyLazyFunc=function(t){e.injectMedalliaScript()}}}},2178:()=>{(function(){const e=this;AB.userInfo.otpData={},this.init=function(){const t=sessionStorage.getItem("kmsiID");t&&e.deleteKmsi(JSON.parse(t)),localStorage.getItem("showOTPSignIn")&&setTimeout(()=>{AB.COMMON.switchOTPContentSignIn("sign-in-with-otp","sign-in-password"),localStorage.removeItem("showOTPSignIn")},2e3)}
1,this.showSpinner=function(e){$("#loaderSignInOTP").removeClass("mask").addClass("unmask mb-3"),$("#signInOTPLoadingEmpty").removeClass("unmask").addClass("mask"),e&&$("#"+e).prop("disabled",!0)},this.hideSpinner=function(e){$("#loaderSignInOTP").removeClass("unmask").addClass("mask"),$("#signInOTPLoadingEmpty").removeClass("mask").addClass("unmask"),e&&$("#"+e).prop("disabled",!1)},this.silentSignOutAndFeildReset=function(e,t){$("#email-mobile-otp").prop("disabled")&&(localStorage.setItem("showOTPSignIn",!0),t&&AB.COMMON.setShowSignInModal(),AB.COMMON.setTopNavPreviousPage(),SWY.OKTA.silentSignOutFromOkta(e))},this.stateTokenExpiryCheck=function(){!0===AB.userInfo.otpData.tokenExpiredError&&($("#error-message-otp").html("Sorry, this session has expired. Please retry."),AB.userInfo.otpData.tokenExpiredError=void 0)},this.onVerifyOTPLoad=function(){const{mode:e,value:t}=AB.userInfo.otpData.sendPasscodeTo;if(t&&t.length>0){const o=$("#verify-otp-header").text().slice(0,10);let n,a,s=sessionStorage.getItem("OTPtype")||"";"emailAddress"===e?(a="email",n="<div>Weâve sent an email with a verification code to <strong>"+t+"</strong>. Enter the code below to sign into your account.</div>",$("#use-password-link").removeClass("mask"),$("#use-different-emaiil-from-otp").removeClass("mask"),$("#try-different-number").addClass("mask"),"page"===s?AB.DATALAYER&&AB.DATALAYER.OTPPageEvents("view",{ss3:"OTP:email-code"}):AB.DATALAYER&&AB.DATALAYER.OTPModalEvents("view","OTP:email-code|view"),sessionStorage.setItem("OTPmode","email")):"mobileNumber"===e&&(a="text message",n="<div>Weâve sent a code to <strong>"+t.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3")+"</strong> so that you can sign into your account.</div>",$("#try-different-number").removeClass("mask"),$("#use-different-emaiil-from-otp").addClass("mask"),$("#use-password-link").addClass("mask"),"page"===s?AB.DATALAYER&&AB.DATALAYER.OTPPageEvents("view",{ss3:"OTP:mobile-code"}):AB.DATALAYER&&AB.DATALAYER.OTPModalEvents("view","OTP:mobile-code|view"),sessionStorage.setItem("OTPmode","mobile")),$("#verify-otp-header").text(o+" "+a),$("#verify-otp-header").removeClass("mask"),$("#sign-in-otp-header").addClass("mask"),$("#kmsi-modal-otp").removeClass("mask"),$("#otp-code").val(""),$("#sign-in-otp-close-button").focus(),$("#otp-sent-label").html(n)}},this.onEnterPasswordLoad=function(){const{mode:e,value:t}=AB.userInfo.otpData.sendPasscodeTo;let o=sessionStorage.getItem("OTPtype")||"";if(t&&t.length>0){if("emailAddress"===e){const e="Please enter your password for this account: <strong>"+t+"</strong>";$("#enter-password-text").html(e).addClass("my-4"),$("#number-not-setup").html(null),$("#use-verification-code").removeClass("mask"),$("#use-different-emaiil-from-password").removeClass("mask"),$("#try-different-number-from-password").addClass("mask"),"page"===o?AB.DATALAYER&&AB.DATALAYER.OTPPageEvents("view",{ss3:"OTP:email-password"}):AB.DATALAYER&&AB.DATALAYER.OTPModalEvents("view","OTP:email-password|view")}if("mobileNumber"===e){const e=AB.userInfo.otpData.maskedEmail,n="The number <strong>"+t.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3")+"</strong> isnât set up to use a verification code.",a="This number is linked to <strong>"+e+"</strong>. Please enter the password for this account to sign in.";$("#number-not-setup").html(n).addClass("mb-3 mt-4").removeClass("mask"),$("#enter-password-text").html(a).addClass("mb-4"),$("#use-verification-code").addClass("mask"),$("#try-different-number-from-password").removeClass("mask"),$("#use-different-emaiil-from-password").addClass("mask"),"page"===o?AB.DATALAYER&&AB.DATALAYER.OTPPageEvents("view",{ss3:"OTP:email-password",ss4:"mobile-not-enrolled-enter-password"}):AB.DATALAYER&&AB.DATALAYER.OTPModalEvents("view","OTP:email-password|view","mobile-not-enrolled-enter-password")}$("#verify-otp-header").addClass("mask"),$("#sign-in-otp-header").removeClass("mask"),$("#kmsi-modal-otp").removeClass("mask"),$("#label-password-otp").val(""),$("#sign-in-otp-close-button").focus()}},this.clearErrorMessage=function(e,t){let o;switch(e){case"email-mobile-otp":o="error-email-mobile-otp";break;case"otp-code":o="invalied-otp";break;case"label-password-otp":o="error-sign-in-with-password",$("#show-hide-password").removeClass("show-hide-password-has-error"),t&&$("#show-hide-password").addClass("show-hide-password-focus")}$("#"+e).closest(".form-group").removeClass("has-error has-danger"),$("#"+o).text("")},this.checkPhoneNumberError=function(e){return"0"===e.charAt(0)||"1"===e.charAt(0)?{hasError:!0,errorMessage:"patternErrorMsg"}:10!==e.length?{hasError:!0,errorMessage:"validErrorMsg"}:{hasError:!1}},this.checkEmailError=function(e){const t=$("#email-mobile-otp").data("email-pattern");return new RegExp(t).test(e)?{hasError:!1}:{hasError:!0,errorMessage:"validErrorMsg"}},this.checkOtpError=function(e){return e.length<1?{hasError:!0,errorMessage:"requiredErrorMsg"}:e.length<6?{hasError:!0,errorMessage:"lengthErrorMsg"}:{hasError:!1}},this.enableOtpContinueBtn=function(t,o){const n=$("#"+t).val().trim(),a=$("#email-mobile-otp").data("mobile-pattern"),s=new RegExp(a).test(n),r={requiredErrorMsg:$
1("#"+t).data("required-error")};let i,l=!1;if(n.length<1)l=!0,$("#error-email-mobile-otp").text(r.requiredErrorMsg);else if(s){i="mobileNumber",r.validErrorMsg=$("#"+t).data("mobile-valid-error"),r.patternErrorMsg=$("#"+t).data("mobile-pattern-error");const{hasError:o,errorMessage:a}=e.checkPhoneNumberError(n);o&&(l=o,$("#error-email-mobile-otp").text(r[a]),AB.DATALAYER&&AB.DATALAYER.setError(t,"OTP-error","mobile|"+r[a]))}else{i="emailAddress",r.validErrorMsg=$("#"+t).data("email-valid-error");const{hasError:o,errorMessage:a}=e.checkEmailError(n);o&&(l=o,$("#error-email-mobile-otp").text(r[a]),AB.DATALAYER&&AB.DATALAYER.setError(t,"OTP-error","email|"+r[a]))}l?($("#"+o).prop("disabled",!0),$("#"+t).closest(".form-group").addClass("has-error has-danger"),$("#error-email-mobile-otp").focus()):(AB.userInfo.otpData.sendPasscodeTo={mode:i,value:n},$("#"+o).removeAttr("disabled"),$("#"+t).closest(".form-group").removeClass("has-error has-danger"),$("#error-email-mobile-otp").text(""))},this.callAlternateSignInApi=function(t){$.ajax({type:"POST",headers:AB.ucaHttpOptions,url:AB.signInCsmsPath,dataType:"json",data:JSON.stringify({userName:AB.userInfo.otpData.sendPasscodeTo.value}),success:function(t){$("#error-message-otp").html(null),AB.userInfo.otpData.stateToken=t.stateToken,AB.userInfo.otpData.expiresAt=t.expiresAt,e.hideSpinner("update-otp-continue-btn"),t.maskedEmail?(AB.userInfo.otpData.maskedEmail=t.maskedEmail,AB.userInfo.otpData.userID=t.oktaId,e.onEnterPasswordLoad(),e.showHideSection(["enter-password-modal","enter-password-modal-buttons"],["otp-modal","otp-modal-buttons"])):(AB.userInfo.otpData.factorId=t._embedded.factor.id,AB.userInfo.otpData.userID=t._embedded.user&&t._embedded.user.id,e.onVerifyOTPLoad(),e.showHideSection(["verify-otp-modal","verify-otp-modal-buttons"],["otp-modal","otp-modal-buttons"]))},error:function(o,n,a){e.hideSpinner("update-otp-continue-btn"),e.handleError(o,t)}})},this.enableOtpSignInBtn=function(t,o){const n=$("#"+o).val().trim(),a={requiredErrorMsg:$
1("#"+o).data("required-error"),lengthErrorMsg:$("#"+o).data("length-error")},{hasError:s,errorMessage:r}=e.checkOtpError(n);s?($("#invalied-otp").text(a[r]).focus(),$("#"+t).prop("disabled",!0),$("#"+o).closest(".form-group").addClass("has-error has-danger")):$("#"+t).removeAttr("disabled")},this.resendOtp=function(){if(AB.userInfo.otpData.sendPasscodeTo&&AB.userInfo.otpData.sendPasscodeTo.value.length>0){e.showSpinner();let t="emailAddress"==AB.userInfo.otpData.sendPasscodeTo.mode?"email":"mobile",o=sessionStorage.getItem("OTPresend")?"we-sent-new-code":"",n=sessionStorage.getItem("OTPtype")||"";"page"===n?AB.DATALAYER&&AB.DATALAYER.OTPPageEvents("click","OTP:"+t+"-code|resend-code"):AB.DATALAYER&&AB.DATALAYER.OTPModalEvents("click","OTP:"+t+"-code|resend-code",o),o&&sessionStorage.removeItem("OTPresend"),$.ajax({type:"POST",headers:AB.ucaHttpOptions,url:AB.resendOtpCsmsPath.replace("{factorId}",AB.userInfo.otpData.factorId),dataType:"json",data:JSON.stringify({stateToken:AB.userInfo.otpData.stateToken,expiresAt:AB.userInfo.otpData.expiresAt,user:{id:AB.userInfo.otpData.userID,profile:{login:AB.userInfo.otpData.sendPasscodeTo.value}}}),success:function(o){e.hideSpinner(),$("#error-message-otp").html(null),AB.userInfo.otpData.stateToken=o.stateToken,AB.userInfo.otpData.expiresAt=o.expiresAt,AB.COMMON.userNotify("We've sent you a new verification code"),"page"===n?AB.DATALAYER&&AB.DATALAYER.OTPPageEvents("view",{ss3:"OTP:"+t+"-code|view",ss4:"we-sent-a-new-code"}):AB.DATALAYER&&AB.DATALAYER.OTPModalEvents("view","OTP:"+t+"-code|view","we-sent-a-new-code"),sessionStorage.setItem("OTPresend",t)},error:function(t,o,n){e.hideSpinner(),e.handleError(t)}})}},this.addNonKmsi=function(e){$.ajax({type:"POST",headers:AB.ucaSignInOtpNonKmsiOtpions,async:!1,url:AB.nonKmsiCsmsPath,dataType:"json",data:JSON.stringify(e),success:function(e){"SUCCESS"===e.status&&(AB.userInfo.otpData.nonKmsiId=e&&e.id,sessionStorage.setItem("kmsiID",JSON.stringify(e.id)),sessionStorage.setItem("triggerKMSIDelete",!0))},error:function(e,t,o){}})},this.deleteKmsi=function(e){$.ajax({type:"DELETE",headers:AB.kmsiHttpOptions,url:AB.kmsiCsmsPath+"/"+e,dataType:"json",success:function(e){sessionStorage.removeItem("kmsiID"),sessionStorage.removeItem("triggerKMSIDelete")},error:function(e,t,o){}})},this.signInWithOtp=function(e){const t=$("#otp-code").val().trim();SWY.OKTA.signInWithOTP(t,"sign-in-otp-btn",e)},this.enableSignInWithPasswordButton=function(e,t){if($("#label-password-otp").val().trim().length<8){const o=$("#"+e).data("required-error");$("#"+t).prop("disabled",!0),$("#"+e).closest(".form-group").addClass("has-error has-danger"),$("#show-hide-password").addClass("show-hide-password-has-error"),$("#error-sign-in-with-password").text(o).focus()}else $("#"+e).closest(".form-group").removeClass("has-error has-danger"),$("#show-hide-password").removeClass("show-hide-password-has-error show-hide-password-focus"),$("#error-sign-in-with-password").text(""),$("#"+t).removeAttr("disabled")},this.signInWithPassword=function(e){const t=$("#label-password-otp").val().trim();SWY.OKTA.signInWithOTP(t,"sign-in-with-password",e,!0)},this.onInputChange=function(t,o){const n=$("#"+o).val().trim();switch(o){case"email-mobile-otp":{const t=$("#email-mobile-otp").data("mobile-pattern");let o;o=new RegExp(t).test(n)?e.checkPhoneNumberError(n).hasError:e.checkEmailError(n).hasError,o?$("#update-otp-continue-btn").prop("disabled",!0):$("#update-otp-continue-btn").removeAttr("disabled")}break;case"otp-code":{t.target.value=t.target.value.replace(/[^0-9]/g,"");const{hasError:o}=e.checkOtpError(t.target.value);o?$("#sign-in-otp-btn").prop("disabled",!0):$("#sign-in-otp-btn").removeAttr("disabled")}break;case"label-password-otp":n.length>=8?$("#sign-in-with-password").removeAttr("disabled"):$("#sign-in-with-password").prop("disabled",!0)}},this.showHideSection=function(t,o){$("#error-message-otp").html(null),e.clearErrorMessage("otp-code"),e.clearErrorMessage("label-password-otp"),e.clearErrorMessage("email-mobile-otp"),$("#update-otp-continue-btn").prop("disabled",!0),$("#sign-in-otp-btn").prop("disabled",!0),$("#sign-in-with-password").prop("disabled",!0),$("#email-mobile-otp").val(""),$("#show-hide-password").removeClass("show-hide-password-focus"),t.forEach(e
1=>{$("#"+e).removeClass("mask")}),o&&o.forEach(e=>{$("#"+e).addClass("mask")}),$("#sign-in-otp-close-button").focus()},this.showCreateAccountModal=function(){$("#unifiedRegistrationModal").modal("show"),$("#signInModal").modal("hide")},$("#signInModal").on("keydown",function(e){if(!$("#sign-in-with-otp").hasClass("mask")){const t='button, [href], input, span, [tabindex]:not([tabindex="-1"])',o=document.querySelector("#signInModal").querySelectorAll(t),n=[];o.forEach(e=>{$(e).is(":visible")&&n.push(e)});const a=n[0],s=n[n.length-1];if("Tab"!==e.key&&9!==e.keyCode)return;e.shiftKey?document.activeElement===a&&(s.focus(),e.preventDefault()):document.activeElement===s&&(a.focus(),e.preventDefault())}}),this.handleError=function(e,t,o){const n=e.responseJSON;let a=sessionStorage.getItem("OTPmode"),s="OTP-error";const r=$("#signInOTPForm").attr("data-createAccount")||"/account/short-registration.html",i=$("#signInOTPForm").attr("data-contactSuport")||"/contact-us.html",l=$("#signInOTPForm").attr("data-contactSupportText");if(n&&n.errors&&n.errors[0]&&"CSMS0139"===n.errors[0].code)$("#error-message-otp").html("Please wait 30 seconds before trying to resend another code"),AB.DATALAYER&&AB.DATALAYER.setError(n.errors[0].code,s,a+"|Please wait 30 seconds before trying to resend another code");else if(n&&n.errors&&n.errors[0]&&"CSMS0156"===n.errors[0].code){const e="<a tabindex='0' class='otp-link' aria-label='sign in' role='button' onclick='AB.COMMON.switchOTPContentSignIn(\"sign-in-password\", \"sign-in-with-otp\", \"create-modal-close-icon\");'>sign in</a>",t=n.errors[0].message.replace("sign in",e);$("#error-message-otp").html(t).focus(),AB.DATALAYER&&AB.DATALAYER.setError(n.errors[0].code,s,"mobile|Mobile number linked to multiple accounts")}else if(n&&n.errors&&n.errors[0]&&"CSMS0157"===n.errors[0].code){const e=`<a tabindex='0' href=${r}><span class='otp-link' aria-label='create a new account'>create a new account</span></a>`,o="<a tabindex='0' role='button' aria-label='create a new account' tabindex='0' onclick='AB.SIGNINOTP.showCreateAccountModal()'><span class='otp-link'>create a new account</span></a>",a=n.errors[0].message.replace("create a new account",t?o:e);$("#error-message-otp").html(a).focus(),AB.DATALAYER&&AB.DATALAYER.setError(n.errors[0].code,s,"mobile|No account for mobile number"),sessionStorage.setItem("OTPMobileError","mobile-not-enrolled-enter-password")}else if(n&&n.errors&&n.errors[0]&&"CSMS0158"===n.errors[0].code){const e=`<a tabindex='0' href=${r}><span class='otp-link' aria-label='create a new account'>create a new account</span></a>`,o="<a tabindex='0' role='button' aria-label='create a new account' onclick='AB.SIGNINOTP.showCreateAccountModal()'><span class='otp-link'>create a new account</span></a>",a=n.errors[0].message.replace("create a new account",t?o:e);$("#error-message-otp").html(a).focus(),AB.DATALAYER&&AB.DATALAYER.setError(n.errors[0].code,s,"email|No account found for email address")}else if(n&&n.errors&&n.errors[0]&&"CSMS0149"===n.errors[0].code)$("#error-message-otp").html("Because of multiple login attempts your account has been temporarily locked for security reasons, please try again in 1 hour."),AB.DATALAYER&&AB.DATALAYER.setError(n.errors[0].code,s,a+"|Because of multiple login attempts this account has been temporarily locked.");else if(n&&n.errors&&n.errors[0]&&"CSMS0160"===n.errors[0].code){const e=`<a tabindex='0' href=${i} aria-label='customer support'><span class='otp-link'>customer support</span></a>`,t=n.errors[0].message.replace("customer support",l||e);$("#error-message-otp").html(t).focus(),AB.DATALAYER&&AB.DATALAYER.setError(n.errors[0].code,s,a+"|Deactivated account.")}else n&&n.errors&&n.errors[0]&&"CSMS0148"===n.errors[0].code?($("#error-message-otp").html(n.errors[0].message),AB.DATALAYER&&AB.DATALAYER.setError(n.errors[0].code,s,"email|Password Expiry")):($("#error-message-otp").html("Sorry, weâre having technical difficulties, please check back later."),AB.DATALAYER&&AB.DATALAYER.setError(n&&(n.errorCode||n.errors[0].code||"000"),s,a+"|Sorry, weâre having technical difficulties, please check back later."))}}).call(AB.SIGNINOTP)},3050:e=>{function t(){let e=0==SWY.CONFIGSERVICE.featureToggleConfig?.disableMockSplashData,t="true"===document.querySelector("splash-modal")?.getAttribute("data-enable-splash-modal"),o=1==AB.isLSEnabled,n={offerId:"51432246",categoryType:"Pet Care",category:"Pet Care",description:"Automation Testing",startDate:"1680199200000",endD
1ate:"1995818400000",events:[],image:"https://ngcp-qa2.safeway.com/CMS/j4u/offers/images/test.gif",limits:"U",name:"J4U API Auto Test MF Offer J4U API Test offers - MF Scenario",brand:"J4U API Auto Test MF Offer J4U API Test offers - MF Scenario",offerPgm:"MF",offerPrice:"Save $1.00",offerSubPgm:"09",regularPrice:"2.00",offerTs:"1634546639397",offerProgramType:"ITEM_DISCOUNT",offerProtoType:"ITEM_DISCOUNT",priceType:"PP",purchaseInd:"L",purchaseRank:"23",status:"U",usageType:"U",arrivalRank:"33",expiryRank:"216",companionOfferIds:[],disclaimer:"EMJU OFFERSETUP NEPTUNE FUNCTIONAL TESTING",deleted:!1,imageId:"test",extlOfferId:"51432246-D",hierarchies:{categories:["Bread & Bakery","Pet Care"],events:[]},etag:"default"};this.initSplashModal=function(){if(!t||!o)return;let n;n=AB.firstTimeLogin?["conflictFlowComplete"]:["conflictFlowComplete","ucaProfileCheckComplete"],document.addEventListener("triggerSplashModal",t=>{if(n=n.filter(e=>e!==t.detail),0==n.length){if(AB.COMMON.isSignInPage()||this.isDealsPage()||AB.COMMON.isErumsPage()||AB.COMMON.checkForEditOrderMode()||AB.userInfo.isClosed||this.isOptanonBoxSeen()||!this.isOnAllowedPage()||this.isDefaultUserSignIn())return;let t=localStorage.getItem("splashModalDisplayed"),o=JSON.parse(localStorage.getItem("abActiveOrders"));if(o?.statusOfOrder)return void((null==t||this.isTTLExpired(t))&&this.setTTl(2));if(null==t||this.isTTLExpired(t)){if(localStorage.removeItem("splashModalDisplayed"),e)return void s();this.callSplashModalApi()}}})},this.callSplashModalApi=function(){let e=AB.splashModalHttpOptions,t={placement:"webSplash",storeId:AB.userInfo.branchId,uiPageSize:14,householdId:AB.userInfo.houseid,assortmentChannel:AB.COMMON.getUserChannel(),platform:"web"},o=window.location.origin+window.SWY.CONFIGSERVICE.wcaxXapiConfig["p13n.splashModal.basePath"];$.ajax({type:"POST",headers:e,url:o,data:JSON.stringify(t),success:e=>{$("#storeFulfillmentModal")?.data("bs.modal")?._isShown||a(e)},error:e=>{console.warn("ERRORED OUT ON SPLASH MODAL DATA FETCH",e)}})},this.dispatchSplashModalEvent=function(e){console.warn("EVENT DISPATCHED",e),document.dispatchEvent(new CustomEvent("triggerSplashModal",{detail:e}))},this.isTTLExpired=function(e){e=parseInt(e);let t=new Date(e);return!!Object.is(t.getTime(),NaN)||t<new Date},this.setTTl=function(e){let t=new Date;if(0==e)return void localStorage.setItem("splashModalDisplayed",t.getTime());let o=new Date(t.setDate(t.getDate()+e));localStorage.setItem("splashModalDisplayed",o.getTime())},this.isDealsPage=function(){return window.location.href.indexOf("foru/coupons-deals.html")>0},this.isOnAllowedPage=function(){return!!(this.urlContainsString("/shop/product-details")||this.urlContainsString("/meal-plans-recipes")||this.urlContainsString("/lp")||this.urlContainsString("/shop/search-results")||this.urlContainsString("/shop/purchases")||this.urlContainsString("/shop/aisles")||"/"==window.location.pathname)},this.isOfferDetailsPage=function(){return this.urlContainsString("foru/offer-details")},this.isMarketplacePage=function(){return this.urlContainsString("marketplace")},this.urlContainsString=function(e){return window.location.href.indexOf(e)>-1},this.isOptanonBoxSeen=function(){let e=SWY.CONFIGSERVICE.getCookie("OptanonAlertBoxClosed");return AB.COMMON.isCookieEmpty(e)},this.isDefaultUserSignIn=function(){let e=AB?.userInfo?.selectionType;return!!e&&"default"==e&&AB.firstTimeLogin};let a=function(e){SplashModalService.setTTl(1),AB?.DATALAYER&&AB.DATALAYER.setP13nExperimentExposure(e,"splash-screen"),null!=e&&null!=e.dealsInfo&&0!=e.dealsInfo.length&&window.splashModal?.zone?.run(function(){window.splashModal.component.setModalDisplayData(e.dealsInfo[0],e.p13nAdobeMetrics)})},s=function(){SplashModalService.setTTl(1),window.splashModal?.zone?.run(function(){window.splashModal.component.setModalDisplayData(n)})}}window.SplashModal=t,e.exports=t},3095:()=>{!function(){"use strict";var e="ACIP548280",t=["foru-guest","coupons-deals"];function o(){let o=window.SWY&&window.SWY.CONFIGSERVICE&&window.SWY.CONFIGSERVICE.featureToggleConfig,n=o?o.enableSavingsHub:void 0;var a=window.AB&&window.AB.experimentation;n&&a&&a.getExperimentByID(e,!1).then(function(o){var n,a=(o&&Array.isArray(o.features)?o.features:[]).find(function(t){return t&&t.featureId===e})||null;if(a&&a.eligible)switch(a.group){case"A":case"B":default:break;case"C":(n=[],document.querySelectorAll(".t_nav__toolbox_item a").forEach(function(e){var o=(e.getAttribute("href")||"").toLowerCase();t.some(function(e){return-1!==o.indexOf(e)})&&n.push(e)}
1),n).forEach(function(e){e.href="/loyalty/discovery"}),function(){if(window.location.pathname.includes("/foru-guest")){var e=document.querySelector('meta[name="redirections"]'),t=encodeURIComponent(JSON.stringify([{redirectPath:"/loyalty/discovery",userType:["R","C"]}]));e&&e.setAttribute("content",t),window.SWY&&(window.SWY.redirections=[{redirectPath:"/loyalty/discovery",userType:["R","C"]}]);var o=encodeURIComponent(window.location.origin+"/loyalty/discovery");SWY&&SWY.CONFIGSERVICE&&SWY.CONFIGSERVICE.setCookie?SWY.CONFIGSERVICE.setCookie("ECommRedirectURL",o,0):window.AB&&AB.COMMON&&AB.COMMON.setCookie&&AB.COMMON.setCookie("ECommRedirectURL",o,0)}}()}}).catch(function(){})}var n=0;function a(){if(!(n>=3)){n++;try{o()}finally{n>=3&&document.removeEventListener("headerInitialized",a)}}}document.addEventListener("headerInitialized",a),setTimeout(function(){0===n&&(console.warn("headerInitialized event not received, running updateExperimentLinks via fallback."),a())},4e3)}()},3440:()=>{(function(){var e;this.executeLazyScript=function(e){if(!window.lazyFunctions)return;let t=e.getAttribute("data-lazy-function"),o=window.lazyFunctions[t];return o?o(e):void 0},"undefined"!=typeof LazyLoad&&(e=new LazyLoad({elements_selector:".ab-lazy"})),this.lazyLoadFunctionsInstance=function(){if("undefined"!=typeof LazyLoad){let e={elements_selector:".ab-lazy-function-500",unobserve_entered:!0,callback_enter:this.executeLazyScript,thresholds:"500px 10%"};return new LazyLoad(e)}return!1},this.init=function(){"undefined"!=typeof LazyLoad&&e?e.update():console.debug("AB.LAZYLOAD.init() :: Lazy loading library is not included in this page.")}}).call(AB.LAZYLOAD)},3466:()=>{(function(){this.init=function(){console.log("init erums functions")},this.getStoreStatus=function(){AB.userInfo.isErumStore=!0,AB.userInfo.erumsGuestEnabled=!0},this.setCartId=function(e,t){this.setCartIdV2(e,t)},this.getCartId=function(e){return this.getCartIdV2(e)},this.setCartIdV2=function(e,t,o){let n=this.getCartIdObjV2(e);n[o||"abs"]=t,this.setCartIdObjV2(e,n)},this.getCartIdV2=function(e,t){let o=this.getCartIdObjV2(e);if(o)return o[t||"abs"]},this.getCartIdObjV2=function(e){let t;if(t=AB.COMMON.isLSCompatible()?localStorage.getItem(e):SWY.CONFIGSERVICE.getCookie(e),t)try{return JSON.parse(t)}catch(e){return console.warn("migrating old cart id",e),{abs:t}}return{}},this.setCartIdObjV2=function(e,t){const o=JSON.stringify(t);AB.COMMON.isLSCompatible()?localStorage.setItem(e,o):SWY.CONFIGSERVICE.setCookie(e,o,-1)},this.removeCartId=function(e,t){if(t){let o=this.getCartIdObjV2(e);o.hasOwnProperty(t)&&delete o[t],this.setCartIdObjV2(e,o)}else AB.COMMON.isLSCompatible()?localStorage.removeItem(e):document.cookie=e+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"},this.checkCartId=function(e){return!!this.getCartIdV2(e)},this.invalidateCartId=function(){this.removeCartId("cartId")}}).call(AB.COMMON)},3695:()=>{(function(){var e={chicoryFlow:!1}
1;this.signOut=async function(e,t){const o=!!SWY.CONFIGSERVICE.featureToggleConfig?.enablePasskey;try{Inq.fireCustomEvent("closeChat")}catch(e){console.error("ERROR",e.message)}const n=document.cookie;if(o){const e="ACI_F_Passkey";document.cookie=e+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"}return SWY.CONFIGSERVICE.checkforOldKMSI(n)&&(AB.COMMON.isB2BSite()?document.cookie="B_SAFEWAY_KMSI=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;":document.cookie="SAFEWAY_KMSI=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;domain="+SWY.CONFIGSERVICE.resolvedBanner+".com"),await this.healthSessionLogout(),SWY.OKTA.signOutFromOkta(e),localStorage.refresh="do refresh",localStorage.removeItem("inAppMessageContent"),localStorage.removeItem("inAppMessageState"),SWY.CONFIGSERVICE.setDomainCookie("SAFEWAY_KMSI","logout",SWY.CONFIGSERVICE.resolvedBanner+".com",0),sessionStorage.getItem("profileCompletionData")&&sessionStorage.removeItem("profileCompletionData"),sessionStorage.getItem("pastPurchaseHistory")&&sessionStorage.removeItem("pastPurchaseHistory"),null!=t?localStorage.setItem("analyticsLogoutFlag",t):localStorage.setItem("analyticsLogoutFlag",!0),!1},this.healthSessionLogout=async function(){await fetch("/health/users/healthSession",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({isLoggedOut:"true"}),mode:"cors",cache:"no-cache"})},this.silentSignOutFromOkta=function(e){if("/account/auth/service/sign-in.html"==window.location.pathname){let e,t=window.AB.COMMON.getURLParameterByName("clientId"),o=window.AB.COMMON.getURLParameterByName("redirect_uri"),n=window.AB.COMMON.getURLParameterByName("v"),a=window.AB.COMMON.getURLParameterByName("state");"2.0"===n?(e="?v="+n+"&comp_id=diff-acct",a&&(e+="&state="+a),AB.COMMON.updateRedirectURLCookie(window.location.pathname+e)):(e="?clientId="+t+"&redirect_uri="+o,a&&(e+="&state="+a),AB.COMMON.updateRedirectURLCookie(window.location.pathname+"?goto="+e))}else AB.COMMON.updateRedirectURLCookie(window.location.pathname+"?goto="+AB.COMMON.getCookie("ECommRedirectURL"));this.signOut(e)},this.silentSignOutAndForgotPasswordRedirect=function(e,t){const o=$("#"+t).attr("data-forgotPassLink");AB.COMMON.updateRedirectURLCookie(o),this.signOut(e)},this.signOutFromOkta=function(e){var t=SWY.CONFIGSERVICE.oktaConfig.url,o=SWY.CONFIGSERVICE.featureToggleConfig?.enableOssmLogout?SWY.CONFIGSERVICE.oktaConfig.ossmLogoutRedirectURI:SWY.CONFIGSERVICE.oktaConfig.logoutRedirectURI;console.log("logoutRedirectUrl",o),SWY.CONFIGSERVICE.clearLocalStroage(),localStorage.removeItem("splashModalDisplayed");var n=t+"/login/signout?fromURI="+o;window.location.replace(n)},this.signIn=function(e){let t=$("#label-email").val().trim(),o=$("#label-password").val().trim();return $("#idform"),t.length<=0||$("#errorMsgEmail")&&$("#errorMsgEmail")[0].innerHTML.length>0?$("#label-email").focus():(o.length<=0||$("#errorMsgPwd")&&$("#errorMsgPwd")[0].innerHTML.length>0)&&$("#label-password").focus(),e.preventDefault(),$("#idform").validator("validate"),$("#btnSignIn").hasClass("disabled")||($("#loaderSignIn").removeClass("mask").addClass("unmask"),$("#signInLoadingEmpty").removeClass("unmask").addClass("mask"),$("#btnSignIn").prop("disabled",!0).addClass("button-disable-color"),$("#btnSignIn").attr("aria-disabled","true"),kmsiFlag=!0,this.signInOKTA(kmsiFlag)),SWY.CONFIGSERVICE.setDomainCookie("SAFEWAY_KMSI",kmsiFlag,SWY.CONFIGSERVICE.resolvedBanner+".com",90),!1},this.signInAssistant=function(e){if(null!=localStorage.getItem("assistant_redirect_uri")&&null!=localStorage.getItem("assistant_client_id")&&null!=localStorage.getItem("assistant_scope")&&null!=localStorage.getItem("assistant_state")){let o=$("#label-email").val().trim(),n=$("#label-password").val().trim();if($("#idform"),o.length<=0||$("#errorMsgEmail")&&$("#errorMsgEmail")[0].innerHTML.length>0?$("#label-email").focus():(n.length<=0||$("#errorMsgPwd")&&$("#errorMsgPwd")[0].innerHTML.length>0)&&$("#label-password").focus(),e.preventDefault(),$("#idform").validator("validate"),!$("#btnSignIn").hasClass("disabled")){$("#loaderSignIn").removeClass("mask").addClass("unmask"),$("#signInLoadingEmpty").removeClass("unmask").addClass("mask"),$("#btnSignIn").prop("disabled",!0).addClass("button-disable-color"),$("#btnSignIn").attr("aria-disabled","true");var t=!0;0==$("#rememberMe").prop("checked")?(t=!1,console.log("kmsi false"),this.kmsi_AddAssistant(t)):(t=!0,console.log("kmsi true"),this.signInAssistantOKTA(t))}return SWY.CONFIGSERVICE.setDomainCookie("SAFEWAY_KMSI",t,SWY.CONFIGSERVICE.resolvedBanner+".com",90),!1}$("#error-message").html('<span class="error-wrong-pwd" tabindex="-1">You are not authorized to Sign-In. </span>'),$("#btnSignIn").prop("disabled",!0).removeClass("button-disable-color"),e.preventDefault()},this.signInAssistantOKTA=function(e){var t=localStorage.getItem("assistant_state"),o=new OktaAuth(SWY.CONFIGSERVICE.getOktaAssistantSignInConfig()),n=$("#label-email").val(),a=$("#label-password").val();
1if(SWY.CONFIGSERVICE.clearLocalStroage(),$("#loaderSignIn").removeClass("mask").addClass("unmask"),$("#signInLoadingEmpty").removeClass("unmask").addClass("mask"),$("#btnSignIn").prop("disabled",!0).addClass("button-disable-color"),$("#error-message").empty(),0!=n.length&&0!=a.length||($("#loaderSignIn").removeClass("unmask").addClass("mask"),$("#signInLoadingEmpty").removeClass("mask").addClass("unmask"),$("#btnSignIn").prop("disabled",!1).removeClass("button-disable-color"),$("#btnSignIn").attr("aria-disabled","false")),n.length>0&&a.length>0){var s=AB.resetPasswordPath;console.log("resetPasswordUrl",s);var r=t;o.signIn({username:n,password:a}).then(function(e){if("SUCCESS"===e.status)console.log("res.status == SUCCESS"),window.AB?.DATALAYER&&AB.DATALAYER.handleReSignIn(),$("#signin-success-msg").html("Login Sucessful"),SWY.CONFIGSERVICE.isLSEnabled&&localStorage.setItem("userSignInSuccess",!0),"true"==$("#idform").attr("data-idp")?(console.debug("data-idp is true, no prompt set"),o.token.getWithRedirect({sessionToken:e.sessionToken,responseType:"code",state:r,scope:["openid","profile","email","offline_access","used_credentials"]})):(console.debug("data-idp is false, prompt set to none"),o.token.getWithRedirect({sessionToken:e.sessionToken,responseType:"code",prompt:"none",state:r,scope:["openid","profile","email","offline_access","used_credentials"]}));else if("PASSWORD_EXPIRED"===e.status){console.log("res.status == PASSWORD_EXPIRED");var t=$("#resetPasswordLink").val();window.location=t}else"LOCKED_OUT"===e.status?($("#error-message").html('<span class="error-wrong-pwd" tabindex="-1">Because of multiple login attempts your account has been temporarily locked for security reasons, please try again in 1 hour.</span>'),$("#loaderSignIn").removeClass("unmask").addClass("mask"),$("#signInLoadingEmpty").removeClass("mask").addClass("unmask"),$("#btnSignIn").prop("disabled",!1).removeClass("button-disable-color"),$("#btnSignIn").attr("aria-disabled","false")):($("#loaderSignIn").removeClass("unmask").addClass("mask"),$("#signInLoadingEmpty").removeClass("mask").addClass("unmask"),$("#btnSignIn").prop("disabled",!1).removeClass("button-disable-color"),$("#btnSignIn").attr("aria-disabled","false"))}).catch(function(e){console.log("Login failed",e),$("#loaderSignIn").removeClass("unmask").addClass("mask"),$("#signInLoadingEmpty").removeClass("mask").addClass("unmask"),$("#error-message").removeClass("d-none"),$("#btnSignIn").attr("data-forgotPwdLink")&&(s=$("#btnSignIn").attr("data-forgotPwdLink")+".html");var t="";if("E0000004"==e.errorCode){const o=$("#idform").attr("data-createAccount")||"/account/short-registration.html";$("#error-message").html(`<span class="error-wrong-pwd" tabindex="-1">The email address or password entered doesn't match our records. Please make sure your email is correct or create a new account <a style="text-decoration: underline;color: #dd1e25;" href=${o} aria-label="here - opens a new registration tab "> here</a>.</span>`),t=$(".error-wrong-pwd").text(),AB.DATALAYER.setError(e.errorCode,"sign_in_error",t)}else 0===e.xhr.status?$("#error-message").html('<span class="error-wrong-pwd" tabindex="-1">Sorry, we're having technical difficulties, please check back later.</span>'):($("#error-message").html('<span class="error-wrong-pwd" tabindex="-1">Sorry, we're having technical difficulties and working on fixing them, please check back later.</span>'),t=$(".error-wrong-pwd").text(),e.errorCode?AB.DATALAYER.setError(e.errorCode,"sign_in_error",e.errorMessage):AB.DATALAYER.setError("E00000041","sign_in_error",e.errorMessage));$("#btnSignIn").prop("disabled",!1).removeClass("button-disable-color"),$("#btnSignIn").attr("aria-disabled","false"),$(".error-wrong-pwd").blur(),$(".error-wrong-pwd").focus()})}else console.log("Email and password are required"),$("#btnSignIn").prop("disabled",!1).removeClass("button-disable-color"),$("#btnSignIn").attr("aria-disabled","false");return!1},this.signInOKTA=function(t){var o=new OktaAuth(SWY.CONFIGSERVICE.getOktaConfig()),n=$("#label-email").val(),a=$("#label-password").val();
1if(SWY.CONFIGSERVICE.clearLocalStroage(),sessionStorage.getItem("ppUsername")&&sessionStorage.removeItem("ppUsername"),$("#loaderSignIn").removeClass("mask").addClass("unmask"),$("#signInLoadingEmpty").removeClass("unmask").addClass("mask"),$("#btnSignIn").prop("disabled",!0).addClass("button-disable-color"),$("#error-message").empty(),0!=n.length&&0!=a.length||($("#loaderSignIn").removeClass("unmask").addClass("mask"),$("#signInLoadingEmpty").removeClass("mask").addClass("unmask"),$("#btnSignIn").prop("disabled",!1).removeClass("button-disable-color"),$("#btnSignIn").attr("aria-disabled","false")),n.length>0&&a.length>0){var s=AB.resetPasswordPath;console.log("resetPasswordUrl",s);var r=SWY.OKTA.generateWords(4);o.signIn({username:n,password:a}).then(function(t){if("SUCCESS"===t.status)if(console.log("res.status == SUCCESS"),window.AB?.DATALAYER&&AB.DATALAYER.handleReSignIn(),$("#signin-success-msg").html("Login Sucessful"),SWY.CONFIGSERVICE.isLSEnabled&&localStorage.setItem("userSignInSuccess",!0),e.chicoryFlow){let o=t&&t.user&&t.user.id?t.user.id:"",n=t&&t.sessionToken?t.sessionToken:"",a=window.AB.COMMON.getURLParameterByName("state");SWY.OKTA.getGrantsAndRedirect(o,n,e.clientId,e.redirectUri,a)}else"true"==$("#idform").attr("data-idp")?(console.debug("data-idp is true, no prompt set"),o.token.getWithRedirect({sessionToken:t.sessionToken,responseType:"code",state:r,scope:["openid","profile","email","offline_access","used_credentials"]})):(console.debug("data-idp is false, prompt set to none"),o.token.getWithRedirect({sessionToken:t.sessionToken,responseType:"code",prompt:"none",state:r,scope:["openid","profile","email","offline_access","used_credentials"]}));else if("PASSWORD_EXPIRED"===t.status){console.log("res.status == PASSWORD_EXPIRED");var n=$("#resetPasswordLink").val();window.location=n}else"LOCKED_OUT"===t.status?($("#error-message").html('<span class="error-wrong-pwd" tabindex="-1">Because of multiple login attempts your account has been temporarily locked for security reasons, please try again in 1 hour.</span>'),$("#loaderSignIn").removeClass("unmask").addClass("mask"),$("#signInLoadingEmpty").removeClass("mask").addClass("unmask"),$("#btnSignIn").prop("disabled",!1).removeClass("button-disable-color"),$("#btnSignIn").attr("aria-disabled","false")):($("#loaderSignIn").removeClass("unmask").addClass("mask"),$("#signInLoadingEmpty").removeClass("mask").addClass("unmask"),$("#btnSignIn").prop("disabled",!1).removeClass("button-disable-color"),$("#btnSignIn").attr("aria-disabled","false"))}).catch(function(t){console.log("Login failed",t),$("#loaderSignIn").removeClass("unmask").addClass("mask"),$("#signInLoadingEmpty").removeClass("mask").addClass("unmask"),$("#error-message").removeClass("d-none"),$("#btnSignIn").attr("data-forgotPwdLink")&&(s=$("#btnSignIn").attr("data-forgotPwdLink")+".html");var o="";if("E0000004"==t.errorCode){let n=$("#idform").attr("data-createAccount")||"/account/short-registration.html";e.chicoryFlow&&(n+="?clientId="+e.clientId+"&redirect_uri="+e.redirectUri),$("#error-message").html(`<span class="error-wrong-pwd" tabindex="-1">The email address or password entered doesn't match our records. Please make sure your email is correct or create a new account <a style="text-decoration: underline;color: #dd1e25;" href=${n} aria-label="here - opens a new registration tab "> here</a>.</span>`),o=$(".error-wrong-pwd").text(),AB.DATALAYER.setError(t.errorCode,"sign_in_error",o)}else 0===t.xhr.status?$("#error-message").html('<span class="error-wrong-pwd" tabindex="-1">Sorry, we're having technical difficulties, please check back later.</span>'):($("#error-message").html('<span class="error-wrong-pwd" tabindex="-1">Sorry, we're having technical difficulties and working on fixing them, please check back later.</span>'),o=$(".error-wrong-pwd").text(),t.errorCode?AB.DATALAYER.setError(t.errorCode,"sign_in_error",t.errorMessage):AB.DATALAYER.setError("E00000041","sign_in_error",t.errorMessage));$("#btnSignIn").prop("disabled",!1).removeClass("button-disable-color"),$("#btnSignIn").attr("aria-disabled","false"),$(".error-wrong-pwd").blur(),$(".error-wrong-pwd").focus()})}else console.log("Email and password are required"),$("#btnSignIn").prop("disabled",!1).removeClass("button-disable-color"),$("#btnSignIn").attr("aria-disabled","false");return!1},this.getGrantsAndRedirect=function(e,t,o,n,a){var s=SWY.CONFIGSERVICE.oktaConfig.thirdPartyUrl+"/"+SWY.CONFIGSERVICE.oktaConfig.thirdPartyOauth2ServerId+"/v1/authorize?client_id="+o+"&redirect_uri="+n+"&response_type=code&response_mode=query&prompt=&nonce=ovJgrUobDYQKhiownVT9jU1GvtkRdpC4Eoyal2SfgGu6ezXG5b03393l08xbDGw8&scope=openid%20loyalty%20cart&sessionToken="+t;s+=a?"&state="+a:"&state="+SWY.OKTA.generateWords(4),window.location.href=s},this.ssoSignIn=function(e,t){var o="ssoSignIn";SWY.CONFIGSERVICE.setCookie("ECommSignInCount",1,0),console.debug(o+" ENTRY: targetBanner="+e);var n=SWY.CONFIGSERVICE.bannerDomainMap[e]+SWY.ssoPath;t&&(n+="?ml="+t),console.debug(o+" signInURL="+n),window.location.href=n},this.kmsi_AddAssistant=function(e){var t=AB.kmsiHttpOptions,o=$("#label-email").val(),n=$("#label-password").val(),a=JSON.stringify({emailId:o,password:n});$.ajax({url:AB.kmsiPath,type:"POST",data:a,headers:t,success:function(t){localStorage.setItem("kmsiID",JSON.stringify(t)),SWY.OKTA.signInAssistant(e),console.log("kmsi SUCESS:")},error:function(t){SWY.OKTA.signInAssistant(e),console.log("kmsi ERROR:",t)}})},this.kmsi_Delete=function(e){var t=AB.kmsiHttpOptions;$.ajax({url:AB.kmsiPath+"/"+e,type:"DELETE",headers:t,success:function(e){console.log("kmsi-deleted success:",e),localStorage.removeItem("kmsiID")},error:function(e){console.log("kmsi deleted error:",e)}})},this.sendOneTimePasscode=function(e){const t=AB.userInfo.otpData.nonKmsiId,o=sessionStorage.getItem("triggerKMSIDelete")||"",n=$("#email-mobile-otp").val().trim();if(AB.userInfo.otpData.sendPasscodeTo&&AB.userInfo.otpData.sendPasscodeTo.value.length>0){AB.userInfo.otpData.sendPasscodeTo.value!==n&&this.updateUserInfoData(n);const a=$("#rememberMe-otp"),s=$("#email-mobile-otp").val().trim(),r
1=s.includes("@")?{emailAddress:s}:{phoneNumber:s};AB.SIGNINOTP.showSpinner("update-otp-continue-btn"),AB.ucaSignInOtpOtpions||AB.postInitializeObject(),0==a.prop("checked")&&AB.SIGNINOTP.addNonKmsi(r),$.ajax({type:"POST",headers:AB.ucaSignInOtpOtpions,url:SWY.CONFIGSERVICE.oktaConfig.url+"/api/v1/authn",dataType:"json",data:JSON.stringify({username:AB.userInfo.otpData.sendPasscodeTo.value}),success:function(n){$("#error-message-otp").html(null),AB.userInfo.otpData.stateToken=n.stateToken,AB.userInfo.otpData.expiresAt=n.expiresAt;const a="emailAddress"===AB.userInfo.otpData.sendPasscodeTo.mode?"email":"sms";n._embedded.factors.some(e=>a===e.factorType&&("sms"===e.factorType||"email"===e.factorType)&&(AB.userInfo.otpData.factorId=e.id,!0))?(SWY.OKTA.sendOTPCode(),"true"===o&&AB.SIGNINOTP.deleteKmsi(t)):(AB.SIGNINOTP.callAlternateSignInApi(e),"true"===o&&AB.SIGNINOTP.deleteKmsi(t))},error:function(e,t,o){AB.SIGNINOTP.hideSpinner("update-otp-continue-btn"),$("#error-message-otp").html("Sorry, we're having technical difficulties, please check back later.")}})}},this.updateUserInfoData=function(e){const t=$("#email-mobile-otp").data("mobile-pattern");let o=new RegExp(t).test(e)?"mobileNumber":"emailAddress";AB.userInfo.otpData.sendPasscodeTo={mode:o,value:e}},this.sendOTPCode=function(){$.ajax({type:"POST",headers:AB.ucaSignInOtpOtpions,url:SWY.CONFIGSERVICE.oktaConfig.url+"/api/v1/authn/factors/"+AB.userInfo.otpData.factorId+"/verify",dataType:"json",data:JSON.stringify({stateToken:AB.userInfo.otpData.stateToken}),success:function(e){const t=AB.userInfo.otpData.nonKmsiId;"true"===(sessionStorage.getItem("triggerKMSIDelete")||"")&&AB.SIGNINOTP.deleteKmsi(t),$("#error-message-otp").html(null),AB.userInfo.otpData.userID=e._embedded.user&&e._embedded.user.id,AB.userInfo.otpData.expiresAt=e.expiresAt,AB.SIGNINOTP.hideSpinner("update-otp-continue-btn"),AB.SIGNINOTP.onVerifyOTPLoad(),AB.SIGNINOTP.showHideSection(["verify-otp-modal","verify-otp-modal-buttons"],["otp-modal","otp-modal-buttons"])},error:function(e,t,o){AB.SIGNINOTP.hideSpinner("update-otp-continue-btn"),!e.responseJSON||"E0000109"!==e.responseJSON.errorCode&&"E0000118"!==e.responseJSON.errorCode?$("#error-message-otp").html("Sorry, we're having technical difficulties, please check back later."):$("#error-message-otp").html("Please wait 30 seconds before trying to resend another code")}})},this.signInWithOTP=function(t,o,n,a){AB.DATALAYER.setLinkClickSignInEcom("otp"),AB.SIGNINOTP.showSpinner(o);const s=a?"password":AB.userInfo.otpData.factorId;AB.userInfo.otpData.userID,$.ajax({type:"POST",headers:AB.ucaSignInOtpOtpions,url:SWY.CONFIGSERVICE.oktaConfig.url+"/api/v1/authn/factors/"+s+"/verify",dataType:"json",data:JSON.stringify({stateToken:AB.userInfo.otpData.stateToken,passCode:t}),success:function(t){if($("#error-message-otp").html(null),"SUCCESS"===t.status)if(e.chicoryFlow){let o=t&&t._embedded&&t._embedded.user&&t._embedded.user.id?t._embedded.user.id:"",n=t&&t.sessionToken?t.sessionToken:"",a=window.AB.COMMON.getURLParameterByName("state");SWY.OKTA.getGrantsAndRedirect(o,n,e.clientId,e.redirectUri,a)}else{let e=sessionStorage.getItem("OTPmode");e&&(localStorage.setItem("otp_sign_in",e),sessionStorage.removeItem("OTPmode")),window.AB?.DATALAYER&&AB.DATALAYER.handleReSignIn(),SWY.CONFIGSERVICE.isLSEnabled&&localStorage.setItem("userSignInSuccess",!0);var n=SWY.CONFIGSERVICE.getOktaConfig().issuer+"/v1/authorize?client_id="+SWY.CONFIGSERVICE.getOktaConfig().clientId+"&redirect_uri="+SWY.CONFIGSERVICE.getOktaConfig().redirectUri+"&response_type=code&response_mode=query&state="+SWY.OKTA.generateWords(4)+"&nonce=ovJgrUobDYQKhiownVT9jU1GvtkRdpC4Eoyal2SfgGu6ezXG5b03393l08xbDGw8&scope=openid%20profile%20email%20offline_access%20used_credentials&sessionToken="+t.sessionToken;window.location.href=n}else"LOCKED_OUT"===t.status?(AB.SIGNINOTP.hideSpinner(o),$("#error-message-otp").html("Because of multiple login attempts your account has been temporarily locked for security reasons, please try again in 1 hour.")):"PASSWORD_EXPIRED"===t.status&&(AB.SIGNINOTP.hideSpinner(o),$("#error-message-otp").html("User might have started password reset that was never completed."))}
1,error:function(t,s,r){AB.SIGNINOTP.hideSpinner(o);const i=t.responseJSON;let l=sessionStorage.getItem("OTPmode"),d="OTP-error";if(i&&"E0000068"===i.errorCode&&!a)$("#error-message-otp").html(null),$("#invalied-otp").text("The verification code you entered is incorrect. Please try again.").focus(),$("#invalied-otp").closest(".form-group").addClass("has-error has-danger"),AB.DATALAYER&&AB.DATALAYER.setError(i.errorCode,d,l+"|OTP errors invalid passcode");else if(i&&"E0000068"===i.errorCode&&a){let t=$("#signInOTPForm").attr("data-createAccount")||"/account/short-registration.html";e.chicoryFlow&&(t+="?clientId="+e.clientId+"&redirect_uri="+e.redirectUri);const o=`<a tabindex='0' href=${t}><span class='otp-link'>create a new account</span></a>`,a="<span tabindex='0' class='otp-link' role='button' onclick='AB.SIGNINOTP.showCreateAccountModal()'>create a new account</span>";$("#error-message-otp").html("The password entered doesn't match our records. Please make sure your info is correct or "+(n?a:o)+".").focus(),AB.DATALAYER&&AB.DATALAYER.setError(i.errorCode,d,l+"|invalid password")}else i&&"E0000011"===i.errorCode&&!a?($("#error-message-otp").html(null),$("#invalied-otp").text('The verification code you entered has expired. Click "resend code" to get a new one.').focus(),$("#invalied-otp").closest(".form-group").addClass("has-error has-danger"),AB.DATALAYER&&AB.DATALAYER.setError(i.errorCode,d,l+"|OTP errors expired")):i&&"E0000011"===i.errorCode&&a?(AB.userInfo.otpData.tokenExpiredError=!0,AB.SIGNINOTP.showHideSection(["otp-modal","otp-modal-buttons"],["enter-password-modal","enter-password-modal-buttons"]),AB.SIGNINOTP.stateTokenExpiryCheck(),AB.DATALAYER&&AB.DATALAYER.setError(i.errorCode,d,l+"|enter password")):!i||"E0000069"!==i.errorCode&&"E0000079"!==i.errorCode?($("#error-message-otp").html("Sorry, we're having technical difficulties, please check back later."),AB.DATALAYER&&AB.DATALAYER.setError(i.errorCode,d,l+"|technical error")):($("#error-message-otp").html("Because of multiple login attempts your account has been temporarily locked for security reasons, please try again in 1 hour."),AB.DATALAYER&&AB.DATALAYER.setError(i.errorCode,d,l+"|OTP errors user locked"))}})},this.signInOKTA_pharmacy=function(e,t){return new Promise(function(e,o){var n=new OktaAuth(SWY.CONFIGSERVICE.getOktaConfig()),a=t.email,s=t.password;SWY.CONFIGSERVICE.clearLocalStroage();var r=AB.resetPasswordPath;console.log("resetPasswordUrl",r);var i=SWY.OKTA.generateWords(4);n.signIn({username:a,password:s}).then(function(t){if("SUCCESS"===t.status){console.log("res.status == SUCCESS");let o=window.location.search?window.location.search+"&sendToHealthApp=true":"?sendToHealthApp=true";SWY.CONFIGSERVICE.setCookie("ECommRedirectURL",SWY.CONFIGSERVICE.pharmacyRxConfig["rx.pharmacy.create.account.page.path"]+o,1),SWY.CONFIGSERVICE.isLSEnabled&&localStorage.setItem("userSignInSuccess",!0),AB.DATALAYER&&AB.DATALAYER.setLinkClickEvents("household|grocery-log-in-success"),n.token.getWithRedirect({sessionToken:t.sessionToken,responseType:"code",prompt:"none",state:i,scope:["openid","profile","email","offline_access","used_credentials"]}),e(t)}else if("PASSWORD_EXPIRED"===t.status){console.log("res.status == PASSWORD_EXPIRED");var a=$("#resetPasswordLink").val();window.location=a}else o(t)}).catch(function(e){console.log("Login failed",e),o(e)})})},$(document).ready(function(){if(-1!=window.location.pathname.search("account")&&window.location.search.indexOf("emailToken")>-1){AB.COMMON.setCookie("ECommRedirectURL","/customer-account/communication-preference",1);var e=new URLSearchParams(window.location.search).get("emailToken"),t=AB.ucaHttpOptionsV3;delete t.Authorization,e&&$.ajax({url:AB.anonymousUnsubscribe+"?token="+e,type:"GET",headers:t,success:function(e){console.log("Email from unsubscribe returned:",e.emailAddress),null!=$("#input-email")&&($("#input-email").val(e.emailAddress),$("#input-email").blur(),$("#input-email").attr("disabled","true")),null!=$("#label-email")&&($("#label-email").val(e.emailAddress),$("#label-email").attr("disabled","true"))},error:function(e){console.log("Failed to return emailAddress from unsubscribe API",e)}})}-1!=window.location.pathname.search("account")&&window.location.search.indexOf("progProfUser")>-1&&AB.COMMON.prepopulateEmailFieldProgProf()})}).call(SWY.OKTA)},4404:()=>{AB.postInitializeObject=function(){const e=()=>SWY.CONFIGSERVICE.getDatapowerConfig(),t=()=>SWY.CONFIGSERVICE.getResolvedBanner(),o=()=>e().cncSubscriptionKey,n=()=>"Bearer "+AB.userInfo.SWY_SHOP_TOKEN;function a(e,n){const a="application/vnd.safeway."+e+"+json",s={Accept:a,"x-swy-banner":t(),"Ocp-Apim-Subscription-Key":o(),"Content-Type":a,"x-swy-client-name":"web-portal","x-swy-correlation-id":AB.COMMON.generateUUID(),"x-swy-date":new Date,"Cache-Control":"no-cache"};
1return n&&Object.assign(s,n),Object.keys(s).forEach(e=>{void 0===s[e]&&delete s[e]}),s}const s={weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"};function r(){return{Accept:"application/vnd.safeway.v1+json","x-swy_banner":t(),"Ocp-Apim-Subscription-Key":o(),"Content-Type":"application/vnd.safeway.v1+json","x-swy-correlation-id":AB.COMMON.generateUUID(),"x-swy-date":(new Date).toString(),"x-swy-client-id":"web-portal",Authorization:n()}}function i(){return{Accept:"application/vnd.albertsons.v1+json","Content-Type":"application/vnd.albertsons.v1+json","x-abs-client":"WEB",Authorization:n(),"ppms-apim-subscription-key":e().ppmsApimSubscriptionKey,"x-abs-banner":t()}}Object.defineProperty(AB,"ucaHttpOptionsPatch",{get:function(){const e=a("v1",{"Content-Type":"application/vnd.safeway.v1.merge-patch+json"});return e["X-SWY_BANNER"]=t(),delete e["x-swy-banner"],e}}),Object.defineProperty(AB,"catalogCbaHttpOptions",{get:()=>({"X-SWY_BANNER":t(),"Ocp-Apim-Subscription-Key":SWY.CONFIGSERVICE.searchConfig.apimSubscriptionKey,"Content-Type":"application/json","Cache-Control":"no-cache"})}),Object.defineProperty(AB,"ucaSignInOtpOtpions",{get:()=>({"Content-Type":"application/json",Accept:"application/json"})}),Object.defineProperty(AB,"ucaSignInOtpNonKmsiOtpions",{get:function(){const o=e(),n=(new Date).toLocaleDateString("en-US",s);return{"Content-Type":"application/vnd.safeway.v2+json",Accept:"application/vnd.safeway.v2+json","X-SWY_BANNER":t(),"Ocp-Apim-Subscription-Key":o.cncSubscriptionKey,"X-IBM-Client-Id":o.clientId,"X-IBM-Client-Secret":o.clientSecret,"x-swy-client-id":"web-portal","x-swy-correlation-id":AB.COMMON.generateUUID(),"x-swy-date":n,"Cache-Control":"yes"}}}),Object.defineProperty(AB,"ucaHttpOptions",{get:function(){return a("v1",{"X-SWY_BANNER":t(),"x-swy-client-id":"web-portal"})}}),Object.defineProperty(AB,"ucaHttpOptionsUpdateProfileV2",{get:function(){return a("v2",{Authorization:n(),SWY_SSO_TOKEN:AB.userInfo.SWY_SHOP_TOKEN,"x-swy-correlation-id":"dc1ddfce-39ed-11e8-b467-0ed5f89f718b","x-swy-date":void 0})}}),Object.defineProperty(AB,"ucaHttpOptionsFulfillmentServlet",{get:function(){return a("v1",{Authorization:n(),SWY_SSO_TOKEN:AB.userInfo.SWY_SHOP_TOKEN})}}),Object.defineProperty(AB,"ucaHttpOptionsGetProfile",{get:function(){return a("v2",{Authorization:n(),SWY_SSO_TOKEN:AB.userInfo.SWY_SHOP_TOKEN,"X-SWY_BANNER":t(),"x-swy-client-id":"web-portal"})}}),Object.defineProperty(AB,"ucaHttpOptionsUpdateBirthdayProfile",{get:function(){return{Accept:"application/vnd.safeway.v2+json",Authorization:n(),"X-Swy_banner":t(),"x-swy-banner":t(),"Ocp-Apim-Subscription-Key":o(),"Content-Type":"application/vnd.safeway.v2.merge-patch+json","X-Swy-Correlation-Id":AB.COMMON.generateUUID(),"X-Swy-Date":new Date,"X-Swy-Client-Id":"web-portal","Cache-Control":"no-cache"}}}),Object.defineProperty(AB,"ucaHttpOptionsGetProfileV2",{get:function(){return{Accept:"application/vnd.safeway.v3+json",Authorization:n(),"x-swy-banner":t(),"x-swy-client-name":"web-portal","ocp-Apim-Subscription-Key":o(),"Content-Type":"application/vnd.safeway.v3+json","x-swy-date":(new Date).toString(),"x-swy-correlation-id":AB.COMMON.generateUUID(),"x-swy-client-id":"web-portal","Cache-Control":"no-cache"}}}),Object.defineProperty(AB,"ucaHttpOptionsSearch",{get:()=>a("v5",{Authorization:n(),"x-swy-client-id":"web-portal"})}),Object.defineProperty(AB,"ucaCSMSHttpOptionsRx",{get:()=>a("v1",{Authorization:n()})}),Object.defineProperty(AB,"ucaHttpOptionsV2",{get:()=>a("v2")}),Object.defineProperty(AB,"ucaHttpOptionsGetProfileV2NoDate",{get:()=>a("v2",{"x-swy-date":void 0})}),Object.defineProperty(AB,"ucaHttpOptionsV3",{get:()=>a("v3",{Authorization:n()})}),Object.defineProperty(AB,"ucaHttpOptionsV3Patch",{get:function(){return a("v3",{"Content-Type":"application/vnd.safeway.v3.merge-patch+json","x-swy-date":(new Date).toString(),"x-swy-client-id":"web-portal",Authorization:n()})}}),Object.defineProperty(AB,"ucaHttpOptionsLoyaltyPartners",{post:r,get:r}),Object.defineProperty(AB,"petProfile",{post:i,put:i,get:i,delete:i}),Object.defineProperty(AB,"payeezyHttpOptions",{get:function(){return{Accept:"application/vnd.safeway.v1+json",Authorization:n(),"Ocp-Apim-Subscription-Key":o(),"Content-Type":"application/vnd.safeway.v1+json","x-swy-correlation-id":AB.COMMON.generateUUID(),Date:new Date,"x-swy-client-name":"web-portal","Cache-Control":"no-cache","x-swy-request-id":AB.COMMON.generateUUID()}}}),Object.defineProperty(AB,"chasePayeezyHttpOptions",{get:function(){return{Accept:"application/vnd.safeway.v1+json",Authorization:n(),"Ocp-Apim-Subscription-Key":e().chaseSubscriptionKey,"Content-Type":"application/vnd.safeway.v1+json","x-swy-correlation-id":AB.COMMON.generateUUID(),Date:new Date,"x-swy-client-name":"web-portal","Cache-Control":"no-cache","x-swy-request-id":AB.COMMON.generateUUID()}}}),Object.defineProperty(AB,"kmsiHttpOptions",{get:function(){const o=e(),n=(new Date).toLocaleDateString("en-US",s);return{Accept:"application/vnd.safeway.v1+json","X-SWY_BANNER":t(),"Ocp-Apim-Subscription-Key":o.cncSubscriptionKey,"X-IBM-Client-Id":o.clientId,"X-IBM-Client-Secret":o.clientSecret,"Content-Type":"application/vnd.safeway.v1+json","x-swy-client-id":"web-portal","x-swy-correlation-id":AB.COMMON.generateUUID(),"x-swy-date":n,"Cache-Control":"yes"}}}),Object.defineProperty(AB,"ecommHttpOptions",{get:function(){const o=e();
1return{"X-SWY_BANNER":t(),"X-IBM-Client-Id":o.clientId,"X-IBM-Client-Secret":o.clientSecret,SWY_SHOP_TOKEN:AB.userInfo.SWY_SHOP_TOKEN}}}),Object.defineProperty(AB,"emrbRewardsHeader",{get:function(){const o=e(),n={"X-SWY_BANNER":t(),"X-IBM-Client-Id":o.extClientId,"X-IBM-Client-Secret":o.extClientSecret,"Cache-Control":"no-cache"};return AB.COMMON.authorize()&&(n.SWY_SSO_TOKEN=AB.userInfo.SWY_SHOP_TOKEN),n}}),Object.defineProperty(AB,"ecommHttpOptionsErums",{get:()=>({accept:"application/json","Content-Type":"application/json",Authorization:n(),"ocp-apim-subscription-key":SWY.CONFIGSERVICE.erumsConfig["apim.key"]})}),Object.defineProperty(AB,"deliverySubHttpOptions",{get:function(){const o=e();return{Authorization:n(),Accept:"application/vnd.safeway.v2+json",banner:t(),"X-IBM-Client-Id":o.clientId,"X-IBM-Client-Secret":o.clientSecret,"Content-Type":"application/json","x-swy-client-id":"web-portal","X-SWY_BANNER":t(),"cache-control":"no-cache"}}}),Object.defineProperty(AB,"deliverySubJavaHttpOptions",{get:()=>({Authorization:n(),Accept:"application/vnd.safeway.v2+json",banner:t(),"ocp-apim-subscription-key":SWY.CONFIGSERVICE.erumsConfig["apim.key"],"Content-Type":"application/json","x-swy-client-id":"web-portal","X-SWY_BANNER":t(),"cache-control":"no-cache"})}),Object.defineProperty(AB,"companionOffersxAPIHttpOptions",{configurable:!0,get:function(){const e={"Content-Type":"application/vnd.safeway.v2+json",Accept:"application/json","X-SWY-APPLICATION-TYPE":"web","X-SWY_API_KEY":"emjou","X-SWY_VERSION":"1.1","X-SWY_BANNER":t()};return AB.COMMON.authorize()&&(e.Authorization="Bearer "+AB.userInfo.SWY_SHOP_TOKEN),e}}),Object.defineProperty(AB,"lastOrderErumsHttpOptions",{configurable:!0,get:function(){const e={"ocp-apim-subscription-key":SWY.CONFIGSERVICE.erumsConfig["apim.key"]};return AB.COMMON.authorize()&&(e.Authorization="Bearer "+AB.userInfo.SWY_SHOP_TOKEN),e}}),Object.defineProperty(AB,"xAPICheckUnclipDetail",{configurable:!0,get:()=>({Authorization:n(),"Content-Type":"application/vnd.safeway.v1+json","ocp-apim-subscription-key":AB.ocrpRewardsXapiApimKey,"x-swy-correlation-id":AB.COMMON.generateUUID()})}),Object.defineProperty(AB,"xAPIstoreResolverHttpOptions",{configurable:!0,get:()=>({"ocp-apim-subscription-key":AB.wcaxXapiApimKey})}),Object.defineProperty(AB,"xAPIOcrpRewardsHttpNoAuth",{configurable:!0,get:()=>({"Content-Type":"application/vnd.safeway.v1+json","ocp-apim-subscription-key":AB.ocrpRewardsXapiApimKey,"x-swy-correlation-id":AB.COMMON.generateUUID()})}),Object.defineProperty(AB,"xAPIOcrpRewardsHttpOptions",{configurable:!0,get:()=>({"Content-Type":"application/vnd.safeway.v1+json","ocp-apim-subscription-key":AB.ocrpRewardsXapiApimKey,"x-swy-correlation-id":AB.COMMON.generateUUID(),Authorization:n()})}),Object.defineProperty(AB,"ucaDecryptionApiHttpOptions",{configurable:!0,get:()=>({"Content-Type":"application/vnd.safeway.v2+json",Accept:"application/vnd.safeway.v2+json","x-swy-client-id":"web-portal","x-swy-correlation-id":AB.COMMON.generateUUID(),"Ocp-Apim-Subscription-Key":o()})}),Object.defineProperty(AB,"xAPIOcrpRewardsHttpOptionsV2",{configurable:!0,get:()=>({"Content-Type":"application/vnd.safeway.v2+json","ocp-apim-subscription-key":AB.ocrpRewardsXapiApimKey,"x-swy-correlation-id":AB.COMMON.generateUUID(),Authorization:n()})}),Object.defineProperty(AB,"xAPIOcrpRewardsHttpOptionsV3",{configurable:!0,get:()=>({"Content-Type":"application/vnd.safeway.v3+json","ocp-apim-subscription-key":AB.ocrpRewardsXapiApimKey,"x-swy-correlation-id":AB.COMMON.generateUUID(),Authorization:n(),"X-ABS-Client-ID":"WEB"})}),Object.defineProperty(AB,"j4UEligibilityOfferOption",{configurable:!0,get:()=>({Accept:"application/vnd.safeway.v1+json","x-swy-correlation-id":AB.COMMON.generateUUID()})}),Object.defineProperty(AB,"ecommHttpOptionsOsdp",{get:()=>({accept:"application/json","Content-Type":"application/json",Authorization:n(),"ocp-apim-subscription-key":SWY.CONFIGSERVICE.osdpConfig["osdp.apim.key"],storeId:AB.userInfo.branchId,clientId:"CC",pageSource:"HOME"})}),Object.defineProperty(AB,"gamePlayHttpOptions",{get:function(){const e={Accept:"application/vnd.safeway.v1+json","Content-Type":"application/vnd.safeway.v1+json","ocp-apim-subscription-key":AB.ocgp.apimKey,storeId:AB.userInfo.branchId,entry:"web",banner:t(),"correlation-id":AB.COMMON.generateUUID()};return AB.userInfo.SWY_SHOP_TOKEN&&(e.Authorization="Bearer "+AB.userInfo.SWY_SHOP_TOKEN),e}}),Object.defineProperties(AB,{sellerShippingMethodsOptions:{get:()=>({"Ocp-Apim-Subscription-Key":AB.sellerShipMethodsSubKey,"Content-Type":"application/json"})},wineShippingMethodsOptions:{get:()=>({"Ocp-Apim-Subscription-Key":AB.wineLandingPromiseSubKey,"Content-Type":"application/json"})},rewardUnclipHttpOptions:{get:()=>({"X-SWY_API_KEY":"emjou","X-SWY_VERSION":"1.0",SWY_BANNER:t(),Authorization:n(),"Content-Type":"application/json"})},splashModalHttpOptions:{get:()=>({"Content-Type":"application/vnd.safeway.v2+json","Ocp-Apim-Subscription-Key":window.SWY.CONFIGSERVICE.searchConfig.apimP13nSubscriptionKey,"X-access-token":window.AB.userInfo.SWY_SHOP_TOKEN,platform:"web"})},fulfillmentServlet:{configurable:!0,get:()=>"/bin/safeway/fulfillment"}}),Object.defineProperty(AB,"mergeAccountsHttpHeader",{configurable:!0,get:function(){const e={"Content-Type":"application/vnd.safeway.v1+json",Accept:"application/vnd.safeway.v1+json","x-abs-client-id":"web-portal","x-abs-correlation-id":AB.COMMON.generateUUID(),"x-abs-request-id":AB.COMMON.generateUUID(),"x-abs-banner-id":t(),"Ocp-Apim-Subscription-Key":o()};return AB.COMMON.authorize()&&(e.Authorization="Bearer "+AB.userInfo.SWY_SHOP_TOKEN),e}}),Object.defineProperty(AB,"clippedCouponsHttpHeader",{configurable:!0,get:function(){const e={"Content-Type":"application/vnd.safeway.v2+json","X-SWY_API_KEY":"wcax","X-SWY_VERSION":"3.0","X-SWY_BANNER":t()};return AB.COMMON.authorize()&&(e.Authorization="Bearer "+AB.userInfo.SWY_SHOP_TOKEN),e}})}},4575:(e,t,o)=>{const n=o(9744),a=o(6708),s=n.createSafely(a.prototype),r=!!(window.SWY&&window.SWY.CONFIGSERVICE&&window.SWY.CONFIGSERVICE.featureToggleConfig&&window.SWY.CONFIGSERVICE.featureToggleConfig.isShopByLazyLoadedDisabled);$(document).ready(function(){r?s.init():(window.lazyFunctions=window.lazyFunctions||{},window.lazyFunctions.lazyShopByCategoryContent=function(){s.init()})})},4929:(e,t,o)=>{const n=o(8474);!function(e){const t=e.AB=e.AB||{},o=t.__sponsoredBeaconBridgeConfigRegistry||new Map;if(t.__sponsoredBeaconBridgeConfigRegistry=o,t.sponsoredBeaconBridge&&"function"==typeof t.sponsoredBeaconBridge.ensure&&"function"==typeof t.sponsoredBeaconBridge.register&&"function"==typeof t.sponsoredBeaconBridge.ensureRegistered)return;const a=function(e,t){if(e&&t)return t.split(".").reduce((e,t)=>
1{if(null!=e)return e[t]},e)},s=function(t){const o=function(e){return Object.assign({},{bridgeKey:"sponsoredBeaconBridge",customElementName:"",dataMethodName:"applyFeaturedCategoryData",observerThreshold:.3,patchRetries:20,patchRetryDelayMs:250,trackerRetries:10,trackerRetryDelayMs:300},e||{})}(t);if(!o.customElementName)return;const s=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`}}(o.bridgeKey);if(e[s.globalPatchedFlag])return;const r=function(){const t=e.customElements&&e.customElements.get(o.customElementName);if(!t||!t.prototype||t.prototype[s.prototypePatchedFlag])return!!t;const r=t.prototype[o.dataMethodName];return t.prototype[o.dataMethodName]=function(t){"function"==typeof r&&r.call(this,t),function(t,r){const i=a(r,o.payloadIconsPath);if(!Array.isArray(i)||0===i.length)return;t[s.eventMap]=t[s.eventMap]||new Map,t[s.onloadRequests]=t[s.onloadRequests]||new Set,t[s.clickBoundCategoryIds]=t[s.clickBoundCategoryIds]||new Set,t[s.impressionSentCategoryIds]=t[s.impressionSentCategoryIds]||new Set;const l=a(r,o.payloadRequestIdPath),d=n.buildOnloadDedupKey(i,l,e=>a(e,o.eventTrackingPath));n.sendOnloadEvent({global:e,entities:i,component:o.componentName,context:o.onloadContext,eventName:o.onloadEventName,dedupStore:t[s.onloadRequests],dedupKey:d,eventTrackingSelector:e=>a(e,o.eventTrackingPath),retries:o.trackerRetries,retryDelayMs:o.trackerRetryDelayMs}),i.forEach(e=>{const n=a(e,o.categoryIdPath),r=a(e,o.eventTrackingPath);n&&r&&t[s.eventMap].set(n,r)});const c=t.querySelectorAll(`[${o.categoryIdAttribute}]`);c.forEach(a=>{const r=a.getAttribute(o.categoryIdAttribute);if(r&&t[s.eventMap].has(r)&&!t[s.clickBoundCategoryIds].has(r)){const i=a.querySelector("a")||a.closest("a");i&&i.addEventListener("click",()=>{const a=t[s.eventMap].get(r);n.sendTrackingEvent({global:e,eventTracking:a,eventName:o.clickEventName,component:o.componentName,context:o.clickContext,retries:o.trackerRetries,retryDelayMs:o.trackerRetryDelayMs})},{passive:!0}),t[s.clickBoundCategoryIds].add(r)}}),t[s.impressionObserver]||"function"!=typeof e.IntersectionObserver||(t[s.impressionObserver]=new IntersectionObserver(a=>{a.forEach(a=>{if(!a.isIntersecting)return;const r=a.target?.getAttribute?.(o.categoryIdAttribute);if(!r||t[s.impressionSentCategoryIds].has(r))return;const i=t[s.eventMap].get(r);n.sendTrackingEvent({global:e,eventTracking:i,eventName:o.impressionEventName,component:o.componentName,context:o.impressionContext,retries:o.trackerRetries,retryDelayMs:o.trackerRetryDelayMs})&&t[s.impressionSentCategoryIds].add(r)})},{threshold:o.observerThreshold})),t[s.impressionObserver]&&c.forEach(e=>{t[s.impressionObserver].observe(e)})}(this,t)},t.prototype[s.prototypePatchedFlag]=!0,e[s.globalPatchedFlag]=!0,!0};if(!r()){let t=o.patchRetries;const n=e.setInterval(()=>{(r()||t<=0)&&e.clearInterval(n),t-=1},o.patchRetryDelayMs)}};t.sponsoredBeaconBridge={ensure:s,register:function(e,t){e&&t&&o.set(e,Object.assign({},t))},ensureRegistered:function(e,t){if(!e||!o.has(e))return;const n=o.get(e);s(Object.assign({},n,t||{}))}}}(window)},5519:()=>{(function(){window.ActiveXObject||window,/Trident/.test(window.navigator.userAgent);var e=["changeStore"];this.hostDomain="localhost"===location.hostname?"https://shop-dev1-origin.tomthumb.com":"",this.setArrowRightOnEnter=function(e){13===e.keyCode&&(e.preventDefault(),$("#disclaimer-content").collapse("toggle"),this.setArrowRight())},this.setArrowRight=function(){$(".svg-icon-Arrow_Right_Red.disclaimer-svg").hasClass("disclaimer-svg-rotate")?$(".svg-icon-Arrow_Right_Red.disclaimer-svg").removeClass("disclaimer-svg-rotate"):$(".svg-icon-Arrow_Right_Red.disclaimer-svg").addClass("disclaimer-svg-rotate")},this.updateStoreSelectionInCookie=function(e,t){var o=AB.COMMON.getCookie("SWY_SHARED_SESSION_INFO");let n=!!SWY.CONFIGSERVICE.featureToggleConfig.enableCookieRestructure;if(o){var a="";try{a=JSON.parse(o)}catch(e){a=""}a&&a.info&&(a.info.J4U||(a.info.J4U={}),e.storeId&&(a.info.J4U.storeId=e.storeId.toString(),a.info.J4U.zipcode=e.zipcode,a.info.J4U.userType&&"A"!==a.info.J4U.userType||(a.info.J4U.userType="G"),a.info.J4U.userData||(a.info.J4U.userData={}),a.info.J4U.userData.guestStoreId&&(a.info.J4U.userData.guestStoreId=void 0),a.info.J4U.userData.guestZipCode&&(a.info.J4U.userData.guestZipCode=void 0)),e.defaultStore?a.info.J4U.userData.defaultStore=e.defaultStore:a.info.J4U.userData.defaultStore=!1,e.defaultZipcode&&(a.info.J4U.userData.defaultZipcode=e.defaultZipcode),void 0!==t&&"null"!==t||(t=!0),e.eC
1omStoreId&&t&&(a.info.SHOP||(a.info.SHOP={}),e.target&&"shop"===e.target.toLowerCase()?"A"!==a.info.SHOP.userType&&"G"!==a.info.SHOP.userType||(a.info.SHOP.storeId=e.storeId.toString()):a.info.SHOP.storeId=e.eComStoreId.toString(),"dugonly"===e.eComZipcode?a.info.SHOP.zipcode=e.zipcode:a.info.SHOP.zipcode=e.eComZipcode,e.resolverResp&&void 0!==e.resolverResp.originalZipcode&&null!==e.resolverResp.originalZipcode&&e.resolverResp.originalZipcode.length>0?(a.info.SHOP.userData.dugPostalZipcode=e.resolverResp.zipCode,a.info.SHOP.userData.originalZipcode=e.resolverResp.originalZipcode,a.info.SHOP.userData.deliveryBanner=e.resolverResp.deliveryBanner,a.info.COMMON.dprefVisited="false"):(a.info.SHOP.userData.dugPostalZipcode="",a.info.SHOP.userData.originalZipcode="",a.info.SHOP.userData.deliveryBanner=AB.userInfo.banner),a.info.SHOP.userType&&"A"!==a.info.SHOP.userType||(a.info.SHOP.userType="G")),n&&(e.storeId&&(a.info.COMMON.storeId=e.storeId.toString(),a.info.COMMON.zipcode=e.zipcode,a.info.COMMON.userType&&"A"!==a.info.COMMON.userType||(a.info.COMMON.userType="G"),a.info.COMMON.userData||(a.info.COMMON.userData={}),a.info.COMMON.userData.guestStoreId&&(a.info.COMMON.userData.guestStoreId=void 0),a.info.COMMON.userData.guestZipCode&&(a.info.COMMON.userData.guestZipCode=void 0)),e.defaultStore?a.info.COMMON.userData.defaultStore=e.defaultStore:a.info.COMMON.userData.defaultStore=!1,e.defaultZipcode&&(a.info.COMMON.userData.defaultZipcode=e.defaultZipcode),void 0!==t&&"null"!==t||(t=!0),e.eComStoreId&&t&&(e.target&&"shop"===e.target.toLowerCase()?"A"!==a.info.COMMON.userType&&"G"!==a.info.SHOP.userType||(a.info.COMMON.storeId=e.storeId.toString()):a.info.COMMON.storeId=e.eComStoreId.toString(),"dugonly"===e.eComZipcode?a.info.COMMON.zipcode=e.zipcode:a.info.COMMON.zipcode=e.eComZipcode,e.resolverResp&&void 0!==e.resolverResp.originalZipcode&&null!==e.resolverResp.originalZipcode&&e.resolverResp.originalZipcode.length>0?(a.info.COMMON.userData.dugPostalZipcode=e.resolverResp.zipCode,a.info.COMMON.userData.originalZipcode=e.resolverResp.originalZipcode,a.info.COMMON.userData.deliveryBanner=e.resolverResp.deliveryBanner,a.info.COMMON.dprefVisited="false"):(a.info.COMMON.userData.dugPostalZipcode="",a.info.COMMON.userData.originalZipcode="",a.info.COMMON.userData.deliveryBanner=AB.userInfo.banner),a.info.COMMON.userType&&"A"!==a.info.COMMON.userType||(a.info.COMMON.userType="G")))),AB.userInfo.updateSessionCookies(a)}},this.updateStoreLocationInLocalStorage=function(e){if(!AB.COMMON.isEmpty(e)){var t=localStorage.getItem("storeData")?JSON.parse(localStorage.getItem("storeData")):{};t.storeLocation={storeId:e.storeId?e.storeId:e.id,zipcode:e.zipcode?e.zipcode:e.zip,address:e.address,banner:e.banner,city:e.city,state:e.state,countryCode:e.countryCode},localStorage.setItem("storeData",JSON.stringify(t))}},this.getBannerLogo=function(e){var t,o=$("#fulfillment-conflict-modal").attr("data-bannerlogomap");return o&&(t=JSON.parse(decodeURIComponent(o))[e]),t},this.reloadPage=function(e){var t=window.location.href;setTimeout(function(){AB.COMMON.checkRedirectParameterReferralUrlPartners(t)},e)},this.updateSyndicatedHeader=function(){var e=AB.COMMON.resolveJquery();if(e(".current-store-panel-container").removeClass("mask"),"undefined"!==AB.userInfo.j4u.storeData.storeLocation.address&&void 0!==AB.userInfo.j4u.storeData.storeLocation.address&&null!==AB.userInfo.j4u.storeData.storeLocation.address&&""!==AB.userInfo.j4u.storeData.storeLocation.address)e(".current-store-address").html(AB.userInfo.j4u.storeData.storeLocation.address);else{var t="www-"+AB.userInfo.banner,o=SWY.CONFIGSERVICE.bannerDomainMap[t];SWY.STORESELECTION.hostDomain=o,StoreAddressComp.getStoreAddressFromXapi(AB.userInfo.j4u.storeId,function(t){void 0!==t&&"Store not found"!==t&&t.storeAddressModel&&e(".current-store-address").html(t.storeAddressModel.address.line1)},function(){})}},this.syndicatedChangeStore=function(){var e,t=encodeURIComponent(window.location.href),o="www-"+AB.userInfo.banner,n=SWY.CONFIGSERVICE.bannerDomainMap[o];n||(n=$(".menu-nav__center-container .banner-logo").attr("href").match(/^https:\/\/[^/]+/)),e=n+"/home.html?action=changeStore&goto="+t,window.location.href=e},this.actionStoreModal=function(){var e=AB.COMMON.getURLParameterByName("action",!1),t=SWY.CONFIGSERVICE.isLSCompatible()?localStorage.getItem("gotoRedirectUrl"):"";if(!SWY.ENFORCEMENTUTILS.isPageMatched({configPagePath:SWY.configService.wwwSignInPagePath})&&!SWY.ENFORCEMENTUTILS.isPageMatched({configPagePath:SWY.configService.reSignInPagePath}))if(SWY.STORESELECTION.isStoreModalDeepLink()){SWY.STORESELECTION.displayStoreModal();let e=["action","zipcode","modaltype","activetab"];AB.COMMON.removeURLParameters(e)}else if(null!=e&&"changeStore"===e&&!t){const e=AB.COMMON.getURLParameterByName("modaltype",!1),t=e&&"2"===e?2:3;window.storeFulfillmentModal.zone.run(function(){window.storeFulfillmentModal.component.setModalDisplayData(t,null,AB.userInfo.j4u.zipcode,!1,!0)});let o=["action","zipcode","modaltype","activetab"];AB.COMMON.removeURLParameters(o)}},this.displayStoreModal=function(){var e,t,o,n=0,a="";if(e=AB.COMMON.getURLParameterByName("zipcode"),t=AB.COMMON.getURLParameterByName("modaltype"),o=AB.COMMON.getURLParameterByName("activetab"),e&&t&&o&&(n=parseInt(t))>0){switch(o){case"1":default:a="modal-tab-instore";break;case"2":a="modal-tab-delivery";break;case"3":a="modal-tab-pickup"}window.storeFulfillmentModal.zone.run(function(){window.storeFulfillmentModal.component.setModalDisplayData(n,a,e,!1,!0)})}},this.isActionValid=function(){var t=AB.COMMON.getURLParameterByName("action"),o=!1;return t&&e.forEach(function(e){e.toLowerCase()===t.toLowerCase()&&(o=!0)}),o},this.isStoreModalDeepLink=function(){var e=AB.COMMON.getURLParameterByName("zipcode"),t=AB.COMMON.getURLParameterByName("modaltype"),o=AB.COMMON.getURLParameterByName("activetab"),n=!1;return SWY.STORESELECTION.isActionValid()&&e&&t&&o&&(n=!0),n}}).call(SWY.STORESELECTION)},5685:e=>{e.exports=function(){this.b2BupdateProfile=function(){let e=AB.updateBusinessProfileEndpoint.replace("{{UUID}}",AB.userInfo.UUID),t=AB.ucaHttpOptionsV3Patch;t["x-swy_banner"]=SWY.CONFIGSERVICE.getResolvedBanner(),businessName=$("#new-bussiness-name")[0].value,businessType=$("#new-bussiness-type")[0].value,$.ajax({type:"PATCH",headers:t,url:e,data:JSON.stringify({businessInfo:{name:businessName,type:businessType}}),success:e=>{},error:e=>{console.warn(e)}}),$("#complete-profile-b2b").modal("hide")}}},6708:(e,t,o)=>{const n=o(9744),a=".shop-by-category",s="circle",r="rectangle";function i(){this.state={aemData:{},endpoints:{aisleinformation:"bin/safeway/aisleinformation"},domElements:{mainWrapper:{attributes:{viewType:"viewTypeComponent",viewAllLink:"viewallLink",popularAisles:"popularAisles",hideViewMoreLink:"hideViewMoreLink",componentTitle:"componentTitle"}},rectangleViewWrapper:{selector:".c-shop-by-category__view--rectangle"},circleViewWrapper:{selector:".c-shop-by-category__view--circle"},carouselViewWrapper:{selector:".category-carousel-wrapper"},fullViewWrapper:{selector:".b-category-list--full"},viewAllHeading:{selector:".shop-by-category-heading__view-all"},viewBtnWrapper:{selector:".shop-by-category-button"},defaultView:{selector:".category-image__default"}},viewType:""},this.init=(e={})=>(e&&this.updateStateOnInit(e),this.validateComponentInit()&&(this.readAemData(),this.handleViewType()),{}),this.updateStateOnInit=(e={})=>{const t=n.getPathValue(e,"domElements.mainWrapper.element");this.state={...this.state,domElements:{...this.state.domElements,mainWrapper:{...this.state.domElements.mainWrapper,element:t}}}},this.readAemData=()=>{const e=n.getPathValue(this.state,"domElements.mainWrapper.element"),t=n.getPathValue(this.state,"domElements.mainWrapper.attributes");if(e&&t)for(const o in t)if(t.hasOwnProperty(o)){const n=t[o];this.state={...this.state,aemData:{...this.state.aemData,[o]:e.dataset[n]}}}},this.handleViewType=()=>{switch(n.getPathValue(this.state,"aemData.viewType")&&(this.state.viewType=n.getPathValue(this.state,"aemData.viewType")),this.state.viewType){case r:const e=this.shopByCategoryV1;n.createSafely(e.prototype).init({state:{defaultCategories:n.getPathValue(this.state,"aemData.popularAisles"),viewAllLink:n.getPathValue(this.state,"aemData.viewAllLink")},hideViewMoreLink:n.getPathValue(this.state,"aemData.hideViewMoreLink"),domElements:this.state.domElements,endpoints:this.state.endpoints});break;case s:const t=this.shopByCategoryV2;n.createSafely(t.prototype).init({state:{defaultCategories:n.getPathValue(this.state,"aemData.popularAisles")},hideViewMoreLink:n.getPathValue(this.state,"aemData.hideViewMoreLink"),componentTitle:n.getPathValue(this.state,"aemData.componentTitle"),domElements:this.state.domElements,endpoints:this.state.endpoints})}},this.validateComponentInit=()=>{if(void 0===window.AB||void 0===window.AB.COMMON)return;const e=n.getPathValue(this.state,"domElements.mainWrapper.element");return!!$(e).length},this.shopByCategoryV1=function(){this.state={defaultCategories:[],leftoverCategories:[],domElements:{},endpoints:{},hideViewMoreLink:"false",viewAllLink:"",viewType:"rectangle"},this.init=(e={})=>(e&&e.state&&(this.updateStateOnInit(e),l.handleCategoryData(this.state,this.handleDefaultCategories)),{}),this.updateStateOnInit=(e={})=>{let t=this.state.viewAllLink;if(n.getPathValue(e,"state.viewAllLink")){t=n.getPathValue(e,"state.viewAllLink"),t=t.replace(/\(branchId\)/g,window.AB.userInfo.branchId);const o=n.getPathValue(e,"domElements.viewAllHeading.selector"),a=o?document.querySelector(o):"";a&&(a.href=t)}let o=n.getPathValue(e,"state.defaultCategories");o=o?JSON.parse(o.toString()):[],this.state={...this.state,defaultCategories:o,viewAllLink:t,hideViewMoreLink:""!==e.hideViewMoreLink?e.hideViewMoreLink:"false",domElements:{...e.domElements},endpoints:{...e.endpoints}}},this.handleDefaultCategories=(e=[])=>{const t=n.getPathValue(this.state,"domElements.mainWrapper.element"),o=n.getPathValue(this.state,"domElements.rectangleViewWrapper.selector");let a;t&&o&&(a=t.querySelector(o)),a&&(e.length>0&&(l.handleDrawnDefaultCategories(a,e,this.state.defaultCategories),l.handleResponseCategories(this.state,e,a)),this.handleTemplateDrawing(a))},this.handleTemplateDrawing=e=>{const t=n.getPathValue(this.state,"domElements.fullViewWrapper.selector"),o=e.querySelector(t);if(o&&window.AB&&window.AB.SHOPBYCATEGORY&&window.AB.SHOPBYCATEGORY.Util){[].concat(this.state.defaultCategories,this.state.leftoverCategories).length>5&&$(e).find(".categories-container").removeClass("categories-container--align-center");let t=l.getDrawingIndex(this.state.viewType,e);if(t+this.state.leftoverCategories.length>=12){const t=n.getPathValue(this.state,"domElements.viewBtnWrapper.selector"),o=e.querySelector(t);o&&o.classList.remove("d-none")}
1this.state.leftoverCategories.forEach(e=>{const n=document.createElement("div");n.classList.add("categories-item","aisle-item"),t>=12&&n.classList.add("d-none","hidden-aisle");const a=document.createElement("a");a.classList.add("sbc-link","aisle-category"),a.href=e.aislePath;const s=document.createElement("span");s.innerHTML=e.aisleName?e.aisleName:e.aisleAltText?e.aisleAltText:"",a.append(s),n.append(a),o.append(n),t++});const s=e.querySelector(a);window.AB.SHOPBYCATEGORY.Util.handleStoreIDPathUpdate(s)}}},this.shopByCategoryV2=function(){this.state={defaultCategories:[],carouselCategories:[],leftoverCategories:[],domElements:{},endpoints:{},hideViewMoreLink:"false",componentTitle:"",viewType:"circle"},this.enableSponsoredCategoryIcons=!1,this.init=(e={})=>(e&&e.state&&(this.updateStateOnInit(e),this.enableSponsoredCategoryIcons=!window.SWY?.CONFIGSERVICE?.featureToggleConfig?.disableSponsoredCategoryIcons&&window.AB.DATALAYER?.isHomePage(),this.enableSponsoredCategoryIcons&&window.AB.SHOPBYCATEGORY?.SponsoredCategoryUtil?.loadSponsoredCategory(),l.handleCategoryData(this.state,this.handleDefaultCategories)),{}),this.updateStateOnInit=(e={})=>{let t=n.getPathValue(e,"state.defaultCategories");t=t?JSON.parse(t.toString()):[],this.state={...this.state,defaultCategories:t,hideViewMoreLink:""!==e.hideViewMoreLink?e.hideViewMoreLink:"false",componentTitle:e.componentTitle?e.componentTitle:"",domElements:{...e.domElements},endpoints:{...e.endpoints}}},this.handleDefaultCategories=(e=[])=>{const t=n.getPathValue(this.state,"domElements.mainWrapper.element"),o=n.getPathValue(this.state,"domElements.circleViewWrapper.selector");let a;t&&o&&(a=t.querySelector(o)),a&&(e.length>0?(l.handleDrawnDefaultCategories(a,e,this.state.defaultCategories),l.handleResponseCategories(this.state,e,a),this.state.carouselCategories=[].concat(this.state.defaultCategories,this.state.leftoverCategories)):this.state.carouselCategories=this.state.defaultCategories,this.handleTemplateDrawing(a),this.handleCarouselTemplateDrawing(a))},this.handleTemplateDrawing=async e=>{const t=n.getPathValue(this.state,"domElements.fullViewWrapper.selector"),o=e&&e.querySelector(t);if(o&&window.AB&&window.AB.SHOPBYCATEGORY&&window.AB.SHOPBYCATEGORY.Util){this.state.carouselCategories.length>7&&$(e).find(".categories-container").removeClass("categories-container--align-center");let t=l.getDrawingIndex(this.state.viewType,e);const s=this.state.leftoverCategories.length||this.state.defaultCategories.length,r=n.getPathValue(this.state,"domElements.viewBtnWrapper.selector"),i=e.querySelector(r);t+s>=15&&i&&i.classList.remove("d-none"),this.state.leftoverCategories.forEach((e,n)=>{const a=document.createElement("div");a.classList.add("categories-item","aisle-item"),t>=15&&a.classList.add("d-none","hidden-aisle");const s=document.createElement("a");s.classList.add("sbc-link","aisle-category","department"===e.tileType?"sbc-aisle":"sbc-custom"),s.href=e.aislePath?e.aislePath:"#",s.id=e.aisleIdHtml?e.aisleIdHtml:s.classList.contains("sbc-aisle")&&e.aisleId&&""!=e.aisleId?"sbc_aisle_"+e.aisleId:"",s.dataset.aisleName=e.aisleName?e.aisleName:"",window.AB.DATALAYER&&(s.onclick=function(){window.AB.DATALAYER.setSBCLinkClickEvents(s)});const r=document.createElement("div");r.classList.add("categories-item__image-container");const i=document.createElement("div");i.classList.add("category-image__default"),i.dataset.src=e.fileReference?e.fileReference:"/",i.dataset.srcMobile=e.fileReferenceMobile?e.fileReferenceMobile:"/",i.dataset.name=e.aisleName?e.aisleName:e.aisleAltText?e.aisleAltText:"",i.innerHTML=window.AB.SHOPBYCATEGORY.Util.getNameAcronym(i,e.aisleName?e.aisleName:e.aisleAltText?e.aisleAltText:""),r.append(i),s.append(r);const l=document.createElement("div");l.classList.add("categories-item__item-text");const d=document.createElement("div");d.classList.add("aisle-category"),d.innerHTML=e.aisleName?e.aisleName:e.aisleAltText?e.aisleAltText:"",l.append(d),s.append(l),a.append(s),o.append(a),t++});const d=n.getPathValue(this.state,"domElements.mainWrapper.element");if(d){const e=n.getPathValue(this.state,"domElements.defaultView.selector"),t=d.querySelectorAll(e);this.enableSponsoredCategoryIcons&&await(window.AB.SHOPBYCATEGORY?.SponsoredCategoryUtil.handleSponsoredCategoryImage(t)),t&&t.forEach(e
1=>{window.AB.SHOPBYCATEGORY.Util.handleCircleImageLazyLoading(e,this.enableSponsoredCategoryIcons)})}l.handleButtonPosition(e,i),i&&i.addEventListener("click",()=>{l.handleButtonPosition(e,i)});const c=e.querySelector(a);window.AB.SHOPBYCATEGORY.Util.handleStoreIDPathUpdate(c)}},this.handleCarouselTemplateDrawing=e=>{if(void 0!==window.AB.SHOPBYCATEGORY){const t=n.getPathValue(this.state,"domElements.carouselViewWrapper.selector"),o=window.AB.SHOPBYCATEGORY.Carousel;o&&o.drawContent(this.state.carouselCategories,t,e,!1,"L2",this.state.componentTitle,void 0,this.enableSponsoredCategoryIcons)}}}}const l={getData:(e={})=>{$.ajax(`${window.location.origin}/${e.endpoint}`,e.requestOptions).then(t=>{if(t&&(t=e.doParse?JSON.parse(t.toString()):t,e.requestCallback&&"function"==typeof e.requestCallback)){const o=e.responsePath?n.getPathValue(t,e.responsePath):t;e.requestCallback(o)}}).catch(t=>{e.requestCallback&&"function"==typeof e.requestCallback&&e.requestCallback()})},handleCategoryData:(e={},t=()=>{})=>{const o=window.AB.userInfo.branchId,n=window.AB.userInfo.banner;o&&n&&!l.isAllCustomCategories(e.defaultCategories)?l.getData({endpoint:e.endpoints.aisleinformation,requestOptions:{data:{storeId:o,banner:n},contentType:"application/json",dataType:"text"},responsePath:"children",requestCallback:t,doParse:!0}):t()},handleDrawnDefaultCategories:(e,t=[],o=[])=>{$.each($(e).find(".sbc-aisle"),(n,a)=>{const s=$(a).attr("id");if(!t.find(e=>`sbc_aisle_${e.id}`===s)){$(a).closest(".categories-item").remove(),o.splice(o.findIndex(e=>`sbc_aisle_${e.id}`===s),1);const t=e&&e.querySelectorAll(".categories-item.hidden-aisle");t.length&&t[0].classList.remove("d-none","hidden-aisle")}})},handleResponseCategories:(e={},t=[],o)=>{"false"===e.hideViewMoreLink&&t.forEach(t=>{if((!o||!o.querySelector(`#sbc_aisle_${t.id}`))&&window.AB.SHOPBYCATEGORY&&window.AB.SHOPBYCATEGORY.Util){const o=new window.AB.SHOPBYCATEGORY.Util.SBCCategoryModel(t,!1,"L2");e.leftoverCategories&&e.leftoverCategories.push(o)}})},isAllCustomCategories:(e=[])=>!e.find(e=>"department"===e.tileType),getDrawingIndex:(e="",t)=>{switch(e){case r:return t?t.querySelectorAll(".categories-item:not(.hidden-aisle)").length:0;case s:return t?t.querySelectorAll(".categories-item:not(.hidden-aisle)").length-1:0;default:return 0}},handleButtonPosition:(e,t)=>{e&&t&&(e.querySelectorAll(".categories-container .aisle-item:not(.d-none)").length%8==0?t.classList.add("e-button--shrink"):t.classList.remove("e-button--shrink"))}};e.exports=function(){this.init=()=>{$.each($(".c-shop-by-category__main-wrapper"),(e,t)=>{n.createSafely(i.prototype).init({domElements:{mainWrapper:{element:t}}})})}}},6981:()=>{const e="https://images.albertsons-media.com/is/image/ABS",t=window.innerWidth;(function(){this.setSBCDefaultImageView=function(e,t="",o=""){const n=this.getNameAcronym(e,t,o),a=$(e).closest(".categories-item__image-container");if(a){$(e).closest(".categories-item__image-wrapper").remove();const t=document.createElement("div");t.classList.add("category-image__default"),t.innerHTML=n||"",t.ariaHidden="true",a.append(t)}},this.getNameAcronym=function(e,t="",o=""){t||(t=e.dataset[o]);let n="";return t&&(n=t.match(/\b(\w)/g).join("")),n},this.SBCCategoryModel=function(o={},n=!1,a=""){if(this.aisleId=o.id,this.aisleName=o.name,this.aislePath=o.pagePath,n)this.fileReference=t<768?o.imagePathMobile:o.imagePath;else{switch(!0){case window.AB.SHOPBYCATEGORY.Util.validateCustomCategory(o):this.fileReference=o.fileReference;case t<768:this.fileReference=`${e}/${a}_${this.aisleId}?$ecom-aisles-tile-mobile-png-alpha$`;default:this.fileReference=`${e}/${a}_${this.aisleId}?$ecom-aisles-tile-png-alpha$`}this.tileType="department"}},this.handleCircleImageLazyLoading=function(e,o=!1){new IntersectionObserver((n,a)=>{n.forEach(n=>{if(n.isIntersecting){let s;n.target&&n.target.classList.contains("category-image__default")&&(s=n.target.parentNode,s&&!s.classList.contains("categories-item__image-container")&&(s=n.target.closest(".categories-item__image-container")));let r=n.target.dataset.src;if(t<768&&n.target.dataset.srcMobile&&"/"!==n.target.dataset.srcMobile&&(r=n.target.dataset.srcMobile),s&&"/"!==r){s.innerHTML="";const e=document.createElement("div");if(e.classList.add("categories-item__image-wrapper"),image=document.createElement("img"),image.classList.add("categories-item__image","reveal-image"),image.src=r,image.alt="",e.append(image),s.append(e),window.AB&&window.AB.SHOPBYCATEGORY){const e=s.querySelector(".categories-item__image");e.onerror=e?()=>{e.onerror=null,window.AB.SHOPBYCATEGORY.Util.setSBCDefaultImageView(e,n.target.dataset.name)}:null,o&&window.AB.SHOPBYCATEGORY.SponsoredCategoryUtil.sendSponsoredImpressionEvent(s)}}a.unobserve(n.target?n.target:e)}})},{rootMargin:"50px"}).observe(e)},this.handleStoreIDPathUpdate=function(e){e&&e.querySelectorAll(".sbc-link").forEach(e
1=>{window.AB.COMMON.updateHrefPlaceholder(e)})},this.validateCustomCategory=function(e={}){switch(!0){case"custom"===e.tileType:return!0;case"department"===e.tileType:default:return!1}}}).call(AB.SHOPBYCATEGORY.Util)},7093:()=>{(function(){this.addCelebration=function(e,t){"celebration"===e?(console.warn("Special Occasion:",e),window.specialOccasionsModal.zone.runTask(()=>{window.specialOccasionsModal.component.showSpecialOccasionsModal(t)})):"profile-completion"===e&&window.profileCompletionModal.zone.run(function(){window.profileCompletionModal.component.showProfileCompletionModal(t)})},this.createCelebrationCookie=function(e){console.warn("Special Occasion:",e),SWY.CONFIGSERVICE.setDomainCookie("ACI_F_SWY_CELEBRATION_SHOW",!1,SWY.CONFIGSERVICE.resolvedBanner+".com",30);const t=document.querySelector(".special-occasion");t&&(t.style.display="none")}}).call(AB.COMMON)},7126:(e,t,o)=>{ABTestUtil=o(9071);const n=o(9744),a=o(5685),s=o(3050),r=o(2167),i=o(1488);""===window.AB.checkCategoryTileL3View&&(window.AB.checkCategoryTileL3View=ABTestUtil.checkABTestCategoryTilesL3);let l=n.createSafely(a.prototype),d=n.createSafely(s.prototype),c=n.createSafely(i.prototype),p=n.createSafely(r.prototype);function u(){window.AB&&window.AB.LAZYLOAD&&"function"==typeof window.AB.LAZYLOAD.lazyLoadFunctionsInstance&&window.AB.LAZYLOAD.lazyLoadFunctionsInstance()}c.init(),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",function(e){p.init(),u()}):(p.init(),u()),window.AuthenticationOtpService=l,window.SplashModalService=d},7284:(e,t,o)=>{const n=o(8474);(function(){this.state={defaultTaxonomyPath:1,aisleItemSelector:{homepage:".sbc-aisle",aisles_l1:".aisle-two",aisles_l2:".sbc-link"},currentPage:"",categoryId:"",sponsoredCategory:{categories:[],categoriesPromise:null,isPromiseCompleted:!1,categoriesMap:new Map},recordedImpression:[],catIdRegex:{imagePathRegex:/L[\d]_(\d+(_\d+)+)/,elemIdRegex:/\d+(_\d+)+/g}},this.loadSponsoredCategory=(e=this.state.defaultTaxonomyPath)=>{this.state.categoryId=e,this.state.currentPage=this.getPagename(),this.state.sponsoredCategory.categoriesPromise=this.getSponsoredCategoryInfo(),this.state.sponsoredCategory.categoriesPromise.then(e=>{e.icons&&(this.state.sponsoredCategory.categories.push(...e.icons),this.state.sponsoredCategory.categoriesMap=new Map(this.state.sponsoredCategory.categories.map(e=>[e.content.categoryId,e])))}).catch(e=>{console.warn("Failed to fetch sponsored category icons - ",e)}).finally(()=>{this.state.sponsoredCategory.isPromiseCompleted=!0})},this.handleSponsoredCategoryImage=async(e=[])=>{if(!this.state.sponsoredCategory.isPromiseCompleted)try{await this.state.sponsoredCategory.categoriesPromise}catch(e){console.warn("Failed to fetch sponsored category icons ",e)}return this.state.sponsoredCategory.categories?.length>0&&e.length>0&&this.updateSponsoredCategories(e),!0},this.getSharedSessionId=()=>{try{const e=AB?.COMMON?.getCookie("SWY_SHARED_SESSION_INFO");return e&&JSON.parse(unescape(e))?.info?.COMMON?.grsSessionId||""}catch(e){return""}},this.getCookieValue=(e=[])=>{const t=Array.isArray(e)?e:[e];for(const e of t){const t=AB?.COMMON?.getCookie?.(e);if(t)return t}const o=document.cookie||"";if(!o)return"";const n=o.split(";").map(e=>e.trim());for(const e of t){const t=n.find(t=>t.startsWith(`${e}=`));if(t)return t.substring(e.length+1);const o=encodeURIComponent(e),a=n.find(e=>e.startsWith(`${o}=`));if(a)return a.substring(o.length+1)}return""},this.withSponsoredSessionIdHeaders=(e,t)=>{const o=new Headers(e||{});return t&&!o.has("sid")&&o.set("sid",t),o},this.withSponsoredSessionIdInUrl=(e,t)=>{if(!e||!t)return e;try{const o=new URL(e,window.location.origin);return o.searchParams.set("sid",t),o.toString()}catch(t){return e}},this.applySponsoredSessionIdToBeaconPayload=(e,t)=>e&&t?Array.isArray(e)?e.map(e=>this.applySponsoredSessionIdToBeaconPayload(e,t)):("object"==typeof e&&Object.keys(e).forEach(o=>{const n=e[o];"string"==typeof n&&/beacon/i.test(o)?e[o]=this.withSponsoredSessionIdInUrl(n,t):n&&"object"==typeof n&&this.applySponsoredSessionIdToBeaconPayload(n,t)}),e):e,this.getAdobeMarketingCloudCookieValue=()=>this.getCookieValue(["AMCV_A7BF3BC75245ADF20A490D4D@AdobeOrg","AMCV_A7BF3BC75245ADF20A490D4D%40AdobeOrg"])||"",this.get
1SponsoredSessionId=()=>this.getAdobeMarketingCloudCookieValue()||this.getSharedSessionId(),this.waitForSponsoredSessionId=({maxAttempts:e=5,delayMs:t=200}={})=>{const o=this.getSponsoredSessionId();return o?Promise.resolve(o):new Promise(o=>{let n=0;const a=()=>{const s=this.getSponsoredSessionId();s||n>=e?o(s||""):(n+=1,window.setTimeout(a,t))};a()})},this.getSponsoredSessionRequestContext=async({requestUrl:e="",headersLike:t,waitForSessionId:o=!0}={})=>{const n=o?await this.waitForSponsoredSessionId():this.getSponsoredSessionId();return{sponsoredSessionId:n,requestUrl:e,headers:this.withSponsoredSessionIdHeaders(t,n)}},this.getSponsoredCategoryInfo=async()=>{if(!(AB&&AB.sponsoredIconsDomainEndpointV2&&AB.sponsoredAdsDomainApiApimKey))return Promise.reject(new Error("Path or subscription key missing in config"));{const e=this.generateRequestUrl(AB.sponsoredIconsDomainEndpointV2),{sponsoredSessionId:t,requestUrl:o,headers:n}=await this.getSponsoredSessionRequestContext({requestUrl:e,headersLike:{"ocp-apim-subscription-key":AB.sponsoredAdsDomainApiApimKey,...AB.COMMON.authorize()&&{token:`Bearer ${AB.userInfo.SWY_SHOP_TOKEN}`}}});if(o)return new Promise((e,a)=>{fetch(o,{method:"GET",headers:n,signal:AbortSignal.timeout(3e3)}).then(e=>{if(e.ok)return e.json()}).then(o=>{o&&o.icons?(this.applySponsoredSessionIdToBeaconPayload(o.icons,t),this.sendSponsoredOnloadEvent(o.icons,"ShopByCategory","sponsoredCategoryIconsLoaded"),e(o)):a(new Error("No icons found"))}).catch(e=>a(e))})}},this.generateRequestUrl=e=>{const t=new URLSearchParams({source:"web",banner:SWY.CONFIGSERVICE.resolvedBanner,pagename:this.state.currentPage?.includes("aisles")?"aisle":this.state.currentPage,position:"CategoryIcon",slots:"1,-14",storeId:AB.userInfo.branchId,taxonomyId:"ProductAlike",taxonomyPath:this.state.categoryId});let o=AB.userInfo.preferenceMode.toLowerCase();return"delivery"===o?t.append("channel","delivery"):"j4u"===o?t.append("channel","instore"):t.append("channel","pickup"),`${e}?${t.toString()}`},this.updateSponsoredCategories=e=>{const t=this.state.aisleItemSelector[this.state.currentPage],{imagePathRegex:o,elemIdRegex:n}=this.state.catIdRegex;return Array.from(e).filter(e=>null!==e.closest(t)).map(e=>({id:e.closest(t).id?.match(n)?.[0]||e.closest(".category-image__default")?.getAttribute("data-src")?.match(o)?.[1],slot:e})).forEach(e=>{if(e.id&&this.state.sponsoredCategory.categoriesMap.has(e.id)){const t=this.state.sponsoredCategory.categoriesMap.get(e.id);if(t?.content?.backgroundImage){e.slot.dataset.src=e.slot.dataset.srcMobile=t.content.backgroundImage;const o=e.slot.closest("a");o&&(o.dataset.categoryId=e.id),this.addClickEvent(e.slot,t)}}}),e},this.sendSponsoredOnloadEvent=(e,t,o="sponsoredIconsLoaded")=>{n.sendOnloadEvent({global:window,entities:e,component:t,context:o,eventName:"AD_ONLOAD_EVENTS"})},this.getPagename=()=>window.AB.DATALAYER?.isHomePage()?"homepage":/shop\/aisles(\.\d+)?\.html/.test(window.location.pathname?.toLowerCase())?"aisles_l1":"aisles_l2",this.addClickEvent=(e,t,o="ShopByCategory")=>{const n=this.state.aisleItemSelector[this.state.currentPage];let a=e.closest(n);$this=this,a.onclick=function(){$this.sendSponsoredOnClickEvent(t,o)}},this.sendSponsoredOnClickEvent=(e,t,o="sponsoredIconsClicked")=>{this.sendTrackingEvent(e.eventTracking,t,o,"AD_CLICK")},this.sendSponsoredImpressionEvent=(e,t=null,o="ShopByCategory")=>{if(null==t){const{elemIdRegex:o}=this.state.catIdRegex,n=this.state.aisleItemSelector[this.state.currentPage];t=e.closest(n)?.id?.match(o)?.[0]||e.closest(n)?.getAttribute("data-category-id")}const a=this.state.sponsoredCategory;null!=t&&a.categoriesMap.has(t)&&!n.hasRecord(this.state.recordedImpression,t)&&this.sendTrackingEvent(a.categoriesMap.get(t).eventTracking,o,"sponsoredIconsImpression","AD_IMPRESSION")&&n.recordKey(this.state.recordedImpression,t)},this.sendTrackingEvent=(e,t,o,a)=>n.sendTrackingEvent({global:window,eventTracking:e,eventName:a,component:t,context:o})}).call(AB.SHOPBYCATEGORY.SponsoredCategoryUtil)},7471:()=>{(function(){this.drawContent=async(e=[],t="",o,n=!1,a="",s="false",r="circle",i=!1)=>{this.destroySlick(o,t);const l=o&&o.querySelector(t);if(l){const d="rectangle"===r?3:5,c=Math.ceil(e.length/d);for(let t=0;t<c;t++){let o=0,s=0;
1"rectangle"===r?(o=t>0?3*t:0,s=o+3):(o=t>0?5*t:0,s=o+5),s=s>e.length?e.length:s;const i=document.createElement("div");i.classList.add("aisle-page"),"rectangle"===r?i.classList.add("aisle-page--rectangle"):i.classList.add("aisle-page--circle");for(let t=o;t<s;t++){let o=e[t];window.AB&&window.AB.SHOPBYCATEGORY&&window.AB.SHOPBYCATEGORY.Util&&n&&(o=new window.AB.SHOPBYCATEGORY.Util.SBCCategoryModel(o,n,a));const s=document.createElement("div");s.classList.add("categories-item","aisle-item"),s.ariaLabel=o.aisleName?o.aisleName:o.aisleAltText?o.aisleAltText:"";const l=document.createElement("a");if(l.classList.add("sbc-link","aisle-category","department"===o.tileType?"sbc-aisle":"custom"==o.tileType?"sbc-custom":"sbc-cat-aisle"),l.id=o.aisleIdHtml?o.aisleIdHtml:!l.classList.contains("sbc-aisle")&&o.tileType||!o.aisleId||""==o.aisleId?"":"sbc_aisle-mob_"+o.aisleId,window.AB.SHOPBYCATEGORY.Util.validateCustomCategory(o)&&"true"===o.isUserProtectedLink&&l.classList.add("user-protected-link","user-prompt-g","user-prompt-a"),l.href=o.pagePath?o.pagePath:o.aislePath?o.aislePath:"#",l.dataset.aisleName=o.aisleName?o.aisleName:"",window.AB&&window.AB.DATALAYER?l.onclick=function(){window.AB.DATALAYER.setSBCLinkClickEvents(l)}:l.onclick=function(){const e="aisles-"+l.dataset.aisleName;localStorage.setItem("aislesPreviousPage",e)},"circle"===r&&window.AB&&window.AB.SHOPBYCATEGORY){const e=document.createElement("div");e.classList.add("categories-item__image-container");const t=document.createElement("div");t.classList.add("category-image__default"),t.dataset.src=o.fileReference?o.fileReference:"/",t.dataset.srcMobile=o.fileReferenceMobile?o.fileReferenceMobile:"/",t.dataset.name=o.aisleName?o.aisleName:o.aisleAltText?o.aisleAltText:"",t.innerHTML=window.AB.SHOPBYCATEGORY.Util.getNameAcronym(t,o.aisleName?o.aisleName:o.aisleAltText?o.aisleAltText:""),e.append(t),l.append(e);const n=document.createElement("div");n.classList.add("categories-item__item-text");const a=document.createElement("div");a.classList.add("aisle-category");const s=document.createElement("span");s.innerHTML=o.aisleName?o.aisleName:o.aisleAltText?o.aisleAltText:"",a.append(s),n.append(a),l.append(n)}else if("rectangle"===r){const e=document.createElement("span");e.innerHTML=o.aisleName?o.aisleName:o.aisleAltText?o.aisleAltText:"",l.append(e)}s.append(l),i.append(s)}l.append(i)}if("circle"===r){const e=l.querySelectorAll(".category-image__default");i&&await(window.AB.SHOPBYCATEGORY?.SponsoredCategoryUtil.handleSponsoredCategoryImage(e)),e&&e.forEach(e=>{window.AB.SHOPBYCATEGORY.Util.handleCircleImageLazyLoading(e,i)})}window.AB.SHOPBYCATEGORY.Util.handleStoreIDPathUpdate(l),this.initSlick(o,t,s)}},this.initSlick=(e,t="",o="false")=>{const n=e.querySelector(t);$(n).not(".slick-initialized").slick({tail:!0,dots:!0,prevArrow:null,nextArrow:null,infinite:!1,cssEase:"linear",speed:300,centerMode:!1,variableWidth:!0,variableHeight:!0,arrows:!0,mobileFirst:!0,slidesToShow:1,slidesToScroll:1,accessibility:!0,swipe:!0,swipeToSlide:!1}).on("beforeChange",(e,t,o,n)=>{setTimeout(()=>{let e=[];e=t.$slides.filter((e,t)=>t.classList.contains("slick-active")),o<n?void 0!==e[e.length-1].getElementsByTagName("A")[0]&&e[e.length-1].getElementsByTagName("A")[0].focus():void 0!==e[0].getElementsByTagName("A")[0]&&e[0].getElementsByTagName("A")[0].focus()},500)}).on("afterChange",()=>{setTimeout(()=>{this.updateADAFunctionality(n,o)},0)}),$(n).hasClass("slick-initialized")&&this.updateADAFunctionality(n,o)},this.destroySlick=(e,t="")=>{const o=e.querySelector(t);$(o).hasClass("slick-initialized")&&($(o).slick("unslick"),$(o).empty()),o?.children?.length>0&&$(o).empty()},this.updateADAFunctionality=(e,t="false")=>{const o=$(e).find(".slick-dots").find("li");$.each(o,(e,n)=>{const a=$(n).find("button");a.removeAttr("tabindex"),a.attr("aria-label",`Page ${e+1} of ${o.length}${t&&"false"!==t?` ${t}`:""}`),a.attr("aria-current",!(!n.classList||!n.classList.contains("slick-active"))&&"page")})}}).call(AB.SHOPBYCATEGORY.Carousel)},8474:e=>{const t=function(e,t){if(!Array.isArray(e)||0===e.length)return[];const o=t||(e=>e&&e.eventTracking);return e.map(e=>o(e)).filter(e=>!!e)},o=function(e,t){return!(!e||!t)&&(e instanceof Set?e.has(t):!!Array.isArray(e)&&e.includes(t))},n=function(e,t){e&&t&&!o(e,t)&&(e instanceof Set?e.add(t):Array.isArray(e)&&e.push(t))},a=function({global:e,eventTracking:t,eventName:o,component:n,context:a,retries:s=0,retryDelayMs:r=0}){if(!t)return!1;const i=e||window,l=function(e){return"function"==typeof i.citrusAdTracker?(i.citrusAdTracker(t,o,{component:n,context:a}),!0):(e>0&&i.setTimeout(()=>{l(e-1)},r),!1)};return l(s)};e.exports={buildOnloadDedupKey:function(e,o,n){return o||t(e,n).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:o,recordKey:n,sendOnloadEvent:function({global:e,entities:s,component:r,context:i,eventName:l="AD_ONLOAD_EVENTS",dedupStore:d,dedupKey:c,eventTrackingSelector:p,retries:u=0,retryDelayMs:g=0}){const f=t(s,p);if(0===f.length)return!1;if(d&&c&&o(d,c))return!1;const m=a({global:e,eventTracking:f,eventName:l,component:r,context:i,retries:u,retryDelayMs:g});return m&&d&&c&&n(d,c),m},sendTrackingEvent:a}},9071:e=>{const t={isABTestEnabled:(e="",o="",n="")=>{let a=!1;
1if(""===window.AB[o])try{if(t.isLSCompatible()){const t=localStorage.getItem(`EOT_${e}`);window.AB[o]=t?t===`EOT-${e}_${n}_New`:a}else window.analyticsSwy&&window.analyticsSwy.testFlags&&window.analyticsSwy.testFlags[`EOT_${e}`]?window.AB[o]=window.analyticsSwy.testFlags[`EOT_${e}`]===`EOT-${e}_${n}_New`:window.AB[o]=a}catch(e){window.AB[o]=a}return window.AB[o]},getABtestGroup:(e="",o="")=>{if(""===window.AB[o]){let n=-1;if(t.isLSCompatible()&&(n=localStorage.getItem(`EOT_${e}`)),-1==n||null==n||""===n)try{n=window.analyticsSwy.testFlags[`EOT_${e}`]}catch(e){n="control"}window.AB[o]=n}return window.AB[o]},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",o=`EOT-${e}_show_images`,n=`EOT-${e}_show_texttiles`,a="defaultView",s="circleView",r="rectangleView",i=(e="")=>{switch(!0){case e===o:return s;case e===n:return r;default:return a}};if(""===window.AB.categoryTileL3Test)try{if(window.analyticsSwy&&window.analyticsSwy.testFlags&&window.analyticsSwy.testFlags[`EOT_${e}`])window.AB.categoryTileL3Test=i(window.analyticsSwy.testFlags[`EOT_${e}`]);else if(t.isLSCompatible()){const t=localStorage.getItem(`EOT_${e}`);window.AB.categoryTileL3Test=t?i(t):a}else window.AB.categoryTileL3Test=a}catch(e){window.AB.categoryTileL3Test=a}return window.AB.categoryTileL3Test},isLSCompatible:()=>window.SWY.CONFIGSERVICE.isLSCompatible(),dispatchCustomEvent:(e,t)=>{const o=new CustomEvent(e,t);document.dispatchEvent(o)},checkEOTEnableByIdAndValue:(e,o)=>{let n;const a="ABTest_"+e,s=t.getEOTValueById(e);null!=s?(n=s===o,t.dispatchCustomEvent(a,{detail:{eotflag:n}})):window.addEventListener(e,function(s){console.warn("== AR TARGET "+e+" EVENT RECEIVED",s),n=s.detail[e]===o,t.dispatchCustomEvent(a,{detail:{eotflag:n}})},{once:!0})},getABTestValue:(e,t,o)=>{if(window.SWY.CONFIGSERVICE.featureToggleConfig?.[t])return localStorage.removeItem(e),"a";{const t=localStorage.getItem(e);return t||(window?.analyticsSwy?.testFlags?.[o]?window.analyticsSwy.testFlags[o]:"a")}}};e.exports=t},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 o=t?t.split("."):[];if(e&&o.length>0){let t=e;return o.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},9964:()=>{(function(e,t){this.init=function(){"object"==typeof AB.userInfo.geoYextAJAXCall?AB.userInfo.geoYextAJAXCall.then(function(){1==AB.userInfo.triggerUserInfoAJAXCall&&AB.COMMON.getUserInfo(!0)}):AB.COMMON.getUserInfo(!0),this.reloadForOkta(),"true"==localStorage.getItem("showSignInModal")&&(window.AB.COMMON.showSignInModal_OTP("#"),localStorage.removeItem("showSignInModal")),this.underlineBrandIndexL3(),this.updateBrandMeta(),AB.COMMON.handleMkpSearchNav()},this.sitePreInit=function(){AB.COMMON.userNotifyInit()},this.reSignIn=function(e){(1==e||AB.COMMON.isSignInPage())&&("undefined"!=typeof SWY&&SWY.previousLogin&&"undefined"!=typeof AB&&AB.userInfo&&!SWY.previousLogin.email&&AB.userInfo.email&&(SWY.previousLogin.email=AB.userInfo.email),"undefined"!=typeof SWY&&SWY.ENFORCEMENT&&SWY.ENFORCEMENT.getCookie("SAFEWAY_KMSI")&&"logout"!=SWY.ENFORCEMENT.getCookie("SAFEWAY_KMSI")&&"error"!=SWY.ENFORCEMENT.getCookie("SAFEWAY_KMSI").toLowerCase()&&"undefined"!=typeof AB&&AB.userInfo&&("G"==AB.userInfo.userType||"A"==AB.userInfo.userType)&&(SWY.OKTA.silentSignOutFromOkta(event),AB.COMMON.isSignInPage()||this.setShowSignInModal()))},this.resetSignInFields=function(){$(".sign-in-container #label-email").attr("value",""),$(".sign-in-container #label-email").prop("disabled",!1),$(".sign-in-container .change-account-link").addClass("d-none"),$(".sign-in-container #email-mobile-otp").val(""),$(".sign-in-container #email-mobile-otp").prop("disabled",!1),$(".sign-in-container #update-otp-continue-btn").prop("disabled",!0)},this.setShowSignInModal=function(){localStorage.setItem("showSignInModal",!0)},this.commonPreInit=function(){AB.postInitializeObject(),AB.COMMON.trackJustForULocation(),AB.ARIA&&"function"==typeof AB.ARIA.init&&AB.ARIA.init(),"object"==typeof AB.DATALAYER&&"function"==typeof AB.DATALAYER.init&&AB.DATALAYER.init(),AB.COMMON.protectLinksByUserState(),AB.COMMON.updateGlobalNavigation(),AB.COMMON.focusTabMouse(document),AB.COMMON.checkRedirectParameter(),AB.COMMON.updatePlaceholdersInOtherHref(),AB.COMMON.updateCarouselVieAllPath(),AB.LAZYLOAD.init(),AB.COMMON.loadCart(),AB.SIGNINOTP.init()},this.syndicatedPreInit=function(){AB.MINICART.init(),AB.COMMON.resolveJquery()("#footerNav").carousel({interval:!1}),AB.COMMON.mapSyndicatedCookie(),SWY.STORESELECTION.updateSyndicatedHeader(),"object"==typeof CookieConsent&&null!==CookieConsent&&CookieConsent.init()},this.focusTabMouse=function(e){if(e){var t=e.createElement("STYLE"),o="addEventListener"in e,n=function(t,n){o?e.addEventListener(t,n):e.attachEvent("on"+t,n)},a=function(e){t.styleSheet?t.styleSheet.cssText=e:t.innerHTML=e};e.getElementsByTagName("HEAD")[0].appendChild(t),n("mousedown",function(){a(":focus{outline:0 !important;}::-moz-focus-inner{ outline:0 !important; }")}),n("keydown",function(){a("")})}},this.getUserInfo=function(e){const t=SWY.CONFIGSERVICE.featureToggleConfig,o=!(!t||!t.userInfoSkipIfGuest)&&t.userInfoSkipIfGuest,n="sincerely-food"==SWY.CONFIGSERVICE.resolvedBanner;if(!AB.COMMON.authorize()&&e&&(o||n)){let e,t,o={j4uStoreId:AB.userInfo.j4u.storeId,shopZipcode:AB.userInfo.zipcode,displayableBanner:AB.userInfo.displayableBanner,preference:AB.userInfo.preferenceMode,banner:AB.userInfo.banner,userType:"G",j4uZipcode:AB.userInfo.j4u.zipcode,shopStoreId:AB.userInfo.j4u.zipcode,siteType:AB.userInfo.siteType,customerType:AB.userInfo.customerType},n=AB.COMMON.getCookie("SWY_SHARED_SESSION_INFO");try{e=n?JSON.parse(n):{},e&&e.info&&e.info.COMMON&&!e.info.COMMON.grsSessionId?(t=crypto.randomUUID(),e.info.COMMON.grsSessionId=t,AB.COMMON.setCookie("SWY_SHARED_SESSION_INFO",encodeURIComponent(JSON.stringify(e)),0)):t=e?.info?.COMMON?.grsSessionId}catch(t){e={}}o.grsSessionId=t,AB.COMMON.processUserInfoFlow(JSON.stringify(o))}else SWY?.CONFIGSERVICE?.featureToggleConfig?.enableUserSessionInfo?$.ajax({url:AB.userSessionInfoPath,mimeType:"text/plain",method:"GET",headers:AB.userSessionInfoOptions}).done(function(e){AB.COMMON.processUserInfoFlow(e)}):$.get({url:AB.userInfoPath,mimeType:"text/plain"}).done(function(e){AB.COMMON.processUserInfoFlow(e)}
1).fail(function(){$("body").trigger("onGetUserInfoLoad",[AB.userInfo])})},this.processUserInfoFlow=function(e){if(AB.COMMON.authorize()&&!JSON.parse(e).SWY_SHOP_TOKEN)AB.COMMON.reconcileExpiredTokenUserState();else{let t="mkp"==AB.COMMON.getProgramType();0==AB.userInfo.earlyInitialize&&AB.userInfo.prepareSharedInfo(),AB.userInfo.prepareUserInfo(e),void 0!==AB.userInfo.branchId&&(AB.aisleHTMLPath+="."+AB.userInfo.branchId+".html"),SWY?.CONFIGSERVICE?.featureToggleConfig?.enablePasskeyFactorApi&&AB.COMMON.initPasskeyModal(),AB.COMMON.initAngularServiceCall(),AB.COMMON.initializeDynamicAngularComponents();try{AB.COMMON.setExtendedUserType()}catch(e){console.log(e)}AB.CART.init(),AB.PROMOTIONS.init(),AB.MINICART.init(),AB.COMMON.searchInit(),t?AB.COMMON.marketPlaceSearchInit():AB.COMMON.wineshopSearchInit(),AB.COMMON.doInit(),"undefined"==typeof NavigationComp&&"undefined"!=typeof NavShoppingPreferencesComp&&(window.NavigationComp=NavShoppingPreferencesComp),"undefined"!=typeof NavigationComp&&NavigationComp.init(),$("body").trigger("onGetUserInfoLoad",[e]);let o=new Event("onGetUserInfoLoad");document.dispatchEvent(o),AB.COMMON.isErumsPage()||(AB.CHECKPROFILE.init(),"true"===SWY.configService.isClosedStoreEnabled&&closedStoreComp.init(),AB.userInfo.isCrossBannerMFCUser&&"delivery"==AB.userInfo.preferenceMode.toLowerCase()?AB.COMMON.showMfcRemappedAlert():(SplashModalService.initSplashModal(),AB.COMMON.initializeModals(),userActionComp.init()),SWY.CONFIGSERVICE.enablePrebookSlotModal()&&prebookSlotsInvoke.init(),AB.COMMON.authorize()||MergeAcctModalComp.init()),OMS_OrderSummaryComp.init(),AB.COMMON.reSignIn(!1)}},this.triggerPopupWrapper=function(e,t=!0){setTimeout(function(){window.popupWrapModal.zone.runTask(()=>{window.popupWrapModal.component.showPopupWrapper(e,t)})},1e3)},this.showConflictModal=function(){if(AB.COMMON.authorize()){var e=window.SWY?.CONFIGSERVICE?.featureToggleConfig?.enablePostAuthNotifyMessage?localStorage.getItem("postAuthNotifyMessage"):localStorage.getItem("notifyMessage"),t=JSON.parse(e);const n=o(t?.message?t?.message:"");let a=SWY?.CONFIGSERVICE?.featureToggleConfig?.enableNoUserPreference;n||(AB?.onUnitySigninFlow?this.triggerPopupWrapper("postUnityLogin-flow",!0):AB?.noPreferenceSigninFlow&&a?this.triggerPopupWrapper("noPreference-flow",!0):AB?.onBoardingSigninFlow&&this.triggerPopupWrapper("postLogin-flow",!1))}else conflictModalComp.init()},this.initializeModals=function(){const e=window.AB.storeFlagsData,t=window?.SWY?.CONFIGSERVICE?.featureToggleConfig?.enableOnboardingFramework;if(this.isObjectEmpty(e)?$(document).on("storeFlagsLoadComplete",()=>{this.showConflictModal(),$(document).off("storeFlagsLoadComplete")}):this.showConflictModal(),!t){const e=!window.SWY?.CONFIGSERVICE?.featureToggleConfig?.disableB2BCompleteProfile,t=$("#storeFulfillmentModal").is(":visible");e&&"B"===window.AB.userInfo.siteType&&!t&&this.openCompleteProfileModelOnAutoSignin()}},this.isObjectEmpty=function(e){return null===e||0===Object.keys(e).length},this.reconcileExpiredTokenUserState=function(){var e=SWY.ENFORCEMENT.getCookie("SAFEWAY_KMSI");redirectPath=encodeURIComponent(window.location.href),AB.COMMON.setCookie("ECommRedirectURL",redirectPath,0),"true"==e?window.location.href=SWY.ssoPath:SWY.OKTA.signOut()},this.setExtendedUserType=function(){var e=AB.userInfo.userType.toLowerCase();"g"!=e&&(e+=void 0!==AB.userInfo.orderCount&&AB.userInfo.orderCount>0?"e":"n"),AB.userInfo.extendedType=e},this.createAnAccount=function(e,t,o){var n=AB.userInfo.zipcode,a=AB.userInfo.isInNoServiceArea,s=null,r="createAnAccount";console.debug(r+" ENTRY: createAccountURL="+e+", needZipCodeURL="+t+", updateCookie="+o),o&&this.updateRedirectURLCookie(location.pathname+window.location.search),void 0!==a&&"Y"==a?s=t:null!=n&&n.length>0?(s=e,s+="?zipcode=",s+=n):s=t,window.location.href=s,console.debug(r+" EXIT: redirectURL="+s)},this.showCreateAccontModal=function(e){$("#createAccountModal").modal({show:!0}),this.isEmpty(e)?(e=window.location.href,$("#accountModalLinkToSignIn").attr("data-redirectUrl",e),$("#accountModalLinkToCreateAccount").attr("data-redirectUrl",e)):-1==e.indexOf("#")?($("#accountModalLinkToSignIn").attr("data-redirectUrl",e),$("#accountModalLinkToCreateAccount").attr("data-redirectUrl",e)):(e=window.location.href,$("#accountModalLinkToSignIn").attr("data-redirectUrl",e),$("#accountModalLinkToCreateAccount").attr("data-redirectUrl",e)),$(".modal").on("hidden.bs.modal",function(){})},this.showSignInModal_OTP=function(e){let t;AB.COMMON.reSignIn(!0),this.isEmpty(e)?(e=window.location.href,$("#linkToSignIn").attr("data-redirectUrl",e),$("#linkToShortReg").attr("data-redirectUrl",e)):-1==e.indexOf("#")?($("#linkToSignIn").attr("data-redirectUrl",e),$("#linkToShortReg").attr("data-redirectUrl",e),t=encodeURIComponent(e)):(e=window.location.href,$("#linkToSignIn").attr("data-redirectUrl",e),$("#linkToShortReg").attr("data-redirectUrl",e),t=encodeURIComponent(e)),t&&null!==t&&AB.COMMON.setCookie("ECommRedirectURL",t,0),AB.COMMON.openAuthenticateModal("signIn")},this.showCreateAccontModalJ4U=function(e,t){let o;AB.COMMON.reSignIn(!0),"creat-account-modal-link"===t?AB.COMMON.openAuthenticateModal("createAccount"):AB.COMMON.openAuthenticateModal("signIn"),this.isEmpty(e)||(o=-1==e.indexOf("#")?encodeURIComponent(e):e
1ncodeURIComponent(window.location.href)),o&&null!==o&&AB.COMMON.setCookie("ECommRedirectURL",o,0),$(".modal").on("hidden.bs.modal",function(){})},this.showReSignInModal=function(){AB.COMMON.openAuthenticateModal("signIn")},this.sessionNotExpired=function(){return!0},this.protectLinksByUserState=function(){$("a.user-protected-link").each(function(){var e=String(AB.userInfo.userType).toLowerCase(),t=$(this);t.hasClass("user-hide-"+e)&&t.hide()}),AB.COMMON.authorize()||$("a.data-link-protected-signIn, a.data-link-protected-createAccount").click(function(e){let t;$(this).hasClass("data-link-protected-createAccount")?t="creat-account-modal-link":$(this).hasClass("data-link-protected-signIn")&&(t="signIn-account-modal-link");let o=$(this).attr("href");window.AB.COMMON.showSignInModal_OTP(o),e.preventDefault()}),$("body").on("click","a.user-protected-link",function(e){var t=AB.userInfo.userType.toLowerCase();""!==t&&"undefined"!==t&&null!==t||(t="g");var o=$(this),n=(o[0].id,o.attr("href"));if($("#shopFlyOutModal").is(":visible")&&$("#shopFlyOutModal").modal("hide"),!o.hasClass("syndicated")&&o.hasClass("user-prompt-"+t))if(e.preventDefault(),"r"===t){var a=SWY.CONFIGSERVICE.getCookie("USED_CREDENTIALS");a&&a.length>0?window.location.href=n:(n&&(n.indexOf("http")<0?AB.COMMON.updateRedirectURLCookie(window.location.protocol+"//"+window.location.host+n):AB.COMMON.updateRedirectURLCookie(n)),AB.COMMON.showReSignInModal(),AB.COMMON.switchOTPContentSignIn("sign-in-password","sign-in-with-otp"))}else $(".myaccount-flyout-wrapper div.sidebar").removeClass("sidebar--effect"),$(".myAccount-flyout-backdrop").hide(),$(".menu-nav__mobile-menu-trigger .menu-nav__icon-container").removeClass("activeMenu"),$(".button__item.menu-nav__red-caret-down").removeClass("menu-nav__red-caret-up"),AB.COMMON.showSignInModal_OTP(n)})},this.updateCarouselVieAllPath=function(){$.each($("a.carousel-header-link"),function(e,t){!function(e){var t=$(e).attr("href");if(void 0!==t){var o=t.indexOf("("),n=t.indexOf(")");if(-1!=o&&-1!=n){var a,s=String(t).substring(o+1,n);void 0!==(a="aisleId"===s?$(".dynamic-page-title .dynamic-page-title__container").attr("data-aisle-id"):AB.userInfo.getValue(s))&&(t=String(t).replace("("+s+")",a),$(e).attr("href",t))}}}($(t))})},this.searchInit=function(){if(null==document.querySelector(".search-wrapper form .search-container"))return;var e=$(".search-container .search-container-wrapper").find(".input-search.ecomm-search"),t=$(".search-container .search-container-wrapper").find(".searchBtn"),o=$(".search-container")[0].dataset.searchtype,n="",a=this.getURLParameterByName("q");null!=a&&"null"!=a?($("#searchNrResults").attr("data-search",a),e.val(a),t.addClass("svg-icon-search-Close").removeClass("svg-icon-search-grey"),t.removeAttr("aria-label"),t.attr("aria-label","clear search")):(t.addClass("svg-icon-search-grey").removeClass("svg-icon-search-Close"),t.removeAttr("aria-label"),t.attr("aria-label","search"));let s=Array.from(e);for(let e in s)$(s[e]).on("keyup input paste",function(){t.addClass("svg-icon-search-grey").removeClass("svg-icon-search-Close"),t.removeAttr("aria-label"),t.attr("aria-label","search"),""!=(n=$(s[e]).val())&&n==a?(t.addClass("svg-icon-search-Close").removeClass("svg-icon-search-grey"),t.removeAttr("aria-label"),t.attr("aria-label","clear search")):(t.addClass("svg-icon-search-grey").removeClass("svg-icon-search-Close"),t.removeAttr("aria-label"),t.attr("aria-label","search")),0!=e&&$(s[0]).val(n),1!=e&&$(s[1]).val(n),2!=e&&$(s[2]).val(n)});t.on("click",function(n){t.hasClass("svg-icon-search-Close")?(e.val(""),t.addClass("svg-icon-search-grey").removeClass("svg-icon-search-Close"),t.removeAttr("aria-label"),t.attr("aria-label","search"),"offerSearch"===o&&(window.location.search=AB.COMMON.removeURLParameterByName(window.location.search,"q"),window.history.pushState({},null,window.location.search))):$(this).closest("form").submit()}),AB.AUTOSUGGEST.init(),AB.POPULARSEARCH.init()},this.marketPlaceSearchInit=function(){if(null==document.querySelector(".walled-header"))return;let e=this.getURLParameterByName("q"),t=document.querySelectorAll(".marketplace-header__search__input,.mktp-listing-header__search__input,.walled-header__search__input")?.length,o=document.querySelectorAll(".marketplace-header__search__input,.mktp-listing-header__search__input,.walled-header__search__input")[t-1];
1null!=e&&"null"!=e&&(o.value=e);let n=document.querySelectorAll(".searchBtn,.mktp-listing-header__search__icon,.walled-header__search__icon"),a=AB.COMMON.getSellerIdFromWalledPage();for(let e=0;e<n.length;e++)n[e].addEventListener("click",function(e){("click"===e.type||"keypress"===e.type&&13===e.keyCode)&&(e.preventDefault(),AB.COMMON.getListingSellerId()?redirectBasedOnListingType(AB.COMMON.getListingSellerId(),o.value):redirectBasedOnListingType(a,o.value))});let s=document.querySelectorAll(".marketplace-header__search__input,.mktp-listing-header__search__input,.walled-header__search__input");for(let e=0;e<s.length;e++)s[e].addEventListener("keypress",function(e){"Enter"===e.key&&o.value&&(e.preventDefault(),AB.COMMON.getListingSellerId()?redirectBasedOnListingType(AB.COMMON.getListingSellerId(),o.value):redirectBasedOnListingType(a,o.value))});redirectBasedOnListingType=function(e,t){if(t){if(t=encodeURIComponent(t),AB?.DATALAYER){const e=document.querySelector("#mkpSellerDpd")?.textContent?.trim();AB.DATALAYER.analyticsCTATracking(`cta:${AB.DATALAYER.initPathSections(!0).join(":")}|${e}|${t}`)}switch(e){case"mkp-cross-search":let o="/shop/marketplace/seller-search.html?q=";window.location.href=window.location.origin+o+t;break;case"global-search":let n="/shop/search-results.html?q=";window.location.href=window.location.origin+n+t;break;default:e&&(window.location.href=AB.COMMON.getMkpWalledPath(e,t))}}}},this.handleMkpSearchNav=function(){var e=document.getElementById("mkpSellerLngInput");e&&(e.addEventListener("keypress",function(t){if("Enter"===t.key){t.preventDefault();let o=AB.COMMON.getSellerIdFromWalledPage(),n=e.value;o&&n&&(window.location.href=AB.COMMON.getMkpWalledPath(o,n))}}),$(".marketplace-header__search").find(".mkpSellerLngBtn").on("click keypress",function(t){let o=AB.COMMON.getSellerIdFromWalledPage(),n=e.value;("click"===t.type||"keypress"===t.type&&13===t.keyCode)&&(t.preventDefault(),o&&n&&(window.location.href=AB.COMMON.getMkpWalledPath(o,n)))}))},this.removeURLParameters=function(e){let t=window.location.search;if(t){paramsMap=new Map(t.slice(1).split("&").map(function(e){return e.split(/=/)}));for(let t of e)paramsMap.has(t)&¶msMap.delete(t);let o=Array.from(paramsMap.entries()).map(function(e){return e[0]+"="+e[1]}).join("&");o=o?"?"+o:"",window.history.replaceState(null,document.title,location.pathname+o+location.hash)}},this.getDugStoreBanner=function(){return SWY.CONFIGSERVICE.getResolvedBanner()},this.formatCurrency=function(e){return parseFloat(Math.round(100*e)/100).toFixed(2)},this.checkUnAttendedDelivery=function(){return 1==AB.unattendedDeliveryIsEnabled},this.filterInit=function(){if("mobile"==AB.COMMON.getBreakpoint()){var e=document.querySelector(".filter-panel.left-hand-navi-simple"),t=!!e&&e.querySelector(".collapsed"),o=!!e&&e.querySelector("#filter_by_brand");t&&o&&(t.setAttribute("aria-expanded",!1),o.setAttribute("aria-expanded",!1),o.classList.remove("show"))}},this.setBoxtopAuth=function(e){if(e.loyaltyPartners)for(var t=e.loyaltyPartners,o=0;o<t.length;o++){var n=t[o];"GeneralMills"==n.name&&n.planNumber.length>1&&(AB.userInfo.boxTopAuth=!0)}},this.myListDisclaimerStyle=function(){$(".my-list-disclaimer").removeClass("col-lg-offset-3 col-lg-9").addClass("col-lg-12")},this.trackJustForULocation=function(){$(document).ready(function(){var e=window.location.href.split("/");"justforu.html"==e[e.length-1]&&$(".my-disclaimer-component").addClass("d-none d-md-block")})},this.ucaAPIPathWithCustomerId=function(e){var t=AB.userInfo.customerId?AB.userInfo.customerId:"1";return e.replace("{customerId}",t)},this.formatDate=function(e){if(e&&!$.isEmptyObject(e)){var t=new Date(e),o=t.getDate(),n=t.getMonth(),a=t.getFullYear();return["January","February","March","April","May","June","July","August","September","October","November","December"][n]+" "+o+", "+a}},this.generateUUID=function(e,t){var o=(new Date).getTime(),n=Math.floor(performance.now()*o);return e&&e.length>0&&!isNaN(e)&&(n+=Number(e)),t&&t.length>0&&(n+=this.__encode(t)),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/([xy])/g,function(e){var t=(n+16*Math.random())%16|0;return n=Math.floor(n/16),("x"===e?t:3&t|8).toString(16)})},this.__encode=function(e){for(var t="",o=e.length,n=0;n<o;n++)t+=e.charCodeAt(n).toString(10);return Number(t)},this.popupUserErrorMessage=function(e,t,o){var n=$("div#popupUserErrorModal"),a=n.find("#popupErrorModalTitle"),s=n.find("#popupErrorModalInfo"),r=n.find('button[data-dismiss="modal"]');a.html(e),s.html(t),n.modal(),a.focus();var i=function(){a.html(""),s.html(""),r.off("click",i),o&&"function"==typeof o&&o()};r.on("click",i)},this.userNotifyInit=function(){const e=SWY?.CONFIGSERVICE?.featureToggleConfig?.enablePostAuthNotifyMessage;if(AB.COMMON.getCookie("ACI_S_social_acc_success").length>0&&(e||this.userNotify("Welcome back. you're now signed in."),document.cookie="ACI_S_social_acc_success=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;",SWY.CONFIGSERVICE.setDomainCookie("SAFEWAY_KMSI",!0,SWY.CONFIGSERVICE.resolvedBanner+".com",90)),SWY.CONFIGSERVICE.isLSCompatible()){var t=localStorage.getItem("notifyMessage"),n=JSON.parse(t);window.location.href.indexOf("sign-in.error-")>1?(n.isDisplayed=!0,t=JSON.stringify(n),localStorage.setItem("notifyMessage",t)):n&&!n.isDisplayed&&(n.message&&n.message.length>0&&(!window.AB.COMMON.isB2BSite()&&o(n.message)||this.userNotify(n.message)),n.isDisplayed=!0,t=JSON.stringify(n),localStorage.setItem("notifyMessage",t))}};const o=e=>{const t=window.SWY?.CONFIGSERVICE?.featureToggleConfig?.enableO
1nboardingFramework,o="account created. you're now signed in!"===e?.toLowerCase(),n=["socialReg","STORE_ONLINE_USER_SIGN","STORE_ONLINE_USER_REG"].includes(window.AB?.onboardingEvent?.event);return t&&o||n};this.openCompleteProfileModelOnAutoSignin=function(){"show"===localStorage.getItem("complete-b2b-business-profile")&&(setTimeout(()=>{$("#complete-profile-b2b").modal({show:!0})},2e3),localStorage.removeItem("complete-b2b-business-profile"))},this.openCompleteProfileModelOnConvert=function(){let e=SWY.CONFIGSERVICE.featureToggleConfig?.isCookieACIPrefixEnabled?"ACI_S_B_convt_acc_success":"B_convt_acc_success";this.getCookie(e)&&setTimeout(()=>{$("#complete-profile-b2b").modal({show:!0}),document.cookie=e+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"},8e3)},this.userNotify=function(e,t){t=$.extend({},{timeToShow:8e3},t);var o=$(".notify-wrapper"),n=$(".notify-wrapper .message");o.is(":visible")&&(o.fadeOut(100),clearTimeout(o.data("timeToShow"))),setTimeout(function(){n.text(e)},150),o.fadeIn("slow");var a=setTimeout(function(){o.fadeOut("slow")},t.timeToShow);o.data("timeToShow",a)},this.showFulfillmentModal=function(){$("reserve-nav__button").click(function(e){e.preventDefault()}),$("#storeFulfillmentModal").modal({show:!0,backdrop:"static"}),AB.DATALAYER&&AB.DATALAYER.setFulfillmentModalView(),$("#storeFulfillmentModal").on("shown.bs.modal",function(){$("#storeFulfillmentModal .create-modal-close-icon").focus()})},this.showSplashModal=function(){$("#splashModal").modal({show:!0,keyboard:!1,focus:!0})},this.toggleShopByCategoryText=e=>{const t=$(e).closest(".c-shop-by-category__view--v1");if(t){const e=t.find(".view-more-categories-js"),o=e.text(),n=t.find(".full-aisles-js");"View More"===o?n.removeClass("d-none"):n.addClass("d-none"),e.text("View More"===o?"View Less":"View More")}},this.loadCart=function(){$(".menu-nav__sub-item-container").on("click",function(){const e="a"!==window.ABTestUtil.getABTestValue("abACIP295974","isGuestAddToCartDisabled","ACIP295974");AB.COMMON.authorize()||(e?"j4u"===AB.userInfo.preferenceMode.toLowerCase()?window.storeFulfillmentModal.component.setModalDisplayData(2,"modal-tab-delivery"):window.location.href=AB.fullcarturl:window.AB.COMMON.showSignInModal_OTP())})},this.setDefaultStoreId=function(e){const t=SWY.CONFIGSERVICE.storeResolutionConfig.bannerDefaultStoreId,o=SWY.CONFIGSERVICE.storeResolutionConfig.bannerDefaultZipcode;let n={info:{COMMON:{},J4U:{},SHOP:{}}};n.info.COMMON.isClosed="false",n.info.COMMON.isCrossBannerMFCUser="false",n.info.COMMON.preference="J4U",n.info.COMMON.zipcode=o,n.info.J4U.storeId=t,n.info.J4U.zipcode=o,n.info.SHOP.storeId=t,n.info.SHOP.zipcode=o,AB.COMMON.updateUserSession(n,null,function(){window.location.reload()},null,e)},this.isProductCardABtestEnbaled=function(){return!0},this.reconcileSlotModal=function(){return new Promise(e=>{let t;$.get({url:AB.userInfoPath,mimeType:"text/plain"}).done(function(o){let n=JSON.parse(o);if(n.SWY_SHOP_TOKEN)t=n.SWY_SHOP_TOKEN,e(t);else{localStorage.setItem("triggerSlotModal","true");let e=SWY.ssoPath+"?goto="+window.location.href;SWY.ENFORCEMENT.sendRedirect(e)}}).fail(function(){window.location.reload()})})},this.handleSessionExpiryUser=function(e){if("true"===this.getCookie("SAFEWAY_KMSI")){let t=e||window.location.href,o=SWY.ssoPath+"?goto="+t;SWY.ENFORCEMENT.sendRedirect(o)}else window.location.reload()},this.focusFunctions=function(e,t,o,n){setTimeout(function(){var e=[];e=t.$slides.filter(function(e,t){return t.classList.contains("slick-active")}),o<n?void 0!==e[e.length-1].getElementsByTagName("A")[0]&&e[e.length-1].getElementsByTagName("A")[0].focus():void 0!==e[0].getElementsByTagName("A")[0]&&e[0].getElementsByTagName("A")[0].focus()},500)},this.getUserChannel=function(){let e=window.AB.userInfo.preferenceMode;switch(e=e?e.toLowerCase():void 0,e){case"delivery":return"delivery";case"dug":return"pickup";case"j4u":return"instore";default:return""}},this.isGuestUser=function(){const e=window.SWY.CONFIGSERVICE.featureToggleConfig,t=!e||!e.hasOwnProperty("disableGuestCart")||e.disableGuestCart;return"g"==String(AB.userInfo.userType).toLowerCase()&&!t},this.showMfcRemappedAlert=function(){"delivery"==AB.userInfo.preferenceMode.toLowerCase()&&window.storeFulfillmentModal.component.setModalDisplayData(3,"modal
1-tab-delivery",AB.userInfo.zipcode,!1,!1,!1,!0)},this.underlineBrandIndexL3=function(){$(".bi-left-nav__category-link").each(function(){$(this).text()==$(".bi-alph-list__category-title").text().trim()&&$(this).addClass("selected")})},this.updateBrandMeta=function(){if($(".bi-alph-list__category-title").text().length>0){let e=$(".bi-alph-list__category-title").text(),t=window.AB.userInfo.displayableBanner;$("title").text("Shop "+e+" By Brand | "+t),$("head").append('<meta name="description" content="Shop for '+e+" by our brands. "+t+" has a huge selection of top brands that you can buy in store, online, or via app. Shop for "+e+" by your favorite brand with "+t+' today.">')}},this.imageNotFound=function(e){let t,o=e.parentNode,n=o.parentNode.querySelector(".marketplace-header__categories-item-text");if(n&&(t=n.innerHTML),t){let e=window.AB.SHOPBYCATEGORY.Util.getNameAcronym(null,t);o.innerHTML=e}o.classList.add("category-image__default"),e.remove()},this.updateCarouselControlForADA=function(e,t){setTimeout(()=>{for(let o=0;o<e.slideCount;o++){const n=$(e.$slides[o]);"nextgen-abs-carousel-wc"==t.component&&n.attr("tabindex","-1"),n.hasClass("slick-active")?(n.attr("aria-hidden","false"),n.find(t.classListString).attr("tabindex","0")):(n.attr("aria-hidden","true"),n.find(t.classListString).attr("tabindex","-1"))}if(e.$nextArrow?.length>0){const t=$(e.$nextArrow[0]);t.hasClass("slick-disabled")?t.attr("tabindex","-1"):t.attr("tabindex","0"),t.on("keyup",t=>{13===t.keyCode&&$(e.$slider[0]).slick("slickNext")})}if(e.$prevArrow?.length>0){const t=$(e.$prevArrow[0]);t.hasClass("slick-disabled")?t.attr("tabindex","-1"):t.attr("tabindex","0"),t.on("keyup",t=>{13===t.keyCode&&$(e.$slider[0]).slick("slickPrev")})}},0)},this.mkpSellerLngInputFunc=function(){let e=document.getElementById("mkpSellerLngInput");document.getElementById("mkpMiniHeaderInput").value=e?.value},this.getProgramType=function(){let e=document.getElementsByClassName("nextgen-main-wrapper")[0]?.getAttribute("data-program");return e||window.location.href.indexOf("product-details")>-1&&"true"===document.getElementsByClassName("mktp-header__page-info")[0]?.getAttribute("data-ismkppage")&&(e="mkp"),e},this.wineshopSearchInit=function(){document.getElementsByClassName("walled-header__search__input")[0];let e=this.getURLParameterByName("q"),t=$(".walled-header__search").find(".walled-header__search__input"),o=this.getProgramType();null!=e&&"null"!=e&&t.val(e),$(".walled-header-expanded").find(".searchBtn").on("click keypress",function(e){let t=document.getElementsByClassName("walled-header__search__input")[0]?.value;("click"===e.type||"keypress"===e.type&&13===e.keyCode)&&(e.preventDefault(),redirectBasedOnProgramType(o,t))}),$(".walled-header-collapsed").find(".searchBtn").on("click keypress",function(e){let t=null==document.getElementsByClassName("walled-header__search__input")[1]?document.getElementsByClassName("walled-header__search__input")[0]?.value:document.getElementsByClassName("walled-header__search__input")[1]?.value;("click"===e.type||"keypress"===e.type&&13===e.keyCode)&&(e.preventDefault(),redirectBasedOnProgramType(o,t))});let n=document?.getElementsByClassName("walled-header__search__input");for(let e=0;e<n.length;e++)n[e].addEventListener("keypress",function(t){if("Enter"===t.key){t.preventDefault();let a=n[e].value;redirectBasedOnProgramType(o,a)}});redirectBasedOnProgramType=function(e,t){t&&(t=encodeURIComponent(t));let o="mkp"==$(".main-wrapper.www-wrapper.nextgen-main-wrapper")?.attr("data-program");switch(e){case"mkp":let e,n=document.getElementById("search-grid_0");e=window.location.href.indexOf("aisles")>0?AB.COMMON.getSellerIdFromAislesPage():n&&o?AB.COMMON.getSellerIdFromWalledPage():window.location.href.indexOf("product-details")>-1?$("product-detail")?.attr("data-product-seller-id"):$(".mktp__seller-info")?.attr("data-seller-id"),e&&t&&(window.location.href=AB.COMMON.getMkpWalledPath(e,t));break;case"wineshop":if(t){let e="/shop/"+window?.AB?.wineShopSearchResultsPath;window.location.href=window.location.origin+e.replace("{q}",t)}break;default:if(t){let e="/shop/search-results.html?q=";window.location.href=window.location.origin+e+t}}}}
1,this.getSellerIdFromWalledPage=function(){let e,t=window.location.pathname.split("/"),o=t[t.length-1].split(".");return o.length>2?e=o[1]:window&&window.AB&&window.AB.COMMON&&window.AB.COMMON.getURLParameterByName("sellerId")&&(e=window.AB.COMMON.getURLParameterByName("sellerId")),e},this.getSellerIdFromAislesPage=function(){let e=window.location.pathname;return e.substring(e.indexOf(".")).split(".")[1]},this.getMkpWalledPath=function(e,t){const o="/shop/"+window?.AB?.marketPlaceSearchResultsPath;return window.location.origin+o.replaceAll("{sellerId}",e).replace("{q}",t)},this.programSearchInputFunc=function(e){let t=e.value;document.getElementsByClassName("walled-header__search__input")&&document.getElementsByClassName("walled-header__search__input")[0]&&(document.getElementsByClassName("walled-header__search__input")[0].value=t),document.getElementsByClassName("walled-header__search__input")&&document.getElementsByClassName("walled-header__search__input")[1]&&(document.getElementsByClassName("walled-header__search__input")[1].value=t)},this.crossSellerSearchInputFunc=function(e){let t=e.value;$(".mktp-listing-header-collapsed, .mktp-listing-header-expanded").find(".mktp-listing-header__search__input").val(t)},this.getListingSellerId=function(){let e=$("#mkpSellerDpd")?.children(".mktp-listing-header__search-default-text,.walled-header__search-default-text")?.attr("data-selected-seller-id");return e},this.getGeoCookieName=function(){return"B"===window.AB?.userInfo?.siteType?"ACI_F_B_DELIVERY_ADDR":"ACI_F_DELIVERY_ADDR"},this.skipToMainContent=function(e){let t=this.getProgramType(),o=this.getCustomPageType();e?.preventDefault(),"wineshop"===t?$(".walled-header__logo-link")?.focus():"mkp"===t&&("seller-listing"===o?$(".mktp-listing-header__body-title")?.focus():"seller-landing"===o?$(".walled-header__logo-link")?.focus():"content"===o||"mkp-cross-seller-page"===o?$(".mktp-listing-header__seller__title")?.focus():$(".walled-header__seller__title")?.focus()),$("global-header.syndicate-header").length&&$("nav > ol > li > span.c-bread-crumbs-name, .Locator-title")?.length&&$("nav > ol > li > span.c-bread-crumbs-name, .Locator-title")[0].focus()},this.getCustomPageType=function(){const e=document.getElementsByClassName("nextgen-main-wrapper")[0]?.getAttribute("data-custom-page-type");return e},this.initializeDynamicAngularComponents=function(){const e=["popup-wrapper","profile-completion","special-occasions"],t=window?.SWY?.CONFIGSERVICE?.featureToggleConfig?.enableProfileComplete,o=window?.SWY?.CONFIGSERVICE?.featureToggleConfig?.enablePostAuthNotifyMessage;t&&e.push("utility-bar-wrapper"),o&&e.push("post-auth-notification"),setTimeout(()=>{e.forEach(e=>{AB.COMMON.addAngularComponent(e)})},0)},this.initPasskeyModal=async function(){try{if(window?.SWY?.CONFIGSERVICE?.featureToggleConfig?.enablePasskey&&AB.COMMON.authorize()){const e="ACI_F_Passkey";if(!window.AB.COMMON.getCookie(e)){window.AB.showPasskey=!0;const{factors:e=[]}=await AB.COMMON.getFactors();e.some(e=>"webauthn"===e.factorType&&"ACTIVE"===e.status)&&(window.AB.showPasskey=!1,AB.COMMON.setPasskeyCookie())}}}catch(e){window.AB.showPasskey=!0}},this.setPasskeyCookie=function(){const e=new Date;e.setTime(e.getTime()+7776e6);const t="expires="+e.toUTCString();document.cookie="ACI_F_Passkey=true; "+t+"; path=/;"},this.formatDeliveryAddress=function(e){if(!e)return"";let t="";return t+=(e.address1||"")+", ",e.address2&&(t+=e.address2+", "),t+=(e.city||"")+", ",t+=(e.state||"")+", ",t+=e.zipCode||"",t},this.updateUserDefaultAddress=function(e){const t="SWY_SHARED_PII_SESSION_INFO",o=this.getCookie(t);if(!o)return;let n;try{n=JSON.parse(o)}catch(e){return}const a=this.formatDeliveryAddress(e);if(n.deliveryAddr===a)return;n.deliveryAddr=a;const s=new Date;s.setTime(s.getTime()+1e3*SWY.CONFIGSERVICE.oktaConfig.maxAge);const r="expires="+s.toUTCString();SWY.CONFIGSERVICE.setCookie(t,encodeURIComponent(JSON.stringify(n)),r,"true")},this.prefetchSignOutData=function(e){e&&Object.keys(e).length>0&&(window.SWY.CONFIGSERVICE.initFeatureToggleConfig(e.featureFlags),SWY?.CONFIGSERVICE?.oktaConfig||(SWY.CONFIGSERVICE.oktaConfig={}),SWY.CONFIGSERVICE.oktaConfig.url=e?.oktaConfig?.url,SWY.CONFIGSERVICE.oktaConfig.logoutRedirectURI=e.oktaConfig.logoutRedirectURI)}}).call(AB.COMMON)}},t={};function o(n){var a=t[n];if(void 0!==a)return a.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,o),s.exports}return o(5519),o(3466),o(4404),o(3440),o(6981),o(7471),o(6708),o(4575),o(9964),o(2145),o(7284),o(4929),o(2178),o(3695),o(7093),o(1945),o(7126),o(3095)})());
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.