!function(){"use strict";var e=e=>null==e,t=t=>!e(t)&&!Array.isArray(t)&&"object"==typeof t;
  /*! js-cookie v3.0.5 | MIT */
  function n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var r=function e(t,r){function o(e,o,a){if("undefined"!=typeof document){"number"==typeof(a=n({},r,a)).expires&&(a.expires=new Date(Date.now()+864e5*a.expires)),a.expires&&(a.expires=a.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var s in a)a[s]&&(i+="; "+s,!0!==a[s]&&(i+="="+a[s].split(";")[0]));return document.cookie=e+"="+t.write(o,e)+i}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var a=n[o].split("="),i=a.slice(1).join("=");try{var s=decodeURIComponent(a[0]);if(r[s]=t.read(i,s),e===s)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){o(e,"",n({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,n({},this.attributes,t))},withConverter:function(t){return e(n({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),o={get:r.get.bind(r),set:r.set.bind(r),remove:r.remove.bind(r),withConverter:r.withConverter.bind(r)};const a=(e,n)=>{Object.keys(n).forEach((r=>{t(e[r])&&t(n[r])?a(e[r],n[r]):e[r]=n[r]}))};var i=(t,...n)=>{if(e(t))throw new TypeError('deepAssign "target" cannot be null or undefined');const r=Object(t);return n.forEach((e=>a(r,Object(e)))),r},s=(e,t)=>n=>{const r=t.split(".").reduce(((e,t)=>(e[t]=e[t]||{},e[t])),e);i(r,n)},c=()=>{const e=[];return{add(t){e.push(t)},call:(...t)=>Promise.all(e.map((e=>e(...t))))}};const d=[];for(let e=0;e<256;++e)d.push((e+256).toString(16).slice(1));let l;const u=new Uint8Array(16);var p={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function g(e,t,n){if(p.randomUUID&&!t&&!e)return p.randomUUID();const r=(e=e||{}).random??e.rng?.()??function(){if(!l){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");l=crypto.getRandomValues.bind(crypto)}return l(u)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){if((n=n||0)<0||n+16>t.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(d[e[t+0]]+d[e[t+1]]+d[e[t+2]]+d[e[t+3]]+"-"+d[e[t+4]]+d[e[t+5]]+"-"+d[e[t+6]]+d[e[t+7]]+"-"+d[e[t+8]]+d[e[t+9]]+"-"+d[e[t+10]]+d[e[t+11]]+d[e[t+12]]+d[e[t+13]]+d[e[t+14]]+d[e[t+15]]).toLowerCase()}(r)}var m=()=>({eventMergeId:g()}),f=({logger:e,cookieJar:t})=>({...t,set(n,r,o){e.info("Setting cookie",{name:n,value:r,...o}),t.set(n,r,o)}}),h=()=>{const e={};return e.promise=new Promise(((t,n)=>{e.resolve=t,e.reject=n})),e};const y=(e,t)=>e===t;var v=(e,t)=>e.appendChild(t);var w=(e,n={},r={},o=[],a=document)=>{const i=a.createElement(e);return Object.keys(n).forEach((e=>{i.setAttribute(e,n[e])})),((e,n)=>{Object.keys(n).forEach((r=>{if("style"===r&&t(n[r])){const t=n[r];Object.keys(t).forEach((n=>{e.style[n]=t[n]}))}else e[r]=n[r]}))})(i,r),o.forEach((e=>v(i,e))),i};const b="IMG",E="STYLE",C="SCRIPT";var I=({src:e,currentDocument:t=document})=>new Promise(((n,r)=>{w(b,{src:e},{onload:n,onerror:r,onabort:r},[],t)})),k=e=>"function"==typeof e,S=e=>Array.isArray(e)&&e.length>0,D=e=>Array.isArray(e)?e:null==e?[]:[].slice.call(e);const P=/^\s*>/;var T=(e,t)=>P.test(t)?D(e.querySelectorAll(`:scope ${t}`)):D(e.querySelectorAll(t)),R=":shadow";const O=(e,t)=>{const n=t;if(!n.startsWith(">"))return n;return`${e instanceof Element||e instanceof Document?":scope":":host"} ${n}`};var N=(e,t)=>{const n=(e=>e.split(R))(t);if(n.length<2)return T(e,t);let r=e;for(let e=0;e<n.length;e+=1){const t=n[e].trim();if(""===t&&r.shadowRoot){r=r.shadowRoot;continue}const o=O(r,t),a=T(r,o);if(0===a.length||!a[0]||!a[0].shadowRoot)return a;r=a[0].shadowRoot}},M=(e,t=document)=>-1===e.indexOf(R)?T(t,e):N(t,e);const A="MutationObserver",x={childList:!0,subtree:!0},$=e=>new Error(`Could not find: ${e}`),q=e=>new Promise(e);var L=(e,t=M,n=5e3,r=window,o=document)=>{const a=t(e);return S(a)?Promise.resolve(a):(e=>k(e[A]))(r)?((e,t,n,r,o)=>q(((a,i)=>{let s;const c=new e[A]((()=>{const e=o(n);S(e)&&(c.disconnect(),s&&clearTimeout(s),a(e))}));s=setTimeout((()=>{c.disconnect(),i($(n))}),r),c.observe(t,x)})))(r,o,e,n,t):(e=>"visible"===e.visibilityState)(o)?((e,t,n,r)=>q(((o,a)=>{const i=()=>{const n=r(t);S(n)?o(n):e.requestAnimationFrame(i)};i(),setTimeout((()=>{a($(t))}),n)})))(r,e,n,t):((e,t,n)=>q(((r,o)=>{const a=()=>{const t=n(e);S(t)?r(t):setTimeout(a,100)};a(),setTimeout((()=>{o($(e))}),t)})))(e,n,t)},U=e=>{const t=e.parentNode;return t?t.removeChild(e):null};const j={name:"Adobe Alloy"},B={style:{display:"none",width:0,height:0}};var F=e=>t(e)&&0===Object.keys(e).length;const _=(n,r)=>e(n)||!t(n)?n:Object.keys(n).reduce(((e,o)=>{const a=n[o];if(t(a)){const t=_(a,r);return F(t)?e:{...e,[o]:t}}return r(a)?{...e,[o]:a}:e}),{}),V=e=>(e=>{let t=2166136261;const n=(new TextEncoder).encode(e);for(let e=0;e<n.length;e+=1)t^=n[e],t=Math.imul(t,16777619);return t>>>0})(e).toString(16).padStart(8,"0");var H="com.adobe.alloy.";const z=`${H}getTld`;var J="kndctr",G=e=>e.replace("@","_"),Q=(e,t)=>`${J}_${G(e)}_${t}`,X=(e,t)=>{const n={};return e.forEach((e=>{const r=t(e);n[r]||(n[r]=[]),n[r].push(e)})),n};const W="Chrome",Y="Edge",K="EdgeChromium",Z="Firefox",ee="IE",te="Safari",ne="Unknown";var re=e=>{let t,n=!1;return()=>(n||(n=!0,t=e()),t)};const oe=[W,Y,K,"IE",ne];var ae=({orgId:e})=>{const t=Q(e,"identity");return()=>Boolean(o.get(t))};const ie=(e,t,n)=>({getItem(r){try{return e[t].getItem(n+r)}catch{return null}},setItem(r,o){try{return e[t].setItem(n+r,o),!0}catch{return!1}},clear(){try{return Object.keys(e[t]).forEach((r=>{r.startsWith(n)&&e[t].removeItem(r)})),!0}catch{return!1}}});var se=e=>t=>{const n=H+t;return{session:ie(e,"sessionStorage",n),persistent:ie(e,"localStorage",n)}},ce=e=>"boolean"==typeof e,de=e=>"number"==typeof e&&!Number.isNaN(e),le=e=>{const t=parseInt(e,10);return de(t)&&e===t},ue=e=>"string"==typeof e,pe=e=>ue(e)&&e.length>0,ge=()=>{};const me=e=>{const t={},n=e.split(".");switch(n.length){case 1:t.subdomain="",t.domain=e,t.topLevelDomain="";break;case 2:t.subdomain="",t.domain=e,t.topLevelDomain=n[1];break;case 3:t.subdomain="www"===n[0]?"":n[0],t.domain=e,t.topLevelDomain=n[2];break;case 4:t.subdomain="www"===n[0]?"":n[0],t.domain=e,t.topLevelDomain=`${n[2]}.${n[3]}`}return t},fe=(e,t=me)=>{ue(e)||(e="");const n=(e=>{try{const t=new URL(e);let n=t.pathname;return e.endsWith("/")||"/"!==n||(n=""),{host:t.hostname,path:n,query:t.search.replace(/^\?/,""),anchor:t.hash.replace(/^#/,"")}}catch{return{host:"",path:"",query:"",anchor:""}}})(e),{host:r,path:o,query:a,anchor:i}=n;return{path:o,query:a,fragment:i,...t(r)}};var he,ye;function ve(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var we=(ye||(ye=1,he={parse:function(e){return function(e){var t={};if(!e||"string"!=typeof e)return t;var n=e.trim().replace(/^[?#&]/,""),r=new URLSearchParams(n),o=r.keys();do{var a=o.next(),i=a.value;if(i){var s=r.getAll(i);1===s.length?t[i]=s[0]:t[i]=s}}while(!1===a.done);return t}(e)},stringify:function(e){return function(e){var t="{{space}}",n=new URLSearchParams;return Object.keys(e).forEach((function(r){var o=e[r];"string"==typeof e[r]?o=o.replace(/ /g,t):["object","undefined"].includes(typeof o)&&!Array.isArray(o)&&(o=""),Array.isArray(o)?o.forEach((function(e){n.append(r,e)})):n.append(r,o)})),n.toString().replace(new RegExp(encodeURIComponent(t),"g"),"%20")}(e)}}),he),be=ve(we);const Ee=e=>Array.isArray(e)?e.map((e=>Ee(e))):"object"==typeof e&&null!==e?Object.keys(e).sort().reduce(((t,n)=>(t[n]=Ee(e[n]),t)),{}):e;var Ce=e=>e instanceof Error?e:new Error(e),Ie=({error:e,message:t})=>{try{e.message=t}catch{}},ke=({error:e,message:t})=>{const n=Ce(e),r=`${t}\nCaused by: ${n.message}`;return Ie({error:n,message:r}),n},Se=(e,t)=>{if(de(e)||ue(e)){const t=Math.round(Number(e));if(!Number.isNaN(t))return t}return t};const De=(e,t,n)=>`${e}`.padStart(t,n);const Pe=e=>function(t,n){return null==t?t:e.call(this,t,n)},Te=(e,t)=>function(n,r){return t.call(this,e.call(this,n,r),r)},Re=(e,t)=>function(n,r){const o=[],a=[e,t].reduce(((e,t)=>{try{return t.call(this,e,r)}catch(t){return o.push(t),e}}),n);if(o.length)throw new Error(o.join("\n"));return a},Oe=(e,t,n)=>Object.assign(Te(e,t),e,n),Ne=(e,t,n)=>Object.assign(Te(e,Pe(t)),e,n),Me=(e,t,n,r)=>{if(!e)throw new Error(`'${n}': Expected ${r}, but got ${JSON.stringify(t)}.`)};var Ae=(e,t)=>(Me(ce(e),e,t,"true or false"),e),xe=(e,t)=>(Me(k(e),e,t,"a function"),e),$e=(e,t)=>function(n,r){let o;const a=e.find((e=>{try{return o=e.call(this,n,r),!0}catch{return!1}}));return Me(a,n,r,t),o},qe=e=>function(t,n){Me(Array.isArray(t),t,n,"an array");const r=[],o=t.map(((o,a)=>{try{return e.call(this,o,`${n}[${a}]`,t)}catch(e){return void r.push(e.message)}}));if(r.length)throw new Error(r.join("\n"));return o},Le=(e="This field has been deprecated")=>function(t,n){let r=e;return void 0!==t&&(n&&(r=`'${n}': ${r}`),this&&this.logger&&this.logger.warn(r)),t},Ue=e=>function(n,r){Me(t(n),n,r,"an object");const o=[],a={};if(Object.keys(n).forEach((t=>{const i=n[t],s=r?`${r}.${t}`:t;try{const n=e.call(this,i,s);void 0!==n&&(a[t]=n)}catch(e){o.push(e.message)}})),o.length)throw new Error(o.join("\n"));return a},je=(e,t)=>(n,r)=>(Me(n>=t,n,r,`${e} greater than or equal to ${t}`),n),Be=e=>(n,r)=>(t(n)?Me(!F(n),n,r,e):Me(n.length>0,n,r,e),n),Fe=e=>function(n,r){Me(t(n),n,r,"an object");const o=[],a={};if(Object.keys(e).forEach((t=>{const i=n[t],s=e[t],c=r?`${r}.${t}`:t;try{const e=s.call(this,i,c);void 0!==e&&(a[t]=e)}catch(e){o.push(e.message)}})),Object.keys(n).forEach((e=>{Object.prototype.hasOwnProperty.call(a,e)||(a[e]=n[e])})),o.length)throw new Error(o.join("\n"));return a},_e=(e,n,r)=>function(o,a){Me(t(o),o,a,"an object");const{[e]:i,[r]:s,...c}=o,d=n(i,a);if(void 0!==d){let t=`The field '${e}' is deprecated. Use '${r}' instead.`;if(a&&(t=`'${a}': ${t}`),void 0!==s&&s!==d)throw new Error(t);this&&this.logger&&this.logger.warn(t)}return{[r]:s||d,...c}},Ve=()=>(e,t)=>(Me((e=>{const t=Object.create(null);for(let n=0;n<e.length;n+=1){const r=e[n];if(r in t)return!1;t[r]=!0}return!0})(e),e,t,"array values to be unique"),e);const He=/^[a-z0-9.-]{1,}$/i;var ze=(e,t)=>(Me(He.test(e),e,t,"a valid domain"),e),Je=(e,t)=>(Me(le(e),e,t,"an integer"),e),Ge=(e,t)=>(Me(de(e),e,t,"a number"),e),Qe=(e,t)=>(Me((e=>{try{return null!==RegExp(e)}catch{return!1}})(e),e,t,"a regular expression"),e),Xe=(e,t)=>{if(null==e)throw new Error(`'${t}' is a required option`);return e},We=(e,t)=>(Me(ue(e),e,t,"a string"),e);const Ye=e=>e;Ye.default=function(e){return Oe(this,(e=>t=>null==t?e:t)(e))},Ye.required=function(){return Oe(this,Xe)},Ye.deprecated=function(e){return Oe(this,Le(e))};const Ke=function(){return Ne(this,ze)},Ze=function(e){return Ne(this,je("an integer",e))},et=function(e){return Ne(this,je("a number",e))},tt=function(e){return Ne(this,(t="a number",n=e,(e,r)=>(Me(e<=n,e,r,`${t} less than or equal to ${n}`),e)));var t,n},nt=function(){return Ne(this,Je,{minimum:Ze})},rt=function(){return Ne(this,Be("a non-empty string"))},ot=function(){return Ne(this,Be("a non-empty array"))},at=function(){return Ne(this,Be("a non-empty object"))},it=function(){return Ne(this,Qe)},st=function(e){return Ne(this,(e=>(t,n)=>(Me(e.test(t),t,n,`does not match the ${e.toString()}`),t))(e))},ct=function(){return Ne(this,(()=>{const e=[];return(t,n)=>(Me(-1===e.indexOf(t),t,n,"a unique value across instances"),e.push(t),t)})())},dt=function(){return Ne(this,Ve())},lt=e=>({noUnknownFields:function(){return Ne(this,(e=>(t,n)=>{const r=[];if(Object.keys(t).forEach((t=>{if(!e[t]){const e=n?`${n}.${t}`:t;r.push(`'${e}': Unknown field.`)}})),r.length)throw new Error(r.join("\n"));return t})(e))},nonEmpty:at,concat:function(t){const n={...e,...t.schema};return Ne(this,t,lt(n))},renamed:function(e,t,n){return r=this,o=_e(e,t,n),Object.assign(Re(Pe(o),r),r,a);var r,o,a},schema:e}),ut=function(e,t){return Oe(this,$e(e,t))}.bind(Ye),pt=function(){return this}.bind(Ye),gt=function(e){return Ne(this,qe(e),{nonEmpty:ot,uniqueItems:dt})}.bind(Ye),mt=function(){return Ne(this,Ae)}.bind(Ye),ft=function(){return Ne(this,xe)}.bind(Ye),ht=function(e){return Ne(this,(e=>(t,n)=>(Me(t===e,t,n,`${e}`),t))(e))}.bind(Ye),yt=function(){return Ne(this,Ge,{minimum:et,maximum:tt,integer:nt,unique:ct})}.bind(Ye),vt=function(e){return Ne(this,Ue(e),{nonEmpty:at})}.bind(Ye),wt=function(e){return Ne(this,Fe(e),lt(e))}.bind(Ye),bt=function(){return Ne(this,We,{regexp:it,domain:Ke,nonEmpty:rt,unique:ct,matches:st})}.bind(Ye),Et=function(...e){return ut(e.map(ht),`one of these values: ${JSON.stringify(e)}`)};var Ct=vt(gt(wt({authenticatedState:Et("ambiguous","authenticated","loggedOut"),id:bt(),namespace:wt({code:bt()}).noUnknownFields(),primary:mt(),xid:bt()}).noUnknownFields()).required()),It=wt({}),kt="alloy_debug",St=({console:e,locationSearch:t,createLogger:n,instanceName:r,createNamespacedStorage:o,getMonitors:a})=>{const i=be.parse(t),s=o(`instance.${r}.`),c=s.session.getItem("debug");let d="true"===c,l=null===c;const u=()=>d,p=(e,{fromConfig:t})=>{t&&!l||(d=e),t||(s.session.setItem("debug",e.toString()),l=!1)};var g;return void 0!==i[kt]&&p((g=i[kt],ue(g)&&"true"===g.toLowerCase()),{fromConfig:!1}),{setDebugEnabled:p,logger:n({getDebugEnabled:u,context:{instanceName:r},getMonitors:a,console:e}),createComponentLogger:t=>n({getDebugEnabled:u,context:{instanceName:r,componentName:t},getMonitors:a,console:e})}};const Dt=["onComponentsRegistered","onBeforeEvent","onBeforeRequest","onResponse","onRequestFailure","onClick","onDecision"];var Pt=e=>Dt.reduce(((t,n)=>{var r;return t[n]=(r=((e,t)=>(...n)=>Promise.all(e.getLifecycleCallbacks(t).map((e=>new Promise((t=>{t(e(...n))}))))))(e,n),(...e)=>Promise.resolve().then((()=>r(...e)))),t}),{});const Tt=(e,t)=>(...n)=>{let r;try{r=e(...n)}catch(e){throw ke({error:e,message:t})}return r instanceof Promise&&(r=r.catch((e=>{throw ke({error:e,message:t})}))),r};var Rt=()=>{const e={},t={},n={};return{register(r,o){const{commands:a,lifecycle:i}=o;((e,n={})=>{const r=(o=Object.keys(t),a=Object.keys(n),o.filter((e=>a.includes(e))));var o,a;if(r.length)throw new Error(`[ComponentRegistry] Could not register ${e} because it has existing command(s): ${r.join(",")}`);Object.keys(n).forEach((r=>{const o=n[r];o.commandName=r,o.run=Tt(o.run,`[${e}] An error occurred while executing the ${r} command.`),t[r]=o}))})(r,a),((e,t={})=>{Object.keys(t).forEach((r=>{n[r]=n[r]||[],n[r].push(Tt(t[r],`[${e}] An error occurred while executing the ${r} lifecycle hook.`))}))})(r,i),e[r]=o},getCommand:e=>t[e],getCommandNames:()=>Object.keys(t),getLifecycleCallbacks:e=>n[e]||[],getComponentNames:()=>Object.keys(e)}};const Ot="in",Nt="out",Mt="pending",At="general",xt="declinedConsent",$t="default",qt="initial",Lt="new",Ut=e=>{const t=new Error(e);return t.code=xt,t.message=e,t};var jt=({logger:e})=>{const t=[],n=()=>Promise.resolve(),r=()=>Promise.resolve(),o=()=>Promise.reject(Ut("No consent preferences have been set.")),a=()=>Promise.reject(Ut("The user declined consent.")),i=e=>{if(e)return Promise.reject(new Error("Consent is pending."));const n=h();return t.push(n),n.promise};return{in(o){o===$t?this.awaitConsent=n:(o===qt?e.info("Loaded user consent preferences. The user previously consented."):o===Lt&&this.awaitConsent!==r&&e.info("User consented."),(()=>{for(;t.length;)t.shift().resolve()})(),this.awaitConsent=r)},out(n){n===$t?(e.warn("User consent preferences not found. Default consent of out will be used."),this.awaitConsent=o):(n===qt?e.warn("Loaded user consent preferences. The user previously declined consent."):n===Lt&&this.awaitConsent!==a&&e.warn("User declined consent."),(()=>{for(;t.length;)t.shift().reject(Ut("The user declined consent."))})(),this.awaitConsent=a)},pending(t){t===$t&&e.info("User consent preferences not found. Default consent of pending will be used. Some commands may be delayed."),this.awaitConsent=i},awaitConsent:()=>Promise.resolve(),withConsent(){return this.awaitConsent(!0)},current(){switch(this.awaitConsent){case n:return{state:"in",wasSet:!1};case r:return{state:"in",wasSet:!0};case o:return{state:"out",wasSet:!1};case a:return{state:"out",wasSet:!0};case i:return{state:"pending",wasSet:!1};default:return{state:"in",wasSet:!1}}}}};const Bt=e=>e&&e._experience&&e._experience.decisioning&&S(e._experience.decisioning.propositions)?e._experience.decisioning.propositions:[];var Ft=()=>{const e={};let t,n,r=!1,o=!1,a=!0;const s=e=>{if(o)throw new Error(`${e} cannot be called after event is finalized.`)},c={hasQuery(){return Object.prototype.hasOwnProperty.call(this.getContent(),"query")},getContent(){const r=JSON.parse(JSON.stringify(e));return t&&i(r,{xdm:t}),n&&i(r,{data:n}),r},setUserXdm(e){s("setUserXdm"),t=e},setUserData(e){s("setUserData"),n=e},mergeXdm(t){s("mergeXdm"),t&&i(e,{xdm:t})},mergeData(t){s("mergeData"),t&&i(e,{data:t})},mergeMeta(t){s("mergeMeta"),t&&i(e,{meta:t})},mergeQuery(t){s("mergeQuery"),t&&i(e,{query:t})},documentMayUnload(){r=!0},finalize(r){if(o)return;const i=((e,t=y)=>e.filter(((n,r)=>((e,t,n)=>{for(let r=0;r<e.length;r+=1)if(n(e[r],t))return r;return-1})(e,n,t)===r)))([...Bt(t),...Bt(e.xdm)],((e,t)=>e===t||e.id&&t.id&&e.id===t.id&&e.scope&&t.scope&&e.scope===t.scope));if(t&&this.mergeXdm(t),i.length>0&&(e.xdm._experience.decisioning.propositions=i),n&&c.mergeData(n),o=!0,r){a=!1;const t={xdm:e.xdm||{},data:e.data||{}},n=r(t);a=!1!==n,e.xdm=t.xdm||{},e.data=t.data||{},F(e.xdm)&&delete e.xdm,F(e.data)&&delete e.data}},getDocumentMayUnload:()=>r,isEmpty:()=>F(e)&&(!t||F(t))&&(!n||F(n)),shouldSend:()=>a,getViewName(){if(t&&t.web&&t.web.webPageDetails)return t.web.webPageDetails.viewName},toJSON(){if(!o)throw new Error("toJSON called before finalize");return e}};return c};const _t="configure",Vt="setDebug";var Ht=({logger:e,configureCommand:n,setDebugCommand:r,handleError:o,validateCommandOptions:a})=>{let i;return(s,c={})=>new Promise((t=>{const o=((t,o)=>{let s;if(t===_t){if(i)throw new Error("The library has already been configured and may only be configured once.");s=()=>(i=n(o),i.then((()=>{})))}else{if(!i)throw new Error("The library must be configured first. Please do so by executing the configure command.");s=t===Vt?()=>{const e=wt({enabled:mt().required()}).noUnknownFields(),t=a({command:{commandName:Vt,optionsValidator:e},options:o});r(t)}:()=>i.then((e=>{const n=e.getCommand(t);if(!n||!k(n.run)){const n=[_t,Vt].concat(e.getCommandNames()).join(", ");throw new Error(`The ${t} command does not exist. List of available commands: ${n}.`)}const r=a({command:n,options:o});return n.run(r)}),(()=>(e.warn(`An error during configuration is preventing the ${t} command from executing.`),new Promise((()=>{})))))}return s})(s,c);e.logOnBeforeCommand({commandName:s,options:c}),t(o())})).catch((e=>o(e,`${s} command`))).catch((t=>{throw e.logOnCommandRejected({commandName:s,options:c,error:t}),t})).then((n=>{const r=t(n)?n:{};return e.logOnCommandResolved({commandName:s,options:c,result:r}),r}))};const zt="https://adobe.ly/3sHgQHb";var Jt=({command:e,options:t})=>{const{commandName:n,documentationUri:r=zt,optionsValidator:o}=e;let a=t;if(o)try{a=o(t)}catch(e){throw new Error(`Invalid ${n} command options:\n\t - ${e} For command documentation see: ${r}`)}return a};var Gt=({options:e,componentCreators:t,coreConfigValidators:n,createConfig:r,logger:o,setDebugEnabled:a})=>{const i=(e=>{const t=[],n={get enabled(){return e.enabled},flush(){t.forEach((({method:t,args:n})=>e[t](...n)))}};return Object.keys(e).filter((t=>"function"==typeof e[t])).forEach((e=>{n[e]=(...n)=>{t.push({method:e,args:n})}})),n})(o),s=t.map((({configValidators:e})=>e)).filter((e=>e)).reduce(((e,t)=>e.concat(t)),n),c=r((({combinedConfigValidator:e,options:t,logger:n})=>{try{return e.noUnknownFields().required().call({logger:n},t)}catch(e){throw new Error(`Resolve these configuration problems:\n\t - ${e.message.split("\n").join("\n\t - ")}\nFor configuration documentation see: https://adobe.ly/3sHh553`)}})({combinedConfigValidator:s,options:e,logger:i}));a(c.debugEnabled,{fromConfig:!0}),i.flush();const d=((e,t,n)=>n.reduce(((n,{buildOnInstanceConfiguredExtraParams:r})=>(r&&(n={...n,...r({config:e,logger:t})}),n)),{}))(c,o,t);return o.logOnInstanceConfigured({...d,config:c}),c};const Qt=e=>({...e});var Xt=({errorPrefix:e,logger:t})=>(n,r)=>{const o=Ce(n);if(o.code===xt)return t.warn(`The ${r} could not fully complete. ${o.message}`),{};throw Ie({error:o,message:`${e} ${o.message}`}),o},Wt=({getDebugEnabled:e,console:t,getMonitors:n,context:r})=>{let o=`[${r.instanceName}]`;r.componentName&&(o+=` [${r.componentName}]`);const a=(e,t)=>{const o=n();if(o.length>0){const n={...r,...t};o.forEach((t=>{t[e]&&t[e](n)}))}},i=(n,...r)=>{a("onBeforeLog",{level:n,arguments:r}),e()&&t[n](o,...r)};return{get enabled(){return n().length>0||e()},logOnInstanceCreated(e){a("onInstanceCreated",e),i("info","Instance initialized.")},logOnInstanceConfigured(e){a("onInstanceConfigured",e),i("info","Instance configured. Computed configuration:",e.config)},logOnBeforeCommand(e){a("onBeforeCommand",e),i("info",`Executing ${e.commandName} command. Options:`,e.options)},logOnCommandResolved(e){a("onCommandResolved",e),i("info",`${e.commandName} command resolved. Result:`,e.result)},logOnCommandRejected(e){a("onCommandRejected",e),i("error",`${e.commandName} command was rejected. Error:`,e.error)},logOnBeforeNetworkRequest(e){a("onBeforeNetworkRequest",e),i("info",`Request ${e.requestId}: Sending request.`,e.payload)},logOnNetworkResponse(e){a("onNetworkResponse",e);const t=e.parsedBody||e.body?"response body:":"no response body.";i("info",`Request ${e.requestId}: Received response with status code ${e.statusCode} and ${t}`,e.parsedBody||e.body)},logOnNetworkError(e){a("onNetworkError",e),i("error",`Request ${e.requestId}: Network request failed.`,e.error)},logOnContentHiding(e){a("onContentHiding",{status:e.status}),i(e.logLevel,e.message)},logOnContentRendering(e){a("onContentRendering",{status:e.status,payload:e.detail}),i(e.logLevel,e.message)},info:i.bind(null,"info"),warn:i.bind(null,"warn"),error:i.bind(null,"error")}},Yt="__view__",Kt=e=>(t,n)=>{e.xdm=e.xdm||{},e.xdm.identityMap=e.xdm.identityMap||{},e.xdm.identityMap[t]=e.xdm.identityMap[t]||[],e.xdm.identityMap[t].push(n)},Zt=e=>{const{payload:t,getAction:n,getUseSendBeacon:r,datastreamIdOverride:o,edgeSubPath:a}=e,i=g();let s=!1,c=!1;return{getId:()=>i,getPayload:()=>t,getAction:()=>n({isIdentityEstablished:c}),getDatastreamIdOverride:()=>o,getUseSendBeacon:()=>r({isIdentityEstablished:c}),getEdgeSubPath:()=>a||"",getUseIdThirdPartyDomain:()=>s,setUseIdThirdPartyDomain(){s=!0},setIsIdentityEstablished(){c=!0}}},en=({payload:e,datastreamIdOverride:t})=>{const n=({isIdentityEstablished:t})=>e.getDocumentMayUnload()&&t;return Zt({payload:e,getAction:({isIdentityEstablished:e})=>n({isIdentityEstablished:e})?"collect":"interact",getUseSendBeacon:n,datastreamIdOverride:t})},tn=t=>{const{content:n,addIdentity:r,hasIdentity:o}=t,a=s(n,"meta.configOverrides");return{mergeMeta:s(n,"meta"),mergeState:s(n,"meta.state"),mergeQuery:s(n,"query"),mergeConfigOverride:t=>a((t=>{if(e(t)||"object"!=typeof t)return null;const n=_(t,(t=>!(e(t)||!ce(t)&&!de(t)&&!pe(t)&&!S(t))));return F(n)?null:n})(t)),addIdentity:r,hasIdentity:o,toJSON:()=>n}},nn=e=>t=>void 0!==(e.xdm&&e.xdm.identityMap&&e.xdm.identityMap[t]),rn=()=>{const e={},t=tn({content:e,addIdentity:Kt(e),hasIdentity:nn(e)});return t.addEvent=t=>{e.events=e.events||[],e.events.push(t)},t.getDocumentMayUnload=()=>(e.events||[]).some((e=>e.getDocumentMayUnload())),t},on=({localConfigOverrides:e,globalConfigOverrides:t,payload:n})=>{const r={payload:n},{datastreamId:o,...a}=e||{};return o&&(r.datastreamIdOverride=o),t&&!F(t)&&n.mergeConfigOverride(t),a&&!F(a)&&n.mergeConfigOverride(a),r};const an="clientId";const sn="Event was canceled because the onBeforeEventSend callback returned false.";var cn=({orgId:e,targetMigrationEnabled:t})=>n=>((e,t)=>0===t.indexOf(`${J}_${G(e)}_`))(e,n)||"at_qa_mode"===n||t&&"mbox"===n;var dn=e=>((...e)=>e.length<2?Object.assign(...e):e.reduce(((e,n)=>(t(n)&&Object.keys(n).forEach((t=>{Array.isArray(n[t])?Array.isArray(e[t])?e[t].push(...n[t]):e[t]=[...n[t]]:e[t]=n[t]})),e))))({},...e.shift()||[],...e.shift()||[],...e),ln=e=>t=>{const n=()=>{throw t};return e.call({error:t}).then(n,n)};const un="The server responded with a";var pn=({orgId:e,cookieJar:t})=>{const n=Q(e,"cluster");return()=>t.get(n)||(()=>{const e=t.get("mboxEdgeCluster");if(e)return`t${e}`})()};const gn=[429,503,502,504];var mn=({response:e,retriesAttempted:t})=>t<3&&gn.includes(e.statusCode);var fn=({response:e,retriesAttempted:t})=>{let n=(e=>{const t=e.getHeader("Retry-After");let n;if(t){const e=parseInt(t,10);n=le(e)?1e3*e:Math.max(0,new Date(t).getTime()-(new Date).getTime())}return n})(e);return void 0===n&&(n=(e=>{const t=1e3+1e3*e,n=.3*t,r=t-n,o=t+n;return Math.round(r+Math.random()*(o-r))})(t)),n};var hn=e=>{let t=window.__alloyMonitors||[];return e&&(t=t.concat(e)),t};var yn=e=>t=>{const n=e().toISOString();i(t,{timestamp:n})};const vn="2.28.0";var wn=[["architecture","string"],["bitness","string"],["model","string"],["platformVersion","string"],["wow64","boolean"]];const bn=(e=>t=>{const n={webPageDetails:{URL:e.location.href||e.location},webReferrer:{URL:e.document.referrer}};i(t,{web:n})})(window),En=(e=>t=>{const{screen:{width:n,height:r}}=e,o={},a=Se(r);a>=0&&(o.screenHeight=a);const s=Se(n);s>=0&&(o.screenWidth=s);const c=(e=>{const{screen:{orientation:t}}=e;if(null==t||null==t.type)return null;const n=t.type.split("-");return 0===n.length||"portrait"!==n[0]&&"landscape"!==n[0]?null:n[0]})(e)||(e=>{if(k(e.matchMedia)){if(e.matchMedia("(orientation: portrait)").matches)return"portrait";if(e.matchMedia("(orientation: landscape)").matches)return"landscape"}return null})(e);c&&(o.screenOrientation=c),Object.keys(o).length>0&&i(t,{device:o})})(window),Cn=(e=>t=>{const{document:{documentElement:{clientWidth:n,clientHeight:r}={}}}=e,o={type:"browser"},a=Se(n);a>=0&&(o.browserDetails={viewportWidth:a});const s=Se(r);s>=0&&(o.browserDetails=o.browserDetails||{},o.browserDetails.viewportHeight=s),i(t,{environment:o})})(window),In=(kn=()=>new Date,e=>{const t=kn(),n={},r=Se(t.getTimezoneOffset());void 0!==r&&(n.localTimezoneOffset=r),(void 0===r||Math.abs(r)<6e3)&&(n.localTime=(e=>{const t=e.getFullYear(),n=De(e.getMonth()+1,2,"0"),r=De(e.getDate(),2,"0"),o=De(e.getHours(),2,"0"),a=De(e.getMinutes(),2,"0"),i=De(e.getSeconds(),2,"0"),s=De(e.getMilliseconds(),3,"0"),c=Se(e.getTimezoneOffset(),0);return`${t}-${n}-${r}T${o}:${a}:${i}.${s}${c>0?"-":"+"}${De(Math.floor(Math.abs(c)/60),2,"0")}:${De(Math.abs(c)%60,2,"0")}`})(t)),i(e,{placeContext:n})});var kn;const Sn=yn((()=>new Date)),Dn={web:bn,device:En,environment:Cn,placeContext:In},Pn={highEntropyUserAgentHints:(e=>(e=>"userAgentData"in e)(e)?(t,n)=>{try{return e.userAgentData.getHighEntropyValues(wn.map((e=>e[0]))).then((e=>{const n={};wn.forEach((([t,r])=>{Object.prototype.hasOwnProperty.call(e,t)&&typeof e[t]===r&&(n[t]=e[t])})),i(t,{environment:{browserDetails:{userAgentClientHints:n}}})}))}catch(e){return n.warn(`Unable to collect user-agent client hints. ${e.message}`),ge}}:ge)(navigator)},Tn={...Dn,...Pn},Rn=[Sn,e=>{i(e,{implementationDetails:{name:"https://ns.adobe.com/experience/alloy",version:vn,environment:"browser"}})}],On=({config:e,logger:t})=>((e,t,n,r)=>{const o=e.context.flatMap(((e,r)=>n[e]?[n[e]]:(t.warn(`Invalid context[${r}]: '${e}' is not available.`),[]))).concat(r);return{namespace:"Context",lifecycle:{onBeforeEvent({event:e}){const n={};return Promise.all(o.map((e=>Promise.resolve(e(n,t))))).then((()=>e.mergeXdm(n)))}}}})(e,t,Tn,Rn);On.namespace="Context",On.configValidators=wt({context:gt(bt()).default(Object.keys(Dn))});const Nn=({eventManager:e,logger:t})=>({commands:{sendEvent:{documentationUri:"https://adobe.ly/3GQ3Q7t",optionsValidator:e=>(({options:e})=>wt({type:bt(),xdm:wt({eventType:bt(),identityMap:Ct}),data:wt({}),documentUnloading:mt(),renderDecisions:mt(),decisionScopes:gt(bt()).uniqueItems(),personalization:wt({decisionScopes:gt(bt()).uniqueItems(),surfaces:gt(bt()).uniqueItems(),sendDisplayEvent:mt().default(!0),includeRenderedPropositions:mt().default(!1),defaultPersonalizationEnabled:mt(),decisionContext:wt({})}).default({sendDisplayEvent:!0}),datasetId:bt(),mergeId:bt(),edgeConfigOverrides:It}).required().noUnknownFields()(e))({options:e}),run:n=>{const{xdm:r,data:o,documentUnloading:a,type:s,mergeId:c,datasetId:d,edgeConfigOverrides:l,...u}=n,p=e.createEvent();return a&&p.documentMayUnload(),p.setUserXdm(r),p.setUserData(o),s&&p.mergeXdm({eventType:s}),c&&p.mergeXdm({eventMergeId:c}),l&&(u.edgeConfigOverrides=l),d&&(t.warn("The 'datasetId' option has been deprecated. Please use 'edgeConfigOverrides.com_adobe_experience_platform.datasets.event.datasetId' instead."),u.edgeConfigOverrides=l||{},i(u.edgeConfigOverrides,{com_adobe_experience_platform:{datasets:{event:{datasetId:d}}}})),e.sendEvent(p,u)}},applyResponse:{documentationUri:"",optionsValidator:e=>(({options:e})=>wt({renderDecisions:mt(),responseHeaders:vt(bt().required()),responseBody:wt({handle:gt(wt({type:bt().required(),payload:pt().required()})).required()}).required(),personalization:wt({sendDisplayEvent:mt().default(!0),decisionContext:wt({})}).default({sendDisplayEvent:!0})}).noUnknownFields()(e))({options:e}),run:t=>{const{renderDecisions:n=!1,decisionContext:r={},responseHeaders:o={},responseBody:a={handle:[]},personalization:i}=t,s=e.createEvent();return e.applyResponse(s,{renderDecisions:n,decisionContext:r,responseHeaders:o,responseBody:a,personalization:i})}}}});Nn.namespace="DataCollector";const Mn=(e,t)=>`ID sync ${t?"succeeded":"failed"}: ${e.spec.url}`;const An=wt({thirdPartyCookiesEnabled:mt().default(!0),idMigrationEnabled:mt().default(!0)});var xn=wt({url:bt().required().nonEmpty(),edgeConfigOverrides:It}).required().noUnknownFields(),$n="ECID",qn=({logger:e})=>new Promise(((n,r)=>{if(t(window.adobe)&&t(window.adobe.optIn)){const t=window.adobe.optIn;e.info("Delaying request while waiting for legacy opt-in to let Visitor retrieve ECID from server."),t.fetchPermissions((()=>{t.isApproved([t.Categories.ECID])?(e.info("Received legacy opt-in approval to let Visitor retrieve ECID from server."),n()):r(new Error("Legacy opt-in was declined."))}),!0)}else n()})),Ln=({logger:e,orgId:t,awaitVisitorOptIn:n})=>()=>{const r=(e=>{const t=e.Visitor;return k(t)&&k(t.getInstance)&&t})(window);return r?n({logger:e}).then((()=>(e.info("Delaying request while using Visitor to retrieve ECID from server."),new Promise((n=>{r.getInstance(t,{}).getMarketingCloudVisitorID((t=>{e.info("Resuming previously delayed request that was waiting for ECID from Visitor."),n(t)}),!0)}))))).catch((t=>{t?e.info(`${t.message}, retrieving ECID from experience edge`):e.info("An error occurred while obtaining the ECID from Visitor.")})):Promise.resolve()},Un="CORE",jn=e=>{try{return decodeURIComponent(e)}catch{return""}};var Bn=(e,t)=>{e.addIdentity($n,{id:t})},Fn=e=>e.getPayloadsByType("identity:result").reduce(((e,t)=>(t.namespace&&t.namespace.code&&(e[t.namespace.code]=t.id),e)),{}),_n=({payload:e,datastreamIdOverride:t})=>Zt({payload:e,datastreamIdOverride:t,getAction:()=>"identity/acquire",getUseSendBeacon:()=>!1}),Vn=e=>{const t={query:{identity:{fetch:e}}};return tn({content:t,addIdentity:Kt(t),hasIdentity:nn(t)})};const Hn=/^([^?#]*)(\??[^#]*)(#?.*)$/;const zn=wt({namespaces:gt(Et($n,Un)).nonEmpty().uniqueItems().default([$n]),edgeConfigOverrides:It}).noUnknownFields().default({namespaces:[$n]});const Jn=(e,t)=>{let n,r=0,o=0;do{if(t<0||t+o>=e.length)throw new Error("Invalid varint: buffer ended unexpectedly");if(n=e[t+o],r|=(127&n)<<7*o,o+=1,o>10)throw new Error("Invalid varint: too long")}while(128&n);return{value:r,length:o}},Gn=Object.freeze({VARINT:0,I64:1,LEN:2,SGROUP:3,EGROUP:4,I32:5});var Qn=({orgId:e,cookieJar:t,logger:n})=>{const r=Q(e,"identity");return()=>{const e=t.get(r);if(!e)return null;try{const t=decodeURIComponent(e).replace(/_/g,"/").replace(/-/g,"+");return(e=>{let t=0,n=null;for(;t<e.length&&!n;){const{value:r,length:o}=Jn(e,t);t+=o;const a=7&r;if(1==r>>3){if(a===Gn.LEN){const r=Jn(e,t);return t+=r.length,n=(new TextDecoder).decode(e.slice(t,t+r.value)),t+=r.value,n}}else switch(a){case Gn.VARINT:t+=Jn(e,t).length;break;case Gn.I64:t+=8;break;case Gn.LEN:{const n=Jn(e,t);t+=n.length+n.value;break}case Gn.SGROUP:case Gn.EGROUP:break;case Gn.I32:t+=4;break;default:throw new Error(`Malformed kndctr cookie. Unknown wire type: ${a}`)}}throw new Error("No ECID found in cookie.")})((e=>{const t=atob(e);return Uint8Array.from(t,(e=>e.codePointAt(0)))})(t))}catch(e){return n.warn(`Unable to decode ECID from ${r} cookie`,e),null}}};const Xn=({config:e,logger:t,consent:n,fireReferrerHideableImage:r,sendEdgeNetworkRequest:a,apexDomain:i,getBrowser:s})=>{const{orgId:c,thirdPartyCookiesEnabled:d,edgeConfigOverrides:l}=e,u=Ln({logger:t,orgId:c,awaitVisitorOptIn:qn}),p=f({logger:t,cookieJar:o}),g=(({config:e,getEcidFromVisitor:t,apexDomain:n,isPageSsl:r,cookieJar:o})=>{const{idMigrationEnabled:a,orgId:i}=e,s=`AMCV_${i}`,c=()=>{let e=null;const t=o.get("s_ecid")||o.get(s);if(t){const n=/(^|\|)MCMID\|(\d+)($|\|)/,r=t.match(n);r&&(e=r[2])}return e};return{getEcid(){if(a){const e=c();return e?Promise.resolve(e):t()}return Promise.resolve()},setEcid(e){if(a&&c()!==e){const t=r?{sameSite:"none",secure:!0}:{};o.set(s,`MCMID|${e}`,{domain:n,expires:390,...t})}}}})({config:e,getEcidFromVisitor:u,apexDomain:i,cookieJar:p,isPageSsl:"https:"===window.location.protocol}),m=ae({orgId:c}),h=(({sendEdgeNetworkRequest:e,createIdentityRequestPayload:t,createIdentityRequest:n,globalConfigOverrides:r})=>({namespaces:o,edgeConfigOverrides:a}={})=>{const i=on({payload:t(o),globalConfigOverrides:r,localConfigOverrides:a}),s=n(i);return e({request:s})})({sendEdgeNetworkRequest:a,createIdentityRequestPayload:Vn,createIdentityRequest:_n,globalConfigOverrides:l}),y=(({getBrowser:e})=>re((()=>oe.includes(e()))))({getBrowser:s}),v=(({thirdPartyCookiesEnabled:e,areThirdPartyCookiesSupportedByDefault:t})=>n=>{e&&t()&&n.setUseIdThirdPartyDomain()})({thirdPartyCookiesEnabled:d,areThirdPartyCookiesSupportedByDefault:y}),w=(({getLegacyEcid:e,addEcidToPayload:t})=>n=>n.hasIdentity($n)?Promise.resolve():e().then((e=>{e&&t(n,e)})))({getLegacyEcid:g.getEcid,addEcidToPayload:Bn}),b=(({locationSearch:e,dateProvider:t,orgId:n,logger:r})=>o=>{if(o.hasIdentity($n))return;let a=be.parse(e).adobe_mc;if(void 0===a)return;Array.isArray(a)&&(r.warn("Found multiple adobe_mc query string paramters, only using the last one."),a=a[a.length-1]);const i=a.split("|").reduce(((e,t)=>{const[n,r]=t.split("=");return e[n]=jn(r),e[n]=e[n].replace(/[^a-zA-Z0-9@.]/g,""),e}),{}),s=parseInt(i.TS,10),c=i.MCMID,d=jn(i.MCORGID);t().getTime()/1e3<=s+300&&d===n&&c?(r.info(`Found valid ECID identity ${c} from the adobe_mc query string parameter.`),o.addIdentity($n,{id:c})):r.info("Detected invalid or expired adobe_mc query string parameter.")})({locationSearch:window.document.location.search,dateProvider:()=>new Date,orgId:c,logger:t}),E=(({doesIdentityCookieExist:e,orgId:t,logger:n})=>({onResponse:r,onRequestFailure:o})=>new Promise(((a,i)=>{r((()=>{e()?a():(n.warn(`Identity cookie not found. This could be caused by any of the following issues:\n\t* The org ID ${t} configured in Alloy doesn't match the org ID specified in the edge configuration.\n\t* Experience edge was not able to set the identity cookie due to domain or cookie restrictions.\n\t* The request was canceled by the browser and not fully processed.`),i(new Error("Identity cookie not found.")))})),o((()=>{e()?a():i(new Error("Identity cookie not found."))}))})))({doesIdentityCookieExist:m,orgId:c,logger:t}),C=(({doesIdentityCookieExist:e,setDomainForInitialIdentityPayload:t,addLegacyEcidToPayload:n,awaitIdentityCookie:r,logger:o})=>{let a;const i=e=>(t(e),n(e.getPayload()));return({request:t,onResponse:n,onRequestFailure:s})=>{if(e())return t.setIsIdentityEstablished(),Promise.resolve();if(a){o.info("Delaying request while retrieving ECID from server.");const e=a;return a=e.catch((()=>r({onResponse:n,onRequestFailure:s}))),a.catch((()=>{})),e.then((()=>{o.info("Resuming previously delayed request."),t.setIsIdentityEstablished()})).catch((()=>i(t)))}return a=r({onResponse:n,onRequestFailure:s}),a.catch((()=>{})),i(t)}})({doesIdentityCookieExist:m,setDomainForInitialIdentityPayload:v,addLegacyEcidToPayload:w,awaitIdentityCookie:E,logger:t}),I=(({fireReferrerHideableImage:e,logger:t})=>n=>{const r=n.filter((e=>"url"===e.type));return r.length?Promise.all(r.map((n=>e(n.spec).then((()=>{t.info(Mn(n,!0))})).catch((()=>{t.error(Mn(n,!1))}))))).then(ge):Promise.resolve()})({fireReferrerHideableImage:r,logger:t}),k=(({processIdSyncs:e})=>t=>e(t.getPayloadsByType("identity:exchange")))({processIdSyncs:I}),S=(({dateProvider:e,orgId:t})=>(n,r)=>{const o=Math.round(e().getTime()/1e3),a=encodeURIComponent(`TS=${o}|MCMID=${n}|MCORGID=${encodeURIComponent(t)}`),[,i,s,c]=r.match(Hn),d=(e=>""===e?"?":"?"===e?"":"&")(s);return`${i}${s}${d}adobe_mc=${a}${c}`})({dateProvider:()=>new Date,orgId:c}),D=(({thirdPartyCookiesEnabled:e})=>t=>{const n=zn(t);if(!e&&n.namespaces.includes(Un))throw new Error(`namespaces: The ${Un} namespace cannot be requested when third-party cookies are disabled.`);return n})({thirdPartyCookiesEnabled:d}),P=(({thirdPartyCookiesEnabled:e,areThirdPartyCookiesSupportedByDefault:t})=>{const n={identity:{fetch:[$n]}};return e&&t()&&n.identity.fetch.push(Un),e=>{e.mergeQuery(n)}})({thirdPartyCookiesEnabled:d,areThirdPartyCookiesSupportedByDefault:y}),T=Qn({orgId:c,cookieJar:p,logger:t});return(({addEcidQueryToPayload:e,addQueryStringIdentityToPayload:t,ensureSingleIdentity:n,setLegacyEcid:r,handleResponseForIdSyncs:o,getNamespacesFromResponse:a,getIdentity:i,consent:s,appendIdentityToUrl:c,logger:d,getIdentityOptionsValidator:l,decodeKndctrCookie:u})=>{let p,g={};return{lifecycle:{onBeforeRequest:({request:r,onResponse:o,onRequestFailure:a})=>(e(r.getPayload()),t(r.getPayload()),n({request:r,onResponse:o,onRequestFailure:a})),onResponse({response:e}){const t=a(e);return p&&p[$n]||!t||!t[$n]||r(t[$n]),t&&Object.keys(t).length>0&&(p={...p,...t}),g={...g,...e.getEdge()},o(e)}},commands:{getIdentity:{optionsValidator:l,run:e=>{const{namespaces:t}=e;return s.awaitConsent().then((()=>{if(p)return;const n=u();return n&&t.includes($n)&&(p||(p={}),p[$n]=n,1===t.length)?void 0:i(e)})).then((()=>({identity:t.reduce(((e,t)=>(e[t]=p[t]||null,e)),{}),edge:g})))}},appendIdentityToUrl:{optionsValidator:xn,run:e=>s.withConsent().then((()=>{if(p)return;const t=u();return t?(p||(p={}),void(p[$n]=t)):i(e)})).then((()=>({url:c(p[$n],e.url)}))).catch((t=>(d.warn(`Unable to append identity to url. ${t.message}`),e)))}}}})({addEcidQueryToPayload:P,addQueryStringIdentityToPayload:b,ensureSingleIdentity:C,setLegacyEcid:g.setEcid,handleResponseForIdSyncs:k,getNamespacesFromResponse:Fn,getIdentity:h,consent:n,appendIdentityToUrl:S,logger:t,getIdentityOptionsValidator:D,decodeKndctrCookie:T})};Xn.namespace="Identity",Xn.configValidators=An;const Wn=({config:e,componentRegistry:t})=>{const n=[...t.getCommandNames(),_t,Vt].sort(),r={...e};Object.keys(e).forEach((t=>{const n=e[t];"function"==typeof n&&(r[t]=n.toString())}));const o=t.getComponentNames();return{version:vn,configs:r,commands:n,components:o}},Yn=({config:e,componentRegistry:t})=>({commands:{getLibraryInfo:{run:()=>({libraryInfo:Wn({config:e,componentRegistry:t})})}}});Yn.namespace="LibraryInfo";var Kn=Object.freeze({__proto__:null,context:On,dataCollector:Nn,identity:Xn,libraryInfo:Yn});const Zn=se(window),{console:er,fetch:tr,navigator:nr}=window,rr=wt({debugEnabled:mt().default(!1),datastreamId:bt().unique().required(),edgeDomain:bt().domain().default("edge.adobedc.net"),edgeBasePath:bt().nonEmpty().default("ee"),orgId:bt().unique().required(),onBeforeEventSend:ft().default(ge),edgeConfigOverrides:It}).renamed("edgeConfigId",bt().unique(),"datastreamId"),or=((e,t)=>{let n="";const r=e.location.hostname.toLowerCase().split(".");let o=1;for(;o<r.length&&!t.get(z);)o+=1,n=(a=r,i=o,a.slice(-i)).join("."),t.set(z,z,{domain:n});var a,i;return t.remove(z,{domain:n}),n})(window,o),ar=(({fetch:e})=>(t,n)=>e(t,{method:"POST",cache:"no-cache",credentials:"include",headers:{"Content-Type":"text/plain; charset=UTF-8"},referrerPolicy:"no-referrer-when-downgrade",body:n}).then((e=>e.text().then((t=>({statusCode:e.status,getHeader:t=>e.headers.get(t),body:t}))))))({fetch:tr}),ir=(({appendNode:e=v,awaitSelector:t=L,createNode:n=w,fireImage:r=I}={})=>{const o=r;let a;const i=({src:o})=>t("BODY").then((([t])=>a||(a=n("IFRAME",j,B),e(t,a)))).then((e=>{const t=e.contentWindow.document;return r({src:o,currentDocument:t})}));return e=>{const{hideReferrer:t,url:n}=e;return t?i({src:n}):o({src:n})}})(),sr=(({window:e,createNamespacedStorage:t})=>{const n=t("validation.");return()=>{const t=be.parse(e.location.search).adb_validation_sessionid;if(!t)return"";const r=(e=>{let t=e.persistent.getItem(an);return t||(t=g(),e.persistent.setItem(an,t)),t})(n),o=`${t}|${r}`;return`&${be.stringify({adobeAepValidationToken:o})}`}})({window:window,createNamespacedStorage:Zn}),cr=(({userAgent:e})=>re((()=>((e,t)=>{const n=Object.keys(e);for(let r=0;r<n.length;r+=1){const o=n[r];if(e[o].test(t))return o}return ne})({[Y]:/Edge\/([0-9\._]+)/,[K]:/Edg\/([0-9\.]+)/,[W]:/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/,[Z]:/Firefox\/([0-9\.]+)(?:\s|$)/,[ee]:/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/,[te]:/Version\/([0-9\._]+).*Safari/},e))))({userAgent:window.navigator.userAgent}),dr=({instanceName:e,logController:{setDebugEnabled:t,logger:n,createComponentLogger:r},components:a})=>{const i=Rt(),s=Pt(i),d=a.concat(Object.values(Kn)),l=f({logger:n,cookieJar:o}),u=Xt({errorPrefix:`[${e}]`,logger:n}),p=Ht({logger:n,configureCommand:a=>{const u=Gt({options:a,componentCreators:d,coreConfigValidators:rr,createConfig:Qt,logger:n,setDebugEnabled:t}),{orgId:p,targetMigrationEnabled:g}=u,m=cn({orgId:p,targetMigrationEnabled:g}),f=(({cookieJar:e,shouldTransferCookie:t,apexDomain:n,dateProvider:r})=>({cookiesToPayload(r,o){const a=""!==n&&o.endsWith(n),i={domain:n,cookiesEnabled:!0};if(!a){const n=e.get(),r=Object.keys(n).filter(t).map((e=>({key:e,value:n[e]})));r.length&&(i.entries=r)}r.mergeState(i)},responseToCookies(t){t.getPayloadsByType("state:store").forEach((t=>{const o={domain:n},a=t.attrs&&t.attrs.SameSite&&t.attrs.SameSite.toLowerCase();void 0!==t.maxAge&&(o.expires=new Date(r().getTime()+1e3*t.maxAge)),void 0!==a&&(o.sameSite=a),"none"===a&&(o.secure=!0),e.set(t.key,t.value,o)}))}}))({cookieJar:l,shouldTransferCookie:m,apexDomain:or,dateProvider:()=>new Date}),h=k(nr.sendBeacon)?(({sendBeacon:e,sendFetchRequest:t,logger:n})=>(r,o)=>{const a=new Blob([o],{type:"text/plain; charset=UTF-8"});return e(r,a)?Promise.resolve({statusCode:204,getHeader:()=>null,body:""}):(n.info("Unable to use `sendBeacon`; falling back to `fetch`."),t(r,o))})({sendBeacon:nr.sendBeacon.bind(nr),sendFetchRequest:ar,logger:n}):ar,y=(({logger:e,sendFetchRequest:t,sendBeaconRequest:n,isRequestRetryable:r,getRequestRetryDelay:o})=>({requestId:a,url:i,payload:s,useSendBeacon:c})=>{const d=JSON.stringify(s),l=JSON.parse(d);e.logOnBeforeNetworkRequest({url:i,requestId:a,payload:l});const u=(s=0)=>(c?n:t)(i,d).then((t=>{if(r({response:t,retriesAttempted:s})){const e=o({response:t,retriesAttempted:s});return new Promise((t=>{setTimeout((()=>{t(u(s+1))}),e)}))}let n;try{n=JSON.parse(t.body)}catch{}return e.logOnNetworkResponse({requestId:a,url:i,payload:l,...t,parsedBody:n,retriesAttempted:s}),{statusCode:t.statusCode,body:t.body,parsedBody:n,getHeader:t.getHeader}}));return u().catch((t=>{throw e.logOnNetworkError({requestId:a,url:i,payload:l,error:t}),ke({error:t,message:"Network request failed."})}))})({logger:n,sendFetchRequest:ar,sendBeaconRequest:h,isRequestRetryable:mn,getRequestRetryDelay:fn}),v=(({logger:e})=>t=>{const{statusCode:n,body:r,parsedBody:o}=t;if(n<200||n>=300||!o&&204!==n||o&&!Array.isArray(o.handle)){const e=o?JSON.stringify(o,null,2):r;throw new Error(`${un} status code ${n} and ${e?`response body:\n${e}`:"no response body."}`)}if(o){const{warnings:t=[],errors:n=[]}=o;t.forEach((t=>{e.warn(`${un} warning:`,t)})),n.forEach((t=>{e.error(`${un} non-fatal error:`,t)}))}})({logger:n}),w=(({logger:e})=>t=>{if(t){const n=t.split(";");if(n.length>=2&&n[1].length>0)try{const e=parseInt(n[1],10);if(!Number.isNaN(e))return{regionId:e}}catch{}e.warn(`Invalid adobe edge: "${t}"`)}return{}})({logger:n}),b=(({extractEdgeInfo:e})=>({content:t={},getHeader:n})=>{const{handle:r=[],errors:o=[],warnings:a=[]}=t;return{getPayloadsByType:e=>r.filter((t=>t.type===e)).flatMap((e=>e.payload)),getErrors:()=>o,getWarnings:()=>a,getEdge:()=>e(n("x-adobe-edge")),toJSON:()=>t}})({extractEdgeInfo:w}),E=pn({orgId:p,cookieJar:o}),C=(({config:e,lifecycle:t,cookieTransfer:n,sendNetworkRequest:r,createResponse:o,processWarningsAndErrors:a,getLocationHint:i,getAssuranceValidationTokenParams:s})=>{const{edgeDomain:d,edgeBasePath:l,datastreamId:u}=e;let p=!1;const g=(e,t)=>{const n=i(),r=n?`${l}/${n}${t.getEdgeSubPath()}`:`${l}${t.getEdgeSubPath()}`,o=t.getDatastreamIdOverride()||u;return o!==u&&t.getPayload().mergeMeta({sdkConfig:{datastream:{original:u}}}),`https://${e}/${r}/v1/${t.getAction()}?configId=${o}&requestId=${t.getId()}${s()}`};return({request:e,runOnResponseCallbacks:i=ge,runOnRequestFailureCallbacks:s=ge})=>{const l=c();l.add(t.onResponse),l.add(i);const u=c();return u.add(t.onRequestFailure),u.add(s),t.onBeforeRequest({request:e,onResponse:l.add,onRequestFailure:u.add}).then((()=>{const t=p||!e.getUseIdThirdPartyDomain()?d:"adobedc.demdex.net",o=g(t,e),a=e.getPayload();return n.cookiesToPayload(a,t),r({requestId:e.getId(),url:o,payload:a,useSendBeacon:e.getUseSendBeacon()})})).then((e=>(a(e),e))).catch((t=>{if(((e,t)=>t.getUseIdThirdPartyDomain()&&(e=>"TypeError"===e.name||"NetworkError"===e.name||0===e.status)(e))(t,e)){p=!0,e.setUseIdThirdPartyDomain(!1);const t=g(d,e),o=e.getPayload();return n.cookiesToPayload(o,d),r({requestId:e.getId(),url:t,payload:o,useSendBeacon:e.getUseSendBeacon()})}return ln(u)(t)})).then((({parsedBody:e,getHeader:t})=>{const r=o({content:e,getHeader:t});return n.responseToCookies(r),l.call({response:r}).then(dn)}))}})({config:u,lifecycle:s,cookieTransfer:f,sendNetworkRequest:y,createResponse:b,processWarningsAndErrors:v,getLocationHint:E,getAssuranceValidationTokenParams:sr}),I=(({cookieTransfer:e,lifecycle:t,createResponse:n,processWarningsAndErrors:r})=>({request:o,responseHeaders:a,responseBody:i,runOnResponseCallbacks:s=ge,runOnRequestFailureCallbacks:d=ge})=>{const l=c();l.add(t.onResponse),l.add(s);const u=c();u.add(t.onRequestFailure),u.add(d);const p=e=>a[e];return t.onBeforeRequest({request:o,onResponse:l.add,onRequestFailure:u.add}).then((()=>r({statusCode:200,getHeader:p,body:JSON.stringify(i),parsedBody:i}))).catch(ln(u)).then((()=>{const t=n({content:i,getHeader:p});return e.responseToCookies(t),l.call({response:t}).then(dn)}))})({lifecycle:s,cookieTransfer:f,createResponse:b,processWarningsAndErrors:v}),S=(({generalConsentState:e,logger:t})=>{const n=(n,r)=>{switch(n[At]){case Ot:e.in(r);break;case Nt:e.out(r);break;case Mt:e.pending(r);break;default:t.warn(`Unknown consent value: ${n[At]}`)}};return{initializeConsent(e,t){t[At]?n(t,qt):n(e,$t)},setConsent(e){n(e,Lt)},suspend(){e.pending()},awaitConsent:()=>e.awaitConsent(),withConsent:()=>e.withConsent(),current:()=>e.current()}})({generalConsentState:jt({logger:n}),logger:n}),D=(({config:e,logger:t,lifecycle:n,consent:r,createEvent:o,createDataCollectionRequestPayload:a,createDataCollectionRequest:i,sendEdgeNetworkRequest:s,applyResponse:d})=>{const{onBeforeEventSend:l,edgeConfigOverrides:u}=e;return{createEvent:o,sendEvent(e,o={}){const{edgeConfigOverrides:d,...p}=o,g=on({payload:a(),localConfigOverrides:d,globalConfigOverrides:u}),m=i(g),f=c(),h=c();return n.onBeforeEvent({...p,event:e,onResponse:f.add,onRequestFailure:h.add}).then((()=>(g.payload.addEvent(e),r.awaitConsent()))).then((()=>{try{e.finalize(l)}catch(e){const t=()=>{throw e};return h.add(n.onRequestFailure),h.call({error:e}).then(t,t)}if(!e.shouldSend()){h.add(n.onRequestFailure),t.info(sn);const e=new Error(sn);return h.call({error:e}).then((()=>{}))}return s({request:m,runOnResponseCallbacks:f.call,runOnRequestFailureCallbacks:h.call})}))},applyResponse(e,t={}){const{renderDecisions:r=!1,decisionContext:o={},responseHeaders:s={},responseBody:l={handle:[]},personalization:u}=t,p=a(),g=i({payload:p}),m=c();return n.onBeforeEvent({event:e,renderDecisions:r,decisionContext:o,decisionScopes:[Yt],personalization:u,onResponse:m.add,onRequestFailure:ge}).then((()=>(p.addEvent(e),d({request:g,responseHeaders:s,responseBody:l,runOnResponseCallbacks:m.call}))))}}})({config:u,logger:n,lifecycle:s,consent:S,createEvent:Ft,createDataCollectionRequestPayload:rn,createDataCollectionRequest:en,sendEdgeNetworkRequest:C,applyResponse:I});return(({componentCreators:e,lifecycle:t,componentRegistry:n,getImmediatelyAvailableTools:r})=>(e.forEach((e=>{const{namespace:t}=e,o=r(t);let a;try{a=e(o)}catch(e){throw ke({error:e,message:`[${t}] An error occurred during component creation.`})}n.register(t,a)})),t.onComponentsRegistered({lifecycle:t}).then((()=>n))))({componentCreators:d,lifecycle:s,componentRegistry:i,getImmediatelyAvailableTools(t){const n=r(t);return{config:u,componentRegistry:i,consent:S,eventManager:D,fireReferrerHideableImage:ir,logger:n,lifecycle:s,sendEdgeNetworkRequest:C,handleError:Xt({errorPrefix:`[${e}] [${t}]`,logger:n}),createNamespacedStorage:Zn,apexDomain:or,getBrowser:cr}}})},setDebugCommand:e=>{t(e.enabled,{fromConfig:!1})},handleError:u,validateCommandOptions:Jt});return p};var lr=({eventManager:e,lifecycle:t,handleError:n})=>{const r=(({eventManager:e,lifecycle:t,handleError:n})=>r=>{if(r.s_fe)return Promise.resolve();const o="composedPath"in r&&r.composedPath().length>0?r.composedPath()[0]:r.target,a=e.createEvent();return a.documentMayUnload(),t.onClick({event:a,clickedElement:o}).then((()=>a.isEmpty()?Promise.resolve():e.sendEvent(a))).then(ge).catch((e=>{n(e,"click collection")}))})({eventManager:e,lifecycle:t,handleError:n});document.addEventListener("click",r,!0)};const ur="\\.(exe|zip|wav|mp3|mov|mpg|avi|wmv|pdf|doc|docx|xls|xlsx|ppt|pptx)$",pr=bt().regexp().default(ur),gr=wt({clickCollectionEnabled:mt().default(!0),clickCollection:wt({internalLinkEnabled:mt().default(!0),externalLinkEnabled:mt().default(!0),downloadLinkEnabled:mt().default(!0),sessionStorageEnabled:mt().default(!1),eventGroupingEnabled:mt().default(!1),filterClickProperties:ft()}).default({internalLinkEnabled:!0,externalLinkEnabled:!0,downloadLinkEnabled:!0,sessionStorageEnabled:!1,eventGroupingEnabled:!1}),downloadLinkQualifier:pr,onBeforeLinkClickSend:ft().deprecated('The field "onBeforeLinkClickSend" has been deprecated. Use "clickCollection.filterClickDetails" instead.')});var mr=(e=document)=>null!==e.getElementById("cppXYctnr"),fr=e=>{let t=e;/^https?:\/\//i.test(t)||(t=`${window.location.protocol}//${e}`);return new URL(t).hostname};var hr=({config:e,logger:t,getClickedElementProperties:n,clickActivityStorage:r})=>{const{clickCollectionEnabled:o,clickCollection:a}=e;return o?({event:o,clickedElement:i})=>{const s=n({clickActivityStorage:r,clickedElement:i,config:e,logger:t}),c=s.linkType;var d,l;mr()||(s.isValidLink()&&((e,t)=>t&&("download"===t&&!e.downloadLinkEnabled||"exit"===t&&!e.externalLinkEnabled||"other"===t&&!e.internalLinkEnabled))(a,c)?t.info(`Cancelling link click event due to clickCollection.${c}LinkEnabled = false.`):s.isInternalLink()&&a.eventGroupingEnabled&&(!e.onBeforeLinkClickSend||a.filterClickDetails)&&(d=window.location.hostname,l=s.linkUrl,fr(d)===fr(l))?r.save(s.properties):s.isValidLink()?(o.mergeXdm(s.xdm),o.mergeData(s.data),r.save({pageName:s.pageName,pageIDType:s.pageIDType})):s.isValidActivityMapData()&&r.save(s.properties))}:()=>{}};var yr=({properties:e,logger:t}={})=>{let n=e||{};return{get pageName(){return n.pageName},set pageName(e){n.pageName=e},get linkName(){return n.linkName},set linkName(e){n.linkName=e},get linkRegion(){return n.linkRegion},set linkRegion(e){n.linkRegion=e},get linkType(){return n.linkType},set linkType(e){n.linkType=e},get linkUrl(){return n.linkUrl},set linkUrl(e){n.linkUrl=e},get pageIDType(){return n.pageIDType},set pageIDType(e){n.pageIDType=e},get clickedElement(){return n.clickedElement},set clickedElement(e){n.clickedElement=e},get properties(){return{pageName:n.pageName,linkName:n.linkName,linkRegion:n.linkRegion,linkType:n.linkType,linkUrl:n.linkUrl,pageIDType:n.pageIDType}},isValidLink:()=>!!(n.linkUrl&&n.linkType&&n.linkName&&n.linkRegion),isInternalLink(){return this.isValidLink()&&"other"===n.linkType},isValidActivityMapData:()=>!!n.pageName&&!!n.linkName&&!!n.linkRegion&&void 0!==n.pageIDType,get xdm(){return n.filteredXdm?n.filteredXdm:(e=>({eventType:"web.webinteraction.linkClicks",web:{webInteraction:{name:e.linkName,region:e.linkRegion,type:e.linkType,URL:e.linkUrl,linkClicks:{value:1}}}}))(this)},get data(){return n.filteredData?n.filteredData:(e=>({__adobe:{analytics:{contextData:{a:{activitymap:{page:e.pageName,link:e.linkName,region:e.linkRegion,pageIDType:e.pageIDType}}}}}}))(this)},applyPropertyFilter(e){e&&!1===e(n)&&(t&&t.info(`Clicked element properties were rejected by filter function: ${JSON.stringify(this.properties,null,2)}`),n={})},applyOptionsFilter(e){const r=this.options;if(r&&r.clickedElement&&(r.xdm||r.data)){if(e&&!1===e(r))return t&&t.info(`Clicked element properties were rejected by filter function: ${JSON.stringify(this.properties,null,2)}`),void(this.options=void 0);this.options=r,n.filteredXdm=r.xdm,n.filteredData=r.data}},get options(){const e={};if(this.isValidLink()&&(e.xdm=this.xdm),this.isValidActivityMapData()&&(e.data=this.data),this.clickedElement&&(e.clickedElement=this.clickedElement),e.xdm||e.data)return e},set options(e){n={},e&&((e,t)=>{const{xdm:n,data:r,clickedElement:o}=e;if(t.clickedElement=o,n&&n.web&&n.web.webInteraction){const{name:e,region:r,type:o,URL:a}=n.web.webInteraction;t.linkName=e,t.linkRegion=r,t.linkType=o,t.linkUrl=a}if(r&&r.__adobe&&r.__adobe.analytics){const{contextData:e}=r.__adobe.analytics;if(e&&e.a&&e.a.activitymap){const{page:n,link:r,region:o,pageIDType:a}=e.a.activitymap;t.pageName=n||t.pageName,t.linkName=r||t.linkName,t.linkRegion=o||t.linkRegion,void 0!==a&&(t.pageIDType=a)}}})(e,n)}}};const vr="clickData";var wr=e=>e&&e.replace(/\s+/g," ").trim();const br=/^(SCRIPT|STYLE|LINK|CANVAS|NOSCRIPT|#COMMENT)$/i;const Er=e=>{let t=[],n=!1;if((e=>!(e&&e.nodeName&&e.nodeName.match(br)))(e)){if(t.push(e),e.childNodes){Array.prototype.slice.call(e.childNodes).forEach((e=>{const r=Er(e);t=t.concat(r.supportedNodes),n=n||r.includesUnsupportedNodes}))}}else n=!0;return{supportedNodes:t,includesUnsupportedNodes:n}},Cr=(e,t,n)=>{let r;return n&&n!==e.nodeName.toUpperCase()||(r=e.getAttribute(t)),r};const Ir=/^(HEADER|MAIN|FOOTER|NAV)$/i,kr=e=>{let t;return"region"===e.role&&pe(e["aria-label"])&&(t=e["aria-label"]),t},Sr=e=>{let t;return e&&e.nodeName&&e.nodeName.match(Ir)&&(t=e.nodeName),t};var Dr=e=>!(!e.href||"A"!==e.tagName&&"AREA"!==e.tagName||e.onclick&&e.protocol&&!(e.protocol.toLowerCase().indexOf("javascript")<0)),Pr=e=>!!e&&!!e.onclick,Tr=e=>{if("INPUT"===e.tagName){const t=e.getAttribute("type");if("submit"===t)return!0;if("image"===t&&e.src)return!0}return!1},Rr=e=>"BUTTON"===e.tagName&&"submit"===e.type,Or=e=>{const t=e.indexOf("?"),n=e.indexOf("#");return t>=0&&(t<n||n<0)?e.substring(0,t):n>=0?e.substring(0,n):e};const Nr=(({window:e,getLinkName:t,getLinkRegion:n,getAbsoluteUrlFromAnchorElement:r,findClickableElement:o,determineLinkType:a})=>({clickedElement:i,config:s,logger:c,clickActivityStorage:d})=>{const{onBeforeLinkClickSend:l,clickCollection:u}=s,{filterClickDetails:p}=u,g=yr({logger:c});if(i){const c=o(i);if(c){g.clickedElement=i,g.linkUrl=r(e,c),g.linkType=a(e,s,g.linkUrl,c),g.linkRegion=n(c),g.linkName=t(c),g.pageIDType=0,g.pageName=e.location.href;const o=d.load();o&&o.pageName&&(g.pageName=o.pageName,g.pageIDType=1),p?g.applyPropertyFilter(p):l&&g.applyOptionsFilter(l)}}return g})({window:window,getLinkName:e=>{let t=wr(e.innerText||e.textContent);const n=Er(e);if(!t||n.includesUnsupportedNodes){const e=(e=>{const t={texts:[]};return e.supportedNodes.forEach((e=>{e.getAttribute&&(t.alt||(t.alt=wr(e.getAttribute("alt"))),t.title||(t.title=wr(e.getAttribute("title"))),t.inputValue||(t.inputValue=wr(Cr(e,"value","INPUT"))),t.imgSrc||(t.imgSrc=wr(Cr(e,"src","IMG")))),e.nodeValue&&t.texts.push(e.nodeValue)})),t})(n);t=wr(e.texts.join("")),t||(t=e.alt||e.title||e.inputValue||e.imgSrc)}return t||""},getLinkRegion:e=>{let t,n=e.parentNode;for(;n;){if(t=wr(n.id||kr(n)||Sr(n)),t)return t;n=n.parentNode}return"BODY"},getAbsoluteUrlFromAnchorElement:(e,t)=>{const n=e.location.href;let r=t.href||"";"string"!=typeof r&&(r="");try{return new URL(r,n).href}catch{return n}},findClickableElement:e=>{let t=e;for(;t;){if(Dr(t)||Pr(t)||Tr(t)||Rr(t))return t;t=t.parentNode}return null},determineLinkType:(e,t,n,r)=>{let o="other";return pe(n)&&(((e,t,n)=>{let r=!1;if(t)if(n&&n.download)r=!0;else if(e){const n=new RegExp(e),o=Or(t).toLowerCase();r=n.test(o)}return r})(t.downloadLinkQualifier,n,r)?o="download":((e,t)=>{let n=!1;if(t&&e.location.hostname){const r=e.location.hostname.toLowerCase();n=Or(t).toLowerCase().indexOf(r)<0}return n})(e,n)&&(o="exit")),o}});let Mr;const Ar=e=>{if(!Mr){const t=se(window)(e.orgId||""),n=(()=>{const e={};return{getItem:t=>e[t],setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}})(),r=e.clickCollection.sessionStorageEnabled?t.session:n;Mr=(({storage:e})=>({save:t=>{const n=JSON.stringify(t);e.setItem(vr,n)},load:()=>{let t=null;const n=e.getItem(vr);return n&&(t=JSON.parse(n)),t},remove:()=>{e.removeItem(vr)}}))({storage:r})}},xr=({config:e,eventManager:t,handleError:n,logger:r})=>{((e,t)=>{const{clickCollectionEnabled:n,onBeforeLinkClickSend:r,downloadLinkQualifier:o}=e;!1===n&&(r&&t.warn("The 'onBeforeLinkClickSend' configuration was provided but will be ignored because clickCollectionEnabled is false."),o&&o!==ur&&t.warn("The 'downloadLinkQualifier' configuration was provided but will be ignored because clickCollectionEnabled is false."))})(e,r);const o=e.clickCollection;Mr||Ar(e);const a=hr({config:e,logger:r,clickActivityStorage:Mr,getClickedElementProperties:Nr}),i=(({clickActivityStorage:e})=>t=>{if(mr())return;const n=e.load(),r=yr({properties:n});if(r.isValidLink()||r.isValidActivityMapData()){if(r.isValidLink()){const e=r.xdm;delete e.eventType,t.mergeXdm(e)}r.isValidActivityMapData()&&t.mergeData(r.data),e.save({pageName:r.pageName,pageIDType:r.pageIDType})}})({clickActivityStorage:Mr}),s=(({clickActivityStorage:e})=>t=>{e.save({pageName:t.getContent().xdm.web.webPageDetails.name,pageIDType:1})})({clickActivityStorage:Mr});return{lifecycle:{onComponentsRegistered(e){const{lifecycle:r}=e;lr({eventManager:t,lifecycle:r,handleError:n})},onClick({event:e,clickedElement:t}){a({event:e,clickedElement:t})},onBeforeEvent({event:e}){(e=>{const t=e.getContent();return void 0!==t.xdm&&void 0!==t.xdm.web&&void 0!==t.xdm.web.webPageDetails&&void 0!==t.xdm.web.webPageDetails.name})(e)&&(o.eventGroupingEnabled&&i(e),s(e,r,Mr))}}}};xr.namespace="ActivityCollector",xr.configValidators=gr,xr.buildOnInstanceConfiguredExtraParams=({config:e,logger:t})=>(Mr||Ar(e),{getLinkDetails:n=>Nr({clickActivityStorage:Mr,clickedElement:n,config:e,logger:t}).properties});var $r=({fireReferrerHideableImage:e,logger:t,cookieJar:n,isPageSsl:r})=>{const o=r?{sameSite:"none",secure:!0}:{};return r=>((e=>{e.filter((e=>"cookie"===e.type)).forEach((e=>{const{name:t,value:r,domain:a,ttlDays:i}=e.spec;n.set(t,r||"",{domain:a||"",expires:i||10,...o})}))})(r),(n=>{const r=n.filter((e=>"url"===e.type));return Promise.all(r.map((n=>e(n.spec).then((()=>{t.info((e=>`URL destination succeeded: ${e.spec.url}`)(n))})).catch((()=>{}))))).then(ge)})(r))},qr=({processDestinations:e})=>({response:t})=>(({response:t})=>{const n=t.getPayloadsByType("activation:push");return e(n)})({response:t}).then((()=>(({response:e})=>({destinations:e.getPayloadsByType("activation:pull")}))({response:t})));const Lr=({logger:e,fireReferrerHideableImage:t})=>{const n=o.withConverter({write:e=>encodeURIComponent(e)}),r=f({logger:e,cookieJar:n}),a=$r({fireReferrerHideableImage:t,logger:e,cookieJar:r,isPageSsl:"https:"===window.location.protocol});return{lifecycle:{onResponse:qr({processDestinations:a})},commands:{}}};Lr.namespace="Audiences";var Ur=e=>V(JSON.stringify(Ee(e)));const jr=({standard:e,version:t})=>`${e}.${t}`;var Br=()=>{const e={},t=tn({content:e,addIdentity:(t,n)=>{e.identityMap=e.identityMap||{},e.identityMap[t]=e.identityMap[t]||[],e.identityMap[t].push(n)},hasIdentity:t=>void 0!==(e.identityMap&&e.identityMap[t])});return t.setConsent=t=>{e.consent=t},t},Fr=({payload:e,datastreamIdOverride:t})=>Zt({payload:e,datastreamIdOverride:t,getAction:()=>"privacy/set-consent",getUseSendBeacon:()=>!1}),_r=e=>e.split(";").reduce(((e,t)=>{const[n,r]=t.split("=");return e[n]=r,e}),{}),Vr=wt({consent:gt(pt()).required().nonEmpty(),identityMap:Ct,edgeConfigOverrides:It}).noUnknownFields().required(),Hr=wt({defaultConsent:Et(Ot,Nt,Mt).default(Ot)});const zr=({config:e,consent:n,sendEdgeNetworkRequest:r,createNamespacedStorage:a})=>{const{orgId:i,defaultConsent:s}=e,c=(({parseConsentCookie:e,orgId:t,cookieJar:n})=>{const r=Q(t,"consent");return{read(){const t=n.get(r);return t?e(t):{}},clear(){n.remove(r)}}})({parseConsentCookie:_r,orgId:i,cookieJar:o}),d=(()=>{let e=0,t=Promise.resolve();return{addTask(n){e+=1;const r=()=>n().finally((()=>{e-=1}));return t=t.then(r,r),t},get length(){return e}}})(),l=(({createConsentRequestPayload:e,createConsentRequest:n,sendEdgeNetworkRequest:r,edgeConfigOverrides:o})=>({consentOptions:a,identityMap:i,edgeConfigOverrides:s})=>{const c=on({payload:e(),globalConfigOverrides:o,localConfigOverrides:s});c.payload.setConsent(a),t(i)&&Object.keys(i).forEach((e=>{i[e].forEach((t=>{c.payload.addIdentity(e,t)}))}));const d=n(c);return r({request:d}).then((()=>{}))})({createConsentRequestPayload:Br,createConsentRequest:Fr,sendEdgeNetworkRequest:r,edgeConfigOverrides:e.edgeConfigOverrides}),u=(({storage:e})=>({clear(){e.clear()},lookup(t){const n={},r=e=>{const t=jr(e),{standard:r,version:o,...a}=e;return n[t]||(n[t]=Ur(a).toString()),n[t]};return{isNew:()=>t.some((t=>{const n=jr(t),o=e.getItem(n);return null===o||o!==r(t)})),save(){t.forEach((t=>{const n=jr(t);e.setItem(n,r(t))}))}}}}))({storage:a(`${G(i)}.consentHashes.`).persistent}),p=ae({orgId:i});return(({storedConsent:e,taskQueue:t,defaultConsent:n,consent:r,sendSetConsentRequest:o,validateSetConsentOptions:a,consentHashStore:i,doesIdentityCookieExist:s})=>{const c={[At]:n};let d=e.read();const l=s(),u=void 0!==d[At];l&&u||i.clear(),l||(e.clear(),d={}),r.initializeConsent(c,d);const p=()=>{if(0===t.length){const t=e.read();void 0!==t[At]&&r.setConsent(t)}};return{commands:{setConsent:{optionsValidator:a,run:({consent:e,identityMap:n,edgeConfigOverrides:a})=>{r.suspend();const s=i.lookup(e);return t.addTask((()=>s.isNew()?o({consentOptions:e,identityMap:n,edgeConfigOverrides:a}):Promise.resolve())).then((()=>s.save())).finally(p)}}},lifecycle:{onResponse:p,onRequestFailure:p}}})({storedConsent:c,taskQueue:d,defaultConsent:s,consent:n,sendSetConsentRequest:l,validateSetConsentOptions:Vr,consentHashStore:u,doesIdentityCookieExist:p})};zr.namespace="Consent",zr.configValidators=Hr;const Jr=()=>(({createEventMergeId:e})=>({commands:{createEventMergeId:{run:e}}}))({createEventMergeId:m});Jr.namespace="EventMerge";var Gr={PAUSE:"media.pauseStart",PLAY:"media.play",BUFFER_START:"media.bufferStart",AD_START:"media.adStart",Ad_BREAK_START:"media.adBreakStart",SESSION_END:"media.sessionEnd",SESSION_START:"media.sessionStart",SESSION_COMPLETE:"media.sessionComplete",PING:"media.ping",AD_BREAK_COMPLETE:"media.adBreakComplete",AD_COMPLETE:"media.adComplete",AD_SKIP:"media.adSkip",BITRATE_CHANGE:"media.bitrateChange",CHAPTER_COMPLETE:"media.chapterComplete",CHAPTER_SKIP:"media.chapterSkip",CHAPTER_START:"media.chapterStart",ERROR:"media.error",STATES_UPDATE:"media.statesUpdate"},Qr=({config:e,eventManager:t,consent:n,sendEdgeNetworkRequest:r,setTimestamp:o})=>({createMediaEvent({options:n}){const r=t.createEvent(),{xdm:a}=n;if(o(a),r.setUserXdm(a),a.eventType===Gr.AD_START){const{advertisingDetails:t}=n.xdm.mediaCollection;r.mergeXdm({mediaCollection:{advertisingDetails:{playerName:t.playerName||e.streamingMedia.playerName}}})}return r},createMediaSession(n){const{playerName:r,channel:o,appVersion:a}=e.streamingMedia,i=t.createEvent(),{sessionDetails:s}=n.xdm.mediaCollection;return i.setUserXdm(n.xdm),i.mergeXdm({eventType:Gr.SESSION_START,mediaCollection:{sessionDetails:{playerName:s.playerName||r,channel:s.channel||o,appVersion:s.appVersion||a}}}),i},augmentMediaEvent({event:e,playerId:t,getPlayerDetails:n,sessionID:r}){if(!t||!n)return e;const{playhead:o,qoeDataDetails:a}=n({playerId:t});return e.mergeXdm({mediaCollection:{playhead:Se(o),qoeDataDetails:a,sessionID:r}}),e},trackMediaSession({event:e,mediaOptions:n,edgeConfigOverrides:r}){const o={mediaOptions:n,edgeConfigOverrides:r};return t.sendEvent(e,o)},trackMediaEvent({event:e,action:t}){const o=rn(),a=(({mediaRequestPayload:e,action:t})=>Zt({payload:e,edgeSubPath:"/va",getAction:()=>t,getUseSendBeacon:()=>!1}))({mediaRequestPayload:o,action:t});return o.addEvent(e),e.finalize(),n.awaitConsent().then((()=>r({request:a}).then((()=>({})))))}}),Xr="main",Wr="completed",Yr=()=>{let e;return{getSession:t=>e[t]||{},storeSession:({playerId:t,sessionDetails:n})=>{void 0===e&&(e={}),e[t]=n},stopPing:({playerId:t})=>{const n=e[t];n&&(clearTimeout(n.pingId),n.pingId=null,n.playbackState=Wr)},savePing:({playerId:t,pingId:n,playbackState:r})=>{e[t]&&(e[t].pingId&&clearTimeout(e[t].pingId),e[t].pingId=n,e[t].playbackState=r)}}};var Kr=({mediaEventManager:e,mediaSessionCacheManager:t,config:n})=>{const r=o=>{const a=e.createMediaEvent({options:o}),{playerId:i,xdm:s}=o,{eventType:c}=s,d=c.split(".")[1],{getPlayerDetails:l,sessionPromise:u,playbackState:p}=t.getSession(i);return u.then((o=>o.sessionId?(e.augmentMediaEvent({event:a,eventType:c,playerId:i,getPlayerDetails:l,sessionID:o.sessionId}),e.trackMediaEvent({event:a,action:d}).then((()=>{if(i)if(c===Gr.SESSION_COMPLETE||c===Gr.SESSION_END)t.stopPing({playerId:i});else{const e=((e,t)=>e===Gr.AD_START||e===Gr.Ad_BREAK_START||e===Gr.AD_SKIP||e===Gr.AD_COMPLETE?"ad":e===Gr.AD_BREAK_COMPLETE||e===Gr.CHAPTER_COMPLETE||e===Gr.CHAPTER_START||e===Gr.CHAPTER_SKIP||e===Gr.SESSION_START?"main":e===Gr.SESSION_END||e===Gr.SESSION_COMPLETE?"completed":t)(c,p);if("completed"===e)return;const o="ad"===e?n.streamingMedia.adPingInterval:n.streamingMedia.mainPingInterval,a=setTimeout((()=>{r({playerId:i,xdm:{eventType:Gr.PING}})}),1e3*o);t.savePing({playerId:i,pingId:a,playbackState:e})}}))):Promise.reject(new Error(`Failed to trigger media event: ${c}. Session ID is not available for playerId: ${i}.`))))};return e=>r(e)},Zr=({config:e,mediaEventManager:t,mediaSessionCacheManager:n,legacy:r=!1})=>o=>{if(!e.streamingMedia)return Promise.reject(new Error("Streaming media is not configured."));const{playerId:a,getPlayerDetails:i,edgeConfigOverrides:s}=o,c=t.createMediaSession(o);t.augmentMediaEvent({event:c,playerId:a,getPlayerDetails:i});const d=t.trackMediaSession({event:c,mediaOptions:{playerId:a,getPlayerDetails:i,legacy:r},edgeConfigOverrides:s});return n.storeSession({playerId:a,sessionDetails:{sessionPromise:d,getPlayerDetails:i,playbackState:Xr}}),d},eo=e=>!ue(e)||!e.trim(),to=({mediaSessionCacheManager:e,config:t,trackMediaEvent:n})=>({response:r,playerId:o,getPlayerDetails:a})=>{const i=r.getPayloadsByType("media-analytics:new-session");if(S(i)){const{sessionId:r}=i[0];if(eo(r))return{};if(!o||!a)return{sessionId:r};const s=setTimeout((()=>{n({playerId:o,xdm:{eventType:Gr.PING}})}),1e3*t.streamingMedia.mainPingInterval);return e.savePing({playerId:o,pingId:s,playbackState:Xr}),{sessionId:r}}return{}};const no={Video:"video",Audio:"audio"},ro={VOD:"vod",Live:"live",Linear:"linear",Podcast:"podcast",Audiobook:"audiobook",AOD:"aod"},oo={FullScreen:"fullScreen",ClosedCaption:"closedCaptioning",Mute:"mute",PictureInPicture:"pictureInPicture",InFocus:"inFocus"},ao={AdBreakStart:"adBreakStart",AdBreakComplete:"adBreakComplete",AdStart:"adStart",AdComplete:"adComplete",AdSkip:"adSkip",ChapterStart:"chapterStart",ChapterComplete:"chapterComplete",ChapterSkip:"chapterSkip",SeekStart:"seekStart",SeekComplete:"seekComplete",BufferStart:"bufferStart",BufferComplete:"bufferComplete",BitrateChange:"bitrateChange",StateStart:"stateStart",StateEnd:"stateEnd"},io="sessionStart",so="sessionEnd",co="sessionComplete",lo="play",uo="pauseStart",po="error",go="statesUpdate",mo={MediaResumed:"media.resumed",GranularAdTracking:"media.granularadtracking"},fo={Show:"a.media.show",Season:"a.media.season",Episode:"a.media.episode",AssetId:"a.media.asset",Genre:"a.media.genre",FirstAirDate:"a.media.airDate",FirstDigitalDate:"a.media.digitalDate",Rating:"a.media.rating",Originator:"a.media.originator",Network:"a.media.network",ShowType:"a.media.type",AdLoad:"a.media.adLoad",MVPD:"a.media.pass.mvpd",Authorized:"a.media.pass.auth",DayPart:"a.media.dayPart",Feed:"a.media.feed",StreamFormat:"a.media.format"},ho={Artist:"a.media.artist",Album:"a.media.album",Label:"a.media.label",Author:"a.media.author",Station:"a.media.station",Publisher:"a.media.publisher"},yo={Advertiser:"a.media.ad.advertiser",CampaignId:"a.media.ad.campaign",CreativeId:"a.media.ad.creative",PlacementId:"a.media.ad.placement",SiteId:"a.media.ad.site",CreativeUrl:"a.media.ad.creativeURL"};var vo=({logger:e})=>({createMediaObject:(t,n,r,o,a)=>{const i={friendlyName:t,name:n,length:r,streamType:a,contentType:o},s=wt({friendlyName:bt().nonEmpty(),name:bt().nonEmpty(),length:yt().required(),streamType:bt().nonEmpty(),contentType:bt().nonEmpty()});try{const e=s(i);return{sessionDetails:{name:e.name,friendlyName:e.friendlyName,length:Math.round(e.length),streamType:e.streamType,contentType:e.contentType}}}catch(t){return e.warn("An error occurred while creating the Media Object.",t),{}}},createAdBreakObject:(t,n,r)=>{const o={friendlyName:t,offset:n,index:r},a=wt({friendlyName:bt().nonEmpty(),offset:yt(),index:yt()});try{const e=a(o);return{advertisingPodDetails:{friendlyName:e.friendlyName,offset:e.offset,index:e.index}}}catch(t){return e.warn("An error occurred while creating the Ad Break Object.",t),{}}},createAdObject:(t,n,r,o)=>{const a={friendlyName:t,name:n,podPosition:r,length:o},i=wt({friendlyName:bt().nonEmpty(),name:bt().nonEmpty(),podPosition:yt(),length:yt()});try{const e=i(a);return{advertisingDetails:{friendlyName:e.friendlyName,name:e.name,podPosition:e.podPosition,length:e.length}}}catch(t){return e.warn("An error occurred while creating the Advertising Object.",t),{}}},createChapterObject:(t,n,r,o)=>{const a={friendlyName:t,offset:n,length:r,index:o},i=wt({friendlyName:bt().nonEmpty(),offset:yt(),length:yt(),index:yt()});try{const e=i(a);return{chapterDetails:{friendlyName:e.friendlyName,offset:e.offset,index:e.index,length:e.length}}}catch(t){return e.warn("An error occurred while creating the Chapter Object.",t),{}}},createStateObject:t=>{const n=bt().matches(/^[a-zA-Z0-9_]{1,64}$/,"This is not a valid state name.");try{return{name:n(t)}}catch(t){return e.warn("An error occurred while creating the State Object.",t),{}}},createQoEObject:(t,n,r,o)=>{const a={bitrate:t,droppedFrames:n,fps:r,startupTime:o},i=wt({bitrate:yt(),droppedFrames:yt(),fps:yt(),startupTime:yt()});try{const e=i(a);return{bitrate:e.bitrate,droppedFrames:e.droppedFrames,framesPerSecond:e.fps,timeToStart:e.startupTime}}catch(t){return e.warn("An error occurred while creating the QOE Object.",t),{}}}});const wo={"a.media.show":"show","a.media.season":"season","a.media.episode":"episode","a.media.asset":"assetID","a.media.genre":"genre","a.media.airDate":"firstAirDate","a.media.digitalDate":"firstDigitalDate","a.media.rating":"rating","a.media.originator":"originator","a.media.network":"network","a.media.type":"showType","a.media.adLoad":"adLoad","a.media.pass.mvpd":"mvpd","a.media.pass.auth":"authorized","a.media.dayPart":"dayPart","a.media.feed":"feed","a.media.format":"streamFormat","a.media.artist":"artist","a.media.album":"album","a.media.label":"label","a.media.author":"author","a.media.station":"station","a.media.publisher":"publisher","media.resumed":"hasResume"},bo={"a.media.ad.advertiser":"advertiser","a.media.ad.campaign":"campaignID","a.media.ad.creative":"creativeID","a.media.ad.placement":"placementID","a.media.ad.site":"siteID","a.media.ad.creativeURL":"creativeURL"};var Eo=({logger:t,trackMediaSession:n,trackMediaEvent:r,uuid:o})=>{let a=null;const i=({eventType:e,mediaDetails:t={},contextData:n=[]})=>{const r=(({eventType:e})=>e===ao.BufferComplete||e===ao.SeekComplete?lo:e===ao.StateStart||e===ao.StateEnd?go:e===ao.SeekStart?uo:e)({eventType:e});if(e===ao.StateStart){return{eventType:`media.${r}`,mediaCollection:{statesStart:[t]}}}if(e===ao.StateEnd){return{eventType:`media.${r}`,mediaCollection:{statesEnd:[t]}}}const o={eventType:`media.${r}`,mediaCollection:{...t}},a=[];return Object.keys(n).forEach((e=>{wo[e]?o.mediaCollection.sessionDetails[wo[e]]=n[e]:bo[e]?o.mediaCollection.advertisingDetails[bo[e]]=n[e]:a.push({name:e,value:n[e]})})),S(a)&&(o.mediaCollection.customMetadata=a),o};return{trackSessionStart:(r,s={})=>{if(e(r)||F(r))return t.warn("Invalid media object"),{};null===a&&(t.warn("The Media Session was completed. Restarting a new session."),a={qoe:null,lastPlayhead:0,playerId:o()});const c=i({eventType:io,mediaDetails:r,contextData:s});return n({playerId:a.playerId,getPlayerDetails:()=>({playhead:a.lastPlayhead,qoeDataDetails:a.qoe}),xdm:c})},trackPlay:()=>{if(null===a)return t.warn("The Media Session was completed."),{};const e=i({eventType:lo});return r({playerId:a.playerId,xdm:e})},trackPause:()=>{if(null===a)return t.warn("The Media Session was completed."),{};const e=i({eventType:uo});return r({playerId:a.playerId,xdm:e})},trackSessionEnd:()=>{if(null===a)return t.warn("The Media Session was completed."),{};const e=i({eventType:so});return r({playerId:a.playerId,xdm:e})},trackComplete:()=>{if(null===a)return t.warn("The Media Session was completed."),{};const e=i({eventType:co});return r({playerId:a.playerId,xdm:e})},trackError:e=>{if(t.warn(`trackError(${e})`),null===a)return t.warn("The Media Session was completed."),{};const n=i({eventType:po,mediaDetails:{errorDetails:{name:e,source:"player"}}});return r({playerId:a.playerId,xdm:n})},trackEvent:(e,n,o)=>{if(F(n))return t.warn("Invalid media object."),{};if(null===a)return t.warn("The Media Session was completed."),{};if(!Object.values(ao).includes(e))return t.warn("Invalid event type"),{};const s=i({eventType:e,mediaDetails:n,contextData:o});return r({playerId:a.playerId,xdm:s})},updatePlayhead:e=>{null!==a?de(e)&&(a.lastPlayhead=parseInt(e,10)):t.warn("The Media Session was completed.")},updateQoEObject:e=>{null!==a?e&&(a.qoe=e):t.warn("The Media Session was completed.")},destroy:()=>{t.warn("Destroy called, destroying the tracker."),a=null}}};const Co=({eventManager:e,sendEdgeNetworkRequest:t,config:n,logger:r,consent:o})=>{const a=Yr(),i=Qr({sendEdgeNetworkRequest:t,config:n,consent:o,eventManager:e,setTimestamp:yn((()=>new Date))}),s=Kr({mediaSessionCacheManager:a,mediaEventManager:i,config:n}),c=Zr({config:n,mediaEventManager:i,mediaSessionCacheManager:a,legacy:!0});return(({trackMediaEvent:e,trackMediaSession:t,mediaResponseHandler:n,logger:r,createMediaHelper:o,createGetInstance:a,config:i})=>({lifecycle:{onBeforeEvent({mediaOptions:e,onResponse:t=ge}){if(!e)return;const{legacy:r,playerId:o,getPlayerDetails:a}=e;r&&t((({response:e})=>n({playerId:o,getPlayerDetails:a,response:e})))}},commands:{getMediaAnalyticsTracker:{run:()=>{if(!i.streamingMedia)return Promise.reject(new Error("Streaming media is not configured."));r.info("Streaming media is configured in legacy mode.");const n=o({logger:r});return Promise.resolve({getInstance:()=>a({logger:r,trackMediaEvent:e,trackMediaSession:t,uuid:g}),Event:ao,MediaType:no,PlayerState:oo,StreamType:ro,MediaObjectKey:mo,VideoMetadataKeys:fo,AudioMetadataKeys:ho,AdMetadataKeys:yo,...n})}}}}))({mediaResponseHandler:to({mediaSessionCacheManager:a,config:n,trackMediaEvent:s}),trackMediaSession:c,trackMediaEvent:s,createMediaHelper:vo,createGetInstance:Eo,logger:r,config:n})};Co.namespace="Legacy Media Analytics";const Io="web",ko="webapp",So="://",Do=/^(\w+):\/\/([^/#]+)(\/[^#]*)?(#.*)?$/,Po=/^(?:.*@)?(?:[a-z\d\u00a1-\uffff.-]+|\[[a-f\d:]+])(?::\d+)?$/,To=/^\/(?:[/\w\u00a1-\uffff-.~]|%[a-fA-F\d]{2})*$/,Ro=/^#(?:[/\w\u00a1-\uffff-.~]|%[a-fA-F\d]{2})+$/,Oo=(e="/")=>{let t=e.length;for(;t>0&&-1!=="/".indexOf(e.charAt(t-1));)t-=1;return e.substring(0,t)||"/"},No=e=>`${e.surfaceType}${So}${e.authority}${e.path||""}${e.fragment||""}`,Mo=e=>{const t=e(),n=t.host.toLowerCase(),r=t.pathname;return Io+So+n+Oo(r)},Ao=(e,t,n)=>{const r=e=>(n.warn(e),null);if(!pe(e))return r(`Invalid surface: ${e}`);const o=((e,t)=>e.startsWith("#")?Mo(t)+e:e)(e,t),a=(e=>{const t=e.match(Do);return t?{surfaceType:(o=t[1],pe(o)?o.toLowerCase():""),authority:(r=t[2],pe(r)?r.toLowerCase():""),path:(n=t[3],pe(n)?Oo(n):"/"),fragment:t[4]}:null;var n,r,o})(o);return null===a?r(`Invalid surface: ${e}`):[Io,ko].includes(a.surfaceType)?a.authority&&Po.test(a.authority)?a.path&&!To.test(a.path)?r(`Invalid path ${a.path} in surface: ${e}`):a.fragment&&!Ro.test(a.fragment)?r(`Invalid fragment ${a.fragment} in surface: ${e}`):a:r(`Invalid authority ${a.authority} in surface: ${e}`):r(`Unsupported surface type ${a.surfaceType} in surface: ${e}`)},xo=e=>!!e&&0===e.indexOf(Io+So)&&-1===e.indexOf("#"),$o="https://ns.adobe.com/personalization/default-content-item",qo="https://ns.adobe.com/personalization/dom-action",Lo="https://ns.adobe.com/personalization/html-content-item",Uo="https://ns.adobe.com/personalization/json-content-item",jo="https://ns.adobe.com/personalization/ruleset-item",Bo="https://ns.adobe.com/personalization/redirect-item",Fo="https://ns.adobe.com/personalization/message/in-app",_o=e=>e.filter(((t,n)=>e.indexOf(t)===n));var Vo=({getPageLocation:t,renderDecisions:n,decisionScopes:r,personalization:o,event:a,isCacheInitialized:i,logger:s})=>{const c=a.getViewName();return{isRenderDecisions:()=>n,isSendDisplayEvent:()=>!!o.sendDisplayEvent,shouldIncludeRenderedPropositions:()=>!!o.includeRenderedPropositions,getViewName:()=>c,hasScopes:()=>r.length>0||S(o.decisionScopes),hasSurfaces:()=>S(o.surfaces),hasViewName:()=>pe(c),createQueryDetails(){const n=[...r];S(o.decisionScopes)&&n.push(...o.decisionScopes);const a=((t=[],n,r)=>t.map((e=>Ao(e,n,r))).filter((t=>!e(t))).map(No))(o.surfaces,t,s);this.shouldRequestDefaultPersonalization()&&((e=>{e.includes(Yt)||e.push(Yt)})(n),((e,t)=>{const n=Mo(t);e.includes(n)||e.push(n)})(a,t));const i=[$o,Lo,Uo,Bo,jo,Fo,"https://ns.adobe.com/personalization/message/content-card"];return n.includes(Yt)&&i.push(qo),{schemas:i,decisionScopes:_o(n),surfaces:_o(a)}},isCacheInitialized:()=>i,shouldFetchData(){return this.hasScopes()||this.hasSurfaces()||this.shouldRequestDefaultPersonalization()},shouldUseCachedData(){return this.hasViewName()&&!this.shouldFetchData()},shouldRequestDefaultPersonalization(){return o.defaultPersonalizationEnabled||!this.isCacheInitialized()&&!1!==o.defaultPersonalizationEnabled}}};const Ho="decisioning.propositionDisplay",zo="decisioning.propositionInteract",Jo="decisioning.propositionTrigger",Go="decisioning.propositionDismiss",Qo="decisioning.propositionSuppressDisplay",Xo={DISPLAY:"display",INTERACT:"interact",TRIGGER:"trigger",DISMISS:"dismiss",SUPPRESS:"suppressDisplay"},Wo={[Ho]:Xo.DISPLAY,[zo]:Xo.INTERACT,[Jo]:Xo.TRIGGER,[Go]:Xo.DISMISS,[Qo]:Xo.SUPPRESS},Yo={[Xo.DISPLAY]:Ho,[Xo.INTERACT]:zo,[Xo.TRIGGER]:Jo,[Xo.DISMISS]:Go,[Xo.SUPPRESS]:Qo},Ko=e=>Wo[e],Zo=e=>Yo[e],ea={propositions:[]};var ta=({getPageLocation:e,logger:t,fetchDataHandler:n,viewChangeHandler:r,onClickHandler:o,isAuthoringModeEnabled:a,mergeQuery:i,viewCache:s,showContainers:c,applyPropositions:d,setTargetMigration:l,mergeDecisionsMeta:u,renderedPropositions:p,onDecisionHandler:g,handleConsentFlicker:m})=>({lifecycle:{onComponentsRegistered(){m()},onDecision:g,onBeforeRequest:({request:e})=>(l(e),Promise.resolve()),onBeforeEvent({event:o,renderDecisions:d,decisionScopes:l=[],personalization:g={},onResponse:m=ge,onRequestFailure:f=ge}){if(m((()=>({propositions:[]}))),f((()=>c())),a())return t.warn("Rendering is disabled for authoring mode."),i(o,{enabled:!1}),Promise.resolve();const h=Vo({getPageLocation:e,renderDecisions:d,decisionScopes:l,personalization:g,event:o,isCacheInitialized:s.isInitialized(),logger:t}),y=[];if(h.shouldIncludeRenderedPropositions()&&y.push(p.clear()),h.shouldFetchData()){const e=s.createCacheUpdate(h.getViewName());f((()=>e.cancel())),n({cacheUpdate:e,personalizationDetails:h,event:o,onResponse:m})}else h.shouldUseCachedData()&&y.push(r({personalizationDetails:h,event:o,onResponse:m,onRequestFailure:f}));return Promise.all(y).then((e=>{const t=e.flatMap((e=>e));S(t)&&u(o,t,[Xo.DISPLAY])}))},onClick({event:e,clickedElement:t}){o({event:e,clickedElement:t})}},commands:{applyPropositions:{optionsValidator:e=>(({logger:e,options:t})=>{const n=wt({propositions:gt(wt({id:bt().required(),scope:bt().required(),scopeDetails:wt({decisionProvider:bt().required()}).required(),items:gt(wt({id:bt().required(),schema:bt().required(),data:wt(pt())})).nonEmpty().required()}).required()).nonEmpty().required(),metadata:wt(pt()),viewName:bt()}).required();try{return n(t)}catch(t){return e.warn("Invalid options for applyPropositions. No propositions will be applied.",t),ea}})({logger:t,options:e}),run:d}}}),na=(e="undefined")=>w("DIV",{},{innerHTML:e});const ra=/:eq\((\d+)\)/g,oa=e=>-1===e.indexOf(":eq("),aa=/(#|\.)(-?\w+)/g,ia=(e,t,n)=>`${t}${CSS.escape(n)}`,sa=e=>{const t=[],n=(e=>e.split(ra).filter(pe))((e=>e.replace(aa,ia))(e.trim())),{length:r}=n;let o=0;for(;o<r;){const e=n[o],r=n[o+1];r?t.push({sel:e,eq:Number(r)}):t.push({sel:e}),o+=2}return t},ca=e=>{const t=document;if(oa(e))return M(e,t);const n=sa(e),{length:r}=n;let o=[],a=t,i=0;for(;i<r;){const{sel:e,eq:t}=n[i],s=M(e,a),{length:c}=s;if(0===c)break;if(null!=t&&t>c-1)break;i<r-1&&(null==t?[a]=s:a=s[t]),i===r-1&&(o=null==t?s:[s[t]]),i+=1}return o};var da=(e,t=document)=>t.getElementById(e),la=(e,t,n)=>{e.setAttribute(t,n)},ua=(e,t)=>e.getAttribute(t),pa=(e,t,n,r)=>{let o;o=r?`${t}:${n} !${r};`:`${t}:${n};`,e.style.cssText+=`;${o}`},ga=e=>e.parentNode,ma=(e,t)=>{if(!e)return;const n=ga(e);n&&n.insertBefore(t,(e=>e.nextElementSibling)(e))},fa=(e,t)=>{if(!e)return;const n=ga(e);n&&n.insertBefore(t,e)},ha=e=>{const{childNodes:t}=e;return t?D(t):[]},ya=e=>e.firstElementChild;let va;var wa=(e=document)=>{if(void 0===va){const t=e.querySelector("[nonce]");va=t&&(t.nonce||t.getAttribute("nonce"))}return va};const ba="src",Ea=e=>w(b,{src:e}),Ca=e=>{M(b,e).forEach((e=>{const t=ua(e,ba);t&&Ea(t)}))},Ia=e=>((e,t)=>e.tagName===t)(e,E)&&!ua(e,ba);var ka=e=>{const t=M(E,e),{length:n}=t,r=wa();if(r)for(let e=0;e<n;e+=1){const n=t[e];Ia(n)&&(n.nonce=r)}};const Sa=e=>{const t=document.createElement("script");t.src=e,t.async=!0;const n=((e,t)=>new Promise(((n,r)=>{t.onload=()=>{n(t)},t.onerror=()=>{r(new Error(`Failed to load script: ${e}`))}})))(e,t);return document.head.appendChild(t),n},Da=(e,t)=>!!e&&e.tagName===t,Pa=e=>Da(e,C)&&!ua(e,ba),Ta=e=>Da(e,C)&&ua(e,ba),Ra=e=>{const t=M(C,e),n=[],{length:r}=t,o=wa(),a={...o&&{nonce:o}};for(let e=0;e<r;e+=1){const r=t[e];if(!Pa(r))continue;const{textContent:o}=r;o&&n.push(w(C,a,{textContent:o}))}return n},Oa=e=>{const t=M(C,e),n=[],{length:r}=t;for(let e=0;e<r;e+=1){const r=t[e];if(!Ta(r))continue;const o=ua(r,ba);o&&n.push(o)}return n},Na=(e,t)=>{t.forEach((t=>{e.appendChild(t),e.removeChild(t)}))},Ma=e=>Promise.all(e.map(Sa));var Aa=(e,t,n)=>{const r=na(t);ka(r);const o=ha(r),a=Ra(r),i=Oa(r);return Ca(r),o.forEach((t=>{v(e,t)})),n(e),Na(e,a),Ma(i)};var xa=(e,t,n)=>((e=>{ha(e).forEach(U)})(e),Aa(e,t,n)),$a=(e,t,n)=>{const r=na(t);ka(r);const o=ha(r),a=Ra(r),i=Oa(r),{length:s}=o;let c=s-1;for(Ca(r);c>=0;){const t=o[c];n(t);const r=ya(e);r?fa(r,t):v(e,t),c-=1}return Na(e,a),Ma(i)};const qa="alloy-prehiding",La={},Ua=e=>{if(La[e])return;const t=wa(),n={...t&&{nonce:t}},r=w(E,n,{textContent:`${e} { visibility: hidden }`});v(document.head,r),La[e]=r},ja=e=>{const t=La[e];t&&(U(t),delete La[e])};var Ba=(e,t,n)=>{n(e),e.textContent=t},Fa=(e,t,n)=>{const r=na(t);ka(r);const o=ha(r),a=Ra(r),i=Oa(r);return Ca(r),o.forEach((t=>{n(t),fa(e,t)})),Na(e,a),Ma(i)},_a=(e,t,n)=>Fa(e,t,n).then((()=>{U(e)})),Va=(e,t,n)=>{const r=na(t);ka(r);const o=ha(r),a=Ra(r),i=Oa(r);Ca(r);let s=e;return o.forEach((e=>{n(e),ma(s,e),s=e})),Na(e,a),Ma(i)},Ha=(e,t,n)=>{const{priority:r,...o}=t;Object.keys(o).forEach((t=>{pa(e,t,o[t],r)})),n(e)},za=(e,t,n)=>{Object.keys(t).forEach((n=>{la(e,n,t[n])})),n(e)},Ja=(e,t,n)=>{e.tagName===b&&(Ea(t),n(e),((e,t)=>{e.removeAttribute(t)})(e,ba),la(e,ba,t))},Ga=(e,{from:t,to:n},r)=>{const o=(e=>{const{children:t}=e;return t?D(t):[]})(e),a=o[t],i=o[n];a&&i&&(t<n?ma(i,a):fa(i,a),r(i),r(a))};const Qa=e=>async(t,n,r)=>{const{selector:o,prehidingSelector:a,content:i}=t;Ua(a);try{(({containers:e,content:t,decorateProposition:n,renderFunc:r,renderStatusHandler:o})=>{const a=e.filter(o.shouldRender).map((async e=>{await r(e,t,n),o.markAsRendered(e)}));Promise.all(a)})({containers:await L(o,ca),content:i,decorateProposition:n,renderFunc:e,renderStatusHandler:r})}finally{ja(a)}},Xa=e=>`${e}`.endsWith("px")?e:`${e}px`;var Wa=(e,t,n)=>{const{priority:r,...o}=t;Object.keys(o).forEach((t=>{let n=o[t];"left"!==t&&"top"!==t||(n=Xa(n)),pa(e,t,n,r)})),n(e)},Ya=(e,t,n)=>{n(e)},Ka=(e,t,n)=>{const{priority:r,...o}=t;Object.keys(o).forEach((t=>{let n=o[t];"width"!==t&&"height"!==t||(n=Xa(n)),pa(e,t,n,r)})),n(e)};const Za="setHtml",ei="customCode",ti="setText",ni="setAttribute",ri="setImageSource",oi="setStyle",ai="move",ii="resize",si="rearrange",ci="remove",di="insertAfter",li="insertBefore",ui="replaceHtml",pi="prependHtml",gi="appendHtml",mi="click",fi="collectInteractions";var hi=({eventManager:e,mergeDecisionsMeta:t})=>({decisionsMeta:n=[],propositionAction:r,documentMayUnload:o=!1,eventType:a=Ho,propositionEventTypes:i=[Ko(a)],viewName:s})=>{const c=e.createEvent(),d={eventType:a};return s&&(d.web={webPageDetails:{viewName:s}}),S(n)&&t(c,n,i,r),c.mergeXdm(d),o&&c.documentMayUnload(),e.sendEvent(c)};var yi=(e,t)=>{if(oa(e))return((e,t)=>t.matches?t.matches(e):t.msMatchesSelector(e))(e,t);const n=ca(e);let r=!1;for(let e=0;e<n.length;e+=1)if(n[e]===t){r=!0;break}return r};const vi="view",wi=e=>e.map((e=>{const{trackingLabel:t,scopeType:n,...r}=e;return r})),bi=(e,t,n)=>{const{documentElement:r}=document;let o=e,a=0;for(;o&&o!==r;){if(yi(t,o)){const e=n(t),r={metas:e},o=e.find((e=>e.trackingLabel));o&&(r.label=o.trackingLabel,r.weight=a);const i=e.find((e=>e.scopeType===vi));return i&&(r.viewName=i.scope,r.weight=a),r}o=o.parentNode,a+=1}return{metas:null}};var Ei=(e,t,n)=>{const r=[];let o,a="",i=Number.MAX_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER;for(let c=0;c<t.length;c+=1){const{metas:d,label:l,weight:u,viewName:p}=bi(e,t[c],n);d&&(l&&u<=i&&(a=l,i=u),p&&u<=s&&(o=p,s=u),r.push(...wi(d)))}return{decisionsMeta:(c=r,c.filter(((e,t)=>{const n=JSON.stringify(e);return t===c.findIndex((e=>JSON.stringify(e)===n))}))),propositionActionLabel:a,propositionActionToken:void 0,viewName:o};var c},Ci=(e=document)=>-1!==e.location.href.indexOf("adobe_authoring_enabled");const Ii=(e,t,n,r)=>{if(0===t.length)return;const o={};n.forEach((e=>{o[e]=1}));const a={_experience:{decisioning:{propositions:t,propositionEventType:o}}};r&&(a._experience.decisioning.propositionAction=r),e.mergeXdm(a)},ki=(e,t)=>{e.mergeQuery({personalization:{...t}})};var Si=()=>{const e={};return{storeClickMeta:({selector:t,meta:{id:n,scope:r,scopeDetails:o,trackingLabel:a,scopeType:i}})=>{e[t]||(e[t]={}),e[t][n]={scope:r,scopeDetails:o,trackingLabel:a,scopeType:i}},getClickSelectors:()=>Object.keys(e),getClickMetas:t=>e[t]?(e=>Object.keys(e).map((t=>({id:t,...e[t]}))))(e[t]):{}}};const Di=(e,t)=>e===Uo&&t===fi,Pi={[qo]:()=>!0,[Lo]:()=>!0,[Uo]:Di,[Fo]:()=>!0,[$o]:()=>!0};var Ti=({processPropositions:e,createProposition:t,renderedPropositions:n,viewCache:r})=>{const o=({items:e,metadataForScope:t={}})=>{const{actionType:n,selector:r}=t;return e.filter((e=>((e,t)=>"function"==typeof Pi[e]&&Pi[e](e,t))(e.schema,n))).map((e=>{const{schema:o}=e;return o===Lo||Di(o,n)?F(t)?void 0:{...e,schema:Di(o,n)?qo:o,data:{...e.data,selector:r,type:n}}:{...e}})).filter((e=>e))},a=e=>!(e.scope===Yt&&e.renderAttempted);return({propositions:i=[],metadata:s={},viewName:c})=>{const d=h();n.concat(d.promise);const l=(({propositions:e,metadata:t})=>e.filter(a).map((e=>{if(S(e.items)){const{id:n,scope:r,scopeDetails:a}=e;return{id:n,scope:r,scopeDetails:a,items:o({items:e.items,metadataForScope:t[e.scope]})}}return e})).filter((e=>S(e.items))))({propositions:i,metadata:s}).map((e=>t(e)));return Promise.resolve().then((()=>c?r.getView(c):[])).then((t=>{const{render:n,returnedPropositions:r}=e([...l,...t]);return n().then(d.resolve),{propositions:r}}))}};var Ri=e=>{const{selector:t,type:n}=e;return n!==ei||"BODY > *:eq(0)"!==t?e:{...e,selector:"BODY"}};var Oi=e=>{const t={...e},{content:n,selector:r}=t;if(eo(n))return t;if(null==r)return t;const o=ca(r);return Da(o[0],"HEAD")?(t.type=gi,t.content=(e=>{const t=na(e);return M("SCRIPT,LINK,STYLE",t).map((e=>e.outerHTML)).join("")})(n),t):t},Ni=({preprocess:e,isPageWideSurface:t})=>(n,r=!0,o=!1)=>{const{id:a,scope:i,scopeDetails:s,items:c=[]}=n,{characteristics:{scopeType:d}={}}=s||{};return{getScope:()=>i,getScopeType:()=>i===Yt||t(i)?"page":d===vi?vi:"proposition",getItems(){return c.map((t=>((t,n)=>{const{id:r,schema:o,data:a,characteristics:{trackingLabel:i}={}}=t,s=a?a.type:void 0,c=e(a);return{getId:()=>r,getSchema:()=>o,getSchemaType:()=>s,getData:()=>c,getProposition:()=>n,getTrackingLabel:()=>i,getOriginalItem:()=>t,toString:()=>JSON.stringify(t),toJSON:()=>t}})(t,this)))},getNotification:()=>({id:a,scope:i,scopeDetails:s}),getId:()=>a,toJSON:()=>n,shouldSuppressDisplay:()=>o,addToReturnValues(e,t,o,a){r&&(e.push({...n,items:o.map((e=>e.getOriginalItem())),renderAttempted:a}),a||t.push({...n,items:o.map((e=>e.getOriginalItem()))}))}}},Mi=()=>({render:ge,setRenderAttempted:!0,includeInNotification:!0});const Ai="always",xi="never",$i="decoratedElementsOnly",qi=[Ai,xi,$i],Li="data-aep-interact-id",Ui="data-aep-click-label";let ji=0;const Bi=(e,t,n,r,o,a,i,s)=>{const{scopeDetails:c={}}=i,{decisionProvider:d}=c;return((e,t)=>!!e&&!!e[t]&&[Ai,$i].includes(e[t]))(e,d)||t===mi?e=>{if(!e.tagName)return;const t=(c=ua(e,Li))?parseInt(c,10):++ji;var c;s(n,r,a,i,t),la(e,Li,t),o&&!ua(e,Ui)&&la(e,Ui,o)}:ge};var Fi=(e,t)=>e!==vi?{shouldRender:()=>!0,markAsRendered:()=>{}}:{shouldRender:e=>{if(!e)return!0;return!(e.dataset.adobePropositionIds??"").split(",").includes(t)},markAsRendered:e=>{const n=(e.dataset.adobePropositionIds??"").split(",");n.includes(t)||n.push(t),e.dataset.adobePropositionIds=n.sort().join(",")}},_i=({modules:e,logger:t,storeInteractionMeta:n,storeClickMeta:r,autoCollectPropositionInteractions:o})=>a=>{const{type:i,selector:s}=a.getData()||{};if(!i)return t.warn("Invalid DOM action data: missing type.",a.getData()),{setRenderAttempted:!1,includeInNotification:!1};if(i===mi)return s?(r({selector:s,meta:{...a.getProposition().getNotification(),trackingLabel:a.getTrackingLabel(),scopeType:a.getProposition().getScopeType()}}),{setRenderAttempted:!0,includeInNotification:!1}):(t.warn("Invalid DOM action data: missing selector.",a.getData()),{setRenderAttempted:!1,includeInNotification:!1});if(!e[i])return t.warn("Invalid DOM action data: unknown type.",a.getData()),{setRenderAttempted:!1,includeInNotification:!1};const c=Fi(a.getProposition().getScopeType(),a.getId()),d=Bi(o,i,a.getProposition().getId(),a.getId(),a.getTrackingLabel(),a.getProposition().getScopeType(),a.getProposition().getNotification(),n);return{render:()=>e[i](a.getData(),d,c),setRenderAttempted:!0,includeInNotification:!0}},Vi=({modules:e,logger:t,storeInteractionMeta:n,autoCollectPropositionInteractions:r})=>o=>{const{type:a,selector:i}=o.getData()||{};if(!i||!a)return{setRenderAttempted:!1,includeInNotification:!1};if(!e[a])return t.warn("Invalid HTML content data",o.getData()),{setRenderAttempted:!1,includeInNotification:!1};const s=Bi(r,a,o.getProposition().getId(),o.getId(),o.getTrackingLabel(),o.getProposition().getScopeType(),o.getProposition().getNotification(),n),c=Fi(o.getProposition().getScopeType(),o.getId());return{render:()=>e[a](o.getData(),s,c),setRenderAttempted:!0,includeInNotification:!0}};const Hi="BODY";var zi=({logger:e,executeRedirect:t,collect:n})=>r=>{const{content:o}=r.getData()||{};if(!o)return e.warn("Invalid Redirect data",r.getData()),{};return{render:()=>(Ua(Hi),n({decisionsMeta:[r.getProposition().getNotification()],documentMayUnload:!0}).then((()=>(e.logOnContentRendering({status:"rendering-redirect",detail:{propositionDetails:r.getProposition().getNotification(),redirect:o},message:`Redirect action ${r.toString()} executed.`,logLevel:"info"}),t(o)))).catch((e=>{throw ja(Hi),e}))),setRenderAttempted:!0,onlyRenderThis:!0}},Ji=({schemaProcessors:e,logger:t})=>{const n=(e,n)=>()=>Promise.resolve().then(e).then((()=>(t.enabled&&t.info(`Action ${n.toString()} executed.`),n.toJSON()))).catch((e=>{const{message:r,stack:o}=e,a=`Failed to execute action ${n.toString()}. ${r} ${o}`;t.logOnContentRendering({status:"rendering-failed",detail:{propositionDetails:n.getProposition().getNotification(),item:n.toJSON()},error:e,message:a,logLevel:"warn"})})),r=t=>{const n=e[t.getSchema()];return n?n(t):{}},o=({renderers:e,returnedPropositions:t,returnedDecisions:o,items:a,proposition:i})=>{let s,c,d,l,u=[...e],p=[...t],g=[...o],m=[],f=[],h=[],y=!1,v=!1,w=0;for(;a.length>w;){if(l=a[w],({render:s,setRenderAttempted:c,includeInNotification:d,onlyRenderThis:v}=r(l)),v){p=[],g=[],c?(m=[l],f=[]):(m=[],f=[l]),u=[],h=[s],y=d;break}s&&h.push(n(s,l)),d&&(y=!0),c?m.push(l):f.push(l),w+=1}if(h.length>0){const e=y?i.getNotification():void 0;u.push((()=>(async(e,t)=>{const n=(await Promise.allSettled(e.map((e=>e())))).filter((e=>"fulfilled"===e.status)).map((e=>e.value));if(t&&S(n))return{...t,items:n}})(h,e)))}else y&&u.push((()=>Promise.resolve(i.getNotification())));return m.length>0&&i.addToReturnValues(p,g,m,!0),f.length>0&&i.addToReturnValues(p,g,f,!1),{renderers:u,returnedPropositions:p,returnedDecisions:g,onlyRenderThis:v}};return(e,n=[])=>{let r,a,i,s=[],c=[],d=[],l=0;for(;e.length>l&&(a=e[l],i=a.getItems(),({renderers:s,returnedPropositions:c,returnedDecisions:d,onlyRenderThis:r}=o({renderers:s,returnedPropositions:c,returnedDecisions:d,items:i,proposition:a})),!r);)l+=1;r&&e.forEach(((e,t)=>{t!==l&&e.addToReturnValues(c,d,e.getItems(),!1)})),n.forEach((e=>{e.addToReturnValues(c,d,e.getItems(),!1)}));return{returnedPropositions:c,returnedDecisions:d,render:()=>Promise.all(s.map((e=>e()))).then((e=>{const n=e.filter((e=>e)),r=n.map((e=>{const{id:t,scope:n,scopeDetails:r}=e;return{id:t,scope:n,scopeDetails:r}}));if(S(n)){const e=X(n,(e=>e.scope));t.logOnContentRendering({status:"rendering-succeeded",detail:{...e},message:`Scopes: ${JSON.stringify(e)} successfully executed.`,logLevel:"info"})}return r}))}}};var Gi=({processPropositions:e,createProposition:t,notificationHandler:n})=>({renderDecisions:r,propositions:o,event:a,personalization:i={}})=>{if(!r)return Promise.resolve();const{sendDisplayEvent:s=!0}=i,c=a?a.getViewName():void 0,d=(()=>{let e=0;return t=>{const{items:n=[]}=t;return!!n.some((e=>e.schema===Fo))&&(e+=1,e>1)}})(),l=o.map((e=>t(e,!0,d(e)))),{render:u,returnedPropositions:p}=e(l),g=n(r,s,c),m=l.reduce(((e,t)=>(e[t.getId()]=t,e)),{});return u().then((e=>{const t=e.filter((e=>!m[e.id].shouldSuppressDisplay())),n=e.filter((e=>m[e.id].shouldSuppressDisplay()));g(t,n)})),Promise.resolve({propositions:p})};const Qi="text/html",Xi="defaultContent",Wi=["content","contentType"],Yi=["mobileParameters","webParameters","html"];var Ki=({modules:e,logger:t})=>n=>{const r=n.getData(),o=n.getProposition(),a={...o.getNotification()},i=o.shouldSuppressDisplay();if(!r)return t.warn("Invalid in-app message data: undefined.",r),{};const{type:s=Xi}=r;return e[s]?((e,t)=>{for(let n=0;n<Wi.length;n+=1){const r=Wi[n];if(!Object.prototype.hasOwnProperty.call(e,r))return t.warn(`Invalid in-app message data: missing property '${r}'.`,e),!1}const{content:n,contentType:r}=e;if("application/json"===r)for(let r=0;r<Yi.length;r+=1){const o=Yi[r];if(!Object.prototype.hasOwnProperty.call(n,o))return t.warn(`Invalid in-app message data.content: missing property '${o}'.`,e),!1}return!0})(r,t)?a?{render:()=>i?null:e[s]({...r,meta:a}),setRenderAttempted:!0,includeInNotification:!0}:(t.warn("Invalid in-app message meta: undefined.",a),{}):{}:(t.warn("Invalid in-app message data: unknown type.",r),{})};const Zi=e=>{const t=M(`#${e}`,document);t&&t.length>0&&U(t[0])};var es=e=>(t,n=!1)=>(n?e.location.href=t:e.location.replace(t),new Promise((()=>{})));const ts="alloy-messaging-container",ns="alloy-overlay-container",rs="alloy-content-iframe",os=()=>[ts,ns].forEach(Zi),as=(e,t=es(window))=>n=>{n.preventDefault(),n.stopImmediatePropagation();const{target:r}=n,o="a"===r.tagName.toLowerCase()?r:r.closest("a");if(!o)return;const{action:a,interaction:i,link:s,label:c,uuid:d}=(e=>{const t={};if(!e||"a"!==e.tagName.toLowerCase())return t;const{href:n}=e;if(!n||!n.startsWith("adbinapp://"))return t;const r=n.split("?"),o=r[0].split("://")[1],a=e.innerText,i=e.getAttribute("data-uuid")||"";let s,c;if(S(r)){const e=be.parse(r[1]);s=e.interaction||"",c=jn(e.link||"")}return{action:o,interaction:s,link:c,label:a,uuid:i}})(o);e(a,{label:c,id:i,uuid:d,link:s}),"dismiss"===a&&os(),pe(s)&&s.length>0&&t(s,!0)},is=e=>{const{verticalAlign:t,width:n,horizontalAlign:r,backdropColor:o,height:a,cornerRadius:i,horizontalInset:s,verticalInset:c,uiTakeover:d=!1}=e,l={width:n?`${n}%`:"100%",backgroundColor:o||"rgba(0, 0, 0, 0.5)",borderRadius:i?`${i}px`:"0px",border:"none",position:d?"fixed":"relative",overflow:"hidden"};return"left"===r?l.left=s?`${s}%`:"0":"right"===r?l.right=s?`${s}%`:"0":"center"===r&&(l.left="50%",l.transform="translateX(-50%)"),"top"===t?l.top=c?`${c}%`:"0":"bottom"===t?(l.position="fixed",l.bottom=c?`${c}%`:"0"):"center"===t&&(l.top="50%",l.transform=("center"===r?`${l.transform} `:"")+"translateY(-50%)",l.display="flex",l.alignItems="center",l.justifyContent="center"),l.height=a?`${a}vh`:"100%",l},ss=e=>{const{backdropOpacity:t,backdropColor:n}=e;return{position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"transparent",opacity:t||.5,backgroundColor:n||"#FFFFFF"}},cs=["enabled","parentElement","insertionMethod"],ds=(e={},t)=>{os();const{content:n,contentType:r,mobileParameters:o}=e;let{webParameters:a}=e;if(r!==Qi)return;const i=w("div",{id:ts}),s=((e,t)=>{const n=(new DOMParser).parseFromString(e,Qi),r=n.querySelector("script");r&&r.setAttribute("nonce",wa());const o=w("iframe",{src:URL.createObjectURL(new Blob([n.documentElement.outerHTML],{type:"text/html"})),id:rs});return o.addEventListener("load",(()=>{const{addEventListener:e}=o.contentDocument||o.contentWindow.document;e("click",t)})),o})(n,as(t)),c=w("div",{id:ns});(e=>{if(!e)return!1;const t=Object.keys(e);if(!t.includes(ts))return!1;if(!t.includes(ns))return!1;const n=Object.values(e);for(let e=0;e<n.length;e+=1){if(!wt(n[e],"style"))return!1;if(!wt(n[e],"params"))return!1;for(let t=0;t<cs.length;t+=1)if(!wt(n[e].params,cs[t]))return!1}return!0})(a)||(a=(e=>{if(!e)return;const{uiTakeover:t=!1}=e;return{[rs]:{style:{border:"none",width:"100%",height:"100%"},params:{enabled:!0,parentElement:"#alloy-messaging-container",insertionMethod:"appendChild"}},[ts]:{style:is(e),params:{enabled:!0,parentElement:"body",insertionMethod:"appendChild"}},[ns]:{style:ss(e),params:{enabled:!0===t,parentElement:"body",insertionMethod:"appendChild"}}}})(o)),a&&((e,t,n,r)=>{[{id:ns,element:r},{id:ts,element:n},{id:rs,element:e}].forEach((({id:e,element:n})=>{const{style:r={},params:o={}}=t[e];Object.assign(n.style,r);const{parentElement:a="body",insertionMethod:i="appendChild",enabled:s=!0}=o,c=document.querySelector(a);s&&c&&"function"==typeof c[i]&&c[i](n)}))})(s,a,i,c)};var ls=e=>({defaultContent:t=>((e,t)=>new Promise((n=>{const{meta:r}=e;ds(e,((e,n)=>{const o={};o[Xo.INTERACT]=1,-1!==Object.values(Xo).indexOf(e)&&(o[e]=1),t({decisionsMeta:[r],propositionAction:n,eventType:zo,propositionEventTypes:Object.keys(o)})})),n({meta:r})})))(t,e)});const us=e=>{const t=e.find((e=>e.scopeType===vi));return t?t.scope:void 0};var ps=(e,t,n)=>{const{interactIds:r,clickLabel:o="",clickToken:a}=(e=>{const{documentElement:t}=document;let n=e;const r=new Set;let o,a;for(;n&&n!==t&&!(n instanceof ShadowRoot);){const e=ua(n,Li);e&&r.add(e),o=o||ua(n,Ui),a=a||ua(n,"data-aep-click-token"),n=n.parentNode}return{interactIds:[...r],clickLabel:o,clickToken:a}})(e),i=((e,t,n)=>r=>{const{scopeDetails:o={}}=r,{decisionProvider:a}=o;return e[a]===Ai||e[a]===$i&&(t||n)})(n,o,a);if(0===r.length)return{};const s=t(r).filter(i);return{decisionsMeta:wi(s),propositionActionLabel:o,propositionActionToken:a,viewName:us(s)}};const gs="AJO",ms="TGT",fs=({config:e,logger:t,eventManager:n,consent:r})=>{const{targetMigrationEnabled:o,prehidingStyle:a,autoCollectPropositionInteractions:i}=e,s=hi({eventManager:n,mergeDecisionsMeta:Ii}),c=(e=>()=>{const t=da(qa);t&&(e.logOnContentHiding({status:"show-containers",message:"Prehiding style removed to show containers.",logLevel:"info"}),U(t))})(t),d=(e=>t=>{if(!t)return;if(da(qa))return;const n=wa(),r={id:qa,...n&&{nonce:n}},o=w(E,r,{textContent:t});e.logOnContentHiding({status:"hide-containers",message:"Prehiding style applied to hide containers.",logLevel:"info"}),v(document.head,o)})(t),{storeInteractionMeta:l,getInteractionMetas:u}=(()=>{const e={},t={};return{storeInteractionMeta:(n,r,o,a,i)=>{i=parseInt(i,10),e[i]||(e[i]={},t[i]={}),t[i][n]||(t[i][n]=new Set),t[i][n].add(r),e[i][n]={...a,scopeType:o}},getInteractionMetas:n=>Array.isArray(n)&&0!==n.length?Object.values(n.map((e=>parseInt(e,10))).reduce(((n,r)=>(Object.keys(e[r]||{}).forEach((o=>{n[o]||(n[o]={proposition:e[r][o],items:new Set}),n[o].items=new Set([...n[o].items,...t[r][o]])})),n)),{})).map((({proposition:e,items:t})=>({...e,items:Array.from(t).map((e=>({id:e})))}))):[]}})(),{storeClickMeta:p,getClickSelectors:g,getClickMetas:m}=Si(),f=(({window:e})=>()=>e.location)({window:window}),y={[Za]:Qa(xa),[ei]:Qa($a),[ti]:Qa(Ba),[ni]:Qa(za),[ri]:Qa(Ja),[oi]:Qa(Ha),[ai]:Qa(Wa),[ii]:Qa(Ka),[si]:Qa(Ga),[ci]:Qa(U),[di]:Qa(Va),[li]:Qa(Fa),[ui]:Qa(_a),[pi]:Qa($a),[gi]:Qa(Aa),[fi]:Qa(Ya)},b=(C=[Oi,Ri],e=>e?C.reduce(((e,t)=>({...e,...t(e)})),e):e);var C;const I=Ni({preprocess:b,isPageWideSurface:xo}),k=(({createProposition:e})=>{let t=!1,n=Promise.resolve({});const r=(t,n)=>{const r=t[n.toLowerCase()];return r&&r.length>0?r:[e({scope:n,scopeDetails:{characteristics:{scopeType:vi}},items:[{schema:$o}]},!1)]};return{createCacheUpdate:e=>{const o=h();return t=!0,n=n.then((e=>o.promise.then((t=>({...e,...t}))).catch((()=>e)))),{update(t){const n=t.filter((e=>e.getScope())),a=X(n,(e=>e.getScope().toLowerCase()));return o.resolve(a),e?r(a,e):[]},cancel(){o.reject()}}},getView:e=>n.then((t=>r(t,e))),isInitialized:()=>t}})({createProposition:I}),D=es(window),P={[$o]:Mi,[qo]:_i({modules:y,logger:t,storeInteractionMeta:l,storeClickMeta:p,autoCollectPropositionInteractions:i}),[Lo]:Vi({modules:y,logger:t,storeInteractionMeta:l,autoCollectPropositionInteractions:i}),[Bo]:zi({logger:t,executeRedirect:D,collect:s}),[Fo]:Ki({modules:ls(s),logger:t})},T=Ji({schemaProcessors:P,logger:t}),R=(()=>{let e=Promise.resolve([]);return{concat(t){e=e.then((e=>t.then((t=>e.concat(t))).catch((()=>e))))},clear(){const t=e;return e=Promise.resolve([]),t}}})(),O=((e,t)=>(n,r,o)=>{if(!n)return()=>{};if(!r){const e=h();return t.concat(e.promise),e.resolve}return(t=[],n=[])=>{S(t)&&e({decisionsMeta:t,viewName:o}),S(n)&&e({decisionsMeta:n,eventType:Qo,propositionAction:{reason:"Conflict"},viewName:o})}})(s,R),N=(({logger:e,prehidingStyle:t,showContainers:n,hideContainers:r,mergeQuery:o,processPropositions:a,createProposition:i,notificationHandler:s,consent:c})=>({cacheUpdate:d,personalizationDetails:l,event:u,onResponse:p})=>{const{state:g,wasSet:m}=c.current();"out"===g&&m||(l.isRenderDecisions()?r(t):n()),o(u,l.createQueryDetails());const f=s(l.isRenderDecisions(),l.isSendDisplayEvent(),l.getViewName());p((({response:t})=>{const r=t.getPayloadsByType("personalization:decisions");S(r)||e.logOnContentRendering({status:"no-offers",message:"No offers were returned.",logLevel:"info",detail:{query:l.createQueryDetails()}});const o=r.map((e=>i(e))),{page:s=[],view:c=[],proposition:u=[]}=X(o,(e=>e.getScopeType())),p=d.update(c);let g,m,h;return l.isRenderDecisions()?(({render:g,returnedPropositions:m,returnedDecisions:h}=a([...s,...p],u)),S(s)&&e.logOnContentRendering({status:"rendering-started",message:"Started rendering propositions for page-wide scope.",logLevel:"info",detail:{scope:Yt,propositions:s.map((e=>e.toJSON()))}}),S(p)&&e.logOnContentRendering({status:"rendering-started",message:`Rendering propositions started for view scope - ${l.getViewName()}.`,logLevel:"info",detail:{scope:l.getViewName(),propositions:p.map((e=>e.toJSON()))}}),g().then(f),n()):({returnedPropositions:m,returnedDecisions:h}=a([],[...s,...p,...u])),{propositions:m,decisions:h}}))})({prehidingStyle:a,showContainers:c,hideContainers:d,mergeQuery:ki,processPropositions:T,createProposition:I,notificationHandler:O,consent:r,logger:t}),M=(({mergeDecisionsMeta:e,collectInteractions:t,collectClicks:n,getInteractionMetas:r,getClickMetas:o,getClickSelectors:a,autoCollectPropositionInteractions:i})=>({event:s,clickedElement:c})=>{const d=[];let l,u,p;if([t(c,r,i),n(c,a(),o)].forEach((({decisionsMeta:e,propositionActionLabel:t,propositionActionToken:n,viewName:r})=>{Array.prototype.push.apply(d,e),!l&&t&&(l=t),!u&&n&&(u=n),!p&&r&&(p=r)})),S(d)){const t={eventType:zo};p&&(t.web={webPageDetails:{viewName:p}}),s.mergeXdm(t),e(s,d,[Xo.INTERACT],((e,t)=>{if(!t&&!e)return;const n={};return e&&(n.label=e),t&&(n.tokens=[t]),n})(l,u))}})({mergeDecisionsMeta:Ii,collectInteractions:ps,collectClicks:Ei,getInteractionMetas:u,getClickMetas:m,getClickSelectors:g,autoCollectPropositionInteractions:i}),A=(({processPropositions:e,viewCache:t,logger:n})=>({personalizationDetails:r,onResponse:o})=>{let a,i;const s=r.getViewName();return o((()=>({propositions:a,decisions:i}))),t.getView(s).then((t=>{let o;return r.isRenderDecisions()?(({render:o,returnedPropositions:a,returnedDecisions:i}=e(t)),n.logOnContentRendering({status:"rendering-started",message:`Started rendering propositions for view scope - ${s}.`,logLevel:"info",detail:{scope:s,propositions:t.map((e=>e.toJSON()))}}),o()):(({returnedPropositions:a,returnedDecisions:i}=e([],t)),[])}))})({processPropositions:T,viewCache:k,logger:t}),x=Ti({processPropositions:T,createProposition:I,renderedPropositions:R,viewCache:k}),$=(({targetMigrationEnabled:e})=>e?e=>{e.getPayload().mergeMeta({target:{migration:!0}})}:ge)({targetMigrationEnabled:o}),q=Gi({processPropositions:T,createProposition:I,notificationHandler:O}),L=(({showContainers:e,consent:t})=>()=>{const{state:n,wasSet:r}=t.current();n===Nt&&r?e():t.awaitConsent().catch(e)})({showContainers:c,consent:r});return ta({getPageLocation:f,logger:t,fetchDataHandler:N,viewChangeHandler:A,onClickHandler:M,isAuthoringModeEnabled:Ci,mergeQuery:ki,viewCache:k,showContainers:c,applyPropositions:x,setTargetMigration:$,mergeDecisionsMeta:Ii,renderedPropositions:R,onDecisionHandler:q,handleConsentFlicker:L})};fs.namespace="Personalization";const hs=qi.map((e=>ht(e)));fs.configValidators=wt({prehidingStyle:bt().nonEmpty(),targetMigrationEnabled:mt().default(!1),autoCollectPropositionInteractions:wt({[gs]:ut(hs).default(Ai),[ms]:ut(hs).default(xi)}).default({[gs]:Ai,[ms]:xi}).noUnknownFields()});const ys=e=>null!==e&&"object"==typeof e&&Object.getPrototypeOf(e)===Object.prototype,vs=(e,t={},n=[])=>(Object.keys(e).forEach((r=>{ys(e[r])||Array.isArray(e[r])?vs(e[r],t,[...n,r]):t[[...n,r].join(".")]=e[r]})),t);var ws=e=>ys(e)?vs(e):e;const bs="matcher",Es="group",Cs="historical",Is="eq",ks="ne",Ss="ex",Ds="nx",Ps="gt",Ts="ge",Rs="lt",Os="le",Ns="co",Ms="nc",As="sw",xs="ew",$s="and",qs="or",Ls="ordered",Us="mostRecent";function js(e){return"object"==typeof e||void 0===e}function Bs(e){return"number"==typeof e}const Fs={[Is]:{matches:(e,t,n=[])=>{if(js(e[t]))return!1;const r=String(e[t]).toLowerCase();for(let e=0;e<n.length;e+=1)if(!js(n[e])&&r===String(n[e]).toLowerCase())return!0;return!1}},[ks]:{matches:(e,t,n=[])=>{if(js(e[t]))return!1;const r=String(e[t]).toLowerCase();for(let e=0;e<n.length;e+=1)if(!js(n[e])&&r===String(n[e]).toLowerCase())return!1;return!0}},[Ss]:{matches:(e,t)=>void 0!==e[t]&&null!==e[t]},[Ds]:{matches:(e,t)=>void 0===e[t]||null===e[t]},[Ps]:{matches:(e,t,n=[])=>{const r=e[t];if(!Bs(r))return!1;for(let e=0;e<n.length;e+=1)if(Bs(n[e])&&r>n[e])return!0;return!1}},[Ts]:{matches:(e,t,n=[])=>{const r=e[t];if(!Bs(r))return!1;for(let e=0;e<n.length;e+=1)if(Bs(n[e])&&r>=n[e])return!0;return!1}},[Rs]:{matches:(e,t,n=[])=>{const r=e[t];if(!Bs(r))return!1;for(let e=0;e<n.length;e+=1)if(Bs(n[e])&&r<n[e])return!0;return!1}},[Os]:{matches:(e,t,n=[])=>{const r=e[t];if(!Bs(r))return!1;for(let e=0;e<n.length;e+=1)if(Bs(n[e])&&r<=n[e])return!0;return!1}},[Ns]:{matches:(e,t,n=[])=>{if(js(e[t]))return!1;const r=String(e[t]).toLowerCase();for(let e=0;e<n.length;e+=1)if(!js(n[e])&&-1!==r.indexOf(String(n[e]).toLowerCase()))return!0;return!1}},[Ms]:{matches:(e,t,n=[])=>{if(js(e[t]))return!1;const r=String(e[t]).toLowerCase();for(let e=0;e<n.length;e+=1)if(!js(n[e])&&-1!==r.indexOf(String(n[e]).toLowerCase()))return!1;return!0}},[As]:{matches:(e,t,n=[])=>{if(js(e[t]))return!1;const r=String(e[t]).toLowerCase();for(let e=0;e<n.length;e+=1)if(!js(n[e])&&r.startsWith(String(n[e]).toLowerCase()))return!0;return!1}},[xs]:{matches:(e,t,n=[])=>{if(js(e[t]))return!1;const r=String(e[t]).toLowerCase();for(let e=0;e<n.length;e+=1)if(!js(n[e])&&r.endsWith(n[e].toLowerCase()))return!0;return!1}}};function _s(e){return void 0===e}const Vs="eventId",Hs="eventType",zs=["iam.eventType",Hs,"type"],Js=["iam.id","id"],Gs=(e,t)=>{for(let n=0;n<t.length;n+=1)if(!_s(e[t[n]]))return t[n];throw new Error("The event does not match the expected schema.")},Qs=e=>{const t=structuredClone(e);return[[Gs(t,zs),Hs],[Gs(t,Js),Vs]].forEach((([e,n])=>{e!==n&&(t[n]=t[e],delete t[e])})),t};function Xs(e,t){return{evaluate:(e,n)=>t.evaluate(e,n),toString:()=>`Condition{type=${e}, definition=${t}}`}}function Ws(e,t,n){return{evaluate:r=>{const o=function(e){return Fs[e]}(t);return!!o&&o.matches(r,e,n)}}}function Ys(e,t,n,r,o,a){return{evaluate:(i,s)=>{let c;return c=Us===a?function(e,t,n,r=0,o=1/0){try{return e.reduce(((e,a,i)=>{const s=n.generateEventHash(Qs(a)),c=t.events[s];if(!c)return e;const d=c.timestamps.filter((e=>e>=r&&e<=o)).pop();return d&&d>e.timestamp?{index:i,timestamp:d}:e}),{index:-1,timestamp:0}).index}catch{return-1}}(e,i,s,r,o):Ls===a?function(e,t,n,r=0,o=1/0){try{let a=r;const i=e.every((e=>{const r=n.generateEventHash(Qs(e)),i=t.events[r];if(!i)return!1;const s=i.timestamps[0],c=s>=a&&s<=o;return a=s,c}));return Number(i)}catch{return 0}}(e,i,s,r,o):function(e,t,n,r=0,o=1/0){return e.reduce(((e,a)=>{try{const i=n.generateEventHash(Qs(a)),s=t.events[i];if(!s)return e;const{timestamps:c=[]}=s;return e+c.filter((e=>e>=r&&e<=o)).length}catch{return e}}),0)}(e,i,s,r,o),((e,t,n)=>{switch(t){case Ps:return e>n;case Ts:return e>=n;case Rs:return e<n;case Os:return e<=n;case Is:return e===n;case ks:return e!==n;default:return!1}})(c,t,n)}}}function Ks(e){const{logic:t,conditions:n}=e;return function(e,t){return{evaluate:(n,r)=>$s===e?function(e,t,n){let r=!0;for(let o=0;o<t.length;o+=1)r=r&&t[o].evaluate(e,n);return r}(n,t,r):qs===e&&function(e,t,n){let r=!1;for(let o=0;o<t.length;o+=1)if(r=r||t[o].evaluate(e,n),r)return!0;return!1}(n,t,r)}}(t,n.map(Zs))}function Zs(e){const{type:t,definition:n}=e;if(bs===t){const e=function(e){const{key:t,matcher:n,values:r}=e;return Ws(t,n,r)}(n);return Xs(t,e)}if(Es===t){return Xs(t,Ks(n))}if(Cs===t){const e=function(e){const{events:t,from:n,to:r,matcher:o,value:a,searchType:i}=e;return Ys(t,o,a,n,r,i)}(n);return Xs(t,e)}throw new Error("Can not parse condition")}function ec(e){const{id:t,type:n,detail:r}=e;return function(e,t,n){return{id:e,type:t,detail:n}}(t,n,r)}function tc(e){const{condition:t,consequences:n,key:r}=e;return function(e,t,n){return{key:n,execute:(n,r)=>e.evaluate(n,r)?t:[],toString:()=>`Rule{condition=${e}, consequences=${t}}`}}(Zs(t),n.map(ec),r)}function nc(e){const{version:t,rules:n,metadata:r}=e,o=n.map(tc),a=function(e){if(!e)return;return{provider:e.provider,providerData:Object.assign({},e.providerData)}}(r);return function(e,t,n){return{version:e,rules:t,metadata:n}}(t,o,a)}function rc(e,t,n){const{providerData:r}=n,{identityTemplate:o}=r;return o.replace("<key>",t).replace("<identity>",e)}function oc(e,t=e=>e[0]){const n={};return function(...r){const o=t(r);return _s(n[o])&&(n[o]=e(...r)),n[o]}}function ac(e,t){const n=65535&t;return((t-n)*e|0)+(n*e|0)|0}const ic=oc((function(e,t=0){let n;const r=e.length,o=3432918353,a=461845907;let i=t;const s=-2&r;for(let t=0;t<s;t+=2)n=e.charCodeAt(t)|e.charCodeAt(t+1)<<16,n=ac(n,o),n=(131071&n)<<15|n>>>17,n=ac(n,a),i^=n,i=(524287&i)<<13|i>>>19,i=5*i+3864292196|0;return r%2==1&&(n=e.charCodeAt(s),n=ac(n,o),n=(131071&n)<<15|n>>>17,n=ac(n,a),i^=n),i^=r<<1,i^=i>>>16,i=ac(i,2246822507),i^=i>>>13,i=ac(i,3266489909),i^=i>>>16,i}),(e=>e.join("-")));const sc=oc((function(e,t){const n=ic(e),r=Math.abs(n)%t/t*100;return Math.round(100*r)/100}));function cc(e,t,n){return{allocation:sc(e,t),...n}}function dc(e,t){return t.map((t=>t.execute(e))).filter((e=>e.length>0))}function lc(e,t){!function(e){const{providerData:t}=e;if(!t)throw new Error("Provider data is missing in metadata");const{identityTemplate:n,buckets:r}=t;if(!n)throw new Error("Identity template is missing in provider data");if(!r)throw new Error("Buckets is missing in provider data")}(t);const n=e.filter((e=>!e.key)),r=function(e){const t={};for(let n=0;n<e.length;n+=1){const r=e[n];r.key&&(t[r.key]||(t[r.key]=[]),t[r.key].push(r))}return t}(e),{buckets:o}=t.providerData;return{provider:"TGT",execute:e=>{const a=function(e){const{xdm:t}=e;if(!t)throw new Error("XDM object is missing in the context");const{identityMap:n}=t;if(!n)throw new Error("Identity map is missing in the XDM object");const r=n.ECID;if(!r)throw new Error("ECID identity namespace is missing in the identity map");if(!Array.isArray(r)||0===r.length)throw new Error("ECID identities array is empty or not an array");const o=r[0].id;if(!o)throw new Error("ECID identity is missing in the identities array");return o}(e),i=dc(e,n),s=Object.keys(r),c=[];for(let n=0;n<s.length;n+=1){const i=s[n],d=r[i],l=dc(cc(rc(a,i,t),o,e),d);c.push(...l)}return[...i,...c]}}}function uc(e,t={generateEventHash:()=>{throw new Error("No hash function provided")}}){const{rules:n,metadata:r={}}=nc(e);return function(e,t,n){const{provider:r}=t;return"TGT"===r?lc(e,t):function(e,t){return{provider:"DEFAULT",execute:n=>e.map((e=>e.execute(n,t))).filter((e=>e.length>0))}}(e,n)}(n,r,t)}var pc=e=>{const t=structuredClone(e),n=Object.keys(t).sort().reduce(((e,n)=>{const r=t[n];return null==r||""===r?e:e+=`${n}:${r}`}),"");return V(n)};const gc="events",mc="~type",fc="~source",hc="com.adobe.eventType.edge",yc="com.adobe.eventType.rulesEngine",vc="com.adobe.eventSource.requestContent",wc="cjmiam",bc="schema";var Ec=(e=30,t=1e3)=>n=>{let r=Object.entries(n).reduce(((e,[t,{timestamps:n=[]}])=>(n.forEach((n=>{e.push({key:t,timestamp:n})})),e)),[]);const o=(e=>{const t=new Date;return t.setDate(t.getDate()-e),t})(e);return r=r.filter((({timestamp:e})=>e>=o)),r.sort(((e,t)=>e.timestamp-t.timestamp)),r=r.slice(-t),r.reduce(((e,{key:t,timestamp:n})=>(e[t]||(e[t]={timestamps:[]}),e[t].timestamps.push(n),e)),{})};const Cc=e=>e?.scopeDetails?.activity?.id,Ic=()=>{const e={};return{getItem:t=>t in e?e[t]:null,setItem:(t,n)=>{e[t]=n}}},kc=e=>{e.clear()};const Sc={[wc]:(e,t,n)=>{const{html:r,mobileParameters:o}=n;return{schema:Fo,data:{mobileParameters:o,webParameters:{},content:r,contentType:Qi},id:e}},[bc]:(e,t,n)=>{const{schema:r,data:o,id:a}=n;return{schema:r,data:o,id:a||e}}};const Dc=e=>{const{schema:t,data:n}=e;if(t===jo)return!0;if(t!==Uo)return!1;try{const e="string"==typeof n.content?JSON.parse(n.content):n.content;return e&&Object.prototype.hasOwnProperty.call(e,"version")&&Object.prototype.hasOwnProperty.call(e,"rules")}catch{return!1}};var Pc=(e,t)=>{const n=e=>{const{id:t,type:n,detail:r}=e;return"function"==typeof Sc[n]?Sc[n](t,n,r):r},r=Cc(e),o=[],a=e=>{const{data:t={},schema:n}=e,r=n===jo?t:t.content;r&&o.push(uc("string"==typeof r?JSON.parse(r):r,{generateEventHash:pc}))};return Array.isArray(e.items)&&e.items.filter(Dc).forEach(a),{rank:e?.scopeDetails?.rank||1/0,evaluate:a=>{const i=t.getEvent(Ho,r),s=i?.timestamps[0],c=((e=[])=>Array.isArray(e)?e.flat(1/0):e)(o.map((e=>e.execute(a)))).map(n).map((e=>{const n=t.addEvent({eventType:Xo.TRIGGER,eventId:r}).timestamps[0];return{...e,data:{...e.data,qualifiedDate:n,displayedDate:s}}}));return{...e,items:c}},isEvaluable:o.length>0}},Tc=({storage:e,logger:t})=>{let n,r,o,a=e;const i=e=>{a=e;const t=((e,t)=>n=>{try{const n=e.getItem(t);return[JSON.parse(n),n.length]}catch{}return[n,0]})(a,gc);if(n=((e,t)=>n=>{e.setItem(t,JSON.stringify(n))})(a,gc),[r,o]=t({}),o>2097152){const e=Ec();r=e(r),n(r)}};i(e);const s=(e={eventType:null,eventId:null},o="insert")=>{const{eventType:a,eventId:i}=e;if(!a||!i)return;const s=pc(e);if("insertIfNotExists"===o&&r[s])return;r[s]&&Array.isArray(r[s].timestamps)||(r[s]={timestamps:[]});const c=(new Date).getTime();return r[s].timestamps.push(c),r[s].timestamps.sort(),t.info("[Event History] Added event for",e,"with hash",s,"and timestamp",c),n(r),r[s]};return{addExperienceEdgeEvent:e=>{const{xdm:t}=e.getContent();if(!(e=>{const{_experience:t}=e||{};return!!t&&"object"==typeof t})(t))return;const{_experience:{decisioning:{propositionEventType:n={},propositionAction:{id:r}={},propositions:o=[]}={}}}=t;Object.keys(n).filter((e=>1===n[e])).forEach((e=>{o.forEach((t=>{(e=>e?.scopeDetails?.decisionProvider)(t)===gs&&s({eventId:Cc(t),eventType:e,action:r})}))}))},addEvent:s,addEventPayloads:(e=[])=>e.map((({operation:e,event:t})=>s(t,e))),getEvent:(e,t)=>{const n=pc({eventType:e,eventId:t});if(r[n])return r[n]},toJSON:()=>r,setStorage:i}};const Rc=(e,...t)=>t,Oc=(e,...t)=>!0;var Nc=({collect:e})=>{let t=()=>{};const n=new Set,r=(e,t,r)=>{const o=[e,t].join("-"),a=!r.has(o)&&((e=>[Xo.INTERACT,Xo.DISMISS].includes(e))(e)||!n.has(o));return r.add(o),n.add(o),a},o=(t,n=[])=>{if(!(n instanceof Array))return Promise.resolve();if(!Object.values(Xo).includes(t))return Promise.resolve();const o=[],a=new Set;return n.forEach((e=>{const n=(e=>{const{id:t,scope:n,scopeDetails:r}=e;return{id:t,scope:n,scopeDetails:r}})(e);r(t,n.id,a)&&o.push(n)})),o.length>0?e({decisionsMeta:o,eventType:Zo(t),documentMayUnload:!0}):Promise.resolve()},a=(()=>{let e=Rc,t=Oc,n=0;const r={};return{add:(e,t=void 0)=>{return"function"!=typeof e?()=>{}:(n+=1,r[n]={callback:e,params:t},{id:n,unsubscribe:(o=n,()=>{delete r[o]})});var o},emit:(...n)=>{Object.values(r).forEach((({callback:r,params:o})=>{const a=e(o,...n);t(o,...a)&&r(...a)}))},emitOne:(n,...o)=>{if(!n||!r[n])return;const{callback:a,params:i}=r[n],s=e(i,...o);t(i,...s)&&a(...s)},hasSubscriptions:()=>Object.keys(r).length>0,setEmissionPreprocessor:t=>{"function"==typeof t&&(e=t)},setEmissionCondition:e=>{"function"==typeof e&&(t=e)}}})();a.setEmissionPreprocessor(((e,t)=>{const{surfacesFilter:n,schemasFilter:r}=e;return[{propositions:t.filter((e=>!n||n.includes(e.scope))).map((e=>{const{items:t=[]}=e;return{...e,items:t.filter((e=>!r||r.includes(e.schema)))}})).filter((e=>e.items.length>0))},o]}));return{refresh:e=>{t=t=>{t?a.emitOne(t,e):a.emit(e)},t()},command:{optionsValidator:e=>(({options:e})=>wt({surfaces:gt(bt()).uniqueItems(),schemas:gt(bt()).uniqueItems(),callback:ft().required()}).noUnknownFields()(e))({options:e}),run:({surfaces:e,schemas:n,callback:r})=>{const{id:o,unsubscribe:i}=a.add(r,{surfacesFilter:e instanceof Array?e:void 0,schemasFilter:n instanceof Array?n:void 0});return t(o),Promise.resolve({unsubscribe:i})}}}};var Mc=({contextProvider:e,decisionProvider:t})=>({optionsValidator:e=>(({options:e})=>wt({renderDecisions:mt(),personalization:wt({decisionContext:wt({})})}).noUnknownFields()(e))({options:e}),run:({renderDecisions:n,decisionContext:r,applyResponse:o})=>o({renderDecisions:n,propositions:t.evaluate(e.getContext(r))})});const Ac=({config:e,eventManager:t,createNamespacedStorage:n,consent:r,getBrowser:o,logger:a})=>{const{orgId:i,personalizationStorageEnabled:s}=e,c=hi({eventManager:t,mergeDecisionsMeta:Ii}),d=n(`${G(i)}.decisioning.`);s||kc(d.persistent);const l=Tc({storage:Ic(),logger:a}),u=(({eventRegistry:e})=>{const t={},n=n=>{const r=Cc(n);if(!r)return;const o=Pc(n,e);o.isEvaluable&&(t[r]=o)};return{addPayload:n,addPayloads:e=>{e.forEach(n)},evaluate:(e={})=>Object.values(t).sort((({rank:e},{rank:t})=>e-t)).map((t=>t.evaluate(e))).filter((e=>e.items.length>0))}})({eventRegistry:l}),p=(({eventRegistry:e,window:t,getBrowser:n})=>{const r=(new Date).getTime(),o=()=>{const e=new Date,t=e.getTime();return{pageLoadTimestamp:r,currentTimestamp:t,currentDate:e.getDate(),"~state.com.adobe.module.lifecycle/lifecyclecontextdata.dayofweek":e.getDay()+1,"~state.com.adobe.module.lifecycle/lifecyclecontextdata.hourofday":e.getHours(),currentMinute:e.getMinutes(),currentMonth:e.getMonth(),currentYear:e.getFullYear(),pageVisitDuration:t-r,"~timestampu":t/1e3,"~timestampz":e.toISOString()}},a={browser:{name:n()},page:{title:t.title,url:t.url,...fe(t.url)},referringPage:{url:t.referrer,...fe(t.referrer)}};return{getContext:(n={})=>{const r={...{...a,...o(),window:{height:t.height,width:t.width,scrollY:t.scrollY,scrollX:t.scrollX},"~sdkver":vn},...n};return{...ws(r),events:e.toJSON()}}}})({eventRegistry:l,window:window,getBrowser:o}),g=Mc({contextProvider:p,decisionProvider:u}),m=Nc({collect:c});let f;return{lifecycle:{onDecision({propositions:e}){m.refresh(e)},onComponentsRegistered(e){f=(({lifecycle:e,eventRegistry:t})=>({renderDecisions:n=!1,propositions:r=[],event:o,personalization:a})=>{if(e){const i=(e=>{const t=[];return e.forEach((e=>{const n=[];e.items.forEach((e=>{"https://ns.adobe.com/personalization/eventHistoryOperation"===e.schema?t.push({operation:e.data.operation,event:{eventId:e.data.content["iam.id"],eventType:e.data.content["iam.eventType"]}}):n.push(e)})),e.items=n})),t})(r);t.addEventPayloads(i),e.onDecision({renderDecisions:n,propositions:r,event:o,personalization:a})}return{propositions:r}})({lifecycle:e.lifecycle,eventRegistry:l}),s&&r.awaitConsent().then((()=>{l.setStorage(d.persistent)})).catch((()=>{d&&kc(d.persistent)}))},onBeforeEvent({event:e,renderDecisions:t,personalization:n={},onResponse:r=ge}){const{decisionContext:o={}}=n;r((({renderDecisions:e,decisionProvider:t,applyResponse:n,event:r,personalization:o,decisionContext:a})=>{const i={...ws(r.getContent()),...a};return({response:a})=>{if(t.addPayloads(a.getPayloadsByType("personalization:decisions")),!r.hasQuery())return{propositions:[]};const s=t.evaluate(i);return n({renderDecisions:e,propositions:s,event:r,personalization:o})}})({renderDecisions:t,decisionProvider:u,applyResponse:f,event:e,personalization:n,decisionContext:p.getContext({[mc]:hc,[fc]:vc,...o})}))},onBeforeRequest({request:e}){const t=e.getPayload().toJSON(),{events:n=[]}=t;0!==n.length&&n.forEach((e=>l.addExperienceEdgeEvent(e)))}},commands:{evaluateRulesets:{run:({renderDecisions:e,personalization:t={}})=>{const{decisionContext:n={}}=t;return g.run({renderDecisions:e,decisionContext:{[mc]:yc,[fc]:vc,...n},applyResponse:f})},optionsValidator:g.optionsValidator},subscribeRulesetItems:m.command}}};Ac.namespace="RulesEngine",Ac.configValidators=wt({personalizationStorageEnabled:mt().default(!1)});var xc=wt({streamingMedia:wt({channel:bt().nonEmpty().required(),playerName:bt().nonEmpty().required(),appVersion:bt(),mainPingInterval:yt().minimum(10).maximum(50).default(10),adPingInterval:yt().minimum(1).maximum(10).default(10)}).noUnknownFields()}),$c=({config:e,trackMediaEvent:t,trackMediaSession:n,mediaResponseHandler:r})=>({lifecycle:{onBeforeEvent({mediaOptions:e,onResponse:t=ge}){if(!e)return;const{legacy:n,playerId:o,getPlayerDetails:a}=e;n||t((({response:e})=>r({playerId:o,getPlayerDetails:a,response:e})))}},commands:{createMediaSession:{optionsValidator:e=>(({options:e})=>ut([wt({playerId:bt().required(),getPlayerDetails:ft().required(),xdm:wt({mediaCollection:wt({sessionDetails:wt(pt()).required()})}),edgeConfigOverrides:It}).required(),wt({xdm:wt({mediaCollection:wt({playhead:yt().required(),sessionDetails:wt(pt()).required()})}),edgeConfigOverrides:It}).required()],"an object with playerId, getPlayerDetails and xdm.mediaCollection.sessionDetails, or an object with xdm.mediaCollection.playhead and xdm.mediaCollection.sessionDetails")(e))({options:e}),run:n},sendMediaEvent:{optionsValidator:e=>(({options:e})=>ut([wt({playerId:bt().required(),xdm:wt({eventType:Et(...Object.values(Gr)).required(),mediaCollection:wt(pt())}).required()}).required(),wt({xdm:wt({eventType:Et(...Object.values(Gr)).required(),mediaCollection:wt({playhead:yt().integer().required(),sessionID:bt().required()}).required()}).required()}).required()],"Error validating the sendMediaEvent command options.")(e))({options:e}),run:n=>e.streamingMedia?t(n):Promise.reject(new Error("Streaming media is not configured."))}}});const qc=({config:e,logger:t,eventManager:n,sendEdgeNetworkRequest:r,consent:o})=>{const a=Yr(),i=Qr({config:e,eventManager:n,consent:o,sendEdgeNetworkRequest:r,setTimestamp:yn((()=>new Date))}),s=Kr({mediaSessionCacheManager:a,mediaEventManager:i,config:e}),c=Zr({config:e,mediaEventManager:i,mediaSessionCacheManager:a}),d=to({mediaSessionCacheManager:a,config:e,trackMediaEvent:s});return $c({config:e,trackMediaEvent:s,mediaResponseHandler:d,trackMediaSession:c})};qc.namespace="Streaming media",qc.configValidators=xc;var Lc=Object.freeze({__proto__:null,activityCollector:xr,audiences:Lr,consent:zr,eventMerge:Jr,mediaAnalyticsBridge:Co,personalization:fs,rulesEngine:Ac,streamingMedia:qc});(({components:e})=>{const t=window.__alloyNS;t&&t.forEach((t=>{const n=St({console:er,locationSearch:window.location.search,createLogger:Wt,instanceName:t,createNamespacedStorage:Zn,getMonitors:hn}),r=(e=>([t,n,[r,o]])=>{e(r,o).then(t,n)})(dr({instanceName:t,logController:n,components:e})),o=window[t].q;o.push=r,n.logger.logOnInstanceCreated({instance:r}),o.forEach(r)}))})({components:Object.values(Lc)})}();