(function(){const configurationData={"version":"v2.101.2","featureFlags":[],"status":200,"errorDetail":"","instanceId":"us3","makeAsyncCall":false,"cookie":"87165fc2-5cdc-488e-ae93-c0bb4b00da21","cookieOptions":{"domain":"","path":""},"data":[],"asyncCallVars":[],"vars":{"data":[]}};!function(){"use strict";const e={version:"",status:500,errorDetail:void 0,instanceId:"EWX",sdk:{},sdkObjectName:"",path:"",sign:"",rootElement:document.documentElement,makeAsyncCall:!1,cookie:"",cookieOptions:{},data:[],vars:{data:[]},asyncCallVars:[],featureFlags:[]},t={version:/** {REPLACE_BY: .Version }**/"",status:/** {REPLACE_BY: .Status }**/500,errorDetail:/** {REPLACE_BY: .ErrorDetail }**/void 0,instanceId:/** {REPLACE_BY: .InstanceID }**/"EWX",makeAsyncCall:/** {REPLACE_BY: .MakeAsyncCall }**/!1,cookie:/** {REPLACE_BY: .Cookie }**/"",cookieOptions:/** {REPLACE_BY: .CookieOptionsData }**/{},data:/** {REPLACE_BY: .ModificationsData }**/[],vars:/** {REPLACE_BY: .DataLayerData }**/{data:[]},asyncCallVars:/** {REPLACE_BY: .PageVars }**/[],featureFlags:/** {REPLACE_BY: .FeatureFlags }**/[]};function n(e,t,n=void 0){const i=(r=/[\[\]\.]/,t.split(r).filter(Boolean).reduce(((e,t)=>null!=e?e[t]:e),e));var r;return void 0===i?n:i}function i(e){return!Object.entries(e||{}).length&&!(null==e?void 0:e.length)&&!(null==e?void 0:e.size)}function r(e){return"function"==typeof e}function o(e,t){for(const n in e)e.hasOwnProperty(n)&&t(e[n],n,e);return e}function s(e){const t=[];for(const n of e)Array.isArray(n)?t.push(...n):t.push(n);return t}function a(e,t="<@OBJECT_NAME@>"){const n=window[t];if(!n)throw new Error("SDK object not found in window");const i=`cspFn_${"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})).replace(/-/g,"_")}`,o=`window.${t}.${i} = function() {${e}};`,s=document.createElement("script");s.id=i,s.type="text/javascript",s.textContent=o;try{document.head.appendChild(s);const e=n[i];if(!r(e))throw new SyntaxError;return e}finally{delete n[i],s.remove()}}class c{static get window(){return window}static get document(){return document}}const u="_webxp_";function l(e,t){c.window.location.search.match(/[?&]exponea_debug(&|=|$)/)&&(console.log(function(e){return"WebXP ["+(new Date).toUTCString()+"] "+e}(e)),void 0!==t&&console.log(t))}const d=()=>{},p=(e,t,n)=>()=>{t?n():(e.removeAttribute("style"),queueMicrotask((()=>(e=>{""===e.getAttribute("style")&&e.removeAttribute("style")})(e))))};function h(e){return null!==(t=e)&&"object"==typeof t&&r(e.remove);var t}function f(e,t){try{return e.matches(t)}catch(e){return!1}}function m(e){const t=e.element;try{const n=document.querySelectorAll(t);return 0===n.length&&("remove"===e.type&&l("The selector matched no elements, ignoring the remove modification",t),"run"!==e.type&&"banner"!==e.type||l("The selector matched no elements but still applying "+e.type+" modification",t)),n}catch(n){return"run"===e.type||"banner"===e.type?l("Invalid selector but still applying the "+e.type+" modification",t):l("Invalid selector of the "+e.type+" modification",t),[]}}function g(e){const t=document.createElement("div");t.innerHTML=e;const n=document.createDocumentFragment();for(;t.firstChild;)n.appendChild(t.firstChild);return n}function v(e){const t=[];for(let n=0;n<e.childNodes.length;n++)t.push(e.childNodes[n]);return t}function y(e,t){return function(e){const t=[];let n=e.parentElement,i=0;for(;n&&i<1e3;)t.push(n),n=n.parentElement,i++;return t}(e).some((e=>{var n;return!0===(null===(n=t.applied)||void 0===n?void 0:n.get(e))}))||function(e){const t=[],n=e.parentNode;if(!n)return t;const i=n.childNodes;for(let n=0;n<i.length;n++)i[n]!==e&&i[n].nodeType===Node.ELEMENT_NODE&&t.push(i[n]);return t}(e).some((e=>{var n;return!0===(null===(n=t.applied)||void 0===n?void 0:n.get(e))}))}function b(e,t){const n="before"===t||"after"===t?e.parentElement:e;let i=null;if(n)switch(t){case"before":i=e;break;case"after":i=e.nextSibling;break;case"prepend_child":i=e.firstChild;break;default:i=null}return{parentElement:n,nodeBefore:i}}function x(e,t){"length"in e||(e=[e]),[].forEach.call(e,(function(e){1===e.nodeType&&t(e)}))}function w(e){return u+e}const _=u+"list";function E(e,t){x(e,(e=>{e[_]||(e[_]=[]),-1===e[_].indexOf(t)&&e[_].push(t)}))}function S(e,t){x(e,(e=>{if(!e[_])return;const n=e[_].indexOf(t);-1!==n&&e[_].splice(n,1)}))}function O(e,t){return e[_]&&-1!==e[_].indexOf(t)}function k(e){"loading"!==document.readyState?e({}):document.addEventListener("DOMContentLoaded",e)}function I(){return!!document.getElementById("exponea-experiments-editor")}function R(e,t,n,i,r,o){const s={};if(s.inPreview=I(),s.sdk=n,s.data=s.params=t,o)s.element=o,s.elements=[o];else{const t=m(e);t&&t.length>0?(s.element=t[0],s.elements=[].slice.call(t)):(s.element=null,s.elements=[])}s.selector=e.element;const c="parametrized_parts"in e?e.parametrized_parts.script:e.script;let u;return u=r?a(c,i).bind(s):new Function(c).bind(s),u.context=s,u}function $(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}function j(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function N(e,t,n,i){return new(n||(n=Promise))((function(t,r){function o(e){try{a(i.next(e))}catch(e){r(e)}}function s(e){try{a(i.throw(e))}catch(e){r(e)}}function a(e){e.done?t(e.value):new n((function(t){t(e.value)})).then(o,s)}a((i=i.apply(e,[])).next())}))}class C{constructor(){this.subscribers=new Map,this.numberOfEvents=0}subscribe(e,t){var n;const i=null!==(n=this.subscribers.get(e))&&void 0!==n?n:new Map,r=++this.numberOfEvents;return i.set(r,t),this.subscribers.set(e,i),{unsubscribe:()=>i.delete(r)}}publish(e,t){var n;const i=null!==(n=this.subscribers.get(e))&&void 0!==n?n:new Map;for(const[,e]of i)e(t)}}function T(e){e.parentNode?e.parentNode.removeChild(e):l("Cannot remove an inserted element because its original parent is missing.")}function A(e,t,n){t?t.insertBefore(e,n):l("Cannot re-insert a removed element because its original parent is missing.")}function L(e,t,n,i,r){try{const o=R(e,t,n,i,r);e.parametrized_parts?(o.context.html=e.parametrized_parts.html,o.context.style=e.parametrized_parts.style):(o.context.html=e.html,o.context.style=e.style);const s=o();return h(s)?s.remove.bind(s):d}catch(e){return l("The banner modification script threw an error",e),d}}function D(e,t){if(t.html&&!O(e,t)){const n=g(t.parametrized_parts?t.parametrized_parts.html:t.html),{parentElement:i}=b(e,"before");if(i){const r=v(n);return E(n.childNodes,t),i.insertBefore(n,e),i.removeChild(e),P.bind(window,e,i,r)}}return d}function P(e,t,n){t?(A(e,t,n[0]),n.forEach(T)):l("Cannot re-insert a removed element because its original parent is missing.")}function M(e,t){const n=e.innerHTML;return t.text&&!O(e,t)?(e.innerText=t.text,E(e,t),q.bind(window,e,n,t)):d}function q(e,t,n){S(e,n),e.innerHTML=t}function F(e){const t=[],n=m(e);if(n.length>0&&e.place_to){const i=function(e){let t;try{t=document.querySelector(e)}catch(t){return l("Invalid selector, ignoring the add modification",e),!1}return t||(l("No element matched the selector, ignoring the modification",e),null)}(e.place_to.element);if(i){const{parentElement:r,nodeBefore:o}=b(i,e.place_to.placement);r&&[].forEach.call(n,(function(n){O(n,e)||(t.push(B.bind(window,n,n.parentElement,n.nextSibling,e)),r.insertBefore(n,o),E(n,e))}))}}return t}function B(e,t,n,i){t?(S(e,i),A(e,t,n)):l("Cannot move back element because its original parent is missing.")}function V(e,t){if(!t.attributes)return d;const n={};return o(t.attributes,((t,i)=>{var r;n[i]=e.getAttribute(i),function(e,t){return w(t)in e&&!0===e[w(t)]}(e,"alreadySetAttribute_"+i)||("src"!==i&&"srcset"!==i||e.setAttribute(i,""),e.setAttribute(i,t),r="alreadySetAttribute_"+i,x(e,(e=>{e[w(r)]=!0})))})),U.bind(window,e,n,t)}function U(e,t,n){n.attributes&&o(n.attributes,((i,r)=>{if(n.attributes&&e.getAttribute(r)===n.attributes[r]){const n=t[r];null==n?e.removeAttribute(r):e.setAttribute(r,n)}else l("Attribute `"+r+"` was not reverted because it changed value in meantime.");var o;o="alreadySetAttribute_"+r,x(e,(e=>{delete e[w(o)]}))}))}function K(e,t){if("change"!==t.type)return;const n=f(e,t.element),r=!!t.place_to&&f(e,t.place_to.element),s=[];return(n||r)&&(t.html&&s.push(D(e,t)),t.text&&s.push(M(e,t)),t.place_to&&s.push(...F(t)),t.attributes&&!i(t.attributes)&&s.push(V(e,t)),t.style&&n&&s.push(function(e,t){var n;const i=e.hasAttribute("style"),r=null!==(n=e.getAttribute("style"))&&void 0!==n?n:"";return t.style?(o(t.style,((t,n)=>{e.style.setProperty(n,t,"important")})),p(e,i,(()=>{e.setAttribute("style",r)}))):d}(e,t)),0!==s.length)?1===s.length?s[0]:s:void 0}function z(e,t,n){if("remove"===t.type&&f(e,t.element))return"remove"===t.method?function(e){let t=d;return e.parentElement&&(t=A.bind(window,e,e.parentElement,e.nextElementSibling),e.parentElement.removeChild(e)),t}(e):"visibility"!==t.method&&"display"!==t.method||!n?void 0:function(e,t){const n=e.hasAttribute("style");if("visibility"===t.method||"display"===t.method){const i="display"===t.method?"display":"visibility",r="display"===t.method?"none":"hidden",o=e.style[i];return e.style[i]=r,p(e,n,(()=>{e.style[i]=o}))}return d}(e,t)}function H(e,t,n,i,o,s){try{if(s&&O(s,e))return d;const a=R(e,t,n,i,o,s)();return s&&E(s,e),()=>{s&&S(s,e),r(a)?a():h(a)&&a.remove.call(a)}}catch(e){return l("The run modification script threw an error",e),d}}function W(e,t,n,i,r,o,s=!1){const a=s?["repeatedly_once_per_element"]:["repeatedly_once_per_element","once_per_element"];if("run"===t.type&&t.execute&&a.includes(t.execute)&&f(e,t.element))return H(t,n,i,r,o,e)}function Q(e){let t=[],n=`/* Experiment: ${e.params.experiment_name} (id: ${e.params.experiment_id}) */`,i=`/* Variant: ${e.params.variant_name} (id: ${e.params.variant_id}) */`;if(e.modifications.forEach((function(e){const r=[];if("change"===e.type&&e.style)for(const t in e.style)e.style.hasOwnProperty(t)&&r.push("\t"+t+": "+e.style[t]+" !important;");else"remove"!==e.type||"display"!==e.method&&"visibility"!==e.method||r.push("\t"+e.method+": "+("display"===e.method?"none":"hidden")+" !important;");r.length>0&&("change"===e.type||"remove"===e.type)&&(n&&(t.push(n),n=""),i&&(t.push(i),i=""),t=[...t,e.element+" {",...r,"}"])})),t.length>0){const e=document.createElement("style");return e.type="text/css",e.innerHTML=t.join("\n"),document.getElementsByTagName("head")[0].appendChild(e),T.bind(window,e)}return d}class J extends Error{constructor(){super(...arguments),this.name="BrIntegrationError"}}function X(e){return("0"+e.toString(16)).slice(-2)}function G(e,t=window){if(e%2)throw new Error("The length of the random string should be an even number!");const n=t.crypto||t.msCrypto;if(n&&n.getRandomValues&&Array.from){const t=new Uint8Array(e/2);return n.getRandomValues(t),Array.from(t,X).join("")}let i="";for(let t=0;t<e/2;t++)i+=X(Math.round(256*Math.random()));return i}class Y{constructor(e,t,n=Math,i=window.navigator){this.debug=e,this.config=t,this.math=n,this.navigator=i,this._target="//sdk-tracing.exponea.com/webxp-trace/record/browser/v1"}reportError(e,t){const n=this;return function(){const i=Date.now();try{return e(...arguments)}catch(r){const o=t||e.name||"transientOperation";throw n.sendErrorReport(r,o,i),r}}}sendErrorReport(e,t,n=Date.now(),i={},r=.01){if(e instanceof J)return;if(this.math.random()>r)return;const o=this.serialize(e,t,n,i);this.debug.log("Sending error report",o),this.navigator.sendBeacon(this._target,JSON.stringify(o))}serialize(e,t,n,i={}){let r;return r=e instanceof Error?e:new Error(String(e)),{id:G(32),instance_id:this.config.instanceId,sdk_version:this.config.version,company_id:this.config.companyId,spans:[{id:G(16),start_time:n/1e3,duration:(Date.now()-n)/1e3,operation:t,error:{message:r.message,name:r.name,stack:r.stack||""},tags:Object.assign({url:location.href.split(/[?#]/)[0],host:location.hostname},i)}]}}}var Z;!function(e){e.isDataLayerVariable=function(e){return"data_layer"===e.variable.type},e.isQueryParameterVariable=function(e){return"query"===e.variable.type},e.isJavaScriptVariable=function(e){return"global_variable"===e.variable.type},e.isCustomFunction=function(e){return"custom_function"===e.variable.type}}(Z||(Z={}));var ee;function te(e,t){return e.data.find((e=>e.id===t))}function ne(e,t){const n=function(e){const t={};return new URL(e).searchParams.forEach(((e,n)=>{t[n]=decodeURIComponent(e)})),t}(t);if(0===Object.keys(n).length)return;const i=e.variable.query.key;if(!i)return;return n[i]}function ie(e,t){let i;if(e)return Z.isDataLayerVariable(e)?i=function(e,t){const i=t.dataLayer;if(!i)return;const r=e.variable.data_layer.name;if(r)for(let e=i.length-1;e>=0;e--){const t=n(i[e],r,void 0);if(t)return t}}(e,t):Z.isQueryParameterVariable(e)?i=ne(e,t.location.href):Z.isJavaScriptVariable(e)?i=function(e,t){const i=e.variable.global_variable.name;if(!i)return;const r=n(t,i,void 0);return r||void 0}(e,t):Z.isCustomFunction(e)&&(i=function(e){const t=e.variable.custom_function.body;if(!t)return;let n,i;try{n=new Function(t)}catch(e){return}try{i=n()}catch(e){return}return i}(e)),i}function re(e,t=window,n){if(!n)return;if(!(null==e?void 0:e.length))return;const r={};return e.forEach((e=>{const i=e.id,o=te(n,i);if(!o)return;const s=ie(o,t);void 0!==s&&(r[i]=s)})),i(r)?void 0:r}!function(e){e.matches=function(e,t,n,i){return!i||i.every((i=>{let r;if(!n)return!1;try{const o=i.attribute.id,s=te(n,o);if(!s)return!1;r=ie(s,e);const a={};return void 0!==r&&(a[o]=r),t(a,o,i.constraint)}catch(e){return!1}}))}}(ee||(ee={}));class oe{constructor(){this.revertObjects=[]}add({fn:e,experimentId:t,trigger:n}){"function"==typeof e?this.revertObjects.push({fn:e,experimentId:t,trigger:n}):this.revertObjects=[...this.revertObjects,...e.map((e=>({fn:e,experimentId:t,trigger:n})))]}revert(){for(let e=this.revertObjects.length-1;e>=0;e--)try{this.revertObjects[e].fn()}catch(e){l("Error from revert experiment script",e)}this.revertObjects=[]}revertExperiment(e){this.revertRelevant((t=>t.experimentId===e))}revertAllByTrigger(e){this.revertRelevant((t=>t.trigger===e))}revertRelevant(e){var t;this.revertObjects.filter(e).map((e=>e.fn)).forEach((e=>{try{e()}catch(e){l("Error from revert experiment script",e)}})),this.revertObjects=this.revertObjects.filter((t=e,e=>!t(e)))}}function se(e,t,n){return N(this,0,void 0,(function*(){let i,r;l(`${(null==n?void 0:n.method)||"GET"} ${t} (payload: ${null==n?void 0:n.body})`);try{i=yield e.fetch(t,n)}catch(e){throw l(`Error ${(null==n?void 0:n.method)||"GET"} to ${t}.`,e),e}if(!(null==i?void 0:i.ok))throw l(`Error: Received ${null==i?void 0:i.status} from ${t}`),new Error(`Received ${null==i?void 0:i.status} from ${t}`);try{r=yield i.json()}catch(e){throw l(`Error: Unable to create JSON from ${t}`),e}return r}))}const ae=console,ce={log:ae.log,warn:ae.warn,debug:ae.debug,error:ae.error};class ue{static isSupported(){if(void 0!==this.cachedIsSupported)return this.cachedIsSupported;try{const e="__storage_test_sample__";return this.getStorage().setItem(e,e),this.getStorage().removeItem(e),this.cachedIsSupported=!0,!0}catch(e){return this.cachedIsSupported=!1,!1}}static getItem(e){return this.isSupported()?this.getStorage().getItem(e):null}static setItem(e,t){this.isSupported()&&this.getStorage().setItem(e,t)}static removeItem(e){this.isSupported()&&this.getStorage().removeItem(e)}static getStorage(){return window.localStorage}}ue.cachedIsSupported=void 0;class le{static getLastShow(e,t){const n=ue.getItem(this.getLastShowKey(e,t));return n?parseInt(n,10):null}static setLastShow(e,t){const n=""+Date.now();ue.setItem(this.getLastShowKey(e,t),n)}static getLastSessionStart(e){const t=ue.getItem(this.getLastSessionStartKey(e));return t?parseInt(t,10):null}static getLastShowKey(e,t){return this.getEventKeyPrefix(t)+e+"_last_show"}static getEventKeyPrefix(e){return this.getPrefix(e)+"_experiment_event__"}static getLastSessionStartKey(e){return this.getPrefix(e)+"_last_session_start_timestamp__"}static getPrefix(e){let t=e.replace(/^_/,"");return"infinario"===t&&(t="inf"),"brweb"===t&&(t="exponea"),"__"+t}}var de,pe,he,fe;function me(e){return function(n,i,r){try{const o=r.type,s=r.operator,a=r.operands;if(de.whitelist.indexOf(s)>-1)return function(e,t,n,i){const r=e[n];switch(i){case de.isSet:return null!=r;case de.isNotSet:return null==r;case de.hasValue:return ge(t)?(null==r?void 0:r.length)>0:r+""!="";case de.hasNoValue:return ge(t)?0===(null==r?void 0:r.length):r+""==""}return!1}(n,o,i,s);if(function(e){return"string"===e}(o))return function(e,n,i,r){if(-1===pe.whitelist.indexOf(i))return t(i,"string"),!1;const o=e[n]+"";let s;switch(i){case pe.equals:return o===r[0].value;case pe.doesNotEqual:return o!==r[0].value;case pe.isIn:return s=r.map((e=>e.value)),s.indexOf(o)>-1;case pe.isNotIn:return s=r.map((e=>e.value)),-1===s.indexOf(o);case pe.contains:return o.indexOf(r[0].value)>-1;case pe.doesNotContain:return-1===o.indexOf(r[0].value);case pe.startsWith:return o.startsWith(r[0].value);case pe.endsWith:return o.endsWith(r[0].value);case pe.matchesRegex:return null!==new RegExp(r[0].value).exec(o)}return!1}(n,i,s,a);if(function(e){return"number"===e}(o))return function(e,n,i,r){if(-1===he.whitelist.indexOf(i))return t(i,"number"),!1;const o=parseFloat(e[n]+""),s=parseFloat(r[0].value);switch(i){case he.equalTo:return o===s;case he.inBetween:return s<=o&&o<=parseFloat(r[1].value);case he.lessThan:return o<s;case he.greaterThan:return o>s}return!1}(n,i,s,a);if(function(e){return"boolean"===e}(o))return function(e,n,i,r){if(-1===fe.whitelist.indexOf(i))return t(i,"boolean"),!1;const o=e[n]+"",s=r.value+"";if(i===fe.is)return o===s;return!1}(n,i,s,r);(function(e){return"date"===e})(o)&&e.error("Value filter: Date type is not supported."),ge(o)&&e.error("Value filter: List type is not supported.")}catch(t){e.debug("Value filter error:",t)}return e.debug("Invalid value filter:",r.operator),!1};function t(t,n){e.error("Contextual Bandits: operation "+t+" not suported for type "+n+".")}}function ge(e){return"list"===e}function ve(e){return function(t){var n;return ye(t.params.experiment_id,t.frequency,e.sdkObjectName)&&function(e,t,n,i,r){if(!t||I())return!0;const o=e.experiment_id;try{const s=function(e,t,n,i,r){const o={};o.inPreview=I(),o.sdk=t,o.data=o.params=e;let s,c=i;return c.length>0&&c.indexOf("\n")<0&&c.indexOf(";")<0&&c.indexOf("return")<0&&(c="return "+c),s=r?a(c,n).bind(o):new Function(c).bind(o),s.context=o,s}(e,n,i,t,r);return s()||l(`Experiment ${o} was filtered out because of custom condition  ${t}.`),!!s()}catch(e){return l(`Custom condition for experiment ${o} threw an error`,e),!1}}(t.params,t.custom_condition,e.sdk,e.sdkObjectName,e.cspScriptIntegration)&&be(null===(n=t.variables_target)||void 0===n?void 0:n.conditions,e.vars)}}function ye(e,t,n){if(I())return!0;const i=le.getLastShow(e,n),r=le.getLastSessionStart(n);if(!ue.isSupported()&&("only_once"===t||"once_per_visit"===t))return l(`Can't apply experiment ${e} due to missing browser local storage support.`),!1;switch(t){case"only_once":return i&&l(`Experiment ${e} was filtered out because of its frequency only_once.`),!i;case"once_per_visit":return i&&r&&i>=r&&l(`Experiment ${e} was filtered out because of its frequency once_per_visit.`),!i||!r||i<r;default:return!0}}function be(e,t){const n=me(ce);return ee.matches(window,n,t,e)}function xe(e){return void 0!==e.streamId}function we(e){return void 0===e.streamId}!function(e){e.isSet="is set",e.isNotSet="is not set",e.hasValue="has value",e.hasNoValue="has no value",e.whitelist=[e.isSet,e.isNotSet,e.hasValue,e.hasNoValue]}(de||(de={})),function(e){e.equals="equals",e.doesNotEqual="does not equal",e.isIn="in",e.isNotIn="not in",e.contains="contains",e.doesNotContain="does not contain",e.startsWith="starts with",e.endsWith="ends with",e.matchesRegex="regex",e.whitelist=[e.equals,e.doesNotEqual,e.isIn,e.isNotIn,e.contains,e.doesNotContain,e.startsWith,e.endsWith,e.matchesRegex]}(pe||(pe={})),function(e){e.equalTo="equal to",e.inBetween="in between",e.lessThan="less than",e.greaterThan="greater than",e.whitelist=[e.equalTo,e.inBetween,e.lessThan,e.greaterThan]}(he||(he={})),function(e){e.is="is",e.whitelist=[e.is]}(fe||(fe={}));class _e{static matches(e,t){return!t.enabled||!(t.from_date&&t.from_date>e)&&!(t.to_date&&t.to_date<e)}}var Ee={exports:{}};Ee.exports=Re;var Se=Ee.exports.isMobile=Re;Ee.exports.default=Re;const Oe=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,ke=/CrOS/,Ie=/android|ipad|playbook|silk/i;function Re(e){e||(e={});let t=e.ua;if(t||"undefined"==typeof navigator||(t=navigator.userAgent),t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]),"string"!=typeof t)return!1;let n=Oe.test(t)&&!ke.test(t)||!!e.tablet&&Ie.test(t);return!n&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==t.indexOf("Macintosh")&&-1!==t.indexOf("Safari")&&(n=!0),n}class $e{static matches(e,t){if(!e)return!0;const n=Se({ua:t,tablet:!0,featureDetect:!0});return"mobile"===e.type?n:"desktop"!==e.type||!n}}class je{static matches(e,t){if("page"in t)return this.matchesURLFilter(e,t.page);if(t.exclude_pages)for(const n of t.exclude_pages)if(this.matchesURLFilter(e,n))return!1;if(t.include_pages)for(const n of t.include_pages)if(this.matchesURLFilter(e,n))return!0;return!1}static parseURL(e){const t={source:e};let n;const i=/^(.{1,5}?):\/\//;(n=i.exec(e))&&(t.protocol=n[1],e=e.replace(i,"")),e.startsWith("//")&&(e=e.substr(2));const r=/(.*?)(\/|$)/;if(n=r.exec(e)){const i=n[1].split(":");""!==i[0]&&(t.host=i[0]),i.length>1&&(t.port=i[1]),e=e.replace(r,"/")}const o=/(.*?)(\?|$|#)/;(n=o.exec(e))&&(t.path=n[1],e=e.replace(o,n[2]));const s=/^\?(.*?)($|#)/;(n=s.exec(e))&&(t.query=n[1],e=e.replace(s,n[2]));if((n=/^#(.*)/.exec(e))&&(t.hash=n[1]),t.withoutHost=t.path,t.query&&(t.withoutHost+=`?${t.query}`),t.hash&&(t.withoutHost+=`#${t.hash}`),t.host){const e=t.port?`:${t.port}`:"";t.withoutProtocol=`//${t.host}${e}${t.withoutHost}`}return t}static escapeRegex(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}static wildcardToRegex(e){const t=("^"+this.escapeRegex(e)+"$").replace(new RegExp("\\\\\\*","g"),".*");return new RegExp(t)}static matchesExactURL(e,t){const n=this.parseURL(e),i=this.parseURL(t);return!(i.host||!i.withoutHost||!n.withoutHost||!n.withoutHost.match(this.wildcardToRegex(i.withoutHost)))||(!(i.protocol||!i.withoutProtocol||!n.withoutProtocol||!n.withoutProtocol.match(this.wildcardToRegex(i.withoutProtocol)))||!!n.source.match(this.wildcardToRegex(i.source)))}static matchesContainsURL(e,t){return e.includes(t)}static matchesRegexURL(e,t){try{const n=new RegExp(t);if(e.match(n))return!0;const i=this.parseURL(e);return!(!i.withoutProtocol||!i.withoutProtocol.match(n))||!(!i.withoutHost||!i.withoutHost.match(n))}catch(e){if(e instanceof Error)return!1;throw e}}static matchesURLFilter(e,t){return"any"===t.type||("exact"===t.type?this.matchesExactURL(e,t.url):"contains"===t.type?this.matchesContainsURL(e,t.url):"regex"===t.type&&this.matchesRegexURL(e,t.regex))}}function Ne(e,t,n,i){try{return(e=>je.matches(n.href,e.trigger))(e)&&(e=>_e.matches((new Date).valueOf()/1e3,e.date_filter))(e)&&(e=>$e.matches(e.device_target,i))(e)&&(e=>ye(e._id,e.frequency,t.sdkObjectName))(e)&&(e=>{var n;return be(null===(n=e.variables_target)||void 0===n?void 0:n.conditions,t.vars)})(e)}catch(e){return!1}}function Ce(e){return"run"===e.type&&("repeatedly"===e.execute||"repeatedly_once_per_element"===e.execute)}function Te(e,t,n,i,r){let o=[];const s=[];return setInterval((()=>{o=o.filter((e=>!e.toBeInvalidated))}),15e3),function(a,c,u){var d,p,h;return N(this,0,void 0,(function*(){const f=yield n;if(!f.length)return[];const m=null===(h=null===(p=null===(d=a.sdk)||void 0===d?void 0:d.configuration)||void 0===p?void 0:p.customer)||void 0===h?void 0:h.cookie;m&&(a.cookie=m,we(a)&&(a.sign=a.sign.split("/")[0]+"/"+a.cookie));const g=e=>t=>t.id===e;return f.forEach((n=>{if(!function(e,t,n){var i,r,o;const s=null===(i=null==e?void 0:e.trigger_event)||void 0===i?void 0:i.type;if(s!==t)return!1;if("datalayer_event"===s){const t=null==n?void 0:n.event;return(null===(o=null===(r=null==e?void 0:e.trigger_event)||void 0===r?void 0:r[s])||void 0===o?void 0:o.event)===t}return!1}(n,c,u))return;if(!Ne(n,a,e,t))return r(n._id),void(o.find(g(n._id))&&(o=function(e,t){const[n,i]=(r=e,o=e=>e.id===t,r.reduce(((e,t)=>(e[o(t)?0:1].push(t),e)),[[],[]]));var r,o;return n.forEach((e=>e.cancel())),i}(o,n._id)));const d=s.includes(n._id);if(o.find(g(n._id))&&!d)return;const p=function(e,t,n,i){var r,o;l(`Loading experiment ${e}`);let s,[a,c]=["",""];xe(n)?c=n.cookie:[a,c]=null!==(o=null===(r=n.sign)||void 0===r?void 0:r.split("/"))&&void 0!==o?o:["",""],s=xe(n)?`${n.path}/webxp/streams/${n.streamId}/experiments/show`:`${n.path}/campaigns/experiments/show`;const u=new AbortController,d=u.signal,p=(()=>N(this,0,void 0,(function*(){var r;let o={};if(null==t?void 0:t.length){const e=i(t,window,n.vars);e&&(o={page_vars:e})}const u=yield se(window,s,{method:"POST",body:JSON.stringify(Object.assign(Object.assign(Object.assign({},xe(n)?{}:{company_id:a}),{customer_ids:{cookie:c},personalisation_ids:[e]}),o)),signal:d});if(0===(null===(r=null==u?void 0:u.data)||void 0===r?void 0:r.length)&&(null==u?void 0:u.success))return u.data[0];if(!(null==u?void 0:u.data)||1!==u.data.length)throw new Error(`Received unexpected response data from ${s}`);return u.data[0]})))();return{id:e,cancel:()=>u.abort(),promise:p,toBeInvalidated:!1}}(n._id,n.page_vars,a,re);o.push(p),p.promise.then((e=>{e?(p.toBeInvalidated=!1,i(e,d),e.modifications.some(Ce)&&!s.includes(e.params.experiment_id)&&s.push(e.params.experiment_id)):p.toBeInvalidated=!0})).catch(l)})),o}))}}function Ae(e,t){const n={};function i(e){return e.params.experiment_id+"_"+e.params.variant_id}e.forEach((e=>{n[i(e)]=e})),t.forEach((t=>{const r=i(t);n[r]?n[r].modifications=[...n[r].modifications,...t.modifications]:e.push(t)}))}class Le{start(){}stop(){}}class De{constructor(e,t){this.isObserving=!1,this.config={childList:!0,subtree:!0,attributes:!0,characterData:!1},this.target=e,this.observer=new MutationObserver(this.observerHandler.bind(this)),this.observerCallback=t}start(){this.isObserving||(this.observer.observe(this.target,this.config),this.isObserving=!0)}stop(){this.isObserving&&(this.observer.disconnect(),this.isObserving=!1)}observerHandler(){this.observerCallback();const e=this.observer.takeRecords();this.stop(),e.length&&this.observerCallback(),this.start()}}function Pe(){return function(e,t,n){const i=n.value,r=Date.now(),o=i.name;return n.value=function(){try{return i.apply(this,arguments)}catch(e){throw this.reporter.sendErrorReport(e,o,r),e}},n}}class Me extends Error{constructor(e){super(e),this.name="SdkNotFoundOnWindowError"}}function qe(e,t){e.forEach((e=>t(e)))}function Fe(e,t,n="dataLayer"){t[n]=t[n]||[];!function(e,t,n=!0){if(!Array.isArray(e))return;const i=e.push;if(e.push=(...n)=>{const r=i.apply(e,n);try{qe(n,t)}catch(e){}return r},n)try{e.forEach((e=>qe([e],t)))}catch(e){}}(t[n],e)}var Be,Ve;!function(e){e.triggerTypes=["page_load","datalayer_event","manual"]}(Be||(Be={}));class Ue{constructor(e){this.config=e}get instanceId(){return this.config.instanceId}get companyId(){var e,t;let n;try{n=xe(this.config)?this.config.streamId:null!==(t=null===(e=this.config.sign)||void 0===e?void 0:e.split("/")[0])&&void 0!==t?t:""}catch(e){n="00000000-0000-0000-0000-000000000000"}return n}get version(){return this.config.version}}class Ke{constructor(e){var t;this.config=e,this.pubSub=new C,this.experiments=[],this.alreadyTrackedExperimentsById={};const n={debug(e,...t){l(e,...t)},error(e,...t){l(e+"",...t)},log(e,...t){l(e,...t)},warn(e,...t){l(e,...t)}};this.config.cspScriptIntegration=function(e){var t,n;if(!e)return!1;const i=null!==(t=null==e?void 0:e._)&&void 0!==t?t:[];if(!Array.isArray(i))return!1;const r=i.find((e=>"_initializeConfig"===(null==e?void 0:e[0])));if(!r)return!1;const o=null===(n=null==r?void 0:r[1])||void 0===n?void 0:n[0];return!0===(null==o?void 0:o.csp_script_integration)}(null===(t=this.config)||void 0===t?void 0:t.sdk);const i=new Ue(e);this.reporter=new Y(n,i),this.revertQueue=new oe,this.config.legacyFlickeringMode?this.observer=new Le:this.observer=new De(e.rootElement,(()=>{this.applyExperimentsOnAllElements()})),this.metaDataPromise=function(e){return N(this,0,void 0,(function*(){const t=e.path;let n,i;n=xe(e)?`${t}/webxp/streams/${e.streamId}/bundle`:`${t}/webxp/projects/${e.sign.split("/")[0]}/bundle`;try{i=yield se(window,n)}catch(e){}let r=[];return(null==i?void 0:i.experiments)&&(r=i.experiments),r}))}(this.config);const r=Te(location,window.navigator.userAgent,this.metaDataPromise,((e,t)=>this.startExperiment(e,t)),(e=>this.stopExperiment(e)));this.pubSub.subscribe("datalayer_event",(e=>r(this.config,"datalayer_event",e)));Fe((e=>{e&&"object"==typeof e&&"event"in e&&(l("DataLayer event triggered",e),this.pubSub.publish("datalayer_event",e))}),window)}init(e=!1,t="page_load"){var n;if(!this.config.sdk||0===Object.keys(this.config.sdk).length)throw new Me("SDK not found in WebxpClient config");if(200!==this.config.status&&l("Web modifications ended up with status "+this.config.status),!this.config.skipExperiments)return l("Experiments was not applied by non-flickering script because skipExperiments=false"),void this.revealPage();we(this.config)&&this.config.cookie&&(this.config.sign=(null===(n=this.config.sign)||void 0===n?void 0:n.split("/")[0])+"/"+this.config.cookie),this.config.sdk.initialize(!1),this.applyExperiments(this.config.data,!0),this.loadRemainingDataIfNeeded(e,t),this.revealPage()}applyModifications(e){return this.config.legacyFlickeringMode||this.revert(),this.config.data=[e],this.experiments=[],this.config.status=200,this.applyExperiments(this.config.data,!1),()=>{this.revert()}}reset(e){var t,n;const i=e=>"datalayer_event"===e.trigger_type;this.observer.stop(),this.revertQueue.revertAllByTrigger("page_load"),this.experiments=this.experiments.filter(i),this.config.data=this.config.data.filter(i),this.config.cookie=(null===(n=null===(t=this.getSDK().configuration)||void 0===t?void 0:t.customer)||void 0===n?void 0:n.cookie)||"",e&&Be.triggerTypes.includes(e)||(e="manual"),this.init(!0,e)}revert(){this.observer.stop(),this.revertQueue.revert(),this.experiments=[]}applyModificationOnElement(e,t,n,i=!1){if(i)this.enqueueRevertFunction(W(e,t,n.params,this.getSDK(),this.config.sdkObjectName,this.config.cspScriptIntegration,!0),n);else switch(t.type){case"add":this.enqueueRevertFunction(function(e,t){var n;if("add"!==t.type||!t.place_to||!f(e,t.place_to.element))return d;const i="add_modification",r=t.parametrized_parts?t.parametrized_parts.html:t.html;if(t.applied||(t.applied=new Map),!0===t.applied.get(e)||O(e,i)&&y(e,t))return d;const o=g(r),{parentElement:s,nodeBefore:a}=b(e,t.place_to.placement);if(!s)return d;const c=v(o);return E(o.childNodes,i),null===(n=null==t?void 0:t.applied)||void 0===n||n.set(e,!0),s.insertBefore(o,a),()=>{var n;c.forEach((e=>T(e))),null===(n=t.applied)||void 0===n||n.set(e,!1)}}(e,t),n);break;case"change":this.enqueueRevertFunction(K(e,t),n);break;case"run":this.enqueueRevertFunction(W(e,t,n.params,this.getSDK(),this.config.sdkObjectName,this.config.cspScriptIntegration,!1),n);break;case"remove":this.enqueueRevertFunction(z(e,t,!!this.config.legacyFlickeringMode),n)}}applyExperiments(e,t,n=!1){const i=JSON.parse(JSON.stringify(e)),r=t&&!n?i.filter(ve(this.config)):i;this.observer.stop(),l("Applying experiments ...",r),this.trackExperiments(r,n),this.applyOneTimeModifications(r,n),n||this.applyOnDocumentReadyModifications(r),Ae(this.experiments,r),this.observer.start(),this.applyExperimentsOnAllElements(n)}applyOneTimeModifications(e,t){e.forEach((e=>{const n=e.params.experiment_id;t||this.revertQueue.add({fn:Q(e),experimentId:n,trigger:e.trigger_type}),e.modifications.forEach((i=>{"run"!==i.type||("immediately"!==i.execute||t)&&"repeatedly"!==i.execute||this.revertQueue.add({fn:H(i,e.params,this.getSDK(),this.config.sdkObjectName,this.config.cspScriptIntegration),experimentId:n,trigger:e.trigger_type})}))}))}applyOnDocumentReadyModifications(e){k((()=>{e.forEach((e=>{const t=e.params.experiment_id;e.modifications.forEach((n=>{"run"!==n.type||n.execute&&"document_ready"!==n.execute?"banner"===n.type&&this.revertQueue.add({fn:L(n,e.params,this.getSDK(),this.config.sdkObjectName,this.config.cspScriptIntegration),experimentId:t,trigger:e.trigger_type}):this.revertQueue.add({fn:H(n,e.params,this.getSDK(),this.config.sdkObjectName,this.config.cspScriptIntegration),experimentId:t,trigger:e.trigger_type})}))}))}))}getSDK(){if(I())return function(){let e=!1;return{initialize(){},track(){},trackLink(){},identify(){},update(){},anonymize(){},_revealPage(){},configuration:{},notifications:{isAvailable:e=>(e(!0),!0),isSubscribed:t=>(t(e,!1),e),subscribe(t){setTimeout((()=>{e=!0,t("subscribed")}),500)},unsubscribe(t){setTimeout((()=>{e=!1,t("unsubscribed")}),500)}}}}();const e=window[this.config.sdkObjectName];if(!e||0===Object.keys(e).length)throw new Me("SDK not found on window for object name: "+this.config.sdkObjectName);return e}trackExperiments(e,t=!1){e.forEach((e=>{I()||(le.setLastShow(e.params.experiment_id,this.config.sdkObjectName),(!this.alreadyTrackedExperimentsById[e.params.experiment_id]||e.modifications.some(Ce)&&t)&&(this.getSDK().track("experiment",{action:"show",experiment_id:e.params.experiment_id,experiment_name:e.params.experiment_name,variant_id:e.params.variant_id,variant_name:e.params.variant_name,location:window.location.href,path:window.location.pathname}),this.alreadyTrackedExperimentsById[e.params.experiment_id]=!0))}))}loadRemainingDataIfNeeded(e=!1,t){return N(this,0,void 0,(function*(){if(!xe(this.config)||this.config.cookie){if(e||this.config.makeAsyncCall||200!==this.config.status){const n=200===this.config.status;let i;i=xe(this.config)?`${this.config.path}/webxp/streams/${this.config.streamId}/data/modifications/${this.config.cookie}/v1`:`${this.config.path}/webxp/data/modifications/${this.config.sign}/v1`;let r=`${i}?http-referer=${encodeURIComponent(location.href)}`,o=!1;!e&&n||(r+="&allModifications=true",o=!0),r+=`&trigger=${t}`;let a=this.config.asyncCallVars;const c=e=>!!e.page_vars;if(e||!n){a=s((yield this.metaDataPromise).filter(c).map((e=>e.page_vars)))}let u,d;if(null==a?void 0:a.length){const e=re(a,window,this.config.vars);if(e){const t={page_vars:e};let n;try{n=JSON.stringify(t)}catch(t){l(`Error serializing ${e} to json.`,t)}t&&(u={method:"POST",headers:{"Content-Type":"application/json"},body:n})}}try{d=yield se(window,r,u)}catch(e){}return this.processResponse(d,o)}}else l("Skipping modifications request — no cookie available for BRX stream")}))}startExperiment(e,t){this.isExperimentRunning(e.params.experiment_id)&&!t||(l(`Starting experiment ${e.params.experiment_id}`),this.applyExperiments([e],!0,t))}enqueueRevertFunction(e,t){e&&this.revertQueue.add({fn:e,experimentId:t.params.experiment_id,trigger:t.trigger_type})}applyExperimentsOnAllElements(e=!1){for(const t of this.experiments)for(const n of t.modifications){const i=He(ze(n));for(const r of i)this.applyModificationOnElement(r,n,t,e)}}isExperimentRunning(e){return this.experiments.some((t=e,e=>e.params.experiment_id===t));var t}stopExperiment(e){this.isExperimentRunning(e)&&(l(`Stopping experiment ${e}`),this.revertQueue.revertExperiment(e),this.experiments=this.experiments.filter((t=>t.params.experiment_id!==e)))}revealPage(){const e=this.getSDK();e._revealPage&&"function"==typeof e._revealPage&&e._revealPage()}processResponse(e,t=!1){e&&e.data&&(l(`Adding new experiments data, ${e.data}, to current data.`),Ae(this.config.data,e.data),t&&(this.config.vars=e.vars),l("Applying new experiments data ..."),this.applyExperiments(e.data,!0))}}function ze(e){const t=[],n=e=>{"string"==typeof e&&t.push(e)};return n(e.element),e.place_to&&n(e.place_to.element),t}function He(e){return s(e.map((e=>Array.from(document.querySelectorAll(e))))).filter((e=>e instanceof HTMLElement))}let We;$([Pe(),j("design:type",Function),j("design:paramtypes",[Boolean,String]),j("design:returntype",void 0)],Ke.prototype,"init",null),$([Pe(),j("design:type",Function),j("design:paramtypes",[Object]),j("design:returntype",Function)],Ke.prototype,"applyModifications",null),$([Pe(),j("design:type",Function),j("design:paramtypes",[String]),j("design:returntype",void 0)],Ke.prototype,"reset",null),$([Pe(),j("design:type",Function),j("design:paramtypes",[]),j("design:returntype",void 0)],Ke.prototype,"revert",null);try{configurationData,We=!0}catch(e){We=!1}const Qe="webxpClient",Je="webxpClientInitialConfig";let Xe;(null===(Ve=window[Qe])||void 0===Ve?void 0:Ve.reset)||(window[Je]=window[Qe]),Xe=We?Object.assign(Object.assign(Object.assign({},e),configurationData),window[Je]):Object.assign(Object.assign(Object.assign({},e),t),window[Je]);const Ge=new Ke(Xe);if(window[Qe]={init:Ge.init.bind(Ge),revert:Ge.revert.bind(Ge),applyModifications:Ge.applyModifications.bind(Ge),config:Ge.config,skipExperiments:Xe.skipExperiments,reset:Ge.reset.bind(Ge)},Ge.config.legacyFlickeringMode&&function(){if(!function(){try{const e="___storage_test__";return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch(e){return!1}}())return!1;try{return!!window.sessionStorage.getItem("exponea-editor-params")}catch(e){return!1}}()){const e=Ge.config.sdk;e._revealPage&&"function"==typeof e._revealPage&&e._revealPage()}else Ge.init()}();
})()