PageSourceSearch

https://www.coca-cola.com/onexp-theme/25d07672864d756cc17ce87a0253…1e8a7dc5b7f00a7df6d5e87ead0c9df5fe/theme.js

js coca-cola.com collected 2026-09-24 08:23:55 UTC 353,078 bytes, 43 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./azureMaps.js","./azureMaps.css","./onboarding.js","./_plugin-vue_export-helper.js","./EnrichmentQuestionStep.js","./EnrichmentQuestionStep.css","./LoadingIndicator.js","./LoadingIndicator.css","./PushNotificationStep.js","./PushNotificationStep.css","./ProgressBar.js","./ProgressBar.css","./onboarding.css","./profileWidget.js","./pinia.js","./globalConfigStore.js","./SelectUsernameStep.vue_vue_type_style_index_0_lang.js","./useBxSvgIcon.js","./useBxSvgIcon.css","./ModalDialog.js","./ModalDialog.css","./SelectUsernameStep.css","./throttle.js","./profileWidget.css","./komotion.js","./komotion.css","./availablePrizes.js","./ngpsStore.js","./UnknownError.js","./UnknownError.css","./ShowMore.js","./ShowMore.css","./validateConfigId.js","./availablePrizes.css","./cngPrizeCatalog.js","./PrizeCatalogTemplate.vue_vue_type_script_setup_true_lang.js","./prizeUtils.js","./PrizeCardTemplate.js","./PrizeContentTemplate.js","./PrizeContentTemplate.css","./PrizeCardTemplate.css","./PrizeCatalogTemplate.css","./TermsAndConditions.js","./userProfileStore.js","./vue-router.js","./dataLayer.js","./promotionStore.js","./loginModalStore.js","./TermsAndConditions.css","./RequiredCurrencies.js","./RequiredCurrencies.css","./MultiplePrizes.vue_vue_type_script_setup_true_lang.js","./MultiplePrizes.css","./cngPrizeCatalog.css","./digitalWalletAllBadges.js","./useBadges.js","./getVouchers.js","./digitalWalletAllBadges.css","./digitalWalletPrizes.js","./digitalWalletPrizes.css","./digitalWalletSummary.js","./useWallet.js","./digitalWalletSummary.css","./instantWinNoPin.js","./App.vue_vue_type_script_setup_true_lang.js","./globalAppStore.js","./AnimatedSvgIcon.vue_vue_type_style_index_0_lang.js","./AnimatedSvgIcon.css","./NativeDialog.js","./NativeDialog.css","./globalAppStore.css","./instantWinContext.js","./EngagementPromotionModal.js","./EngagementPromotionModal.css","./instantWinContext.css","./PromotionStartButton.vue_vue_type_script_setup_true_lang.js","./LoginModal.js","./LoginModal.css","./instantWinPin.js","./instantWinPrizeCatalog.js","./instantWinPrizeCatalog.css","./ngps.js","./prizeDrawApi.js","./ngps.css","./prizeDrawNoPin.js","./App.vue_vue_type_script_setup_true_lang2.js","./prizeDrawContext.js","./PromotionImageUpload.js","./PromotionImageUpload.css","./prizeDrawContext.css","./prizeDrawPin.js","./quizInstantWinNoPin.js","./App.vue_vue_type_script_setup_true_lang3.js","./QuizStartButton.vue_vue_type_script_setup_true_lang.js","./QuizStartButton.css","./quizInstantWinPin.js","./quizPrizeDrawNoPin.js","./App.vue_vue_type_script_setup_true_lang4.js","./quizPrizeDrawPin.js","./notifyMe.js","./notifyMe.css","./progressiveProfileQuestion.js","./useProgressiveProfileState.js","./progressiveProfileQuestion.css","./search.js","./search.css"])))=>i.map(i=>d[i]);
2const _i="modulepreload",Pi=function(t,e){return new URL(t,e).href},$r={},Z=function(e,n,r){let o=Promise.resolve();if(n&&n.length>0){let l=function(d){return Promise.all(d.map(p=>Promise.resolve(p).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};const i=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),c=s?.nonce||s?.getAttribute("nonce");o=l(n.map(d=>{if(d=Pi(d,r),d in $r)return;$r[d]=!0;const p=d.endsWith(".css"),u=p?'[rel="stylesheet"]':"";if(r)for(let f=i.length-1;f>=0;f--){const y=i[f];if(y.href===d&&(!p||y.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${d}"]${u}`))return;const g=document.createElement("link");if(g.rel=p?"stylesheet":_i,p||(g.as="script"),g.crossOrigin="",g.href=d,c&&g.setAttribute("nonce",c),document.head.appendChild(g),p)return new Promise((f,y)=>{g.addEventListener("load",f),g.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${d}`)))})}))}function a(i){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=i,window.dispatchEvent(s),!s.defaultPrevented)throw i}return o.then(i=>{for(const s of i||[])s.status==="rejected"&&a(s.reason);return e().catch(a)})};class Ii{callbacks;constructor(){this.callbacks=[],this.initMonitor()}watch(e){this.callbacks.push(e)}initMonitor(){const e=window?.Granite?.author?.MessageChannel;if(e){const n=o=>document.querySelector(`cq[data-path="${o}"]`)?.parentNode;new e("cqauthor").subscribeRequestMessage("cqauthor-cmd",o=>{const{data:a}=o;if(a.dataType==="HTML"&&a.cmd!=="delete"){if(a.path===null)return;const i=n(a.path);this.callbacks.forEach(s=>{s(i)})}})}}}const Do=new Ii,Ee=t=>{try{return t()}catch{console.info("Local and/or Session Storage is unavailable. Some features may be missing.");return}},pn="applyDebug",lr=()=>{const t=Li(pn);return t===!0?(Ee(()=>{console.log("You are using debug mode. Remove the query param when you finish debugging."),localStorage.setItem(pn,"true")}),!0):t===!1?(Ee(()=>{localStorage.removeItem(pn)}),!1):t===null&&Ti()},Ti=()=>window.localStorage?localStorage.getItem(pn)==="true":!1,Li=t=>{switch(new URLSearchParams(window.location.search).get(t)){case"true":return!0;case"false":return!1;default:return null}};class ki{debugMode;constructor(){this.debugMode=lr()}log(e,...n){this.debugMode&&(n.length>1?console.log(typeof e=="string"?"%s":"%o",e,n):n.length===1?console.log(typeof e=="string"?"%s":"%o",e,n[0]):console.log(e))}warn(e,...n){this.debugMode&&(n.length>1?console.warn(typeof e=="string"?"%s":"%o",e,n):n.length===1?console.warn(typeof e=="string"?"%s":"%o",e,n[0]):console.warn(e))}}const v=new ki,Oo=t=>{let e=t,n=0;for(;e;)n+=e.offsetTop,e=e.offsetParent;return n};class Ri{elementList;constructor(){this.elementList=[],this.initObserver()}observe(e){this.elementList.push(e)}elementsAdded(){this.onEvent()}getElementMetrics(e){const n=Oo(e),r=e.getBoundingClientRect().height;return{elementPosition:n,elementHeight:r}}onEvent(){if(!this.elementList.length)return;const e=window.scrollY,n=window.innerHeight;this.elementList.forEach((r,o)=>{if(!r)return;const{threshold:a=0,percentageFallbackThreshold:i=1}=r,{elementPosition:s,elementHeight:c}=this.getElementMetrics(r.element),l=Math.min(a,n,c*i),d=s+l<=e+n,p=s+c-l>=e;p&&d&&!r.visible?(r.onEnter(),r.enterOnce&&(this.elementList[o]=void 0),r.visible=!0):(!p||!d)&&r.visible&&(r.onExit(),r.exitOnce&&(this.elementList[o]=void 0),r.visible=!1)})}initObserver(){window.addEventListener("scroll",this.onEvent.bind(this)),window.addEventListener("resize",this.onEvent.bind(this))}}const Vt=new Ri,Mr=t=>Array.prototype.slice.call(t),Di=/^\s*>/,Ur=(t,e)=>Di.test(e)?Mr(t.querySelectorAll(`:scope ${e}`)):Mr(t.querySelectorAll(e)),Oi=":eq(",Ni=/:eq\((-?\d+)\)/g,xi=t=>t.indexOf(Oi)===-1,$i=t=>t.split(Ni).filter(e=>e!==""),Mi=/([#.])(-?\w+)/g,Ui=(t,e,n)=>`${e}${CSS.escape(n)}`,Bi=t=>t.replace(Mi,Ui),qi=t=>{const e=[],n=Bi(t.trim()),r=$i(n),{length:o}=r;let a=0;for(;a<o;){const i=r[a],s=r[a+1];s?e.push({sel:i,eq:Number(s)}):e.push({sel:i}),a+=2}return e},Gt=(t,e=document)=>{if(xi(t))return Ur(e,t);const n=qi(t),{length:r}=n;let o=[],a=e,i=0;for(;i<r;){const{sel:s,eq:c}=n[i],l=Ur(a,s),d=l.length;if(d===0||c!=null&&c>d-1)break;i<r-1&&(c==null?[a]=l:a=l[c]),i===r-1&&(c==null?o=l:o=[l[c]]),i+=1}return o},Br=[],Fi=[".teaser",".image--hero-image",".adaptiveImage",".countdown-card__event-image",".promo-layout__image",".leaderboard__initial-preview",".recipeHero",".cmp-embed--thumbnail",".countdown-card--image",".countdown-card__background"],Wi=[".carousel",".content-card",".ngps",".promoQuiz",".promoPlusQuiz",".promoPlusReceiptScanner",".promoPlusNoPin",".promoPlusPin",".promoPlusMyReceipts"],zi=[".brands-list",".secondary-header",".secondary-navigation",".youtube-subscribe",".container--mobile-app-buttons",".cmp-experiencefragment--footer"],qt={PICTURE_VISIBILE:"visible",PICTURE_LOADED:"loaded",FADE_IN_OBSERVED:"fade-in-observed"},Hi=(t,e)=>{const n={attributes:!1,childList:!0,subtree:!0};new MutationObserver(o=>{for(const a of o)e(a.addedNodes)}).observe(t,n)},No=t=>{if(Br.indexOf(t)===-1){const e=t.querySelector("img");Vt.observe({element:t,threshold:200,percentageFallbackThreshold:.75,enterOnce:!0,onEnter:()=>{t.classList.add(qt.PICTURE_VISIBILE)}});const n=()=>{t.classList.add(qt.PICTURE_LOADED)};e.addEventListener("load",n),e.complete&&(t.classList.add(qt.PICTURE_LOADED),e.removeEventListener("load",n)),Br.push(t)}},Vi=(t,e)=>{let n=!1;return t.forEach(r=>{n=n||r.contains(e)}),n},xo=t=>{const e=document.querySelectorAll(zi.join(","));let n=!1;t.forEach(r=>{Vi(e,r)||(v.log("Fading in",r),No(r),n=!0)}),n&&Vt.elementsAdded()};Do.watch(t=>{const e=Gt("picture",t);xo(e)});const $o=()=>
2{Wi.forEach(t=>{Gt(t).forEach(n=>{n.classList.contains(qt.FADE_IN_OBSERVED)||(v.log("Attaching fade-in observer on",n),Hi(n,r=>{let o=!1;r.forEach(a=>{a.nodeType===1&&Gt("picture",a).forEach(s=>{v.log("Fading in by observer",s),No(s),o=!0})}),o&&Vt.elementsAdded()}),n.classList.add(qt.FADE_IN_OBSERVED))})})},dr=(t="main.container")=>{const e=[];Fi.forEach(n=>{const r=`${t} ${n} picture`,o=Gt(r);e.push(...o)}),v.log("Fading in images"),xo(e)},Mo=()=>document.getElementById("single-sdk-config")?.dataset,Gi=()=>document.getElementById("maintenance-mode-config")?.dataset,Te=()=>{const t=Mo();if(!t)return console.warn('Element "single-sdk-config" not found.'),null;const{defaultCountry:e,defaultLanguage:n}=Bo();return{clientId:t.clientId,region:t.region,country:t.overrideCountry||e,lang:t.overrideLanguage||n,tokenExchangeUrl:t.tokenExchangeUrl,loginUrl:t.loginUrl,logoutUrl:t.logoutUrl,stringRedirectUrl:t.stringRedirectUrl,cdsGamUrl:t.cdsGamUrl,cdsEnrichmentUrl:t.cdsEnrichmentUrl,isGamV2Enabled:t.hasOwnProperty("isGamV2Enabled"),gamPolicy:t.gamPolicy}},Uo=()=>{const t=Gi();return t?{maintenancePagePath:t.maintenancePagePath||""}:null},Bo=()=>{const e=new RegExp("/(?<country>\\w{2})/(?<lang>\\w{2})(/.*)?").exec(window.location.pathname);return{defaultCountry:e?.groups.country,defaultLanguage:e?.groups.lang}},ur=()=>{const t=Mo();return t!==null&&typeof t=="object"&&"clientId"in t&&"region"in t&&"tokenExchangeUrl"in t},ji=()=>!!Uo(),ie=window.Granite&&window.Granite?.author;class Ct{static instance;constructor(){}static getInstance(){return Ct.instance||(Ct.instance=new Ct),Ct.instance}getFacadeType(){return"UnavailableFacade"}isLoginAvailable(){return!1}async getAuthToken(){return""}async getAuthPayload(){return{ref_code:"",hashed_kocid:"",ref_hashed_kocid:""}}async getUuid(){return""}async isAuthenticated(){return!1}async logOut(){}async manageAccount(){}async signIn(){const e="Could not sign in, login sdk not available.";throw console.error(e),new Error(e)}async signUp(){}}const jt={location:"location",pnpParams:"cep.pnpParams"},qo=(t,e,n="/")=>{document.cookie=`${t}=${e}; path=${n}; secure`},Ln=(t,e,n=7,r="/")=>{const o=new Date(Date.now()+n*864e5).toUTCString();document.cookie=`${t}=${e}; expires=${o}; path=${r}; secure`},gt=t=>document.cookie.split("; ").reduce((e,n)=>{const r=n.split("=");return r[0]===t?decodeURIComponent(r[1]):e},""),mn=(t,e)=>{Ln(t,"",-1,e)};async function Ki(t){try{const e=t.startsWith("http")?new URL(t):new URL(t,window.location.origin);e.pathname+=".meta";const n=await fetch(e.toString());if(n.status===404)return v.log(`Page metadata not found for page: ${t}`),{siteSection:void 0};if(!n.ok)return console.error(`Unexpected error while fetching page metadata (${n.status}).`,n),{siteSection:void 0};const r=await n.json();return v.log(`Fetched page metadata: ${JSON.stringify(r,null,2)}`),r}catch(e){return console.error("Unexpected error while fetching page metadata.",e),{siteSection:void 0}}}const Yi=async(t,e)=>{let n;return t&&e?n={siteSection:(await Ki(e)).siteSection??qr()}:n={siteSection:qr()},v.log(`Sdk analytics: ${JSON.stringify(n,null,2)}`),n};function qr(){const e=document.querySelector("#single-sdk-config")?.dataset?.siteSection||"";return v.log(`Extracted site section from sdk config markup: ${e}`),e}const Ji=()=>{const n=[...new URLSearchParams(window.location.search).entries()].filter(([r])=>r.startsWith("pnp-"));if(n.length){const r=pr(),o=Date.now();n.forEach(([a,i])=>{r[a]={t:o,v:i}}),qo(jt.pnpParams,encodeURIComponent(JSON.stringify(r)))}},pr=()=>{const t=gt(jt.pnpParams);return t?JSON.parse(decodeURIComponent(t)):{}},Qi=t=>{const e=pr();Object.entries(e).forEach(([r,o])=>{t.delete(r),t.append(r,o.v)})},Fo=()=>{const t=[],e=pr();return Object.entries(e).forEach(([r,o])=>{t.push([r,o.v,o.t])}),t};function Xi(t){const e=t.split("#")[1];if(!e||!e.toLowerCase().includes("error"))return null;const n=new URLSearchParams(e);return{type:Hn(n.get("error")),description:Hn(n.get("error_description")),hash:Hn(e)}}function Zi(t){const e=new Error(`Type: ${t.type} | Description: ${t.description} | Hash: ${t.hash}`);console.error("GAM error occurred:",e.message),window.cep.reportRumError&&window.cep.reportRumError({message:"GAM Error",stack:`${e}`})}function Hn(t){return t?decodeURI(t):null}const vt=t=>`onexp_gam_${t.country}_${t.lang}_${t.clientId}`,es=["singleSdkSignOutPromise","singleSdkEditAccountPromise","singleSdkSignInPromise","singleSdkSignUpPromise"];class ne{sdk;sdkProps;recreateSdkPromise=null;constructor(e,n){this.sdkProps=n,this.sdk=e,this.getAuthToken=this.getAuthToken.bind(this),this.getAuthPayload=this.getAuthPayload.bind(this),this.isAuthenticated=this.isAuthenticated.bind(this),this.logOut=this.logOut.bind(this),this.manageAccount=this.manageAccount.bind(this),this.signIn=this.signIn.bind(this),this.signUp=this.signUp.bind(this),this.recreateSingleSdk=this.recreateSingleSdk.bind(this),this.registerRecreateSdkListeners()}static async getInstance(){const e=Xi(window.location.href);return e&&Zi(e),window.singleSdkLoginFacadeInstancePromise||(window.singleSdkLoginFacadeInstancePromise=new Promise(async n=>{try{const{sdk:r,sdkProps:o}=await ne.createSingleSdk();window.sdk=r;
2const a=new ne(r,o);n(a)}catch(r){console.error("SDK working in unavailable login mode"),console.debug(`Error during Single SDK initialization: ${r}`);const o=Ct.getInstance();n(o)}})),window.singleSdkLoginFacadeInstancePromise}static async createSingleSdk(){const e=Te(),n={region:e.region,country:e.country,lang:e.lang,...e.gamPolicy?.length>0&&{policy:e.gamPolicy},...e.isGamV2Enabled&&{isGamV2:!0}},r=new URLSearchParams(window.location.search),o=r.get("is_magic_link"),a=r.get("referralLink"),i=window.location.pathname.endsWith("logout"),s=window.location.pathname===e.loginUrl,c=window.location.pathname===e.tokenExchangeUrl,l=c&&o==="go",d=a==="true",{defaultCountry:p,defaultLanguage:u}=Bo(),g=`${window.location.origin}/${p}/${u}`,f=r.get("return_to")||g,y=ne.calculateCurrentPageHref(),S=await Yi(s,f),k=i?{...n,analytics:S,clientId:e.clientId}:l||s?{...n,analytics:S,clientId:r.get("client_id"),redirectUri:e.tokenExchangeUrl,refCode:r.get("refCode"),returnTo:f}:c?{...n,analytics:S,clientId:e.clientId,redirectUri:e.tokenExchangeUrl}:d?{...n,analytics:S,clientId:e.clientId,redirectUri:e.tokenExchangeUrl,returnTo:y,refCode:r.get("referralCode")}:{...n,analytics:S,clientId:e.clientId,redirectUri:e.tokenExchangeUrl,returnTo:y},b=await window.cds(k);if(l&&(console.debug(`[103] onMagicLink: sdk.signInRedirect with props: ${JSON.stringify({isMagicLink:o,id_token_hint:r.get("id_token_hint")})}`),await b.signInRedirect({isMagicLink:o,id_token_hint:r.get("id_token_hint")})),d&&!b.hasActiveAccount()&&(console.debug("[104] onReferralLink: sdk.signUpRedirect()"),await b.signUpRedirect()),s&&(console.debug("[115] onLogin: sdk.signInRedirect()"),await b.signInRedirect()),ne.isPageBehindLogin()&&!b.hasActiveAccount()){console.debug("[120] SingleSdkLoginFacade.isPageBehindLogin() && !sdk.hasActiveAccount()");const C=encodeURIComponent(y),T=encodeURIComponent(e.clientId);console.debug(`[124] Setting window.location.href: ${e.loginUrl}?return_to=${C}&client_id=${T}`),window.location.href=`${e.loginUrl}?return_to=${C}&client_id=${T}`}if(c||b.hasActiveAccount())if(console.debug("[130] onTokenExchange || sdk.hasActiveAccount(): sdk.getAccessToken()"),ne.hasFreshToken(b)){console.debug("Token auth time is still fresh, refreshing token.");const C=await b.getAccessToken();console.debug(`Setting cookie ${vt(e)}`),Ln(vt(e),C,7,ne.getMarket())}else console.debug("Token auth time has expired, refreshing token will cause redirect to gamma login."),console.debug(`Deleting cookie: ${vt(e)}`),mn(vt(e),ne.getMarket());return console.debug(`[135] sdk.hasActiveAccount(): ${b.hasActiveAccount()}`),b.hasActiveAccount()||mn(vt(e),ne.getMarket()),{sdk:b,sdkProps:k}}async recreateSingleSdk(){try{console.debug("[SingleSdkLoginFacade] Recreating SDK instance...");const e=ne.calculateCurrentPageHref();this.sdkProps={...this.sdkProps,returnTo:e},this.sdk=await window.cds(this.sdkProps),window.sdk=this.sdk,console.debug("[SingleSdkLoginFacade] SDK instance recreated successfully",{returnTo:e})}catch(e){console.error("[SingleSdkLoginFacade] Failed to recreate SDK instance:",e)}}registerRecreateSdkListeners(){const e=history.pushState.bind(history);history.pushState=(...n)=>{e(...n),window.dispatchEvent(new Event("pushstate"))},window.addEventListener("pushstate",()=>{console.debug("[SingleSdkLoginFacade] History pushState detected"),this.recreateSdkPromise=this.recreateSingleSdk()}),window.addEventListener("popstate",()=>{console.debug("[SingleSdkLoginFacade] History popState detected"),this.recreateSdkPromise=this.recreateSingleSdk()})}static calculateCurrentPageHref(){const e=new URLSearchParams(window.location.search);Qi(e);const n=e.toString().length?`?${e.toString()}`:"";return`${window.location.origin?window.location.origin:""}${window.location.pathname}${n}`}static getAuthEndTime(e){const{auth_time:n}=e?.getIdentityClaims()||{};return n?n+86400:void 0}static hasFreshToken(e){const n=Math.round(Date.now()/1e3),r=ne.getAuthEndTime(e);return console.debug(`[188] hasFreshToken - now: ${n}`),console.debug(`[189] hasFreshToken - authEndTime: ${r}`),!!(r&&r>n)}static getMarket(){return window.location.pathname.split("/").slice(0,2).join("/")}static isPageBehindLogin(){return!ie&&!!document.querySelector('meta[name="hiddenBehindLogin"]')}
2static cleanGlobalRedirects(){es.forEach(e=>{delete window[e]})}static async invokeGlobalRedirect(e,n){return window[e]||(window[e]=new Promise(async(r,o)=>{try{await n(),r()}catch(a){o(a)}})),window[e]}getFacadeType(){return"SingleSdkFacade"}isLoginAvailable(){return!0}async getAuthToken(){return console.debug("[152] getAuthToken: sdk.getAccessToken();"),console.debug("claims",JSON.stringify(this.sdk.getIdentityClaims(),null,2)),await this.isAuthenticated()&&await this.sdk.getAccessToken()||""}async getAuthPayload(){if(console.debug("[getAuthPayload] Attempting to retrieve authentication payload."),!await this.isAuthenticated())return console.warn("[getAuthPayload] User is not authenticated..."),{ref_code:"",hashed_kocid:"",ref_hashed_kocid:""};try{console.debug("[getAuthPayload] Attempting to get identity claims via sdk.getIdentityClaims().");const e=this.sdk.getIdentityClaims();if(!e)return console.warn("[getAuthPayload] sdk.getIdentityClaims() returned null."),{ref_code:"",hashed_kocid:"",ref_hashed_kocid:""};const n={ref_code:e.ref_code??"",hashed_kocid:e.hashed_kocid??"",ref_hashed_kocid:e.ref_hashed_kocid??""};return n.ref_code?console.debug(`[getAuthPayload] Successfully constructed payload with ref_code: ${n.ref_code}`):console.warn("[getAuthPayload] 'ref_code' claim is missing..."),n}catch(e){return console.error("[getAuthPayload] Error retrieving or processing identity claims:",e),{ref_code:"",hashed_kocid:"",ref_hashed_kocid:""}}}
2async getUuid(){return console.debug("[157] getUuid: sdk.getIdentityClaims()"),this.sdk.getIdentityClaims().hashed_kocid||""}async isAuthenticated(){return console.debug(`[162] isAuthenticated: this.sdk.hasActiveAccount(): ${this.sdk.hasActiveAccount()}`),console.debug(`[163] isAuthenticated: SingleSdkLoginFacade.hasFreshToken(this.sdk): ${ne.hasFreshToken(this.sdk)}`),this.sdk.hasActiveAccount()&&ne.hasFreshToken(this.sdk)}async logOut(){const e=Te();return mn(vt(e),ne.getMarket()),console.debug("[169] logOut: sdk.signOutRedirect()"),ne.invokeGlobalRedirect("singleSdkSignOutPromise",async()=>{const n=e.logoutUrl?`${location.origin}${e.logoutUrl}`:ne.calculateCurrentPageHref();await this.sdk.signOutRedirect({postLogoutRedirectUri:n,state:{return_to:n}})})}async manageAccount(){return console.debug("[174] manageAccount: sdk.editAccountRedirect()"),ne.invokeGlobalRedirect("singleSdkEditAccountPromise",this.sdk.editAccountRedirect)}async signIn(){return console.debug("[179] signIn: sdk.signInRedirect()"),this.recreateSdkPromise&&await this.recreateSdkPromise,ne.invokeGlobalRedirect("singleSdkSignInPromise",this.sdk.signInRedirect)}async signUp(){return console.debug("[184] signUp: sdk.signUpRedirect()"),this.recreateSdkPromise&&await this.recreateSdkPromise,ne.invokeGlobalRedirect("singleSdkSignUpPromise",this.sdk.signUpRedirect)}}const vn="applyMocks",Wo="applyMaintenanceMode",Sn="applyStubs",Kt="stubsKey",zo="skipAnimations",Ho="showWallets",Vo="noPin",Go="errorOccurred";let jo=!1;const kn=()=>Rn(vn),Ko=()=>Yo(Wo),mr=()=>Rn(Sn),Jm=()=>Rn(zo),Qm=()=>Rn(Ho),Xm=()=>new URLSearchParams(window.location.search).get("receiptList"),ts=()=>{const t=sessionStorage.getItem(Kt)||"";return!t&&mr()&&console.error("Stubs are enabled but stubsKey is missing. Provide it via URL parameter."),t},dt=()=>{if(!mr())return{};const t=ts();return t?{"x-stubs-key":t}:{}};function Je(t,e){if(!e.has(t))return;const n=e.get(t);if(n==="false")sessionStorage.removeItem(t),t===Sn&&(sessionStorage.removeItem(vn),sessionStorage.removeItem(Kt));else{const r=n!==""?n:"true";sessionStorage.setItem(t,r),t===Sn&&sessionStorage.setItem(vn,r)}}function ns(t){if(t.has(Kt)){const e=new URL(window.location.href);e.searchParams.delete(Kt),window.history.replaceState({},"",e.toString())}}function rs(){const t=new URLSearchParams(window.location.search);Je(vn,t),Je(Wo,t),Je(Sn,t),Je(Kt,t),ns(t),Je(Vo,t),Je(Go,t),Je(zo,t),Je(Ho,t),jo=!0}function Yo(t){return jo||rs(),window.sessionStorage.getItem(t)==="true"}function Rn(t){return Yo(t)||!!ie}class At{static instance;constructor(){}static getInstance(){return At.instance||(At.instance=new At),At.instance}getFacadeType(){return"EmptyFacade"}isLoginAvailable(){return!0}async getAuthToken(){let e="eyJhbGciOiJSUzI1NiIsImtpZCI6IlphVXVud3B0Z3lNZFpRN1BLbTRWZ1QtaVl4WGxHTjY1RUdPUDFIWnV3TVUiLCJ0eXAiOiJKV1QifQ.eyJjb3VudHJ5IjoiVVMiLCJzdWIiOiJhMzQzNmFmYi0yNTBkLTRmZmMtYTZkNS00OTJkMDkxZWZhZGMiLCJoYXNoZWRfa29jaWQiOiIyOTQzNzVkOGFiNjM3YmMyODZhOGNmZjFiZGFlMDJlMTllYjc4NzJiNGE1OTA4MmFmNGNkNTE4OWJiZjI0NWUzIiwiZXh0ZW5zaW9uX2hhc19wYXNzd29yZCI6ZmFsc2UsImhhc2hlZF9lbWFpbCI6ImZISlNpVVJLZE
25qWG93Wk5WbzFFQUl4MDZHVEVORjNKQkd2QXFaYmlGSDA9IiwidGlkIjoiYzJkZTE2NWItZDA0OC00ZWZjLTllYzEtOWUyYWVjZTUwOTU1IiwiYWNyIjoiQjJDXzFBX1NpZ25VcF9TaWduSW5fZ2FtIiwibm9uY2UiOiJlZjA0YjI1Yi0yZGUyLTRjYWYtOTViOC01NjI2YmRkZGY0ODQiLCJzY3AiOiJyZWFkIiwiYXpwIjoiOTZiYjg3M2QtZGJkYi00OTNkLWIyMjgtYTI5NjM1NTBlYTQ1IiwidmVyIjoiMS4wIiwiaWF0IjoxNjkzOTk5MDQ3LCJhdWQiOiI0ZjIzMzkyOC1kMzVkLTRjMDQtYjA4OC0xMzFkNGE1Y2I3OGUiLCJleHAiOjE2OTM5OTkzNDcsImlzcyI6Imh0dHBzOi8vZ2xvYmFsZ2FtbWFiMmMuYjJjbG9naW4uY29tL2MyZGUxNjViLWQwNDgtNGVmYy05ZWMxLTllMmFlY2U1MDk1NS92Mi4wLyIsIm5iZiI6MTY5Mzk5OTA0N30.4KmSPEdbjyNH5fmaYaZsiy-PXvbcXcAQWr8LMlDaPnLGaeZHcLHdf6VIhPeymaQ4PM4q0TZHOgrPpI_H1obFRlK-6Kq7ikieHDMX4m485YxdN975aP9_s_1Tvl3bLRcIotSx9xTIMH2qCy_Z1EgePQmle1cbAp_G0Xmy-FnsiWKdXyGVgsJfIQtbCJlhKaobhNsFrcg_aKHRncrUdhteQsRVBibYV4K_oxpQPWWerIBGtH0OeiY7JLGmnCs7m8HGmnRQCq8J_CiDkbM6Ba3zS3Lrspw-Uh2jSuDr3cPCUTQzEFWGJAqq-zx7KzU4_le1MMGAifF1dKy3WRvSQtcqoQ";try{if(mr()){const n="data-pnp-api-url",r=document.querySelector(`[${n}]`).getAttribute(n);e=(await(await fetch(`${r}/stubs/token`,{method:"GET",headers:{accept:"application/json"}})).json()).token}}finally{return e}}async getAuthPayload(){return{ref_code:"AY5B1tKkPlknenq_hJiung",hashed_kocid:"1580102672137537522162830941338401",ref_hashed_kocid:new URLSearchParams(window.location.search).get("refKocid")}}async getUuid(){return"294375d8ab637bc286a8cff1bdae02e19eb7872b4a59082af4cd5189bbf245e3"}async isAuthenticated(){return kn()}async logOut(){}async manageAccount(){}async signIn(){}async signUp(){}}class it{static instance;constructor(){this.logOut=this.logOut.bind(this),this.manageAccount=this.manageAccount.bind(this),this.signIn=this.signIn.bind(this),this.signUp=this.signUp.bind(this)}static async getInstance(){if(!it.instance){it.instance=new it;const e=Te(),n=window.location.pathname===e.tokenExchangeUrl,r=window.location.pathname===e.loginUrl,o=window.location.pathname.endsWith("logout");(n||o||r)&&await it.instance.redirectToMaintenancePage()}return it.instance}redirectToMaintenancePage(){let e=Uo()?.maintenancePagePath;if(!e&&Ko()&&(e="/zz/en/under-maintenance"),!e){console.warn("Maintenance mode is enabled, but maintenance page path is missing.");return}return new Promise(n=>{setTimeout(()=>{window.location.href=e,n()},350)})}getFacadeType(){return"MaintenanceModeFacade"}isLoginAvailable(){return!1}async getAuthToken(){return""}async getAuthPayload(){return{ref_code:"",hashed_kocid:"",ref_hashed_kocid:""}}async getUuid(){return""}async isAuthenticated(){return!1}async logOut(){await this.redirectToMaintenancePage()}async manageAccount(){await this.redirectToMaintenancePage()}async signIn(){await this.redirectToMaintenancePage()}async signUp(){await this.redirectToMaintenancePage()}}const J=async()=>{const t=kn(),e=Ko();return(ji()||e)&&!ie?it.getInstance():ur()&&!t?ne.getInstance():At.getInstance()},os=()=>{ne.cleanGlobalRedirects()},Dn=async()=>await(await J()).getAuthToken().catch(e=>(console.warn(e),"")),Jt=async()=>{if(!ie)try{const t=await J();if(await t.isAuthenticated())return;await t.signIn()}catch(t){v.warn("Error occurred while auth guard",t)}},as=new URL("http://localhost:3005"),is=new URL("https://onexp-mocks.dev.tccc-nextgen.com"),ss={"onexp.rde1.playground.tccc-nextgen.com":new URL("https://onexp-mocks-rde1.dev.tccc-nextgen.com")};function Ce(t){if(!kn())return v.log(`mocksSupport: no mocks used, returning original url: ${t}`),t;try{const e=new URL(t),n=cs();e.protocol=n.protocol,e.host=n.host;const r=ds(e.toString());return v.log(`mocksSupport: using url: ${r}`),r}catch(e){return console.error(`mocksSupport: error while using promo+ url: ${t}: ${e}`),t}}function Ae(t){if(!kn())return v.log("mocksSupport: no mocks used, returning original headers"),t;const e=sessionStorage.getItem(Vo),n=sessionStorage.getItem(Go),r=new URLSearchParams(window.location.search).get("refKocid"),o=new URLSearchParams(window.location.search).get("quiz"),a=new URLSearchParams(window.location.search).get("scanner"),i=new URLSearchParams(window.location.search).get("leaderboard"),s={...e&&{"x-mocks-no-pin":e},...n&&{"x-mocks-error-occurred":n},...r&&{"x-mocks-ref-kocid":r},...o&&{"x-mocks-quiz":o},...a&&{"x-mocks-scanner":a},...i&&{"x-mocks-leaderboard":i}};return v.log(`mocksSupport: adding headers: ${JSON.stringify(s,null,2)}`),{...t,...s}}function cs(){return ls()?as:ss[window.location.hostname]??is}function ls(){return["https://local.dev.onexp.com","http://localhost:4502"].includes(window.location.origin)}function ds(t){return t.endsWith("/")?t.slice(0,-1):t}const us=t=>t,ps=t=>typeof t=="object"&&"error"in t;class Ft{constructor(e=!1,n=ps){this.enableDataCaching=e,this.isErrorResponse=n}
2cachedPromises={};cachedData={};async getCachedData(e,n,r=us){if(this.enableDataCaching&&this.cachedData[e])return this.cachedData[e];let o;this.cachedPromises[e]?o=this.cachedPromises[e]:(o=n(),this.cachedPromises[e]=o);const a=await o;delete this.cachedPromises[e];const i=r(a);return this.enableDataCaching&&!this.isErrorResponse(i)&&(this.cachedData[e]=i),i}clearCache(e){delete this.cachedPromises[e],delete this.cachedData[e]}}class ut{constructor(e){this.apiBaseUrl=e}async getProfile(){return await this.getAPIRequest("/consumers")}async updateProfile(e){const n=await this.postAPIRequest("/consumers/update",e);return ut.isErrorResponse(n)?n:await this.getProfile()}static isErrorResponse(e){return typeof e=="object"&&"error"in e}async getAPIRequest(e){return this.executeAPIRequestWrapper(n=>fetch(`${Ce(this.apiBaseUrl)}${e}`,{method:"GET",headers:Ae(n)}))}async postAPIRequest(e,n){return this.executeAPIRequestWrapper(r=>fetch(`${Ce(this.apiBaseUrl)}${e}`,{method:"POST",headers:Ae(r),body:n?JSON.stringify(n):void 0}),"POST")}async executeAPIRequestWrapper(e,n){const r={accept:"application/json",...n==="POST"&&{"Content-Type":"application/json"},Authorization:`Bearer ${await Dn()}`},o=await e(r),a=await o.json().catch(i=>{console.debug("Failed to parse JSON response:",i)});if(o.ok)return a;if(a?.userMessage||a?.message){const i=a?.userMessage??a?.message,c=i.split(",").map(l=>{const d=l.trim();if(d.startsWith("error.default.")){const p=d.replace("error.default.","").split(".");if(p.length===2)return{field:p[0],type:p[1]}}return null}).filter(Boolean);if(c.length>0)return{error:"VALIDATION_ERROR",validationErrors:c,message:i}}return{error:a?.errorCode||"UNKNOWN_ERROR",message:a?.userMessage||a?.message||"An error occurred"}}}class je extends ut{static profileCache=new Ft(!0);async getProfile(){const e=this.apiBaseUrl;return await je.profileCache.getCachedData(e,()=>super.getProfile())}async updateProfile(e){const n=this.apiBaseUrl;return je.profileCache.clearCache(n),await super.updateProfile(e)}}var Jo=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],En=Jo.join(","),Qo=typeof Element>"u",pt=Qo?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Cn=!Qo&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t?.ownerDocument},An=function(e,n){var r;n===void 0&&(n=!0);var o=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),a=o===""||o==="true",i=a||n&&e&&(typeof e.closest=="function"?e.closest("[inert]"):An(e.parentNode));return i},ms=function(e){var n,r=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return r===""||r==="true"},Xo=function(e,n,r){if(An(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(En));return n&&pt.call(e,En)&&o.unshift(e),o=o.filter(r),o},_n=function(e,n,r){for(var o=[],a=Array.from(e);a.length;){var i=a.shift();if(!An(i,!1))if(i.tagName==="SLOT"){var s=i.assignedElements(),c=s.length?s:i.children,l=_n(c,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:i,candidates:l})}else{var d=pt.call(i,En);d&&r.filter(i)&&(n||!e.includes(i))&&o.push(i);var p=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),u=!An(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(p&&u){var g=_n(p===!0?i.children:p.children,!0,r);r.flatten?o.push.apply(o,g):o.push({scopeParent:i,candidates:g})}else a.unshift.apply(a,i.children)}}return o},Zo=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},st=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||ms(e))&&!Zo(e)?0:e.tabIndex},hs=function(e,n){var r=st(e);
vendor: 18,966 bytes, lines 2-4
2return r<0&&n&&!Zo(e)?0:r},gs=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},ea=function(e){return e.tagName==="INPUT"},fs=function(e){return ea(e)&&e.type==="hidden"},ys=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},ws=function(e,n){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===n)return e[r]},bs=function(e){if(!e.name)return!0;var n=e.form||Cn(e),r=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(e.name));else try{o=r(e.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var a=ws(o,e.form);return!a||a===e},vs=function(e){return ea(e)&&e.type==="radio"},Ss=function(e){return vs(e)&&!bs(e)},Es=function(e){var n,r=e&&Cn(e),o=(n=r)===null||n===void 0?void 0:n.host,a=!1;if(r&&r!==e){var i,s,c;for(a=!!((i=o)!==null&&i!==void 0&&(s=i.ownerDocument)!==null&&s!==void 0&&s.contains(o)||e!=null&&(c=e.ownerDocument)!==null&&c!==void 0&&c.contains(e));!a&&o;){var l,d,p;r=Cn(o),o=(l=r)===null||l===void 0?void 0:l.host,a=!!((d=o)!==null&&d!==void 0&&(p=d.ownerDocument)!==null&&p!==void 0&&p.contains(o))}}return a},Fr=function(e){var n=e.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},Cs=function(e,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in e){var a=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!a}if(getComputedStyle(e).visibility==="hidden")return!0;var i=pt.call(e,"details>summary:first-of-type"),s=i?e.parentElement:e;if(pt.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var c=e;e;){var l=e.parentElement,d=Cn(e);if(l&&!l.shadowRoot&&o(l)===!0)return Fr(e);e.assignedSlot?e=e.assignedSlot:!l&&d!==e.ownerDocument?e=d.host:e=l}e=c}if(Es(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Fr(e);return!1},As=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return pt.call(n,"fieldset[disabled] *")?!0:!o.contains(e)}return!0}n=n.parentElement}return!1},Pn=function(e,n){return!(n.disabled||fs(n)||Cs(n,e)||ys(n)||As(n))},Qn=function(e,n){return!(Ss(n)||st(n)<0||!Pn(e,n))},_s=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},ta=function(e){var n=[],r=[];return e.forEach(function(o,a){var i=!!o.scopeParent,s=i?o.scopeParent:o,c=hs(s,i),l=i?ta(o.candidates):s;c===0?i?n.push.apply(n,l):n.push(s):r.push({documentOrder:a,tabIndex:c,item:o,isScope:i,content:l})}),r.sort(gs).reduce(function(o,a){return a.isScope?o.push.apply(o,a.content):o.push(a.content),o},[]).concat(n)},Ps=function(e,n){n=n||{};var r;return n.getShadowRoot?r=_n([e],n.includeContainer,{filter:Qn.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:_s}):r=Xo(e,n.includeContainer,Qn.bind(null,n)),ta(r)},Is=function(e,n){n=n||{};var r;return n.getShadowRoot?r=_n([e],n.includeContainer,{filter:Pn.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Xo(e,n.includeContainer,Pn.bind(null,n)),r},St=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return pt.call(e,En)===!1?!1:Qn(n,e)},Ts=Jo.concat("iframe:not([inert]):not([inert] *)").join(","),Vn=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return pt.call(e,Ts)===!1?!1:Pn(n,e)};function Xn(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ls(t){if(Array.isArray(t))return Xn(t)}function Wr(t,e,n,r,o,a,i){try{var s=t[a](i),c=s.value}catch(l){return void n(l)}s.done?e(c):Promise.resolve(c).then(r,o)}function zr(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var a=t.apply(e,n);function i(c){Wr(a,r,o,i,s,"next",c)}function s(c){Wr(a,r,o,i,s,"throw",c)}i(void 0)})}}function Hr(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=na(t))||e){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(c){throw c},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,i=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var c=n.next();return i=c.done,c},e:function(c){s=!0,a=c},f:function(){try{i||n.return==null||n.return()}finally{if(s)throw a}}}}function ks(t,e,n){return(e=xs(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rs(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Ds(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function Gr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Vr(Object(n),!0).forEach(function(r){ks(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Vr(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Ut(){var t,e,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function a(g,f,y,S){var k=f&&f.prototype instanceof s?f:s,b=Object.create(k.prototype);return _e(b,"_invoke",function(C,T,L){var I,R,U,O=0,_=L||[],E=!1,N={p:0,n:0,v:t,a:D,f:D.bind(t,4),d:function(h,m){return I=h,R=0,U=t,N.n=m,i}};function D(h,m){for(R=h,U=m,e=0;!E&&O&&!w&&e<_.length;e++){var w,P=_[e],A=N.p,x=P[2];h>3?(w=x===m)&&(U=P[(R=P[4])?5:(R=3,3)],P[4]=P[5]=t):P[0]<=A&&((w=h<2&&A<P[1])?(R=0,N.v=m,N.n=P[1]):A<x&&(w=h<3||P[0]>m||m>x)&&(P[4]=h,P[5]=m,N.n=x,R=0))}if(w||h>1)return i;throw E=!0,m}return function(h,m,w){if(O>1)throw TypeError("Generator is already running");for(E&&m===1&&D(m,w),R=m,U=w;(e=R<2?t:U)||!E;){I||(R?R<3?(R>1&&(N.n=-1),D(R,U)):N.n=U:N.v=U);try{if(O=2,I){if(R||(h="next"),e=I[h]){if(!(e=e.call(I,U)))throw TypeError("iterator result is not an object");if(!e.done)return e;U=e.value,R<2&&(R=0)}else R===1&&(e=I.return)&&e.call(I),R<2&&(U=TypeError("The iterator does not provide a '"+h+"' method"),R=1);I=t}else if((e=(E=N.n<0)?U:C.call(T,N))!==i)break}catch(P){I=t,R=1,U=P}finally{O=1}}return{value:e,done:E}}}(g,y,S),!0),b}var i={};function s(){}function c(){}function l(){}e=Object.getPrototypeOf;var d=[][r]?e(e([][r]())):(_e(e={},r,function(){return this}),e),p=l.prototype=s.prototype=Object.create(d);function u(g){return Object.setPrototypeOf?Object.setPrototypeOf(g,l):(g.__proto__=l,_e(g,o,"GeneratorFunction")),g.prototype=Object.create(p),g}return c.prototype=l,_e(p,"constructor",l),_e(l,"constructor",c),c.displayName="GeneratorFunction",_e(l,o,"GeneratorFunction"),_e(p),_e(p,o,"Generator"),_e(p,r,function(){return this}),_e(p,"toString",function(){return"[object Generator]"}),(Ut=function(){return{w:a,m:u}})()}function _e(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch{o=0}_e=function(a,i,s,c){function l(d,p){_e(a,d,function(u){return this._invoke(d,p,u)})}i?o?o(a,i,{value:s,enumerable:!c,configurable:!c,writable:!c}):a[i]=s:(l("next",0),l("throw",1),l("return",2))},_e(t,e,n,r)}function Os(t){return Ls(t)||Rs(t)||na(t)||Ds()}function Ns(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xs(t){var e=Ns(t,"string");return typeof e=="symbol"?e:e+""}function na(t,e){if(t){if(typeof t=="string")return Xn(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xn(t,e):void 0}}var He={getActiveTrap:function(e){return e?.length>0?e[e.length-1]:null},activateTrap:function(e,n){var r=He.getActiveTrap(e);n!==r&&He.pauseTrap(e);var o=e.indexOf(n);o===-1||e.splice(o,1),e.push(n)},deactivateTrap:function(e,n){var r=e.indexOf(n);r!==-1&&e.splice(r,1),He.unpauseTrap(e)},pauseTrap:function(e){var n=He.getActiveTrap(e);n?._setPausedState(!0)},unpauseTrap:function(e){var n=He.getActiveTrap(e);n&&!n._isManuallyPaused()&&n._setPausedState(!1)}},$s=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},Ms=function(e){return e?.key==="Escape"||e?.key==="Esc"||e?.keyCode===27},Wt=function(e){return e?.key==="Tab"||e?.keyCode===9},Us=function(e){return Wt(e)&&!e.shiftKey},Bs=function(e){return Wt(e)&&e.shiftKey},jr=function(e){return setTimeout(e,0)},$t=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return typeof e=="function"?e.apply(void 0,r):e},an=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},qs=[],Qt=function(e,n){var r=n?.document||document,o=n?.trapStack||qs,a=Gr({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isolateSubtrees:!1,isKeyForward:Us,isKeyBackward:Bs},n),i={containers:[],containerGroups:[],tabbableGroups:[],adjacentElements:new Set,alreadySilent:new Set,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},s,c=function(h,m,w){return h&&h[m]!==void 0?h[m]:a[w||m]},l=function(h,m){var w=typeof m?.composedPath=="function"?m.composedPath():void 0;return i.containerGroups.findIndex(function(P){var A=P.container,x=P.tabbableNodes;return A.contains(h)||w?.includes(A)||x.find(function($){return $===h})})},d=function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},w=m.hasFallback,P=w===void 0?!1:w,A=m.params,x=A===void 0?[]:A,$=a[h];if(typeof $=="function"&&($=$.apply(void 0,Os(x))),$===!0&&($=void 0),!$){if($===void 0||$===!1)return $;throw new Error("`".concat(h,"` was specified but was not a node, or did not return a node"))}var q=$;if(typeof $=="string"){try{q=r.querySelector($)}catch(W){throw new Error("`".concat(h,'` appears to be an invalid selector; error="').concat(W.message,'"'))}if(!q&&!P)throw new Error("`".concat(h,"` as selector refers to no known node"))}return q},p=function(){var h=d("initialFocus",{hasFallback:!0});if(h===!1)return!1;if(h===void 0||h&&!Vn(h,a.tabbableOptions))if(l(r.activeElement)>=0)h=r.activeElement;else{var m=i.tabbableGroups[0],w=m&&m.firstTabbableNode;h=w||d("fallbackFocus")}else h===null&&(h=d("fallbackFocus"));if(!h)throw new Error("Your focus-trap needs to have at least one focusable element");return h},u=function(){if(i.containerGroups=i.containers.map(function(h){var m=Ps(h,a.tabbableOptions),w=Is(h,a.tabbableOptions),P=m.length>0?m[0]:void 0,A=m.length>0?m[m.length-1]:void 0,x=w.find(function(W){return St(W)}),$=w.slice().reverse().find(function(W){return St(W)}),q=!!m.find(function(W){return st(W)>0});return{container:h,tabbableNodes:m,focusableNodes:w,posTabIndexesFound:q,firstTabbableNode:P,lastTabbableNode:A,firstDomTabbableNode:x,lastDomTabbableNode:$,nextTabbableNode:function(z){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,H=m.indexOf(z);return H<0?K?w.slice(w.indexOf(z)+1).find(function(ee){return St(ee)}):w.slice(0,w.indexOf(z)).reverse().find(function(ee){return St(ee)}):m[H+(K?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(h){return h.tabbableNodes.length>0}),i.tabbableGroups.length<=0&&!d("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(i.containerGroups.find(function(h){return h.posTabIndexesFound})&&i.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},g=function(h){var m=h.activeElement;if(m)return m.shadowRoot&&m.shadowRoot.activeElement!==null?g(m.shadowRoot):m},f=function(h){if(h!==!1&&h!==g(document)){if(!h||!h.focus){f(p());return}h.focus({preventScroll:!!a.preventScroll}),i.mostRecentlyFocusedNode=h,$s(h)&&h.select()}},y=function(h){var m=d("setReturnFocus",{params:[h]});return m||(m===!1?!1:h)},S=function(h){var m=h.target,w=h.event,P=h.isBackward,A=P===void 0?!1:P;m=m||an(w),u();var x=null;if(i.tabbableGroups.length>0){var $=l(m,w),q=$>=0?i.containerGroups[$]:void 0;if($<0)A?x=i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:x=i.tabbableGroups[0].firstTabbableNode;else if(A){var W=i.tabbableGroups.findIndex(function(ye){var De=ye.firstTabbableNode;return m===De});if(W<0&&(q.container===m||Vn(m,a.tabbableOptions)&&!St(m,a.tabbableOptions)&&!q.nextTabbableNode(m,!1))&&(W=$),W>=0){var z=W===0?i.tabbableGroups.length-1:W-1,K=i.tabbableGroups[z];x=st(m)>=0?K.lastTabbableNode:K.lastDomTabbableNode}else Wt(w)||(x=q.nextTabbableNode(m,!1))}else{var H=i.tabbableGroups.findIndex(function(ye){var De=ye.lastTabbableNode;return m===De});if(H<0&&(q.container===m||Vn(m,a.tabbableOptions)&&!St(m,a.tabbableOptions)&&!q.nextTabbableNode(m))&&(H=$),H>=0){var ee=H===i.tabbableGroups.length-1?0:H+1,re=i.tabbableGroups[ee];x=st(m)>=0?re.firstTabbableNode:re.firstDomTabbableNode}else Wt(w)||(x=q.nextTabbableNode(m))}}else x=d("fallbackFocus");return x},k=function(h){var m=an(h);if(!(l(m,h)>=0)){if($t(a.clickOutsideDeactivates,h)){s.deactivate({returnFocus:a.returnFocusOnDeactivate});return}$t(a.allowOutsideClick,h)||h.preventDefault()}},b=function(h){var m=an(h),w=l(m,h)>=0;if(w||m instanceof Document)w&&(i.mostRecentlyFocusedNode=m);else{h.stopImmediatePropagation();var P,A=!0;if(i.mostRecentlyFocusedNode)if(st(i.mostRecentlyFocusedNode)>0){var x=l(i.mostRecentlyFocusedNode),$=i.containerGroups[x].tabbableNodes;if($.length>0){var q=$.findIndex(function(W){return W===i.mostRecentlyFocusedNode});q>=0&&(a.isKeyForward(i.recentNavEvent)?q+1<$.length&&(P=$[q+1],A=!1):q-1>=0&&(P=$[q-1],A=!1))}}else i.containerGroups.some(function(W){return W.tabbableNodes.some(function(z){return st(z)>0})})||(A=!1);else A=!1;A&&(P=S({target:i.mostRecentlyFocusedNode,isBackward:a.isKeyBackward(i.recentNavEvent)})),f(P||i.mostRecentlyFocusedNode||p())}i.recentNavEvent=void 0},C=function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i.recentNavEvent=h;var w=S({event:h,isBackward:m});w&&(Wt(h)&&h.preventDefault(),f(w))},T=function(h){(a.isKeyForward(h)||a.isKeyBackward(h))&&C(h,a.isKeyBackward(h))},L=function(h){Ms(h)&&$t(a.escapeDeactivates,h)!==!1&&(h.preventDefault(),s.deactivate())},I=function(h){var m=an(h);l(m,h)>=0||$t(a.clickOutsideDeactivates,h)||$t(a.allowOutsideClick,h)||(h.preventDefault(),h.stopImmediatePropagation())},R=function(){if(!i.active)return Promise.resolve();He.activateTrap(o,s);var h;return a.delayInitialFocus?h=new Promise(function(m){i.delayInitialFocusTimer=jr(function(){f(p()),m()})}):(h=Promise.resolve(),f(p())),r.addEventListener("focusin",b,!0),r.addEventListener("mousedown",k,{capture:!0,passive:!1}),r.addEventListener("touchstart",k,{capture:!0,passive:!1}),r.addEventListener("click",I,{capture:!0,passive:!1}),r.addEventListener("keydown",T,{capture:!0,passive:!1}),r.addEventListener("keydown",L),h},U=function(h){i.active&&!i.paused&&s._setSubtreeIsolation(!1),i.adjacentElements.clear(),i.alreadySilent.clear();var m=new Set,w=new Set,P=Hr(h),A;try{for(P.s();!(A=P.n()).done;){var x=A.value;m.add(x);for(var $=typeof ShadowRoot<"u"&&x.getRootNode()instanceof ShadowRoot,q=x;q;){m.add(q);var W=q.parentElement,z=[];W?z=W.children:!W&&$&&(z=q.getRootNode().children,W=q.getRootNode().host,$=typeof ShadowRoot<"u"&&W.getRootNode()instanceof ShadowRoot);var K=Hr(z),H;try{for(K.s();!(H=K.n()).done;){var ee=H.value;w.add(ee)}}catch(re){K.e(re)}finally{K.f()}q=W}}}catch(re){P.e(re)}finally{P.f()}m.forEach(function(re){w.delete(re)}),i.adjacentElements=w},O=function(){if(i.active)return r.removeEventListener("focusin",b,!0),r.removeEventListener("mousedown",k,!0),r.removeEventListener("touchstart",k,!0),r.removeEventListener("click",I,!0),r.removeEventListener("keydown",T,!0),r.removeEventListener("keydown",L),s},_=function(h){var m=h.some(function(w){var P=Array.from(w.removedNodes);return P.some(function(A){return A===i.mostRecentlyFocusedNode})});m&&f(p())},E=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(_):void 0,N=function(){E&&(E.disconnect(),i.active&&!i.paused&&i.containers.map(function(h){E.observe(h,{subtree:!0,childList:!0})}))};return s={get active(){return i.active},get paused(){return i.paused},activate:function(h){if(i.active)return this;var m=c(h,"onActivate"),w=c(h,"onPostActivate"),P=c(h,"checkCanFocusTrap"),A=He.getActiveTrap(o),x=!1;if(A&&!A.paused){var $;($=A._setSubtreeIsolation)===null||$===void 0||$.call(A,!1),x=!0}try{P||u(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=g(r),m?.();var q=function(){var z=zr(Ut().m(function K(){return Ut().w(function(H){for(;;)switch(H.n){case 0:return P&&u(),H.n=1,R();case 1:s._setSubtreeIsolation(!0),N(),w?.();case 2:return H.a(2)}},K)}));return function(){return z.apply(this,arguments)}}();if(P)return P(i.containers.concat()).then(q,q),this;q()}catch(z){if(A===He.getActiveTrap(o)&&x){var W;(W=A._setSubtreeIsolation)===null||W===void 0||W.call(A,!0)}throw z}return this},deactivate:function(h){if(!i.active)return this;var m=Gr({onDeactivate:a.onDeactivate,onPostDeactivate:a.onPostDeactivate,checkCanReturnFocus:a.checkCanReturnFocus},h);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,i.paused||s._setSubtreeIsolation(!1),i.alreadySilent.clear(),O(),i.active=!1,i.paused=!1,N(),He.deactivateTrap(o,s);var w=c(m,"onDeactivate"),P=c(m,"onPostDeactivate"),A=c(m,"checkCanReturnFocus"),x=c(m,"returnFocus","returnFocusOnDeactivate");w?.();var $=function(){jr(function(){x&&f(y(i.nodeFocusedBeforeActivation)),P?.()})};return x&&A?(A(y(i.nodeFocusedBeforeActivation)).then($,$),this):($(),this)},pause:function(h){return i.active?(i.manuallyPaused=!0,this._setPausedState(!0,h)):this},unpause:function(h){return i.active?(i.manuallyPaused=!1,o[o.length-1]!==this?this:this._setPausedState(!1,h)):this}
4,updateContainerElements:function(h){var m=[].concat(h).filter(Boolean);return i.containers=m.map(function(w){return typeof w=="string"?r.querySelector(w):w}),a.isolateSubtrees&&U(i.containers),i.active&&(u(),i.paused||s._setSubtreeIsolation(!0)),N(),this}},Object.defineProperties(s,{_isManuallyPaused:{value:function(){return i.manuallyPaused}},_setPausedState:{value:function(h,m){if(i.paused===h)return this;if(i.paused=h,h){var w=c(m,"onPause"),P=c(m,"onPostPause");w?.(),O(),s._setSubtreeIsolation(!1),N(),P?.()}else{var A=c(m,"onUnpause"),x=c(m,"onPostUnpause");A?.();var $=function(){var q=zr(Ut().m(function W(){return Ut().w(function(z){for(;;)switch(z.n){case 0:return u(),z.n=1,R();case 1:s._setSubtreeIsolation(!0),N(),x?.();case 2:return z.a(2)}},W)}));return function(){return q.apply(this,arguments)}}();$()}return this}},_setSubtreeIsolation:{value:function(h){a.isolateSubtrees&&i.adjacentElements.forEach(function(m){var w;if(h)switch(a.isolateSubtrees){case"aria-hidden":(m.ariaHidden==="true"||((w=m.getAttribute("aria-hidden"))===null||w===void 0?void 0:w.toLowerCase())==="true")&&i.alreadySilent.add(m),m.setAttribute("aria-hidden","true");break;default:(m.inert||m.hasAttribute("inert"))&&i.alreadySilent.add(m),m.setAttribute("inert",!0);break}else if(!i.alreadySilent.has(m))switch(a.isolateSubtrees){case"aria-hidden":m.removeAttribute("aria-hidden");break;default:m.removeAttribute("inert");break}})}}}),s.updateContainerElements(e),s};const rt=(t="#labels")=>{const e=document.querySelector(t);let n;try{n=JSON.parse(e.dataset.labels)}catch{n={}}return n},Fe=t=>rt()[t],he={scrollLock:"scroll-lock",visible:"visible",transition:"transition",modalDialog:"cep-modal-dialog",modalDialogWrapper:"cep-modal-dialog__wrapper",modalDialogContainer:"cep-modal-dialog__container",modalCloseBtn:"cep-modal-dialog__close",modalCloseCTA:"close-btn"};class On{name;priority;wrapper;id;isOpen;focusTrap;keyDownEvent;additionalCloseHandler;constructor(e,n,r,o,a){if(o?this.wrapper=o:this.wrapper=this.createModal(r),this.id=null,this.isOpen=!1,this.name=e,this.priority=n,this.additionalCloseHandler=a,this.handleModalEvents(),this.priority==="auto"){const{id:i}=window.modalController.requestOpen({name:this.name,priority:this.priority,openFn:this.openModal.bind(this),closeFn:this.closeModal.bind(this)});this.id=i}}async openModal(){if(this.isOpen)return;await M.mountDeferred(this.wrapper),this.isOpen=!0,this.wrapper.classList.add(he.visible),setTimeout(()=>this.wrapper.classList.add(he.transition),10),document.body.classList.add(he.scrollLock);const e=this.wrapper.querySelector(`.${he.modalCloseBtn}`);this.focusTrap=Qt(this.wrapper,{allowOutsideClick:!0,clickOutsideDeactivates:!1,escapeDeactivates:!1,returnFocusOnDeactivate:!1,...e&&{initialFocus:e,fallbackFocus:e}}),this.focusTrap.activate()}closeModal(){this.isOpen&&(this.id=null,this.isOpen=!1,this.wrapper.classList.remove(he.transition),setTimeout(()=>this.wrapper.classList.remove(he.visible),300),document.body.classList.remove(he.scrollLock),this.focusTrap?.active&&this.focusTrap.deactivate({returnFocus:!1}),this.focusTrap=null,document.removeEventListener("keydown",this.keyDownEvent),this.additionalCloseHandler?.())}createModal(e){const n=Fe("closeButton"),r=document.createElement("div");r.classList.add(he.modalDialog),e&&r.classList.add(e);const o=document.createElement("div");o.classList.add(he.modalDialogWrapper);const a=document.createElement("div");a.classList.add(he.modalDialogContainer);const i=document.createElement("button");return i.classList.add(he.modalCloseBtn),i.setAttribute("aria-label",n),a.append(i),o.append(a),r.append(o),document.body.append(r),r}handleModalEvents(){const e=this.wrapper.querySelector(`.${he.modalCloseBtn}`),n=this.wrapper.querySelector(`.${he.modalCloseCTA}`),r=Fe("closeButton");e?.setAttribute("aria-label",r),this.keyDownEvent=o=>{o.key==="Escape"&&window.modalController.requestClose(this.id)},this.wrapper.addEventListener("click",o=>{const a=o.target;(a.classList.contains(he.modalDialog)||a.classList.contains(he.modalDialogWrapper))&&window.modalController.requestClose(this.id
4)}),e?.addEventListener("click",()=>{window.modalController.requestClose(this.id)}),n?.addEventListener("click",()=>{window.modalController.requestClose(this.id)}),document.addEventListener("keydown",this.keyDownEvent)}}const ra=(t,e)=>{document.body.appendChild(t);const n="cep-modal-dialog";return new On(n,e,"",t)},hr=t=>{if(t.priority==="manual"){const{id:n}=window.modalController.requestOpen({name:t.name,priority:t.priority,openFn:t.openModal.bind(t),closeFn:t.closeModal.bind(t)});t.id=n}const e={id:t.id,name:t.name,priority:t.priority,wrapper:t.wrapper};document.dispatchEvent(new CustomEvent("cep:modal-opened",{detail:e}))},Kr=t=>{const e=document.getElementById(t);if(!e)throw new Error(`Cannot find modal component using id: ${t}`);const n=ra(e,"auto");hr(n)},gr="cepCmpInit",fr="true",Nn="data-cep-deferred-mount",oa=t=>getComputedStyle(t).display==="none"?!0:t.parentElement?oa(t.parentElement):!1,aa=t=>t.hasAttribute(Nn),Fs=t=>aa(t)?!0:!!t.parentElement?.closest(`[${Nn}]`),Ws=t=>{t.setAttribute(Nn,"true")},zs=t=>{t.removeAttribute(Nn)};function ft(t){const e="cep-global-components";let n=document.getElementById(e);n||(n=document.createElement("div"),n.id=e,n.hidden=!0,document.body.appendChild(n));let r=n.querySelector(`#${t}`);return r||(r=document.createElement("div"),r.id=t,n.appendChild(r)),r}const ia=t=>!t||t.dataset[gr]===fr||Fs(t);function se(t,e){return Y([t],e).length>0}async function Dt(t,e){return(await me([t],e)).length>0}function Y(t,e){const n=[];for(const r of t)ia(r)||(e(r),r.dataset[gr]=fr,n.push(r));return n}async function me(t,e){return await We(t,async()=>Promise.resolve({}),e)}async function We(t,e,n){const r=Array.from(t).filter(s=>!ia(s));if(!r.length)return[];const o=await e(),a=[],i=r.map(s=>n(s,o).then(()=>{s.dataset[gr]=fr,a.push(s)}));return await Promise.all(i),a}class Yr{componentList;printReport;mountQueue;constructor(){this.componentList=[],this.printReport=lr(),this.mountQueue=Promise.resolve(),window.cep=window.cep||{},Do.watch(e=>{this.mountAll(e,{stopReport:!0})})}registerComponent(e){this.componentList.find(n=>n.name===e.name)?v.warn(`Component ${e.name} already registered`):(v.log(`Registering ${e.name} component`,e),this.componentList.push(e),window.cep.allComponentsReady&&(v.log(`Mounting ${e.name} component after all components are ready`),e.mount(document.body)))}async mountAllTask(e=document.body,n={}){v.log("Mounting all components on scope",e);const r={TIME:"Time [ms]",PERCENT:"Percent [%]"},o={FULL:"█",EMPTY:"░",SPACE:" "},a={};let i=0;const s=async l=>{try{const d=window.performance.now();await l.mount(e);const p=parseFloat((window.performance.now()-d).toFixed(3));i+=p,a[l.name]={[r.TIME]:p}}catch(d){console.error(d),window.cep.reportRumError?.({message:`${l.name} Component Error`,stack:`${d}`})}},c=()=>{if(!n?.stopReport&&this.printReport){for(const l in a){const d=Math.round(a[l][r.TIME]/i*100);a[l][r.PERCENT]="";for(let p=0;p<20;p++)a[l][r.PERCENT]+=p*5<Math.round(d)?o.FULL:o.EMPTY;a[l][r.PERCENT]+=`${o.SPACE.repeat(3)}${d} %`.slice(-6)}a.TOTAL={[r.TIME]:parseFloat(i.toFixed(1))},console.table(a)}};for(const l of this.componentList)await s(l);c(),window.cep.allComponentsReady=!0}async mountDeferredTask(e){aa(e)&&(zs(e),await this.mountAllTask(e))}async mountAll(e=document.body,n={}){const r=this.mountQueue.then(()=>this.mountAllTask(e,n));this.mountQueue=r.catch(o=>{console.error("Error mounting components",o)}),await r}async mountDeferred(e){const n=this.mountQueue.then(()=>this.mountDeferredTask(e));this.mountQueue=n.catch(r=>{console.error("Error mounting deferred scope",r)}),await n}}const Jr=async t=>{v.log("Initializing components as requested",t);for(const e of t||[]){const n=Gt(e);v.log("Mounting scope",[...n]);for(const r of n)await window.cep?.componentController.mountAll(r);dr(e)}$o()},Qr=async()=>{try{if(await(ur()?await J():void 0)?.isAuthenticated()){const n=Te().cdsGamUrl,o=await(n?new ut(n):null)?.getProfile();return ut.isErrorResponse(o)?null:o}}catch(t){console.log(t)}return null};window.cep?(window.cep.componentController===void 0&&(window.cep.componentController=new Yr),window.cep.initializeComponents===void 0&&(window.cep.initializeComponents=Jr),window.cep.openM
4odalComponentById===void 0&&(window.cep.openModalComponentById=Kr),window.cep.gam===void 0&&(window.cep.gam={getUserProfile:Qr})):window.cep={gam:{getUserProfile:Qr},allComponentsReady:!1,componentController:new Yr,initializeComponents:Jr,openModalComponentById:Kr};const M=window.cep.componentController,ve={brandBanner:"brand-banner",container:"cmp-adaptive-image",top:"brand-banner--dynamic-top",bottom:"brand-banner--dynamic-bottom",dynamic:"brand-banner--dynamic"},Xr=t=>{const e=window.innerHeight,n=t.querySelector("img"),{height:r}=n.getBoundingClientRect(),o=t.querySelector(`.${ve.container}`);if(r>=e){o.classList.remove(ve.top),o.classList.remove(ve.bottom),o.classList.remove(ve.dynamic);return}const{top:a,bottom:i}=t.getBoundingClientRect(),s=(a+i)*.5,c=s<r*.5,l=s>e-r*.5;c?(o.classList.add(ve.top),o.classList.remove(ve.bottom),o.classList.remove(ve.dynamic)):l?(o.classList.add(ve.bottom),o.classList.remove(ve.top),o.classList.remove(ve.dynamic)):(o.classList.add(ve.dynamic),o.classList.remove(ve.top),o.classList.remove(ve.bottom))},Hs=async t=>{const e=t.querySelectorAll(`.${ve.brandBanner}`);if(!e.length)return;const n=()=>e.forEach(Xr);window.addEventListener("resize",n),window.addEventListener("scroll",n),Y(e,r=>{Xr(r)})};(()=>{const t={name:"Brand Banner",mount:Hs};M.registerComponent(t)})();const Vs=async(t="")=>{try{if(!t.toLowerCase().endsWith(".svg"))return console.error("Invalid file extension. Expected .svg"),null;const e=await fetch(t);return e.ok?await e.text():null}catch(e){return console.error("Failed to load SVG:",e),null}},Gs=async t=>{if(!t)return;const e=t.querySelector("picture"),n=t.querySelector("img");try{const r=await Vs(n.src);if(r){const i=new DOMParser().parseFromString(r,"image/svg+xml").documentElement;i.classList.add("bx-svg-icon"),e.replaceWith(i)}}catch(r){console.error(r)}};(()=>{const e={name:"Brand Expression SVG Icon",mount:async n=>{const o=n.querySelectorAll('.cmp-adaptive-image[data-cmp-data-layer*="/content/dam/onexp/global/icons/brand-expression/"]');Y(o,Gs)}};M.registerComponent(e)})();const js=t=>{const e=new Date;return e.setDate(1),e.setMonth(t-1),e.toLocaleString("default",{month:"short"})};(()=>{const t={ageGate:".age-gate",ageDoBMonth:".age-gate-dob__dropdown--month select",ageDoBDay:".age-gate-dob__dropdown--day select",ageDoBYear:".age-gate-dob__dropdown--year select",ageButtonConfirm:".age-gate__button--confirm button",ageButtonReject:".age-gate__button--reject button",selected:"fieldset--selected"},e=async o=>{const a=o.querySelectorAll(t.ageGate);Y(a,i=>n(i))},n=async o=>{const a="MM",i="DD",s="YYYY",c=(I,R)=>{const U=document.createElement("option");return U.value=`${I}`,U.text=`${R}`,U},l=(I,R,{valueMapper:U,textMapper:O}={})=>{const _=U||(N=>N+1),E=O||(N=>`${N}`);Array.from({length:R},(N,D)=>_(D)).map(N=>({value:N,text:E(N)})).map(({value:N,text:D})=>c(N,D)).forEach(N=>I.appendChild(N))},d=I=>{const U=new Date().getFullYear(),O=U-1900+1,_=12,E=31,[N,D,h]=I;l(N,_,{textMapper:js}),l(D,E),l(h,O,{valueMapper:m=>U-m})},p=(I,R,U)=>{const O=parseInt(R.value,10),_=parseInt(I.value,10),E=parseInt(U.value,10),N=_>=1&&_<=12,D=E>=1900;let h=N?[31,29,31,30,31,30,31,31,30,31,30,31][_-1]:31;D&&_===2&&(h=E%400===0||E%100!==0&&E%4===0?29:28);const m=O>=1&&O<=h,w=D&&N&&m;return O>h?"INVALID":w?"VALID":"NOT_SELECTED"},u=(I,R,U)=>()=>{const[O,_,E]=R,N=p(O,_,E);N==="NOT_SELECTED"?U.disabled=!0:N==="INVALID"?(U.disabled=!0,_.value=i):U.disabled=!1,I.value===a||I.value===i||I.value===s?I.parentElement.classList.remove(t.selected):I.parentElement.classList.add(t.selected)},g=(I,R)=>I.forEach(U=>U.addEventListener("change",u(U,I,R))),f=I=>{const R=new URLSearchParams(window.location.search),[U,O,_]=I;return U&&U.value&&R.append("month",U.value),O&&O.value&&R.append("day",O.value),_&&_.value&&R.append("year",_.value),R.toString()},y=()=>{const I=new RegExp("(?<market>/\\w{2}/\\w{2})(/.*)?"),{groups:R}=I.exec(window.location.pathname);return R.market},S=o.querySelector(t.ageDoBMonth),k=o.querySelector(t.ageDoBDay),b=o.querySelector(t.ageDoBYear),C=[S,k,b],T=o.querySelector(t.ageButtonConfirm),L=o.querySelector(t.ageButtonReject);S&&k&&b&&(T&&(T.disabled=!0),d(C),g(C,T)),T?.addEventListener("click",()=>{const I=y(),R=f(C);window.location.href=`${I}/confirm-agegate?${R}`}),L?.addEventListener("click",()=>{const I=new URLSearchParams(window.location.search);I.append("agegate_result","rejected");const R=I.toString(),U=y();window.location.href=`${U}/confirm-agegate?${R}`})},r={name:"Age Gate",mount:e};M.registerComponent(r)})();const Ks=(t,e=0)=>{const{top:n,bottom:r}=t.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight,a=n<o+e&&n>0,i=r>0-e&&r<o;return a||i},Ys=t=>!!(t&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length));class ot{element;threshold;controller=new AbortController;constructor(e,n={threshold:0}){this.element=e,this.threshold=n.threshold}observe(e,n="constant"){const r=()=>{Ks(this.element,this.threshold)&&(e(),n==="single"&&this.controller.abort())};r(),window.addEventListener("scroll",r,{signal:this.controller.signal}),window.addEventListener("resize",r,{signal:this.controller.signal})}stopObserve(){this.controller.abort()}}(()=>{const t=r=>{new ot(r,{threshold:40}).observe(()=>{e(r)},"single")},e=async r=>{const{init:o}=await Z(async()=>{const{init:a}=await import("./azureMaps.js");return{init:a}},__vite__mapDeps([0,1]),import.meta.url);o(r)},n=async r=>{const o=r.querySelectorAll(".cmp-embed__azure-maps");Y(o,a=>{t(a)})};M.registerComponent({name:"Azure Maps",mount:n})})();const xe=Object.freeze({MOBILE:0,TABLET:600,DESKTOP:1200}),sa=/^\/[a-z]{2}\/[a-z]{2}$/,Js=/(\/content\/\w+)?\/[a-z]{2}\/[a-z]{2}/,Qs="https://www.youtube.com/iframe_api",Xs="https://open.spotify.com/embed-podcast/iframe-api/v1",ca="https://onexp.dev.tccc-nextgen.com",Zs=new RegExp(/^(\/content\/[a-z]+)?\/(?<country>[a-z]{2})\/(?<language>[a-z]{2})/),ec=()=>!!window?.tccc?.cloudsearch,tc=()=>window.tccc.cloudsearch,yr=()=>{const t=window.location.pathname,e=Zs.exec(t);return e?{path:t.match(Js)[0],country:e.groups.country,language:e.groups.language}:ec()?{path:"",country:"",language:"",useUrlMatch:!1,windowMatch:tc()}:{path:"/zz/en",country:"zz",language:"en"}},Zm=yr();(()=>{const t={bannerWrapper:".banner-wrapper",bannerContainer:".banner-wrapper .cmp-container",bannerMessage:".banner-wrapper .cmp-text",bannerButton:"banner__button",bannerExpanded:"banner--expanded"},e={name:"banner-last-message",expireAfterDays:365},n=s=>
4gt(e.name)!==s,r=(s,c)=>{s.closest(t.bannerWrapper).classList.remove(t.bannerExpanded),Ln(e.name,c,e.expireAfterDays,yr().path)},o=(s,c)=>{n(c)&&s.closest(t.bannerWrapper).classList.add(t.bannerExpanded)},i={name:"Banner",mount:async s=>{se(s.querySelector(t.bannerContainer),c=>{const l=s.querySelector(t.bannerMessage);if(!c||!l)return;const{id:d}=l,p=document.createElement("button");p.ariaLabel=Fe("closeButton"),p.classList.add(t.bannerButton),p.addEventListener("click",()=>{r(c,d)}),c.appendChild(p),o(c,d)})}};M.registerComponent(i)})();const la=()=>document.querySelector("#theme-url")?.dataset.themeUrl,ct=t=>{const e=t||window.location.pathname,r=new RegExp("/(?<country>\\w{2})/(?<lang>\\w{2})(/.*)?").exec(e),o=r?.groups?.country,a=r?.groups?.lang;return!o||!a?(v.log(`Cannot find either country or lang in ${e}`),null):`/${o}/${a}`},nc=t=>t.indexOf("://")>0||t.indexOf("//")===0,da=t=>t.startsWith("https://"),Zn=t=>{const e=new URL(t,window.location.origin);return e.searchParams.delete("wcmmode"),e.pathname},ua=t=>t.replace(/\.html$/,""),hn="brandExpression",Gn="brandFonts",Zr="use-brand-fonts",eo=["tccc","coca-cola","sprite","fanta","fanta-halloween","schweppes","powerade","fuzetea","smartwater","minute-maid"],rc=()=>{const e=new URLSearchParams(window.location.search).get(hn);return e?`${e}-brand-theme`:document.head.querySelector("#design-token")?.dataset.brandExpression??null},oc=async()=>{const t=la();if(!t){v.warn("Theme URL not found");return}const e=`${t}/resources/brand-expression`,n=new URLSearchParams(window.location.search),r=n.get(hn);if(r===null)return;if(!eo.includes(r)){v.warn(`
5            Supplied '${hn}=${r}' value is invalid.
6
7            Allowed values are: ${eo.join(", ")}.
8        `);return}const o=`${r}-brand-theme`,a=`${e}/${o}.css`;v.log(a);const i=await fetch(a).then(l=>l.text()),s=document.head.querySelector("#design-token");if(v.log(`Changing Brand Expression to: ${r}`),s)s.dataset.brandExpression=o,s.textContent=i;else{const l=document.createElement("style");l.id="design-token",l.dataset.brandExpression=o,l.textContent=i,document.head.appendChild(l)}v.log(`Found the "${hn}" query param - removing the Brand Fonts functionality`),document.body.classList.remove(Zr);const c=n.get(Gn);c!==null&&(c==="true"?(v.log(`Found the "${Gn}=true" query param - applying the Brand Fonts`),document.body.classList.add(Zr)):v.warn(`Found the "${Gn}" with invalid value. Pass "true" to make it work.`))},to={"coca-cola":{desktop:'<svg viewBox="0 0 2560 692" xmlns="http://www.w3.org/2000/svg" class="branded-parallax__top-overlay--desktop"><path d="M2559.93 0C2217.71 11.7265 2003.47 252.273 1646.44 366.101C1145.16 525.958 446.276 435.547 0 179.55V535.912C605.369 718.345 1023.64 712.329 1473.99 496.113C1870.95 289.171 2201.3 140.987 2560 203.97L2559.93 0Z"/><path d="M1473.99 495.709C1023.64 711.854 605.369 717.868 0 535.498V692H2560V203.637C2201.3 140.669 1870.95 288.817 1473.99 495.709Z"/></svg>',mobile:'<svg viewBox="0 0 1200 325" xmlns="http://www.w3.org/2000/svg" class="branded-parallax__top-overlay--mobile"><path d="M690.933 232.896C479.833 334.287 283.767 337.108 0 251.561V324.973H1200V95.8894C1031.86 66.3521 877.008 135.846 690.933 232.896Z"/><path d="M1199.97 -0.00012207C1039.55 5.50057 939.125 118.336 771.767 171.731C536.792 246.716 209.192 204.306 0 84.2234V251.386C283.767 336.961 479.833 334.14 690.933 232.717C877.008 135.644 1031.86 66.1341 1200 95.6783L1199.97 -0.00012207Z"/></svg>'},fanta:{desktop:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2560 655" class="branded-parallax__top-overlay--desktop"><path d="M1784.77 144.955C1755.89 664.246 832.623 615.835 672.997 339.507C549.547 656.772 112.64 612.423 0 301.575V655H2560V0C2442.73 262.211 2093.76 341.398 1784.76 144.941L1784.77 144.955Z"/></svg>',mobile:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 307"><path d="M836.609 67.9405C823.072 311.334 390.292 288.643 315.467 159.128C257.6 307.831 52.8 287.044 0 141.349V307H1200V0C1145.03 122.899 981.452 160.014 836.604 67.934L836.609 67.9405Z"/></svg>'},sprite:{desktop:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2560 1022" class="branded-parallax__top-overlay--desktop"><path d="M2385.65 310.839C2362.15 451.697 2399.42 588.156 2479.61 698.402C2276.4 606.11 1852.59 514.816 1489.84 564.414C1129.86 613.623 810.717 781.726 573.059 1015.23C554.629 916.187 475.988 770.879 360.706 693.715C230.245 606.38 74.4795 589.899 0 587.58V1022H2560V0C2469.57 80.9714 2406.12 188.138 2385.65 310.839Z"/></svg>',mobile:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 479" class="branded-parallax__top-overlay--mobile">
8<path d="M1118.28 145.687C1107.26 211.705 1124.73 275.662 1162.32 327.334C1067.06 284.077 868.4 241.288 698.365 264.535C529.622 287.598 380.022 366.385 268.622 475.827C259.982 429.405 223.12 361.302 169.081 325.136C107.927 284.204 34.9123 276.479 0 275.393V479H1200V0C1157.61 37.9503 1127.87 88.1781 1118.28 145.687Z"/></svg>'}};(()=>{const t={topWrapper:".branded-parallax__top-wrapper",topContainer:".branded-parallax__top",topFixed:"branded-parallax__top--fixed",backgroundFix:".branded-parallax__background-fix"},e="coca-cola",n={"fanta-brand-theme":"fanta","sprite-brand-theme":"sprite"},r=l=>{const d=l.querySelector(t.topWrapper),p=l.querySelector(t.topContainer),u=p.getBoundingClientRect().height;d.style.height=`${u}px`,l.getBoundingClientRect().top<=0?p.classList.add(t.topFixed):p.classList.remove(t.topFixed)},o=(l,d)=>{const p=l.querySelector(t.backgroundFix);p.insertAdjacentHTML("beforeend",to[d].desktop),p.insertAdjacentHTML("beforeend",to[d].mobile)},a=l=>{const d=rc(),p=d?n[d]:void 0;p&&l.classList.add(`brand-expression--${p}`),o(l,p||e)},i=l=>{const d=l.querySelector(t.topWrapper),p=l.querySelectorAll(".branded-parallax__top .hero :is(a, button)"),u=()=>{d.scrollIntoView({behavior:"smooth"})};p.forEach(g=>{g.addEventListener("focusin",()=>{g.matches(":focus-visible")&&u()})})},c={name:"Branded Parallax",mount:async l=>{const d=l.querySelectorAll(".brandedParallax");await me(d,async p=>{a(p),window.addEventListener("resize",()=>r(p)),window.addEventListener("scroll",()=>r(p),{passive:!0}),r(p),i(p)})}};M.registerComponent(c)})();(()=>{const e={name:"Util - Browser Classes",mount:async n=>{const r=ft("browser-classes");se(r,()=>{n.ownerDocument.body.classList.toggle("isSafari",/^((?!chrome|android).)*safari/i.test(navigator.userAgent))})}};M.registerComponent(e)})();const Me=t=>{const e=Math.floor(t),n=(100-100/t*e)/2;return{perPage:e,padding:`${n}%`}},no=(t,e)=>{if(!t){v.warn("[switchChildFocus] `splide` is null - aborting.");return}const n=t.Components.Slides.filter(".splide__slide"),r=t.Components.Slides.filter(".is-visible");n?.forEach(o=>{const a=r.includes(o);if(e&&!a){o.slide.setAttribute("inert","true");return}!o.slide.hasAttribute("inert")!==a&&(a?o.slide.removeAttribute("inert"):o.slide.setAttribute("inert","true"))})},ac={type:"loop",focus:0,arrows:!1,flickPower:600,cloneStatus:!1,mediaQuery:"min",gap:"var(--dimension-spacing-m)"},ic={"card-primary":{...Me(1.15),flickMaxPages:.5,breakpoints:{[xe.DESKTOP]:{...Me(2),flickMaxPages:.4,flickPower:200,gap:"var(--dimension-spacing-xl)"}}},"card-secondary":{...Me(1.15),flickMaxPages:.5,breakpoints:{[xe.DESKTOP]:{...Me(3),flickMaxPages:.3,flickPower:100,gap:"var(--dimension-spacing-xl)"}}},hero:{...Me(1.15),focus:"center",breakpoints:{[xe.DESKTOP]:{gap:"var(--dimension-spacing-xl)"}}},image:{...Me(1.15),focus:"center",breakpoints:{[xe.DESKTOP]:{gap:"var(--dimension-spacing-xl)"}}},"image-card":{...Me(1.15),clones:4,flickMaxPages:.5,breakpoints:{[xe.DESKTOP]:{...Me(3.8),flickPower:400,flickMaxPages:.1,gap:"var(--dimension-spacing-m)"}}},feed:{type:"slide",focus:"center",arrows:!0,perPage:1,padding:"var(--dimension-spacing-min)",gap:"var(--dimension-spacing-min)"},micro:{type:"slide",pagination:!1,paginationKeyboard:!1,fixedWidth:"var(--microcarousel-tile-size)",padding:"var(--dimension-spacing-xl)",gap:"var(--dimension-spacing-s)",breakpoints:{[xe.DESKTOP]:{padding:"var(--dimension-spacing-min)"}}},default:{...Me(1.15),breakpoints:{[xe.DESKTOP]:{...Me(2),flickPower:400,flickMaxPages:.4,gap:"var(--dimension-spacing-xl)"}}}};var ro=function(t){var e=sc(lc(dc(cc(t),8*t.length)));return e.toLowerCase()};function sc(t){for(var e,n="0123456789ABCDEF",r="",o=0;o<t.length;o++)e=t.charCodeAt(o),r+=n.charAt(e>>>4&15)+n.charAt(15&e);return r}function cc(t){for(var e=Array(t.length>>2),n=0;n<e.length;n++)e[n]=0;for(n=0;n<8*t.length;n+=8)e[n>>5]|=(255&t.charCodeAt(n/8))<<n%32;return e}function lc(t){for(var e="",n=0;n<32*t.length;n+=8)e+=String.fromCharCode(t[n>>5]>>>n%32&255);return e}function dc(t,e){t[e>>5]|=128<<e%32,t[14+(e+64>>>9<<4)]=e;for(var n=1732584193,r=-271733879,o=-1732584194,a=271733878,i=0;i<t.length;i+=16){var s=n,c=r,l=o,d=a;r=ue(r=ue(r=ue(r=ue(r=de(r=de(r=de(r=de(r=le(r=le(r=le(r=le(r=ce(r=ce(r=ce(r=ce(r,o=ce(o,a=ce(a,n=ce(n,r,o,a,t[i+0],7,-680876936),r,o,t[i+1],12,-389564586),n,r,t[i+2],17,606105819),a,n,t[i+3],22,-1044525330),o=ce(o,a=ce(a,n=ce(n,r,o,a,t[i+4],7,-176418897),r,o,t[i+5],12,1200080426),n,r,t[i+6],17,-1473231341),a,n,t[i+7],22,-45705983),o=ce(o,a=ce(a,n=ce(n,r,o,a,t[i+8],7,1770035416),r,o,t[i+9],12,-1958414417),n,r,t[i+10],17,-42063),a,n,t[i+11],22,-1990404162),o=ce(o,a=ce(a,n=ce(n,r,o,a,t[i+12],7,1804603682),r,o,t[i+13],12,-40341101),n,r,t[i+14],17,-1502002290),a,n,t[i+15],22,1236535329),o=le(o,a=le(a,n=le(n,r,o,a,t[i+1],5,-165796510),r,o,t[i+6],9,-1069501632),n,r,t[i+11],14,643717713),a,n,t[i+0],20,-373897302),o=le(o,a=le(a,n=le(n,r,o,a,t[i+5],5,-701558691),r,o,t[i+10],9,38016083),n,r,t[i+15],14,-660478335),a,n,t[i+4],20,-405537848),o=le(o,a=le(a,n=le(n,r,o,a,t[i+9],5,568446438),r,o,t[i+14],9,-1019803690),n,r,t[i+3],14,-187363961),a,n,t[i+8],20,1163531501),o=le(o,a=le(a,n=le(n,r,o,a,t[i+13],5,-1444681467),r,o,t[i+2],9,-51403784),n,r,t[i+7],14,1735328473),a,n,t[i+12],20,-1926607734),o=de(o,a=de(a,n=de(n,r,o,a,t[i+5],4,-378558),r,o,t[i+8],11,-2022574463),n,r,t[i+11],16,1839030562),a,n,t[i+14],23,-35309556),o=de(o,a=de(a,n=de(n,r,o,a,t[i+1],4,-1530992060),r,o,t[i+4],11,1272893353),n,r,t[i+7],16,-155497632),a,n,t[i+10],23,-1094730640),o=de(o,a=de(a,n=de(n,r,o,a,t[i+13],4,681279174),r,o,t[i+0],11,-358537222),n,r,t[i+3],16,-722521979),a,n,t[i+6],23,76029189),o=de(o,a=de(a,n=de(n,r,o,a,t[i+9],4,-640364487),r,o,t[i+12],11,-421815835),n,r,t[i+15],16,530742520),a,n,t[i+2],23,-995338651),o=ue(o,a=ue(a,n=ue(n,r,o,a,t[i+0],6,-198630844),r,o,t[i+7],10,1126891415),n,r,t[i+14],15,-1416354905),a,n,t[i+5],21,-57434055),o=ue(o,a=ue(a,n=ue(n,r,o,a,t[i+12],6,1700485571),r,o,t[i+3],10,-1894986606),n,r,t[i+10],15,-1051523),a,n,t[i+1],21,-2054922799),o=ue(o,a=ue(a,n=ue(n,r,o,a,t[i+8],6,1873313359),r,o,t[i+15],10,-30611744),n,r,t[i+6],15,-1560198380),a,n,t[i+13],21,1309151649),o=ue(o,a=ue(a,n=ue(n,r,o,a,t[i+4],6,-145523070),r,o,t[i+11],10,-1120210379),n,r,t[i+2],15,718787259),a,n,t[i+9],21,-343485551),n=tt(n,s),r
8=tt(r,c),o=tt(o,l),a=tt(a,d)}return Array(n,r,o,a)}function xn(t,e,n,r,o,a){return tt(uc(tt(tt(e,t),tt(r,a)),o),n)}function ce(t,e,n,r,o,a,i){return xn(e&n|~e&r,t,e,o,a,i)}function le(t,e,n,r,o,a,i){return xn(e&r|n&~r,t,e,o,a,i)}function de(t,e,n,r,o,a,i){return xn(e^n^r,t,e,o,a,i)}function ue(t,e,n,r,o,a,i){return xn(n^(e|~r),t,e,o,a,i)}function tt(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function uc(t,e){return t<<e|t>>>32-e}const pc=t=>{const e="=".repeat((4-t.length%4)%4),n=(t+e).replace(/-/g,"+").replace(/_/g,"/"),r=window.atob(n),o=new Uint8Array(r.length);for(let a=0;a<r.length;++a)o[a]=r.charCodeAt(a);return o},pa=()=>`${window.location.origin.includes("local")?ca:window.location.origin}/api/notifications/v1`,wr=()=>{const t=document.getElementById("notifications-config");return t?{publicVapidKey:t.dataset?.publicVapidKey,aepEnvironment:t.dataset?.aepEnvironment,aepRegion:t.dataset?.aepRegion}:null},In=()=>{const t=document.getElementById("notifications-prompt-config");return t?{frequencyAppearance:t.dataset?.frequencyAppearance,numberOfPrompts:t.dataset?.numberOfPrompts,amountOfPoints:t.dataset?.amountOfPoints}:null},mc=()=>{const t=ur()?Te().region:void 0,e=wr();return{region:t||e.aepRegion,environment:e.aepEnvironment}},hc=()=>{const e=new RegExp("/(?<country>\\w{2})/(?<lang>\\w{2})(/.*)?").exec(window.location.pathname),n=e?.groups.country,r=e?.groups.lang;if(!n||!r)throw new Error(`Cannot find either country or lang in ${window.location.pathname}`);return`onexp_${r}-${n.toUpperCase()}`},gc=async()=>{const t=new Promise(r=>{setTimeout(()=>{r("timeout")},750)}),e=async()=>{let r;try{r=(await window.alloy("getIdentity"))?.identity?.ECID,v.log("Got online identity",r)}catch(o){console.log("Cannot get online identity and will not be provided in subscription due to:",o)}return r},n=await Promise.race([e(),t]);if(n==="timeout"){v.log("Timeout while getting online identity. It will not be provided in subscription");return}return n||void 0},fc=async()=>{let t;try{const{isAuthenticated:e,getAuthPayload:n}=await J();await e()?(t=(await n()).hashed_kocid,v.log("Got offline identity",t)):v.log("User is not authenticated. Offline identity will not be provided in subscription")}catch(e){console.log("Cannot get offline identity and will not be provided in subscription due to:",e)}return t||void 0},_t={amountOfPoints:0,numberOfPrompts:1,frequency:"1-week"},ma=()=>!document.getElementById("notifications-config")||!document.getElementById("notifications-prompt-config")||ie,mt=t=>async function(){try{this.classList.add("loading"),this.setAttribute("disabled","true"),await t()}finally{setTimeout(()=>{this.removeAttribute("disabled"),this.classList.remove("loading")},150)}},G={push:t=>{window.adobeDataLayer&&window.adobeDataLayer.push(t),window.dataLayer&&window.dataLayer.push(t)}},br=(t,e)=>new Promise(n=>{if(t()){n(!0);return}let r=0;const o=setInterval(()=>{t()&&(clearInterval(o),n(!0)),r++,r>=e.repetitions&&(clearInterval(o),n(!1))},e.delay)}),vr={android:"android",ios:/(iPhone|iPod|iPad)/,safari:/^((?!chrome|android).)*safari/i},ha=()=>navigator.userAgent.toLowerCase().indexOf(vr.android)>-1,Xt=()=>navigator.userAgent.match(vr.ios)!==null,ga=()=>navigator.userAgent.match(vr.safari)!==null,yc="https://www.google.com/recaptcha/api.js",wc="https://www.google.com/recaptcha/enterprise.js",Ve=(t,e)=>{const n=new Error(t);return e===void 0?console.error(n):console.error(n,e),n},fa=(t,e)=>`${t}?render=${encodeURIComponent(e)}`,ya=(t,e)=>{if(document.querySelector(`script[src="${t}"]`)){v.log("ReCaptcha script already on the page",t);return}const n=document.createElement("script");n.src=t,n.dataset[e]="true",document.head.append(n),v.log("ReCaptcha script loaded",t)},$n=async t=>{if(!t){console.warn("ReCaptcha: site key not found, the script will not be loaded");return}ya(fa(yc,t),"recaptchaLoaded")},wa=()=>document.head.querySelector('meta[name="recaptchaEnterpriseSiteKey"]')?.content,Mn=async()=>{const t=wa();if(!t){console.warn("ReCaptcha: Enterprise site key not found, the script will not be loaded");return}ya(fa(wc,t),"recaptchaEnterpriseLoaded")},nt=async(t,e)=>{if(!await br(()=>typeof window.grecaptcha?.execute=="function",{delay:375,repetitions:28}))throw Ve(`ReCaptcha not loaded on time! Action: ${e}`);return new Promise((r,o)=>{try{window.grecaptcha.ready(()=>{try{window.grecaptcha.execute(t,{action:e}).then(r).catch(a=>o(Ve(`ReCaptcha execute failed! Action: ${e}`,a)))}catch(a){o(Ve(`ReCaptcha execute failed! Action: ${e}`,a))}})}catch(a){o(Ve(`ReCaptcha ready failed! Action: ${e}`,a))}})},ba=async t=>{const e=wa();if(!e)throw Ve("ReCaptcha Enterprise site key not found!");if(await Mn(),!await br(()=>typeof window.grecaptcha?.enterprise?.execute=="function",{delay:375,repetitions:28}))throw Ve(`ReCaptcha Enterprise not loaded on time! Action: ${t}`);return new Promise((r,o)=>{try{window.grecaptcha.enterprise.ready(()=>{try{window.grecaptcha.enterprise.execute(e,{action:t}).then(r).catch(a=>o(Ve(`ReCaptcha Enterprise execute failed! Action: ${t}`,a)))}catch(a){o(Ve(`ReCaptcha Enterprise execute failed! Action: ${t}`,a))}})}catch(a){o(Ve(`ReCaptcha Enterprise ready failed! Action: ${t}`,a))}})};let Tt=null,be=null;const er="pwa-redirect-cookie",Sr=t=>async()=>{try{await Aa({trackingEnabled:!0,trackingElement:t}),lt(Sc)}catch(e){const n=Xt(),r=e?.cause==="NOTIFICATIONS_NOT_SUPPORTED",o=e?.cause==="PERMISSIONS_NOT_GRANTED";n&&r?(lt(_c),vc()):lt(r?Ec:o?Cc:Ac)}},va=t=>{Sa(t,"standard-prompt")},bc=t=>{Sa(t,"final-prompt")},lt=t=>
8{if(document.querySelector(".notifications-modal")){const n=be.wrapper.querySelector(".cep-modal-dialog__container > div");if(window.modalController.currentModal?.id===Tt)return t(n),be.wrapper;if(be.wrapper.dataset.mode==="manual"){const{id:r}=window.modalController.requestOpen({name:"notifications",priority:"manual",openFn:be.openModal.bind(be),closeFn:be.closeModal.bind(be)});be.id=r,Tt=r}t(n)}else{be=new On("notifications","auto","notifications-modal",null,()=>{Zt.handleCloseModal(be.wrapper),be.wrapper.dataset.mode="manual"}),Tt=be.id;const n=be.wrapper.querySelector(".cep-modal-dialog__container"),r=document.createElement("div");n.appendChild(r),t(r)}return be.wrapper},vc=()=>{qo(er,window.location.pathname)},Sc=t=>{Un(t,"confirmation")},Ec=t=>{Un(t,"unsupported-browser")},Cc=t=>{Un(t,"permissions-rejected")},Ac=t=>{Un(t,"unknown-error")},Un=(t,e)=>{const{confirmationHeader:n,confirmationDescription:r,unsupportedBrowserHeader:o,unsupportedBrowserDescription:a,notificationsPermissionsNotGrantedErrorHeader:i,notificationsPermissionsNotGrantedErrorDescription:s,notificationsUnknownErrorHeader:c,notificationsUnknownErrorDescription:l,closeButton:d}=rt();let p="",u="";switch(e){case"confirmation":p=n,u=r;break;case"unsupported-browser":p=o,u=a;break;case"permissions-rejected":p=i,u=s;break;case"unknown-error":p=c,u=l;break}const g=document.createElement("div");g.classList.add("modal-content__status-icon");const f=document.createElement("div");f.classList.add("modal-content__header");const y=document.createElement("h3");y.classList.add("modal-content__title"),y.textContent=p;const S=document.createElement("p");S.classList.add("modal-content__description"),S.innerHTML=u;const k=document.createElement("button");k.classList.add("button-secondary","close-btn"),k.textContent=d,k.addEventListener("click",()=>{window.modalController.requestClose(Tt)}),t.innerHTML="",t.classList="modal-content",t.classList.add(e),t.setAttribute("data-modal-type",e),f.append(g),f.append(y),t.append(f),t.append(S),t.append(k)},Sa=(t,e)=>{const{standardPromptHeader:n,standardPromptDescription:r,standardPromptSubscribeButton:o,standardPromptSubscribeButtonAriaLabel:a,standardPromptCloseButton:i,standardPromptCloseButtonAriaLabel:s,standardPromptIconAriaLabel:c,finalPromptHeader:l,finalPromptDescription:d,finalPromptSubscribeButton:p,finalPromptSubscribeButtonAriaLabel:u,finalPromptCloseButton:g,finalPromptCloseButtonAriaLabel:f,finalPromptIconAriaLabel:y}=rt("#notificationsLabels");let S="",k="",b="",C="",T="",L="",I="";switch(e){case"standard-prompt":S=c,k=n,b=r,C=o,T=a,L=i,I=s;break;case"final-prompt":S=y,k=l,b=d,C=p,T=u,L=g,I=f;break}const R=document.createElement("div");R.classList.add("modal-content__status-icon"),R.setAttribute("aria-label",S);const U=document.createElement("div");U.classList.add("modal-content__header");const O=document.createElement("h3");O.classList.add("modal-content__title"),O.textContent=k;const _=document.createElement("p");_.classList.add("modal-content__description"),_.innerHTML=b;const E=document.createElement("button");E.classList.add("button--primary","cep-modal-dialog__subscribe"),E.textContent=C,E.setAttribute("aria-label",T);const N=document.createElement("button");N.classList.add("button-secondary","close-btn"),N.textContent=L,N.setAttribute("aria-label",I),N.addEventListener("click",()=>{window.modalController.requestClose(Tt)}),t.innerHTML="",t.classList="modal-content",t.classList.add(e),t.setAttribute("data-modal-type",e),U.append(R),U.append(O),t.append(U),t.append(_),t.append(E),t.append(N)},_c=t=>{const e=rt(),n=e.iOSInstructionsDescription.replaceAll("{{ios_share}}",'<span class="ios_share"></span>'),r=document.createElement("div");r.classList.add("modal-content__header");const o=document.createElement("h3");o.classList.add("modal-content__title"),o.textContent=e.iOSInstructionsHeader;const a=document.createElement("div");a.classList.add("modal-content__description"),a.innerHTML=n;const i=document.createElement("div");i.classList.add("modal-content__image-wrapper");const s=document.createElement("img");s.src=e.iOSInstructionsImage,s.setAttribute("role","presentation"),s.setAttribute("alt","");const c=document.createElement("button");c.classList.add("button-secondary","close-btn"),c.textContent=e.closeButton,c.addEventListener("click",()=>{window.modalController.requestClose(Tt)}),t.innerHTML="",t.classList="modal-content",t.classList.add("ios-instructions"),t.setAttribute("data-modal-type","ios-instructions"),i.append(s),r.append(o),t.append(r),t.append(i),t.append(a),t.append(c)},Pc=async t=>{const e=hc(),n=await gc(),r=await fc(),o=t.toJSON(),a=mc();return{siteId:e,...n&&{onlineIdentity:n},...r&&{offlineIdentity:r},...o,aepConfigId:a}},Ic=async()=>(await Mn(),{"Content-Type":"application/json",Accept:"application/json","g-recaptcha-response":await ba("NOTIFICATION_SUBSCRIPTION"),...dt()}),Ea=async t=>{const e=pa(),n=await Pc(t),r=await Ic(),o=await fetch(`${e}/subscriptions`,{method:"POST",body:JSON.stringify(n),headers:r});if(!o.ok)throw new Error(`Received error response with status: ${o.status}`);v.log("Subscription is successfully registered")},Ca=async t=>{const{publicVapidKey:e}=wr(),n=pc(e);return v.log("Creating new subscription"),await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:n})},Tc=async()=>{const t=await navigator.serviceWorker.getRegistration(),e=await t?.pushManager.getSubscription();return e===null?Ca(t):(v.log("Subscription is ready to use",JSON.stringify(e)),e)},Er=()=>{if(!("Notification"in window))throw new Lt("NOTIFICATIONS_NOT_SUPPORTED","Missing notification support in the browser");return v.log("Current permissions are",Notification.permission),Notification.permission},Lc=async()=>{const t=Er();return ga()?t==="granted"?t:new Promise(async e=>{Notification.requestPermission(),await br(()=>Notification.permission==="granted",{delay:750,repetitions:10})||v.log("Notification permissions not granted within timeout"),e(Notification.permission)}):await Notification.requestPermission()};
8class Lt extends Error{constructor(e,n){super(n),this.cause=e}}const Aa=async t=>{const{trackingEnabled:e,trackingElement:n}=t||{},r=e&&n;if(r&&G.push({event:"push_notifications_click_CTA",button_id:n.id,button_copy:n.textContent.trim()}),await Lc()!=="granted")throw new Lt("PERMISSIONS_NOT_GRANTED","Notification permissions have not been granted");try{const a=await Tc();await Ea(a),r&&G.push({event:"push_notifications_subscribed",button_id:n.id,button_copy:n.textContent.trim()})}catch(a){v.log("Error occurred during subscription:",a);const i=a?.message||"Subscription operation failed";throw new Lt("UNKNOWN_ERROR",i)}},kc=async t=>{const e=pa(),n={"Content-Type":"application/json",Accept:"application/json"};await fetch(`${e}/telemetry`,{body:JSON.stringify({info:t}),headers:n}),v.log("Telemetry data is successfully sent")},Rc=async()=>{let t;if(Ee(()=>{t=window.sessionStorage.getItem("subscriptionUpdateExpiration")||"0"}),parseInt(t)>Date.now())v.log("Subscription already updated in current session");else try{if(Er()==="granted"){const r=await navigator.serviceWorker.getRegistration();let o=await r?.pushManager.getSubscription();o===null&&(await kc("Subscription does not exist. Re-subscribing."),o=await Ca(r)),await Ea(o),Ee(()=>{window.sessionStorage.setItem("subscriptionUpdateExpiration",`${Date.now()+36e5}`)})}else v.log("Permissions not granted. Subscription cannot be updated.")}catch(n){v.log("Subscription updated failed",n)}},Dc={POINTS:"engagement-points",ACTIVITY_RECORD:"engagement-record",PROMPTS_REMAINING:"engagement-prompts-remaining",NEXT_PROMPT:"engagement-next-prompt",BLOCK_PROMPTING:"engagement-block-prompting"};class X{static path=yr().path;constructor(){}static getStorageItemName(e,n){const r=n?"-"+n:"";return`${this.path}/${Dc[e]}${r}`}static getItem(e,n){return localStorage.getItem(this.getStorageItemName(e,n))}static setItem(e,n,r){localStorage.setItem(this.getStorageItemName(e,r),n)}static removeItem(e,n){localStorage.removeItem(this.getStorageItemName(e,n))}}class Cr{constructor(e,n){this.apiBaseUrl=e,this.region=n}async sendEnrichmentData(e){const n=this.validatePayload(e);if(n)return n;const o=Te()?.clientId,a=new Date().toISOString(),i="onexp",s=e.map(c=>({...c,insertDate:a,sourceName:i}));return this.postAPIRequest("/consumers/enrichment-data",{applicationId:o,data:s}).then(()=>({message:"Survey results successfully submitted"})).catch(c=>({error:c.code,message:c.message}))}async getEnrichmentData(){return this.getAPIRequest("/consumers/enrichment-data").then(e=>({message:"Survey results successfully received",data:e})).catch(e=>({error:e.code,message:e.message}))}static isErrorResponse(e){return!!e.error}async postAPIRequest(e,n){return this.executeAPIRequestWrapper(r=>fetch(`${Ce(this.apiBaseUrl)}${e}`,{method:"POST",headers:Ae(r),body:n?JSON.stringify(n):void 0}),"POST")}async getAPIRequest(e){return this.executeAPIRequestWrapper(n=>fetch(`${Ce(this.apiBaseUrl)}${e}`,{method:"GET",headers:Ae(n)}))}async executeAPIRequestWrapper(e,n){const{getAuthToken:r}=await J(),o={accept:"application/json",...n==="POST"&&{"Content-Type":"application/json"},Authorization:`Bearer ${await r()}`},a=await e(o),i=await a.json();return a.ok?i:Promise.reject({message:i?.message||"Something went wrong",error:i?.errorCode||"UNKNOWN_ERROR",data:i?.data})}validatePayload(e){return Array.isArray(e)?e.some(n=>!n.category)?{error:"BAD_REQUEST",message:"Category is required. Please check JSON schema"}:void 0:{error:"BAD_REQUEST",message:"Wrong payload format. Please check JSON schema"}}}class kt extends Cr{static enrichmentDataCache=new Ft(!0);async getEnrichmentData(){const e=this.apiBaseUrl;return await kt.enrichmentDataCache.getCachedData(e,()=>super.getEnrichmentData())}async sendEnrichmentData(e){const n=this.apiBaseUrl;return kt.enrichmentDataCache.clearCache(n),await super.sendEnrichmentData(e)}}const Ar={USER_ONBOARDING_CONFIG:"#user-onboarding-config",SKIP_ONBOARDING:"[data-onboarding-skip]"};let sn=null;const Oc=async()=>{await Z(()=>import("./onboarding.js"),__vite__mapDeps([2,3,4,5,6,7,8,9,10,11,12]),import.meta.url)},Nc=async()=>
8{if(sn)return sn;sn=Oc(),await sn},xc=()=>{const t=document.querySelector(Ar.USER_ONBOARDING_CONFIG);if(!t)return;const e=t?.dataset.leaderboardsApiUrl,n=t?.dataset.userApiUrl,r=t?.dataset.recaptchaSitekey,o=t?.dataset.promoPlusEnv,a=t?.dataset.engagementPointsAppId,i=t?.dataset.config,s=t?.dataset.welcomeScreenConfig;if(i)try{const c=JSON.parse(i),l=Mc();let d;s&&(d=JSON.parse(s));const p=[];return c.forEach(u=>{switch(u.stepType){case"avatar_username_question":const g=u.id.split("avatar_username_question-").pop(),f={type:"avatar-selection",id:`avatar-selection-${g}`,profileProgressLabel:u.profileProgressAvatarLabel,stepTitle:u.avatarStepTitle,stepSubtitle:u.avatarStepSubtitle},y={type:"username-selection",id:`username-selection-${g}`,profileProgressLabel:u.profileProgressUsernameLabel,stepTitle:u.usernameStepTitle,stepSubtitle:u.usernameStepSubtitle,generatedUsernameLabel:u.generatedUsernameLabel,usernameRegenerateButtonText:u.usernameRegenerateButtonText};p.push(f),p.push(y);break;case"enrichment_service_question":const S=_a(u);p.push(S);break;case"push_notification":const k={type:"push-notification",id:u.id,profileProgressLabel:u.profileProgressLabel,stepHeading:u.stepHeading,stepDescription:u.stepDescription,subscribeCTALabel:u.subscribeCTALabel};p.push(k);break;case"summary":const b={type:"summary",id:u.id,stepTitle:u.stepTitle,stepDescription:u.stepDescription,grantedCurrencyTitle:u.grantedCurrencyTitle,grantedCurrencyDescription:u.grantedCurrencyDescription,primaryButtonLabel:u.primaryButtonLabel,primaryButtonUrl:u.primaryButtonUrl,secondaryLinkLabel:u.secondaryLinkLabel,secondaryLinkUrl:u.secondaryLinkUrl};p.push(b);break}}),{leaderboardsApiUrl:e,userApiUrl:n,reCaptchaSiteKey:r,promoPlusEnv:o,engagementPointsAppId:a,labels:l,welcomeScreenConfig:d,stepsConfig:p}}catch(c){console.error("Failed to parse onboarding config:",c);return}},$c=t=>{const e=[];return t.forEach(n=>{if(n.type==="enrichment_service_question"){const r=_a(n);e.push(r)}}),e},_a=t=>{const e=JSON.parse(t.questions);return{type:"enrichment-question",id:t.id,questionVariant:t.questionVariant,profileProgressLabel:t.profileProgressLabel,stepHeading:t.stepHeading,stepDescription:t.stepDescription,questions:e,stepCompletedHeading:t.stepCompletedHeading,stepCompletedDescription:t.stepCompletedDescription}},eh=t=>{try{if(!t?.progressiveProfileEnabled||!t?.progressiveProfileQuestions)return null;const e=$c(t.progressiveProfileQuestions);return e.length===0?null:{progressiveProfileEnabled:t.progressiveProfileEnabled,progressiveProfileQuestions:e}}catch(e){return console.error("Failed to parse Progressive Profile config:",e),null}},Mc=()=>{const t=rt();return{continueButtonText:t.continueLabel,skipStepLabel:t.skipLabel,likeButtonAriaLabel:t.likeButtonAriaLabel,dislikeButtonAriaLabel:t.dislikeButtonAriaLabel,errorMessage:t.unknownErrorMsgLabel}},Uc=()=>{const{cdsEnrichmentUrl:t,region:e}=Te();return new kt(t,e)},th=async t=>{try{const e=Uc(),n={category:t.category,enrichmentType:t.enrichmentType,enrichmentValue:t.enrichmentValue},r=await e.sendEnrichmentData([n]);return kt.isErrorResponse(r)?(console.error("Failed to send enrichment selection:",r.error),{success:!1}):{success:!0}}catch(e){return console.error("Failed to send enrichment selection:",e),{success:!1}}},nh=()=>{try{if(typeof window.sdk?.getIdentityClaims=="function")return!!window.sdk.getIdentityClaims()?.newUser}catch(t){console.error("Failed to get identity claims:",t)}return!1},rh=()=>{const t=document.querySelector(Ar.USER_ONBOARDING_CONFIG);if(t)return JSON.parse(t?.dataset.welcomeScreenConfig||"{}")},Pa=async()=>{const e=window.onexpGlobalStores.onboardingStore.getState(),n=document.querySelector(Ar.SKIP_ONBOARDING);return gt("OneXPOnboardingDisabled")==="true"||n?!1:(await e.fetchOnboardingSteps()).length>0},Bc=async()=>{const e=window.onexpGlobalStores.onboardingStore.getState(),n=location.pathname.includes("token-exchange");if(ie||n)return;const r=xc();if(!r)return;const{isAuthenticated:o}=await J();await o()&&(await e.loadOnboardingData(r),await Pa()&&await Nc())},qc={"1-week":7,"2-weeks":14,"1-month":28};class Zt{constructor(){}static setPrompts(){const e=In();e?.numberOfPrompts||console.warn(`[Engagement Push] Invalid number of prompts in config! Value: {${e?.numberOfPrompts}}. Setting to ${_t.numberOfPrompts}`),X.setItem("PROMPTS_REMAINING",e?.numberOfPrompts||_t.numberOfPrompts.toString()),X.setItem("NEXT_PROMPT",new Date().setHours(0,0,0,1).toString()),this.showPrompt()}static async showPrompt(){if(!await this.canShowPrompt())return;v.log("[Engagement Push] Prompting user");const e=parseInt(X.getItem("PROMPTS_REMAINING")),r=lt(e===1?bc:va).querySelector(".cep-modal-dialog__subscribe");r?.addEventListener("click",mt(Sr(r)))}static async handleCloseModal(e){const n=e.querySelector(".modal-content")?.dataset.modalType||"unknown";if(v.log(`[Engagement Push] Dialog of type {${n}} closed.`),await this.isSubscribedToNotifications())v.log("[Engagement Push] User successfully subscribed."),this.blockPrompting();else{const r=parseInt(X.getItem("PROMPTS_REMAINING"))-1;r===0?(v.log("[Engagement Push] No prompts remaining."),this.blockPrompting()):(v.log(`[Engagement Push] Prompts remaining: ${r}`),X.setItem("PROMPTS_REMAINING",r.toString()),this.scheduleNextPrompt())}}static scheduleNextPrompt(){const e=In();e?.frequencyAppearance||console.warn(`[Engagement Push] Invalid prompts frequency in config! Value: {${e?.frequencyAppearance}}. Next prompt scheduled in ${_t.frequency}`);const n=new Date;n.setHours(0,0,0,1),n.setDate(n.getDate()+qc[e.frequencyAppearance||_t.frequency]),v.log(`[Engagement Push] Next prompt scheduled on ${n}`),X.setItem("NEXT_PROMPT",n.getTime().toString())}static blockPrompting(){v.log("[Engagement Push] Blocking prompting."),X.setItem("BLOCK_PROMPTING","true"),v.log(`[Engagement Push] Added ${X.getStorageItemName("BLOCK_PROMPTING")} blocking item`),X.removeItem("PROMPTS_REMAINING"),v.log(`[Engagement Push] Removed ${X.getStorageItemName("PROMPTS_REMAINING")} item`),X.removeItem("NEXT_PROMPT"),v.log(`[Engagement Push] Removed ${X.getStorageItemName("NEXT_PROMPT")} item`)}static async isSubscribedToNotifications(){try{if(Er()==="granted")return await(await navigator.serviceWorker.getRegistration())?.pushManager.getSubscription()!==null}catch(e){return v.log(`[Engagement Push] Permission error: ${e}`),!1}}
8static async isInterrupting(){if(document.querySelector("[data-notifications-prompt-skip]"))return v.log("[Engagement Push] Page contains component with skip parameter. Postponing prompt."),!0;const e=["age-gate-page","global-error-page","global-page","loading-page","local-error-page"],n=document.querySelector('meta[name="template"]').content;return n&&e.includes(n)?(v.log(`[Engagement Push] User on ${n} template. Postponing prompt.`),!0):await Pa()?(v.log("[Engagement Push] Onboarding app is required. Postponing prompt."),!0):!1}static async canShowPrompt(){if(ma()||X.getItem("BLOCK_PROMPTING")==="true")return!1;if(await this.isSubscribedToNotifications())return v.log(`[Engagement Push] Blocking prompts due to permissions being granted.
9                This can happen if user didn't close the modal after successful sign-up and left the page.`),Zt.blockPrompting(),!1;const e=X.getItem("NEXT_PROMPT");return!(!e||parseInt(e)>Date.now()||await this.isInterrupting())}}(()=>{const t=async()=>{if(!localStorage){console.warn("[Engagement Push] No local storage found. Feature will not be loaded.");return}Zt.showPrompt()},e={name:"Engagement - Prompting",mount:async()=>{const n=ft("engagement-prompting");await Dt(n,async()=>{await t()})}};M.registerComponent(e)})();const cn={"internal-link":{points:1},"page-first-time":{points:1,recordActivity:"array",hash:!0},"xtnd-page":{points:2},"scroll-to-end":{points:2,recordActivity:"array",hash:!0},login:{points:2,recordActivity:"string"},"return-to-website":{points:2},"promotion-participation":{points:3},share:{points:3},subscribe:{points:4}};class Ne{static stopRecording=!1;static pointsCap;constructor(){}static activityRegisteringStopped(){return this.stopRecording||(ma()?(this.stopRecording=!0,v.log("[Engagement Counter] Engagement feature disabled, stopping activity recording")):(X.getItem("PROMPTS_REMAINING")||X.getItem("BLOCK_PROMPTING"))&&(this.stopRecording=!0,v.log("[Engagement Counter] User already engaged, stopping activity recording"))),this.stopRecording}static registerActivity(e,n){if(!this.activityRegisteringStopped()){switch(cn[e].recordActivity){case"array":this.recordActivityArray(e,n);break;case"string":this.recordActivityString(e,n);break;default:this.addPoints(e);break}this.verifyEngagementCriteria()}}static removeActivityRecord(e){X.removeItem("ACTIVITY_RECORD",e),v.log(`[Engagement Counter] Removed ${X.getStorageItemName("ACTIVITY_RECORD",e)} activity item`)}static recordActivityString(e,n){if(!n)throw new Error(`[Engagement Counter] Data is required to record ${e} activity`);const r=X.getItem("ACTIVITY_RECORD",e);if(r){v.log(`[Engagement Counter] Activity ${e} with data {${r}} already recorded`);return}const o=n&&cn[e].hash?ro(n):n||"";X.setItem("ACTIVITY_RECORD",o,e),v.log(`[Engagement Counter] Activity ${e} with data {${n}} recorded`),this.addPoints(e)}static recordActivityArray(e,n){if(!n)throw new Error(`[Engagement Counter] Data is required to record ${e} activity`);const r=X.getItem("ACTIVITY_RECORD",e),o=r?JSON.parse(r):[],a=n&&cn[e].hash?ro(n):n||"";if(o.find(i=>i===a)){v.log(`[Engagement Counter] Activity ${e} with data {${n}} already recorded`);return}o.push(a),X.setItem("ACTIVITY_RECORD",JSON.stringify(o),e),v.log(`[Engagement Counter] Activity ${e} with data {${n}} recorded`),this.addPoints(e)}static getPointsCap(){if(!this.pointsCap){const e=In();e?.amountOfPoints||console.warn(`[Engagement Counter] Invalid amount of points in config! Value: {${e?.amountOfPoints}}.
10        Setting to ${_t.amountOfPoints}`),this.pointsCap=e?.amountOfPoints?parseInt(e.amountOfPoints):_t.amountOfPoints}return this.pointsCap}static addPoints(e){const n=cn[e].points;let r=parseInt(X.getItem("POINTS"))||0;r+=n,X.setItem("POINTS",r.toString()),v.log(`[Engagement Counter] Added ${n} points to ${e} activity item. Current points: ${r} / ${this.getPointsCap()}`)}static verifyEngagementCriteria(){const e=parseInt(X.getItem("POINTS"));e&&e>=this.getPointsCap()&&(v.log(`[Engagement Counter] Criteria of ${this.getPointsCap()} points have been met. Removing unnecessary local storage items. Setting up prompting mechanism.`),this.stopRecording=!0,this.removeCounterItems(),Zt.setPrompts())}static removeCounterItems(){X.removeItem("POINTS"),v.log(`[Engagement Counter] Removed ${X.getStorageItemName("POINTS")} points counter item`),this.removeActivityRecord("page-first-time"),this.removeActivityRecord("scroll-to-end"),this.removeActivityRecord("login")}}const oh=()=>{Ne.registerActivity("promotion-participation")},Fc=()=>{Ne.registerActivity("share")},ah=()=>{Ne.registerActivity("subscribe")};(()=>{const t=()=>{performance.getEntriesByType("navigation")[0].type==="navigate"&&Ne.registerActivity("page-first-time",window.location.pathname)},e=()=>{if(!document.referrer)return;const c=performance.getEntriesByType("navigation")[0],l=new URL(document.referrer).origin===window.location.origin;c.type==="navigate"&&l&&Ne.registerActivity("internal-link")},n=()=>{document.querySelector(".xtndApp iframe")&&Ne.registerActivity("xtnd-page")},r=()=>{const c=document.querySelector("main");if(!c||c.clientHeight<=window.innerHeight)return;const l=document.querySelector("footer");l&&window.addEventListener("scroll",()=>{new ot(l).observe(()=>{Ne.registerActivity("scroll-to-end",window.location.pathname)},"single")},{once:!0})},o=()=>{const c=performance.getEntriesByType("navigation")[0],l=!document.referrer||new URL(document.referrer).origin!==window.location.origin;c.type==="navigate"&&l&&Ne.registerActivity("return-to-website")},a=async()=>{const{isAuthenticated:c}=await J();await c()?Ne.registerActivity("login","true"):Ne.removeActivityRecord("login")},i=async()=>
10{if(!localStorage){console.warn("[Engagement Functions] No local storage found. Feature will not be loaded.");return}Ne.activityRegisteringStopped()||(await a(),t(),e(),n(),r(),o())},s={name:"Engagement - Functions",mount:async()=>{const c=ft("engagement-functions");await Dt(c,async()=>{await i()})}};M.registerComponent(s)})();function Wc(){return matchMedia(`only screen and (min-width: ${xe.MOBILE}px)`).matches}function zc(){return matchMedia(`only screen and (min-width: ${xe.TABLET}px)`).matches}function Ia(){return matchMedia(`only screen and (min-width: ${xe.DESKTOP}px)`).matches}function oo(){return Wc()&&!zc()&&!Ia()}function Be(){return Ia()}const qe={azureMaps:"cmp-embed__azure-maps",buttonSelfInit:"button--self-init",carousel:"carousel",carouselComponent:"cmp-carousel",feedItem:"feed-item",feedItemShare:"feed-item__share",textActive:"text--active",splideSlide:"splide__slide",splideSlideActive:"is-active"},_r={shareButton:".share-wrapper .button",azureMapsShare:".azure-maps__container .popup__share",azureMapsPopup:".azure-maps__container .popup__wrapper"},Hc={shareType:"share-type"},Tn={carouselId:"carousel-id",slideIndex:"slide"},ao={pointId:"point-id",zoom:"zoom"},Vc="/social-share",Ta=t=>{let e=window.location.origin;e.includes("local")&&(e=ca);const n=new URL(e);n.pathname=Vc;const r=n.searchParams;return r.set("id",t),r.set("path",window.location.pathname),n},La=t=>{const e=t.closest(`.${qe.feedItem}`),n=Ta(e.id),r=n.searchParams,o=e.firstElementChild;if(!o.querySelector(`.${qe.carousel}`))return n.toString();const a=o.querySelector(`.${qe.carouselComponent}`),i=a.id.replace("carousel-",""),c=[...a.querySelectorAll(`.${qe.splideSlide}`)].findIndex(l=>l.classList.contains(qe.splideSlideActive));return r.set(Tn.carouselId,i),r.set(Tn.slideIndex,c.toString()),n.toString()},Gc=t=>{const e=t.closest(`.${qe.azureMaps}`),n=Ta(e.id),r=n.searchParams;r.set(Hc.shareType,"azureMap");const o=e.querySelector(_r.azureMapsPopup);return o.dataset.pointId&&r.set(ao.pointId,o.dataset.pointId),o.dataset.zoom&&r.set(ao.zoom,o.dataset.zoom),n.toString()},jc=t=>t.closest(`.${qe.feedItemShare}`)?La(t):t.closest(_r.azureMapsShare)?Gc(t):window.location.href,ka=t=>{const e=t.nextElementSibling;e&&(e.classList.add(qe.textActive),setTimeout(()=>{e.classList.remove(qe.textActive)},1500))},Ra=(t,e)=>{Fc();const n=e||jc(t);Be()||!window.navigator.share?(ka(t),window.navigator.clipboard.writeText(n)):window.navigator.share({url:n})};(()=>{const e={name:"Share Button",mount:async n=>{const r=n.querySelectorAll(_r.shareButton);Y(r,o=>{o.classList.contains(qe.buttonSelfInit)||o.addEventListener("click",()=>Ra(o))})}};M.registerComponent(e)})();const tr=()=>document.documentElement.dir==="rtl",en=(t,e)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}},at={cardPrimary:"carousel--card-primary",cardSecondary:"carousel--card-secondary",hero:"carousel--hero",image:"carousel--image",imageCard:"carousel--image-card",micro:"carousel--micro"},Qe={root:"splide",track:"splide__track",list:"splide__list",slide:"splide__slide",pagination:"splide__pagination",paginationItem:"splide__pagination__page",arrowPrev:"splide__arrow--prev",arrowNext:"splide__arrow--next"},pe={carousel:"carousel",cmpCarousel:"cmp-carousel",cmpCarouselContent:"cmp-carousel__content",cmpCarouselItem:"cmp-carousel__item",cmpCarouselItemActive:"cmp-carousel__item--active",originalPagination:"cmp-carousel__indicators",originalNavigation:{element:"cmp-carousel__actions",prevButton:"cmp-carousel__action--previous",nextButton:"cmp-carousel__action--next"},hidden:"hidden"};let io=null;const Kc=t=>{const{classList:e}=t;let n="default";return e.contains(at.hero)?n="hero":e.contains(at.cardPrimary)?n="card-primary":e.contains(at.cardSecondary)?n="card-secondary":e.contains(at.image)?n="image":e.contains(at.imageCard)?n="image-card":t.closest(".feed-item")?n="feed":e.contains(at.micro)&&(n="micro"),n},Yc=async()=>(io??=Z(()=>import("./splide.esm.js"),[],import.meta.url).then(t=>({Splide:t.default})),io);class Jc{root;variant;paginationElement;paginationLabel;prevButtonElement;prevButtonLabel;nextButtonElement;nextButtonLabel;constructor(e,n){this.root=e,this.variant=n,this.initCarousel()}removeNativeControls(e){const n=e.querySelector(`.${pe.originalPagination}`);this.paginationLabel=n?.ariaLabel||"";const r=e.querySelector(`.${pe.originalNavigation.element}`);this.prevButtonLabel=r?.querySelector(`.${pe.originalNavigation.prevButton}`)?.ariaLabel||"",this.nextButtonLabel=r?.querySelector(`.${pe.originalNavigation.nextButton}`)?.ariaLabel||"",r?.remove(),n?.remove()}adjustLabels(){this.paginationElement=this.root.querySelector(`.${Qe.pagination}`),this.paginationElement?.setAttribute("aria-label",this.paginationLabel),this.prevButtonElement=this.root.querySelector(`.${Qe.arrowPrev}`),this.nextButtonElement=this.root.querySelector(`.${Qe.arrowNext}`),this.prevButtonElement?.setAttribute("aria-label",this.prevButtonLabel),this.nextButtonElement?.setAttribute("aria-label",this.nextButtonLabel);
10const e=Fe("carouselPaginationItemLabel");this.paginationElement?.querySelectorAll(`.${Qe.paginationItem}`).forEach((n,r)=>{n.setAttribute("aria-label",`${e} ${r+1}`)}),this.root.querySelectorAll(`.${pe.cmpCarouselItem}`).forEach(n=>{n.removeAttribute("aria-labelledby")})}async initCarousel(){this.removeNativeControls(this.root),ie?this.initAuthorCarousel():await this.initPublishCarousel()}listenToPanelChanges(){const e=this.root.querySelector(`.${pe.cmpCarousel}`);this.getGraniteMessageChannel()?.subscribeRequestMessage("cmp.panelcontainer",r=>{r.data?.type==="cmp-carousel"&&r.data?.id===e.dataset?.cmpPanelcontainerId&&r.data?.operation==="navigate"&&this.navigateToPanel(r.data.index)})}getGraniteMessageChannel(){if(window.Granite?.author?.MessageChannel)return new window.Granite.author.MessageChannel("cqauthor",window)}navigateToPanel(e){if(this.root.classList.contains(at.micro))return;this.root.querySelectorAll(`.${pe.cmpCarouselItem}`).forEach((r,o)=>{o===e?(r.classList.add(pe.cmpCarouselItemActive),r.classList.remove(pe.hidden),r.removeAttribute("aria-hidden")):(r.classList.remove(pe.cmpCarouselItemActive),r.classList.add(pe.hidden),r.setAttribute("aria-hidden","true"))})}
10navigateToSlide(e,n){const{detail:r}=e,o=r?.carouselId,a=Number(r?.slideIndex);!(o===this.root.id)||isNaN(a)||setTimeout(()=>{n(a)},500)}getDeepLinkInitialSlide(){const e=new URLSearchParams(window.location.search),n=`carousel-${e.get(Tn.carouselId)}`,r=Number(e.get(Tn.slideIndex)),o=this.root.querySelectorAll(`.${pe.cmpCarouselItem}`).length;return n===this.root.querySelector(`.${pe.cmpCarousel}`)?.id&&!isNaN(r)&&o>r?r:0}initAuthorCarousel(){this.navigateToPanel(0),this.listenToPanelChanges(),window.addEventListener("page-validation-scroll-to-carousel-element",e=>{this.navigateToSlide(e,n=>{this.navigateToPanel(n)})})}async initPublishCarousel(){const{Splide:e}=await Yc(),n=this.root.querySelector(`.${pe.cmpCarousel}`),r=this.root.querySelector(`.${pe.cmpCarouselContent}`),o=r?[...r.children]:[];if(o.length===0){v.warn(`[Carousel] Broken or empty Carousel detected. Aborting initialization. Carousel ID: ${this.root.id}`);return}this.root.classList.add(Qe.root),n.classList.add(Qe.track),r.classList.add(Qe.list),o.forEach(d=>{d.classList.add(Qe.slide)});const a=o.length===1,i=this.variant==="feed"?this.getDeepLinkInitialSlide():0,s=tr()?"rtl":"ltr",c={...ac,...ic[this.variant],direction:s,...a&&{type:"slide",pagination:!1,paginationKeyboard:!1,flickPower:0,drag:!1},...i>0&&{start:i}},l=new e(this.root,c);l.mount(),M.mountAll(this.root,{stopReport:!0}),this.adjustLabels(),no(l,!0),l.on("moved resized",en(()=>{no(l)},100)),window.addEventListener("page-validation-scroll-to-carousel-element",d=>
10{this.navigateToSlide(d,p=>{l.go(p)})})}}(()=>{const t=async e=>{const n=e.querySelectorAll(`.${pe.carousel}`);Y(n,r=>{const o=Kc(r);new Jc(r,o)})};M.registerComponent({name:"Carousel",mount:t})})();(()=>{const t={container:"cmp-conditional-container",hidden:"conditionalcontainer--hidden",loading:"conditionalcontainer__loading",loggedInMode:{loggedInUserContainer:"conditionalcontainer__logged-item",anonymousUserContainer:"conditionalcontainer__not-logged-item"},scheduleMode:{activeTimeUserContainer:"conditionalcontainer__active-time-container",inactiveTimeUserContainer:"conditionalcontainer__inactive-time-container"},profileEligibilityMode:{eligibleUserContainer:"conditionalcontainer__eligible-container",ineligibleUserContainer:"conditionalcontainer__ineligible-container",anonymousUserContainer:"conditionalcontainer__anonymous-container"}};let e="uninitialized";const n=async()=>(e==="uninitialized"&&(e=await a()),e==="error"?null:e),r=async u=>{u.classList.remove(t.hidden),await M.mountDeferred(u)},o=u=>{u.classList.add(t.hidden),Ws(u)},a=async()=>{const u=Te();if(u){const f=await new je(u.cdsGamUrl)?.getProfile();return je.isErrorResponse(f)?"error":f}return"error"},i=async(u,g)=>{const f=u.querySelector(`.${t.loggedInMode.loggedInUserContainer}`),y=u.querySelector(`.${t.loggedInMode.anonymousUserContainer}`);g?(o(y),await r(f)):(o(f),await r(y))},s=async u=>{const g=u.querySelector(`.${t.scheduleMode.activeTimeUserContainer}`),f=u.querySelector(`.${t.scheduleMode.inactiveTimeUserContainer}`),y=u.getAttribute("data-schedule-rules"),S=JSON.parse(y),k=new Date;S.find(C=>{const T=new Date(C.fromDate),L=new Date(C.toDate);return k>=T&&k<=L})?(o(g),await r(f)):(o(f),await r(g))};function c(u,g){const f=u.getAttribute("data-property-name"),y=u.getAttribute("data-property-check-mode"),S=u.getAttribute("data-string-to-find"),k=u.getAttribute("data-regex");try{const b=g[f],C=b&&typeof b!="string"?JSON.stringify(b):b;switch(y){case"contains":return C&&C.includes(S);case"matches":return C&&new RegExp(k).test(C);case"exists":return!!b;default:}}catch(b){v.warn("Could not check property",b)}return!1}const l=async(u,g)=>{const f=u.querySelector(`.${t.profileEligibilityMode.eligibleUserContainer}`),y=u.querySelector(`.${t.profileEligibilityMode.ineligibleUserContainer}`),S=u.querySelector(`.${t.profileEligibilityMode.anonymousUserContainer}`);if(g){const k=await n();k&&c(u,k)?await r(f):await r(y)}else S?await r(S):await r(y)},p={name:"Conditional Container",mount:async u=>{const g=u.querySelectorAll(`.${t.container}`);We(g,async()=>({authenticated:await(await J()).isAuthenticated()}),async(y,{authenticated:S})=>{if(!ie)switch(y.getAttribute("data-mode")){case"schedule":s(y),setInterval(()=>{s(y)},60*1e3);break;case"profileEligibility":l(y,S);break;default:i(y,S)}y.querySelector(`.${t.loading}`).classList.add(t.hidden)})}};M.registerComponent(p)})();const so={listContainerID:"list-container"},Le={container:"container--show-more",listContainer:"cmp-container",listItemLink:"list-item--link",showMoreItemsButtonWrapper:"show-more-items__button-wrapper",showMoreItemsButton:"show-more-items__button",hidden:"hidden"};(()=>{const e={name:"Show More (Items)",mount:async n=>{const r=n.querySelectorAll(`.${Le.container}`),o=5,a=(i,s)=>{const c=n.ownerDocument.createElement("div"),l=n.ownerDocument.createElement("button");return c.classList.add(`${Le.showMoreItemsButtonWrapper}`),c.appendChild(l),l.setAttribute("aria-controls",`${so.listContainerID}-${s}`),l.classList.add(`${Le.showMoreItemsButton}`),l.textContent=Fe("showMore"),l.addEventListener("click",i),c};Y(r,i=>{const s=i.querySelector(`.${Le.listContainer}`),c=i.querySelectorAll(`.${Le.listItemLink}`),l=d=>{const p=d.currentTarget;let u=i.querySelectorAll(`.${Le.listItemLink}.${Le.hidden}`);Array.from(u).slice(0,o).forEach(g=>{g.classList.remove(`${Le.hidden}`)}),u[0].querySelector("a")?.focus(),u=i.querySelectorAll(`.${Le.listItemLink}.${Le.hidden}`),u.length||(p.removeEventListener("click",l),p.parentElement.classList.add(`${Le.hidden}`),p.setAttribute("aria-hidden","true"),p.removeAttribute("aria-controls"),s.removeAttribute("id"))};if(c.length>o){const d=crypto.randomUUID(),p=a(l,d);
10Array.from(c).slice(o).forEach(u=>{u.classList.add(`${Le.hidden}`)}),s.setAttribute("id",`${so.listContainerID}-${d}`),i.appendChild(p)}i.style.display="flex"})}};M.registerComponent(e)})();(()=>{const t=()=>window.innerWidth-document.body.clientWidth,e=()=>{if(document.documentElement.scrollHeight>document.documentElement.clientHeight){const o=t();document.documentElement.style.setProperty("--scrollWidth",`${o}px`)}else document.documentElement.style.removeProperty("--scrollWidth")},r={name:"Container",mount:async()=>{const o=ft("container");se(o,()=>{e(),window.addEventListener("resize",e)})}};M.registerComponent(r)})();const Qc=()=>new Promise(t=>{window?.YT?.loaded?t():window.onYouTubeIframeAPIReady=t,new Da(Qs).init()}),Xc=()=>{if(window.Spotify.loaded!=="not_started")return;window.Spotify.loaded="pending",new Da(Xs).init()};class Da{scriptUrl;initialised=!1;constructor(e){this.scriptUrl=e}init(){if(!this.initialised){this.initialised=!0;const e=document.createElement("script");e.src=this.scriptUrl,document.getElementsByTagName("body")[0].appendChild(e)}}}const ge={thumbnailEmbed:".cmp-embed--thumbnail",thumbnailPlayButton:"cep-play-button",thumbnailPlayButtonBackground:"cep-play-button-background",thumbnailPlayButtonIcon:"cep-play-button-icon",closeButton:"cmp-embed__close-button",playerTitle:"player-title",fullscreen:"fullscreen",scrollLock:"scroll-lock",hidden:"hidden"};class Oa{embed;playButton;closeButton;playerTitle;thumbnailWrapper;videoLoaded;isFullscreen;playerData;player;playerIframe;focusTrap;constructor(e,n=null){this.embed=e,this.thumbnailWrapper=n?.wrapper||e.querySelector(ge.thumbnailEmbed),this.closeButton=e.querySelector(`.${ge.closeButton}`),this.playerData=n||JSON.parse(this.thumbnailWrapper.dataset.iframe),this.playerData.allowFullscreenModal=this.playerData.allowFullscreenModal==="true",this.videoLoaded=!1,this.isFullscreen=!1,this.focusTrap=null,this.init()}addPlayButton(){this.playButton=document.createElement("button"),this.playButton.className=ge.thumbnailPlayButton;const e=document.createElement("span");e.classList.add(ge.thumbnailPlayButtonBackground);const n=document.createElement("span");n.classList.add(ge.thumbnailPlayButtonIcon),e.appendChild(n),this.playButton.ariaLabel=this.playerData.playButtonAriaLabel,this.playButton.appendChild(e),this.thumbnailWrapper.appendChild(this.playButton)}hideThumbnail(){this.thumbnailWrapper.querySelector("picture")?.classList.add(ge.hidden),this.playButton.classList.add(ge.hidden)}getPlayerId(e){const n=new URL(e).pathname.split("/");return`youtube-player-${n[n.length-1]}`}enableAutoplay(e){const n=new URL(e),r=n.searchParams;return!Be()&&"ontouchstart"in document.documentElement&&r.set("mute","1"),r.set("autoplay","1"),r.set("playsinline","1"),r.set("rel","0"),n.toString()}loadVideo(){this.hideThumbnail(),this.playerIframe=document.createElement("iframe"),this.playerIframe.classList.add("cmp-embed__youtube-iframe"),this.playerIframe.title=this.playerData.playerTitle,this.playerIframe.src=this.enableAutoplay(this.playerData.src),this.playerIframe.setAttribute("frameborder","0"),this.playerIframe.allow=this.playerData.allow,this.playerIframe.ariaLabel=this.playerData.playerAriaLabel,this.playerIframe.id=this.getPlayerId(this.playerData.src),this.playerIframe.tabIndex=0,this.thumbnailWrapper.appendChild(this.playerIframe),this.playButton.classList.add(ge.hidden),this.player=new YT.Player(this.playerIframe.id,{events:{onReady:e=>{e.target.playVideo()},onStateChange:e=>{!this.isFullscreen&&this.playerData.allowFullscreenModal&&e.data==YT.PlayerState.PLAYING&&this.enterFullscreen()}}}),this.enterFullscreen()}continue(){this.enterFullscreen(),this.player.playVideo()}closeFullscreen(){this.embed.classList.remove(ge.fullscreen),document.body.classList.remove(ge.scrollLock),this.player.pauseVideo(),this.isFullscreen=!1,this.focusTrap?.active&&this.focusTrap.deactivate({returnFocus:!1}),this.focusTrap=null}enterFullscreen(){this.playerData.allowFullscreenModal&&(document.body.classList.add(ge.scrollLock),this.embed.classList.add(ge.fullscreen),this.isFullscreen=!0,this.focusTrap?.active&&this.focusTrap.deactivate({returnFocus:!1}),this.focusTrap=Qt(this.embed,{allowOutsideClick:!0,clickOutsideDeactivates:!1,escapeDeactivates:!1,returnFocusOnDeactivate:!1,initialFocus:this.playerIframe||this.closeButton,fallbackFocus:this.closeButton||this.embed}),this.focusTrap.activate(),this.playerIframe?.focus())}addEvents(){this.playButton.addEventListener("click",()=>{this.videoLoaded?this.enterFullscreen():(this.loadVideo(),this.videoLoaded=!0)}),this.closeButton||(this.closeButton=document.createElement("button"),this.closeButton.classList.add(ge.closeButton),this.playerTitle=this.embed.querySelector(`.${ge.playerTitle}`),this.playerTitle?.appendChild(this.closeButton)),this.closeButton?.addEventListener("click",this.closeFullscreen.bind(this))}addTitle(){const e=document.createElement("div");e.classList.add(ge.playerTitle);const n=document.createElement("p");n.textContent=this.playerData.title,e.appendChild(n),this.thumbnailWrapper.append(e)}init(){this.thumbnailWrapper.style.paddingBottom=this.playerData.iFrameAspectRatio,Qc().then(()=>{this.playerData.initAndPlay&&this.loadVideo()}),this.playerData.title&&this.addTitle(),this.addPlayButton(),this.addEvents()}}(()=>{const t={heroPromo:".hero-promo",teaserButton:".cmp-teaser__action-container a",teaserTitle:".cmp-teaser__title",liveBadgeIcon:".countdown-card__live-badge-icon",videoWrapper:"video-wrapper"},e=a=>{const i=document.createElement("p");i.innerText=Fe("liveBadge"),a.parentElement.querySelector(t.liveBadgeIcon)?.append(i)},n=a=>{const i=a.querySelector(t.teaserButton);try{const c=new URL(i.getAttribute("href")).searchParams.get("v"),l=document.createElement("div"),d=a.querySelector(t.teaserTitle).innerText;l.className=t.videoWrapper,a.append(l);let p;i.addEventListener("click",u=>{u.preventDefault(),p?p.continue():p=new Oa(l,{src:`https://www.youtube.com/embed/${c}?enablejsapi=1&hl=en&mute=0&rel=0&playsinline=0`,type:"youtube",allowFullscreenModal:"true",wrapper:l,initAndPlay:!0,allow:"autoplay; fullscreen",fature:!0,playerTitle:"",playerAriaLabel:"",loadButtonAriaLabel:"",title:d})})}catch(s){console.warn("Error: ",s)}e(a)},o={name:"Countdown Card - Live Badge",mount:async a=>{const i=a.querySelectorAll(t.heroPromo);Y(i,s=>n(s))}};M.registerComponent(o)})();function nr(){return nr=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},nr.apply(this,arguments)}function Na(t){var e={exports:{}};return t(e,e.exports),e.exports}var Pt=Na(function(t,e){t.exports=function(){var n="millisecond",r="second",o="minute",a="hour",i="day",s="week",c="month",l="quarter",d="year",p="date",u=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}
10|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},y=function(O,_,E){var N=String(O);return!N||N.length>=_?O:""+Array(_+1-N.length).join(E)+O},S={s:y,z:function(O){var _=-O.utcOffset(),E=Math.abs(_),N=Math.floor(E/60),D=E%60;return(_<=0?"+":"-")+y(N,2,"0")+":"+y(D,2,"0")},m:function O(_,E){if(_.date()<E.date())return-O(E,_);var N=12*(E.year()-_.year())+(E.month()-_.month()),D=_.clone().add(N,c),h=E-D<0,m=_.clone().add(N+(h?-1:1),c);return+(-(N+(E-D)/(h?D-m:m-D))||0)},a:function(O){return O<0?Math.ceil(O)||0:Math.floor(O)},p:function(O){return{M:c,y:d,w:s,d:i,D:p,h:a,m:o,s:r,ms:n,Q:l}[O]||String(O||"").toLowerCase().replace(/s$/,"")},u:function(O){return O===void 0}},k="en",b={};b[k]=f;var C=function(O){return O instanceof R},T=function(O,_,E){var N;if(!O)return k;if(typeof O=="string")b[O]&&(N=O),_&&(b[O]=_,N=O);else{var D=O.name;b[D]=O,N=D}return!E&&N&&(k=N),N||!E&&k},L=function(O,_){if(C(O))return O.clone();var E=typeof _=="object"?_:{};return E.date=O,E.args=arguments,new R(E)},I=S;I.l=T,I.i=C,I.w=function(O,_){return L(O,{locale:_.$L,utc:_.$u,x:_.$x,$offset:_.$offset})};var R=function(){function O(E){this.$L=T(E.locale,null,!0),this.parse(E)}var _=O.prototype;return _.parse=function(E){this.$d=function(N){var D=N.date,h=N.utc;if(D===null)return new Date(NaN);if(I.u(D))return new Date;if(D instanceof Date)return new Date(D);
vendor: 4,267 bytes, line 10
10if(typeof D=="string"&&!/Z$/i.test(D)){var m=D.match(u);if(m){var w=m[2]-1||0,P=(m[7]||"0").substring(0,3);return h?new Date(Date.UTC(m[1],w,m[3]||1,m[4]||0,m[5]||0,m[6]||0,P)):new Date(m[1],w,m[3]||1,m[4]||0,m[5]||0,m[6]||0,P)}}return new Date(D)}(E),this.$x=E.x||{},this.init()},_.init=function(){var E=this.$d;this.$y=E.getFullYear(),this.$M=E.getMonth(),this.$D=E.getDate(),this.$W=E.getDay(),this.$H=E.getHours(),this.$m=E.getMinutes(),this.$s=E.getSeconds(),this.$ms=E.getMilliseconds()},_.$utils=function(){return I},_.isValid=function(){return this.$d.toString()!=="Invalid Date"},_.isSame=function(E,N){var D=L(E);return this.startOf(N)<=D&&D<=this.endOf(N)},_.isAfter=function(E,N){return L(E)<this.startOf(N)},_.isBefore=function(E,N){return this.endOf(N)<L(E)},_.$g=function(E,N,D){return I.u(E)?this[N]:this.set(D,E)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(E,N){var D=this,h=!!I.u(N)||N,m=I.p(E),w=function(K,H){var ee=I.w(D.$u?Date.UTC(D.$y,H,K):new Date(D.$y,H,K),D);return h?ee:ee.endOf(i)},P=function(K,H){return I.w(D.toDate()[K].apply(D.toDate("s"),(h?[0,0,0,0]:[23,59,59,999]).slice(H)),D)},A=this.$W,x=this.$M,$=this.$D,q="set"+(this.$u?"UTC":"");switch(m){case d:return h?w(1,0):w(31,11);case c:return h?w(1,x):w(0,x+1);case s:var W=this.$locale().weekStart||0,z=(A<W?A+7:A)-W;return w(h?$-z:$+(6-z),x);case i:case p:return P(q+"Hours",0);case a:return P(q+"Minutes",1);case o:return P(q+"Seconds",2);case r:return P(q+"Milliseconds",3);default:return this.clone()}},_.endOf=function(E){return this.startOf(E,!1)},_.$set=function(E,N){var D,h=I.p(E),m="set"+(this.$u?"UTC":""),w=(D={},D[i]=m+"Date",D[p]=m+"Date",D[c]=m+"Month",D[d]=m+"FullYear",D[a]=m+"Hours",D[o]=m+"Minutes",D[r]=m+"Seconds",D[n]=m+"Milliseconds",D)[h],P=h===i?this.$D+(N-this.$W):N;if(h===c||h===d){var A=this.clone().set(p,1);A.$d[w](P),A.init(),this.$d=A.set(p,Math.min(this.$D,A.daysInMonth())).$d}else w&&this.$d[w](P);return this.init(),this},_.set=function(E,N){return this.clone().$set(E,N)},_.get=function(E){return this[I.p(E)]()},_.add=function(E,N){var D,h=this;E=Number(E);var m=I.p(N),w=function(x){var $=L(h);return I.w($.date($.date()+Math.round(x*E)),h)};if(m===c)return this.set(c,this.$M+E);if(m===d)return this.set(d,this.$y+E);if(m===i)return w(1);if(m===s)return w(7);var P=(D={},D[o]=6e4,D[a]=36e5,D[r]=1e3,D)[m]||1,A=this.$d.getTime()+E*P;return I.w(A,this)},_.subtract=function(E,N){return this.add(-1*E,N)},_.format=function(E){var N=this;if(!this.isValid())return"Invalid Date";var D=E||"YYYY-MM-DDTHH:mm:ssZ",h=I.z(this),m=this.$locale(),w=this.$H,P=this.$m,A=this.$M,x=m.weekdays,$=m.months,q=function(H,ee,re,ye){return H&&(H[ee]||H(N,D))||re[ee].substr(0,ye)},W=function(H){return I.s(w%12||12,H,"0")},z=m.meridiem||function(H,ee,re){var ye=H<12?"AM":"PM";return re?ye.toLowerCase():ye},K={YY:String(this.$y).slice(-2),YYYY:this.$y,M:A+1,MM:I.s(A+1,2,"0"),MMM:q(m.monthsShort,A,$,3),MMMM:q($,A),D:this.$D,DD:I.s(this.$D,2,"0"),d:String(this.$W),dd:q(m.weekdaysMin,this.$W,x,2),ddd:q(m.weekdaysShort,this.$W,x,3),dddd:x[this.$W],H:String(w),HH:I.s(w,2,"0"),h:W(1),hh:W(2),a:z(w,P,!0),A:z(w,P,!1),m:String(P),mm:I.s(P,2,"0"),s:String(this.$s),ss:I.s(this.$s,2,"0"),SSS:I.s(this.$ms,3,"0"),Z:h};return D.replace(g,function(H,ee){return ee||K[H]||h.replace(":","")})},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(E,N,D){var h,m=I.p(N),w=L(E),P=6e4*(w.utcOffset()-this.utcOffset()),A=this-w,x=I.m(this,w);return x=(h={},h[d]=x/12,h[c]=x,h[l]=x/3,h[s]=(A-P)/6048e5,h[i]=(A-P)/864e5,h[a]=A/36e5,h[o]=A/6e4,h[r]=A/1e3,h)[m]||A,D?x:I.a(x)},_.daysInMonth=function(){return this.endOf(c).$D},_.$locale=function(){return b[this.$L]},_.locale=function(E,N){if(!E)return this.$L;var D=this.clone(),h=T(E,N,!0);return h&&(D.$L=h),D},_.clone=function(){return I.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},O}(),U=R.prototype;return L.prototype=U,[["$ms",n],["$s",r],["$m",o],["$H",a],["$W",i],["$M",c],["$y",d],["$D",p]].forEac
10h(function(O){U[O[1]]=function(_){return this.$g(_,O[0],O[1])}}),L.extend=function(O,_){return O.$i||(O(_,R,L),O.$i=!0),L},L.locale=T,L.isDayjs=C,L.unix=function(O){return L(1e3*O)},L.en=b[k],L.Ls=b,L.p={},L}()}),Zc=Na(function(t,e){t.exports=function(n,r,o){var a=r.prototype;o.utc=function(u){return new r({date:u,utc:!0,args:arguments})},a.utc=function(u){var g=o(this.toDate(),{locale:this.$L,utc:!0});return u?g.add(this.utcOffset(),"minute"):g},a.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var i=a.parse;a.parse=function(u){u.utc&&(this.$u=!0),this.$utils().u(u.$offset)||(this.$offset=u.$offset),i.call(this,u)};var s=a.init;a.init=function(){if(this.$u){var u=this.$d;this.$y=u.getUTCFullYear(),this.$M=u.getUTCMonth(),this.$D=u.getUTCDate(),this.$W=u.getUTCDay(),this.$H=u.getUTCHours(),this.$m=u.getUTCMinutes(),this.$s=u.getUTCSeconds(),this.$ms=u.getUTCMilliseconds()}else s.call(this)};var c=a.utcOffset;a.utcOffset=function(u,g){var f=this.$utils().u;if(f(u))return this.$u?0:f(this.$offset)?c.call(this):this.$offset;var y=Math.abs(u)<=16?60*u:u,S=this;if(g)return S.$offset=y,S.$u=u===0,S;if(u!==0){var k=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(S=this.local().add(y+k,"minute")).$offset=y,S.$x.$localOffset=k}else S=this.utc();return S};var l=a.format;a.format=function(u){return l.call(this,u||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":""))},a.valueOf=function(){var u=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||new Date().getTimezoneOffset());return this.$d.valueOf()-6e4*u},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var d=a.toDate;a.toDate=function(u){return u==="s"&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var p=a.diff;a.diff=function(u,g,f){if(u&&this.$u===u.$u)return p.call(this,u,g,f);var y=this.local(),S=o(u).local();return p.call(y,S,g,f)}}});const xa={dateTimeLocal:"YYYY-MM-DD[T]HH:mm:ss",dateTimeUTC:"YYYYMMDD[T]HHmmss[Z]",allDay:"YYYYMMDD"};function el(t){const e=new URLSearchParams;return Object.keys(t).sort().forEach(n=>{const r=t[n];r!=null&&e.append(n,r)}),e.toString().replace(/\+/g,"%20")}function $a({startTime:t,endTime:e},n){const r=xa[n];return{start:t.format(r),end:e.format(r)}}Pt.extend(Zc);const Ma=(t,e=!0)=>{const{start:n,end:r,duration:o}=t,a=function(c,l){if(c==null)return{};var d,p,u={},g=Object.keys(c);for(p=0;p<g.length;p++)l.indexOf(d=g[p])>=0||(u[d]=c[d]);return u}(t,["start","end","duration"]),i=e?Pt(n).utc():Pt(n),s=r?e?Pt(r).utc():Pt(r):(()=>{if(t.allDay)return i.add(1,"day");if(o&&o.length==2){const c=Number(o[0]);return i.add(c,o[1])}return i})();return nr({},a,{startTime:i,endTime:s})},tl=t=>{const e=Ma(t),{start:n,end:r}=$a(e,e.allDay?"allDay":"dateTimeUTC"),o={action:"TEMPLATE",text:e.title,details:e.description,location:e.location,trp:e.busy,dates:n+"/"+r,recur:e.rRule?"RRULE:"+e.rRule:void 0};return e.guests&&e.guests.length&&(o.add=e.guests.join()),`https://calendar.google.com/calendar/render?${el(o)}`},co=t=>{const e=Ma(t),n=(e.description||"").replace(/,/gm,",").replace(/;/gm,";").replace(/\r\n/gm,`
11`).replace(/\n/gm,"\\n").replace(/(\\n)[\s\t]+/gm,"\\n"),r=(e.location||"").replace(/,/gm,",").replace(/;/gm,";").replace(/\r\n/gm,`
12`).replace(/\n/gm,"\\n").replace(/(\\n)[\s\t]+/gm,"\\n"),{start:o,end:a}=$a(e,e.allDay?"allDay":"dateTimeUTC"),i=Pt(new Date).utc().format(xa.dateTimeUTC),s=[{key:"BEGIN",value:"VCALENDAR"},{key:"VERSION",value:"2.0"},{key:"PRODID",value:"-//AnandChowdhary//calendar-link//EN"},{key:"BEGIN",value:"VEVENT"},{key:"URL",value:e.url},{key:"DTSTART",value:o},{key:"DTEND",value:a},{key:"DTSTAMP",value:i},...e.allDay?[{key:"X-MICROSOFT-CDO-ALLDAYEVENT",value:"TRUE"},{key:"X-MICROSOFT-MSNCALENDAR-ALLDAYEVENT",value:"TRUE"}]:[],{key:"RRULE",value:e.rRule},{key:"SUMMARY",value:e.title},{key:"DESCRIPTION",value:n},{key:"LOCATION",value:r},{key:"ORGANIZER",value:e.organizer},{key:"STATUS",value:e.status},{key:"UID",value:e.uid||Math.floor(1e5*Math.random()).toString().replace(".","")},{key:"END",value:"VEVENT"},{key:"END",value:"VCALENDAR"}];let c="";
12return s.forEach(l=>{if(l.value)if(l.key=="ORGANIZER"){const d=l.value;c+=`${l.key};${encodeURIComponent(`CN=${d.name}:MAILTO:${d.email}\r
13`)}`}else c+=`${l.key}:${encodeURIComponent(`${l.value}\r
14`)}`}),`data:text/calendar;charset=utf8,${c}`},nl=t=>{const e=rl(t);return ha()?tl(e):(Xt(),co(e))},rl=t=>({start:t.startDate,end:t.endDate,title:t.eventTitle,description:t.eventDescription,url:t.eventUrl,location:t.eventUrl}),Ua=(t,e)=>{const n={timer:`.${t}__timer`,countdownDays:`.${t}__digit--days`,countdownHrs:`.${t}__digit--hrs`,countdownMin:`.${t}__digit--min`,countdownSec:`.${t}__digit--sec`,flipClock:".flip-clock",animatedDigit:`${t}__animated-digit`,flip:`${t}__animated-digit--flip`,side:`${t}__side`,front:`${t}__side--front`,back:`${t}__side--back`},r=l=>`${l}`.length===1?`0${l}`:`${l}`,o=l=>{window.location.href=nl(l)},a=l=>{if(!(l instanceof HTMLElement)||l.dataset.flipInitialized==="true")return;const d=(l.textContent||"00").trim()||"00";l.textContent="",l.classList.add(n.animatedDigit);const p=document.createElement("div");p.classList.add(n.side,n.front),p.dataset.number=d;const u=document.createElement("div");u.classList.add(n.side,n.back),u.dataset.number=d,l.appendChild(p),l.appendChild(u),l.dataset.flipInitialized="true"},i=(l,d)=>{const p=r(d);if(!(l instanceof HTMLElement)){l.innerHTML=p;return}a(l);const u=l.querySelector(`.${n.front}`),g=l.querySelector(`.${n.back}`);if(!u||!g){l.innerHTML=p;return}(u.dataset.number||p)!==p&&(g.dataset.number=p,l.classList.add(n.flip),window.setTimeout(()=>{l.classList.remove(n.flip),u.dataset.number=p},500))},s=()=>{document.querySelectorAll(n.timer).forEach(d=>{const p=d.closest(n.flipClock),u=d.querySelector(n.countdownDays),g=d.querySelector(n.countdownHrs),f=d.querySelector(n.countdownMin),y=d.querySelector(n.countdownSec),S=new Date(d.getAttribute("data-countdown-date"));if(u&&g&&f&&y){const k=S.getTime(),b=setInterval(()=>{const C=new Date().getTime(),T=k-C;if(T<=0){clearInterval(b);return}const L=Math.floor(T/(1e3*60*60*24)),I=Math.floor(T%(1e3*60*60*24)/(1e3*60*60)),R=Math.floor(T%(1e3*60*60)/(1e3*60)),U=Math.floor(T%(1e3*60)/1e3);p?(i(u,L),i(g,I),i(f,R),i(y,U)):(u.innerHTML=r(L),g.innerHTML=r(I),f.innerHTML=r(R),y.innerHTML=r(U))},1e3)}})},c=()=>{e.filter(l=>!!l).forEach(l=>{const d=l.getAttribute("data-calendar-event");if(d){const p=JSON.parse(d);l.addEventListener("click",u=>{u.preventDefault(),o(p)})}})};s(),c()},ol=async(t,e={})=>{const{maxRetries:n=3,delayMs:r=1e3}=e;let o=0;for(;o<=n;)try{return await t()}catch(a){if(o++,o>n)throw a;v.warn(`Attempt ${o}/${n} failed. Retrying in ${r}ms...`,a),await new Promise(i=>setTimeout(i,r))}},al={hidden:"hidden"},et={countdownId:"data-countdown-id",reloadEnabled:"data-reload-enabled",notValidAfter:"data-not-valid-after",notValidBefore:"data-not-valid-before"},Ba=t=>{const e=/wcmmode=disabled/.test(window.location.search),n=window.location.host==="local.dev.onexp.com",r=(o,a)=>{const i=new Date;o.querySelectorAll(`[${a}]`).forEach(s=>{const c=s.getAttribute(a),l=new Date(c)<=i;s.classList.toggle(al.hidden,a===et.notValidAfter?l:!l)})};(e||n)&&(r(t,et.notValidAfter),r(t,et.notValidBefore))},il=async(t,e)=>await ol(async()=>{const n=`${window.location.pathname}/${t}.${e.getTime()}.restricted`,r=await fetch(`${window.location.origin}${n}`);if(!r.ok)throw new Error(`Got ${r.status} status while fetching restricted content`);return await r.text()},{maxRetries:60,delayMs:2e3}),lo=async(t,e,n,r)=>{try{t.innerHTML=await il(n,r),await M.mountAll(t),dr(e),v.log("Successfully loading restricted content",{restrictedId:n})}catch(o){v.log("Unsuccessfully loading restricted content",{restrictedId:n,error:o})}},sl=async(t,e)=>{const n=new Date,r=t.querySelector(`[${et.notValidAfter}]`);if(t.querySelector(`[${et.notValidBefore}]`)||!r){v.log("Skipping loading restricted content as it is already loaded",t);return}const a=r.getAttribute(et.countdownId),i=new Date(r.getAttribute(et.notValidAfter)),s=r.getAttribute(et.reloadEnabled)==="true";if(!a||!s||ie){v.warn("Skipping loading restricted content as it is not available",{restrictedId:a,reloadEnabled:s});return}if(i<n){v.log("Loading restricted content during initialization",{restrictedId:a,restrictedDate:i}),await lo(t,e,a,i);return}const c=i.getTime()-n.getTime();if(10*24*3600*1e3<c){v.log("Skipping loading restricted content as it exceeds 10 days",{restrictedId:a,restrictedDate:i});return}v.log(`Loading restricted content in ${c} ms`,{restrictedId:a,restrictedDate:i}),setTimeout(async()=>{v.log("Loading restricted content after the timeout",{restrictedId:a,restrictedDate:i}),await lo(t,e,a,i)},c)};(()=>{const t={countdown:".countdowncard",countdownCalendardMode:"div.countdown-card__countdown--mode-calendar-link",addToCalendarBtn:".countdown-card__add-to-calendar",addToCalendarLink:".countdown-card__add-to-calendar-link"},e=a=>{const i=a.querySelectorAll(t.countdownCalendardMode);i.length&&(i[0].classList.add("first-item"),i[i.length-1].classList.add("last-item"))},n=async a=>{const i=a.querySelector(t.addToCalendarBtn),s=a.querySelector(t.addToCalendarLink);Ua("countdown-card",[i,s]),await sl(a,t.countdown)},o={name:"Countdown Card",mount:async a=>{const i=a.querySelectorAll(t.countdown);await me(i,async s=>{Ba(s),await n(s)}),e(a)}};M.registerComponent(o)})();function rr(t){return t.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#039;")}function ih(t){return t.replaceAll("\u2028","")}(()=>{const t={container:"cmp-embed__bazaarvoice",inlineRating:"bazaarvoice__inline-rating",modalReviews:"bazaarvoice__reviews"};let e=!1,n=!1;const r=[];let o=null,a=!1,i=null,s=null;const c=new CustomEvent("openBVModal"),l=new CustomEvent("closeBVModal"),d=new CustomEvent("closeBVUserReviews"),p=C=>{if(e||n)return;const T=C.getAttribute("data-src");if(!T)return;n=!0;const L=document.createElement("script");L.async=!0,L.src=rr(T),L.addEventListener("load",()=>{e=!0,n=!1,r.forEach(I=>I()),r.length=0}),document.head.appendChild(L)},u=C=>{e&&window.$BV?C():r.push(C)},g=()=>{window.$BV&&window.$BV.ui("rr","inline_ratings",{})},f=(C,T)=>{let L=!1;const I=new MutationObserver(()=>{const U=!!C.shadowRoot?.querySelector(T);v.log("[BV] Flow 1 — mutation fired, isActive:",U,"wasActive:",L),U&&!L?(L=!0,v.log("[BV] Flow 1 — dispatching openBVModal"),window.dispatchEvent(c)):!U&&L&&(L=!1,v.log("[BV] Flow 1 — dispatching closeBVModal"),window.dispatchEvent(l))}),R=setInterval(()=>{C.shadowRoot&&(L=!!C.shadowRoot.querySelector(T),v.log("[BV] Flow 1 — shadow root found, initial wasActive:",L),I.observe(C.shadowRoot,{childList:!0,subtree:!0}),clearInterval(R))},100);setTimeout(()=>{R&&clearInterval(R)},1e3)},y=C=>{s=C;const T=document.createElement("div");T.classList.add(t.modalReviews),T.setAttribute("data-bv-show","reviews"),T.setAttribute("data-bv-product-id",C);let L=null,I=!1;const R=()=>{I&&window.dispatchEvent(d),T.remove(),L&&clearInterval(L)},U=new On("bv-reviews","manual","bazaarvoice__modal",void 0,R);U.wrapper.querySelector(".cep-modal-dialog__container").appendChild(T),i=U,hr(U),L=setInterval(()=>{const{shadowRoot:_}=T;if(!_){v.log("[BV] Flow 2 — poll tick: shadow root not yet available");return}const E=!!_.querySelector("button.modalCloseBtn");E!==I&&v.log("[BV] Flow 2 — button.modalCloseBtn changed:",I,"→",E),I&&!E&&(v.log("[BV] Flow 2 — dispatching closeBVUserReviews, clearing overflow"),window.dispatchEvent(d)),I=E},200),window.$BV?.ui("rr","show_reviews",{productId:C})};window.addEventListener("openBVModal",()=>{v.log("[BV] Flow 1 — openBVModal received, closing reviews modal"),i?.closeModal()}),window.addEventListener("closeBVModal",()=>{v.log("[BV] Flow 1 — closeBVModal received, reopening reviews modal"),y(s),document.body.style.overflow=""}),window.addEventListener("closeBVUserReviews",()=>{v.log("[BV] Flow 2 — closeBVUserReviews received, clearing overflow"),document.body.style.overflow=""});const S=()=>
14{if(a===!0||o)return;const C=new MutationObserver(()=>{o=document.querySelector("div[data-bv-show='inpage_submission']"),o&&(f(o,"div[type='main']"),C.disconnect(),a=!1)});C.observe(document.body,{childList:!0}),a=!0},b={name:"BazaarVoice",mount:async C=>{const T=C.querySelectorAll(`.${t.container}`);Y(T,L=>{new ot(L,{threshold:40}).observe(()=>{S();const R=L.querySelector("script");R&&p(R),u(()=>{g();const U=L.querySelector(`.${t.inlineRating}`),O=L.dataset.bvProductId;U&&O&&U.addEventListener("click",_=>{_.preventDefault(),_.stopPropagation(),y(O)})})},"single")})}};M.registerComponent(b)})();(()=>{const t={container:"cmp-embed__dotter",buttonContainer:"cmp-embed__dotter--button",hidden:"dotter--hidden",loading:"dotter__loading",widget:"dotter",button:"cmp-button",modalContainer:"dotter__modal-container"},e=s=>{const c=s.dataset.dotter;let l;try{l=JSON.parse(c)}catch{return{filter:{}}}return l},n=s=>{const c=e(s),l=s.querySelector("script");l.addEventListener("load",()=>{const d=s?.querySelector(`.${t.loading}`),p=s.querySelector(`.${t.widget}`),u=new Dotter(c);d.classList.add(t.hidden),u.embed(p)}),l.setAttribute("src",rr(l.getAttribute("data-src"))),l.removeAttribute("data-src")},r=s=>{const c=e(s),l=s.querySelector("script");l.addEventListener("load",()=>{const d=s.querySelector(`.${t.button}`),p=s.querySelector(`.${t.modalContainer}`),u=g=>{g.preventDefault();try{new Dotter(c).popup(p,()=>{document.location.hash=""})}catch(f){console.error("Error opening Dotter modal:",f)}};d&&p&&d.addEventListener("click",u)}),l.setAttribute("src",rr(l.getAttribute("data-src"))),l.removeAttribute("data-src")},o=()=>{const s=new URL(window.location.href);s.hash=decodeURI(decodeURI(s.hash)),window.history.replaceState(window.history.state,"",s.href)},i={name:"Dotter",mount:async s=>{const c=s.querySelectorAll(`.${t.container}`);c.length>0&&o(),Y(c,l=>{const d=new ot(l,{threshold:40}),p=l.classList.contains(t.buttonContainer);d.observe(()=>{p?r(l):n(l)},"single")})}};M.registerComponent(i)})();(()=>{const t={instagram:"cmp-embed__instagram"},n={name:"Instagram",mount:async r=>{const o=r.querySelectorAll(`.${t.instagram}`);Y(o,a=>{const i=a.querySelector("script");if(!i)return;new ot(a,{threshold:200}).observe(()=>{i.dataset.src&&(i.src=i.dataset.src)},"single")})}};M.registerComponent(n)})();(()=>{const t={container:"cmp-embed__live-chat-lightning",statusLabel:"status-label"},e=(o,a,i)=>{const{buttonId:s,chatId:c,deploymentId:l,eswLiveAgentDevName:d,language:p,labelOffline:u,labelOnline:g,liveChatLabel:f="",organisationId:y}=a;window.embedded_svc.settings={...window.embedded_svc.settings,displayHelpButton:!0,language:p,enabledFeatures:["LiveAgent"],entryFeature:"LiveAgent",defaultMinimizedText:`${f}<span class='${t.statusLabel}'>${g}</span>`,disabledMinimizedText:`${f}<span class='${t.statusLabel}'>${u}</span>`},window.embedded_svc.init(i.salesforce,i.nexusLightning,o,y,c,{baseLiveAgentContentURL:i.baseLiveAgentContentURL,deploymentId:l,buttonId:s,baseLiveAgentURL:i.baseLiveAgentURL,eswLiveAgentDevName:d,isOfflineSupportEnabled:!1})},r={name:"Salesforce Live Chat (Lightning)",mount:async o=>{se(o.querySelector(`.${t.container}`),a=>{const i=o.querySelector(`.${t.container} > script[data-src]`),s=JSON.parse(a?.dataset?.livechat||null),c=o.querySelector("[data-livechat-urls]"),l=JSON.parse(c?.dataset?.livechatUrls||null);!i||!s||!l||(i.src=i.dataset.src,i.onload=()=>{e("https://service.force.com",s,l)})})}};M.registerComponent(r)})();(()=>{const t={container:"cmp-embed__live-chat-miaw",available:"cmp-embed__live-chat-miaw-button--available",unavailable:"cmp-embed__live-chat-miaw-button--unavailable",conversationButton:"embeddedMessagingConversationButton",messagingFrame:"embeddedMessagingFrame"},e={scriptRequested:"liveChatScriptRequested",observersRegistered:"liveChatObserversRegistered"},n=()=>{const u=navigator;return u.userAgentData?.platform?u.userAgentData.platform:navigator.platform||""},r=()=>{const u=navigator;return{userAgent:u.userAgent,browserLanguage:u.language||u.userLanguage||"",screenResolution:`${window.screen.width}x${window.screen.height}`,platform:n()}},o=()=>{try{const u=r();v.log("Browser Info:",u);const g={User_Agent:u.userAgent,Browser_Language:u.browserLanguage,Screen_Resolution:u.screenResolution,Platform:u.platform};Object.keys(g).length>0&&window.embeddedservice_bootstrap.prechatAPI.setHiddenPrechatFields(g)}catch(u){console.error("Error setting hidden prechat fields: ",u)}},a=(u,g)=>{const f=u.querySelector(`.${t.available}`),y=u.querySelector(`.${t.unavailable}`);f&&(f.style.display=g?"block":"none"),y&&(y.style.display=g?"none":"block")},i=u=>{const g=document.querySelector(`.${t.conversationButton}`),f=document.querySelector(`.${t.messagingFrame}`);if(!g&&!f){v.log("Availability check skipped — Salesforce not yet rendered");return}const y=!!f;let S=!1;if(g&&(S=window.getComputedStyle(g).display==="none"),!y&&S){a(u,!1);return}a(u,!0)},s=u=>{if(u.dataset[e.observersRegistered]==="true")return;u.dataset[e.observersRegistered]="true";let g=!1,f=null,y=null;const S=()=>{g||(g=!0,requestAnimationFrame(()=>{g=!1,i(u)}))},k=T=>{T!==y&&(f?.disconnect(),y=T,f=new MutationObserver(()=>{S()}),f.observe(T,{attributes:!0,attributeFilter:["style","class","hidden","aria-hidden"]}))};new MutationObserver(()=>{const T=document.querySelector(`.${t.conversationButton}`);T?k(T):y&&(f?.disconnect(),y=null),S()}).observe(document.body,{childList:!0,subtree:!0});const C=document.querySelector(`.${t.conversationButton}`);C&&k(C),S()},c=(u,g)=>{try{g.useAvailabilityButtons==="true"&&s(u),window.embeddedservice_bootstrap.settings.language=g.language,window.addEventListener("onEmbeddedMessagingReady",o),window.embeddedservice_bootstrap.init(g.organizationId,g.buttonName,g.messagingChannelUrl,{scrt2URL:g.scrt2Url})}catch(f){console.error("Error loading Embedded Messaging: ",f)}},l=u=>{if(u.dataset[e.scriptRequested]==="true")return;let g;
14try{g=JSON.parse(u?.dataset?.livechat||"{}")}catch(y){console.error("Error parsing live chat data: ",y);return}const f=u.querySelector("script[data-src]");if(!f||!g||!g.scriptUrl){console.warn("Salesforce Live Chat (MIAW): Missing required configuration or script element");return}u.dataset[e.scriptRequested]="true",f.src=f.dataset.src,f.onload=()=>{c(u,g)},f.removeAttribute("data-src")},p={name:"Salesforce Live Chat (MIAW)",mount:async u=>{se(u.querySelector(`.${t.container}`),g=>{new ot(g,{threshold:40}).observe(()=>{l(g)},"single")})}};M.registerComponent(p)})();const qa={spotifyPlaceholder:"spotify-placeholder",spotifyComponent:"cmp-embed__spotify"};class cl{IFrameAPI;initialised=!1;spotifyPlayers;initQueue=[];constructor(){window.Spotify||(window.Spotify={loaded:"not_started"}),this.spotifyPlayers=document.querySelectorAll(`.${qa.spotifyPlaceholder}`),this.spotifyPlayers.forEach(e=>{new ot(e,{threshold:200}).observe(()=>{this.initPlayer(e)},"single")})}initPlayer(e){this.initialised?this.loadPlayer(e):(Xc(),this.initQueue.push(e),this.tryRunLoadQueue())}tryRunLoadQueue(){this.initialised&&this.initQueue.forEach((e,n)=>{e&&(this.loadPlayer(e),this.initQueue[n]=void 0)})}async getSpotifyTitle(e){const n=new URL("https://open.spotify.com/oembed");n.searchParams.set("url",encodeURI(e));try{return(await(await fetch(n,{method:"GET",mode:"cors"})).json()).title}catch{return""}}async emitSpotifyEvent(e){const n={event:"play_spotify",embed_title:await this.get
14SpotifyTitle(e),embed_url:e};G.push(n)}loadPlayer(e){const{type:n,uri:r,src:o}=JSON.parse(e.dataset.iframe);let a=!1;const i={height:["track","episode","show"].includes(n)?105:398,uri:r},s=c=>{c.addListener("playback_update",l=>{!l.data.isPaused&&!a?(this.emitSpotifyEvent(o),a=!0):l.data.isPaused&&(a=!1)})};this.IFrameAPI.createController(e,i,s)}setScriptLoaded(e){window.Spotify.loaded="initialised",this.IFrameAPI=e,this.initialised=!0,this.tryRunLoadQueue()}}(()=>{const e={name:"Spotify",mount:async n=>{const r=n.querySelector(`.${qa.spotifyComponent}`);se(r,()=>{const o=new cl;window.onSpotifyIframeApiReady=a=>{o.setScriptLoaded(a)}})}};M.registerComponent(e)})();(()=>{const t={gallery:"cmp-embed__sprinklr-gallery"},n={name:"Sprinklr Gallery",mount:async r=>{const o=r.querySelectorAll(`.${t.gallery}`);Y(o,a=>{const i=a.querySelector("script");if(!i)return;new ot(a,{threshold:200}).observe(()=>{i.src=i.dataset.src},"single")})}};M.registerComponent(n)})();const uo={tiktokEmbed:".cmp-embed__tiktok",video:"tiktok-video",profile:"tiktok-profile"};(()=>{let t=!1,e;const n=()=>
14{if(t){const a=document.createElement("script");a.src=e,document.body.appendChild(a),t=!1}},o={name:"TikTok Embed",mount:async a=>{const i=a.querySelectorAll(uo.tiktokEmbed);await me(i,async s=>{const c=s.querySelector(".tiktok-wrapper"),{tiktokUrl:l}=c.dataset,d="https://www.tiktok.com/oembed?maxwidth=300&maxheight=300&url="+l,p=await fetch(d);if(!p.ok)throw new Error(`Received error status code ${p.status}`);const u=await p.json();c.innerHTML=u.html;const g=u.embed_type,f=c.querySelector("script");e=f.src,s.classList.add(uo[g]),f.parentNode.removeChild(f),Vt.observe({element:c,threshold:100,percentageFallbackThreshold:.75,enterOnce:!0,onEnter:n}),t=!0,Vt.elementsAdded()})}};M.registerComponent(o)})();const ll={youtubeEmbed:".cmp-embed__youtube"};(()=>{const e={name:"YouTube Embed",mount:async n=>{const r=n.querySelectorAll(ll.youtubeEmbed);Y(r,o=>{const a=o.closest(".embed");new Oa(a)})}};M.registerComponent(e)})();const jn={LABELS:{showMore:"Show More",showLess:"Show Less"},HIDDEN_CLASS:"hidden",DEBOUNCE_DELAY:50},Xe={expanded:"expanded",collapsed:"collapsed",button:"show-more__button"};class Pr{expanded;hiddenClass;debounceDelay;labels;minHeight;maxHeight;showMoreElement;showMoreButton;isSafari;visibilityObserver=null;constructor(e,n){this.hiddenClass=n?.hiddenClass||jn.HIDDEN_CLASS,this.expanded=n?.expanded||!1,this.showMoreElement=e,this.labels=n?.labels||jn.LABELS,this.debounceDelay=n?.debounceDelay||jn.DEBOUNCE_DELAY,document.fonts.ready.then(()=>{this.initShowMore()}),this.isSafari=ga()}scrollIfNeeded(){const n=Oo(this.showMoreElement),r=document.documentElement.scrollTop,o=window.innerHeight,a=document.querySelector(".secondary-header"),s=(a?a.getBoundingClientRect().height:0)+50,c=n-s<r,l=n+this.minHeight+50>r+o;c?window.scrollTo({top:n-s,left:0,behavior:"smooth"}):l&&window.scrollTo({top:n-o+this.minHeight+50,left:0,behavior:"smooth"})}toggleState(){if(this.expanded=!this.expanded,this.showMoreButton.textContent=this.expanded?this.labels.showLess:this.labels.showMore,this.showMoreButton.classList.toggle(Xe.expanded,this.expanded),this.showMoreElement.classList.toggle(Xe.collapsed,!this.expanded),this.isSafari){this.showMoreElement.classList.toggle(`safari-${Xe.expanded}`,this.expanded),this.showMoreElement.removeAttribute("style");return}this.updateHeight(),this.expanded?this.showMoreElement.style["-webkit-line-clamp"]="unset":(this.showMoreElement.style.height=`${this.minHeight}`,this.showMoreElement.addEventListener("transitionend",()=>{this.showMoreElement.style["-webkit-line-clamp"]=""},{once:!0}),this.scrollIfNeeded())}calculateHeight(){this.showMoreElement.removeAttribute("style"),this.isSafari&&this.showMoreElement.classList.remove(`safari-${Xe.expanded}`),this.minHeight=this.showMoreElement.getBoundingClientRect().height,this.showMoreElement.style["-webkit-line-clamp"]="unset",this.isSafari&&this.showMoreElement.classList.add(`safari-${Xe.expanded}`),this.maxHeight=this.showMoreElement.getBoundingClientRect().height;const e=this.expanded?this.maxHeight:this.minHeight;this.showMoreElement.style.height=`${e}px`,this.expanded||(this.showMoreElement.style["-webkit-line-clamp"]=""),this.isSafari&&this.showMoreElement.classList.toggle(`safari-${Xe.expanded}`,this.expanded)}buildShowMoreButton(){this.showMoreButton=this.newElement({tag:"button",class:Xe.button}),this.showMoreButton.textContent=this.labels.showMore,this.showMoreElement.after(this.showMoreButton),this.toggleShowMoreButton(),this.showMoreButton.addEventListener("click",this.toggleState.bind(this))}updateHeight(){const e=this.expanded?this.maxHeight:this.minHeight;this.showMoreElement.style.height=`${e}px`}newElement(e){const n=document.createElement(e?.tag||"div");return n.className=e.class||"",n.textContent=e.text||"",n}toggleShowMoreButton(){this.showMoreButton.classList.toggle(this.hiddenClass,this.maxHeight===this.minHeight)}isMeasurable(){return this.showMoreElement.getBoundingClientRect().height>0}measure(){this.calculateHeight(),this.toggleShowMoreButton()}measureWhenVisible(){if(!window.ResizeObserver){this.measure();return}this.visibilityObserver||(this.visibilityObserver=new ResizeObserver(()=>{this.isMeasurable()&&(this.visibilityObserver.disconnect(),this.visibilityObserver=null,this.measure())}),this.visibilityObserver.observe(this.showMoreElement))}measureOrWait(){if(this.isMeasurable()){this.measure();return}this.showMoreElement.removeAttribute("style"),this.measureWhenVisible()}initShowMore(){let e;this.buildShowMoreButton(),this.measureOrWait(),this.showMoreElement.classList.toggle(Xe.collapsed,!this.expanded),window.addEventListener("resize",()=>{clearTimeout(e),e=window.setTimeout(this.measureOrWait.bind(this),this.debounceDelay)})}}const ze={feedItem:"feed-item",feedItemContent:"feed-item__content",feedItemDescription:"feed-item__description",descriptionShowMore:"feed-item__description--show-more",notifyShopCta:"feed-item__notify-shop-cta",feedItemTitle:"feed-item__title",feedItemShare:"feed-item__share"},Fa="[data-calendar-event]",Wa=t=>{const e=t.querySelector(`.${ze.feedItemTitle}`)?.textContent,n=t.querySelector(Fa),r=JSON.parse(n?.dataset?.calendarEvent||"{}"),o=r?.startDate||"",a=r?.endDate||"";return{title:e,startTime:o,endTime:a}},dl=(t,e)=>{const{title:n,startTime:r,endTime:o}=Wa(e),a=La(t.target),i={event:"user_action",action:"share_card",card_title:n,card_start_time:r,card_end_time:o,card_share_url:a};G.push(i)},ul=(t,e)=>{const{title:n,startTime:r,endTime:o}=Wa(e),a=t.target?.href||"",i={event:"user_action",action:"card_cta_link",card_title:n,card_start_time:r,card_end_time:o,card_cta_link:a};G.push(i)},pl={labels:rt()},ml=t=>{t.querySelectorAll(`.${ze.feedItemDescription}`).forEach(a=>{const s=a.closest(`.${ze.feedItemContent}`)?.querySelector(Fa),c=s&&Ys(s);(!(a.dataset.isCtaUrl==="true")||c)&&(new Pr(a,pl),a.classList.add(ze.descriptionShowMore))});const n=t.querySelectorAll(`.${ze.notifyShopCta}`);Ua(ze.feedItem,[...n]),Ba(t),t.querySelectorAll(`.${ze.notifyShopCta}`).forEach(a=>{a.addEventListener("click",i=>ul(i,t))});const o=t.querySelector(`.${ze.feedItemShare} button`);o&&o.addEventListener("click",a=>dl(a,t))},hl=async t=>{const e=t.querySelectorAll(`.${ze.feedItem}`);Y(e,ml)},gl={name:"Feed Item",mount:hl};M.registerComponent(gl);(()=>{const t={mobileAccordion:"footer__mobile-accordion",linkList:"footer__link-list",expanded:"expanded",footerNavigation:"footer__navigation",separator:"separator",separatorDynamic:"separator--dynamic",separatorMobileNav:"separator--mobile-nav"},e=l=>{const d=l.target,p=d.nextElementSibling?.matches("ul")?d.nextElementSibling:null;d.matches(":is(h2, h4)")&&p&&(p.classList.toggle(t.expanded),d.ariaPressed=`${p.classList.contains(t.expanded)}`)},n=l=>
14{[" ","Enter"].includes(l.key)&&(l.preventDefault(),e(l))},r=l=>{l.forEach(d=>{const p=d.querySelector(":is(h2, h4)");if(!p)return;const u=!!d.querySelector("ul")?.classList.contains(t.expanded);p.role="button",p.tabIndex=0,p.ariaPressed=`${u}`})},o=l=>{l.forEach(d=>{const p=d.querySelector(":is(h2, h4)");p&&(p.role=null,p.tabIndex=-1,p.ariaPressed=null)})},a=(l,d,p)=>{if(!d)return;const u=document.createElement("div"),g=document.createElement("hr"),f=[t.separatorDynamic,p].filter(Boolean);u.classList.add(...f),u.appendChild(g),d.insertAdjacentElement("afterend",u)},i=async l=>{const d=l.querySelector(`.${t.footerNavigation}`);se(d,()=>s(d))},s=async l=>{const d=[...l?.querySelectorAll(`.${t.mobileAccordion}`)||[]],p=!!d.length;if(!p)return;const u=p?d.at(-1):null,g=!!u?.nextElementSibling?.matches(`.${t.linkList}`);oo()&&(r(d),l.addEventListener("click",e),l.addEventListener("keydown",n)),g&&a("after",u),l.nextElementSibling?.matches(`.${t.separator}`)||a("after",l,t.separatorMobileNav);const f=en(()=>{oo()?(r(d),l.addEventListener("click",e),l.addEventListener("keydown",n)):(d.forEach(y=>{y.querySelector("ul")?.classList.remove(t.expanded)}),o(d),l.removeEventListener("click",e),l.removeEventListener("keydown",n))},300);window.addEventListener("resize",()=>f())},c={name:"Footer Mobile Accordion",mount:i};M.registerComponent(c)})();(()=>{const t={reciteMeButton:"footer__button--accessibility"},e=o=>{const a=o.ownerDocument,i="//api.reciteme.com/asset/js?key=",s="85389bdaafe0171ae63847aa3f391aadf30c1962",c={},l="#reciteEnable",d=[],p=window.location.hash===l,u=(y,S)=>{const k=a.createElement("script");k.type="text/javascript",k.readyState?k.onreadystatechange=()=>{(k.readyState=="loaded"||k.readyState=="complete")&&(k.onreadystatechange=null,S?.())}:S!=null&&(k.onload=()=>{S()}),k.src=y,a.getElementsByTagName("head")[0].appendChild(k)},g=y=>{for(let S=i+s,k=0;k<d.length;k++){if(d[k]==S)return;d.push(S)}u(i+s,()=>{typeof _reciteLoaded=="function"&&_reciteLoaded(),Recite.load(c),Recite.Event.subscribe("Recite:load",()=>{Recite.enable()})})};gt("Recite.Persist")=="true"&&g(),p&&(a.addEventListener?a.addEventListener("DOMContentLoaded",()=>{g()}):g());const f=a.querySelectorAll(`.${t.reciteMeButton} button`);for(let y=0;y<f.length;y++){const S=f[y];S&&S.addEventListener("click",()=>{g()})}},r={name:"ReciteMe",mount:async o=>{se(o.querySelector(`.${t.reciteMeButton}`),()=>e(o))}};M.registerComponent(r)})();(()=>{const t={aemform:".aemform",defaultOption:"#emptyValue"},e=a=>{a.querySelectorAll(t.defaultOption).forEach(s=>{s.setAttribute("hidden","")})},n=(a,i,s)=>{const c=i.querySelector(".form_path input")?.value;let l;switch(a){case"view":l={event:"onexp_form_view",form_type:"contact_us",form_configuration:c??""};break;case"start":l={event:"onexp_form_start",form_type:"contact_us",form_configuration:c??""};break;case"submit":{let d=null;s?.marketingConsent?d=s.marketingConsent==="1":d=null,l={event:"onexp_form_submit",form_type:"contact_us",form_configuration:c??"",form_submission_result:s.submissionResult,form_marketing_consent:d};break}}G.push(l)},r=a=>{const i=new AbortController,s=c=>{["INPUT","SELECT","TEXTAREA","BUTTON"].includes(c.target.tagName)&&(n("start",a),i.abort())};a.addEventListener("click",s,{signal:i.signal}),window.addEventListener("aem-forms-submit",c=>{n("submit",a,c.detail)})},o=async a=>{const i=a.querySelectorAll(t.aemform);Y(i,s=>{n("view",s),e(s),r(s)})};M.registerComponent({name:"Form",mount:o})})();const Rt={NOTIFICATIONS_RAISED:"profile-notifications:raised",NOTIFICATIONS_DISMISSED:"profile-notifications:dismissed"};async function Bn(){let t;try{const{isAuthenticated:e,getAuthPayload:n}=await J();await e()?(t=(await n()).hashed_kocid,v.log("Got offline identity for profile notifications",t)):v.log("User is not authenticated. Offline identity will not be provided in profile notifications")}catch(e){console.log("Cannot get offline identity and will not be provided in profile notifications",e)}return t||"anonymous"}async function fl(){const t=await Bn(),e=Ee(()=>localStorage.getItem(Rt.NOTIFICATIONS_RAISED));if(!e)return{};try{return JSON.parse(e)[t]||{}}catch{return{}}}async function yl(t,e){const n=await Bn(),r=Ee(()=>localStorage.getItem(Rt.NOTIFICATIONS_RAISED));let o={};if(r)try{o=JSON.parse(r)}catch{}o[n]||(o[n]={}),o[n][t]=e,Ee(()=>localStorage.setItem(Rt.NOTIFICATIONS_RAISED,JSON.stringify(o)))}async function wl(){const t=await Bn(),e=Ee(()=>localStorage.getItem(Rt.NOTIFICATIONS_DISMISSED));if(e)try{const r=JSON.parse(e)[t]||[];return new Set(r)}catch(n){v.warn("Failed to parse dismissed profile notifications from local storage!",n)}return new Set}async function sh(t){const e=await Bn(),n=Ee(()=>localStorage.getItem(Rt.NOTIFICATIONS_DISMISSED));let r={};if(n)try{r=JSON.parse(n)}catch{}r[e]=Array.from(t),Ee(()=>localStorage.setItem(Rt.NOTIFICATIONS_DISMISSED,JSON.stringify(r)))}async function bl(t){const e=await fl(),n=await wl(),r=[];for(const o of t)if(!n.has(o.id))if(e[o.id]){const a=o.define(),i=e[o.id];
14r.push({...a,...i,id:o.id})}else{const a=o.raise();if(a){await yl(o.id,a);const i=o.define();r.push({...i,...a,id:o.id})}}return r.sort((o,a)=>a.date-o.date)}async function vl(t){return(await bl(t)).length>0}function Sl(t,e){const r=window.onexpGlobalStores.profileStore.getState(),o=[];return t.createProfile&&o.push({id:"create-profile",define:()=>({title:t.createProfile.title||"",description:t.createProfile.description||"",action:{label:t.createProfile.actionLabel||"",callback:()=>(e?.onEditProfile?.(),!1)}}),raise:()=>r.isProfileSaved()??!1?null:{date:Date.now()},shouldAutoDismiss:()=>r.isProfileSaved()??!1}),o}(()=>{const t=async(r,o)=>{const a=window.onexpGlobalStores.profileStore,i=a.getState();if(!await(await J()).isAuthenticated())return;const l=JSON.parse(o.dataset?.params),{leaderboardConfig:d,reCaptchaSiteKey:p,enableAvatarAndUsername:u,ngpsApi:g,configurationIds:f}=l,y={leaderboardApiUrl:d.leaderboardApiUrl,reCaptchaSiteKey:p,promoPlusEnvId:d.promoPlusEnvId,engagementApiUrl:d.engagementApiUrl,engagementPointsAppId:d.engagementPointsAppId,ngpsConfig:g,configurationIds:f};i.setApiConfig(y);let S=null,k=!1;const b=(R,U)=>{const O=r.querySelector(".user-avatar");if(!O||!R||R===S)return;let _=O.querySelector(".user-avatar__image img");if(!_){const E=O.querySelector(".user-avatar__image");_=document.createElement("img"),E?.appendChild(_)}_.setAttribute("src",R),_.setAttribute("alt",U),O.classList.remove("hidden"),r.classList.remove("header__user-account--placeholder"),S=R},C=async()=>{await i.fetchProfileData();const{avatarUrl:R,avatarAlt:U,state:O}=i.getProfileData(),_=r.querySelector(".user-avatar"),E=O==="saved";r.classList.add("header__user-account--placeholder"),_&&(E&&b(R,U),await L()),T()},T=()=>{a.subscribe(({profileData:R})=>{if(k)return;R.state==="saved"&&b(R.avatarUrl,R.avatarAlt)})},L=async()=>{const R=r.querySelector(".user-avatar");if(!R)return;const U=Sl(l.notifications);if(await vl(U)&&(R.classList.remove("hidden"),!R.querySelector(".user-avatar__notification"))){const E=document.createElement("div");E.className="user-avatar__notification",R.querySelector(".user-avatar__content")?.prepend(E)}},I=async()=>{const{init:R}=await Z(async()=>{const{init:U}=await import("./profileWidget.js");return{init:U}},__vite__mapDeps([13,3,14,15,16,6,7,17,18,19,20,21,22,8,9,23]),import.meta.url);await R(r,o),k=!0,r.classList.remove("header__user-account--placeholder")};r.classList.add("header__user-account--placeholder"),u&&!ie&&C(),r.addEventListener("click",()=>I(),{once:!0})},n={name:"Promo+ User Profile",mount:async r=>{const o=r.querySelector(".header"),a=r.querySelector("#header-configuration"),i=r.querySelector(".header__user-account");await Dt(i,async s=>{!o||!a||await t(s,a)})}};M.registerComponent(n)})();(()=>{const t={activeChild:"active-child",activeElement:"active-element",authenticatedFlow:"authenticated-flow",notAuthenticatedFlow:"not-authenticated-flow",focusTrap:"focus-trap-active",focusTrapElement:"focus-trap-active-element",hasSubmenu:"has-submenu",headerButtonsWrapper:"header__buttons-wrapper",headerNavigation:"header__navigation",headerOpen:"is-open",header:"header",headerWrapper:"header-wrapper",loginUnavailableBanner:"header__login-unavailable-banner",loginUnavailableBannerCloseButton:"header__login-unavailable-banner__close-button",loginUnavailableBannerHidden:"header__login-unavailable-banner--hidden",loginUnavailableFlow:"login-unavailable-flow",menuButton:"header__menu-button",scrollLock:"scroll-lock",separatorHidden:"header__button--separator-hidden",submenu:"submenu",submenuOpen:"sublist-is-open"};class e{header;ftContainer;ftSelectors;headerNavigation;menuButton;listElements;focusTrap;mobileMenuModalId;isMobileMenuOpen;constructor(r){this.header=r,this.ftContainer=this.header?.querySelector(`.${t.headerWrapper}`),this.ftSelectors=[`.${t.headerButtonsWrapper} .${t.menuButton}`,`.${t.headerNavigation}`],this.headerNavigation=this.header?.querySelector(`.${t.headerNavigation}`),this.menuButton=this.header?.querySelector(`.${t.menuButton}`),this.listElements=this.headerNavigation?[...this.headerNavigation?.querySelectorAll(".cmp-text > ul > li")]:[],this.focusTrap=Qt(this.ftSelectors,{onActivate:()=>{this.ftContainer.classList.add(t.focusTrap),this.ftSelectors.forEac
14h(o=>this.header?.querySelector(o).classList.add(t.focusTrapElement))},onDeactivate:()=>{this.ftContainer.classList.remove(t.focusTrap),this.ftSelectors.forEach(o=>this.header?.querySelector(o).classList.remove(t.focusTrapElement))}}),this.mobileMenuModalId=null,this.isMobileMenuOpen=!1,this.initHeader()}menuButtonClickHandler(){if(this.isMobileMenuOpen){window.modalController.requestClose(this.mobileMenuModalId);return}const{id:r}=window.modalController.requestOpen({name:"mobile-menu",priority:"manual",openFn:this.openMenuModal.bind(this),closeFn:this.closeMenuModal.bind(this)});this.mobileMenuModalId=r}initHeader(){this.headerNavigation&&this.initNavigationSubmenu(),this.initLanguageToggleSubmenu(),this.menuButton&&this.menuButton.querySelector("button").addEventListener("click",()=>{this.menuButtonClickHandler()});const r=en(()=>{Be()&&this.isMobileMenuOpen&&window.modalController.requestClose(this.mobileMenuModalId),this.hideLastButtonSeparator()},200);window.addEventListener("resize",()=>r())}initNavigationSubmenu(){this.listElements.forEach(r=>{const o=r.querySelector("ul"),a=r.querySelector("a");a&&(a.setAttribute("role","button"),a.setAttribute("data-text",a.innerText.trim()),o&&(a.setAttribute("aria-expanded","false"),r.classList.add(t.hasSubmenu),o.classList.add(t.submenu),o.querySelectorAll("li > a").forEach(i=>{i.setAttribute("data-text",i.innerText.trim())}),a.addEventListener("click",i=>{i.preventDefault();const s=this.header.querySelector(`.${t.submenuOpen}`),c=s?.querySelector("a"),l=i.currentTarget;r.classList.toggle(t.submenuOpen),this.toggleA11yAttribute(l),s&&l.parentElement!==s&&(s.classList.remove(t.submenuOpen),this.toggleA11yAttribute(c))}),a.parentElement.addEventListener("mouseenter",i=>{if(!Be())return;const s=i.currentTarget,c=s.querySelector("a");this.collapseSubmenu(),c?.setAttribute("aria-expanded","true"),s.classList.add(t.submenuOpen)}),a.parentElement.addEventListener("mouseleave",()=>{Be()&&this.collapseSubmenu()})))})}initLanguageToggleSubmenu(){(this.header?[...this.header.querySelectorAll(".header__language-toggle ul > li"),...this.header.querySelectorAll(".header__mobile-language-toggle ul > li")]:[]).forEach(o=>{const a=o.querySelector("ul"),i=o.querySelector("a");i&&a&&(i.setAttribute("aria-expanded","false"),o.classList.add(t.hasSubmenu),a.classList.add(t.submenu),a.querySelectorAll("li > a").forEach(s=>{s.setAttribute("data-text",s.innerText.trim())}),i.addEventListener("click",s=>{s.preventDefault();const c=this.header.querySelector(`.${t.submenuOpen}`),l=c?.querySelector("a"),d=s.currentTarget;o.classList.toggle(t.submenuOpen),this.toggleA11yAttribute(d),c&&d.parentElement!==c&&(c.classList.remove(t.submenuOpen),this.toggleA11yAttribute(l))}),i.parentElement.addEventListener("mouseenter",s=>{if(!Be())return;const c=s.currentTarget,l=c.querySelector("a");this.collapseSubmenu(),l?.setAttribute("aria-expanded","true"),c.classList.add(t.submenuOpen)}),i.parentElement.addEventListener("mouseleave",()=>{Be()&&this.collapseSubmenu()}))})}isVisible(r){return!!(r.offsetWidth||r.offsetHeight||r.getClientRects().length)}collapseSubmenu(){const r=this.header.querySelector(`.${t.submenuOpen}`),o=this.headerNavigation.querySelector(`.${t.hasSubmenu} > a[aria-expanded="true"]`);r?.classList.remove(t.submenuOpen),o?.setAttribute("aria-expanded","false")}toggleA11yAttribute(r){if(r?.tagName==="A"){const o=r.ariaExpanded==="true"?"false":"true";r.setAttribute("aria-expanded",o)}}hideLastButtonSeparator(){if(!this.header)return;const o=[...this.header.querySelectorAll(`.${t.headerButtonsWrapper} > .cmp-container > .button`)].filter(a=>this.isVisible(a));o.forEach((a,i)=>{const s=i===o.length-1;a.classList.toggle(t.separatorHidden,s)})}openMenuModal(){this.isMobileMenuOpen=!0,this.headerNavigation.classList.add(t.headerOpen),document.body.classList.add(t.scrollLock),this.menuButton.classList.add(t.headerOpen),this.ftContainer.classList.contains(t.focusTrap)||this.focusTrap.activate()}closeMenuModal(){this.mobileMenuModalId=null,this.isMobileMenuOpen=!1,this.headerNavigation.classList.remove(t.headerOpen),document.body.classList.remove(t.scrollLock),this.menuButton.classList.remove(t.headerOpen),this.ftContainer.classList.contains(t.focusTrap)&&this.focusTrap.deactivate()}updateActiveState(){if(!this.headerNavigation)return;const r=[...this.headerNavigation.querySelectorAll("a")];r.length!==0&&r.some(o=>{const a=o.getAttribute("href");if(a!=="#"&&window.location.pathname===a){const i=o.closest(`.${t.hasSubmenu}`);return i?(o.classList.add(t.activeChild),i.querySelector("a").classList.add(t.activeElement)):o.classList.add(t.activeElement),!0}})}async setUserFlow(){if(!this.header)return;const r=await J(),o=await r.isAuthenticated();this.header.classList.add(o?t.authenticatedFlow:t.notAuthenticatedFlow),this.header.classList.toggle(t.loginUnavailableFlow,r.getFacadeType()==="UnavailableFacade"),r.getFacadeType()==="UnavailableFacade"&&(this.initLoginUnavailableBanner(),this.disableSignupButton())}disableSignupButton(){const r=document.querySelector(".header__top-sign-up-button button");r&&(r.disabled=!0)}initLoginUnavailableBanner(){const r=document.querySelector(`.${t.loginUnavailableBanner}`),o=r?.querySelector(`.${t.loginUnavailableBannerCloseButton}`);!r||!o||(o.setAttribute("aria-label",Fe("closeButton")),o.addEventListener("click",()=>{r.classList.add(t.loginUnavailableBannerHidden)}))}}M.registerComponent({name:"Header",mount:async n=>{const r=n.querySelector(`.${t.header}`);Dt(r,async o=>{const a=new e(o);a.updateActiveState(),await a.setUserFlow(),a.hideLastButtonSeparator()})}})})();const Se={inviteFriend:".conditionalcontainer__logged-item:not(.conditionalcontainer--hidden) .invite-friend",signUp:".conditionalcontainer__not-logged-item:not(.conditionalcontainer--hidden) .referral__sign-up button",referral:".invite-friend__referral",referralTitle:".invite-friend__referral-title",referralDescription:".invite-friend__referral-description",referralButton:".invite-friend__referral-button",referralCta:".invite-friend__referral-button .cmp-button",referralCtaLabel:".invite-friend__referral-button .cmp-button__text",shareLink:".invite-friend__share-link .button",copyInstructions:".invite-friend__share-copy .button",loading:"loading-indicator",statusErrorReferralCode:".invite-friend__status-error-referral-code"},or=t=>{G.push({event:"user_referral",referral_result:t})},za=(t,e)=>{const n={referrer:{currency:void 0,amount:void 0},referee:{currency:void 0,amount:void 0}};if(!t||typeof t.success=="boolean")return n;function r(c){return Array.isArray(c)&&c.every(l=>typeof l=="object"&&"user"in l)}const o=r(t),a=c=>{const l=d=>
14c==="referrer"?d===e:d!==e;if(o)return t?.find(d=>l(d.user))?.success[0];if(Array.isArray(t?.success))return t.success.find(d=>l(d.user.userId))},i=a("referrer"),s=a("referee");return{referrer:{currency:i?.transactions?.[0]?.currencyName,amount:i?.amountInserted?.toString()},referee:{currency:s?.transactions?.[0]?.currencyName,amount:s?.amountInserted?.toString()}}},El=async(t,e,n,r)=>{const o=t.querySelector(Se.referral),a=new URLSearchParams(window.location.search).has("referralLink","true");if(r&&a){Re(o,{title:e.loadingContent,loading:!0});const i=await nt(e.ngpsApi.reCaptchaSiteKey,"referral"),s=await Ha(n,i,e),c=za(s,r);if(ja(c)){if(Ga(c)){const l=e.congratulationDescription.replaceAll("{{referee_amount}}",c.referee.amount).replaceAll("{{referee_currency}}",c.referee.currency).replaceAll("{{referrer_amount}}",c.referrer.amount||"").replaceAll("{{referrer_currency}}",c.referrer.currency||"0");Re(o,{title:e.congratulationTitle,description:l,buttonCta:e.congratulationCta,link:e.congratulationLink})}else Re(o,{title:e.pointsGrantedTitle,description:e.pointsGrantedDescription,buttonCta:e.pointsGrantedCta,link:e.pointsGrantedLink});Al(),or("Success")}else Cl(e,o,s,r,n)}else a&&(Re(o,{title:e.noReferralTitle,description:e.noReferralDescription,buttonCta:e.noReferralCta,link:e.noReferralLink}),or("No Code"))},Re=(t,e)=>{if(t){const n=t.querySelector(Se.referralTitle),r=t.querySelector(Se.referralDescription),o=t.querySelector(Se.referralButton),a=t.querySelector(Se.referralCta),i=t.querySelector(Se.referralCtaLabel);t.classList.toggle(Se.loading,!!e.loading),t.removeAttribute("hidden"),n.textContent=e.title,r.textContent=e.description,e.buttonCta?(o.removeAttribute("hidden"),e.link&&setTimeout(()=>{a.addEventListener("click",()=>{document.location=e.link})}),i.textContent=e.buttonCta):o.setAttribute("hidden","true");let s=document.querySelector(".referral-modal"),c;if(s)c=s.querySelector(".cep-modal-dialog__container > div");else{s=new On("referral","auto","referral-modal").wrapper;const d=s.querySelector(".cep-modal-dialog__container");c=document.createElement("div"),d.appendChild(c)}c.innerHTML=t.innerHTML,c.className=t.className,c.querySelector(".button")?.addEventListener("click",()=>{a.click()})}},Cl=(t,e,n,r,o)=>{if(or("Error"),n?.errCode||n?.error?.length||n?.message?.error?.length)switch(n.message?.error?.[0]?.errCode||n.error?.[0]?.errCode||n.errCode){case 10038:Re(e,{title:t.limitReachTitle,description:t.limitReachDescription,buttonCta:t?.limitReachCta,link:t?.limitReachLink});break;case 10037:Re(e,{title:t.referralCodeUsedTitle,description:t.referralCodeUsedDescription,buttonCta:t?.referralCodeUsedCta,link:t?.referralCodeUsedLink});break;case 10036:Re(e,{title:t.promotionNotActiveTitle,description:t.promotionNotActiveDescription,buttonCta:t.promotionNotActiveCta,link:t.promotionNotActiveLink});break;default:Re(e,{title:t.statusErrorTitle,description:t.statusErrorDescription,buttonCta:t.statusErrorCta});const i=e.querySelector(Se.referralCta);i.addEventListener("click",async()=>{await po(e,i,r,o,t)})}else{Re(e,{title:t.statusErrorTitle,description:t.statusErrorDescription,buttonCta:t.statusErrorCta});const i=e.querySelector(Se.referralCta);i.addEventListener("click",async()=>{await po(e,i,r,o,t)})}},Ha=async(t,e,n)=>{const r=new URLSearchParams({configurationId:n.configurationId,"g-recaptcha-response":e}),o={"Content-Type":"application/json","x-api-key":n.ngpsApi.ngpsApiKey,Authorization:`Bearer ${t}`},a=`${n.ngpsApi.ngpsApiUrl}/referralRewards?${r}`;return(await fetch(Ce(a),{method:"POST",headers:Ae(o)})).json()},po=async(t,e,n,r,o)=>{Re(t,{title:o.loadingContent,loading:!0});const a=await nt(o.ngpsApi.reCaptchaSiteKey,"referral"),i=await Ha(r,a,o),s=za(i,n);ja(s)?(e.replaceWith(e.cloneNode(!0)),Re(t,{title:o.pointsGrantedTitle,description:o.pointsGrantedDescription,buttonCta:o.pointsGrantedCta,link:o.pointsGrantedLink})):Re(t,{title:o.statusErrorTitle,description:o.statusErrorDescription,buttonCta:o.statusErrorCta})},Al=()=>{const t=new URL(window.location.href);t.searchParams.delete("referralCode"),t.searchParams.delete("referralLink"),window.history.replaceState(null,null,t)},Va=t=>!!(t.amount&&t.currency),_l=t=>Va(t.referrer),Ga=t=>Va(t.referee),ja=t=>Ga(t)||_l(t),Ka=(t,e)=>{const n=new URL(e||`${window.location.origin}${window.location.pathname}`);return n.searchParams.append("referralLink","true"),n.searchParams.append("referralCode",t),n.toString()},Pl=async(t,e,n="")=>{const r=t.querySelector(Se.shareLink),o=t.querySelector(Se.copyInstructions);n?(r?.querySelector("button")?.addEventListener("click",()=>{const s=Ka(n);Ra(r,s)}),o?.querySelector("button")?.addEventListener("click",()=>{const s=e.copyInstructionsMessage.replaceAll("{{referralCode}}",n);ka(o),window.navigator.clipboard.writeText(s)})):Il(t,r,o)},Il=async(t,e,n)=>{v.warn("Missing ref_code in GAM token"),window.cep.reportRumError?.({message:`Missing ref_code in GAM token on ${window.location.href} URL`,stack:new Error("Missing ref_code error").stack}),t.querySelector(Se.statusErrorReferralCode)?.removeAttribute("hidden");const o=e?.querySelector("button");o&&(o.disabled=!0);const a=n?.querySelector("button");a&&(a.disabled=!0)};(()=>{const t=async o=>{const{getAuthPayload:a,getAuthToken:i}=await J(),s=await i(),c=JSON.parse(o.dataset.params||"{}"),{ref_code:l,ref_hashed_kocid:d}=await a();await $n(c.ngpsApi.reCaptchaSiteKey),El(o,c,s,d),Pl(o,c,l)},e=o=>{const a=async()=>{const{signUp:i}=await J();await i()};o.addEventListener("click",mt(a))},r={name:"Invite Friend",mount:async o=>{const a=o.querySelector(Se.inviteFriend);se(a,s=>{ie||t(s)});const i=o.querySelector(Se.signUp);se(i,s=>{ie||e(s)})}};M.registerComponent(r)})();(()=>{const t=async n=>new Promise(r=>{n.src=n.dataset.src,n.onload=r}),e=async n=>{const r=n.querySelectorAll(".cmp-thumbnail");await We(r,async()=>{const a=n.querySelector("[data-komotion-client-helper]");!![...r].find(c=>c.hasAttribute("data-private-video"))&&a&&await t(a);const{init:s}=await Z(async()=>{const{init:c}=await import("./komotion.js");return{init:c}},__vite__mapDeps([24,25]),import.meta.url);return{init:s}},async(a,{init:i})=>{const s=a.closest(".komotion");s instanceof HTMLElement&&i(s)})};M.registerComponent({name:"Komotion",mount:e})})();(()=>{const t={locationSelector:"cmp-location-selector",dropdown:"cmp-location-selector__dropdown-widget",redirectButton:"cmp-location-selector__button"},e=async a=>{const i=a.querySelectorAll(`.${t.locationSelector}`);await me(i,async s=>{const c=s.querySelector(`.${t.dropdown}`);c.addEventListener("change",()=>n(s,c)),ie||await r(s,c)})},n=(a,i)=>{const s=a.querySelector(`.${t.redirectButton}`),c=i.selectedOptions[0].dataset.url||"";s?.setAttribute("href",c)},r=async(a,i)=>{try{const s=await fetch(`${window.location.origin}/api/geolocation`);if(!s.ok)throw new Error(`Received error response with status: ${s.status}`);const l=(await s.json()).country||"",p=Array.from(i.options).find(u=>u.getAttribute("value")===l.toUpperCase());p&&(p.selected=!0,n(a,i))}catch(s){console.error("Cannot set default country on Location Selector",s)}},o={name:"Location Selector",mount:e};M.registerComponent(o)})();const mo="#modalTrigger",Et={visible:"visible",modal:"cep-modal",modalWarning:"cep-modal-component__warning",modalTriggerWrapper:"cep-modal-trigger",modalDialog:"cep-modal-dialog"};(()=>{const t=async o=>{const a=o.querySelectorAll(`.${Et.modal}`);Y(a,i=>{const s=i.querySelector(`.${Et.modalTriggerWrapper}`),c=i.querySelector(`a[href='${mo}']`);if(ie){n(i,c);return}const l=i.querySelector(`.${Et.modalDialog}`);
14e(l,s),l.id||(l.id=`${Et.modalDialog}-${crypto.randomUUID()}`);const d=ra(l,"manual");c?.addEventListener("click",p=>{p.preventDefault(),hr(d)})})},e=(o,a)=>{const i=!!a.querySelector(".popup-card");o.classList.toggle("modal-popup-card",i)},n=(o,a)=>{const i=o.querySelector(`a[data-cmp-data-layer*='${mo}']`),s=!a&&!i;o.querySelector(`.${Et.modalWarning}`)?.classList.toggle(Et.visible,s)},r={name:"Modal Trigger",mount:t};M.registerComponent(r)})();const Ya=t=>{const e=t?.split(",")||[""],n=e[0],r=e.length>1?e.slice(1).join(", "):null;return{configurationId:n,configurationIds:r}},Ir=()=>{const t="PromoID",e=new URLSearchParams(window.location.search);let n;return Ee(()=>{n=e.get(t)||localStorage.getItem(t)||""}),n&&(e.set(t,n),window.history.replaceState({},"",`?${e.toString()}`),Ee(()=>localStorage.setItem(t,n))),{configurationId:n,configurationIds:null}},Tl=t=>{const e=JSON.parse(t.dataset?.params),{configurationId:n,configurationIds:r}=e.enableDynamicConfigurationIds?Ir():Ya(e.configurationId),{ngpsApiKey:o,ngpsApiUrl:a,envId:i}=e.ngpsApi||{};return{parsedGeneralData:e,promoPlusConfig:{configurationId:n,configurationIds:r,ngpsApiKey:o,ngpsApiUrl:a,promoPlusEnv:i}}},ch=t=>{const e=JSON.parse(t.dataset?.params);e.brandExpressionStyle=Ja(t);const{enableDynamicConfigurationIds:n}=e.dynamicConfigurationIds,{configurationId:r,configurationIds:o}=n?Ir():Ya(e.configurationId),{ngpsApiKey:a,ngpsApiUrl:i,envId:s}=e.ngpsApi||{};return{parsedGeneralData:e,promoPlusConfig:{configurationId:r,configurationIds:o,ngpsApiKey:a,ngpsApiUrl:i,promoPlusEnv:s}}},lh=t=>{const e=JSON.parse(t.dataset?.params);e.brandExpressionStyle=Ja(t);const{enableDynamicConfigurationIds:n}=e.dynamicConfigurationIds,{configurationId:r}=n?Ir():{};return{parsedGeneralData:e,configurationId:r}},Ja=t=>{const e=t?.parentElement?.classList;return e?.contains("color-variants--primary")?"primary":e?.contains("color-variants--secondary")?"secondary":"neutral"},ho="cepPromoViewPushed",Ll=(t,{viewName:e,reportPromoMechanic:n}={})=>{if(t.dataset[ho])return;const{parsedGeneralData:r,promoPlusConfig:o}=Tl(t),a=r.enableDynamicConfigurationIds?o.configurationId:r.configurationId;G.push({event:"promo_view",view_name:e??r.startViewName??"",promo_id:a||"",...n&&{promo_mechanic:r.promotionMechanic||""}}),t.dataset[ho]="true"},yt=(t,e={})=>{t.forEach(n=>{try{Ll(n,e)}catch{console.error(`Unable to push the promo_view event for ${e.viewName||n.id}.`)}})};(()=>{const t=async e=>{const n=e.querySelectorAll("[id^=promoPlusAvailablePrizes]");yt(n,{viewName:"Available Prizes"}),await me(n,async r=>{const{init:o}=await Z(async()=>{const{init:a}=await import("./availablePrizes.js");return{init:a}},__vite__mapDeps([26,3,14,15,27,6,7,28,29,30,31,32,33]),import.meta.url);o(r)})};M.registerComponent({name:"Promo+ Available Prizes",mount:t})})();(()=>{const t=async e=>{const n=e.querySelectorAll("[id^=promoPlusCngPrizeCatalog]");yt(n,{viewName:"C&G - Prize Catalog"}),await We(n,async()=>{await Jt();const{init:o}=await Z(async()=>{const{init:a}=await import("./cngPrizeCatalog.js");return{init:a}},__vite__mapDeps([34,3,14,15,35,27,19,20,36,32,6,7,28,29,37,38,17,18,39,40,41,42,43,44,45,46,47,48,49,50,30,31,51,52,53]),import.meta.url);return{init:o}},async(o,{init:a})=>{a(o)})};M.registerComponent({name:"Promo+ Collect And Get Prize Catalog",mount:t})})();(()=>{const t=async e=>{const n=e.querySelectorAll("[id^=promoPlusDigitalWalletAllBadges]");yt(n,{viewName:"Digital Wallet - All Badges"}),await We(n,async()=>{await Jt();const{init:o}=await Z(async()=>{const{init:a}=await import("./digitalWalletAllBadges.js");return{init:a}},__vite__mapDeps([54,3,14,15,55,56,6,7,28,29,32,57]),import.meta.url);return{init:o}},async(o,{init:a})=>{a(o)})};M.registerComponent({name:"Promo+ Digital Wallet All Badges",mount:t})})();(()=>{const t=async e=>{const n=e.querySelectorAll("[id^=promoPlusDigitalWalletPrizes]");yt(n),await We(n,async()=>{await Jt();const{init:o}=await Z(async()=>{const{init:a}=await import("./digitalWalletPrizes.js");return{init:a}},__vite__mapDeps([58,3,14,15,56,36,32,6,7,28,29,37,19,20,38,17,18,39,40,43,30,31,42,27,44,45,46,47,48,59]),import.meta.url);return{init:o}},async(o,{init:a})=>{a(o)})};M.registerComponent({name:"Promo+ Digital Wallet Prize Catalog",mount:t})})();const kl=t=>t.length?Array.from(t).some(e=>{try{return JSON.parse(e.dataset?.params||"{}").skipLoginRedirect===!0}catch{return!1}}):!0;(()=>{const t=async e=>{const n=e.querySelectorAll("[id^=promoPlusDigitalWalletSummary]");yt(n,{viewName:"Digital Wallet - Summary"}),await We(n,async()=>{kl(n)||await Jt();const{init:o}=await Z(async()=>{const{init:a}=await import("./digitalWalletSummary.js");return{init:a}},__vite__mapDeps([60,3,14,15,55,56,6,7,28,29,61,22,27,43,19,20,32,62]),import.meta.url);return{init:o}},async(o,{init:a})=>{a(o)})};M.registerComponent({name:"Promo+ Digital Wallet Summary",mount:t})})();(()=>{const t=async e=>{const n=e.querySelectorAll("[id^=promoPlusInstantWinNoPin]");await me(n,async r=>{const{init:o}=await Z(async()=>{const{init:a}=await import("./instantWinNoPin.js");return{init:a}},__vite__mapDeps([63,3,14,64,65,17,18,46,32,15,47,66,67,68,69,70,71,72,73,36,6,7,51,38,39,52,43,74,75,76,77]),import.meta.url);o(r)})};M.registerComponent({name:"Promo+ Instant Win No Pin",mount:t})})();(()=>{const t=async e=>{const n=e.querySelectorAll("[id^=promoPlusInstantWinPin]");await me(n,async r=>{const{init:o}=await Z(async()=>{const{init:a}=await import("./instantWinPin.js");return{init:a}},__vite__mapDeps([78,3,14,46,32,15,47,64,65,17,18,66,67,68,69,70,71,72,73,36,6,7,51,38,39,52,43,74,75,76,77]),import.meta.url);o(r)})};M.registerComponent({name:"Promo+ Instant Win Pin",mount:t})})();(()=>{const t=async e=>{const n=e.querySelectorAll("[id^=promoPlusInstantWinPrizeCatalog]");yt(n,{viewName:"Instant Win - Prize Catalog"}),await We(n,async()=>{await Jt();const{init:o}=await Z(async()=>{const{init:a}=await import("./instantWinPrizeCatalog.js");return{init:a}},__vite__mapDeps([79,3,14,15,35,27,19,20,36,32,6,7,28,29,37,38,17,18,39,40,41,30,31,80]),import.meta.url);return{init:o}},async(o,{init:a})=>{a(o)})};M.registerComponent({name:"Promo+ Instant Win Prize Catalog",mount:t})})();const Qa=async()=>
14{if(window.workerInitialized)v.log("Service Worker already initialized");else if(window.workerInitialized=!0,"serviceWorker"in navigator)try{const t=`${la()}/resources/serviceWorker.js`;await Rl(t)}catch(t){v.log("Failed to init Service worker",t)}else v.log("Missing Service Worker support in the browser. ")},Rl=async t=>{await navigator.serviceWorker.register(t,{scope:"/"}),v.log("Service Worker registered")};(()=>{const t=async e=>{const n=e.querySelectorAll("[id^=ngpsApp]");yt(e.querySelectorAll("[id^=ngpsApp][data-promo-view]"),{reportPromoMechanic:!0});let r=!0;const o=i=>{const{searchParams:s}=new URL(window.location.href),c=s.has("PromoID")||localStorage.getItem("PromoID"),{enableDynamicConfigurationIds:l}=JSON.parse(i?.dataset?.params);c&&l&&r&&(i.scrollIntoView({behavior:"smooth"}),r=!1)};await We(n,async()=>{await Qa();const{init:i}=await Z(async()=>{const{init:s}=await import("./ngps.js");return{init:s}},__vite__mapDeps([81,3,14,44,42,15,27,43,45,46,32,47,48,66,67,72,68,69,73,49,17,18,50,82,6,7,28,29,36,61,22,19,20,38,39,16,21,83]),import.meta.url);return{init:i}},async(i,{init:s})=>{o(i),s(i)})};M.registerComponent({name:"Ngps",mount:t})})();(()=>{const t=async e=>{const n=e.querySelectorAll("[id^=promoPlusPrizeDrawNoPin]");await me(n,async r=>{const{init:o}=await Z(async()=>{const{init:a}=await import("./prizeDrawNoPin.js");return{init:a}},__vite__mapDeps([84,3,14,85,65,17,18,46,32,15,47,66,67,68,69,70,86,82,87,6,7,88,51,38,39,52,89,75,76,77]),import.meta.url);o(r)})};M.registerComponent({name:"Promo+ Prize Draw No Pin",mount:t})})();(()=>{const t=async e=>{const n=e.querySelectorAll("[id^=promoPlusPrizeDrawPin]");await me(n,async r=>{const{init:o}=await Z(async()=>{const{init:a}=await import("./prizeDrawPin.js");return{init:a}},__vite__mapDeps([90,3,14,46,32,15,47,85,65,17,18,66,67,68,69,70,86,82,87,6,7,88,51,38,39,52,89,75,76,77]),import.meta.url);o(r)})};M.registerComponent({name:"Promo+ Prize Draw Pin",mount:t})})();(()=>{const t=async e=>{const n=e.querySelectorAll("[id^=promoPlusQuizInstantWinNoPin-id]");await me(n,async r=>{const{init:o}=await Z(async()=>{const{init:a}=await import("./quizInstantWinNoPin.js");return{init:a}},__vite__mapDeps([91,3,14,92,65,17,18,46,32,15,47,66,67,68,69,70,93,45,94,72,73,71,36,6,7,51,38,39,52,43,74,87,88,76,77]),import.meta.url);o(r)})};M.registerComponent({name:"Promo+ Quiz Instant Win No Pin",mount:t})})();(()=>{const t=async e=>{const n=e.querySelectorAll("[id^=promoPlusQuizInstantWin-id]");await me(n,async r=>{const{init:o}=await Z(async()=>{const{init:a}=await import("./quizInstantWinPin.js");return{init:a}},__vite__mapDeps([95,3,14,46,32,15,47,92,65,17,18,66,67,68,69,70,93,45,94,72,73,71,36,6,7,51,38,39,52,43,74,87,88,76,77]),import.meta.url);o(r)})};M.registerComponent({name:"Promo+ Quiz Instant Win Pin",mount:t})})();(()=>{const t=async e=>{const n=e.querySelectorAll("[id^=promoPlusQuizPrizeDrawNoPin-id]");await me(n,async r=>{const{init:o}=await Z(async()=>{const{init:a}=await import("./quizPrizeDrawNoPin.js");return{init:a}},__vite__mapDeps([96,3,14,97,65,17,18,46,32,15,47,66,67,68,69,70,93,45,94,82,87,6,7,88,86,51,38,39,52,89,76,77]),import.meta.url);o(r)})};M.registerComponent({name:"Promo+ Quiz Prize Draw No Pin",mount:t})})();(()=>{const t=async e=>{const n=e.querySelectorAll("[id^=promoPlusQuizPrizeDraw-id]");await me(n,async r=>{const{init:o}=await Z(async()=>{const{init:a}=await import("./quizPrizeDrawPin.js");return{init:a}},__vite__mapDeps([98,3,14,46,32,15,47,97,65,17,18,66,67,68,69,70,93,45,94,82,87,6,7,88,86,51,38,39,52,89,76,77]),import.meta.url);o(r)})};M.registerComponent({name:"Promo+ Quiz Prize Draw Pin",mount:t})})();(()=>{const t="#pushNotificationSubscription",e=()=>{const o="standalone"in navigator&&window.matchMedia("(display-mode: standalone)").matches,a=gt(er);return o&&a?(mn(er),window.location.href=a,!0):!1},r={name:"Push Notifications",mount:async o=>{if(!wr()){v.log("Push notifications has not been enabled");return}if(e()){v.log("Redirecting on PWA MacOS to given page");return}Rc();const i=o.querySelectorAll(`a[href*="${t}"]`);Y(i,s=>{s.addEventListener("click",mt(Sr(s)))})}};M.registerComponent(r)})();(()=>{const t="#pushNotificationsPrompt",e={modalSubscribeBtn:"cep-modal-dialog__subscribe"},n=()=>async()=>{const i=lt(va).querySelector(`.${e.modalSubscribeBtn}`);i?.addEventListener("click",mt(Sr(i)))},o={name:"Push Notifications Prompt",mount:async a=>{if(!In()){v.log("Push notifications prompt has not been enabled");return}const s=a.querySelectorAll(`a[href*="${t}"]`);Y(s,c=>{c.addEventListener("click",mt(n()))})}};M.registerComponent(o)})();const Dl=async()=>
14{if(await(await J()).isAuthenticated()){const n=Te();if(!n?.cdsGamUrl)return console.warn("GAM URL configuration is missing"),null;const o=await new je(n.cdsGamUrl).getProfile();if(!je.isErrorResponse(o))return{...o,postalCd:o.zipcode}}return null},dh=async t=>{const e=Te();if(!e?.cdsGamUrl)return Promise.reject("GAM URL configuration is missing");const r=await new je(e.cdsGamUrl).updateProfile({...t,applicationId:e.clientId});return je.isErrorResponse(r)?Promise.reject(r):r};(()=>{const e=["notifyMe","dataCollection","survey"].map(r=>`[id^=${r}][data-parameters]`).join(", "),n=async r=>{const o=Array.from(r.querySelectorAll(e));await We(o,async()=>{const i=await Dl(),{init:s}=await Z(async()=>{const{init:c}=await import("./notifyMe.js");return{init:c}},__vite__mapDeps([99,3,100]),import.meta.url);return{init:s,profileData:i}},async(i,{init:s,profileData:c})=>{await s(i,c)})};M.registerComponent({name:"Notify Me",mount:n})})();const Ol="#js-open-onetrust-preference-center",Nl=`a[href="${Ol}"]`;(()=>{const e={name:"Onetrust",mount:async n=>{const r=n.ownerDocument;window.addEventListener("keydown",a=>{a.key==="Escape"&&r.documentElement.classList.remove("ot-modal-open")});const o=n.querySelectorAll(Nl);Y(o,a=>{a?.addEventListener("click",()=>{window.modalController.currentModal?.closeFn(),window.Optanon.ToggleInfoDisplay();const i=r.getElementById("accept-recommended-btn-handler");r.getElementsByClassName("ot-btn-container")[0].prepend(i),r.documentElement.classList.add("ot-modal-open");const s=["#close-pc-btn-handler","#accept-recommended-btn-handler",".save-preference-btn-handler",".ot-pc-refuse-all-handler"];r.querySelector("#onetrust-pc-sdk").addEventListener("click",c=>{const l=c;l.modalClicked=!0}),r.querySelector(".onetrust-pc-dark-filter").addEventListener("click",c=>{c.modalClicked||(window.Optanon.Close(),r.documentElement.classList.remove("ot-modal-open"))}),[...r.querySelectorAll(s.join(","))].forEach(c=>{c.addEventListener("click",()=>{r.documentElement.classList.remove("ot-modal-open")})})})})}};M.registerComponent(e)})();class xl{init(){}canDrawNextFrame(){return!0}remove(){}}class $l{previousWindowSize={width:void 0,height:void 0};currentWindowSize={width:void 0,height:void 0};windowSizeFn=this.getWindowSize.bind(this);init(){window.addEventListener("resize",this.windowSizeFn)}canDrawNextFrame(){const e=this.previousWindowSize.width!==this.currentWindowSize.width||this.previousWindowSize.height!==this.currentWindowSize.height;return this.previousWindowSize=this.currentWindowSize,e}remove(){window.removeEventListener("resize",this.windowSizeFn)}getWindowSize(){this.currentWindowSize={width:window.innerWidth,height:window.innerHeight}}}class Ml{scrollPositionLast;scrollPositionCurrent;scrollPositionFn=this.getVerticalScrollPosition.bind(this);init(){window.addEventListener("scroll",this.scrollPositionFn)}canDrawNextFrame(){const e=this.scrollPositionLast!==this.scrollPositionCurrent;return this.scrollPositionLast=this.scrollPositionCurrent,e}remove(){window.removeEventListener("scroll",this.scrollPositionFn)}getVerticalScrollPosition(){this.scrollPositionCurrent=window.scrollY}}class Ul{limitationArray=[];constructor(e=[]){e.forEach(n=>{this.limitationArray.push(this.selectLimitation(n))}),this.limitationArray.length===0&&this.limitationArray.push(new xl)}init(){this.limitationArray.forEach(e=>{e.init()})}canDrawNextFrame(){return this.limitationArray.some(e=>e.canDrawNextFrame())}remove(){this.limitationArray.forEach(e=>{e.remove()})}selectLimitation(e){switch(e){case"scroll":return new Ml;case"resize":return new $l}}}class Bl{observer;animationLoop;animationFrame;limitation;element;initFrame;constructor(e,n,r=[],o={initFrame:!0,useIntersectionObserver:!0}){this.animationFrame=n,this.limitation=new Ul(r),this.initFrame=o.initFrame,this.element=e,o.useIntersectionObserver?(this.observer=new IntersectionObserver(this.handleIntersectEvent.bind(this)),this.observer.observe(this.element)):this.init()}init(){this.limitation.init(),this.animationLoop=ql(()=>{(this.limitation.canDrawNextFrame()||this.initFrame)&&(this.initFrame=!1,this.animationFrame())})}handleIntersectEvent(e){e[0].isIntersecting?(this.initFrame=!0,this.init()):(this.animationLoop?.destroy(),this.limitation.remove())}}const ql=t=>{let e=!0;const n=()=>{e=!1},r=()=>{t(),e&&requestAnimationFrame(()=>{r()})};return r(),{destroy:n}},Fl=8;function It(t=1){return Fl*t}const Wl={parallax:"parallax"},zl=It(16),Hl=It(32);(()=>{const e={name:"Parallax",mount:async n=>{const r=Xt(),o=n.querySelectorAll(`.${Wl.parallax}`);Y(o,a=>{const i=a.querySelector(".cmp-container > .hero"),s=a.querySelector(".cmp-container > picture");new Bl(a,()=>{const{top:c,height:l}=a.getBoundingClientRect(),d=Math.max(0,Math.min(-c/l,1));if(i){const p=Be()?It(36):It(35.5);i.style.translate=`0 ${d*p}px`}if(s){const p=Be()?It(-9)-zl:It(-1.5)-Hl;s.style.translate=`0 ${d*p}px`}},r?[]:["scroll"],{useIntersectionObserver:!r})})}};M.registerComponent(e)})();(()=>{const t={component:".container--app-pincode-redemption",pinContent:".copy-code-field__content",copyIconButton:".copy-code-field__copy-button",tooltip:".copy-code-field__tooltip",tooltipActive:"copy-code-field__tooltip--active"},n={name:"Pincode Redemption",mount:async r=>{const o=new URLSearchParams(window.location.search).get("pincode"),a=r.querySelectorAll(t.component);Y(a,i=>{const s=i.querySelector("button.cmp-button"),c=i.querySelector(t.copyIconButton);if(!o)c.disabled=!0,s&&(s.disabled=!0);else{const l=i.querySelector(t.pinContent);l.textContent=o;const d=i.querySelector(t.tooltip),p=()=>{navigator.clipboard.writeText(o),d.classList.add(t.tooltipActive),setTimeout(()=>{d.classList.remove(t.tooltipActive)},1500)};c.addEventListener("click",p),s&&s.addEventListener("click",p)}})}};M.registerComponent(n)})();(()=>{const t=async e=>{const n=e.querySelectorAll("[id^=progressiveProfileQuestion]");await me(n,async r=>{const{init:o}=await Z(async()=>{const{init:a}=await import("./progressiveProfileQuestion.js");return{init:a}},__vite__mapDeps([101,3,14,4,5,47,76,17,18,68,69,77,102,103]),import.meta.url);o(r)})};M.registerComponent({name:"Progressive Profile Question",mount:t})})();(()=>{const t={mobileSearch:"header__mobile-search",searchInput:"mobile-search__input",searchForm:"mobile-search__form"},n={name:"Mobile Search",mount:async r=>{const o=r.querySelector(`.${t.mobileSearch}`),a=o?.querySelector(`.${t.searchForm}`),i=o?.querySelector(`.${t.searchInput}`);se(o,()=>{o&&a.addEventListener("submit",s=>{s.preventDefault();const c=a.getAttribute("action"),l=i.value;sessionStorage.query=l,l!=""&&(location.href=c)})})}};M.registerComponent(n)})();(()=>{const t=async e=>{const n=e.querySelector("#searchResult");Dt(n,async r=>{const{init:o}=await Z(async()=>{const{init:a}=await import("./search.js");return{init:a}},__vite__mapDeps([104,3,14,44,105]),import.meta.url);o(r)})};M.registerComponent({name:"Search",mount:t})})();(()=>{const t={searchButton:"header__search-button button",closeSearchButton:"search-panel__close-button",searchInput:"search-panel__input",searchBox:"searchBox",searchPanel:"search-panel",searchBoxOpen:"searchBox--open",scrollLock:"scroll-lock",form:"search-panel__input-wrapper"};class e{searchButton;closeSearchButton;searchBox;searchPanelFocusTrap;searchPanel;searchForm;searchInput;boundOnClickOutside;modalId;isOpen;constructor(a,i){this.searchButton=a,this.searchBox=i,this.searchPanel=this.searchBox.querySelector(`.${t.searchPanel}`),this.closeSearchButton=this.searchPanel.querySelector(`.${t.closeSearchButton}`),this.searchForm=this.searchPanel.querySelector(`.${t.form}`),this.searchInput=this.searchForm.querySelector(`.${t.searchInput}`),this.searchPanelFocusTrap=null,this.modalId=null,this.isOpen=!1,this.boundOnClickOutside=this.onClickOutside.bind(this),this.init()}onClickOutside(a){this.searchBox.className.includes(t.searchBoxOpen)&&!a.target.className.includes(t.searchPanel)&&window.modalController.requestClose(this.modalId)}openModal(){this.isOpen=!0,this.searchBox.classList.add(t.searchBoxOpen),document.body.classList.add(t.scrollLock),this.searchPanelFocusTrap=Qt(this.searchPanel,{allowOutsideClick:!0,clickOutsideDeactivates:!1,escapeDeactivates:!1,returnFocusOnDeactivate:!1,fallbackFocus:this.searchPanel}),this.searchPanelFocusTrap.activate(),window.addEventListener("click",this.boundOnClickOutside),this.searchInput.focus()}closeModal(){this.modalId=null,this.isOpen=!1,this.searchBox.classList.remove(t.searchBoxOpen),document.body.classList.remove(t.scrollLock),this.searchPanelFocusTrap?.active&&this.searchPanelFocusTrap.deactivate({returnFocus:!1}),this.searchPanelFocusTrap=null,window.removeEventListener("click",this.boundOnClickOutside),this.searchButton.focus()}searchButtonClickHandler(){if(this.isOpen){window.modalController.requestClose(this.modalId);return}const{id:a}=window.modalController.requestOpen({name:"search",priority:"manual",openFn:this.openModal.bind(this),closeFn:this.closeModal.bind(this)});this.modalId=a}init(){this.searchButton.addEventListener("click",i=>{i.stopPropagation(),this.searchButtonClickHandler()}),this.closeSearchButton.addEventListener("click",()=>{this.isOpen&&window.modalController.requestClose(this.modalId)}),this.searchForm.addEventListener("submit",i=>{i.preventDefault();const s=this.searchForm.getAttribute("action"),c=this.searchInput.value;sessionStorage.query=c,c!=""&&(location.href=s)});const a=en(()=>{!Be()&&this.isOpen&&window.modalController.requestClose(this.modalId)},200);window.addEventListener("resize",()=>a())}}const r={name:"SearchBox",mount:async o=>{const a=o.querySelector(`.${t.searchButton}`);se(a,()=>{const i=o.querySelector(`.${t.searchBox}`);!a||!i||new e(a,i)})}};M.registerComponent(r)})();(()=>{const t={active:"active",secondaryNavigation:"secondary-navigation"},e=o=>{const a=o.querySelectorAll("a"),{pathname:i}=window.location;let s=!1;a.forEach(c=>{if(s)return;const{pathname:l}=new URL(c.href),d=i.replaceAll(".html","").endsWith(l.replaceAll(".html",""));s=d,d&&(c.classList.add(t.active),setTimeout(()=>{c.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},100))})},r={name:"Secondary Navigation",mount:async o=>{const a=o.querySelectorAll(`.${t.secondaryNavigation}`);
14Y(a,i=>{const s=i.querySelector("ul");s&&e(s)})}};M.registerComponent(r)})();(()=>{const t={widgetConfig:"#side-widget-config"},e=async(o,a,i,s)=>{const c=await J(),l=c.isLoginAvailable(),d=await c.isAuthenticated();if(!l||d)return;const p=document.createElement("div");p.className="side-widget";const u=document.createElement("div");u.className="side-widget__invoker",u.addEventListener("click",()=>{p.classList.add("side-widget__expanded")});const g=document.createElement("div");g.className="side-widget__modal",p.appendChild(u),p.appendChild(g),document.body.appendChild(p);const f=document.createElement("button");f.className="side-widget__close-button",g.appendChild(f),f.setAttribute("aria-label",o);const y=document.createElement("div");y.className="side-widget__modal-text",g.appendChild(y),y.innerText=s;const S=document.createElement("button");S.className="side-widget__modal-button button-secondary",g.appendChild(S),S.innerText=a;const k=document.createElement("button");k.className="side-widget__modal-button button-primary",g.appendChild(k),k.innerText=i,f.addEventListener("click",()=>{p.classList.remove("side-widget__expanded")}),S.addEventListener("click",()=>{c.signIn()}),k.addEventListener("click",()=>{c.signUp()})},r={name:"Side Widget",mount:async o=>{se(o.querySelector(t.widgetConfig),a=>{const{closeButtonAriaLabel:i,isEnabled:s,loginButtonLabel:c,signUpButtonLabel:l,widgetText:d,mode:p}=a.dataset;s===void 0||document.querySelector(".xtnd-app--full-screen")||p==="loginSignup"&&e(i,c,l,d)})}};M.registerComponent(r)})();(()=>{const t={loginButton:[".header__log-in-button",".loginButton__log-in-button",'.cmp-text a[href="#login"]','.cmp-teaser a[href="#login"]'].join(", "),signUpButton:[".header__sign-up-button",".loginButton__sign-up-button",".header__top-sign-up-button button",'.cmp-text a[href="#signUp"]','.cmp-teaser a[href="#signUp"]'].join(", ")},e=async n=>{const r=await J(),o=n.querySelectorAll(t.loginButton);Y(o,i=>{i.addEventListener("click",function(s){s.preventDefault(),mt(r.signIn).call(this)})});const a=n.querySelectorAll(t.signUpButton);Y(a,i=>{i.addEventListener("click",function(s){s.preventDefault(),mt(r.signUp).call(this)})}),window.addEventListener("beforeunload",()=>{n.querySelectorAll(".loading").forEach(i=>{i.classList.remove("loading"),i.removeAttribute("disabled")})})};M.registerComponent({name:"Single SDK",mount:e})})();const te={countrySelector:"country-selector",tabList:".cmp-tabs__tablist",activeTab:"cmp-tabs__tab--active",activeTabpanel:"cmp-tabs__tabpanel--active",tabpanelButton:"tabpanel-button",tab:"cmp-tabs__tab",tabpanel:"cmp-tabs__tabpanel",activeLink:"country-selector__link--active",currentTitle:"coutry-selector__title--current"},ln={CONTROLS:"aria-controls",LABEL:"aria-labelledby"};(()=>{const t=(r,o)=>{const a=o.ownerDocument,i=r.querySelector(te.tabList),s=i.querySelectorAll(`.${te.tab}`),c=o.querySelectorAll(`.${te.tabpanel}`),l=g=>`#${g}, #${g.replace("-tabpanel","")}`,d=g=>{const f=g.target,y=i.querySelector(`.${te.activeTab}`),S=r.querySelector(`.${te.activeTabpanel}`),k=f.parentElement.classList.contains(te.activeTabpanel);if(f!==y){f.classList.contains(te.tab)&&(f.classList.add(te.activeTab),y.classList.remove(te.activeTab),S.classList.remove(te.activeTabpanel));const b=f.getAttribute(ln.CONTROLS);r.querySelector(l(b)).classList.add(te.activeTabpanel)}k&&f.parentElement.classList.remove(te.activeTabpanel)};s.forEach(g=>{const f=o.ownerDocument.createElement("button"),y=g.getAttribute(ln.CONTROLS),S=o.querySelector(l(y));f.classList.add(te.tabpanelButton),f.setAttribute(ln.CONTROLS,y),f.innerText=g.innerText,S.prepend(f),f.addEventListener("click",d),g.addEventListener("click",d)});const p=gt(jt.location),u=g=>{let f;return g.forEach(y=>{const S=y.getAttribute("href");sa.test(p)&&S.includes(p)&&(y.classList.add(te.activeLink),f=y)}),f};c.forEach(g=>{const f=g.getAttribute(ln.LABEL),y=g.querySelectorAll(".cmp-text a"),S=u(y);if(S){if(!a.querySelector(`.${te.currentTitle}`)){const L=a.createElement("div");L.classList.add(te.currentTitle),L.innerText=S.innerText,r.prepend(L)}const b=i.querySelector(`.${te.activeTab}`),C=r.querySelector(`.${te.activeTabpanel}`),T=a.querySelector(`#${f}`);b.classList.remove(te.activeTab),C.classList.remove(te.activeTabpanel),g.classList.add(te.activeTabpanel),T.classList.add(te.activeTab)}})},n={name:"Tabs (Country Selector)",mount:async r=>{const o=r.querySelector(`.${te.countrySelector}`);se(o,a=>t(a,r))}};M.registerComponent(n)})();(()=>{const t=()=>{const r=gt(jt.location),a=window.location.pathname.match(sa)?.[0];a&&r!=a&&Ln(jt.location,a)},n={name:"Tabs",mount:async()=>{const r=ft("tabs-location-cookie");se(r,t)}};M.registerComponent(n)})();const Oe={timeline:"timeline",timelineReady:"timeline--ready",timelineEmpty:"timeline--empty",innerWrapper:"cmp-tabs",arrowsWrapper:"cmp-tabs__navigation-arrows",arrow:"cmp-tabs__navigation-arrow",arrowPrev:"cmp-tabs__navigation-arrow--prev",arrowNext:"cmp-tabs__navigation-arrow--next",tablist:"cmp-tabs__tablist",activeTab:"cmp-tabs__tab--active"};class Vl{timeline;innerWrapper;tablist;tabs;currentActiveIndex;arrowsWrapper;arrowPrev;arrowNext;shouldCreateNavigation;TRANSLATION_FACTOR=96;constructor(e){this.timeline=e,this.innerWrapper=this.timeline.querySelector(`.${Oe.innerWrapper}`),this.tablist=this.timeline.querySelector(`.${Oe.tablist}`),this.tablist?(this.tabs=[...this.tablist.children],this.shouldCreateNavigation=this.tabs.length>=2,this.init(e.ownerDocument)):(console.warn(`Timeline Tabs component (id=${this.innerWrapper.id}) is empty!`),this.timeline.classList.add(Oe.timelineEmpty))}init(e){this.attachEvents(e)}getCurrentActiveIndex(){const e=this.tabs.findIndex(n=>n.classList.contains(Oe.activeTab));return e>-1?e:0}updateCurrentActiveIndex(){this.currentActiveIndex=this.getCurrentActiveIndex()}translateElement(e,n,r){let o;
14r?o=tr()?1:-1:o=tr()?-1:1,e.style.translate=`${n*this.TRANSLATION_FACTOR*o}px`}moveToCurrentActiveTab(e){this.translateElement(this.tablist,e,!0)}updateButtonsState(){this.shouldCreateNavigation&&(this.currentActiveIndex===0?(this.arrowPrev.disabled=!0,this.arrowNext.disabled=!1):this.currentActiveIndex===this.tabs.length-1?(this.arrowPrev.disabled=!1,this.arrowNext.disabled=!0):(this.arrowPrev.disabled=!1,this.arrowNext.disabled=!1))}adjustCurrentPosition(){this.updateCurrentActiveIndex(),this.moveToCurrentActiveTab(this.currentActiveIndex),this.updateButtonsState()}handleNavigationArrowClick(e){if(this.updateCurrentActiveIndex(),e==="prev"){const n=this.currentActiveIndex-1;this.tabs[n].click()}else{const n=this.currentActiveIndex+1;this.tabs[n].click()}this.updateCurrentActiveIndex(),this.updateButtonsState()}createNavigationArrow(e,n){const r=e.createElement("button"),o=Fe(`${n}Label`);return r.ariaLabel=o,n==="prev"?r.classList.add(Oe.arrow,Oe.arrowPrev):r.classList.add(Oe.arrow,Oe.arrowNext),r.addEventListener("click",()=>{this.handleNavigationArrowClick(n)}),r.tabIndex=-1,this.arrowsWrapper.appendChild(r),r}initNavigationArrows(e){this.shouldCreateNavigation&&(this.arrowsWrapper=e.createElement("div"),this.arrowsWrapper.classList.add(Oe.arrowsWrapper),this.arrowPrev=this.createNavigationArrow(e,"prev"),this.arrowNext=this.createNavigationArrow(e,"next"),this.innerWrapper.prepend(this.arrowsWrapper))}
14attachEvents(e){this.initNavigationArrows(e),this.tabs.forEach((n,r)=>{this.translateElement(n,r,!1)}),this.tablist.addEventListener("click",this.adjustCurrentPosition.bind(this)),this.tablist.addEventListener("keydown",this.adjustCurrentPosition.bind(this)),this.adjustCurrentPosition(),this.timeline.classList.add(Oe.timelineReady)}}(()=>{const e={name:"Timeline",mount:async n=>{const r=n.querySelectorAll(`.${Oe.timeline}`);Y(r,o=>new Vl(o))}};M.registerComponent(e)})();const Gl=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"],fe={tab:"cmp-tabs__tab",tabList:"cmp-tabs__tablist",cmpTabs:"cmp-tabs",activeTab:"cmp-tabs__tab--active",tabEntry:"cmp-tabs__tabpanel",dropdownSelector:"dropdown-selector",expanded:"expanded",singleTab:"single-tab",selectorText:"text",selectorIcon:"icon"},jl=["faq","media-center"],Kl=(t,e)=>{let n=-1;return t.forEach((r,o)=>{r.classList.contains(e)&&(n=o)}),n},go=t=>{t.forEach((e,n)=>{n===0?e.ariaHidden="true":e.removeAttribute("aria-hidden"),e.removeAttribute("tabindex")})};(()=>{const t=(r,o,a)=>{const i=o.querySelector(`.${fe.tabList}`);if(!i)return;const s=`tab-filter-${a}`;i.id=s;const c=i.querySelectorAll(`.${fe.tab}`),l=Kl(c,fe.activeTab),d=r.querySelectorAll(`.${fe.tabEntry}`),p=jl.some(S=>o.classList.contains(S)),g=(()=>{const S=r.createElement("button");S.className=fe.dropdownSelector,S.setAttribute("aria-controls",s),S.ariaExpanded="false",S.addEventListener("click",()=>{S.classList.toggle(fe.expanded),S.ariaExpanded=S.ariaExpanded==="true"?"false":"true"});const k=r.createElement("div"),b=r.createElement("div");return k.className=fe.selectorIcon,b.className=fe.selectorText,b.innerText=c[l].innerText,S.appendChild(b),S.appendChild(k),o.querySelector(`.${fe.cmpTabs}`).prepend(S),o.classList.toggle(fe.singleTab,l>0),p&&go(d),{setValue:C=>{b.innerText=C},close:()=>{S.classList.remove(fe.expanded),S.ariaExpanded="false"},ddSelector:S}})(),f=S=>k=>{const b=k.target;o.classList.toggle(fe.singleTab,S>0),g.setValue(b.innerText),g.ddSelector.focus(),g.close(),p&&S===0&&go(d)},y=S=>{const k=i.querySelector(`.${fe.activeTab}`);Gl.indexOf(S.key)>=0?(g.setValue(k.innerText),o.classList.toggle(fe.singleTab,!c[0].classList.contains(fe.activeTab))):S.key==="Tab"&&g.close()};c.forEach((S,k)=>{S.addEventListener("click",f(k)),S.addEventListener("keydown",y)})},n={name:"Tabs with Filtering",mount:async r=>{r.querySelectorAll(".tabs.faq, .tabs.brands-list, .tabs.media-center, .tabs.media-tiles").forEach((a,i)=>{se(a,()=>t(r.ownerDocument,a,i))})}};M.registerComponent(n)})();(()=>{const t={listItem:"list-item",teaserDescription:"cmp-teaser__description"},e={labels:null},r={name:"List Item",mount:async o=>{const a=o.querySelector("#labels"),i=a?JSON.parse(a.getAttribute("data-labels")):{},s=o.querySelectorAll(`.${t.listItem} .${t.teaserDescription}`);Object.keys(i).length>0&&(e.labels=i),Y(s,c=>new Pr(c,e))}};M.registerComponent(r)})();(()=>{const t={teaser:"content-card--plus",additionalContent:"cmp-teaser__additional-content",active:"active",visible:"visible",button:"cmp-teaser__additional-content-button",link:"cmp-teaser__action-link"},n={name:"Teaser Plus",mount:async r=>{const o=r.querySelectorAll(`.${t.teaser}`);Y(o,a=>{const i=a.querySelector("a");if(!i)return;const s=a.querySelector(`.${t.link}`),c=a.querySelector(`.${t.additionalContent}`),l=a.querySelector(`.${t.button}`);s.innerHTML="";const d=JSON.parse(c.getAttribute("data-params"));if(i.ariaLabel=d.expandButtonLabel,i.addEventListener("click",p=>{p.preventDefault(),c.classList.add(t.active,t.visible),i.tabIndex=-1,l.tabIndex=0,l.focus({preventScroll:!0})}),l.addEventListener("click",p=>{p.stopPropagation(),c.classList.remove(t.active),i.tabIndex=0,l.tabIndex=-1,i.focus(),setTimeout(()=>{c.classList.remove(t.visible)},500)}),!a.closest(".cmp-carousel__item")){const p=a.querySelector(".cmp-teaser");p.ariaLive="polite"}})}};M.registerComponent(n)})();(()=>{const e={name:"Popup Card",mount:async n=>{const r=n.querySelectorAll(".popup-card .cmp-teaser__action-link");Y(r,o=>{o.textContent=null,o.ariaLabel=Fe("showModal")})}};M.registerComponent(e)})();(()=>{const t={teaser:"teaser",contentCardPlus:"content-card--plus",contentCard:"content-card",teaserLink:"cmp-teaser__action-link",actionContainer:"cmp-teaser__action-container"},e=o=>{const a=o.querySelector(`a.${t.teaserLink}`);if(a){const i=document.createElement("p");i.className=a.className,i.innerHTML=a.innerHTML,a.classList.remove(t.teaserLink),o.appendChild(a);const s=o.querySelector(".cmp-teaser");a.replaceChildren(s),o.querySelector(`.${t.actionContainer}`).appendChild(i)}},r={name:"Teaser",mount:async o=>{if(!ie){const a=o.querySelectorAll(`.${t.teaser}.${t.contentCard}
14:not(.${t.contentCardPlus})`);Y(a,i=>e(i))}}};M.registerComponent(r)})();const Yl=300,Xa=t=>{for(const e of t.attributes)t.removeAttribute(e.name)},Za=(t,e,n)=>{for(const r of t.querySelectorAll("table")){Xa(r);const o={table:r,transposedTable:void 0,currentLayout:void 0,previousLayout:void 0};ti(o,n),e.push(o)}},ei=(t,e)=>{const n=en(()=>{t.forEach(r=>{r.currentLayout=ni(window,r),ti(r,e)})},Yl);window.addEventListener("resize",n)},ti=(t,e)=>{t.currentLayout||(t.currentLayout=ni(window,t)),!t.transposedTable&&t.currentLayout==="TRANSPOSED"&&(t.transposedTable=e(t.table)),t.currentLayout==="TRANSPOSED"&&t.previousLayout!=="TRANSPOSED"&&t.table.replaceWith(t.transposedTable),t.currentLayout==="REGULAR"&&t.previousLayout==="TRANSPOSED"&&t.transposedTable.replaceWith(t.table),t.previousLayout=t.currentLayout},ni=(t,e)=>t.innerWidth<xe.TABLET||Jl(e)?"TRANSPOSED":"REGULAR",Jl=t=>t.table.parentNode?t.table.getBoundingClientRect().width>t.table.parentElement.getBoundingClientRect().width:t.transposedTable.getBoundingClientRect().width>t.transposedTable.parentElement.getBoundingClientRect().width;function oe(t,e=void 0,n=void 0){const r=document.createElement("div");return r.classList.add(t),e&&r.setAttribute("role",e),n&&(r.textContent=n),r}const ri=t=>{for(const e of t.cells)if(e.tagName==="TH")return!0;return!1};(()=>{const e={name:"Horizontally Scrollable Table",mount:async n=>{const r=n.querySelectorAll(".text.horizontally-scrollable-table");Y(r,o=>{o.querySelectorAll("table").forEach(a=>{if(!a.parentElement.classList.contains("table-wrapper")){const i=oe("table-wrapper","none");a.parentElement.insertBefore(i,a),i.appendChild(a),a.tabIndex=0,Xa(a),Ql(a)}})})}};M.registerComponent(e)})();const Ql=t=>{t.querySelectorAll("td, th").forEach(e=>{const n=e.getAttribute("width");e.hasAttribute("width")&&!n?.includes("%")&&(e.hasAttribute("style")?e.setAttribute("style",`${e.getAttribute("style")} min-width:${n}px;`):e.setAttribute("style",`min-width:${n}px`),e.removeAttribute("width"))})};(()=>{const t=[],n={name:"Transposed Table with ID",mount:async r=>{const o=r.querySelectorAll(".text.transposed-table__with-id");Y(o,a=>{Za(a,t,fo)}),ei(t,fo)}};M.registerComponent(n)})();const fo=t=>{const e=oe("transposed-table-container","table");return Xl(t).rows.forEach((n,r)=>{const o=oe("row-container","rowgroup"),a=oe("id-box","row"),i=oe("id-cell","cell",`${r+1}`);a.appendChild(i),o.appendChild(a);const s=oe("row-body","none");o.appendChild(s),n.cells.forEach(c=>{const l=oe("row","row"),d=oe("header","rowheader",c.header),p=oe("value","cell",c.value);l.appendChild(d),l.appendChild(p),s.appendChild(l)}),e.appendChild(o)}),e},Xl=t=>{const e={headers:[],rows:[]};for(const n of t.rows)if(ri(n))for(const r of n.cells)e.headers.push(r.textContent);else{const r={cells:[]};for(const o of n.cells)if(o.cellIndex>0){const a={header:e.headers[o.cellIndex],value:o.textContent};r.cells.push(a)}e.rows.push(r)}return e};(()=>{const t=[],n={name:"Transposed Table with sections",mount:async r=>{const o=r.querySelectorAll(".text.transposed-table__with-sections");Y(o,a=>{Za(a,t,yo)}),ei(t,yo)}};M.registerComponent(n)})();const yo=t=>{const e=oe("transposed-table-container");return Zl(t).sections.forEach(r=>{const o=oe("section-container","table");if(o.setAttribute("aria-describedby","section_header"),r.header){const a=oe("section-row-group","rowgroup"),i=oe("section-row","row");a.appendChild(i);const s=oe("section-header","cell",r.header);s.id="section_header",i.appendChild(s),o.appendChild(a)}r.rows.forEach(a=>{const i=oe("cells-container","none");o.appendChild(i);const s=oe("row-group","rowgroup");i.appendChild(s),a.cells.forEach(c=>{const l=oe("row","row");c.header&&l.appendChild(oe("header","rowheader",c.header)),l.appendChild(oe("value","cell",c.value)),s.appendChild(l)})}),e.appendChild(o)}),e},Zl=t=>{const e={headers:[],sections:[]};let n={header:void 0,rows:[]};for(const r of t.rows)if(ri(r))for(const o of r.cells)e.headers.push(o.textContent);else if(ed(r))n={header:r.cells[0].textContent,rows:[]},e.sections.push(n);else{const o={cells:[]};for(const a of r.cells){const i={header:e.headers[a.cellIndex],value:a.textContent};o.cells.push(i)}n.rows.push(o)}return n.header||e.sections.push(n),e},ed=t=>{for(const e of t.cells)if(e.hasAttribute("colspan"))return!0;return!1};function Tr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function uh(t){if(Object.prototype.hasOwnProperty.call(t,"__esMo
14dule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){var o=!1;try{o=this instanceof r}catch{}return o?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return t[r]}})}),n}var gn={exports:{}},td=gn.exports,wo;function nd(){return wo||(wo=1,function(t,e){(function(n,r){t.exports=r()})(td,function(){var n=1e3,r=6e4,o=36e5,a="millisecond",i="second",s="minute",c="hour",l="day",d="week",p="month",u="quarter",g="year",f="date",y="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,k=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(h){var m=["th","st","nd","rd"],w=h%100;return"["+h+(m[(w-20)%10]||m[w]||m[0])+"]"}},C=function(h,m,w){var P=String(h);return!P||P.length>=m?h:""+Array(m+1-P.length).join(w)+h},T={s:C,z:function(h){var m=-h.utcOffset(),w=Math.abs(m),P=Math.floor(w/60),A=w%60;return(m<=0?"+":"-")+C(P,2,"0")+":"+C(A,2,"0")},m:function h(m,w){if(m.date()<w.date())return-h(w,m);var P=12*(w.year()-m.year())+(w.month()-m.month()),A=m.clone().add(P,p),x=w-A<0,$=m.clone().add(P+(x?-1:1),p);return+(-(P+(w-A)/(x?A-$:$-A))||0)},a:function(h){return h<0?Math.ceil(h)||0:Math.floor(h)},p:function(h){return{M:p,y:g,w:d,d:l,D:f,h:c,m:s,s:i,ms:a,Q:u}[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(h){return h===void 0}},L="en",I={};I[L]=b;var R="$isDayjsObject",U=function(h){return h instanceof N||!(!h||!h[R])},O=function h(m,w,P){var A;if(!m)return L;if(typeof m=="string"){var x=m.toLowerCase();I[x]&&(A=x),w&&(I[x]=w,A=x);var $=m.split("-");if(!A&&$.length>1)return h($[0])}else{var q=m.name;I[q]=m,A=q}return!P&&A&&(L=A),A||!P&&L},_=function(h,m){if(U(h))return h.clone();var w=typeof m=="object"?m:{};return w.date=h,w.args=arguments,new N(w)},E=T;E.l=O,E.i=U,E.w=function(h,m){return _(h,{locale:m.$L,utc:m.$u,x:m.$x,$offset:m.$offset})};var N=function(){function h(w){this.$L=O(w.locale,null,!0),this.parse(w),this.$x=this.$x||w.x||{},this[R]=!0}var m=h.prototype;return m.parse=function(w){this.$d=function(P){var A=P.date,x=P.utc;if(A===null)return new Date(NaN);if(E.u(A))return new Date;if(A instanceof Date)return new Date(A);if(typeof A=="string"&&!/Z$/i.test(A)){var $=A.match(S);if($){var q=$[2]-1||0,W=($[7]||"0").substring(0,3);return x?new Date(Date.UTC($[1],q,$[3]||1,$[4]||0,$[5]||0,$[6]||0,W)):new Date($[1],q,$[3]||1,$[4]||0,$[5]||0,$[6]||0,W)}}return new Date(A)}(w),this.init()},m.init=function(){var w=this.$d;this.$y=w.getFullYear(),this.$M=w.getMonth(),this.$D=w.getDate(),this.$W=w.getDay(),this.$H=w.getHours(),this.$m=w.getMinutes(),this.$s=w.getSeconds(),this.$ms=w.getMilliseconds()},m.$utils=function(){return E},m.isValid=function(){return this.$d.toString()!==y},m.isSame=function(w,P){var A=_(w);return this.startOf(P)<=A&&A<=this.endOf(P)},m.isAfter=function(w,P){return _(w)<this.startOf(P)},m.isBefore=function(w,P){return this.endOf(P)<_(w)},m.$g=function(w,P,A){return E.u(w)?this[P]:this.set(A,w)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(w,P){var A=this,x=!!E.u(P)||P,$=E.p(w),q=function(De,we){var Ye=E.w(A.$u?Date.UTC(A.$y,we,De):new Date(A.$y,we,De),A);return x?Ye:Ye.endOf(l)},W=function(De,we){return E.w(A.toDate()[De].apply(A.toDate("s"),(x?[0,0,0,0]:[23,59,59,999]).slice(we)),A)},z=this.$W,K=this.$M,H=this.$D,ee="set"+(this.$u?"UTC":"");switch($){case g:return x?q(1,0):q(31,11);case p:return x?q(1,K):q(0,K+1);case d:var re=this.$locale().weekStart||0,ye=(z<re?z+7:z)-re;return q(x?H-ye:H+(6-ye),K);case l:case f:return W(ee+"Hours",0);case c:return W(ee+"Minutes",1);case s:return W(ee+"Seconds",2);case i:return W(ee+"Milliseconds",3);default:return this.clone()}},m.endOf=function(w){return this.startOf(w,!1)},m.$set=function(w,P){var A,x=E.p(w),$="set"+(this.$u?"UTC":""),q=(A={},A[l]=$+"Date",A[f]=$+"Date",A[p]=$+"Month",A[g]=$+"FullYear",A[c]=$+"Hours",A[s]=$+"Minutes",A[i]=$+"Seconds",A[a]=$+"Milliseconds",A)[x],W=x===l?this.$D+(P-this.$W):P;if(x===p||x===g){var z=this.clone().set(f,1);z.$d[q](W),z.init(),this.$d=z.set(f,Math.min(this.$D,z.daysInMonth())).$d}else q&&this.$d[q](W);return this.init(),this},m.set=function(w,P){return this.clone().$set(w,P)},m.get=function(w){return this[E.p(w)]()},m.add=function(w,P){var A,x=this;w=Number(w);var $=E.p(P),q=function(K){var H=_(x);return E.w(H.date(H.date()+Math.round(K*w)),x)};if($===p)return this.set(p,this.$M+w);if($===g)return this.set(g,this.$y+w);if($===l)return q(1);if($===d)return q(7);var W=(A={},A[s]=r,A[c]=o,A[i]=n,A)[$]||1,z=this.$d.getTime()+w*W;return E.w(z,this)},m.subtract=function(w,P){return this.add(-1*w,P)},m.format=function(w){var P=this,A=this.$locale();
14if(!this.isValid())return A.invalidDate||y;var x=w||"YYYY-MM-DDTHH:mm:ssZ",$=E.z(this),q=this.$H,W=this.$m,z=this.$M,K=A.weekdays,H=A.months,ee=A.meridiem,re=function(we,Ye,xt,on){return we&&(we[Ye]||we(P,x))||xt[Ye].slice(0,on)},ye=function(we){return E.s(q%12||12,we,"0")},De=ee||function(we,Ye,xt){var on=we<12?"AM":"PM";return xt?on.toLowerCase():on};return x.replace(k,function(we,Ye){return Ye||function(xt){switch(xt){case"YY":return String(P.$y).slice(-2);case"YYYY":return E.s(P.$y,4,"0");case"M":return z+1;case"MM":return E.s(z+1,2,"0");case"MMM":return re(A.monthsShort,z,H,3);case"MMMM":return re(H,z);case"D":return P.$D;case"DD":return E.s(P.$D,2,"0");case"d":return String(P.$W);case"dd":return re(A.weekdaysMin,P.$W,K,2);case"ddd":return re(A.weekdaysShort,P.$W,K,3);case"dddd":return K[P.$W];case"H":return String(q);case"HH":return E.s(q,2,"0");case"h":return ye(1);case"hh":return ye(2);case"a":return De(q,W,!0);case"A":return De(q,W,!1);case"m":return String(W);case"mm":return E.s(W,2,"0");case"s":return String(P.$s);case"ss":return E.s(P.$s,2,"0");case"SSS":return E.s(P.$ms,3,"0");case"Z":return $}return null}(we)||$.replace(":","")})},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(w,P,A){var x,$=this,q=E.p(P),W=_(w),z=(W.utcOffset()-this.utcOffset())*r,K=this-W,H=function(){return E.m($,W)};switch(q){case g:x=H()/12;break;case p:x=H();break;case u:x=H()/3;break;case d:x=(K-z)/6048e5;break;case l:x=(K-z)/864e5;break;case c:x=K/o;break;case s:x=K/r;break;case i:x=K/n;break;default:x=K}return A?x:E.a(x)},m.daysInMonth=function(){return this.endOf(p).$D},m.$locale=function(){return I[this.$L]},m.locale=function(w,P){if(!w)return this.$L;var A=this.clone(),x=O(w,P,!0);return x&&(A.$L=x),A},m.clone=function(){return E.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},h}(),D=N.prototype;return _.prototype=D,[["$ms",a],["$s",i],["$m",s],["$H",c],["$W",l],["$M",p],["$y",g],["$D",f]].forEach(function(h){D[h[1]]=function(m){return this.$g(m,h[0],h[1])}}),_.extend=function(h,m){return h.$i||(h(m,N,_),h.$i=!0),_},_.locale=O,_.isDayjs=U,_.unix=function(h){return _(1e3*h)},_.en=I[L],_.Ls=I,_.p={},_})}(gn)),gn.exports}var rd=nd();const Lr=Tr(rd);var fn={exports:{}},od=fn.exports,bo;function ad(){return bo||(bo=1,function(t,e){(function(n,r){t.exports=r()})(od,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(o,a,i){var s,c=function(u,g,f){f===void 0&&(f={});var y=new Date(u),S=function(k,b){b===void 0&&(b={});var C=b.timeZoneName||"short",T=k+"|"+C,L=r[T];return L||(L=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:k,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:C}),r[T]=L),L}(g,f);return S.formatToParts(y)},l=function(u,g){for(var f=c(u,g),y=[],S=0;S<f.length;S+=1){var k=f[S],b=k.type,C=k.value,T=n[b];T>=0&&(y[T]=parseInt(C,10))}var L=y[3],I=L===24?0:L,R=y[0]+"-"+y[1]+"-"+y[2]+" "+I+":"+y[4]+":"+y[5]+":000",U=+u;return(i.utc(R).valueOf()-(U-=U%1e3))/6e4},d=a.prototype;d.tz=function(u,g){u===void 0&&(u=s);var f,y=this.utcOffset(),S=this.toDate(),k=S.toLocaleString("en-US",{timeZone:u}),b=Math.round((S-new Date(k))/1e3/60),C=15*-Math.round(S.getTimezoneOffset()/15)-b;if(!Number(C))f=this.utcOffset(0,g);else if(f=i(k,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(C,!0),g){var T=f.utcOffset();f=f.add(y-T,"minute")}return f.$x.$timezone=u,f},d.offsetName=function(u){var g=this.$x.$timezone||i.tz.guess(),f=c(this.valueOf(),g,{timeZoneName:u}).find(function(y){return y.type.toLowerCase()==="timezonename"});return f&&f.value};var p=d.startOf;d.startOf=function(u,g){if(!this.$x||!this.$x.$timezone)return p.call(this,u,g);var f=i(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return p.call(f,u,g).tz(this.$x.$timezone,!0)},i.tz=function(u,g,f){var y=f&&g,S=f||g||s,k=l(+i(),S);if(typeof u!="string")return i(u).tz(S);var b=function(I,R,U){var O=I-60*R*1e3,_=l(O,U);if(R===_)return[O,R];var E=l(O-=60*(_-R)*1e3,U);return _===E?[O,_]:[I-60*Math.min(_,E)*1e3,Math.max(_,E)]}(i.utc(u,y).valueOf(),k,S),C=b[0],T=b[1],L=i(C).utcOffset(T);return L.$x.$timezone=S,L},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(u){s=u}}})}(fn)),fn.exports}var id=ad();const sd=Tr(id);var yn={exports:{}},cd=yn.exports,vo;function ld(){return vo||(vo=1,function(t,e){(function(n,r){t.exports=r()})(cd,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,o=/([+-]|\d\d)/g;return function(a,i,s){var c=i.prototype;s.utc=function(y){var S={date:y,utc:!0,args:arguments};return new i(S)},c.utc=function(y){var S=s(this.toDate(),{locale:this.$L,utc:!0});return y?S.add(this.utcOffset(),n):S},c.local=function(){return s(this.toDate(),{locale:this.$L,utc:!1})};var l=c.parse;c.parse=function(y){y.utc&&(this.$u=!0),this.$utils().u(y.$offset)||(this.$offset=y.$offset),l.call(this,y)};var d=c.init;c.init=function(){if(this.$u){var y=this.$d;this.$y=y.getUTCFullYear(),this.$M=y.getUTCMonth(),this.$D=y.getUTCDate(),this.$W=y.getUTCDay(),this.$H=y.getUTCHours(),this.$m=y.getUTCMinutes(),this.$s=y.getUTCSeconds(),this.$ms=y.getUTCMilliseconds()}else d.call(this)};var p=c.utcOffset;c.utcOffset=function(y,S){var k=this.$utils().u;if(k(y))return this.$u?0:k(this.$offset)?p.call(this):this.$offset;if(typeof y=="string"&&(y=function(L){L===void 0&&(L="");var I=L.match(r);if(!I)return null;var R=(""+I[0]).match(o)||["-",0,0],U=R[0],O=60*+R[1]+ +R[2];return O===0?0:U==="+"?O:-O}(y),y===null))return this;var b=Math.abs(y)<=16?60*y:y,C=this;if(S)return C.$offset=b,C.$u=y===0,C;if(y!==0){var T=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(C=this.local().add(b+T,n)).$offset=b,C.$x.$localOffset=T}else C=this.utc();return C};var u=c.format;c.format=function(y){var S=y||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,S)},c.valueOf=function(){var y=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*y},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var g=c.toDate;c.toDate=function(y){return y==="s"&&this.$offset?s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var f=c.diff;c.diff=function(y,S,k){if(y&&this.$u===y.$u)return f.call(this,y,S,k);var b=this.local(),C=s(y).local();return f.call(b,C,S,k)}}})}(yn)),yn.exports}var dd=ld();const ud=Tr(dd);Lr.extend(ud);Lr.extend(sd);
14const pd=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],md=["January","February","March","April","May","June","July","August","September","October","November","December"],ar=(t,e)=>{const n={MM:String(t.getMonth()+1).padStart(2,"0"),M:t.getMonth()+1,dd:String(t.getDate()).padStart(2,"0"),d:t.getDate(),yyyy:t.getFullYear(),yy:String(t.getFullYear()).slice(-2),HH:String(t.getHours()).padStart(2,"0"),H:t.getHours(),mm:String(t.getMinutes()).padStart(2,"0"),m:t.getMinutes(),ss:String(t.getSeconds()).padStart(2,"0"),s:t.getSeconds()};return e.replace(/MM|M|dd|d|yyyy|yy|HH|H|mm|m|ss|s/g,r=>n[r])},ph=t=>{const e="dd.MM.yyyy",n=ir()||e,r=new Date(t);try{return ar(r,n)}catch(o){return console.error(`Issue occurred when formatting date to ${ir()}. Error: ${o}`),ar(r,e)}},ir=()=>document.getElementById("date-format-config")?.dataset?.dateFormat,hd=(t,e)=>{const n=e.days??pd,r=e.months??md,o=n[t.getDay()-1],a=r[t.getMonth()],i=e.format.toLowerCase();return i==="{today}"?`${o}, ${t.getDate()} ${a}`.toUpperCase():i==="{today_us}"?`${o}, ${a} ${t.getDate()}`.toUpperCase():""},mh=(t,e,n=!1)=>{let r=ir()||"dd-MM-yyyy";n||(r+=" HH:mm"),e||(e="UTC");const a=Lr(t).tz(e).local();return ar(a.toDate(),r)};(()=>{const e={name:"Feed Date (Text)",mount:async n=>{const r=n.querySelector(".text--feed-date p");se(r,()=>{const o=rt(),a=o.days?.length>0?o.days.split(`
15`):null,i=o.months?.length>0?o.months?.split(`
16`):null,s=r?.innerHTML,c=hd(new Date,{format:s,months:i,days:a});c&&(r.innerHTML=c)})}};M.registerComponent(e)})();(()=>{const e={name:"Show More (Text)",mount:async n=>{const r=rt(),o={labels:Object.keys(r).length>0?r:null},a=n.querySelectorAll(".text.show-more > .cmp-text");Y(a,i=>new Pr(i,o))}};M.registerComponent(e)})();const Bt={button:"button",ticker:"ticker",play:"ticker--playing",pauseLabel:"cmp-button__text--pause",playLabel:"cmp-button__text--play"};class gd{wrapper;button;pauseLabel;playLabel;constructor(e){this.wrapper=e,this.button=this.wrapper.querySelector(`.${Bt.button}`),this.pauseLabel=this.button.querySelector(`.${Bt.pauseLabel}`),this.playLabel=this.button.querySelector(`.${Bt.playLabel}`),this.button.addEventListener("click",()=>this.toggleTicker()),this.toggleTicker()}toggleTicker(){this.wrapper.classList.toggle(Bt.play),this.toggleAriaHidden(this.pauseLabel),this.toggleAriaHidden(this.playLabel)}toggleAriaHidden(e){e.ariaHidden=e.ariaHidden==="true"?"false":"true"}}(()=>{const t={name:"Ticker",mount:async e=>{const n=e.querySelectorAll(`.${Bt.ticker}`);Y(n,r=>new gd(r))}};M.registerComponent(t)})();const Ie={thirdPartyExperienceComponent:"cmp-embed__third-party-experience",closeButton:"third-party-experience__close-button",embedHeader:"third-party-experience__header",loader:"loading-indicator",hidden:"hidden"},$e=250,sr=t=>{try{return!!JSON.parse(t)}catch{return!1}},Q=(t,...e)=>{lr()&&console.log(t,...e)},Ue=async(t,e)=>{const{getAuthToken:n}=await J();return Promise.all([n(),nt(t,e)]).catch(r=>(console.warn(r),["",""]))},fd=t=>!![...t.iframe.closest(`.${Ie.thirdPartyExperienceComponent}`).children].find(n=>n.className?.includes(Ie.embedHeader)),oi=()=>{const t=()=>!!document.referrer,e=()=>dn(window.location.hostname)===dn(new URL(document.referrer).hostname),n=()=>dn(String(window.location))!==dn(document.referrer);return t()&&e()&&n()},dn=t=>t.replace(/\/$/,"");class ai{constructor(e,n,r,o){this.apiBaseUrl=e,this.reCaptchaSiteKey=n,this.promoPlusEnv=r,this.clientLanguage=o}async sendGameResult(e,n,r){const o=a=>{if(a?.errorCode==="APP_RESULTS_LIMIT_EXCEEDED")return{...a.errorDetails,error:"participation_limit",message:a.message}};return this.postAPIRequest("/app-results","sendGameResult",{appId:e,level:r,points:n,clientLanguage:this.clientLanguage},o)}async burnPincode(e,n){const r=a=>{switch(a?.errorCode){case"BURN_PINCODE_INVALID_INPUT_ERROR":return{error:"pincode_error",errorCode:1,message:a.message};case"BURN_PINCODE_CODE_INACTIVE_ERROR":return{error:"pincode_error",errorCode:2,message:a.message};case"BURN_PINCODE_PINCODE_IS_EXPIRED_ERROR":return{error:"pincode_error",errorCode:3,message:a.message};case"BURN_PINCODE_ALREADY_REDEEMED_ERROR":return{error:"pincode_error",errorCode:4,message:a.message};case"BURN_PINCODE_TOO_MANY_ATTEMPTS_ERROR":return{error:"pincode_error",errorCode:5,message:a.message};case"BURN_PINCODE_REDEMPTION_LOCKED_ERROR":return{error:"pincode_error",errorCode:6,message:a.message};case"BURN_PINCODE_LIMIT_EXCEEDED_ERROR":return{error:"participation_limit",message:a.message};case"BURN_PINCODE_BLOCKED_ERROR":return{error:"blocked",message:a.message,errorDetails:a.errorDetails};case"BURN_PINCODE_UNKNOWN_ERROR":return{error:"BURN_PINCODE_UNKNOWN_ERROR",message:"Something went wrong"}}},o=await this.postAPIRequest("/burn-pincode","burnPincode",{appId:e,pincode:n,clientLanguage:this.clientLanguage},r);return"earnedCurrencies"in o?{message:o.message,earnedCurrencies:o.earnedCurrencies}:o}async newBurnPincode(e,n){const r=a=>{switch(a?.errorCode){case"BURN_PINCODE_INVALID_INPUT_ERROR":return{error:"INVALID_INPUT",message:a.message};case"BURN_PINCODE_CODE_INACTIVE_ERROR":return{error:"PINCODE_INACTIVE",message:a.message};case"BURN_PINCODE_PINCODE_IS_EXPIRED_ERROR":return{error:"PINCODE_EXPIRED",message:a.message};case"BURN_PINCODE_ALREADY_REDEEMED_ERROR":return{error:"PINCODE_ALREADY_REDEEMED",message:a.message};case"BURN_PINCODE_TOO_MANY_ATTEMPTS_ERROR":return{error:"TOO_MANY_ATTEMPTS",message:a.message};case"BURN_PINCODE_REDEMPTION_LOCKED_ERROR":return{error:"REDEMPTION_LOCKED",message:a.message};case"BURN_PINCODE_REDEMPTION_LIMIT_REACHED_ERROR":return{error:"REDEMPTION_LIMIT_REACHED",message:a.message};case"BURN_PINCODE_LIMIT_EXCEEDED_ERROR":return{error:"PARTICIPATION_LIMIT",message:a.message};case"BURN_PINCODE_BLOCKED_ERROR":return{error:"BLOCKED",message:a.message,errorDetails:a.errorDetails};case"BURN_PINCODE_UNKNOWN_ERROR":return{error:"UNKNOWN_ERROR",message:"Something went wrong"}}},o=await this.postAPIRequest("/burn-pincode","burnPincode",{appId:e,pincode:n,clientLanguage:this.clientLanguage},r);return"earnedCurrencies"in o?{message:o.message,earnedCurrencies:o.earnedCurrencies}:o}async burnPartnerCode(e,n){const r=o=>{switch(o?.errorCode){case"BURN_PARTNER_CODE_INVALID_CODE_ERROR":return{error:"INVALID_CODE",message:o.message};case"BURN_PARTNER_CODE_EXPIRED_CODE_ERROR":return{error:"EXPIRED_CODE",message:o.message};case"BURN_PARTNER_CODE_BURNED_CODE_ERROR":return{error:"BURNED_CODE",message:o.message};case"BURN_PARTNER_CODE_LOCKED_CODE_ERROR":return{error:"LOCKED_CODE",message:o.message};case"BURN_PARTNER_CODE_INVALID_CONFIGURATION_ERROR":return{error:"INVALID_CONFIGURATION",message:o.message};case"BURN_PARTNER_CODE_PROMOPLUS_REDEMPTION_LIMIT_REACHED_ERROR":return{error:"REDEMPTION_LIMIT_REACHED",message:o.message};default:return{error:"UNKNOWN_ERROR",message:o.message||"Something went wrong"}}};return this.postAPIRequest(`/apps/${e}/burn-partner-code`,"burnPartnerCode",{code:n,clientLanguage:this.clientLanguage},r)}async walletStatus(e){return this.postAPIRequest("/wallet-status","walletStatus",{appId:e,clientLanguage:this.clientLanguage})}async redeemPrize(e,n){const r=o=>{switch(o?.errorCode){case"REDEEM_PRIZE_NOT_ENOUGH_CURRENCIES_ERROR":return{missingCurrencies:o.missingCurrencies,error:"not_enough_currencies",message:o.message};case"REDEEM_PRIZE_INVALID_PRIZE_ERROR":return{error:"not_found",message:o.message}}};return this.postAPIRequest("/redeem-prize","redeemPrize",{appId:e,prizeId:n,clientLanguage:this.clientLanguage},r)}async saveAppData(e,n){const r={appId:e,data:n};
16return this.postAPIRequest("/app-data","saveData",r)}async loadAppData(e){return this.getAPIRequest(`/app-data/${e}`,"loadData")}async newLoadAppData(e){const n=await this.getAPIRequest(`/app-data/${e}`,"loadData");return typeof n=="object"&&("data"in n||"error"in n)?n:{data:null}}async getApp(e){return this.getAPIRequest(`/apps/${e}`,"getApp")}async saveSurveyResults(e){return this.postAPIRequest("/survey-results","saveSurveyResults",e)}async postAPIRequest(e,n,r,o=()=>{}){return this.executeAPIRequestWrapper(a=>fetch(`${this.apiBaseUrl}${e}`,{method:"POST",headers:{...a,"Content-Type":"application/json"},body:r?JSON.stringify(r):void 0}),n,o)}async getAPIRequest(e,n,r=()=>{}){return this.executeAPIRequestWrapper(o=>fetch(`${this.apiBaseUrl}${e}`,{method:"GET",headers:o}),n,r)}async executeAPIRequestWrapper(e,n,r){const[o,a]=await Ue(this.reCaptchaSiteKey,n),i={"x-auth-verify":o,"x-recaptcha-token":a,"x-promo-plus-env":this.promoPlusEnv,...dt()},s=await e(i),c=await s.json().catch(l=>(console.debug("Failed to parse JSON response:",l),{}));return s.ok?c:this.handleErrorResponse(s,c,r)}handleErrorResponse(e,n,r){const o=r&&r(n);return o||(n.errorCode==="BAD_REQUEST"?{error:"bad_request",message:"Bad request"}:e.status===401?{error:"unauthorized",message:"Unauthorized"}:n.errorCode?{error:n.errorCode.toLowerCase(),message:n.message}:e.status===403?{error:"forbidden",message:"Forbidden"}:{error:"generic_error",message:"Something went wrong"})}}class F extends Error{constructor(e,n="GENERIC_ERROR",r,o="XtndError"){super(e),this.data=r,this.errorCode=n,this.name=o}errorCode="GENERIC_ERROR"}const Ke=t=>{const e={...t};delete e.message,delete e.error;const n=Object.keys(e).length===0;return new F(t.message,t.error,n?void 0:e,"ApiError")},yd=t=>new F(t.message,"GENERIC_ERROR",void 0,t.name);class wd{async getGeolocation(){const e=await fetch("/api/geolocation",{credentials:"include",headers:{Accept:"application/json"}});if(!e.ok){const n=await e.text();throw new F(`Cannot fetch geolocation: (${n})`,"GEOLOCATION_ERROR")}return await e.json()}}const Kn="clAppData";class ii{loadAppData(e){if(!window.localStorage)return{message:"No local storage available, data not loaded"};const n=localStorage.getItem(Kn+e);return n?JSON.parse(n):""}newLoadAppData(e){if(!window.localStorage)return{error:"no_local_storage",message:"No local storage available, data not loaded"};const n=localStorage.getItem(Kn+e);return n?JSON.parse(n):{data:null}}saveAppData(e,n){if(!window.localStorage)return{error:"no_local_storage",message:"No local storage available, data not saved"};if(!n)return{error:"bad_request",message:"Bad request"};const r=this.loadAppData(e),o=new Date().toISOString(),a={data:n,created:r?.created??o,modified:o};return window.localStorage.setItem(Kn+e,JSON.stringify(a)),{created:a.created,modified:a.modified}}}class si{constructor(e,n,r){this.apiUrl=e,this.apiKey=n,this.reCaptchaSiteKey=r}async postArbiterSDK(e,n){const[r,o]=await Ue(this.reCaptchaSiteKey,"ngpsArbiterGateway");return this.postAPIRequest("arbiterSDK",{"g-recaptcha-response":o,...e},{Authorization:`Bearer ${r}`},{...n})}async getPublicListPrizes(e){return await this.getAPIRequest("publicListPrizes",e)}async listTransactions(e,n){const[r,o]=await Ue(this.reCaptchaSiteKey,"listTransactions"),{flowLabel:a,responseType:i,language:s,...c}=n||{},l={currencyId:e,flowLabel:a??"listTransactions",...i&&{responseType:i},...s&&{language:s}};return this.postAPIRequest("arbiterSDK",{"g-recaptcha-response":o,...c},{Authorization:`Bearer ${r}`},l)}async uploadImage(e,n){const[r,o]=await Ue(this.reCaptchaSiteKey,"postUploadImage"),a=await this.postAPIRequest("uploadImage",{"g-recaptcha-response":o,...e},{Authorization:`Bearer ${r}`},{fileNames:[n?.fileName]});if(!a.ok)throw new Error("Failed to get pre-signed URL");const i=await a.json(),s=i.signedUrls?.[n?.fileName]?.signedURL;if(!s)throw new Error("No signed URL received");if(!(await fetch(s,{method:"PUT",headers:{"Content-Type":"application/octet-stream"},body:n?.fileBuffer})).ok)throw new Error("Failed to upload file");return new Response(JSON.stringify(i),{status:a.status,statusText:a.statusText,headers:a.headers})}async startParticipation(e,n){const[r,o]=await Ue(this.reCaptchaSiteKey,"postPromotion"),{flowLabel:a,responseType:i,language:s,...c}=n||{},l={signedUrls:e,...a&&{flowLabel:a},...i&&{responseType:i},...s&&{language:s}};return this.postAPIRequest("arbiterSDK",{"g-recaptcha-response":o,...c},{Authorization:`Bearer ${r}`},l)}async continueParticipation(e,n){const[r,o]=await Ue(this.reCaptchaSiteKey,"postPromotion"),{flowLabel:a,...i}=n||{},s={participationId:e,...a&&{flowLabel:a}};return this.postAPIRequest("arbiterSDK",{"g-recaptcha-response":o,...i},{Authorization:`Bearer ${r}`},s)}async getParticipations(e){const[n,r]=await Ue(this.reCaptchaSiteKey,"myReceipts");return this.getAPIRequest("getParticipationsWithStatus",{"g-recaptcha-response":r,...e},{Authorization:`Bearer ${n}`})}async getAPIRequest(e,n,r){const o=new URL(`${Ce(this.apiUrl)}/${e}`);
16return Object.entries(n).forEach(([a,i])=>o.searchParams.append(a,String(i))),fetch(o.toString(),{method:"GET",headers:Ae({"x-api-key":this.apiKey,...r})})}async postAPIRequest(e,n,r,o){const a=new URL(`${Ce(this.apiUrl)}/${e}`);return Object.entries(n).forEach(([i,s])=>a.searchParams.append(i,String(s))),fetch(a.toString(),{method:"POST",headers:Ae({"Content-Type":"application/json","x-api-key":this.apiKey,...r}),body:o?JSON.stringify(o):void 0})}}class ci{constructor(){}async sendData(e,n,r){const o=await ba("prospect_submit"),a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:o,partner:n,...r})});if(!a.ok&&a.status===400){const i=await a.text();throw new F(`Failed to send data: ${i}`,"API_ERROR")}else if(!a.ok){const i=await a.text();throw new F(`Request to Prospect API failed ${i}`)}}}class li{constructor(e,n){this.apiUrls=e,this.reCaptchaSiteKey=n}async uploadFile(e,n){const[r,o]=await Ue(this.reCaptchaSiteKey,"uploadFile"),{fileBuffer:a,...i}=n||{},s=n?.contentType,c=await this.postAuthenticatedAPIRequest("upload",e,i,{"x-auth-verify":r,"x-recaptcha-token":o});if("error"in c)return c;const{uploadUrl:l,contentType:d}=c;return l?this.uploadToS3(l,a,d||s||"application/octet-stream",c):{message:"No upload URL returned",error:"UGC_UPLOAD_ERROR"}}async uploadToS3(e,n,r,o){const a=typeof n=="string"?this.base64ToArrayBuffer(n):void 0,i=await fetch(e,{method:"PUT",headers:{"Content-Type":r},body:a});if(!i.ok)return{message:`File upload failed with status ${i.status}`,error:"UGC_UPLOAD_ERROR"};const{uploadUrl:s,contentType:c,...l}=o;return l}base64ToArrayBuffer(e){const n=atob(e),r=new Uint8Array(n.length);for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o);return r.buffer}async listFiles(e){const[n,r]=await Ue(this.reCaptchaSiteKey,"listFiles");return this.getAPIRequest("list",e,{"x-auth-verify":n,"x-recaptcha-token":r})}async listPublic(e){const[,n]=await Ue(this.reCaptchaSiteKey,"listPublicFiles");return this.getAPIRequest("list-public",e,{"x-recaptcha-token":n})}async postAuthenticatedAPIRequest(e,n,r,o){const a=new URL(`${Ce(this.resolveApiUrl())}/${e}`);n&&Object.entries(n).forEach(([c,l])=>a.searchParams.append(c,String(l)));const i=await fetch(a.toString(),{method:"POST",headers:Ae({"Content-Type":"application/json",...o,...dt()}),body:r?JSON.stringify(r):void 0}),s=await i.json();return i.ok?s:{message:s?.message||"Something went wrong",error:s?.errorCode||"UNKNOWN_ERROR"}}async getAPIRequest(e,n,r){const o=new URL(`${Ce(this.resolveApiUrl())}/${e}`);n&&Object.entries(n).forEach(([s,c])=>o.searchParams.append(s,String(c)));const a=await fetch(o.toString(),{method:"GET",headers:Ae({...r,...dt()})}),i=await a.json();return a.ok?i:{message:i?.message||"Something went wrong",error:i?.errorCode||"UNKNOWN_ERROR"}}resolveApiUrl(){switch(Te()?.region?.toUpperCase()||"NA"){case"LATAM":return this.apiUrls.latam;case"EMEA":return this.apiUrls.emea;case"APAC":return this.apiUrls.apac;case"NA":default:return this.apiUrls.na}}}const bd=async(t,e)=>(e.data.event_category==="ecommerce"?Sd(t,e.data):vd(t,e.data),{message:"Event sent"}),vd=(t,e)=>{const n={app_id:t.appName,event:e.event,event_category:e.event_category,event_action:e.event_action,event_label:e.event_label,screen_name:e.screen_name,origin:"xtnd",...e.optional_params};Q("Xtnd Analytics event",n),G.push(n)},Sd=(t,e)=>{const n={app_id:t.appName,event:e.event,event_category:e.event_category,origin:"xtnd",ecommerce:{...e.ecommerce}};G.push({ecommerce:null}),Q("Xtnd Analytics event",n),G.push(n)},Ed=async(t,e)=>{const n=e.data;if(!n.url)throw new F("URL is missing","MISSING_URL");return await Rd(n),{message:"Navigation performed"}},Cd=async t=>{const e=t.iframe.closest(`.${Ie.thirdPartyExperienceComponent}`).querySelector(`.${Ie.closeButton}`);if(!e||!e.href)throw new F("Application cannot be closed","NOT_SUPPORTED");return await di(e.href),{message:"App closed"}},Ad=async(t,e)=>{const{height:n}=e.data;if(fd(t))throw new F("Iframe can only be resized when is not in standalone mode","NOT_SUPPORTED");if(!Number.isInteger(n)||!(n>0))throw new F("Height must be an integer and greater than zero","BAD_INPUT");const r=t.iframe.closest(`.${Ie.thirdPartyExperienceComponent}`);return r.style.height=`${n}px`,r.style.aspectRatio="unset",{message:"Window resized"}},_d=async(t,e)=>{const{data:n}=e;if(!n.data)throw new F("Field data is required","BAD_INPUT");const r=t.localStorage.saveAppData(t.appId,n.data);if(G.push({event:"experience_event",event_category:"auto_track",event_action:"save_data",event_label:"save_data",additional_context_1:"local_storage",..."error"in r&&{additional_context_2:r.error}}),"error"in r)throw Ke(r);return{message:"Data saved",data:r}},Pd=async t=>{const e=t.localStorage.newLoadAppData(t.appId);if(G.push({event:"experience_event",event_category:"auto_track",event_action:"load_data",event_label:"load_data",additional_context_1:"local_storage",..."error"in e&&{additional_context_2:e.error}}),"error"in e)throw Ke(e);return{message:"Data loaded",data:e}},Id=async()=>{const t=new URLSearchParams(window.location.search),e=[...Fo()];return Dd(t,e),{message:"Query params loaded",data:e.map(r=>({key:r[0],value:r[1],timestamp:r.length>2?r[2]:void 0}))}},Td=async(t,e)=>{const{url:n}=e.data;return window.history.pushState({},"",n),{message:"Push state completed"}},Ld=async()=>({message:"Current location loaded",data:window.location}),kd=async(t,e)=>{const{offset:n}=e.data,o=t.iframe.getBoundingClientRect().top+window.scrollY-document.documentElement.clientTop;
16if(!Number.isInteger(n))throw new F("Provided value is not valid");return window.scrollTo({top:o+n}),{message:"Scrolled to position"}},Rd=t=>(G.push({event:"experience_event",event_category:"auto_track",event_action:"parent_navigation",event_label:"onAction",additional_context_1:"web_view",additional_context_2:`${t.url}`}),new Promise((e,n)=>{t.newTab?window.open(t.url,"_blank")?e():n("Failed to open new tab"):(setTimeout(()=>window.location.assign(t.url),$e),e())})),di=t=>{const e=oi()?document.referrer:t;return G.push({event:"experience_event",event_category:"auto_track",event_action:"parent_navigation",event_label:"closeGame",additional_context_2:e}),new Promise(n=>{setTimeout(()=>{window.location.assign(e),n()},$e)})},Dd=(t,e)=>{const n=e.map(([o])=>o);[...t.entries()].filter(([o])=>!n.includes(o)).forEach(([o,a])=>e.push([o,a]))},Od=async()=>(await Wd(),{message:"Action performed"}),Nd=async()=>(await zd(),{message:"Action performed"}),xd=async()=>(await Hd(),{message:"Action performed"}),$d=async()=>{const t=await J();if(!await t.isAuthenticated())throw new F("User is not authenticated","USER_NOT_AUTHENTICATED");return{message:"User identity retrieved",data:{uuid:await t.getUuid(),token:await t.getAuthToken()}}},Md=async t=>{const e=await J();if(!await e.isAuthenticated())throw new F("User is not authenticated","USER_NOT_AUTHENTICATED");const n=await t.apiClientGAM.getProfile();if("error"in n)throw new F(n.message,n.error);return{message:"Profile retrieved",data:{...n,uuid:await e.getUuid(),token:await e.getAuthToken()}}},Ud=async(t,e)=>{const n=await J(),r=Te(),o={...e.data,applicationId:r.clientId};if(!await n.isAuthenticated())throw new F("User is not authenticated","USER_NOT_AUTHENTICATED");const i=await t.apiClientGAM?.updateProfile(o);if(i instanceof Object&&("error"in i||"message"in i))throw new F(i.message,i.error);return{message:"User profile updated",data:{...i}}},Bd=async()=>(await Vd(),{message:"Action performed"}),qd=async(t,e)=>{const n=await t.cdsEnrichmentClient.sendEnrichmentData(e.data);if("error"in n)throw new F(n.message,n.error);return n},Fd=async t=>{const e=await t.cdsEnrichmentClient.getEnrichmentData();if("error"in e)throw new F(e.message,e.error);return e},Wd=async()=>(G.push({event:"experience_event",event_category:"auto_track",event_action:"parent_navigation",event_label:"onAction",additional_context_1:"login"}),new Promise((t,e)=>{setTimeout(async()=>{try{await(await J()).signIn(),t()}catch(n){e(qn(n,"Failed to log in"))}},$e)})),zd=async()=>(G.push({event:"experience_event",event_category:"auto_track",event_action:"parent_navigation",event_label:"onAction",additional_context_1:"logout"}),new Promise((t,e)=>{setTimeout(async()=>{try{await(await J()).logOut(),t()}catch(n){e(qn(n,"Failed to log out"))}},$e)})),Hd=async()=>(G.push({event:"experience_event",event_category:"auto_track",event_action:"parent_navigation",event_label:"onAction",additional_context_1:"signup"}),new Promise((t,e)=>{setTimeout(async()=>{try{await(await J()).signUp(),t()}catch(n){e(qn(n,"Failed to sign up"))}},$e)})),Vd=async()=>(G.push({event:"experience_event",event_category:"auto_track",event_action:"parent_navigation",event_label:"onAction",additional_context_1:"manage_account"}),new Promise((t,e)=>{setTimeout(async()=>{try{await(await J()).manageAccount(),t()}catch(n){e(qn(n,"Failed to manage account"))}},$e)})),qn=(t,e)=>{const n=new F(e);return t instanceof Error&&(n.message=`${n.message} (${t.message})`),n},ui=async(t,e)=>{try{const n=new URL(t.origin),r=n.searchParams;n.pathname=e,r.set("logoUri",t.logoUri),r.set("cardTitle",t.cardTitle),r.set("header",t.header),r.set("subheader",t.subheader),r.set("code",t.code),r.set("codeLabel",t.codeLabel),r.set("backgroundColor",t.backgroundColor),r.set("heroImageUri",t.heroImageUri);const o=await fetch(n.toString());return o.ok?o:null}catch(n){return console.log(n),null}},Gd=async t=>{const e=await ui(t,"/api/google-wallet"),n=await e.json();return e?n.walletLink:null},jd=async t=>{const e=await ui(t,"/api/apple-wallet"),n=r=>Uint8Array.from(atob(r),o=>o.charCodeAt(0));if(e){const r=await e.text(),o=n(r),a=new Blob([o],{type:"application/vnd.apple.pkpass"});return URL.createObjectURL(a)}return null},Kd=async()=>{try{return await Aa(),{message:"Subscription successful"}}catch(t){if(t instanceof Lt){const e=t instanceof Lt?t.cause:void 0,n=t instanceof Lt?t.message:void 0;throw new F(n,e)}else{const e=t instanceof Error?t.message:"Unknown error";throw new F(e)}}},Yd=async(t,e)=>{const n=await J();if(await n.isAuthenticated()){const{ref_code:r}=await n.getAuthPayload();if(!r)throw new F("Referral code is not present","REFERRAL_CODE_NOT_PRESENT");return{message:"Invite link created",data:{inviteLink:Ka(r,e.data.baseUrl)}}}throw new F("User is not authenticated","USER_NOT_AUTHENTICATED")},Jd=async(t,e)=>{const n=new URLSearchParams(window.location.search),r=n.get("xtnd-content"),o=n.get("xtnd-locale");return{message:"Translations loaded",data:{xtndExperienceId:n.get("xtnd-experience-id"),xtndContent:r,xtndLocale:o,translation:e.data.translation}}},Qd=async(t,e)=>{let n="";if(ha())n=await Gd(e.data);else if(Xt())n=await jd(e.data);else throw new F("Cannot finalize request. Unsupported platform.","NATIVE_WALLET_ERROR");if(!n)throw new F("Cannot retrieve wallet link","NATIVE_WALLET_ERROR");
16return{message:"Request finalized.",data:{walletLink:n}}},Xd=async()=>({message:"Geolocation fetched",data:await new wd().getGeolocation()}),Zd=async t=>({message:"Mode retrieved",data:t.config.configType}),eu=async(t,e)=>{const n=t.config.reCaptchaSiteKey;if(!n)throw new F("Site key for reCAPTCHA not found","RECAPTCHA_MISSING_SITE_KEY");try{return{message:"reCAPTCHA token generated",data:await window.grecaptcha.execute(n,{action:e.data})}}catch{throw new F("Cannot generate reCAPTCHA token","RECAPTCHA_ERROR")}},Ot=t=>{const e={...t};return delete e.message,{message:t.message,data:e}},tu=async(t,e)=>{const{points:n,level:r}=e.data;if(!Number.isInteger(n)||!(n>0))throw new F("Points must be an integer and greater than zero","BAD_INPUT");const o=await t.apiClient.sendGameResult(t.appId,n,r);if(G.push({event:"experience_event",event_category:"auto_track",event_action:"send_game_result",event_label:`${n}`,additional_context_1:`${r}`,..."error"in o&&{additional_context_2:o.error}}),"error"in o)throw Ke(o);return Ot(o)},nu=async t=>{const e=await t.apiClient.walletStatus(t.appId);if("error"in e)throw Ke(e);return Ot(e)},ru=async(t,e)=>{const{pincode:n}=e.data;if(!n||n.length===0)throw new F("Pincode cannot be empty","BAD_INPUT");const r=await t.apiClient.newBurnPincode(t.appId,n);if("error"in r)throw Ke(r);return Ot(r)},ou=async(t,e)=>{const{code:n,applicationId:r}=e.data;if(!n||n.length===0)throw new F("Code cannot be empty","INVALID_CODE");const o=r&&r.length>0?r:void 0,a=await t.apiClient.burnPartnerCode(o??t.appId,n);if("error"in a)throw Ke(a);return Ot(a)},au=async(t,e)=>{const{prizeId:n}=e.data;if(!n||n.length===0)throw new F("PrizeId cannot be empty","BAD_INPUT");const r=await t.apiClient.redeemPrize(t.appId,n);if("error"in r)throw Ke(r);return Ot(r)},iu=async(t,e)=>{const{event:n,itemId:r,actionId:o,points:a,customAttribute1:i,customAttribute2:s}=e.data,c=await t.engagementApiClient.registerEvent(t.appId,n,{itemId:r,actionId:o,points:a,customAttribute1:i,customAttribute2:s});if("error"in c)throw new F(c.message,c.error,c?.errorDetails,"ApiError");return Ot(c)},su=async(t,e)=>{const{data:n}=e;if(!n.data)throw new F("Field data is required","BAD_INPUT");const r=JSON.stringify(n.data),o=await t.apiClient.saveAppData(t.appId,r);if(G.push({event:"experience_event",event_category:"auto_track",event_action:"save_data",event_label:"save_data",additional_context_1:"api",..."error"in o&&{additional_context_2:o.error}}),"error"in o)throw Ke(o);return{message:"Data saved",data:o}},cu=async t=>{const e=await t.apiClient.newLoadAppData(t.appId);if(G.push({event:"experience_event",event_category:"auto_track",event_action:"load_data",event_label:"load_data",additional_context_1:"api",..."error"in e&&{additional_context_2:e.error}}),"error"in e)throw Ke(e);if("data"in e){const n=e.data?JSON.parse(e.data):{};return{message:"Data loaded",data:{...e,data:n}}}throw new F("No data found","NO_DATA")},lu=async(t,e)=>({message:"Participation started successfully",data:{...await tn(()=>t.apiClientQuiz?.startParticipation(e.data.quizId,e.data.promotionId))}}),du=async(t,e)=>({message:"Participation retrieved successfully",data:{...await tn(()=>t.apiClientQuiz?.getParticipation(e.data.quizId,e.data.participationId))}}),uu=async(t,e)=>({message:"Participation finished successfully",data:{...await tn(()=>t.apiClientQuiz?.finishParticipation(e.data.quizId,e.data.participationId))}}),pu=async(t,e)=>({message:"Answer submitted successfully",data:{...await tn(()=>t.apiClientQuiz?.submitAnswer(e.data.quizId,e.data.participationId,e.data.answer))}}),mu=async(t,e)=>({message:"Promotion submitted successfully",data:{...await tn(()=>t.apiClientQuiz?.submitPromotion(e.data.quizId,e.data.participationId,e.data.pins,e.data.promotionId,e.data.userInputs,e.data.hiddenInput,e.data.participationImage))}}),tn=async t=>{if(!await(await J()).isAuthenticated())throw new F("User is not authenticated","USER_NOT_AUTHENTICATED");const n=await t();if("error"in n)throw new F(n.message,n.error);return n},hu=async(t,e)=>{const{body:n,params:r}=e.data;if(!n?.flowLabel)throw new F("Body and flowLabel are required","BAD_INPUT");if(!r?.configurationId)throw new F("Params and configurationId are required","BAD_INPUT");const o=await t.promoPlusClient.postArbiterSDK(r,n),a=await o.json();return o.status===200&&kr(n.flowLabel,r.configurationId,a),wt(o,a),{message:"Secure request completed",data:a}},gu=async(t,e)=>{const{params:n}=e.data;if(!n?.configurationId)throw new F("Params and configurationId are required","BAD_INPUT");const r=await t.promoPlusClient.getPublicListPrizes(n),o=await r.json();return wt(r,o),{message:"List public prizes completed",data:o}},fu=async(t,e)=>{const{currencyId:n,params:r}=e.data;if(!n)throw new F("currencyId is required","BAD_INPUT");if(!r?.configurationId)throw new F("Params and configurationId are required","BAD_INPUT");const o=await t.promoPlusClient.listTransactions(n,r),a=await o.json();return wt(o,a),{message:"List transactions completed",data:a}},yu=async(t,e)=>{const{body:n,params:r}=e.data;if(!n?.fileName||!n?.fileBuffer)throw new F("fileName and fileBuffer are required","BAD_INPUT");if(!r?.configurationId)throw new F("Params and configurationId are required","BAD_INPUT");let o;try{if(typeof n.fileBuffer=="string"){const s=atob(n.fileBuffer),c=new Uint8Array(s.length);for(let l=0;l<s.length;l++)c[l]=s.charCodeAt(l);o=c.buffer}}catch(s){throw console.error("Error converting base64 to ArrayBuffer:",s),new F("Failed to process file buffer","BAD_INPUT")}const a=await t.promoPlusClient.uploadImage(r,{...n,fileBuffer:o}),i=await a.json();return wt(a,i),{message:"Image upload completed",data:i}},wu=async(t,e)=>{const{signedUrls:n,params:r}=e.data;if(!n)throw new F("signedUrls is required","BAD_INPUT");if(!r?.configurationId)throw new F("Params and configurationId are required","BAD_INPUT");const o=await t.promoPlusClient.startParticipation(n,r),a=await o.json();return o.status===200&&kr("promoEntry",r.configurationId,a),wt(o,a),{message:"Participation started",data:a}},bu=async(t,e)=>{const{params:n}=e.data;if(!n?.configurationId)throw new F("Params and configurationId are required","BAD_INPUT");const r=await t.promoPlusClient.getParticipations(n),o=await r.json();return wt(r,o),{message:"Participations retrieved",data:o}},vu=async(t,e)=>{const{participationId:n,params:r}=e.data;if(!n)throw new F("participationId is required","BAD_INPUT");if(!r?.configurationId)throw new F("Params and configurationId are required","BAD_INPUT");const o=await t.promoPlusClient.continueParticipation(n,r),a=await o.json();return o.status===200&&kr("promoEntry",r.configurationId,a),wt(o,a),{message:"Participation continued",data:a}},wt=(t,e)=>{if(t.status>=300)if(e){const n=e?.message||"Failed to complete request",r=`API_ERROR_HTTP_${t.status}`;throw new F(n,r,e)}else throw new F("Unknown error")},kr=(t,e,n)=>{const r=["promoEntry","redeemPrize","redeemPincodeForCurrencies","redeemPincode","redeemV
16oucher","rejectWinningMoment"],o={event:"experience_event",event_category:"auto_track",event_action:"promo_events"};r.includes(t)?G.push({...o,event_label:t,additional_context_1:e}):t==="autoRedeemCnG"?G.push({...o,event_label:"autoRedeemCnG",additional_context_1:e,additional_context_2:`${!!n.wonPrizes}`}):t==="instantWin"&&G.push({...o,event_label:"instantWin",additional_context_1:e,additional_context_2:`${!!n.instantWinResult?.winner}`})},Su=async t=>({message:"Get avatars completed",data:await Nt(()=>t.leaderboardsClient.getAvatars())}),Eu=async t=>({message:"Generate username completed",data:await Nt(()=>t.leaderboardsClient.generateUsername())}),Cu=async t=>({message:"Create profile completed",data:await Nt(()=>t.leaderboardsClient.createUserProfile())}),Au=async t=>({message:"Get user profile completed",data:await Nt(()=>t.leaderboardsClient.getUserProfile())}),_u=async(t,e)=>{const{avatarId:n,usernameId:r}=e.data||{};if(!n&&!r)throw new F("avatarId or usernameId is required","BAD_INPUT");const o={...n?{avatarId:n}:{},...r?{usernameId:r}:{}},a=await Nt(()=>t.leaderboardsClient.saveUserProfile(o)),i={avatarUpdated:!!n,usernameUpdated:!!r};return{message:"Update profile completed",data:a&&Object.keys(a).length>0?{...a,updated:i}:{updated:i}}},Pu=async(t,e)=>{const{configId:n,currencyId:r}=e.data||{};if(!n)throw new F("configId is required","BAD_INPUT");if(!r)throw new F("currencyId is required","BAD_INPUT");return{message:"Get leaderboard completed",data:await Nt(()=>t.leaderboardsClient.getLeaderboard(n,r))}},Nt=async t=>{if(!await(await J()).isAuthenticated())throw new F("User is not authenticated","USER_NOT_AUTHENTICATED");const n=await t();if("error"in n)throw new F(n.message,n.error,n.data);return n},Iu=async(t,e)=>{const{name:n,contentType:r,fileBuffer:o}=e.data||{};if(!n||!o)throw new F("name and fileBuffer are required","BAD_INPUT");const a={configurationId:t.appId},i={name:n,...r&&{contentType:r},fileBuffer:o};return{message:"File uploaded",data:await mi(()=>t.ugcClient.uploadFile(a,i))}},Tu=async(t,e)=>pi(t,e,n=>t.ugcClient.listFiles(n)),Lu=async(t,e)=>pi(t,e,n=>t.ugcClient.listPublic(n)),pi=async(t,e,n)=>{const{limit:r,nextToken:o}=e.data||{},a={configurationId:t.appId,...r&&{limit:r},...o&&{nextToken:o}};return{message:"List files completed",data:await mi(()=>n(a))}},mi=async t=>{const e=await t();if("error"in e)throw new F(e.message,e.error);return e},ku=async(t,e)=>{const{endpoint:n,partnerId:r,...o}=e.data;if(!n||!r)throw new F("endpoint and partnerId are required","BAD_INPUT");return await t.prospectClient.sendData(n,r,o),{message:"Prospect data sent",data:{}}},zt={xtndSendAnalyticsEvent:bd,xtndBrowserSaveData:_d,xtndBrowserLoadData:Pd,xtndNavigate:Ed,xtndCloseApp:Cd,xtndResizeWindow:Ad,xtndGetQueryParams:Id,xtndHistoryPushState:Td,xtndGetCurrentLocation:Ld,xtndScrollTo:kd,xtndLogIn:Od,xtndLogOut:Nd,xtndSignUp:xd,xtndGetUserIdentity:$d,xtndGetUserProfile:Md,xtndUpdateUserProfile:Ud,xtndManageAccount:Bd,xtndSendSurveyResults:qd,xtndGetSurveyResults:Fd,xtndSecureRequest:hu,xtndListPublicPrizes:gu,xtndListTransactions:fu,xtndUploadImage:yu,xtndEnrollPromotion:wu,xtndGetParticipations:bu,xtndContinueParticipation:vu,xtndApplicationStorageSaveData:su,xtndApplicationStorageLoadData:cu,xtndAddPoints:tu,xtndGetWallet:nu,xtndBurnPincode:ru,xtndBurnPartnerCode:ou,xtndRedeemPrize:au,xtndRegisterEvent:iu,xtndGetParticipation:du,xtndStartParticipation:lu,xtndFinishParticipation:uu,xtndSubmitAnswer:pu,xtndSubmitPromotion:mu,xtndSubscribeToNotifications:Kd,xtndCreateInviteFriendLink:Yd,xtndGetTranslations:Jd,xtndAddToNativeWallet:Qd,xtndGetMode:Zd,xtndGetGeolocation:Xd,xtndGetRecaptchaToken:eu,xtndProspectSendData:ku,xtndLeaderboardsGetAvatars:Su,xtndLeaderboardsGenerateUsername:Eu,xtndLeaderboardsCreateProfile:Cu,xtndLeaderboardsGetUserProfile:Au,xtndLeaderboardsUpdateProfile:_u,xtndLeaderboardsGetLeaderboard:Pu,xtndUgcUploadFile:Iu,xtndUgcListFiles:Tu,xtndUgcListPublic:Lu};function Fn(){return document.querySelector('meta[name="language"]')?.getAttribute("content")||document.documentElement.lang}const Yn={sendFirebaseEvent:async(t,e)=>{const{name:n,params:r}=e;return Du(e,n,{data:r}),{event:"firebaseEventSent",data:{original_event_name:n,message:"Firebase event successfully sent"}}},onAction:async(t,e)=>{const n=Ru(e);switch(n.action){case"web_view":Mu(n);return;case"login":await Uu();return;case"logout":await Bu();return;case"signup":await qu();return;default:return}},getQueryParams:async()=>{const t=new URLSearchParams(window.location.search),e=[...Fo()];return xu(t,e),{event:"getQueryParams",payload:e}},closeGame:async()=>{const t=document.querySelector(".third-party-experience__close-button");t&&t.href&&$u(t.href)},resizeWindow:async(t,e)=>{const{height:n}=JSON.parse(e.param);let r;if(Nu(t.iframe))r={error:"not_supported",message:"iframe can only be resized 
16when app is not embedded in standalone mode"};else if(!Number.isInteger(n)||!(n>0))r={error:"bad_input",message:"height must be an integer and greater than zero"};else{const o=t.iframe.closest(`.${Ie.thirdPartyExperienceComponent}`);o.style.height=`${n}px`,o.style.aspectRatio="unset",r={message:`height set to ${n}px`}}return{payload:r}},getProfile:async()=>{const t=await J();return{data:{profile:await t.isAuthenticated()?{uuid:await t.getUuid(),token:await t.getAuthToken()}:void 0}}},getFullUserProfile:async t=>{const e=await J();return{data:{profile:await e.isAuthenticated()?{...await Ou(t),uuid:await e.getUuid(),token:await e.getAuthToken()}:void 0}}},callNgpsArbiterGateway:async(t,e)=>{if(!sr(e.param))return So("ngpsArbiterGatewayResponse");const n=JSON.parse(e.param),r=await t.promoPlusClient.postArbiterSDK(n.params,n.body),o=await r.json();if(r.status===200){const a=n.body.flowLabel,i=n.params.configurationId,s=["promoEntry","redeemPrize","redeemPincodeForCurrencies","redeemPincode","redeemVoucher","rejectWinningMoment"],c={event:"experience_event",event_category:"auto_track",event_action:"promo_events"};s.includes(a)?G.push({...c,event_label:a,additional_context_1:i}):a==="autoRedeemCnG"?G.push({...c,event_label:"autoRedeemCnG",additional_context_1:i,additional_context_2:`${!!o.wonPrizes}`}):a==="instantWin"&&G.push({...c,event_label:"instantWin",additional_context_1:i,additional_context_2:`${!!o.instantWinResult?.winner}`})}return{event:"ngpsArbiterGatewayResponse",payload:{statusCode:r.status,response:o}}},callNgpsPublicListPrizesGateway:async(t,e)=>{if(!sr(e.param))return So("ngpsPublicListPrizesGatewayResponse");const n=JSON.parse(e.param),r=await t.promoPlusClient.getPublicListPrizes(n.params),o=await r.json();return{event:"ngpsPublicListPrizesGatewayResponse",payload:{statusCode:r.status,response:o}}},sendGameResult:async(t,e)=>{const{points:n,level:r}=JSON.parse(e.param),o=await t.apiClient.sendGameResult(t.appId,n,r);return G.push({event:"experience_event",event_category:"auto_track",event_action:"send_game_result",event_label:`${n}`,additional_context_1:`${r}`,..."error"in o&&{additional_context_2:o.error}}),{payload:o}},burnPincode:async(t,e)=>{const{pincode:n}=JSON.parse(e.param);return{payload:await t.apiClient.burnPincode(t.appId,n)}},getWalletStatus:async t=>({payload:await t.apiClient.walletStatus(t.appId)}),redeemPrize:async(t,e)=>{const{prizeId:n}=JSON.parse(e.param);return{payload:await t.apiClient.redeemPrize(t.appId,n)}},saveData:async(t,e)=>{const n=JSON.parse(e.param),r=n.useLocalStorage?t.localStorage.saveAppData(t.appId,n.dataJson):await t.apiClient.saveAppData(t.appId,n.dataJson);return G.push({event:"experience_event",event_category:"auto_track",event_action:"save_data",event_label:"save_data",additional_context_1:n.useLocalStorage?"local_storage":"api",..."error"in r&&{additional_context_2:r.error}}),{event:"dataSaved",payload:r}},loadData:async(t,e)=>{const n=JSON.parse(e.param),r=n.useLocalStorage?t.localStorage.loadAppData(t.appId):await t.apiClient.loadAppData(t.appId);return G.push({event:"experience_event",event_category:"auto_track",event_action:"load_data",event_label:"load_data",additional_context_1:n.useLocalStorage?"local_storage":"api",...typeof r=="object"&&"error"in r&&{additional_context_2:r.error}}),{event:"dataLoaded",payload:r}},getMode:async t=>({payload:{mode:t.config.configType}})},So=t=>({...t&&{event:t},payload:{error:"malformed_payload",message:"event payload must be a valid JSON string"}}),Ru=t=>{try{return JSON.parse(t.param)}catch{return{action:"unknown"}}},Du=(t,e,n)=>{const r={event:"mini_game",original_event_name:e,...n};Q("Analytics event",r),G.push(r)};async function Ou(t){try{return await t.apiClientGAM?.getProfile()}catch(e){v.log("Error while getting full GAM profile",e)}}const Nu=t=>!![...t.closest(`.${Ie.thirdPartyExperienceComponent}`).children].find(n=>n.className?.includes(Ie.embedHeader)),xu=(t,e)=>{const n=e.map(([o])=>o);[...t.entries()].filter(([o])=>!n.includes(o)).forEach(([o,a])=>e.push([o,a]))},$u=t=>{const e=oi()?document.referrer:t;G.push({event:"experience_event",event_category:"auto_track",event_action:"parent_navigation",event_label:"closeGame",additional_context_2:e}),setTimeout(()=>{window.location.href=e},$e)},Mu=t=>{t.url?(G.push({event:"experience_event",event_category:"auto_track",event_action:"parent_navigation",event_label:"onAction",additional_context_1:"web_view",additional_context_2:`${t.url}`}),t.newTab?window.open(t.url,"_blank"):setTimeout(()=>window.open(t.url,"_self"),$e)):(G.push({event:"experience_event",event_category:"auto_track",event_action:"parent_navigation",event_label:"onAction",additional_context_1:"web_view",additional_context_3:"missing_url"}),console.warn("Received navigation event action 'web_view', but url is missing."))}
16,Uu=async()=>{G.push({event:"experience_event",event_category:"auto_track",event_action:"parent_navigation",event_label:"onAction",additional_context_1:"login"}),setTimeout(async()=>{await(await J()).signIn()},$e)},Bu=async()=>{G.push({event:"experience_event",event_category:"auto_track",event_action:"parent_navigation",event_label:"onAction",additional_context_1:"logout"}),setTimeout(async()=>{await(await J()).logOut()},$e)},qu=async()=>{G.push({event:"experience_event",event_category:"auto_track",event_action:"parent_navigation",event_label:"onAction",additional_context_1:"signup"}),setTimeout(async()=>{await(await J()).signUp()},$e)};class hi{constructor(e,n,r){this.apiBaseUrl=e,this.reCaptchaSiteKey=n,this.promoPlusEnv=r}async getQuizConfig(e,n){const r=n?`?promoId=${encodeURIComponent(n)}`:void 0;return await this.getAPIRequest(e,r)}async startParticipation(e,n){const r=n!==void 0?{promotionId:n}:{};return await this.postAPIRequest(`${e}/participations`,r)}async getParticipation(e,n){return await this.getAPIRequest(`${e}/participations/${n}`)}async submitAnswer(e,n,{questionId:r,answerIds:o,answerText:a}){return await this.postAPIRequest(`${e}/participations/${n}/answers`,{questionId:r,answerIds:o,...a!==void 0&&{answerText:a}})}async finishParticipation(e,n){return await this.postAPIRequest(`${e}/participations/${n}/finish`)}async submitPromotion(e,n,r,o,a,i,s){return await this.postAPIRequest(`${e}/participations/${n}/promoPlus`,{pins:r,promotionId:o,...a&&a.length>0&&{userInputs:a},...i&&{hiddenInput:i},...s&&{participationImage:s}})}async getAPIRequest(e,n){return await this.executeAPIRequestWrapper(r=>fetch(Ce(`${this.apiBaseUrl}/quizzes/${e}${n??""}`),{headers:Ae(r)}))}async postAPIRequest(e,n){return await this.executeAPIRequestWrapper(r=>fetch(Ce(`${this.apiBaseUrl}/quizzes/${e}`),{method:"POST",headers:Ae(r),body:n?JSON.stringify(n):void 0}),"POST")}async executeAPIRequestWrapper(e,n){const r={accept:"application/json",...n==="POST"&&{"Content-Type":"application/json"},"x-auth-verify":await Dn(),"x-recaptcha-token":await nt(this.reCaptchaSiteKey,"quiz"),"x-promo-plus-env":this.promoPlusEnv,...dt()},o=await e(r),a=await o.json();return o.ok?a:{message:a?.message||"Something went wrong",error:a?.errorCode||"UNKNOWN_ERROR",data:a?.data}}}const hh=t=>!!t.error,gh=t=>t.status==="STARTED",fh=t=>t.status==="FINISHED";var Ht=(t=>(t.CREATED="created",t.SAVED="saved",t))(Ht||{});const yh=t=>t.state!=="saved";class nn{constructor(e,n,r){this.apiBaseUrl=e,this.reCaptchaSiteKey=n,this.promoPlusEnv=r}async getLeaderboard(e,n){const r=this.getSiteId();return await this.executeAPIRequest(`/leaderboards/${e}?currencyId=${n}&siteId=${r}`,"GET","getLeaderboard")}async getAvatars(){return await this.executeAPIRequest("/avatars","GET","getAvatars")}async getUserProfile(){const e=await this.fetchUserProfile();return this.processUserProfile(e)}async fetchUserProfile(){return await this.executeAPIRequest("/profiles","GET","getUserProfile")}processUserProfile(e){if(nn.isStatusResponse(e))switch(e.status){case 200:return e.data;case 404:return{message:e.message??"Profile not found",error:"PROFILE_NOT_FOUND",data:e.data};default:return{message:e.message??"Something went wrong",error:"UNKNOWN_ERROR",data:e.data}}return e}static isErrorResponse(e){return!!e.error}static isStatusResponse(e){return"status"in e&&"message"in e&&"data"in e}async generateUsername(){const e={siteId:this.getSiteId()};return await this.executeAPIRequest("/usernames","POST","generateUsername",e)}async saveUserProfile(e){return await this.executeAPIRequest("/profiles","PUT","saveProfile",e)}async createUserProfile(e,n){return await this.executeAPIRequest("/profiles","POST","createProfile",{siteId:this.getSiteId(),...e&&{usernameId:e},...n&&{avatarId:n}})}async executeAPIRequest(e,n,r,o){const a=await this.getHeaders(n,r),i=await fetch(Ce(`${this.apiBaseUrl}${e}`),{method:n,headers:Ae(a),body:o?JSON.stringify(o):void 0}),s=i.status===204?{}:await i.json();return i.ok?s:{message:s?.message||"Something went wrong",error:s?.errorCode||"UNKNOWN_ERROR",data:s?.data}}async getHeaders(e,n){return{accept:"application/json",...e==="POST"&&{"Content-Type":"application/json"},"x-auth-verify":await Dn(),"x-recaptcha-token":await nt(this.reCaptchaSiteKey,n),...this.promoPlusEnv?{"x-promo-plus-env":this.promoPlusEnv}:{},...dt()}}getSiteId(){const n=new RegExp("/(?<country>\\w{2})/(?<lang>\\w{2})(/.*)?").exec(window.location.pathname),r=n?.groups.country,o=n?.groups.lang;if(!r||!o)throw new Error(`Cannot find either country or lang in ${window.location.pathname}`);return`${r}-${o}`}}
16class Pe extends nn{static leaderboardCache=new Ft;static avatarsCache=new Ft(!0);static userProfileCache=new Ft;async getLeaderboard(e,n){const r=this.getSiteId(),o=`${this.apiBaseUrl}_${e}_${n}_${r}`;return await Pe.leaderboardCache.getCachedData(o,()=>super.getLeaderboard(e,n))}async getAvatars(){const e=this.apiBaseUrl;return await Pe.avatarsCache.getCachedData(e,()=>super.getAvatars())}async getUserProfile(){const e=this.apiBaseUrl;return await Pe.userProfileCache.getCachedData(e,()=>this.fetchUserProfile(),n=>this.processUserProfile(n))}}class Rr{clientLanguage;constructor(e,n,r){this.engagementApiUrl=e,this.reCaptchaSiteKey=n,this.promoPlusEnv=r,this.clientLanguage=Fn()}engagementApiUrl;reCaptchaSiteKey;promoPlusEnv;async registerProfileCompletion(e){return!e||!this.engagementApiUrl||!this.reCaptchaSiteKey||!this.promoPlusEnv?{grantedCurrencies:[]}:this.extractGrantedCurrencies(()=>this.registerEvent(e,"profile_completion"))}async registerPromoParticipation(e,n){if(!e||!this.engagementApiUrl||!this.reCaptchaSiteKey||!this.promoPlusEnv)return{grantedCurrencies:[]};const r=n.promotionMechanic==="collect_and_get"?n.currencyId:n.voucherCode;return this.extractGrantedCurrencies(()=>this.registerEvent(e,"promo_participation",{itemId:n.participationId,customAttribute1:n.configurationId,customAttribute2:r,customAttribute3:n.promotionMechanic}))}async registerEvent(e,n,r={}){const o={appId:e,event:n,clientLanguage:this.clientLanguage,...r.itemId!==void 0&&{itemId:r.itemId},...r.actionId!==void 0&&{actionId:r.actionId},...r.points!==void 0&&{points:r.points},...r.customAttribute1!==void 0&&{customAttribute1:r.customAttribute1},...r.customAttribute2!==void 0&&{customAttribute2:r.customAttribute2},...r.customAttribute3!==void 0&&{customAttribute3:r.customAttribute3}};return this.executeAPIRequest("/events","registerEvent",o)}async executeAPIRequest(e,n,r){try{const o=await this.getHeaders(n),a=await fetch(Ce(`${this.engagementApiUrl}${e}`),{method:"POST",headers:Ae(o),body:JSON.stringify(r)}),i=await a.json();return a.ok?i:{message:i?.message||"Something went wrong",error:i?.errorCode||"UNKNOWN_ERROR",errorDetails:i?.errorDetails}}catch(o){return console.error("Error while calling Engagement API",o),{message:"Something went wrong",error:"UNKNOWN_ERROR"}}}async getHeaders(e){return{accept:"application/json","Content-Type":"application/json","x-auth-verify":await Dn(),"x-recaptcha-token":await nt(this.reCaptchaSiteKey,e),...this.promoPlusEnv?{"x-promo-plus-env":this.promoPlusEnv}:{},...dt()}}async extractGrantedCurrencies(e){const n=await e();if(!Fu(n))return{grantedCurrencies:[]};const r=[];for(const o of n.ruleRecords||[]){const a=o.grantedRewards?.currencies||[];for(const i of a)r.push({currencyId:i.currencyId,amount:i.amount,currencyName:i.currencyName,currencyIcon:i.currencyIcon})}return{grantedCurrencies:r}}}const Fu=t=>!!t.ruleRecords,Jn=[];let Wu=0;(()=>{const t=Object.keys(Yn),e=Object.keys(zt),n=async(b,C)=>{if(!t.includes(b.event)||typeof Yn[b.event]!="function")throw new F(`Communication layer | Event handler not found: ${b.event}`);k(b,C);const T=b.event,L={id:C.id,appId:C.appId,configType:C.config.configType,iframe:C.iframe,window:C.window};Q("Communication layer | Incoming event: ",b,L);const I=await Promise.resolve(Yn[T](C,b));I&&(I.event||(I.event=`${T}Response`),Q("Communication layer | Outgoing event: ",I,L),u(C),s(C.window,I))},r=b=>({id:b.id,appId:b.appId,configType:b.config.configType,iframe:b.iframe,window:b.window}),o=async(b,C)=>{const T=b.event;Q("Communication layer | Incoming event: ",b,r(C));const L=await a(T,b,C);if(L){const I={eventId:b.eventId,status:"success",...L};u(C),c(C,I)}else throw new F("No response")},a=async(b,C,T)=>{if(!e.includes(b)||typeof zt[b]!="function")throw new F(`Communication layer | Event handler not found: ${b}`);return await Promise.resolve(zt[b](T,C))},i=b=>{if(sr(b)){const C=JSON.parse(b);if(C.event)return C;console.error("Communication layer | Error: corrupted payload")}},s=(b,C)=>{b.postMessage(JSON.stringify(C),"*")},c=(b,C)=>{Q("Communication layer | Outgoing event: ",C,r(b)),b.window.postMessage(JSON.stringify(C),"*")},l=()=>{window.addEventListener("message",async b=>{const C=Jn.find(L=>b.source===L.window);if(!C)return;if(!C.window){console.error("Communication layer | Error: iframe window not found",b);return}const T=i(b.data);if(!T){console.error("Communication layer | Error: corrupted payload");return}if(T.event.startsWith("xtnd"))try{await o(T,C)}catch(L){console.error("Communication layer | Error processing message: ",L);const I=d(T,L);c(C,I)}else try{await n(T,C)}catch(L){console.error("Communication layer | Error processing message: ",L)}})},d=(b,C)=>{let T={eventId:b.eventId,status:"failure"};if(C instanceof Error){const L=C instanceof F?C:yd(C);T={...T,message:`(${L.name}) ${L.message}`,error:L.errorCode.toUpperCase(),...L.data?{data:L.data}:{}}}else T={...T,message:"Unknown error",error:"UNKNOWN_ERROR"};return T},p=b=>{const C=new ai(b.baseApiUrl,b.reCaptchaSiteKey,b.promoPlusEnv,Fn()),T=new ut(b.baseGamApiUrl),L=new Cr(b.baseEnrichmentApiUrl,b.cdsRegion),I=new si(b.promoPlusApiUrl,b.promoPlusApiKey,b.reCaptchaSiteKey),R=new ci,U=new hi(b.quizApiUrl,b.reCaptchaSiteKey,b.promoPlusEnv),O=new ii,_=new nn(b.leaderboardsApiUrl,b.reCaptchaSiteKey,b.promoPlusEnv),E=new Rr(b.baseApiUrl,b.reCaptchaSiteKey,b.promoPlusEnv),N=new li({na:b.ugcNaApiUrl,latam:b.ugcLatamApiUrl,emea:b.ugcEmeaApiUrl,apac:b.ugcApacApiUrl},b.reCaptchaSiteKey);return{apiClient:C,apiClientGAM:T,apiClientQuiz:U,promoPlusClient:I,prospectClient:R,cdsEnrichmentClient:L,localStorage:O,leaderboardsClient:_,engagementApiClient:E,ugcClient:N}},u=b=>{b.config.configType!=="production"&&console.warn("Non-Production configuration is used on this component. Remember to switch 3rd Party Experience component Endpoint to PRODUCTION before going live.")},g=(b,C,T)=>{if(C==="production")return;const I=b.parentElement?.parentElement?.querySelector(".xtnd-app__warning");(ie||!T)&&I?.classList.add("xtnd-app__warning--visible"),ie&&T&&I?.classList.add("xtnd-app_warning-visible-fullscreen-author"),!ie&&T&&console.warn("Non-Production configuration is used on this component. Remember to switch 3rd Party Experience component Endpoint to PRODUCTION before going live.")},f=async(b,C)=>{const T=b.parentElement;b.dataset.src&&(b.src=b.dataset.src);const L={configType:T.getAttribute("data-app-endpoint")==="production"?"production":"non-production",baseApiUrl:T.getAttribute("data-pnp-api-url"),baseGamApiUrl:T.getAttribute("data-cds-frontend-url"),baseEnrichmentApiUrl:T.getAttribute("data-cds-enrichment-url"),cdsRegion:T.getAttribute("data-cds-region"),reCaptchaSiteKey:T.getAttribute("data-recaptcha-sitekey"),quizApiUrl:T.getAttribute("data-quiz-api-url"),promoPlusApiUrl:T.getAttribute("data-ngps-api-url"),promoPlusApiKey:T.getAttribute("data-ngps-api-key"),promoPlusEnv:T.getAttribute("data-promo-plus-env"),leaderboardsApiUrl:T.getAttribute("data-leaderboards-api-url"),ugcNaApiUrl:T.getAttribute("data-ugc-na-api-url"),ugcLatamApiUrl:T.getAttribute("data-ugc-latam-api-url"),ugcEmeaApiUrl:T.getAttribute("data-ugc-emea-api-url"),ugcApacApiUrl:T.getAttribute("data-ugc-apac-api-url")},I=p(L);g(T,L.configType,C);const R=`xtnd-${Wu++}`;Jn.push({id:R,appId:T.getAttribute("data-app-id"),appName:T.getAttribute("data-app-name"),config:L,iframe:b,window:b.contentWindow,...I}),await $n(L.reCaptchaSiteKey),await Mn(),Q(`Registered XTND iframe '${R}'`,Jn)}
16,S={name:"Plug and Play - Iframe communication",mount:async b=>{const C=b.querySelectorAll(`.${Ie.thirdPartyExperienceComponent} iframe`);if(!C.length)return;const T=ft("xtnd-iframe-communication");se(T,()=>{l()});const L=!!b.querySelector(".xtnd-app--full-screen");Y(C,I=>{f(I,L)})}},k=(b,C)=>{window.cep?.reportRumError?.({message:"XTND Legacy Message Invocation",stack:JSON.stringify({event:b.event,appId:C.appId,iframeId:C.id})})};M.registerComponent(S)})();(()=>{const t=o=>{const a=o.querySelector(`.${Ie.closeButton}`);if(a){const i=a.href,s=Fe("closeButton");a.setAttribute("aria-label",s),a.addEventListener("click",async c=>{c.preventDefault(),await di(i)})}},e=o=>{const a=o.getAttribute("data-app-name");if(a){const i={event:"3rd_party_app",event_name:"app_start",app_name:a};G.push(i)}},n=o=>{const a=o.querySelector(`.${Ie.loader}`);a&&a.classList.add(Ie.hidden),t(o),e(o)};Ji();const r={name:"Plug and Play",mount:async o=>{const a=o.querySelectorAll(`.${Ie.thirdPartyExperienceComponent}`);Y(a,i=>n(i))}};M.registerComponent(r)})();const Eo=[],zu="#xtnd-host";(()=>{const t=a=>{const i=new ai(a.baseApiUrl,a.reCaptchaSiteKey,a.promoPlusEnv,Fn()),s=new ut(a.baseGamApiUrl),c=new Cr(a.baseEnrichmentApiUrl,a.cdsRegion),l=new si(a.promoPlusApiUrl,a.promoPlusApiKey,a.reCaptchaSiteKey),d=new ci,p=new hi(a.quizApiUrl,a.promoPlusEnv,a.reCaptchaSiteKey),u=new ii,g=new nn(a.leaderboardsApiUrl,a.reCaptchaSiteKey,a.promoPlusEnv),f=new Rr(a.baseApiUrl,a.reCaptchaSiteKey,a.promoPlusEnv),y=new li({na:a.ugcNaApiUrl,latam:a.ugcLatamApiUrl,emea:a.ugcEmeaApiUrl,apac:a.ugcApacApiUrl},a.reCaptchaSiteKey);return{apiClient:i,apiClientGAM:s,apiClientQuiz:p,promoPlusClient:l,prospectClient:d,cdsEnrichmentClient:c,localStorage:u,leaderboardsClient:g,engagementApiClient:f,ugcClient:y}},e=async a=>{const i={},s={},c={configType:a.getAttribute("data-app-endpoint")==="production"?"production":"non-production",baseApiUrl:a.getAttribute("data-pnp-api-url"),baseGamApiUrl:a.getAttribute("data-cds-frontend-url"),baseEnrichmentApiUrl:a.getAttribute("data-cds-enrichment-url"),cdsRegion:a.getAttribute("data-cds-region"),reCaptchaSiteKey:a.getAttribute("data-recaptcha-sitekey"),quizApiUrl:a.getAttribute("data-quiz-api-url"),promoPlusApiUrl:a.getAttribute("data-ngps-api-url"),promoPlusApiKey:a.getAttribute("data-ngps-api-key"),promoPlusEnv:a.getAttribute("data-promo-plus-env"),leaderboardsApiUrl:a.getAttribute("data-leaderboards-api-url"),ugcNaApiUrl:a.getAttribute("data-ugc-na-api-url"),ugcLatamApiUrl:a.getAttribute("data-ugc-latam-api-url"),ugcEmeaApiUrl:a.getAttribute("data-ugc-emea-api-url"),ugcApacApiUrl:a.getAttribute("data-ugc-apac-api-url")};i[c.configType]||(i[c.configType]=c,s[c.configType]=t(c)),Eo.push({id:"xtnd-spa",appId:a.getAttribute("data-app-id"),appName:a.getAttribute("data-app-name"),config:c,iframe:a,window,...s[c.configType]}),await Promise.all(Object.values(i).map(l=>$n(l.reCaptchaSiteKey))),await Mn()},n=()=>{const a=async i=>{const s=i.detail,c=s.eventType,l=s.eventId;if(!zt[c]){console.log(`Event ${c} does not exist.`);return}console.log("FE Received Event: ",s);try{const d=await zt[c](Eo[0],i.detail.payload),p=new CustomEvent("xtnd-response",{detail:{eventId:l,eventType:c,message:d}});console.log("FE Sent Event: ",p.detail),dispatchEvent(p)}catch{const d=new CustomEvent("xtnd-response",{detail:{eventId:l,eventType:c,message:"Something went wrong"}});console.log("FE Sent Event: ",d.detail),dispatchEvent(d)}};window.addEventListener("xtnd-message",a)},o={name:"Plug and Play - SPA Communication",mount:async a=>{const i=a.querySelector(zu);if(!i)return;const s=ft("xtnd-spa-communication");se(s,n),await Dt(i,async c=>{await e(c),window.xtndComm=!0})}};M.registerComponent(o)})();const Hu=async(t,e)=>{try{const n=e.data,r={event:n.event,event_category:n.event_category,event_action:n.event_action,event_label:n.event_label,screen_name:n.screen_name,...n.optional_params||{},app_id:t.appName||t.appId||t.componentId,origin:"xtnd-web-component"};return G.push(r),Q(`[XTND WebComponent ${t.componentId}] Analytics event sent successfully:`,r),{eventId:`wc-${t.componentId}-${Date.now()}`,status:"success",message:"Analytics event sent successfully"}}catch(n){const r=n instanceof Error?n.message:"Unknown error";return console.error(`[XTND WebComponent ${t.componentId}] Failed to send analytics event:`,n),{eventId:`wc-${t.componentId}-${Date.now()}`,status:"failure",message:"Failed to send analytics event",error:r}}},Co={xtndSendAnalyticsEvent:Hu},Vu=async(t,e,n)=>{if(!Co[e])return{eventId:`web-component-${t.componentId}-${Date.now()}`,status:"failure",message:`Event handler not found: ${e}`,error:`Unsupported event type: ${e}`};try{return await Co[e](t,{data:n})}catch(r){const o=r instanceof Error?r.message:"Unknown error";return console.error(`Failed to handle event ${e}:`,r),Q(`Failed to handle event ${e}:`,r),{eventId:`wc-${t.componentId}-${Date.now()}`,status:"failure",message:`Failed to handle event: ${e}`,error:o}}},Gu=(t,e,n)=>{const r={componentId:t,appId:e,appName:n};return Q("XTND Web Component Communication context created for:",t),r},ju=(t,e,n)=>{const r=Gu(t,e,n);return{context:r,sendEvent:async(o,a)=>await Vu(r,o,a),getContext:()=>({...r})}},Ku=t=>({appUrl:t.getAttribute("data-app-url")||"",appId:t.getAttribute("data-app-id")||"",appName:t.getAttribute("data-app-name")||"",experienceId:t.getAttribute("data-experience-id")||"",enableShadowDOM:t.getAttribute("data-enable-shadow-dom")==="true"}),Yu=t=>{if(!t.appId)return console.error("XTND Bridge: App ID not found in component configuration."),null;const e=t.appId,n=ju(e,t.appId,t.appName);return Q("XTND Communication layer initialized for component:",e),n},Ju=t=>{if(!t){console.warn("Communication layer not initialized");return}window.xtndWebComponentSDK={sendEvent:t.sendEvent.bind(t)},Q("XTND Web Component communication layer established")},Qu=async t=>{try{const e=Ku(t);if(!e.appUrl)return console.error("XTND Bridge: App URL not found in component configuration."),null;const n=Yu(e);return n?(Ju(n),Q("XTND Web Component Bridge initialized successfully"),n):null}catch(e){return console.error("Failed to initialize XTND Bridge:",e),null}},Xu=async t=>{const e=t.querySelectorAll("xtnd-web-component"),n=new Map;return Q(`Found ${e.length}
16 XTND Web Component element(s) to mount`),await me(e,async r=>{try{const o=await Qu(r);o?(n.set(r,o),Q("XTND Web Component mounted:",r)):console.error("Failed to mount XTND Web Component:",r)}catch(o){console.error("Error mounting XTND Web Component:",r,o)}}),n},Zu=()=>{delete window.xtndWebComponentSDK,Q("XTND Web Component SDK cleaned up")},ep=async t=>{Q("Initializing XTND Web Components in scope:",t);try{const e=await Xu(t);Q(`Successfully mounted ${e.size} XTND Web Component(s)`)}catch(e){throw console.error("Failed to initialize XTND Web Components:",e),e}},tp={name:"Plug and Play - Web component communication",mount:ep,unmount:Zu};M.registerComponent(tp);Q("XTND Web Component registered with componentController");class np{shadowRoots=[];addShadowRoot(e){this.shadowRoots.push(e)}getShadowRootFor(e){return this.shadowRoots.filter(n=>n.getElementById(e))}getAmount(){return this.shadowRoots.length}}class rp{constructor(e){this.catalog=e}pendingMounts=new Map;registerMount(e,n){this.pendingMounts.set(e,n),Q(`Registered mount for app root: ${e}`)}notifyReady(e){Q("Received notify ready from web component");const n=this.pendingMounts.get(e);if(!n)throw new Error(`Mount function not found for app root: ${e}`);try{const r=this.catalog.getShadowRootFor(e);for(const o of r)try{n({shadowRoot:o})}catch(a){console.error(`Failed to mount web component app: ${e}`,a,o)}}finally{this.pendingMounts.delete(e)}}}const gi=new np,op=new rp(gi),ap=t=>({appUrl:t.getAttribute("data-app-url")||"",appId:t.getAttribute("data-app-id")||"",appName:t.getAttribute("data-app-name")||"",experienceId:t.getAttribute("data-experience-id")||""}),ip=t=>{const e=t.querySelector("body");return e?e.innerHTML:(console.error("No body tag found, returning full content"),null)},sp=async(t,e)=>{const n=new CSSStyleSheet;let r="";const o=t.querySelectorAll('link[rel="stylesheet"]');for(const a of o){const i=a.getAttribute("href");if(i)try{let s=i;i.startsWith("http")||(s=`${new URL(e).origin}${i}`);const c=await fetch(s);if(c.ok){const l=await c.text();r+=l+`
17`}else console.warn("Failed to load stylesheet:",s,c.status)}catch(s){console.error("Error fetching stylesheet:",i,s)}}return r.trim()?n.replaceSync(r):console.warn("No styles found in HTML document"),n},cp=t=>{const e=[];return t.querySelectorAll("script").forEach(r=>{const o=r.outerHTML;e.push(o)}),e},lp=async t=>{try{const e=await fetch(t);if(!e.ok)throw new Error(`Network response was not ok: ${e.status}`);const n=await e.text(),r=new DOMParser().parseFromString(n,"text/html"),o=await sp(r,t),a=cp(r);return{body:ip(r),styles:o,scripts:a}}catch(e){throw console.error("Fetch operation failed:",e),e}},dp=(t,e)=>{e&&t&&(t.innerHTML=e,Q("Body content injected successfully"))},up=(t,e)=>{t.adoptedStyleSheets=[e]},pp=(t,e,n)=>{e.forEach(r=>{const o=document.createElement("div");o.innerHTML=r;const a=o.querySelector("script");if(a){const i=document.createElement("script");i.type=a.getAttribute("type")||"text/javascript";
17const s=a.getAttribute("src");if(s)if(s.startsWith("http"))i.src=s;else{const l=new URL(n).origin;i.src=`${l}${s}`}const c=a.getAttribute("crossorigin");c!==null&&(i.crossOrigin=c),i.onload=()=>{Q("script loaded successfully")},t.appendChild(i),Q("Script injected to shadow root:",s||"inline script")}})},Ao=(t,e,n)=>{const r=t.querySelector(".xtnd-placeholder");r&&(r.innerHTML=`
18            <div style="color: #d32f2f; text-align: center;">
19                <h3>Error Loading XTND App</h3>
20                <p>${e}</p>
21                <p><strong>App URL:</strong> ${n||"Not specified"}</p>
22            </div>
23        `)},mp=async(t,e)=>{if(!e.appUrl){console.error("App URL not found in component configuration."),Ao(t,"SPA URL not configured",e.appUrl);return}try{const{body:n,styles:r,scripts:o}=await lp(e.appUrl);dp(t,n),up(t,r),pp(t,o,e.appUrl),Q("XTND component initialized successfully")}catch(n){console.error("Failed to load XTND app content:",n);const r=n instanceof Error?n.message:"Unknown error";Ao(t,`Failed to load content: ${r}`,e.appUrl)}},hp=()=>class extends HTMLElement{state;constructor(){super(),this.state={shadowRoot:this.attachShadow({mode:"closed"}),isConnected:!1,config:ap(this)},gi.addShadowRoot(this.state.shadowRoot),Q("XTND Web Component created",this.state.shadowRoot)}connectedCallback(){this.state.isConnected=!0,mp(this.state.shadowRoot,this.state.config),Q("XTND Web Component connected",this.state.shadowRoot)}disconnectedCallback(){this.state.isConnected=!1,this.state.shadowRoot=null,Q("XTND Web Component disconnected",this.state.shadowRoot)}},gp=hp();"customElements"in window?customElements.get("xtnd-web-component")?console.warn("XTND Web Component already registered"):(window.xtndWebComponentRegistry=op,customElements.define("xtnd-web-component",gp),Q("XTND Web Component registered successfully")):console.error("Web Components not supported in this browser");const fp=()=>new Promise(t=>{const e=setInterval(()=>{if(!window.Optanon?.IsAlertBoxClosedAndValid)return;const n=()=>{window.Optanon.IsAlertBoxClosedAndValid()&&(t(),clearInterval(e))};window.Optanon.OnConsentChanged(()=>{n()}),n()},500)}),Mt={modalDialog:"cep-modal-dialog",modalDialogWrapper:"cep-modal-dialog__wrapper",modalDialogClose:"cep-modal-dialog__close"},wn=t=>!t||t===document.body||t===document.documentElement||!t.isConnected?!1:!t.hasAttribute("disabled")&&!t.hasAttribute("hidden")&&!t.closest("[inert]"),yp=(t,e,n)=>{const r=document.activeElement;return wn(r)&&!n.contains(r)?!1:wn(t)?t:wn(e)?e:!1};class wp{currentModal;queue;isWaitingForOnetrust;isBackdropPointerDown;focusTrap;lastFocusedElement;constructor(){if(this.queue=[],this.currentModal=null,this.isWaitingForOnetrust=!0,this.isBackdropPointerDown=!1,this.focusTrap=null,this.lastFocusedElement=null,document.addEventListener("focusin",this.trackFocusedElement,!0),!window.OptanonWrapper){v.log("[Modal Controller] OneTrust is not initialized on this page, canceling waiting for it"),this.isWaitingForOnetrust=!1,this.openNextFromQueue();return}const e=setTimeout(()=>{if(document.documentElement.classList.contains("ot-modal-open")){v.log("[Modal Controller] OneTrust modal is open, awaiting user interaction");return}if(this.isWaitingForOnetrust){v.log("[Modal Controller] OneTrust is taking too long to initialize, aborting waiting for it"),this.isWaitingForOnetrust=!1,this.openNextFromQueue();return}v.log("[Modal Controller] OneTrust is already initialized and closed")},3e3);(async()=>(await fp(),v.log("[Modal Controller / Onetrust] OneTrust is valid and closed, clearing timeout"),clearTimeout(e),this.isWaitingForOnetrust=!1,this.openNextFromQueue()))()}generateUniqueId(e){const n=crypto.randomUUID();return`${e.replace(/\s+/g,"_")}_${n}`}requestOpen(e){const n=this.generateUniqueId(e.name);if(e.id=n,v.log(`[Modal Controller] Requesting to open modal: ${e.id}`),this.isWaitingForOnetrust)return v.log(`[Modal Controller] Waiting for Onetrust. Queueing modal: ${e.id}`),this.addToQueue(e),{status:"queued",id:n};if(!this.currentModal)return v.log(`[Modal Controller] Opening modal: ${e.id}`),this.currentModal=e,this.onBeforeDialogOpened(),this.currentModal.openFn(),{status:"opened",id:n};const r=this.currentModal.priority,o=e.priority;return v.log(`[Modal Controller] Priority comparison: ${r} vs ${o}`),r==="auto"&&o==="auto"?(v.log(`[Modal Controller] Queueing: ${e.id}`),this.addToQueue(e),{status:"queued",id:n}):r==="auto"&&o==="manual"?(v.log(`[Modal Controller] Aborting: ${e.id}`),{status:"aborted",id:n}):r==="manual"&&o==="auto"?(v.log(`[Modal Controller] Queueing auto modal behind manual: ${e.id}`),this.addToQueue(e),{status:"queued",id:n}):(v.log(`[Modal Controller] Closing ${this.currentModal.id} and opening: ${e.id}`),this.currentModal.closeFn(),this.onAfterDialogClosed(!1),this.currentModal=e,this.onBeforeDialogOpened(),this.currentModal.openFn(),{status:"opened",id:n})}requestClose(e){if(!!this.queue.find(r=>r.id===e)){v.log(`[Modal Controller] Modal is queued, aborting close request: ${e}`);return}if(v.log(`[Modal Controller] Requesting to close modal: ${e}`),this.currentModal?.id!==e){v.log(`[Modal Controller] Requested modal is not currently open: ${e}`);return}this.currentModal.closeFn(),this.onAfterDialogClosed(),this.queue.length>0?this.openNextFromQueue():this.currentModal=null}addToQueue(e){e.priority==="auto"||this.queue.length===0?this.queue.push(e):v.log(`[Modal Controller] Manual modals can be added only if queue is empty. Skipping: ${e.id}`)}openNextFromQueue(){if(this.queue.length===0){v.log("[Modal Controller] Queue is empty, nothing to open");return}this.currentModal=this.queue.shift(),v.log(`[Modal Controller] Opening modal from queue: ${this.currentModal.id}`),this.onBeforeDialogOpened(),this.currentModal.openFn()}onBeforeDialogOpened(){if(this.currentModal?.dialogElement){if(this.currentModal.allowKeyboardClose&&this.currentModal.id&&document.addEventListener("keydown",this.onEscapeDown),this.currentModal.allowBackdropClose&&this.currentModal.id&&(this.currentModal.dialogElement.addEventListener("click",this.onBackdropClick),this.currentModal.dialogElement.addEventListener("pointerdown",this.onBackdropPointerDown)),this.currentModal.id&&this.currentModal.isModal){const e=this.lastFocusedElement,n=this.currentModal.dialogElement;this.focusTrap=Qt(n,{fallbackFocus:()=>n.querySelector(`.${Mt.modalDialogClose}`),setReturnFocus:r=>yp(r,e,n)}),this.focusTrap.activate()}document.body.classList.toggle("scroll-lock",!0)}}onAfterDialogClosed(e=!0){this.currentModal?.dialogElement&&(document.removeEventListener("keydown",this.onEscapeDown),this.currentModal.dialogElement.removeEventListener("click",this.onBackdropClick),this.currentModal.dialogElement.removeEventListener("pointerdown",this.onBackdropPointerDown),this.focusTrap?.active&&this.focusTrap.deactivate({returnFocus:e}),document.body.classList.toggle("scroll-lock",!1),this.lastFocusedElement=null)}trackFocusedElement=e=>{const n=e.target;wn(n)&&(this.lastFocusedElement=n)};onEscapeDown=e=>{e.key==="Escape"&&this.requestClose(this.currentModal.id)};onBackdropPointerDown=e=>{const n=e.target;this.isBackdropPointerDown=n.classList.contains(Mt.modalDialog)||n.classList.contains(Mt.modalDialogWrapper)};onBackdropClick=e=>{const n=e.target;(n.classList.contains(Mt.modalDialog)||n.classList.contains(Mt.modalDialogWrapper))&&this.isBackdropPointerDown&&this.requestClose(this.currentModal.id),this.isBackdropPointerDown=!1}}const bp=new Promise(t=>{document.readyState!=="loading"?t():document.addEventListener("DOMContentLoaded",()=>{t()})});let _o=!1;const Po=t=>{try{const e=new t;e.apiEnabled?window.smartbanner=e:e.publish(),v.log("Smartbanner created")}catch(e){v.log("Failed to create smartbanner",e)}},vp=async()=>
23{if(!!!document.querySelector('meta[name="smartbanner:button-url-google"]')){v.log('Tag "smartbanner:button-url-google" not found, skipping smartbanner.js');return}if(!_o){_o=!0,v.log('Tag "smartbanner:button-url-google" detected, preparing to load smartbanner.js');try{const{default:e}=await Z(async()=>{const{default:n}=await import("./smartbanner.js");return{default:n}},[],import.meta.url);document.readyState==="complete"?Po(e):(v.log("Smartbanner loaded, waiting for the load event"),window.addEventListener("load",()=>Po(e),{once:!0}))}catch(e){v.log("Failed to import smartbanner.js",e)}}},j={lengths:{title:{min:29,max:61},description:{min:71,max:153},h1:{min:4,max:60},image:{altText:{min:4}}},dimensions:{featuredImage:{width:1200,height:600,aspectRatio:2,aspectRatioSafetyMargin:.025}},text:{toolTitle:"OneXP Content Quality Checker",successTitle:"Success! No issues detected.",errorTitle:"Warning! Detected {{issues_amount}} issue(s).",showDetails:"Show details",hideDetails:"Hide details",fixIt:"Fix it",links:{check:"Check",loading:"Checking...",error:"Checking error",success:"Checked successfully"},disclaimer:`In order to interact with the Page Validation Tool, enter either the "View as Published", or
24 the "Preview" mode.`,hiddenItemTooltip:`Given element is currently hidden. Can't perform scroll.
25            It might be inside a modal, hidden on desktop, or conditionally invisible (e.g. on hover).
26            Try looking for this element in the authoring mode (or page markup).`}},B={buttonSecondary:"button-secondary",buttonTertiary:"button-tertiary",loading:"loading",wrapper:"page-validation",error:"page-validation--error",expanded:"page-validation--expanded",wrapperHidden:"page-validation--hidden",titleWrapper:"page-validation__title",severities:"page-validation__severities",severity:"page-validation__severity",severityLinks:"links",severityExpanded:"page-validation__severity--expanded",severityTop:"page-validation__severity-top",severityTitle:"page-validation__severity-title",severityTotal:"page-validation__severity-total",severityExpandButton:"page-validation__severity-expand-button",severityBottom:"page-validation__severity-bottom",issue:"page-validation__issue",issueTop:"page-validation__issue-top",issueTopTitle:"page-validation__issue-top-title",issueTopControls:"page-validation__issue-top-controls",issueBottom:"page-validation__issue-bottom",issueExpanded:"page-validation__issue--expanded",area:"page-validation__issue-area",violation:"page-validation__issue-violation",tooltipsWrapper:"page-validation__tooltips-wrapper",tooltip:"page-validation__tooltip",tooltipTrigger:"page-validation__tooltip-trigger",tooltipTriggerInfo:"page-validation__tooltip-trigger--info",tooltipTriggerContent:"page-validation__tooltip-trigger--content",tooltipContent:"page-validation__tooltip-content",fixItButton:"page-validation__issue-fix-it-button",issueExpandButton:"page-validation__issue-expand-button",issueInstancesListSubtitle:"page-validation__issue-instances-list-subtitle",issueInstancesList:"page-validation__issue-instances-list",issueInstancesItem:"page-validation__issue-instances-item",issueInstancesItemHidden:"page-validation__issue-instances-item--hidden",detailsButton:"page-validation__details-button",checkLinksButton:"page-validation__check-links-button",checkLinksButtonError:"page-validation__check-links-button--error",checkLinksButtonLoading:"page-validation__check-links-button--loading",checkLinksButtonSuccess:"page-validation__check-links-button--success",buttonsWrapper:"page-validation__buttons-wrapper",closeButton:"page-validation__close-button",disclaimer:"page-validation__disclaimer",highlight:"page-validation__highlight",highlightBackgroun
26d:"page-validation__highlight-background",brokenLinksResults:"page-validation__broken-links-results"},ae={config:'meta[name="page-validation"]',title:'meta[property="og:title"]',description:'meta[property="og:description"]',featuredImageAltText:'meta[property="og:image:alt"]',campaign:'meta[name="campaign"]',contentType:'meta[name="contentType"]',publicationDate:".publicationDate",header:".header",headerSubmenu:".header .submenu",carousel:".carousel",splideClone:".splide__slide--clone",carouselItem:".cmp-carousel__item:not(.splide__slide--clone)",onetrustWrapper:"#onetrust-consent-sdk",fullScreenXtndApp:".xtnd-app--full-screen"},Sp=[{fullPath:"/content/dam/onexp/global"},{fullPath:"/content/dam/onexp/shared"},{fullPath:"/content/onexp/country-selector",isShortenedOnCdn:!0},{fullPath:"/content/onexp/privacy-policy",isShortenedOnCdn:!0},{fullPath:"/content/onexp/terms-of-service",isShortenedOnCdn:!0},{fullPath:"/content/onexp/dsr",isShortenedOnCdn:!0}],Dr=t=>Sp.some(({fullPath:e,isShortenedOnCdn:n})=>t.startsWith(e)||n&&t.startsWith(e.replace("/content/onexp",""))),Ge=t=>{const e=[ae.splideClone,ae.onetrustWrapper,ae.fullScreenXtndApp];return[...document.querySelectorAll(t)].filter(n=>e.every(r=>!n.closest(r)))},Wn=()=>!!document.querySelector(ae.fullScreenXtndApp),bt=t=>document.head.querySelector(t)?.content||null,fi=(t,e)=>{if(!t)return!1;const n={article:/article/i,campaign:/campaign/i,promo:/promo/i,"press release":/press release/i};return e.some(r=>n[r].test(t))},Ep=async t=>new Promise((e,n)=>{const r=new XMLHttpRequest;r.open("GET",t,!0),r.onreadystatechange=()=>{r.readyState===XMLHttpRequest.HEADERS_RECEIVED&&(e(r.status),r.abort())},r.onload=()=>{e(r.status)},r.onerror=()=>{n(new Error("Network error while checking"))},r.ontimeout=()=>{n(new Error("Request timed out"))},r.timeout=6e4,r.send()}),Cp=async t=>{const e=t.getAttribute("href");if(!e||e==="/"||e.startsWith("#")||e.startsWith("javascript:")||e.startsWith("data:")||e.startsWith("vbscript:")||e.startsWith("mailto:")||e.startsWith("tel:")||da(e)||Dr(e))return null;try{const n=await Ep(e);if(n<300)return null;let r;return n>=300&&n<400?(r="Redirect - this may impact SEO performance",{link:t,status:n,errorExplanation:r}):(n===401||n===403?r="Requires login - may not be accessible to all users":n===404?r="Page not found":n>=500?r="Server error - the destination server is experiencing issues":r="Unknown Client Error",{link:t,status:n,errorExplanation:r})}catch(n){return{link:t,status:0,errorExplanation:n.message||"Network error or timeout - unable to validate this link"}}},cr={ruleId:"incorrectLinksOnThePage",area:"SEO",severity:"links",violation:"Found incorrect links or redirects on the page",description:"Linking to redirecting pages, pages requiring login, or non-existent pages can cause SEO issues.",disableAutoRun:!0,validate:async()=>{const e=Ge("a[href]").map(Cp),n=(await Promise.all(e)).filter(Boolean);return n.length===0?void 0:{instances:n.map(o=>{const a=ua(Zn(o.link.getAttribute("href")));return{element:o.link,label:`Status code: ${o.status} - ${o.errorExplanation}`,severity:"links",violatingContent:a}}).filter(Boolean)}}};class Ap{constructor(e,n=!1,r=[]){this.issues=e,this.renderFixItLinks=n,this.ruleIds=r,this.rootContainer=document.querySelector(".root > .cmp-container"),this.groupedIssues=this.getGroupedIssues(e),this.isError=e.length>0}rootContainer;wrapper;groupedIssues;isError;updateHeadline;checkLinksButton;getGroupedIssues(e){const n={critical:[],moderate:[],low:[],links:[]};return e.forEach(r=>{n[r.severity].push(r)}),n}prepareBannerTitleSection(){const e=document.createElement("section"),n=document.createElement("h4"),r=document.createElement("h2");return e.classList.add(B.titleWrapper),n.textContent=j.text.toolTitle,this.updateHeadline=()=>{this.isError?r.textContent=j.text.errorTitle.replace("{{issues_amount}}",`${this.issues.length}`):r.textContent=j.text.successTitle},this.updateHeadline(),e.appendChild(n),e.appendChild(r),e}prepareSeverityTopSection(e,n,r){const o=document.createElement("div");o.classList.add(B.severityTop);const a=document.createElement("p");a.classList.add(B.severityTitle),a.textContent=`${e} issues`;const i=document.createElement("p");if(i.classList.add(B.severityTotal),e==="links"?i.textContent=`Total: ${r?n:"unverified"}`:i.textContent=`Total: ${n}`,o.appendChild(a),o.appendChild(i),n===0)return o;const s=document.createElement("button");return s.classList.add(B.severityExpandButton,B.buttonTertiary),o.addEventListener("click",()=>{o.parentElement.classList.toggle(B.severityExpanded)}),o.appendChild(s),o}scrollToElement(e){const n=e.closest(ae.carousel),o=e.closest(ae.header)&&!e.closest(ae.headerSubmenu)?e.closest("li"):null,a=n||o||e,i=o||e;if(n){const s=n.id,c=e.closest(ae.carouselItem).id,l=[...n.querySelectorAll(ae.carouselItem)].findIndex(({id:d})=>d===c);dispatchEvent(new CustomEvent("page-validation-scroll-to-carousel-element",{detail:{carouselId:s,slideIndex:l}}))}if(a.scrollIntoView({behavior:"smooth",block:"center",inline:"center"}
26),!i.querySelector(`.${B.highlightBackground}`)){const s=document.createElement("div");s.classList.add(B.highlightBackground),i.insertAdjacentElement("afterbegin",s)}setTimeout(()=>{i.classList.add(B.highlight),setTimeout(()=>{i.classList.remove(B.highlight),i.querySelector(`.${B.highlightBackground}`)?.remove()},1800)},500)}renderInstances(e){const n=document.createElement("ol");return n.classList.add(B.issueInstancesList),e.forEach(r=>{const o=document.createElement("li");o.classList.add(B.issueInstancesItem),"element"in r?this.renderElementIssueInstance(o,r):"href"in r?this.renderLinkIssueInstance(o,r):r.label&&this.renderSimpleIssueInstance(o,r),n.appendChild(o)}),n}renderLinkIssueInstance(e,n){const r=document.createElement("a");r.classList.add(B.buttonTertiary),r.textContent=n.label.trim();const o=new URL(window.location.href),a=new URL(n.href,window.location.origin);o.searchParams.has("wcmmode","disabled")&&(v.log('[Page Validation] Appending "wcmmode=disabled" query param.'),a.searchParams.set("wcmmode","disabled")),r.href=a.href,r.target="_blank",e.appendChild(r)}renderSimpleIssueInstance(e,n){const r=document.createElement("span");r.textContent=n.label||"",e.appendChild(r)}renderElementIssueInstance(e,n){const{element:r}=n,o=!!r.closest(ae.carousel),a=document.createElement("div");a.classList.add(B.tooltipsWrapper);const i=oa(r)&&!o;if(i){const c=this.prepareTooltip(j.text.hiddenItemTooltip,"hidden");a.appendChild(c)}e.classList.toggle(B.issueInstancesItemHidden,i);const s=document.createElement("p");if(s.classList.toggle(B.buttonTertiary),r.tagName==="IMG"){i||e.addEventListener("click",l=>{l.preventDefault(),this.scrollToElement(r.parentElement)});const c=document.createElement("span");if(c.textContent=r.getAttribute("src")?.split("/").pop()||"(unknown filename)",s.appendChild(c),e.appendChild(s),"violatingContent"in n){const l=this.prepareTooltip(n.violatingContent||"(empty)","content",n.violatingContent&&!!n.quoteViolatingContent);a.appendChild(l)}}else{i||e.addEventListener("click",p=>{p.preventDefault(),this.scrollToElement(r)});const c=n.label.trim(),l=c.replace(/\s/g,"").length===0,d=document.createElement(!l&&n.quoteInstanceLabel?"q":"span");if(l?d.textContent="(empty)":d.textContent=c,s.appendChild(d),e.appendChild(s),n.violatingContent){const p=this.prepareTooltip(n.violatingContent,"content",!!n.quoteViolatingContent);a.appendChild(p)}}e.appendChild(a)}renderInstancesSubtitle(e){const n=document.createElement("p");return n.classList.add(B.issueInstancesListSubtitle),n.textContent=e,n}prepareIssueWrapper(e){const n=e.instances&&e.instances.length>0,r=document.createElement("div");r.classList.add(B.issue);const o=document.createElement("div");o.classList.add(B.issueTop);const a=document.createElement("div");a.classList.add(B.issueTopTitle);const i=document.createElement("p");i.classList.add(B.area),i.textContent=`${e.area}:`;const s=document.createElement("p");s.classList.add(B.violation),s.textContent=e.violation;const c=document.createElement("div");c.classList.add(B.tooltipsWrapper);const l=this.prepareTooltip(e.description,"info");if(c.appendChild(l),a.appendChild(i),a.appendChild(s),(!n||"forceIssueLevelTooltip"in e)&&"violatingContent"in e){const{violatingContent:f}=e;let y=null;f?y=this.prepareTooltip(f,"content",!!e.quoteViolatingContent):y=this.prepareTooltip("(empty)","content"),c.appendChild(y)}const d=document.createElement("div");if(d.classList.add(B.issueTopControls),o.appendChild(a),o.appendChild(c),o.appendChild(d),r.appendChild(o),this.renderFixItLinks&&e.fixItPath){const f=this.prepareFixItButton(e.fixItPath);d.appendChild(f)}if(!n)return r;const p=document.createElement("div");p.classList.add(B.issueBottom);const u=this.renderInstances(e.instances),g=document.createElement("button");if(g.classList.add(B.issueExpandButton,B.buttonTertiary),o.addEventListener("click",()=>{r.classList.toggle(B.issueExpanded)}),d.appendChild(g),"instancesListSubtitle"in e&&e.instancesListSubtitle){const f=this.renderInstancesSubtitle(e.instancesListSubtitle);p.appendChild(f)}return p.appendChild(u),r.appendChild(p),r}prepareSeverityBottomSection(e){const n=document.createElement("div");return n.classList.add(B.severityBottom),e.forEach(r=>{const o=this.prepareIssueWrapper(r);n.appendChild(o)}),n}prepareTooltip(e,n,r=!1){const o=document.createElement("div");o.classList.add(B.tooltip);const a=document.createElement("i");a.classList.add(B.tooltipTrigger,`${B.tooltipTrigger}--${n}`);const i=document.createElement("div");i.classList.add(B.tooltipContent);const s=document.createElement(r?"q":"p");return s.textContent=e,i.appendChild(s),o.appendChild(a),o.appendChild(i),o.addEventListener("click",c=>{c.stopPropagation()}),o}generateFixItLink(e){return!e||e==="#"?"#":e}prepareFixItButton(e){const n=document.createElement("a");return n.classList.add(B.fixItButton,B.buttonTertiary),n.textContent=j.text.fixIt,n.href=this.generateFixItLink(e),n.target="_blank",n}toggleCheckLinksButtonState(e){switch(e){case"initial":this.checkLinksButton.disabled=!1,this.checkLinksButton.textContent=j.text.links.check,this.checkLinksButton.classList.remove(B.checkLinksButtonLoading),this.checkLinksButton.classList.remove(B.checkLinksButtonError);break;case"loading":this.checkLinksButton.disabled=!0,this.checkLinksButton.textContent=j.text.links.loading,this.checkLinksButton.classList.add(B.checkLinksButtonLoading);break;case"error":this.checkLinksButton.disabled=!0,this.checkLinksButton.textContent=j.text.links.error,this.checkLinksButton.classList.remove(B.checkLinksButtonLoading),this.checkLinksButton.classList.add(B.checkLinksButtonError);break;case"success":this.checkLinksButton.disabled=!0,this.checkLinksButton.textContent=j.text.links.success,this.checkLinksButton.classList.remove(B.checkLinksButtonLoading),this.checkLinksButton.classList.add(B.checkLinksButtonSuccess);break}}prepareCheckLinksButton(){this.checkLinksButton=document.createElement("button"),this.checkLinksButton.classList.add(B.checkLinksButton,B.buttonSecondary),this.toggleCheckLinksButtonState("initial"),this.checkLinksButton.addEventListener("click",async()=>{this.toggleCheckLinksButtonState("loading");try{const e=await cr.validate();if(v.log("[Page Validation] Incorrect links validation results:",e),this.issues=this.issues.filter(n=>n.ruleId!=="incorrectLinksOnThePage"),e&&"instances"in e){const{ruleId:n,area:r,severity:o,violation:a,description:i}=cr,{instances:s}=e;this.issues.push({ruleId:n,area:r,severity:o,violation:a,description:i,instances:s})}this.groupedIssues=this.getGroupedIssues(this.issues),this.isError=this.issues.length>0,this.updateHeadline(),this.updateLinksSeveritySection(),this.wrapper.classList.toggle(B.error,this.isError),this.toggleCheckLinksButtonState("success")}catch(e){v.log("[Page Validation] Failed to check links:",e),this.toggleCheckLinksButtonState("error"),setTimeout(()=>{this.toggleCheckLinksButtonState("initial")},3e3)}})}updateLinksSeveritySection(){const e=this.issues.filter(i=>i.severity==="links");this.wrapper.querySelector(`.${B.severityLinks}`)?.remove();const r=this.prepareSeverityWrapper("links",e,!0);r.querySelector(`.${B.severityTotal}`).insertAdjacentElement("afterend",this.checkLinksButton),r.classList.add(B.severityExpanded),r.querySelector(`.${B.issue}`)?.classList.add(B.issueExpanded),this.wrapper.querySelector(`.${B.severities}`)?.appendChild(r)}prepareSeverityWrapper(e,n,r){const{length:o}=n;if(o===0&&e!=="links")return null;let a=null;e==="links"?a=this.prepareSeverityTopSection(e,n?.[0]?.instances?.length||0,r):a=this.prepareSeverityTopSection(e,o);const i=document.createElement("section");if(i.classList.add(B.severity,e),i.appendChild(a),e==="links"&&n[0]?.instances?.length===0)return i;const s=this.prepareSeverityBottomSection(n);return i.appendChild(s),i}prepareSeveritiesWrapper(){const e=document.createElement("section");return e.classList.add(B.severities),Object.entries(this.groupedIssues).forEac
26h(([n,r])=>{const o=this.prepareSeverityWrapper(n,r);o&&e.appendChild(o)}),e.children?.[0].classList.add(B.severityExpanded),e}prepareButtonsWrapper(){const e=document.createElement("div");e.classList.add(B.buttonsWrapper),this.ruleIds.includes("incorrectLinksOnThePage")&&(this.prepareCheckLinksButton(),this.wrapper.querySelector(`.${B.severityLinks} .${B.severityTop}`).appendChild(this.checkLinksButton));const n=this.prepareDetailsButton();return e.appendChild(n),e}prepareDetailsButton(){const e=document.createElement("button"),n=!!this.wrapper.querySelector(`.${B.severityLinks}`);return e.textContent=n?j.text.hideDetails:j.text.showDetails,e.classList.add(B.detailsButton,B.buttonTertiary),e.addEventListener("click",()=>{this.wrapper.classList.toggle(B.expanded),this.wrapper.classList.contains(B.expanded)?e.textContent=j.text.hideDetails:e.textContent=j.text.showDetails}),e}prepareDisclaimer(){const e=document.createElement("p");return e.classList.add(B.disclaimer),e.textContent=j.text.disclaimer,e}prepareCloseButton(){const e=document.createElement("button");return e.classList.add(B.closeButton),e.addEventListener("click",()=>{this.wrapper.classList.add(B.wrapperHidden)}),e}renderBanner(){if(this.rootContainer.querySelector(`.${B.wrapper}`)){v.log("[Page Validation] Tool is already present. Aborting.");return}this.wrapper=document.createElement("article"),this.wrapper.classList.add(B.wrapper),this.wrapper.classList.toggle(B.error,this.isError);const e=this.prepareCloseButton(),n=this.prepareBannerTitleSection(),r=this.prepareDisclaimer();this.wrapper.appendChild(e),this.wrapper.appendChild(n),this.wrapper.appendChild(this.prepareSeveritiesWrapper()),this.wrapper.appendChild(this.prepareButtonsWrapper()),ie&&this.wrapper.appendChild(r),this.rootContainer.insertAdjacentElement("afterbegin",this.wrapper),this.wrapper.classList.add(B.expanded)}}const _p=()=>{const t=ct(),e=Ge("a").filter(o=>{const a=o.getAttribute("href");if(!a)return!0;if(a.startsWith("#")||Zn(a)==="/"||da(a))return!1;if(nc(a)){const i=ct(a);return t!==i}else{const i=ct(a);return!i||i!==t}}).map(o=>{const a=ua(Zn(o.getAttribute("href")));return{label:o.textContent,element:o,path:o.getAttribute("href"),violatingContent:a,quoteInstanceLabel:!0}}),n=Ge(".cmp-experiencefragment").filter(o=>{const{path:a}=o.dataset,i=ct(a);return!a||i!==t}).map(o=>({label:"Experience Fragment",element:o,path:o.dataset.path,violatingContent:o.dataset.path.replace("/jcr:content","")})),r=Ge("[data-cmp-contentfragment-path]").filter(o=>{const{cmpContentfragmentPath:a}=o.dataset,i=ct(a);return!a||i!==t}).map(o=>({label:"Content Fragment",element:o,path:o.dataset.cmpContentfragmentPath,violatingContent:o.dataset.cmpContentfragmentPath}));return[...e,...n,...r]},Pp={ruleId:"incorrectContentReferences",area:"Information Architecture",severity:"low",violation:"Page includes elements pointing to incorrect content",description:`Make sure that all links, experience fragments, and content fragments
27        point to content from either the current market, global, or shared directories.`,validate:()=>{const t=_p().filter(e=>!Dr(e.path));if(t.length!==0)return{instances:t}}},Ip={ruleId:"pageTitleLength",area:"SEO",severity:"critical",violation:"Page title has wrong length",description:`Page title should be between ${j.lengths.title.min} and ${j.lengths.title.max} characters.
28 Leaving the page title too short or too long negatively impacts SEO rankings as well as CTR (click-through rates) in SEO.`,validate:t=>{const e=bt(ae.title);if(!(e&&e.length>=j.lengths.title.min&&e.length<=j.lengths.title.max))return{fixItPath:t.pagePropertiesPath,violatingContent:e,quoteViolatingContent:!0}}},Tp={ruleId:"pageDescriptionLength",area:"SEO",severity:"critical",violation:"Page description has wrong length, or is empty",description:`Page description should be between ${j.lengths.description.min}
29 and ${j.lengths.description.max} characters. Leaving the page description too short, too long, or empty negatively
30 impacts SEO rankings as well as CTR (click-through rates) in SEO.`,validate:t=>{const e=bt(ae.description);if(!(e&&e.length>=j.lengths.description.min&&e.length<=j.lengths.description.max)
30)return{fixItPath:t.pagePropertiesPath,violatingContent:e,quoteViolatingContent:!0}}},Lp={ruleId:"genericCampaignId",area:"Analytics",severity:"moderate",violation:"Generic Campaign ID",description:`Campaign ID should not be set to the generic one ("Other"), as it leads to poor data
31 quality in Analytics.`,appliesTo:t=>fi(t.metaData.contentType,["campaign","promo"]),validate:t=>{if(bt(ae.campaign)==="Other")return{fixItPath:t.pagePropertiesPath,quoteViolatingContent:!0}}},kp="https://xtnd-lang-publish.coca-cola.com/page-validator/rules.json";let un=null,Io=0;const Rp=5*60*1e3;async function Dp(){const t=Date.now();if(un&&t-Io<Rp)return un;const e=await fetch(kp);if(!e.ok)throw new Error(`Failed to fetch rules: ${e.status}`);return un=await e.json(),Io=t,un}function Op(t,e){if(!e||e.trim()==="")return!0;try{return new RegExp(e).test(t)}catch{return v.warn(`[Analytics Checker] Invalid URL pattern: ${e}`),!1}}function Np(t){return(t||"").trim().toLowerCase()==="required"}function xp(t){return!t.authoringRule?.trim()||!t.elementSelector?.trim()?null:Np(t.elementCondition)?Ge(t.elementSelector).length===0?{label:t.authoringRule,severity:t.severity?t.severity:"moderate"}:null:(t.elementCondition?.trim()&&v.warn(`[Analytics Checker] Unsupported elementCondition "${t.elementCondition}" for rule: ${t.authoringRule}`),null)}const $p={ruleId:"analyticsChecker",area:"Analytics",severity:"moderate",violation:"Analytics tagging rules violated",description:"One or more analytics tagging rules defined for this campaign are not satisfied.",appliesTo:()=>!Wn(),validate:async()=>{const t=bt(ae.campaign);if(!t||t==="Other"){v.log("[Analytics Checker] No valid campaign ID found, skipping validation");return}try{const n=(await Dp())[t];if(!n?.data?.length){v.log(`[Analytics Checker] No rules found for campaign: ${t}`);return}const r=window.location.pathname.replace(/\.html$/,""),o=[];for(const a of n.data){const i=a["urlPattern (optional)"]||a.urlPattern;if(!Op(r,i))continue;const s=xp(a);s&&o.push(s)}if(o.length===0){v.log("[Analytics Checker] All analytics rules passed");return}return v.log(`[Analytics Checker] Found ${o.length} violation(s)`),{instances:o}}catch(e){console.error("[Analytics Checker] Failed to validate:",e);return}}},Mp={ruleId:"featuredImageNotConfigured",area:"Social Media",severity:"moderate",violation:"Featured image is not configured",description:`Pages should have featured image configured in order to improve CTR (Click-through rates) from
32 Social Media. Having a good quality image for a page shared in Social Media greatly improves the visibility of
33 the link shared.`,validate:t=>{if(!t.backendData.featuredImagePath)return{fixItPath:t.pagePropertiesPath}}},Up={ruleId:"featuredImageAltTextEmptyOrTooShort",area:"Social Media",severity:"low",violation:"Featured image alt text is empty, or too short",description:`Featured image, similar to other images on the page, should have a descriptive alt text configured,
34 longer than ${j.lengths.image.altText.min} characters.`,validate:t=>{if(!t.backendData.featuredImagePath)return;const e=bt(ae.featuredImageAltText);if(!(e&&e.length>=j.lengths.image.altText.min))return{fixItPath:t.pagePropertiesPath,violatingContent:e,quoteViolatingContent:!0}}},Bp={ruleId:"featuredImageIncorrectDimensions",area:"Social Media",severity:"low",violation:"Featured image does not meet minimum dimensions, and/or have incorrect aspect ratio",description:`For best results the image used as featured image should have minimum dimensions
35 of ${j.dimensions.featuredImage.width}x${j.dimensions.featuredImage.height}, and aspect ratio
36 of ${j.dimensions.featuredImage.aspectRatio}:1 (± ${j.dimensions.featuredImage.aspectRatioSafetyMargin}).`,validate:t=>{const{featuredImagePath:e,featuredImageWidth:n,featuredImageHeight:r}=t.backendData;if(!e)return;const o=n>=j.dimensions.featuredImage.width&&r>=j.dimensions.featuredImage.height,a=n/r,i=Math.abs(a-j.dimensions.featuredImage.aspectRatio)<=j.dimensions.featuredImage.aspectRatioSafetyMargin;if(o&&i)return;const s=o?"OK":"incorrect",c=i?"OK":"incorrect";return{fixItPath:t.pagePropertiesPath,violatingContent:`Dimensions: ${s} (${n}x${r});
37                    Aspect ratio: ${c} (${a}); Path: ${e}`}}},qp={ruleId:"singleH1HeadingElement",area:"Web Standards",severity:"moderate",violation:"There should be exactly one H1 heading on the page",description:`Exactly one H1 header should be configured on the page. Not having H1 impacts negatively SEO
38 Rankings. Having too many H1 can be confusing for consumers using assistive technologies (accessibility).`,appliesTo:()=>!Wn(),validate:()=>{const t=Ge("h1"),{length:e}=t;if(e!==1)return{instances:t.map(n=>({label:n.textContent,element:n,quoteInstanceLabel:!0})),forceIssueLevelTooltip:!0,...e===0&&{violatingContent:"No H1 heading found."},...e>1&&{violatingContent:"Multiple H1 headings found."}}}},Fp={ruleId:"H1HeadingLength",area:"Web Standards",severity:"moderate",violation:"H1 heading has wrong length",description:`H1 should have a length between ${j.lengths.h1.min} and ${j.lengths.h1.max} characters
39 for best SEO and UX results.`,appliesTo:()=>!Wn(),validate:()=>{const t=Ge("h1");if(t.length===0)return;const e=t[0],n=e.textContent.trim(),r=n.length;if(!(r>=j.lengths.h1.min&&r<=j.lengths.h1.max))return{instances:[{label:n,element:e,quoteInstanceLabel:!0}]}}},Wp=t=>t.classList.contains("cmp-thumbnail--fallback"),zp=t=>{const{role:e,ariaHidden:n}=t;return e==="presentation"||n==="true"},Hp=t=>{const{alt:e}=t;return e&&e.trim().length>=j.lengths.image.altText.min},Vp=t=>!Wp(t)&&!zp(t)&&!Hp(t),Gp={ruleId:"altTextEmptyOrTooShort",area:"Web Standards",severity:"moderate",violation:"Alt text is empty, or too short",description:`Every image should have a descriptive alt text configured (longer
40 than ${j.lengths.image.altText.min} characters), or be marked as decorative.`,appliesTo:()=>!Wn(),validate:()=>{const t=Ge("img").filter(Vp);if(t.length!==0)return{instances:t.map(e=>({element:e,violatingContent:e.alt,quoteViolatingContent:!0}))}}},jp={ruleId:"publicationDateNotConfigured",area:"Information Architecture",severity:"critical",violation:"Publication date is not configured, and/or is not used on the page",description:`Publication date should be configured in the Page Properties AND the Publication Date component
41 should be used on the page.`,appliesTo:t=>fi(t.metaData.contentType,["article","press release"]),validate:t=>{const{isPublicationDateConfigured:e}=t.backendData,n=document.querySelector(ae.publicationDate);if(e&&n)return;const a=`Page Properties: ${e?"OK":"not configured"}; Component: ${n?"OK":"not used"}`;return{fixItPath:t.pagePropertiesPath,violatingContent:a}}},Kp={ruleId:"incorrectContentFragment",area:"Information Architecture",severity:"low",violation:"Page is referencing an incorrect Content Fragment",description:`Make sure that the page's main Content Fragment
42        (configured in the Page Properties) refers to content from either
43        the current market, global, or shared directories.`,validate:t=>{const{contentFragmentPath:e}=t.backendData;if(!e)return;const n=ct(),r=ct(e);if(!(n===r||Dr(e)))return{fixItPath:t.pagePropertiesPath,violatingContent:`Current reference: ${e}`}}},Yp={ruleId:"pageDescriptionUniqueness",area:"SEO",severity:"critical",violation:"Page description is not unique within market scope",description:"Page description should be unique within the market to avoid SEO issues and content duplication.",instancesListSubtitle:"Other pages with the same description:",validate:t=>{if(!t.backendData?.pageDescriptionDuplicates)return;const e=t.backendData.pageDescriptionDuplicates,n=bt(ae.description);if(!(n?.trim().length===0||e.length===0))return{fixItPath:t.pagePropertiesPath,instances:e.map(([r,o])=>({label:r,href:o})),violatingContent:n,quoteViolatingContent:!0,forceIssueLevelTooltip:!0}}},Jp=[{label:"The Third Party Experience embeddable",selector:".embed:has(.cmp-embed__third-party-experience)",advice:"Please use the XTND App component instead."}],Qp={ruleId:"deprecatedComponentsUsed",area:"Information Architecture",severity:"critical",violation:"Page contains deprecated components",description:"Deprecated components are used on this page. Please replace them with the recommended alternatives.",validate:()=>{const t=[];if(Jp.forEach(e=>{const n=Ge(e.selector);n.length!==0&&n.forEach(r=>{t.push({label:e.label,element:r,violatingContent:e.advice})})}),t.length!==0)return{instances:t}}},Xp=[Ip,Tp,Yp,Lp,$p,Mp,Up,Bp,qp,Fp,Gp,Pp,Kp,jp,cr,Qp],Zp=()=>{const t={};return["title","description","campaign","contentType","featuredImageAltText"].forEach(e
43=>{t[e]=bt(ae[e])}),t},em=()=>{const t=document.head.querySelector(ae.config);return t?.content?JSON.parse(t.content):null},tm=t=>{const e=window.location.pathname.replace(/\.html$/,"");let r=`/mnt/overlay/wcm/core/content/sites/properties.html?item=${e}`,o=`/sites.html${e}`;e.startsWith("/content")||(v.warn("[Page Validation] Could not determine a valid page path."),r="#",o="#");const a=Zp();return{pagePath:e,pagePropertiesPath:r,siteAdminPath:o,metaData:a,backendData:t.backendPageData}},nm=(t,e)=>t.reduce((n,r)=>{const o=r.severity||e;return(n[o]??=[]).push(r),n},{}),rm=async(t,e)=>{const n=[],r=e.filter(o=>"validate"in o).filter(o=>!("appliesTo"in o)||o.appliesTo(t)).filter(o=>!("disableAutoRun"in o)||!o.disableAutoRun);for(const o of r){const a=await o.validate(t);if(typeof a!="object"||a===null)continue;const i={ruleId:o.ruleId,area:o.area,violation:o.violation,description:o.description,instancesListSubtitle:o.instancesListSubtitle};if("instances"in a&&a.instances?.some(s=>s.severity)){const s=nm(a.instances,o.severity);for(const[c,l]of Object.entries(s))n.push({...i,severity:c,instances:l})}else n.push({...i,severity:o.severity,...a})}return n},om=async()=>{const t=em();if(!t){v.warn("[Page Validation] Invalid config. Aborting.");return}const e=t?.rulesIds?Xp.filter(i=>t.rulesIds.includes(i.ruleId)):[],n=e.map(i=>i.ruleId),r=tm(t),o=await rm(r,e);new Ap(o,t.shouldRenderFixItLinks??!1,n).renderBanner()},yi=()=>document.getElementById("engagement-points-config"),wh=()=>{const t=yi();return t?{engagementApiUrl:t?.dataset.engagementApiUrl||"",engagementApplicationId:t?.dataset.engagementApplicationId||"",reCaptchaSiteKey:t?.dataset.recaptchaSitekey||""}:null},bh=()=>{const t=yi();if(!t?.dataset.engagementLabels)return{};try{return JSON.parse(t.dataset.engagementLabels)}catch{return{}}},am=t=>t.some(e=>!e.currencyName||!e.currencyIcon),im=(t,e)=>{const n=new Set(e.map(r=>r.currencyId));return t.filter(r=>!r.currencyName||!r.currencyIcon).every(r=>n.has(r.currencyId))},sm=async(t,e=[],n)=>{try{if(!am(t))return t;let r=e;im(t,r)||(r=await n());const o=new Map(r.map(a=>[a.currencyId,a]));return t.map(a=>{const i=o.get(a.currencyId);return{currencyId:a.currencyId,currencyName:a.currencyName||i?.currencyName||"",currencyIcon:a.currencyIcon||i?.currencyIcon||"",amount:a.amount}})}catch(r){console.warn("Failed to enrich currencies from wallet, using original data:",r)}return t},cm=async(t,e,n,r,{pinCode:o,userInputs:a,hiddenInput:i,participationImage:s,entryType:c,signedUrls:l,imageForParticipation:d,participationId:p})=>{const u={...a&&{userInputs:a},...i&&{hiddenInput:i},...s&&{participationImage:s}},g={...o&&{pins:o},...c&&{entryType:c},...(a||i||s)&&{optionalInformation:u},...l&&{signedUrls:l},...d&&{imageForParticipation:d},...p&&{participationId:p}};return ht(t,e,n,r,g)},ht=async(t,e,n,r,o)=>{if(!t)throw new Error(`Tried to send arbiter message with missing token, for flow: ${n}, payload: ${JSON.stringify(o)}`);const a=lm(t),i=Or(r,{flowLabel:n,...o});return Nr("POST","arbiterSDK",r,{reCaptchaResponse:e,headers:a,payload:i})},lm=t=>({Authorization:`Bearer ${t}`}),Or=(t,e)=>{const{configurationIds:n}=t;return{...n&&{configurationIds:n},responseType:"html",language:Fn(),...e}},Nr=async(t,e,n,r={})=>{const{headers:o,params:a,payload:i,reCaptchaResponse:s}=r,{ngpsApiKey:c,ngpsApiUrl:l,configurationId:d}=n,p=new URLSearchParams({configurationId:d,"g-recaptcha-response":s,...(t==="GET"||t==="PATCH")&&a||{}}),u=`${Ce(l)}/${e}?${p.toString()}`,g=Object.fromEntries(Object.entries(o||{}).filter(([y,S])=>!!S)),f=Ae({...["POST","PATCH"].includes(t)&&{"Content-Type":"application/json"},"x-api-key":c,...g});return fetch(u,{method:t,headers:f,body:["POST","PATCH"].includes(t)?JSON.stringify(i):void 0,signal:AbortSignal.timeout(3e4)})},V=t=>t!==null&&typeof t=="object",dm=t=>V(t)&&(t?.errorDetails?.pinRejection?.[0]?.errorName==="INVALID_INPUT"||t?.errorDetails?.pinRejection?.[0]?.errorName==="INVALID_LOT_ID"),um=t=>V(t)&&t?.errorDetails?.pinRejection?.[0]?.errorName==="ALREADY_REDEEMED",pm=t=>V(t)&&t?.errorDetails?.pinRejection?.[0]?.errorName==="PINCODE_IS_EXPIRED",mm=t=>V(t)&&t?.errorDetails?.pinRejection?.[0]?.errorName==="REDEMPTION_LIMIT_REACHED",hm=t=>V(t)&&t.errorCode===1&&t?.message?.includes("Participation limit is reached"),gm=t=>V(t)&&t.errorCode===1&&t?.message?.includes("Max currency limit reached"),vh=t=>V(t)&&t.errorCode===1&&t?.message?.includes("You reached the limit of won prizes"),fm=t=>V(t)&&(t.errorCode===2||t.errorCode===5),Sh=t=>V(t)&&t.errorCode===2&&["Redemption Limit for this prize has been reached","Redemption Limit has been reached"].includes(t.message),ym=t=>V(t)&&t.prizeRedeemErrors?.length>0&&t.prizeRedeemErrors[0].errorCode===2&&t.prizeRedeemErrors[0].message==="Redemption Limit for this prize has been reached",Eh=t=>V(t)&&t.errorCode===10&&t.message==="Not enough vouchers available",wm=t=>V(t)&&t.result?.errorCode===400,Ch=t=>V(t)&&t.errorCode===2&&t.message==="Blocked",Ah=t=>V(t)&&t.errorCode===1&&t.message==="Promotion is not active",_h=t=>V(t)&&t.errorCode===10&&t.errCode===10018&&t.message==="Uploaded image not found",Ph=t=>V(t)&&t.errorCode===10&&t.errCode===10018&&t.message==="IW imageEntry participation not found",Ih=t=>V(t)&&t.message==="Already participated with that image",bm=t=>V(t)&&t.errorCode===1&&t.message==="Not enough currencies"&&Array.isArray(t?.errorDetails?.missingCurrencies)||V(t)&&t.errorCode===8&&t?.errorDetails?.currencyId&&t.message.includes("Not enough currency"),wi=t=>V(t)&&typeof t.pincode=="string"&&typeof t.programId=="string"&&typeof t.burned=="boolean",bi=t=>V(t)&&typeof t.prizeId=="string"&&typeof t.name=="string"&&xr(t.imgUrl),xr=t=>typeof t=="string"||Array.isArray(t),Yt=t=>Array.isArray(t)?t[0]:t,vm=t=>typeof t=="number"&&!isNaN(t)||typeof t=="string"&&!isNaN(parseFloat(t)),Sm=t=>typeof t=="string"?parseFloat(t):t,To=t=>typeof t=="string"?t:void 0,Em=t=>{v.log(`[requiredCurrencies] Parsing additional information: ${t}`,t);try{if(!t?.additionalConfigurationInformation)return v.warn("[requiredCurrencies] Missing additionalConfigurationInformation"),null;const e=t.additionalConfigurationInformation.requiredCurrencies,r=(e?typeof e=="string"?Lo(e)||[]:e:[]).map(o=>{if(!(o in t.additionalConfigurationInformation))return;const a=t.additionalConfigurationInformation[o],i=typeof a=="str
43ing"?Lo(a):a;if(i)return{id:o,amount:bn(i.amount),label:i.label,imgUrl:i.damIconPath}}).filter(Boolean);return r.length>0?r:null}catch(e){return v.warn(`[requiredCurrencies] Unexpected error while parsing additional information: ${e}`,e),null}},Lo=t=>{try{return JSON.parse(t)}catch(e){v.warn(`[requiredCurrencies] Could not parse: ${t}, ${e}`,e);return}},bn=t=>{if(t)return new Intl.NumberFormat("en-US",{notation:"compact",compactDisplay:"short",maximumFractionDigits:1,roundingMode:"floor"}).format(t)},Th=(t,e,n)=>{const r="#TOTAL_AMOUNT#",o="#AVAILABLE_AMOUNT#",a="#REDEEMED_AMOUNT#";let i;const s=t.includes(a);s&&typeof n=="number"&&(i=n-e);const c=t?.includes(r)&&n||!1,l=t?.includes(o)&&e||!1,d=s&&typeof i=="number";return c||l||d?t.replace(r,c?bn(n):"").replace(o,l?bn(e):"").replace(a,d?bn(i):""):`${e} ${t}`},zn=t=>V(t)&&typeof t.amount=="number"&&typeof t.currencyId=="string",Cm=t=>V(t)&&vm(t.amount)&&typeof t.currencyId=="string"&&typeof t.name=="string",rn=t=>V(t)&&typeof t.transactionInserted=="boolean"&&typeof t.currencyName=="string"&&typeof t.currencyId=="string"&&typeof t.walletRollingTotal=="number",Am=t=>V(t)&&typeof t.gpp_user_id=="string"&&typeof t.transaction_timestamp=="number"&&typeof t.amount=="number"&&typeof t.configuration_id=="string"&&typeof t.currency_id=="string"&&typeof t.currency_name=="string"&&typeof t.entry_date=="string"&&typeof t.promo_name=="string"&&typeof t.transaction_type=="number"&&typeof t.wallet_rolling_total=="number",_m=t=>V(t)&&xr(t.imgUrl)&&typeof t.name=="string"&&typeof t.description=="string"&&t.prizeCost?t.prizeCost.every(Cm):!0,vi=t=>V(t)&&typeof t.redeemedPrize=="object"&&bi(t.redeemedPrize),Pm=t=>V(t)&&typeof t.amount=="number"&&typeof t.currencyId=="string"&&typeof t.currencyName=="string"&&typeof t.gppUserId=="string",ko=t=>t===void 0||typeof t=="number",Im=t=>V(t)&&typeof t.amount=="number"&&typeof t.currency_id=="string"&&typeof t.currency_name=="string"&&typeof t.gpp_user_id=="string"&&typeof t.valid_thru=="number"&&ko(t.already_spent)&&ko(t.spent_amount),Tm=t=>V(t)&&typeof t.description=="string"&&(!t.expiryDate||typeof t.expiryDate=="number")&&xr(t.imgUrl)&&typeof t.name=="string"&&typeof t.prizeName=="string"&&(!t.redeemDescription||typeof t.redeemDescription=="string")&&(!t.redemptionLink||typeof t.redemptionLink=="string")&&typeof t.voucher=="string",Ro=t=>V(t)&&V(t.pluginOutput)&&Array.isArray(t.allocationArray)&&Array.isArray(t.transactions)&&t.allocationArray?.every(zn)&&t.transactions?.every(rn),Lm=t=>V(t)&&t.allocationArray?.every(zn)&&t.burnResult?.every(wi)&&t.transactions?.every(rn)&&typeof t.participationId=="string",km=t=>V(t)&&V(t.pluginOutput)&&t.allocationArray?.every(zn)&&t.transactions?.every(rn)&&t.wonPrizes?.every(vi),Rm=t=>V(t)&&t.allocationArray?.every(zn)&&t.burnResult?.every(wi)&&t.transactions?.every(rn)&&t.wonPrizes?.every(vi)&&typeof t.participationId=="string",Dm=t=>V(t)&&t.prizeList?.every(_m),Om=t=>V(t)&&bi(t.redeemedPrize)&&t.transactions?.every(rn)&&typeof t.participationId=="string",Nm=t=>V(t)&&t.walletStatus?.every(Pm),xm=t=>V(t)&&t.expirationWallet?.every(Im),$m=t=>V(t)&&t.vouchers?.every(Tm),Mm=t=>V(t)&&t.transactions?.every(Am),Um=t=>V(t)&&t.prizeRedeemErrors?.[0]?.errorDetails?.totalAvailable===0,Bm=t=>Rm(t)||km(t)?{type:"COLLECT_AND_GET_AUTO_WIN",data:{...t,wonPrizes:(t.wonPrizes||[]).map(e=>({...e,redeemedPrize:{...e.redeemedPrize,barcodeUrl:Yt(e.redeemedPrize?.barcodeUrl),imgUrl:Yt(e.redeemedPrize?.imgUrl),redeemDescription:To(e.redeemedPrize?.redeemDescription),shortDescription:To(e.redeemedPrize?.shortDescription)}}))}}:Lm(t)||Ro(t)&&t.allocationArray?.length>0?{type:"COLLECT_AND_GET_SUCCESS",data:t}:Um(t)?{type:"COLLECT_AND_GET_NO_MORE_PRIZES",error:t}:um(t)?{type:"COLLECT_AND_GET_ALREADY_REDEEMED",error:t}:pm(t)?{type:"COLLECT_AND_GET_PINCODE_EXPIRED",error:t}:dm(t)?{type:"COLLECT_AND_GET_INVALID_INPUT",error:t}:gm(t)?{type:"COLLECT_AND_GET_MAX_CURRENCY_LIMIT",error:t}:hm(t)?{type:"COLLECT_AND_GET_PARTICIPATION_LIMIT_EXCEEDED",error:t}:mm(t)?{type:"COLLECT_AND_GET_PIN_REDEMPTION_LIMIT",error:t}:ym(t)?{type:"COLLECT_AND_GET_REDEMPTION_LIMIT_EXCEEDED",error:t}:wm(t)?{type:"COLLECT_AND_GET_INVALID_PARTICIPATION_ID",error:t}:Ro(t)&&t.allocationArray?.length===0?{type:"COLLECT_AND_GET_NO_CURRENCY_AWARDED",error:t}:{type:"COLLECT_AND_GET_UNKNOWN_RESPONSE"},Lh=t=>async(e,n,r=!1,o)=>{const s=await(await cm(e,n,r?"autoRedeemCnG":"redeemPincodeForCurrencies",t,o)).json();return Bm(s)},Si=({data:t})=>Dm(t)?{type:"LIST_PRIZES_SUCCESS",data:{...t,prizeList:t.prizeList.map(e=>({...e,imgUrl:Yt(e.imgUrl),prizeCost:e.prizeCost?e.prizeCost.map(n=>({...n,amount:Sm(n.amount)})):[]}))}}:{type:"LIST_PRIZES_UNKNOWN_RESPONSE"},Ei=()=>({type:"LIST_PRIZES_UNKNOWN_RESPONSE"}),kh=(t,e)=>async(n,r)=>{const o=await ht(n,r,"listPrizes",t,e),a=await o.json();return o.ok?Si({data:a}):Ei()},Rh=t=>async()=>{const e=Or(t),n=await Nr("GET","publicListPrizes",t,{params:e}),r=await n.json();return n.ok?Si({data:r}):Ei()},Dh=t=>async()=>{const e=Or(t,{language:"us-EN"}),r=await(await Nr("GET","additionalInformation",t,{params:e})).json();return r?.additionalConfigurationInformation?{promotionImgUrl:r.additionalConfigurationInformation.imgUrl??"",promotionName:r.additionalConfigurationInformation.name??"",requiredCurrencies:Em(r)}:{promotionImgUrl:"",promotionName:"",requiredCurrencies:null}},Oh=t=>async(e,n,r)=>{const o=await ht(e,n,"redeemPrize",t,{prizeId:r}),a=await o.json();return o.ok&&Om(a)?{type:"REDEEM_PRIZE_SUCCESS",data:{...a,redeemedPrize:{...a.redeemedPrize,imgUrl:Yt(a.redeemedPrize.imgUrl)}}}:fm(a)?{type:"REDEEM_PRIZE_REDEMPTION_LIMIT_EXCEEDED",error:a}:bm(a)?{type:"REDEEM_PRIZE_NOT_ENOUGH_CURRENCIES",error:a}:{type:"REDEEM_PRIZE_UNKNOWN_RESPONSE"}},qm=t=>async(e,n,r,o)=>{const i=await(await ht(e,n,"queryWallet",t)).json();if(Nm(i))if(r){const s=await ht(e,o,"queryExpirationWalletByUser",t).then(l=>l.json()).catch(l=>{console.debug("Failed to fetch expiration wallet data:",l)});return{type:"QUERY_WALLET_SUCCESS",data:Wm(s,i)}}else return{type:"QUERY_WALLET_SUCCESS",data:i};return{type:"QUERY_WALLET_UNKNOWN_RESPONSE"}},Nh=t=>async(e,n)=>{const o=await(await ht(e,n,"queryVouchers",t)).json();
43return $m(o)?{type:"QUERY_VOUCHERS_SUCCESS",data:{...o,vouchers:o.vouchers.map(a=>({...a,imgUrl:Yt(a.imgUrl)}))}}:{type:"QUERY_VOUCHERS_UNKNOWN_RESPONSE"}},xh=(t,e)=>async(n,r)=>{const a=await(await ht(n,r,"listTransactions",t,{currencyId:e})).json();return Mm(a)?{type:"LIST_TRANSACTIONS_SUCCESS",data:a}:{type:"LIST_TRANSACTIONS_UNKNOWN_RESPONSE"}},Fm=t=>typeof t.spent_amount=="number"?Math.max(0,t.amount-t.spent_amount):t.amount,Wm=(t,e)=>{if(xm(t)){const n=Date.now()+12096e5,r=t.expirationWallet.reduce((o,a)=>(a.valid_thru<=n&&(o[a.currency_id]=(o[a.currency_id]||0)+Fm(a)),o),{});return{walletStatus:e.walletStatus.map(o=>({...o,expiring:r[o.currencyId]||0}))}}else return e},zm=async(t,e,n)=>{const{getAuthToken:r}=await J(),o=await r(),a=await nt(e,"fetchWallet"),i=await nt(e,"fetchExpirationWalletToken"),c=await qm(t)(o,a,n,i);switch(c.type){case"QUERY_WALLET_SUCCESS":return c.data.walletStatus;case"QUERY_WALLET_UNKNOWN_RESPONSE":default:throw new Error("Wallet unknown response")}},Hm=t=>{let e;const n=new Set,r=(l,d)=>{const p=typeof l=="function"?l(e):l;if(!Object.is(p,e)){const u=e;e=d??(typeof p!="object"||p===null)?p:Object.assign({},e,p),n.forEach(g=>g(e,u))}},o=()=>e,s={setState:r,getState:o,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=e=t(r,o,s);return s},Ci=t=>Hm,Vm=t=>(e,n,r)=>{const o=r.subscribe;return r.subscribe=(i,s,c)=>{let l=i;if(s){const d=c?.equalityFn||Object.is;let p=i(r.getState());l=u=>{const g=i(u);if(!d(p,g)){const f=p;s(p=g,f)}},c?.fireImmediately&&s(p,p)}return o(l)},t(e,n,r)},Ai=Vm,Gm=Ci()(Ai((t,e)=>({apiConfig:{},avatarsData:[],profileGrantedCurrencies:[],walletData:[],profileData:{},getAvatars:()=>e().avatarsData,getProfileGrantedCurrencies:()=>e().profileGrantedCurrencies,getWalletData:()=>e().walletData,getProfileData:()=>e().profileData,hasProfileData:()=>Object.keys(e().profileData).length>0,isProfileSaved:()=>e().profileData?.state===Ht.SAVED,setApiConfig:n=>{n.leaderboardApiUrl?(!n.engagementApiUrl||!n.engagementPointsAppId)&&console.warn("Profile store: 'apiConfig' set without engagement fields.","Profile completion events will not be sent."):console.warn("Profile store: 'apiConfig' set without required fields.","Profile operations will not work. Ensure header is present on the page."),t({apiConfig:{...e().apiConfig,...n}})},setProfileData:async n=>{await e().ensureAvatarIdAssigned(n),t({profileData:n})},createProfileData:async()=>{if(!e().profileData.username)try{const{leaderboardApiUrl:n,reCaptchaSiteKey:r,promoPlusEnvId:o}=e().apiConfig,i=await new Pe(n,r,o).createUserProfile();Pe.isErrorResponse(i)||(await e().ensureAvatarIdAssigned(i.profile),t({profileData:i.profile}))}catch(n){console.error("Error fetching current user data:",n)}},fetchAvatarsData:async()=>{if(!e().avatarsData.length)try{const{leaderboardApiUrl:n,reCaptchaSiteKey:r,promoPlusEnvId:o}=e().apiConfig,i=await new Pe(n,r,o).getAvatars();if(!Pe.isErrorResponse(i))return t({avatarsData:i}),i}catch(n){console.error("Error fetching avatars data:",n)}},fetchProfileData:async()=>{if(e().profileData.username)return;const{leaderboardApiUrl:n,reCaptchaSiteKey:r,promoPlusEnvId:o}=e().apiConfig,a=new Pe(n,r,o);await $n(r);try{const i=await a.getUserProfile();Pe.isErrorResponse(i)||(await e().ensureAvatarIdAssigned(i),t({profileData:i}))}catch(i){console.error(i)}},ensureAvatarIdAssigned:async n=>{if(!n.avatarId&&n.avatarUrl){await e().fetchAvatarsData();const r=e().avatarsData.find(o=>o.avatarUrl===n.avatarUrl);n.avatarId=r?.avatarId}},regenerateUsername:async()=>{try{const{leaderboardApiUrl:n,reCaptchaSiteKey:r,promoPlusEnvId:o}=e().apiConfig,i=await new Pe(n,r,o).generateUsername();if(!Pe.isErrorResponse(i))return{usernameId:i.usernameId,username:i.username}}catch(n){console.error("Error generating username:",n)}return{}},refreshWallet:async()=>{const{ngpsConfig:n,configurationIds:r,reCaptchaSiteKey:o}=e().apiConfig;if(!n.ngpsApiUrl||!n.ngpsApiKey||!r||!o)return console.warn("Cannot refesh wallet due to NGPS API not configured"),e().walletData;const a={ngpsApiUrl:n.ngpsApiUrl,ngpsApiKey:n.ngpsApiKey,configurationId:r,configurationIds:null};try{const i=await zm(a,o,!1);return t({walletData:i}),i}catch(i){return console.warn("Failed to refresh wallet:",i),t({walletData:[]}),[]}},saveProfileData:async n=>
43{try{const{leaderboardApiUrl:r,reCaptchaSiteKey:o,promoPlusEnvId:a,engagementApiUrl:i,engagementPointsAppId:s}=e().apiConfig,c=new Pe(r,o,a),l={usernameId:n.usernameId,state:Ht.SAVED},d=n.avatar3dConfig&&Object.keys(n.avatar3dConfig).length>0;if(d?l.avatar3dConfig=n.avatar3dConfig:n.avatarId&&(l.avatarId=n.avatarId),!(l.avatarId||l.usernameId||d)){console.warn("savePersonalizationData called with no data to update");return}await c.saveUserProfile(l);const u=e().avatarsData.find(k=>k.avatarId===n.avatarId),g={...e().profileData,...u,username:n.username,usernameId:n.usernameId,avatarId:n.avatarId,avatar3dConfig:n.avatar3dConfig,state:Ht.SAVED},f=new Rr(i,o,a),{grantedCurrencies:y}=await f.registerProfileCompletion(s),S=await sm(y,e().walletData,()=>e().refreshWallet());t({profileData:g,profileGrantedCurrencies:S}),S.length>0&&dispatchEvent(new CustomEvent("wallet:refresh"))}catch(r){console.error("Error saving profile data:",r)}}})));class ke{static STORAGE_KEY="onexp_onboarding";static async getHashedKocid(){let e;try{e=(await(await J()).getAuthPayload()).hashed_kocid}catch(n){v.log("Cannot get offline identity and will not be provided in onboarding storage",n)}return e||"anonymous"}static async parseStorageData(){try{const e=await ke.getHashedKocid(),n=localStorage.getItem(ke.STORAGE_KEY);if(!n)return null;const o=JSON.parse(n)[e];return o?!o.version||!Array.isArray(o.completedSteps)?(console.warn("Invalid onboarding storage structure, ignoring"),null):o:null}catch(e){return console.error("Failed to parse onboarding storage:",e),null}}static async saveStorageData(e){try{const n=await ke.getHashedKocid(),r=Ee(()=>localStorage.getItem(ke.STORAGE_KEY)),o=JSON.parse(r||"{}");o[n]=e,Ee(()=>{localStorage.setItem(ke.STORAGE_KEY,JSON.stringify(o))})}catch(n){console.error("Failed to save onboarding storage:",n)}}static getDefaultStorageData(){return{completedSteps:[],skippedSteps:[],onboardingSkippedAt:null,version:1}}}class Ze{static isOnboardingDebug(){return new URLSearchParams(window.location.search).get("onboardingDebug")==="true"}static notificationSupported(){const e=Xt();return"Notification"in window&&!e}static getNotificationPermission(){return"Notification"in window?Notification.permission:"not-supported"}static async getUserSubscription(){return(await navigator.serviceWorker.getRegistration())?.pushManager.getSubscription()}static createEnrichmentKey(e,n,r){return`${e}_${n}_${r}`}}const jm=Ci()(Ai((t,e)=>({onboardingConfig:null,onboardingData:ke.getDefaultStorageData(),enrichmentAnswers:[],fetchEnrichmentAnswers:async()=>{if(!e().enrichmentAnswers.length)try{const{cdsEnrichmentUrl:n,region:r}=Te(),a=await new kt(n,r).getEnrichmentData();if("error"in a)return;const i=a.data;if(!Array.isArray(i))return;const s=i.map(({category:c,enrichmentType:l,enrichmentValue:d})=>Ze.createEnrichmentKey(c,l,d));t({enrichmentAnswers:[...new Set(s)]})}catch(n){console.error("Error fetching user enrichment selections:",n)}},loadOnboardingData:async n=>{const r=e().onboardingData;if(r.completedSteps.length||r.skippedSteps.length||r.onboardingSkippedAt)return;t({onboardingConfig:n});const o=await ke.parseStorageData();if(o){t({onboardingData:o});const a=n.stepsConfig.find(s=>s.type==="avatar-selection"),i=n.stepsConfig.find(s=>s.type==="username-selection");a&&i&&e().isStepCompleted(a.id)&&!e().isStepCompleted(i.id)&&(o.completedSteps=o.completedSteps.filter(s=>s!==a.id),t({onboardingData:o}),await ke.saveStorageData(o))}},fetchOnboardingSteps:async(n=!1)=>{const o=window.onexpGlobalStores.profileStore.getState();await Promise.all([o.fetchProfileData(),e().fetchEnrichmentAnswers()]);const a=e().getStepsConfig();if(Ze.isOnboardingDebug())return a;const i=[];for(const s of a)if(!(e().isStepCompleted(s.id)||e().isStepSkipped(s.id)&&!n))if(s.type==="enrichment-question")e().isEnrichmentFilled(s)||i.push(s);else if(s.type==="avatar-selection"||s.type==="username-selection")o.getProfileData().state!==Ht.SAVED&&i.push(s);else if(s.type==="push-notification"){const c=Ze.notificationSupported(),l=Ze.getNotificationPermission();c&&l!=="denied"&&(await Ze.getUserSubscription()||i.push(s))}else i.push(s);return i.length===1&&i[0].type==="summary"?[]:i},fetchProgressiveSteps:async n=>(await e().fetchEnrichmentAnswers(),Ze.isOnboardingDebug()?n:n.filter(r=>!(e().isStepCompleted(r.id)||e().isEnrichmentFilled(r)))),getStepsConfig:()=>e().onboardingConfig?.stepsConfig||[],markStepCompletedByType:async n=>{const o=e().getStepsConfig().filter(a=>a.type===n);for(const a of o)await e().markStepCompleted(a.id)},markStepCompleted:async n=>{const r=e().onboardingData;r.completedSteps.includes(n)||r.completedSteps.push(n),r.skippedSteps=r.
43skippedSteps.filter(o=>o.id!==n),t({onboardingData:{...r}}),await ke.saveStorageData(r)},markStepSkipped:async n=>{const r=e().onboardingData;r.skippedSteps=r.skippedSteps.filter(o=>o.id!==n),r.skippedSteps.push({id:n,skippedAt:Date.now()}),t({onboardingData:{...r}}),await ke.saveStorageData(r)},markOnboardingSkipped:async()=>{const n=e().onboardingData;n.onboardingSkippedAt=Date.now(),t({onboardingData:{...n}}),await ke.saveStorageData(n)},markQuestionAnswered:n=>{const r=Ze.createEnrichmentKey(n.category,n.enrichmentType,n.enrichmentValue),o=e().enrichmentAnswers;o.includes(r)||t({enrichmentAnswers:[...o,r]})},isStepSkipped:n=>{const r=e().onboardingData;if(!r?.skippedSteps)return!1;const o=r.skippedSteps.find(c=>c.id===n);if(!o)return!1;const a=Date.now(),s=90*24*60*60*1e3;return a-o.skippedAt<s},isStepCompleted:n=>{const r=e().onboardingData;return r?r.completedSteps.includes(n):!1},isOnboardingSkipped:()=>{const n=e().onboardingData;if(!n?.onboardingSkippedAt)return!1;const r=Date.now(),a=90*24*60*60*1e3;return r-n.onboardingSkippedAt<a},isEnrichmentFilled:n=>{const r=e().enrichmentAnswers;return n.questions.some(o=>{const a=Ze.createEnrichmentKey(o.category,o.enrichmentType,o.enrichmentValue);return r.includes(a)})}}))),Km=()=>({profileStore:Gm,onboardingStore:jm});window.onexpGlobalStores=Km();window.modalController=new wp;const Ym=new URLSearchParams(window.location.search);Ym.get("rtl")==="true"&&document.querySelector("html")?.setAttribute("dir","rtl");(async()=>{const t=document.querySelector(".aemform"),e="/etc.clientlibs/fd/af/runtime/clientlibs/guideRuntime.lc-0e68c77e7c186891ab6c48488deeaa47-lc.min.js";if(t)try{console.log("Fetching clientlib with mode cache: only-if-cached");const n=await fetch(e,{cache:"only-if-cached",mode:"same-origin"}),r=(await n.text()).length;if(n.status===200&&r===0){console.log("Clientlib stored as 0B file; Fetching updated version with mode cache: reload"),await fetch(e,{cache:"reload"}),window.location.reload();return}if(n.status===200){console.log(`Clientlib obtained from cache; Content-Length is ${r}`);return}n.status===404&&console.log("Clientlib not found in cache; Status 404;")}catch{console.log("Failed to fetch clientlib from cache;")}})();bp.then(async()=>{await Qa(),await M.mountAll(),dr(),$o(),await oc(),await vp(),await om(),await Bc()});window.addEventListener("pageshow",async t=>{t.persisted&&(v.log("BF cache: resetting global promises"),os())});window.location.pathname.endsWith("logout")&&Z(()=>import("./logout.js"),[],import.meta.url);export{cm as $,ao as A,Rh as B,G as C,Th as D,Tl as E,Oh as F,Nh as G,ch as H,kh as I,zm as J,Lh as K,kn as L,Jm as M,ie as N,Ze as O,Ht as P,Dn as Q,oh as R,hi as S,hh as T,$n as U,Bm as V,V as W,Nr as X,lm as Y,Xm as Z,Z as _,en as a,hm as a0,eh as a1,ih as a2,mh as a3,xh as a4,ha as a5,Pe as a6,Ya as a7,Dh as a8,Qm as a9,sm as aA,bh as aB,gh as aC,fh as aD,tr as aE,no as aF,rr as aG,Tr as aH,dh as aI,Mn as aJ,ba as aK,ah as aL,Te as aM,kt as aN,Vs as aO,Zm as aP,Lr as aQ,ud as aR,th as aS,M as aT,ft as aU,se as aV,nh as aW,rh as aX,Aa as aY,uh as aZ,Xt as aa,ca as ab,jd as ac,Gd as ad,Ee as ae,lh as af,rc as ag,Eh as ah,dm as ai,um as aj,pm as ak,mm as al,bm as am,Ah as an,vh as ao,Sh as ap,Ch as aq,fm as ar,wm as as,_h as at,Ph as au,Ih as av,To as aw,Yt as ax,wh as ay,Rr as az,Fe as b,Dl as c,v as d,qm as e,nt as f,J as g,yh as h,Be as i,la as j,Sl as k,wl as l,bl as m,sh as n,ph as o,lr as p,rt as q,oo as r,Ra as s,Mc as t,xc as u,ga as v,mt as w,Wa as x,dl as y,Qt as z};

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.