(function(){"use strict";function u(){sessionStorage.setItem("_up_core_boosted","1")}var s=(t=>(t.LINKER_COMPLETED="_up_lk_cp",t))(s||{});const n={LINKER:"_upl",REDIRECT_URL:"redirect_url"};function p(){if(new URLSearchParams(window.location.search).has(n.LINKER))return!0;if(!("__st"in window))return!1;try{return new URL("https://"+__st.pageurl).searchParams.has(n.LINKER)}catch{return!1}}function c(){return window.location.search!=""?new URL(window.location.href):"__st"in window?new URL("https://"+__st.pageurl):new URL(location.href)}function l(){const e=c().searchParams.get(n.REDIRECT_URL);e&&(window.location.href=atob(e))}function d(){if(!p())return;const t=c(),e=t.searchParams.get(n.REDIRECT_URL),o=t.searchParams.get(n.LINKER);if(!e||!o)return;const r=setInterval(()=>{if(document.readyState!="complete")return;const i=localStorage.getItem(s.LINKER_COMPLETED);i&&i===o&&(l(),clearInterval(r))},100);setTimeout(()=>{clearInterval(r)},1e4)}function f(){const t=UpPromoteCoreSettings.app_env.env,e={local:"https://d1639lhkj5l89m.cloudfront.net/js/storefront/uppromote.js",test:"https://af-test.uppromote.com/js/storefront/uppromote-test.js",staging:"https://af-test.uppromote.com/js/storefront/uppromote-test.js",production:"https://d1639lhkj5l89m.cloudfront.net/js/storefront/uppromote.js"},o=e[t]||e.production,r=document.createElement("script");r.setAttribute("async","true"),r.src=o,document.body.prepend(r)}function a(){u(),f(),d()}document.readyState!=="loading"?a():document.addEventListener("DOMContentLoaded",a)})();