/** * Copyright 2019 Adobe. All rights reserved. * This file is licensed to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. You may obtain a copy * of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS * OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ !function(){"use strict";if(document.documentMode&&document.documentMode<11)console.warn("The Adobe Experience Cloud Web SDK does not support IE 10 and below.");else{var e="Chrome",n="Edge",t="EdgeChromium",r="Unknown",o=function(e,n){return-1!==e.indexOf(n)},i=[e,n,t,"IE",r],a=function(e){return o(i,e)},c=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,d=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var n={},t=0;t<10;t++)n["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(n).map((function(e){return n[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,n){for(var t,r,o=ui(e),i=1;i1?t-1:0),o=1;o>>1:t>>>1;e.push(t)}return function(n,t){n=unescape(encodeURIComponent(n)),t||(t=0),t^=-1;for(var r=0;r>>8^e[o]}return(t^=-1)>>>0}}(),I=function(){var e={};return e.promise=new Promise((function(n,t){e.resolve=n,e.reject=t})),e},D=function(e,n){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:document,i=o.createElement(e);return Object.keys(n).forEach((function(e){i.setAttribute(e,n[e])})),S(i,t),r.forEach((function(e){return R(i,e)})),i},O="BODY",P="IFRAME",q="IMG",x="STYLE",M="SCRIPT",A=function(e){var n=e.src,t=e.currentDocument,r=void 0===t?document:t;return new Promise((function(e,t){k(q,{src:n},{onload:e,onerror:t,onabort:t},[],r)}))},T=function(e){return"function"==typeof e},N=function(e){return Array.isArray(e)&&e.length>0},j=function(e){return Array.isArray(e)?e:null==e?[]:[].slice.call(e)},U=/^\s*>/,B=function(e,n){if(!U.test(n))return j(e.querySelectorAll(n));var t="alloy-"+Date.now();try{return e.classList.add(t),j(e.querySelectorAll("."+t+" "+n))}finally{e.classList.remove(t)}},F=function(e,n){return e.substr(0,n.length)===n},_=":shadow",H=function(e,n){var t=n.trim();return F(t,">")?window.document.documentMode?t.substring(1).trim():(e instanceof Element||e instanceof HTMLDocument?":scope":":host")+" "+t:t},L=function(e,n){if(!window.document.documentElement.attachShadow)return B(e,n.replace(_,""));var t=function(e){return e.split(_)}(n);if(t.length<2)return B(e,n);for(var r=e,o=0;o1&&void 0!==arguments[1]?arguments[1]:document;return V(e)?L(n,e):B(n,e)},J={childList:!0,subtree:!0},W=function(e){return new Error("Could not find: "+e)},Q=function(e){return new Promise(e)},X=function(e){return T(e.MutationObserver)},$=function(e,n,t,r,o){return Q((function(i,a){var c=new e.MutationObserver((function(){var e=o(t);N(e)&&(c.disconnect(),i(e))}));setTimeout((function(){c.disconnect(),a(W(t))}),r),c.observe(n,J)}))},Y=function(e){return"visible"===e.visibilityState},G=function(e,n,t,r){return Q((function(o,i){!function t(){var i=r(n);N(i)?o(i):e.requestAnimationFrame(t)}(),setTimeout((function(){i(W(n))}),t)}))},K=function(e,n,t){return Q((function(r,o){!function n(){var o=t(e);N(o)?r(o):setTimeout(n,100)}(),setTimeout((function(){o(W(e))}),n)}))},Z=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:z,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:document,i=n(e);return N(i)?Promise.resolve(i):X(r)?$(r,o,e,t,n):Y(o)?G(r,e,t,n):K(e,t,n)},ee=function(e){var n=e.parentNode;return n?n.removeChild(e):null},ne={name:"Adobe Alloy"},te={style:{display:"none",width:0,height:0}},re=function(e,n){return Array.prototype.concat.apply([],e.map(n))},oe="com.adobe.alloy.",ie=oe+"getTld",ae=function(e){return e.replace("@","_")},ce=function(e,n){return"kndctr_"+ae(e)+"_"+n},ue=function(e){var n=e.orgId,t=ce(n,"identity");return function(){return Boolean(g.get(t))}},se=function(e,n,t){return{getItem:function(r){try{return e[n].getItem(t+r)}catch(e){return null}},setItem:function(r,o){try{return e[n].setItem(t+r,o),!0}catch(e){return!1}},clear:function(){try{return Object.keys(e[n]).forEach((function(r){F(r,t)&&e[n].removeItem(r)})),!0}catch(e){return!1}}}},de=function(e,n){return e.filter((function(e){return o(n,e)}))},fe=function(e){return m(e)&&0===Object.keys(e).length},le=function(e){return"number"==typeof e&&!isNaN(e)},pe=function(e){var n=parseInt(e,10);return le(n)&&e===n},ge=function(e){return"string"==typeof e},ve=function(e){return ge(e)&&e.length>0},me=function(){},he=function(e,n,t){var r=String(e),o=String(t);if(r.length>=n||0===o.length)return r;for(var i=n-r.length;i>o.length;)o+=o;return o.slice(0,i)+r},ye=function(e,n,t,r){n=n||"&",t=t||"=";var o={};if("string"!=typeof e||0===e.length)return o;var i=/\+/g;e=e.split(n);var a=1e3;r&&"number"==typeof r.maxKeys&&(a=r.maxKeys);var c=e.length;a>0&&c>a&&(c=a);for(var u=0;u=0?(s=p.substr(0,g),d=p.substr(g+1)):(s=p,d=""),f=decodeURIComponent(s),l=decodeURIComponent(d),wi(o,f)?Array.isArray(o[f])?o[f].push(l):o[f]=[o[f],l]:o[f]=l}return o},we=function(e){switch(li(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},be=function(e,n,t,r){return n=n||"&",t=t||"=",null===e&&(e=void 0),"object"===li(e)?Object.keys(e).map((function(r){var o=encodeURIComponent(we(r))+t;return Array.isArray(e[r])?e[r].map((function(e){return o+encodeURIComponent(we(e))})).join(n):o+encodeURIComponent(we(e[r]))})).join(n):r?encodeURIComponent(we(r))+t+encodeURIComponent(we(e)):""},Ce=si((function(e,n){n.decode=n.parse=ye,n.encode=n.stringify=be}));Ce.decode,Ce.parse,Ce.encode,Ce.stringify;for(var Ee=function(e){return"string"==typeof e&&(e=e.trim().replace(/^[?#&]/,"")),Ce.parse(e)},Ie=function(e){return Ce.stringify(e)},De=function(e){return e instanceof Error?e:new Error(e)},Re=function(e){var n=e.error,t=e.message;try{n.message=t}catch(e){}},Se=function(e){var n=e.error,t=e.message,r=De(n),o=t+"\nCaused by: "+r.message;return Re({error:r,message:o}),r},ke=function(e,n){if(le(e)||ge(e)){var t=Math.round(Number(e));if(!isNaN(t))return t}return n},Oe=si((function(e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var t=new Uint8Array(16);e.exports=function(){return n(t),t}}else{var r=new Array(16);e.exports=function(){for(var e,n=0;n<16;n++)0==(3&n)&&(e=4294967296*Math.random()),r[n]=e>>>((3&n)<<3)&255;return r}}})),Pe=[],qe=0;qe<256;++qe)Pe[qe]=(qe+256).toString(16).substr(1);var xe=function(e,n){var t=n||0,r=Pe;return[r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]]].join("")},Me=function(e,n,t){var r=n&&t||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||Oe)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,n)for(var i=0;i<16;++i)n[r+i]=o[i];return n||xe(o)},Ae=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=function(t,r){return n(e(t,r),r)};return f(r,e,t),r},Te=function(e,n,t){return Ae(e,(function(e,t){return null==e?e:n(e,t)}),t)},Ne=function(e,n,t,r){if(!e)throw new Error("'"+t+"': Expected "+r+", but got "+JSON.stringify(n)+".")},je=function(e,n){return Ne(function(e){return"boolean"==typeof e}(e),e,n,"true or false"),e},Ue=function(e,n){return Ne(T(e),e,n,"a function"),e},Be=function(e,n){return function(t,r){return Ne(t>=n,t,r,e+" greater than or equal to "+n),t}},Fe=function(e){return function(n,t){return m(n)?Ne(!fe(n),n,t,e):Ne(n.length>0,n,t,e),n}},_e=function(){return function(e,n){Ne(function(e){for(var n=Object.create(null),t=0;t1&&void 0!==arguments[1]?arguments[1]:{},r=de(Object.keys(n),Object.keys(t));if(r.length)throw new Error("[ComponentRegistry] Could not register "+e+" because it has existing command(s): "+r.join(","));Object.keys(t).forEach((function(r){var o=t[r];o.commandName=r,o.run=bn(o.run,"["+e+"] An error occurred while executing the "+r+" command."),n[r]=o}))}(r,i),function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(n).forEach((function(r){t[r]=t[r]||[],t[r].push(bn(n[r],"["+e+"] An error occurred while executing the "+r+" lifecycle hook."))}))}(r,a),e[r]=o},getCommand:function(e){return n[e]},getCommandNames:function(){return Object.keys(n)},getLifecycleCallbacks:function(e){return t[e]||[]}}},En="in",In="pending",Dn="general",Rn="declinedConsent",Sn="default",kn="initial",On="new",Pn=function(e){var n=new Error(e);return n.code=Rn,n.message=e,n},qn=function(e){var n=e.logger,t=[],r=function(){return Promise.resolve()},o=function(){return Promise.resolve()},i=function(){return Promise.reject(Pn("No consent preferences have been set."))},a=function(){return Promise.reject(Pn("The user declined consent."))},c=function(e){if(e)return Promise.reject(new Error("Consent is pending."));var n=I();return t.push(n),n.promise};return{in:function(e){e===Sn?this.awaitConsent=r:(e===kn?n.info("Loaded user consent preferences. The user previously consented."):e===On&&this.awaitConsent!==o&&n.info("User consented."),function(){for(;t.length;)t.shift().resolve()}(),this.awaitConsent=o)},out:function(e){e===Sn?(n.warn("User consent preferences not found. Default consent of out will be used."),this.awaitConsent=i):(e===kn?n.warn("Loaded user consent preferences. The user previously declined consent."):e===On&&this.awaitConsent!==a&&n.warn("User declined consent."),function(){for(;t.length;)t.shift().reject(Pn("The user declined consent."))}(),this.awaitConsent=a)},pending:function(e){e===Sn&&n.info("User consent preferences not found. Default consent of pending will be used. Some commands may be delayed."),this.awaitConsent=c},awaitConsent:function(){return Promise.reject(new Error("Consent has not been initialized."))},withConsent:function(){return this.awaitConsent(!0)}}},xn=function(){var e,n,t={},r=!1,o=!1,i=!0,a=function(e){if(o)throw new Error(e+" cannot be called after event is finalized.")},c={setUserXdm:function(n){a("setUserXdm"),e=n},setUserData:function(e){a("setUserData"),n=e},mergeXdm:function(e){a("mergeXdm"),e&&y(t,{xdm:e})},mergeMeta:function(e){a("mergeMeta"),e&&y(t,{meta:e})},mergeQuery:function(e){a("mergeQuery"),e&&y(t,{query:e})},documentMayUnload:function(){r=!0},finalize:function(r){if(!o&&(e&&c.mergeXdm(e),n&&(t.data=n),o=!0,r)){i=!1;var a={xdm:t.xdm||{},data:t.data||{}},u=r(a);i=!1!==u,t.xdm=a.xdm||{},t.data=a.data||{},fe(t.xdm)&&delete t.xdm,fe(t.data)&&delete t.data}},getDocumentMayUnload:function(){return r},isEmpty:function(){return fe(t)&&(!e||fe(e))&&(!n||fe(n))},shouldSend:function(){return i},getViewName:function(){if(e&&e.web&&e.web.webPageDetails)return e.web.webPageDetails.viewName},toJSON:function(){if(!o)throw new Error("toJSON called before finalize");return t}};return c},Mn="configure",An="setDebug",Tn=function(e){var n=e.command,t=e.options,r=n.commandName,o=n.documentationUri,i=void 0===o?"https://adobe.ly/3sHgQHb":o,a=n.optionsValidator,c=t;if(a)try{c=a(t)}catch(e){throw new Error("Invalid "+r+" command options:\n\t - "+e+" For command documentation see: "+i)}return c},Nn=function(e){var n=e.eventManager;return{commands:{sendEvent:{documentationUri:"https://adobe.ly/3GQ3Q7t",optionsValidator:function(e){return function(e){var n=e.options;return pn({type:gn(),xdm:pn({eventType:gn(),identityMap:mn}),data:pn({}),documentUnloading:sn(),renderDecisions:sn(),decisionScopes:un(gn()).uniqueItems(),personalization:pn({decisionScopes:un(gn()).uniqueItems(),surfaces:un(gn()).uniqueItems()}),datasetId:gn(),mergeId:gn()}).required().noUnknownFields()(n)}({options:e})},run:function(e){var t=e.xdm,r=e.data,o=e.documentUnloading,i=void 0!==o&&o,a=e.type,c=e.mergeId,u=e.renderDecisions,s=void 0!==u&&u,d=e.decisionScopes,f=void 0===d?[]:d,l=e.personalization,p=void 0===l?{}:l,g=e.datasetId,v=n.createEvent();return i&&v.documentMayUnload(),v.setUserXdm(t),v.setUserData(r),a&&v.mergeXdm({eventType:a}),c&&v.mergeXdm({eventMergeId:c}),g&&v.mergeMeta({collect:{datasetId:g}}),n.sendEvent(v,{renderDecisions:s,decisionScopes:f,personalization:p})}},applyResponse:{documentationUri:"",optionsValidator:function(e){return function(e){var n=e.options;return pn({renderDecisions:sn(),responseHeaders:ln(gn().required()),responseBody:pn({handle:un(pn({type:gn().required(),payload:cn().required()})).required()}).required()}).noUnknownFields()(n)}({options:e})},run:function(e){var t=e.renderDecisions,r=void 0!==t&&t,o=e.responseHeaders,i=void 0===o?{}:o,a=e.responseBody,c=void 0===a?{handle:[]}:a,u=n.createEvent();return n.applyResponse(u,{renderDecisions:r,responseHeaders:i,responseBody:c})}}}}};Nn.namespace="DataCollector",Nn.configValidators={};var jn=function(e){var n=function(e){var n=e.eventManager,t=e.lifecycle,r=e.handleError;return function(e){var o=e.target,i=n.createEvent();return i.documentMayUnload(),t.onClick({event:i,clickedElement:o}).then((function(){return i.isEmpty()?Promise.resolve():n.sendEvent(i)})).then(me).catch((function(e){r(e,"click collection")}))}}({eventManager:e.eventManager,lifecycle:e.lifecycle,handleError:e.handleError});document.addEventListener("click",n,!0)},Un={clickCollectionEnabled:sn().default(!0),downloadLinkQualifier:gn().regexp().default("\\.(exe|zip|wav|mp3|mov|mpg|avi|wmv|pdf|doc|docx|xls|xlsx|ppt|pptx)$")},Bn=function(e,n,t,r){var o="other";return!function(e,n,t){var r=new RegExp(e);return!!t.download||r.test(n.toLowerCase())}(n.downloadLinkQualifier,t,r)?function(e,n){var t=e.location.hostname.toLowerCase();return!(n.toLowerCase().indexOf(t)>=0)}(e,t)&&(o="exit"):o="download",o},Fn=function(e){var n=e.config,t=e.eventManager,r=e.handleError,o=function(e,n){return function(t,r){if(n.clickCollectionEnabled){var o=function(e){for(var n,t=e;t;){if((n=t).href&&("A"===n.tagName||"AREA"===n.tagName)&&(!n.onclick||!n.protocol||n.protocol.toLowerCase().indexOf("javascript")<0))return t;t=t.parentNode}return null}(r);if(o){var i=function(e,n){var t=e.location,r=n.href?n.href:"",o=n.protocol,i=n.host;if(!function(e){return e&&/^[a-z0-9]+:\/\//i.test(e)}(r)){o||(o=t.protocol?t.protocol:""),o=o?o+"//":"",i||(i=t.host?t.host:"");var a="";if("/"!==r.substring(0,1)){var c=t.pathname.lastIndexOf("/");c=c<0?0:c,a=t.pathname.substring(0,c)}r=""+o+i+a+"/"+r}return r}(e,o);if(i){var a=Bn(e,n,i,o);t.documentMayUnload(),t.mergeXdm({eventType:"web.webinteraction.linkClicks",web:{webInteraction:{name:"Link Click",type:a,URL:i,linkClicks:{value:1}}}})}}}}}(window,n);return{lifecycle:{onComponentsRegistered:function(e){var o=e.lifecycle;jn({config:n,eventManager:t,lifecycle:o,handleError:r})},onClick:function(e){var n=e.event,t=e.clickedElement;o(n,t)}}}};Fn.namespace="ActivityCollector",Fn.configValidators=Un;var _n,Hn,Ln,Vn=function(e,n){return"ID sync "+(n?"succeeded":"failed")+": "+e.spec.url},zn={thirdPartyCookiesEnabled:sn().default(!0),idMigrationEnabled:sn().default(!0)},Jn=function(e){return pn({namespaces:un(fn("ECID")).nonEmpty().uniqueItems()}).noUnknownFields()(e),{namespaces:["ECID"]}},Wn=pn({url:gn().required().nonEmpty()}).required().noUnknownFields(),Qn=function(e){var n=e.logger;return new Promise((function(e,t){if(m(window.adobe)&&m(window.adobe.optIn)){var r=window.adobe.optIn;n.info("Delaying request while waiting for legacy opt-in to let Visitor retrieve ECID from server."),r.fetchPermissions((function(){r.isApproved([r.Categories.ECID])?(n.info("Received legacy opt-in approval to let Visitor retrieve ECID from server."),e()):t(new Error("Legacy opt-in was declined."))}),!0)}else e()}))},Xn=function(e){var n=e.logger,t=e.orgId,r=e.awaitVisitorOptIn;return function(){var e=function(e){var n=e.Visitor;return T(n)&&T(n.getInstance)&&n}(window);return e?r({logger:n}).then((function(){return n.info("Delaying request while using Visitor to retrieve ECID from server."),new Promise((function(r){e.getInstance(t,{}).getMarketingCloudVisitorID((function(e){n.info("Resuming previously delayed request that was waiting for ECID from Visitor."),r(e)}),!0)}))})).catch((function(e){e?n.info(e.message+", retrieving ECID from experience edge"):n.info("An error occurred while obtaining the ECID from Visitor.")})):Promise.resolve()}},$n="ECID",Yn=function(e){e.mergeQuery({identity:{fetch:[$n]}})},Gn=(_n=function(o){var i,a;return(pi(i={},n,/Edge\/([0-9\._]+)/),pi(i,t,/Edg\/([0-9\.]+)/),pi(i,e,/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/),pi(i,"Firefox",/Firefox\/([0-9\.]+)(?:\s|$)/),pi(i,"IE",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/),pi(i,"Safari",/Version\/([0-9\._]+).*Safari/),a=i,function(e){for(var n=Object.keys(a),t=0;t0&&void 0!==arguments[0]?arguments[0]:"/",n=e.length;n>0&&-1!=="/".indexOf(e.charAt(n-1));)n-=1;return e.substring(0,n)||"/"},It=function(e){return""+e.surfaceType+ht+e.authority+(e.path||"")+(e.fragment||"")},Dt=function(e){var n=e(),t=n.host.toLowerCase(),r=n.pathname;return"web://"+t+Et(r)},Rt=function(e,n,t){var r=function(e){return t.warn(e),null};if(!ve(e))return r("Invalid surface: "+e);var i,a,c,u,s=function(e,n){return F(e,"#")?Dt(n)+e:e}(e,n),d=(u=s.match(yt))?{surfaceType:(c=u[1],ve(c)?c.toLowerCase():""),authority:(a=u[2],ve(a)?a.toLowerCase():""),path:(i=u[3],ve(i)?Et(i):"/"),fragment:u[4]}:null;return null===d?r("Invalid surface: "+e):o([mt,"webapp"],d.surfaceType)?d.authority&&wt.test(d.authority)?d.path&&!bt.test(d.path)?r("Invalid path "+d.path+" in surface: "+e):d.fragment&&!Ct.test(d.fragment)?r("Invalid fragment "+d.fragment+" in surface: "+e):d:r("Invalid authority "+d.authority+" in surface: "+e):r("Unsupported surface type "+d.surfaceType+" in surface: "+e)},St="__view__",kt="https://ns.adobe.com/personalization/default-content-item",Ot="https://ns.adobe.com/personalization/dom-action",Pt="https://ns.adobe.com/personalization/html-content-item",qt="https://ns.adobe.com/personalization/redirect-item",xt=function(e){return e.filter((function(n,t){return e.indexOf(n)===t}))},Mt=function(e){var n=e.getPageLocation,t=e.renderDecisions,r=e.decisionScopes,i=e.personalization,a=e.event,c=e.viewCache,u=e.logger,s=a.getViewName();return{isRenderDecisions:function(){return t},getViewName:function(){return s},hasScopes:function(){return r.length>0||N(i.decisionScopes)},hasSurfaces:function(){return N(i.surfaces)},hasViewName:function(){return ve(s)},createQueryDetails:function(){var e=mi(r);N(i.decisionScopes)&&e.push.apply(e,mi(i.decisionScopes));var t=function(){var e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((function(t){return Rt(t,e,n)})).filter((function(e){return!v(e)})).map(It)}(i.surfaces,n,u);this.isCacheInitialized()||(function(e){o(e,St)||e.push(St)}(e),function(e,n){var t=Dt(n);o(e,t)||e.push(t)}(t,n));var a=[kt,Pt,"https://ns.adobe.com/personalization/json-content-item",qt];return o(e,St)&&a.push(Ot),{schemas:a,decisionScopes:xt(e),surfaces:xt(t)}},isCacheInitialized:function(){return c.isInitialized()},shouldFetchData:function(){return this.hasScopes()||this.hasSurfaces()||!this.isCacheInitialized()},shouldUseCachedData:function(){return this.hasViewName()&&this.isCacheInitialized()}}},At={propositions:[]},Tt=function(e){var n=e.getPageLocation,t=e.logger,r=e.fetchDataHandler,o=e.viewChangeHandler,i=e.onClickHandler,a=e.isAuthoringModeEnabled,c=e.mergeQuery,u=e.viewCache,s=e.showContainers,d=e.applyPropositions,f=e.setTargetMigration;return{lifecycle:{onBeforeRequest:function(e){var n=e.request;return f(n),Promise.resolve()},onBeforeEvent:function(e){var i=e.event,d=e.renderDecisions,f=e.decisionScopes,l=void 0===f?[]:f,p=e.personalization,g=void 0===p?{}:p,v=e.onResponse,m=void 0===v?me:v,h=e.onRequestFailure,y=void 0===h?me:h;if(m((function(){return{propositions:[]}})),y((function(){return s()})),a())return t.warn("Rendering is disabled for authoring mode."),void c(i,{enabled:!1});var w=Mt({getPageLocation:n,renderDecisions:d,decisionScopes:l,personalization:g,event:i,viewCache:u,logger:t});if(w.shouldFetchData()){var b=I();return u.storeViews(b.promise),y((function(){return b.reject()})),void r({decisionsDeferred:b,personalizationDetails:w,event:i,onResponse:m})}return w.shouldUseCachedData()?o({personalizationDetails:w,event:i,onResponse:m,onRequestFailure:y}):void 0},onClick:function(e){var n=e.event,t=e.clickedElement;i({event:n,clickedElement:t})}},commands:{applyPropositions:{optionsValidator:function(e){return function(e){var n=e.logger,t=e.options,r=pn({propositions:un(pn(cn())).nonEmpty(),metadata:pn(cn())}).required();try{return r(t)}catch(e){return n.warn("Invalid options for applyPropositions. No propositions will be applied.",e),At}}({logger:t,options:e})},run:d}}}},Nt=function(e){return k("DIV",{},{innerHTML:e})},jt=si((function(e,n){var t;t=l,e.exports=function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var n=function(e){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var n,t=String(e),r=t.length,o=-1,i="",a=t.charCodeAt(0);++o=1&&n<=31||127==n||0==o&&n>=48&&n<=57||1==o&&n>=48&&n<=57&&45==a?"\\"+n.toString(16)+" ":0==o&&1==r&&45==n||!(n>=128||45==n||95==n||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122)?"\\"+t.charAt(o):t.charAt(o):i+="�";return i};return e.CSS||(e.CSS={}),e.CSS.escape=n,n}(t)})),Ut=/:eq\((\d+)\)/g,Bt=function(e){return-1===e.indexOf(":eq(")},Ft=/(#|\.)(-?\w+)/g,_t=function(e,n,t){return""+n+jt(t)},Ht=function(e){for(var n=[],t=function(e){return e.split(Ut).filter(ve)}(function(e){return e.replace(Ft,_t)}(e.trim())),r=t.length,o=0;of-1)break;if(a1&&void 0!==arguments[1]?arguments[1]:document;return n.getElementById(e)},zt=function(e,n,t){e.setAttribute(n,t)},Jt=function(e,n){return e.getAttribute(n)},Wt=function(e){return e.parentNode},Qt=function(e,n){if(e){var t=Wt(e);t&&t.insertBefore(n,function(e){return e.nextElementSibling}(e))}},Xt=function(e,n){if(e){var t=Wt(e);t&&t.insertBefore(n,e)}},$t=function(e){var n=e.childNodes;return n?j(n):[]},Yt=function(e){return e.firstElementChild},Gt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;if(void 0===vt){var n=e.querySelector("[nonce]");vt=n&&(n.nonce||n.getAttribute("nonce"))}return vt},Kt="alloy-prehiding",Zt={},er=function(e){var n=Zt[e];n&&(ee(n),delete Zt[e])},nr=function(e){if(e&&!Vt(Kt)){var n=Gt(),t=fi({id:Kt},n&&{nonce:n}),r=k(x,t,{textContent:e});R(document.head,r)}},tr=function(){var e=Vt(Kt);e&&ee(e)},rr=function(e,n){e.textContent=n},or="src",ir=function(e){return k(q,{src:e})},ar=function(e){z(q,e).forEach((function(e){var n=Jt(e,or);n&&ir(n)}))},cr=function(e){return function(e,n){return e.tagName===n}(e,x)&&!Jt(e,or)},ur=function(e){var n=z(x,e),t=n.length,r=Gt();if(r)for(var o=0;o=0;){var c=r[a],u=Yt(e);u?Xt(u,c):R(e,c),a-=1}return wr(e,o),br(i)},Dr=function(e,n){var t=Nt(n);ur(t);var r=$t(t),o=hr(t),i=yr(t);return ar(t),r.forEach((function(n){Xt(e,n)})),wr(e,o),br(i)},Rr=function(e,n){Dr(e,n),ee(e)},Sr=function(e,n){var t=Nt(n);ur(t);var r=$t(t),o=hr(t),i=yr(t);return ar(t),r.forEach((function(n){Qt(e,n)})),wr(e,o),br(i)},kr=["priority"],Or=function(e,n){var t=n.priority,r=gi(n,kr);Object.keys(r).forEach((function(n){!function(e,n,t,r){var o;o=r?n+":"+t+" !"+r+";":n+":"+t+";",e.style.cssText+=";"+o}(e,n,r[n],t)}))},Pr=function(e,n){Object.keys(n).forEach((function(t){zt(e,t,n[t])}))},qr=function(e,n){e.tagName===q&&(ir(n),function(e,n){e.removeAttribute(n)}(e,or),zt(e,or,n))},xr=function(e,n){var t=n.from,r=n.to,o=function(e){var n=e.children;return n?j(n):[]}(e),i=o[t],a=o[r];i&&a&&(t