1!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.experimentation=t():e.experimentation=t()}(window,()=>(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function n(e){const t=function(e){const t=document.cookie.match(new RegExp("(^| )"+e+"=([^;]+)"));return t?t[2]:null}(e);if(t)try{return JSON.parse(decodeURIComponent(t))}catch(t){console.warn(`Error parsing cookie ${e}:`,t)}return{}}e.r(t),e.d(t,{experimentation:()=>S});const r={dev:{xerApi:{apimBasePath:"/abs/devint/aapn/experiments/api/v2/experiments/evaluate/on-demand",subscriptionKey:"bd07f71455ed40e4b0cd396e3d8d18ad"}},qa1:{xerApi:{apimBasePath:"/abs/qa/aapn/experiments/api/v2/experiments/evaluate/on-demand",subscriptionKey:"9f7f88b2c82d40148a703179f3e9561d"}},qa2:{xerApi:{apimBasePath:"/abs/qa/aapn/experiments/api/v2/experiments/evaluate/on-demand",subscriptionKey:"9f7f88b2c82d40148a703179f3e9561d"}},qa3:{xerApi:{apimBasePath:"/abs/perf/aapn/experiments/api/v2/experiments/evaluate/on-demand",subscriptionKey:"8f52cc103eee4e04a69da36c65556e74"}},prod:{xerApi:{apimBasePath:"/abs/pub/aapn/experiment-front-end/api/v2/experiments/evaluate/on-demand",subscriptionKey:"81ac510611ad4987a24bbae772ec4659"}}},o=function(){const e=function(e){const t=e.toLowerCase();return t.includes("-dev.")?"dev":t.includes("-qa1.")?"qa1":t.includes("-qa2.")?"qa2":t.includes("-qa3.")?"qa3":"prod"}(window.location.host),t=r[e]?.xerApi;return t||r.qa1.xerApi}(),a=o?.apimBasePath||"",i=36e5,s="abPreFetchExperiment",c="abExperimentExpoCount",u=o?.subscriptionKey||"";let p={},d={};function l(e=!1){try{const t=localStorage.getItem(c);if(!t)return{};const n=JSON.parse(t);if(!e)return n;const r=Date.now(),o={};let a=!1;for(const[e,t]of Object.entries(n))r<t?.expiryTime?o[e]=t:a=!0;return a&&localStorage.setItem(c,JSON.stringify(o)),o}catch(e){return console.error("Failed to get exposure count:",e),{}}}function m(e){const t=document.cookie.split("; ");for(let n of t){const[t,r]=n.split("=");if(t===e)return decodeURIComponent(r)}return null}function f(e,t,n={}){const r=e?.features?.[0]?.featureId;if(!r||!function(e){const t=l(!0),n=t?.[e];return!n||n?.count<5}(r))return Promise.resolve();!function(e){try{const t=l(!1),n=Date.now();t?.[e]?t[e].count+=1:t[e]={count:1,expiryTime:n+864e5},localStorage.setItem(c,JSON.stringify(t))}catch(e){console.error("Failed to increment exposure count:",e)}}(r);const o={compMetaData:{type:t.page?.componentId,name:t.page?.componentTitle},experiment:{id:e?.features?.[0]?.experimentId,group:e?.features?.[0]?.group,eligible:e?.features?.[0]?.eligible,featureId:r},misc:{...e?.features?.[0]?.xerTags},page:{...n,mktChannel:t?.mktChannel,slot:t?.slot,subSlot:t?.subSlot,zone:t?.zone}};return window.AB.DATALAYER.sendExperimentDataToOneTag(o).then(e=>{console.warn("[XER SDK] Exposure event sent successfully:",e)}).catch(e=>{console.error("[XER SDK] Failed to send exposure event, not counting:",e);const t=l(!1);throw t?.[r]?.count>0&&(t[r].count-=1,localStorage.setItem(c,JSON.stringify(t))),e})}const S={CONSTS:{INFO_COOKIE_NAME:"SWY_SHARED_SESSION_INFO",PII_COOKIE_NAME:"SWY_SHARED_PII_SESSION_INFO"},getExperimentByID:async function(e,t=!1,n={}){if(!t){const t=function(){try{const e=localStorage.getItem(s);if(e){const t=JSON.parse(e);return t?.data}return null}catch(e){return console.error("[XER SDK] Failed to get experiment data:",e),null}}();if(t){const r=t?.features?.find(t=>t?.featureId===e);let o={};return r&&(o={features:[r]},f(o,n).catch(e=>{console.error("Failed to send exposure event:",e)})),o}return null}const r=window.AB.experimentation,o=function(){const e=m("B_SWY_SHARED_SESSION_INFO")||m("SWY_SHARED_SESSION_INFO");if(!e)return null;try{return JSON.parse(e)}catch(e){return null}}(),c={pageId:n?.page?.pageId,pageType:n?.page?.pageType,componentId:n?.page?.componentId};null!=n?.page?.L2&&(c.L2=n?.page.L2),null!=n?.page?.L3&&(c.L3=n?.page.L3),null!=n?.page?.L4&&(c.L4=n?.page.L4),null!=n?.page?.searchQuery&&(c.searchQuery=n?.page?.searchQuery);const l=Date.now(),S=p?.[e];if(S&&l<S?.expiryTime){const e=S?.data;return f(e,n,c).catch(e=>{console.error("Failed to send exposure event:",e)}),e}if(d[e])try{const t=await d[e];return t&&f(t,n,c).catch(e=>{console.error("Failed to send exposure event:",e)}),t}catch(e){console.error("[XER SDK] In-flight request failed:",e)}
1try{if(!o)return null;const t=function(){try{const e=localStorage.getItem("abCart");if(!e)return[];const t=JSON.parse(e);return(t?.cart?.abs?.cartItems||[]).filter(e=>null!=e?.itemId).map(e=>({bpn:e?.itemId}))}catch(e){return[]}}(),s={features:[{featureId:e,context:{page:c,user:{assortmentChannel:o?.info?.COMMON.preference,banner:o?.info?.COMMON.banner,host:window.location.hostname,platformId:"web",storeId:o?.info?.SHOP.storeId,cartItems:t}}}]},m=fetch(a,{method:"POST",headers:{"Content-Type":"application/json","Ocp-Apim-Subscription-Key":u},body:JSON.stringify(s),signal:AbortSignal.timeout(500)}).then(async t=>{if(!t.ok)return r.setExperimentError(`XER API error: ${t.status}`),null;const n=await t.json();return n?.features?.length?(p[e]={data:n,expiryTime:l+i},n):(console.error("[XER SDK]: XER API returned no experiment data"),null)}).finally(()=>{delete d[e]});d[e]=m;const S=await m;return S?(f(S,n,c).catch(e=>{console.error("Failed to send exposure event:",e)}),S):null}catch(t){return delete d[e],"TimeoutError"===t?.name||"AbortError"===t?.name?r.setExperimentError("[XER SDK] Failed to respond in 500ms"):r.setExperimentError(`[XER SDK] Failed to load experience: ${t?.message||t}`),null}},setExperimentError:function(e="Error not defined"){const t=window.AB?.experimentation?.storedData;t&&(t.errors+=e+";"),window.console.warn("[Experimentation Error]:"+e)},storedData:{errors:""}};var O;return"undefined"!=typeof window&&(window.AB=window.AB||{},window.AB.experimentation=S,(O=S).storedData[O.CONSTS.INFO_COOKIE_NAME]=n(O.CONSTS.INFO_COOKIE_NAME),O.storedData[O.CONSTS.PII_COOKIE_NAME]=n(O.CONSTS.PII_COOKIE_NAME),O.storedData.audienceData=function(){const e=window.AB.experimentation;return{banner:window.location.hostname.split(".")[1],customerGUID:e.storedData[e.CONSTS.PII_COOKIE_NAME].gid||null,deviceType:navigator.userAgent.includes("Mobile")?"mobile":"desktop",osType:(t=navigator.userAgent||window.opera,n="",/windows phone/i.test(t)?n="Windows Phone":/android/i.test(t)?n="Android":/iPad|iPhone|iPod/.test(t)&&!window.MSStream&&(n="ios"),n),referrer:document.referrer,url:window.location.href,userAgent:navigator.userAgent,zipCode:e.storedData?.[e.CONSTS.INFO_COOKIE_NAME]?.info?.SHOP?.zipcode||null,userType:e.storedData?.[e.CONSTS.INFO_COOKIE_NAME]?.info?.COMMON?.userType||"G",hhid:e.storedData?.[e.CONSTS.INFO_COOKIE_NAME]?.info?.COMMON?.hhid||null,deliveryPreference:e.storedData?.[e.CONSTS.INFO_COOKIE_NAME]?.info?.COMMON?.preference||null};var t,n}(),function(){try{const e=localStorage.getItem(s);if(e){const t=JSON.parse(e);if(Date.now()<t?.expiryTime)return;localStorage.removeItem(s)}const t=document.getElementById("experimentation-placeholder");if(!t)return;const n=t.getAttribute("data-xer-experiments");if(!n||""===n?.trim())return;let r;try{r=JSON.parse(n)}catch(e){return void console.error("[XER SDK] Failed to parse experiment data JSON:",e)}r&&r?.features?.length&&Array.isArray(r.features)&&(localStorage.setItem(s,JSON.stringify({data:r,expiryTime:Date.now()+i})),function(){const e=new Date;e.setTime(e.getTime()+36e5),document.cookie=`ACI_S_EXP_PF=true;expires=${e.toUTCString()};path=/`}(),console.log("[XER SDK] Pre-fetched experiment data cached successfully"))}catch(e){console.error("[XER SDK] Failed to initialize experiment data:",e)}}()),t})());
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.