(function () {
  'use strict';

  function getElementClasses(t){if(!t.classList)return [];var e=[];return t.classList.forEach((function(t){return e.push(t)})),e}function getElementShelf(t,e){var r=e.getAttribute(t);if(null===r)throw new Error('expected attribute "'.concat(t,'" of ').concat(e," to be a valid shelf: attribute is not set"));var n=JSON.parse(r);if("object"!=typeof n)throw new Error('expected attribute "'.concat(t,'" of ').concat(e,' to be a valid shelf: got "').concat(r,'" instead'));var o=n.shn;if(!o||"string"!=typeof o)throw new Error('expected attribute "'.concat(t,'" of ').concat(e," to be a valid shelf: shn is not valid shelf name"));var a=n.sht;if(!a||"string"!=typeof a)throw new Error('expected attribute "'.concat(t,'" of ').concat(e," to be a valid shelf. sht is not a valid shelf type"));var i=n.p;if(!i||"object"!=typeof i)throw new Error('expected attribute "'.concat(t,'" of ').concat(e," to be a valid shelf. p is not a valid property container"));return {shn:o,sht:a,p:i}}var TrackedElements=function(){function t(t,e,r){this.query=t,this.markerAttribute=e,this.onDiscover=r;}return t.prototype.refresh=function(){var t=this;document.querySelectorAll(this.query).forEach((function(e){null===e.getAttribute(t.markerAttribute)&&(t.onDiscover(e),e.setAttribute(t.markerAttribute,"1"));}));},t}();

  var SEPARATOR=" ",FLAG_TRACK_PAGEVIEW="pv",FLAG_GENERATE_PAGEVIEW_ID="pvid",FLAG_ENABLE_LINK_TRACKING="a",FLAG_ENABLE_ELEMENT_CLICK_TRACKING="ec",FLAG_ENABLE_ELEMENT_ACTIVE_VIEW_TRACKING="av";function getFeatureFlags(_){if(!_)return {track_pageview:!0,generate_page_view_id:!0,enable_link_tracking:!0,enable_element_click_tracking:!0,enable_active_view_tracking:!0};var e=_.split(SEPARATOR).filter((function(_){return !!_})).map((function(_){return _.trim()}));return {track_pageview:e.some((function(_){return _===FLAG_TRACK_PAGEVIEW})),generate_page_view_id:e.some((function(_){return _===FLAG_GENERATE_PAGEVIEW_ID})),enable_link_tracking:e.some((function(_){return _===FLAG_ENABLE_LINK_TRACKING})),enable_element_click_tracking:e.some((function(_){return _===FLAG_ENABLE_ELEMENT_CLICK_TRACKING})),enable_active_view_tracking:e.some((function(_){return _===FLAG_ENABLE_ELEMENT_ACTIVE_VIEW_TRACKING}))}}

  /******************************************************************************
   Copyright (c) Microsoft Corporation.

   Permission to use, copy, modify, and/or distribute this software for any
   purpose with or without fee is hereby granted.

   THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
   REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
   AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
   INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
   LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
   PERFORMANCE OF THIS SOFTWARE.
   ***************************************************************************** */

  var __assign = function() {
    __assign = Object.assign || function __assign(t) {
      for (var s, i = 1, n = arguments.length; i < n; i++) {
        s = arguments[i];
        for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
      }
      return t;
    };
    return __assign.apply(this, arguments);
  };

  function __values(o) {
    var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
    if (m) return m.call(o);
    if (o && typeof o.length === "number") return {
      next: function () {
        if (o && i >= o.length) o = void 0;
        return { value: o && o[i++], done: !o };
      }
    };
    throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
  }

  function __read(o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
      while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
      try {
        if (r && !r.done && (m = i["return"])) m.call(i);
      }
      finally { if (e) throw e.error; }
    }
    return ar;
  }

  function __spreadArray(to, from, pack) {
    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
      if (ar || !(i in from)) {
        if (!ar) ar = Array.prototype.slice.call(from, 0, i);
        ar[i] = from[i];
      }
    }
    return to.concat(ar || Array.prototype.slice.call(from));
  }

  var rngBrowser$1 = {exports: {}};

  var getRandomValues$2="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(getRandomValues$2){var rnds8$2=new Uint8Array(16);rngBrowser$1.exports=function(){return getRandomValues$2(rnds8$2),rnds8$2};}else {var rnds$1=new Array(16);rngBrowser$1.exports=function(){for(var r,o=0;o<16;o++)0==(3&o)&&(r=4294967296*Math.random()),rnds$1[o]=r>>>((3&o)<<3)&255;return rnds$1};}

  for(var byteToHex$2=[],i$1=0;i$1<256;++i$1)byteToHex$2[i$1]=(i$1+256).toString(16).substr(1);function bytesToUuid$5(o,e){var t=e||0,r=byteToHex$2;return [r[o[t++]],r[o[t++]],r[o[t++]],r[o[t++]],"-",r[o[t++]],r[o[t++]],"-",r[o[t++]],r[o[t++]],"-",r[o[t++]],r[o[t++]],"-",r[o[t++]],r[o[t++]],r[o[t++]],r[o[t++]],r[o[t++]],r[o[t++]]].join("")}var bytesToUuid_1$1=bytesToUuid$5;

  var _nodeId$1,_clockseq$1,rng$4=rngBrowser$1.exports,bytesToUuid$4=bytesToUuid_1$1,_lastMSecs$1=0,_lastNSecs$1=0;function v1$3(e,o,s){var r=o&&s||0,c=o||[],l=(e=e||{}).node||_nodeId$1,a=void 0!==e.clockseq?e.clockseq:_clockseq$1;if(null==l||null==a){var d=rng$4();null==l&&(l=_nodeId$1=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==a&&(a=_clockseq$1=16383&(d[6]<<8|d[7]));}var n=void 0!==e.msecs?e.msecs:(new Date).getTime(),t=void 0!==e.nsecs?e.nsecs:_lastNSecs$1+1,i=n-_lastMSecs$1+(t-_lastNSecs$1)/1e4;if(i<0&&void 0===e.clockseq&&(a=a+1&16383),(i<0||n>_lastMSecs$1)&&void 0===e.nsecs&&(t=0),t>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");_lastMSecs$1=n,_lastNSecs$1=t,_clockseq$1=a;var m=(1e4*(268435455&(n+=122192928e5))+t)%4294967296;c[r++]=m>>>24&255,c[r++]=m>>>16&255,c[r++]=m>>>8&255,c[r++]=255&m;var u=n/4294967296*1e4&268435455;c[r++]=u>>>8&255,c[r++]=255&u,c[r++]=u>>>24&15|16,c[r++]=u>>>16&255,c[r++]=a>>>8|128,c[r++]=255&a;for(var _=0;_<6;++_)c[r+_]=l[_];return o||bytesToUuid$4(c)}var v1_1$1=v1$3;

  var rng$3=rngBrowser$1.exports,bytesToUuid$3=bytesToUuid_1$1;function v4$4(r,o,e){var s=o&&e||0;"string"==typeof r&&(o="binary"===r?new Array(16):null,r=null);var n=(r=r||{}).random||(r.rng||rng$3)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,o)for(var a=0;a<16;++a)o[s+a]=n[a];return o||bytesToUuid$3(n)}var v4_1$1=v4$4;

  var v1$2=v1_1$1,v4$3=v4_1$1,uuid$1=v4$3;uuid$1.v1=v1$2,uuid$1.v4=v4$3;var uuid_1$1=uuid$1;

  /*!
   * Core functionality for Snowplow JavaScript trackers v3.5.0 (http://bit.ly/sp-js)
   * Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang
   * Licensed under BSD-3-Clause
   */
  var version$1="3.5.0";function base64urldecode(e){if(!e)return e;switch(4-e.length%4){case 2:e+="==";break;case 3:e+="=";}return base64decode(e.replace(/-/g,"+").replace(/_/g,"/"))}function base64urlencode(e){return e?base64encode(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"):e}var b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function base64encode(e){var n,t,r,o,i,a=0,s=0,c=[];if(!e)return e;e=unescape(encodeURIComponent(e));do{n=(i=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,t=i>>12&63,r=i>>6&63,o=63&i,c[s++]=b64.charAt(n)+b64.charAt(t)+b64.charAt(r)+b64.charAt(o);}while(a<e.length);var l=c.join(""),u=e.length%3;return (u?l.slice(0,u-3):l)+"===".slice(u||3)}function base64decode(e){var n,t,r,o,i,a,s,c=0,l=0,u="",d=[];if(!e)return e;e+="";do{n=(a=b64.indexOf(e.charAt(c++))<<18|b64.indexOf(e.charAt(c++))<<12|(o=b64.indexOf(e.charAt(c++)))<<6|(i=b64.indexOf(e.charAt(c++))))>>16&255,t=a>>8&255,r=255&a,d[l++]=64===o?String.fromCharCode(n):64===i?String.fromCharCode(n,t):String.fromCharCode(n,t,r);}while(c<e.length);return u=d.join(""),s=u.replace(/\0+$/,""),decodeURIComponent(s.split("").map((function(e){return "%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))}function payloadBuilder(){var e,n={},t=[],r=[],o=[],i=function(e,t){null!=t&&""!==t&&(n[e]=t);};return {add:i,addDict:function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&i(n,e[n]);},addJson:function(e,n,o){if(o&&isNonEmptyJson(o)){var i={keyIfEncoded:e,keyIfNotEncoded:n,json:o};r.push(i),t.push(i);}},addContextEntity:function(e){o.push(e);},getPayload:function(){return n},getJson:function(){return t},withJsonProcessor:function(n){e=n;},build:function(){return null==e||e(this,r,o),n}}}function payloadJsonProcessor(e){return function(n,t,r){for(var o=function(t,r,o){var i=JSON.stringify(t);e?n.add(r,base64urlencode(i)):n.add(o,i);},i=function(t,r){var o=t||function(){var t=n.getPayload();if(e?t.cx:t.co)return JSON.parse(e?base64urldecode(t.cx):t.co)}();return o?o.data=o.data.concat(r.data):o=r,o},a=void 0,s=0,c=t;s<c.length;s++){var l=c[s];"cx"===l.keyIfEncoded?a=i(a,l.json):o(l.json,l.keyIfEncoded,l.keyIfNotEncoded);}(t.length=0,r.length)&&(a=i(a,{schema:"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",data:__spreadArray([],r,!0)}),r.length=0);a&&o(a,"cx","co");}}function isNonEmptyJson(e){if(!isJson(e))return !1;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))return !0;return !1}function isJson(e){return null!=e&&(e.constructor==={}.constructor||e.constructor===[].constructor)}var LOG_LEVEL,label="Snowplow: ";!function(e){e[e.none=0]="none",e[e.error=1]="error",e[e.warn=2]="warn",e[e.debug=3]="debug",e[e.info=4]="info";}(LOG_LEVEL||(LOG_LEVEL={}));var LOG=logger();function logger(e){return void 0===e&&(e=LOG_LEVEL.warn),{setLogLevel:function(n){e=LOG_LEVEL[n]?n:LOG_LEVEL.warn;},warn:function(n,t){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];if(e>=LOG_LEVEL.warn&&"undefined"!=typeof console){var i=label+n;t?console.warn.apply(console,__spreadArray([i+"\n",t],r,!1)):console.warn.apply(console,__spreadArray([i],r,!1));}},error:function(n,t){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];if(e>=LOG_LEVEL.error&&"undefined"!=typeof console){var i=label+n+"\n";t?console.error.apply(console,__spreadArray([i+"\n",t],r,!1)):console.error.apply(console,__spreadArray([i],r,!1));}},debug:function(n){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];e>=LOG_LEVEL.debug&&"undefined"!=typeof console&&console.debug.apply(console,__spreadArray([label+n],t,!1));},info:function(n){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];e>=LOG_LEVEL.info&&"undefined"!=typeof console&&console.info.apply(console,__spreadArray([label+n],t,!1));}}}function globalContexts(){var e=[],n=[];return {getGlobalPrimitives:function(){return e},getConditionalProviders:function(){return n},addGlobalContexts:function(t){for(var r=[],o=[],i=0,a=t;i<a.length;i++){var s=a[i];isConditionalContextProvider(s)?r.push(s):isContextPrimitive(s)&&o.push(s);}e=e.concat(o),n=n.concat(r);},clearGlobalContexts:function(){n=[],e=[];},removeGlobalContexts:function(t){for(var r=function(t){isConditionalContextProvider(t)?n=n.filter((function(e){return JSON.stringify(e)!==JSON.stringify(t)})):isContextPrimitive(t)&&(e=e.filter((function(e){return JSON.stringify(e)!==JSON.stringify(t)})));},o=0,i=t;o<i.length;o++){r(i[o]);}},getApplicableContexts:function(t){return function(t){var r=getUsefulSchema(t),o=getEventType(t),i=[],a=generatePrimitives(e,t,o,r);i.push.apply(i,a);var s=generateConditionals(n,t,o,r);return i.push.apply(i,s),i}(t)}}}function pluginContexts(e){return {addPluginContexts:function(n){var t=n?__spreadArray([],n,!0):[];return e.forEach((function(e){try{e.contexts&&t.push.apply(t,e.contexts());}catch(e){LOG.error("Error adding plugin contexts",e);}})),t}}}function resolveDynamicContext(e){for(var n,t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return null!==(n=null==e?void 0:e.map((function(e){if("function"!=typeof e)return e;try{return e.apply(void 0,t)}catch(e){return}})).filter(Boolean))&&void 0!==n?n:[]}function getSchemaParts(e){var n=new RegExp("^iglu:([a-zA-Z0-9-_.]+)/([a-zA-Z0-9-_]+)/jsonschema/([1-9][0-9]*)-(0|[1-9][0-9]*)-(0|[1-9][0-9]*)$").exec(e);if(null!==n)return n.slice(1,6)}function validateVendorParts(e){if("*"===e[0]||"*"===e[1])return !1;if(e.slice(2).length>0){for(var n=!1,t=0,r=e.slice(2);t<r.length;t++){if("*"===r[t])n=!0;else if(n)return !1}return !0}return 2==e.length}function validateVendor(e){var n=e.split(".");return !!(n&&n.length>1)&&validateVendorParts(n)}function getRuleParts(e){var n=new RegExp("^iglu:((?:(?:[a-zA-Z0-9-_]+|\\*).)+(?:[a-zA-Z0-9-_]+|\\*))/([a-zA-Z0-9-_.]+|\\*)/jsonschema/([1-9][0-9]*|\\*)-(0|[1-9][0-9]*|\\*)-(0|[1-9][0-9]*|\\*)$").exec(e);if(null!==n&&validateVendor(n[1]))return n.slice(1,6)}function isValidRule(e){var n=getRuleParts(e);if(n){var t=n[0];return 5===n.length&&validateVendor(t)}return !1}function isStringArray(e){return Array.isArray(e)&&e.every((function(e){return "string"==typeof e}))}function isValidRuleSetArg(e){return isStringArray(e)?e.every((function(e){return isValidRule(e)})):"string"==typeof e&&isValidRule(e)}function isSelfDescribingJson(e){var n=e;return !!(isNonEmptyJson(n)&&"schema"in n&&"data"in n)&&("string"==typeof n.schema&&"object"==typeof n.data)}function isRuleSet(e){var n=e,t=0;if(null!=e&&"object"==typeof e&&!Array.isArray(e)){if(Object.prototype.hasOwnProperty.call(n,"accept")){if(!isValidRuleSetArg(n.accept))return !1;t+=1;}if(Object.prototype.hasOwnProperty.call(n,"reject")){if(!isValidRuleSetArg(n.reject))return !1;t+=1;}return t>0&&t<=2}return !1}function isContextCallbackFunction(e){return "function"==typeof e&&e.length<=1}function isContextPrimitive(e){return isContextCallbackFunction(e)||isSelfDescribingJson(e)}function isFilterProvider(e){return !(!Array.isArray(e)||2!==e.length)&&(Array.isArray(e[1])?isContextCallbackFunction(e[0])&&e[1].every(isContextPrimitive):isContextCallbackFunction(e[0])&&isContextPrimitive(e[1]))}function isRuleSetProvider(e){return !(!Array.isArray(e)||2!==e.length)&&(!!isRuleSet(e[0])&&(Array.isArray(e[1])?e[1].every(isContextPrimitive):isContextPrimitive(e[1])))}function isConditionalContextProvider(e){return isFilterProvider(e)||isRuleSetProvider(e)}function matchSchemaAgainstRuleSet(e,n){var t=0,r=0,o=e.accept;Array.isArray(o)?e.accept.some((function(e){return matchSchemaAgainstRule(e,n)}))&&r++:"string"==typeof o&&matchSchemaAgainstRule(o,n)&&r++;var i=e.reject;return Array.isArray(i)?e.reject.some((function(e){return matchSchemaAgainstRule(e,n)}))&&t++:"string"==typeof i&&matchSchemaAgainstRule(i,n)&&t++,r>0&&0===t}function matchSchemaAgainstRule(e,n){if(!isValidRule(e))return !1;var t=getRuleParts(e),r=getSchemaParts(n);if(t&&r){if(!matchVendor(t[0],r[0]))return !1;for(var o=1;o<5;o++)if(!matchPart(t[o],r[o]))return !1;return !0}return !1}function matchVendor(e,n){var t=n.split("."),r=e.split(".");if(t&&r){if(t.length!==r.length)return !1;for(var o=0;o<r.length;o++)if(!matchPart(t[o],r[o]))return !1;return !0}return !1}function matchPart(e,n){return e&&n&&"*"===e||e===n}function getUsefulSchema(e){for(var n=0,t=e.getJson();n<t.length;n++){var r=t[n];if("ue_px"===r.keyIfEncoded&&"object"==typeof r.json.data){var o=r.json.data.schema;if("string"==typeof o)return o}}return ""}function getEventType(e){var n=e.getPayload().e;return "string"==typeof n?n:""}function buildGenerator(e,n,t,r){var o=void 0;try{return o=e({event:n.getPayload(),eventType:t,eventSchema:r}),Array.isArray(o)&&o.every(isSelfDescribingJson)||isSelfDescribingJson(o)?o:void 0}catch(e){o=void 0;}return o}function normalizeToArray(e){return Array.isArray(e)?e:Array.of(e)}function generatePrimitives(e,n,t,r){var o,i=normalizeToArray(e).map((function(e){var o=evaluatePrimitive(e,n,t,r);if(o&&0!==o.length)return o}));return (o=[]).concat.apply(o,i.filter((function(e){return null!=e&&e.filter(Boolean)})))}function evaluatePrimitive(e,n,t,r){if(isSelfDescribingJson(e))return [e];if(isContextCallbackFunction(e)){var o=buildGenerator(e,n,t,r);if(isSelfDescribingJson(o))return [o];if(Array.isArray(o))return o}}function evaluateProvider(e,n,t,r){if(isFilterProvider(e)){var o=e[0],i=!1;try{i=o({event:n.getPayload(),eventType:t,eventSchema:r});}catch(e){i=!1;}if(!0===i)return generatePrimitives(e[1],n,t,r)}else if(isRuleSetProvider(e)&&matchSchemaAgainstRuleSet(e[0],r))return generatePrimitives(e[1],n,t,r);return []}function generateConditionals(e,n,t,r){var o,i=normalizeToArray(e).map((function(e){var o=evaluateProvider(e,n,t,r);if(o&&0!==o.length)return o}));return (o=[]).concat.apply(o,i.filter((function(e){return null!=e&&e.filter(Boolean)})))}function getTimestamp(e){return null==e?{type:"dtm",value:(new Date).getTime()}:"number"==typeof e?{type:"dtm",value:e}:"ttm"===e.type?{type:"ttm",value:e.value}:{type:"dtm",value:e.value||(new Date).getTime()}}function trackerCore(e){void 0===e&&(e={});var n=e.base64,t=e.corePlugins,r=e.callback,o=null!=t?t:[],i=function(e,n,t){var r=pluginContexts(n),o=globalContexts(),i=e,a={};function s(e,n){a[e]=n;}var c={track:function(e,s,c){e.withJsonProcessor(payloadJsonProcessor(i)),e.add("eid",uuid_1$1.v4()),e.addDict(a);var l=getTimestamp(c);e.add(l.type,l.value.toString());var u=function(e,n){var t=o.getApplicableContexts(e),r=[];return n&&n.length&&r.push.apply(r,n),t&&t.length&&r.push.apply(r,t),r}(e,r.addPluginContexts(s)),d=function(e){if(e&&e.length)return {schema:"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",data:e}}(u);void 0!==d&&e.addJson("cx","co",d),n.forEach((function(n){try{n.beforeTrack&&n.beforeTrack(e);}catch(e){LOG.error("Plugin beforeTrack",e);}})),"function"==typeof t&&t(e);var f=e.build();return n.forEach((function(e){try{e.afterTrack&&e.afterTrack(f);}catch(e){LOG.error("Plugin afterTrack",e);}})),f},addPayloadPair:s,getBase64Encoding:function(){return i},setBase64Encoding:function(e){i=e;},addPayloadDict:function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(a[n]=e[n]);},resetPayloadPairs:function(e){a=isJson(e)?e:{};},setTrackerVersion:function(e){s("tv",e);},setTrackerNamespace:function(e){s("tna",e);},setAppId:function(e){s("aid",e);},setPlatform:function(e){s("p",e);},setUserId:function(e){s("uid",e);},setScreenResolution:function(e,n){s("res",e+"x"+n);},setViewport:function(e,n){s("vp",e+"x"+n);},setColorDepth:function(e){s("cd",e);},setTimezone:function(e){s("tz",e);},setLang:function(e){s("lang",e);},setIpAddress:function(e){s("ip",e);},setUseragent:function(e){s("ua",e);},addGlobalContexts:function(e){o.addGlobalContexts(e);},clearGlobalContexts:function(){o.clearGlobalContexts();},removeGlobalContexts:function(e){o.removeGlobalContexts(e);}};return c}(null==n||n,o,r),a=__assign(__assign({},i),{addPlugin:function(e){var n,t,r=e.plugin;o.push(r),null===(n=r.logger)||void 0===n||n.call(r,LOG),null===(t=r.activateCorePlugin)||void 0===t||t.call(r,a);}});return null==o||o.forEach((function(e){var n,t;null===(n=e.logger)||void 0===n||n.call(e,LOG),null===(t=e.activateCorePlugin)||void 0===t||t.call(e,a);})),a}function buildSelfDescribingEvent(e){var n=e.event,t=n.schema,r=n.data,o=payloadBuilder(),i={schema:"iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0",data:{schema:t,data:r}};return o.add("e","ue"),o.addJson("ue_px","ue_pr",i),o}function buildPageView(e){var n=e.pageUrl,t=e.pageTitle,r=e.referrer,o=payloadBuilder();return o.add("e","pv"),o.add("url",n),o.add("page",t),o.add("refr",r),o}function buildPagePing(e){var n=e.pageUrl,t=e.pageTitle,r=e.referrer,o=e.minXOffset,i=e.maxXOffset,a=e.minYOffset,s=e.maxYOffset,c=payloadBuilder();return c.add("e","pp"),c.add("url",n),c.add("page",t),c.add("refr",r),o&&!isNaN(Number(o))&&c.add("pp_mix",o.toString()),i&&!isNaN(Number(i))&&c.add("pp_max",i.toString()),a&&!isNaN(Number(a))&&c.add("pp_miy",a.toString()),s&&!isNaN(Number(s))&&c.add("pp_may",s.toString()),c}function buildLinkClick(e){return buildSelfDescribingEvent({event:{schema:"iglu:com.snowplowanalytics.snowplow/link_click/jsonschema/1-0-1",data:removeEmptyProperties({targetUrl:e.targetUrl,elementId:e.elementId,elementClasses:e.elementClasses,elementTarget:e.elementTarget,elementContent:e.elementContent})}})}function removeEmptyProperties(e,n){void 0===n&&(n={});var t={};for(var r in e)(n[r]||null!==e[r]&&void 0!==e[r])&&(t[r]=e[r]);return t}var version=version$1;

  var global$1 = "undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};

  var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,inited=!1;function init$1(){inited=!0;for(var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=o.length;r<e;++r)lookup[r]=o[r],revLookup[o.charCodeAt(r)]=r;revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;}function toByteArray(o){var r,e,t,u,n,p;inited||init$1();var i=o.length;if(i%4>0)throw new Error("Invalid string. Length must be a multiple of 4");n="="===o[i-2]?2:"="===o[i-1]?1:0,p=new Arr(3*i/4-n),t=n>0?i-4:i;var a=0;for(r=0,e=0;r<t;r+=4,e+=3)u=revLookup[o.charCodeAt(r)]<<18|revLookup[o.charCodeAt(r+1)]<<12|revLookup[o.charCodeAt(r+2)]<<6|revLookup[o.charCodeAt(r+3)],p[a++]=u>>16&255,p[a++]=u>>8&255,p[a++]=255&u;return 2===n?(u=revLookup[o.charCodeAt(r)]<<2|revLookup[o.charCodeAt(r+1)]>>4,p[a++]=255&u):1===n&&(u=revLookup[o.charCodeAt(r)]<<10|revLookup[o.charCodeAt(r+1)]<<4|revLookup[o.charCodeAt(r+2)]>>2,p[a++]=u>>8&255,p[a++]=255&u),p}function tripletToBase64(o){return lookup[o>>18&63]+lookup[o>>12&63]+lookup[o>>6&63]+lookup[63&o]}function encodeChunk(o,r,e){for(var t,u=[],n=r;n<e;n+=3)t=(o[n]<<16)+(o[n+1]<<8)+o[n+2],u.push(tripletToBase64(t));return u.join("")}function fromByteArray(o){var r;inited||init$1();for(var e=o.length,t=e%3,u="",n=[],p=16383,i=0,a=e-t;i<a;i+=p)n.push(encodeChunk(o,i,i+p>a?a:i+p));return 1===t?(r=o[e-1],u+=lookup[r>>2],u+=lookup[r<<4&63],u+="=="):2===t&&(r=(o[e-2]<<8)+o[e-1],u+=lookup[r>>10],u+=lookup[r>>4&63],u+=lookup[r<<2&63],u+="="),n.push(u),n.join("")}

  function read(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else {if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=e;}return (s?-1:1)*p*Math.pow(2,M-r)}function write(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,N=i>>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),(o+=p+N>=1?n/f:n*Math.pow(2,1-N))*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l;}

  var toString={}.toString;var isArray = Array.isArray||function(r){return "[object Array]"==toString.call(r)};

  var INSPECT_MAX_BYTES=50;Buffer.TYPED_ARRAY_SUPPORT=void 0===global$1.TYPED_ARRAY_SUPPORT||global$1.TYPED_ARRAY_SUPPORT;kMaxLength();function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(t,e){if(kMaxLength()<e)throw new RangeError("Invalid typed array length");return Buffer.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=Buffer.prototype:(null===t&&(t=new Buffer(e)),t.length=e),t}function Buffer(t,e,r){if(!(Buffer.TYPED_ARRAY_SUPPORT||this instanceof Buffer))return new Buffer(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe(this,t)}return from(this,t,e,r)}function from(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return "undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?fromArrayBuffer(t,e,r,n):"string"==typeof e?fromString(t,e,r):fromObject(t,e)}function assertSize(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function alloc(t,e,r,n){return assertSize(e),e<=0?createBuffer(t,e):void 0!==r?"string"==typeof n?createBuffer(t,e).fill(r,n):createBuffer(t,e).fill(r):createBuffer(t,e)}function allocUnsafe(t,e){if(assertSize(e),t=createBuffer(t,e<0?0:0|checked(e)),!Buffer.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function fromString(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!Buffer.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|byteLength(e,r),f=(t=createBuffer(t,n)).write(e,r);return f!==n&&(t=t.slice(0,f)),t}function fromArrayLike(t,e){var r=e.length<0?0:0|checked(e.length);t=createBuffer(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function fromArrayBuffer(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),Buffer.TYPED_ARRAY_SUPPORT?(t=e).__proto__=Buffer.prototype:t=fromArrayLike(t,e),t}function fromObject(t,e){if(internalIsBuffer(e)){var r=0|checked(e.length);return 0===(t=createBuffer(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return "number"!=typeof e.length||isnan(e.length)?createBuffer(t,0):fromArrayLike(t,e);if("Buffer"===e.type&&isArray(e.data))return fromArrayLike(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(t){if(t>=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|t}Buffer.poolSize=8192,Buffer._augment=function(t){return t.__proto__=Buffer.prototype,t},Buffer.from=function(t,e,r){return from(null,t,e,r)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Buffer[Symbol.species]),Buffer.alloc=function(t,e,r){return alloc(null,t,e,r)},Buffer.allocUnsafe=function(t){return allocUnsafe(null,t)},Buffer.allocUnsafeSlow=function(t){return allocUnsafe(null,t)};function internalIsBuffer(t){return !(null==t||!t._isBuffer)}function byteLength(t,e){if(internalIsBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return utf8ToBytes(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return base64ToBytes(t).length;default:if(n)return utf8ToBytes(t).length;e=(""+e).toLowerCase(),n=!0;}}function slowToString(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return "";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return "";if((r>>>=0)<=(e>>>=0))return "";for(t||(t="utf8");;)switch(t){case"hex":return hexSlice(this,e,r);case"utf8":case"utf-8":return utf8Slice(this,e,r);case"ascii":return asciiSlice(this,e,r);case"latin1":case"binary":return latin1Slice(this,e,r);case"base64":return base64Slice(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0;}}function swap(t,e,r){var n=t[e];t[e]=t[r],t[r]=n;}function bidirectionalIndexOf(t,e,r,n,f){if(0===t.length)return -1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=f?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(f)return -1;r=t.length-1;}else if(r<0){if(!f)return -1;r=0;}if("string"==typeof e&&(e=Buffer.from(e,n)),internalIsBuffer(e))return 0===e.length?-1:arrayIndexOf(t,e,r,n,f);if("number"==typeof e)return e&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?f?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):arrayIndexOf(t,[e],r,n,f);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(t,e,r,n,f){var i,o=1,u=t.length,s=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return -1;o=2,u/=2,s/=2,r/=2;}function a(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(f){var h=-1;for(i=r;i<u;i++)if(a(t,i)===a(e,-1===h?0:i-h)){if(-1===h&&(h=i),i-h+1===s)return h*o}else -1!==h&&(i-=i-h),h=-1;}else for(r+s>u&&(r=u-s),i=r;i>=0;i--){for(var c=!0,l=0;l<s;l++)if(a(t,i+l)!==a(e,l)){c=!1;break}if(c)return i}return -1}function hexWrite(t,e,r,n){r=Number(r)||0;var f=t.length-r;n?(n=Number(n))>f&&(n=f):n=f;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var o=0;o<n;++o){var u=parseInt(e.substr(2*o,2),16);if(isNaN(u))return o;t[r+o]=u;}return o}function utf8Write(t,e,r,n){return blitBuffer(utf8ToBytes(e,t.length-r),t,r,n)}function asciiWrite(t,e,r,n){return blitBuffer(asciiToBytes(e),t,r,n)}function latin1Write(t,e,r,n){return asciiWrite(t,e,r,n)}function base64Write(t,e,r,n){return blitBuffer(base64ToBytes(e),t,r,n)}function ucs2Write(t,e,r,n){return blitBuffer(utf16leToBytes(e,t.length-r),t,r,n)}function base64Slice(t,e,r){return 0===e&&r===t.length?fromByteArray(t):fromByteArray(t.slice(e,r))}function utf8Slice(t,e,r){r=Math.min(t.length,r);for(var n=[],f=e;f<r;){var i,o,u,s,a=t[f],h=null,c=a>239?4:a>223?3:a>191?2:1;if(f+c<=r)switch(c){case 1:a<128&&(h=a);break;case 2:128==(192&(i=t[f+1]))&&(s=(31&a)<<6|63&i)>127&&(h=s);break;case 3:i=t[f+1],o=t[f+2],128==(192&i)&&128==(192&o)&&(s=(15&a)<<12|(63&i)<<6|63&o)>2047&&(s<55296||s>57343)&&(h=s);break;case 4:i=t[f+1],o=t[f+2],u=t[f+3],128==(192&i)&&128==(192&o)&&128==(192&u)&&(s=(15&a)<<18|(63&i)<<12|(63&o)<<6|63&u)>65535&&s<1114112&&(h=s);}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),f+=c;}return decodeCodePointsArray(n)}Buffer.isBuffer=isBuffer,Buffer.compare=function(t,e){if(!internalIsBuffer(t)||!internalIsBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,f=0,i=Math.min(r,n);f<i;++f)if(t[f]!==e[f]){r=t[f],n=e[f];break}return r<n?-1:n<r?1:0},Buffer.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return !0;default:return !1}},Buffer.concat=function(t,e){if(!isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return Buffer.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=Buffer.allocUnsafe(e),f=0;for(r=0;r<t.length;++r){var i=t[r];if(!internalIsBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,f),f+=i.length;}return n},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)swap(this,e,e+1);return this},Buffer.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)swap(this,e,e+3),swap(this,e+1,e+2);return this},Buffer.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)swap(this,e,e+7),swap(this,e+1,e+6),swap(this,e+2,e+5),swap(this,e+3,e+4);return this},Buffer.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?utf8Slice(this,0,t):slowToString.apply(this,arguments)},Buffer.prototype.equals=function(t){if(!internalIsBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===Buffer.compare(this,t)},Buffer.prototype.inspect=function(){var t="",e=INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},Buffer.prototype.compare=function(t,e,r,n,f){if(!internalIsBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===f&&(f=this.length),e<0||r>t.length||n<0||f>this.length)throw new RangeError("out of range index");if(n>=f&&e>=r)return 0;if(n>=f)return -1;if(e>=r)return 1;if(this===t)return 0;for(var i=(f>>>=0)-(n>>>=0),o=(r>>>=0)-(e>>>=0),u=Math.min(i,o),s=this.slice(n,f),a=t.slice(e,r),h=0;h<u;++h)if(s[h]!==a[h]){i=s[h],o=a[h];break}return i<o?-1:o<i?1:0},Buffer.prototype.includes=function(t,e,r){return -1!==this.indexOf(t,e,r)},Buffer.prototype.indexOf=function(t,e,r){return bidirectionalIndexOf(this,t,e,r,!0)},Buffer.prototype.lastIndexOf=function(t,e,r){return bidirectionalIndexOf(this,t,e,r,!1)},Buffer.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else {if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0);}var f=this.length-e;if((void 0===r||r>f)&&(r=f),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return hexWrite(this,t,e,r);case"utf8":case"utf-8":return utf8Write(this,t,e,r);case"ascii":return asciiWrite(this,t,e,r);case"latin1":case"binary":return latin1Write(this,t,e,r);case"base64":return base64Write(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0;}},Buffer.prototype.toJSON=function(){return {type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(t){var e=t.length;if(e<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=MAX_ARGUMENTS_LENGTH));return r}function asciiSlice(t,e,r){var n="";r=Math.min(t.length,r);for(var f=e;f<r;++f)n+=String.fromCharCode(127&t[f]);return n}function latin1Slice(t,e,r){var n="";r=Math.min(t.length,r);for(var f=e;f<r;++f)n+=String.fromCharCode(t[f]);return n}function hexSlice(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var f="",i=e;i<r;++i)f+=toHex(t[i]);return f}function utf16leSlice(t,e,r){for(var n=t.slice(e,r),f="",i=0;i<n.length;i+=2)f+=String.fromCharCode(n[i]+256*n[i+1]);return f}function checkOffset(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function checkInt(t,e,r,n,f,i){if(!internalIsBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>f||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function objectWriteUInt16(t,e,r,n){e<0&&(e=65535+e+1);for(var f=0,i=Math.min(t.length-r,2);f<i;++f)t[r+f]=(e&255<<8*(n?f:1-f))>>>8*(n?f:1-f);}function objectWriteUInt32(t,e,r,n){e<0&&(e=4294967295+e+1);for(var f=0,i=Math.min(t.length-r,4);f<i;++f)t[r+f]=e>>>8*(n?f:3-f)&255;}function checkIEEE754(t,e,r,n,f,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function writeFloat(t,e,r,n,f){return f||checkIEEE754(t,e,r,4),write(t,e,r,n,23,4),r+4}function writeDouble(t,e,r,n,f){return f||checkIEEE754(t,e,r,8),write(t,e,r,n,52,8),r+8}Buffer.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),Buffer.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=Buffer.prototype;else {var f=e-t;r=new Buffer(f,void 0);for(var i=0;i<f;++i)r[i]=this[i+t];}return r},Buffer.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||checkOffset(t,e,this.length);for(var n=this[t],f=1,i=0;++i<e&&(f*=256);)n+=this[t+i]*f;return n},Buffer.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||checkOffset(t,e,this.length);for(var n=this[t+--e],f=1;e>0&&(f*=256);)n+=this[t+--e]*f;return n},Buffer.prototype.readUInt8=function(t,e){return e||checkOffset(t,1,this.length),this[t]},Buffer.prototype.readUInt16LE=function(t,e){return e||checkOffset(t,2,this.length),this[t]|this[t+1]<<8},Buffer.prototype.readUInt16BE=function(t,e){return e||checkOffset(t,2,this.length),this[t]<<8|this[t+1]},Buffer.prototype.readUInt32LE=function(t,e){return e||checkOffset(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},Buffer.prototype.readUInt32BE=function(t,e){return e||checkOffset(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Buffer.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||checkOffset(t,e,this.length);for(var n=this[t],f=1,i=0;++i<e&&(f*=256);)n+=this[t+i]*f;return n>=(f*=128)&&(n-=Math.pow(2,8*e)),n},Buffer.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||checkOffset(t,e,this.length);for(var n=e,f=1,i=this[t+--n];n>0&&(f*=256);)i+=this[t+--n]*f;return i>=(f*=128)&&(i-=Math.pow(2,8*e)),i},Buffer.prototype.readInt8=function(t,e){return e||checkOffset(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},Buffer.prototype.readInt16LE=function(t,e){e||checkOffset(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(t,e){e||checkOffset(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(t,e){return e||checkOffset(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Buffer.prototype.readInt32BE=function(t,e){return e||checkOffset(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Buffer.prototype.readFloatLE=function(t,e){return e||checkOffset(t,4,this.length),read(this,t,!0,23,4)},Buffer.prototype.readFloatBE=function(t,e){return e||checkOffset(t,4,this.length),read(this,t,!1,23,4)},Buffer.prototype.readDoubleLE=function(t,e){return e||checkOffset(t,8,this.length),read(this,t,!0,52,8)},Buffer.prototype.readDoubleBE=function(t,e){return e||checkOffset(t,8,this.length),read(this,t,!1,52,8)},Buffer.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||checkInt(this,t,e,r,Math.pow(2,8*r)-1,0);var f=1,i=0;for(this[e]=255&t;++i<r&&(f*=256);)this[e+i]=t/f&255;return e+r},Buffer.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||checkInt(this,t,e,r,Math.pow(2,8*r)-1,0);var f=r-1,i=1;for(this[e+f]=255&t;--f>=0&&(i*=256);)this[e+f]=t/i&255;return e+r},Buffer.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},Buffer.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):objectWriteUInt16(this,t,e,!0),e+2},Buffer.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):objectWriteUInt16(this,t,e,!1),e+2},Buffer.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):objectWriteUInt32(this,t,e,!0),e+4},Buffer.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):objectWriteUInt32(this,t,e,!1),e+4},Buffer.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var f=Math.pow(2,8*r-1);checkInt(this,t,e,r,f-1,-f);}var i=0,o=1,u=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===u&&0!==this[e+i-1]&&(u=1),this[e+i]=(t/o>>0)-u&255;return e+r},Buffer.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var f=Math.pow(2,8*r-1);checkInt(this,t,e,r,f-1,-f);}var i=r-1,o=1,u=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===u&&0!==this[e+i+1]&&(u=1),this[e+i]=(t/o>>0)-u&255;return e+r},Buffer.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},Buffer.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):objectWriteUInt16(this,t,e,!0),e+2},Buffer.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):objectWriteUInt16(this,t,e,!1),e+2},Buffer.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):objectWriteUInt32(this,t,e,!0),e+4},Buffer.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||checkInt(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):objectWriteUInt32(this,t,e,!1),e+4},Buffer.prototype.writeFloatLE=function(t,e,r){return writeFloat(this,t,e,!0,r)},Buffer.prototype.writeFloatBE=function(t,e,r){return writeFloat(this,t,e,!1,r)},Buffer.prototype.writeDoubleLE=function(t,e,r){return writeDouble(this,t,e,!0,r)},Buffer.prototype.writeDoubleBE=function(t,e,r){return writeDouble(this,t,e,!1,r)},Buffer.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var f,i=n-r;if(this===t&&r<e&&e<n)for(f=i-1;f>=0;--f)t[f+e]=this[f+r];else if(i<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(f=0;f<i;++f)t[f+e]=this[f+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},Buffer.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var f=t.charCodeAt(0);f<256&&(t=f);}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Buffer.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else "number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else {var o=internalIsBuffer(t)?t:utf8ToBytes(new Buffer(t,n).toString()),u=o.length;for(i=0;i<r-e;++i)this[i+e]=o[i%u];}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g;function base64clean(t){if((t=stringtrim(t).replace(INVALID_BASE64_RE,"")).length<2)return "";for(;t.length%4!=0;)t+="=";return t}function stringtrim(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function toHex(t){return t<16?"0"+t.toString(16):t.toString(16)}function utf8ToBytes(t,e){var r;e=e||1/0;for(var n=t.length,f=null,i=[],o=0;o<n;++o){if((r=t.charCodeAt(o))>55295&&r<57344){if(!f){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&i.push(239,191,189);continue}f=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),f=r;continue}r=65536+(f-55296<<10|r-56320);}else f&&(e-=3)>-1&&i.push(239,191,189);if(f=null,r<128){if((e-=1)<0)break;i.push(r);}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128);}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128);}else {if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128);}}return i}function asciiToBytes(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function utf16leToBytes(t,e){for(var r,n,f,i=[],o=0;o<t.length&&!((e-=2)<0);++o)n=(r=t.charCodeAt(o))>>8,f=r%256,i.push(f),i.push(n);return i}function base64ToBytes(t){return toByteArray(base64clean(t))}function blitBuffer(t,e,r,n){for(var f=0;f<n&&!(f+r>=e.length||f>=t.length);++f)e[f+r]=t[f];return f}function isnan(t){return t!=t}function isBuffer(t){return null!=t&&(!!t._isBuffer||isFastBuffer(t)||isSlowBuffer(t))}function isFastBuffer(t){return !!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function isSlowBuffer(t){return "function"==typeof t.readFloatLE&&"function"==typeof t.slice&&isFastBuffer(t.slice(0,0))}

  var sha1$1 = {exports: {}};

  var crypt = {exports: {}};

  !function(){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t={rotl:function(r,t){return r<<t|r>>>32-t},rotr:function(r,t){return r<<32-t|r>>>t},endian:function(r){if(r.constructor==Number)return 16711935&t.rotl(r,8)|4278255360&t.rotl(r,24);for(var o=0;o<r.length;o++)r[o]=t.endian(r[o]);return r},randomBytes:function(r){for(var t=[];r>0;r--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(r){for(var t=[],o=0,n=0;o<r.length;o++,n+=8)t[n>>>5]|=r[o]<<24-n%32;return t},wordsToBytes:function(r){for(var t=[],o=0;o<32*r.length;o+=8)t.push(r[o>>>5]>>>24-o%32&255);return t},bytesToHex:function(r){for(var t=[],o=0;o<r.length;o++)t.push((r[o]>>>4).toString(16)),t.push((15&r[o]).toString(16));return t.join("")},hexToBytes:function(r){for(var t=[],o=0;o<r.length;o+=2)t.push(parseInt(r.substr(o,2),16));return t},bytesToBase64:function(t){for(var o=[],n=0;n<t.length;n+=3)for(var e=t[n]<<16|t[n+1]<<8|t[n+2],s=0;s<4;s++)8*n+6*s<=8*t.length?o.push(r.charAt(e>>>6*(3-s)&63)):o.push("=");return o.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var o=[],n=0,e=0;n<t.length;e=++n%4)0!=e&&o.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*e+8)-1)<<2*e|r.indexOf(t.charAt(n))>>>6-2*e);return o}};crypt.exports=t;}();

  var charenc={utf8:{stringToBytes:function(n){return charenc.bin.stringToBytes(unescape(encodeURIComponent(n)))},bytesToString:function(n){return decodeURIComponent(escape(charenc.bin.bytesToString(n)))}},bin:{stringToBytes:function(n){for(var e=[],r=0;r<n.length;r++)e.push(255&n.charCodeAt(r));return e},bytesToString:function(n){for(var e=[],r=0;r<n.length;r++)e.push(String.fromCharCode(n[r]));return e.join("")}}},charenc_1=charenc;

  !function(){var e=crypt.exports,r=charenc_1.utf8,o=charenc_1.bin,s=function(s,a){var t=e.wordsToBytes(function(o){o.constructor==String?o=r.stringToBytes(o):void 0!==Buffer&&"function"==typeof isBuffer&&isBuffer(o)?o=Array.prototype.slice.call(o,0):Array.isArray(o)||(o=o.toString());var s=e.bytesToWords(o),a=8*o.length,t=[],i=1732584193,n=-271733879,p=-1732584194,f=271733878,d=-1009589776;s[a>>5]|=128<<24-a%32,s[15+(a+64>>>9<<4)]=a;for(var m=0;m<s.length;m+=16){for(var u=i,l=n,c=p,h=f,j=d,_=0;_<80;_++){if(_<16)t[_]=s[m+_];else {var y=t[_-3]^t[_-8]^t[_-14]^t[_-16];t[_]=y<<1|y>>>31;}var v=(i<<5|i>>>27)+d+(t[_]>>>0)+(_<20?1518500249+(n&p|~n&f):_<40?1859775393+(n^p^f):_<60?(n&p|n&f|p&f)-1894007588:(n^p^f)-899497514);d=f,f=p,p=n<<30|n>>>2,n=i,i=v;}i+=u,n+=l,p+=c,f+=h,d+=j;}return [i,n,p,f,d]}(s));return a&&a.asBytes?t:a&&a.asString?o.bytesToString(t):e.bytesToHex(t)};s._blocksize=16,s._digestsize=20,sha1$1.exports=s;}();

  var rngBrowser = {exports: {}};

  var getRandomValues$1="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(getRandomValues$1){var rnds8$1=new Uint8Array(16);rngBrowser.exports=function(){return getRandomValues$1(rnds8$1),rnds8$1};}else {var rnds=new Array(16);rngBrowser.exports=function(){for(var r,o=0;o<16;o++)0==(3&o)&&(r=4294967296*Math.random()),rnds[o]=r>>>((3&o)<<3)&255;return rnds};}

  for(var byteToHex$1=[],i=0;i<256;++i)byteToHex$1[i]=(i+256).toString(16).substr(1);function bytesToUuid$2(o,e){var t=e||0,r=byteToHex$1;return [r[o[t++]],r[o[t++]],r[o[t++]],r[o[t++]],"-",r[o[t++]],r[o[t++]],"-",r[o[t++]],r[o[t++]],"-",r[o[t++]],r[o[t++]],"-",r[o[t++]],r[o[t++]],r[o[t++]],r[o[t++]],r[o[t++]],r[o[t++]]].join("")}var bytesToUuid_1=bytesToUuid$2;

  var _nodeId,_clockseq,rng$2=rngBrowser.exports,bytesToUuid$1=bytesToUuid_1,_lastMSecs=0,_lastNSecs=0;function v1$1(e,o,s){var r=o&&s||0,c=o||[],l=(e=e||{}).node||_nodeId,a=void 0!==e.clockseq?e.clockseq:_clockseq;if(null==l||null==a){var d=rng$2();null==l&&(l=_nodeId=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==a&&(a=_clockseq=16383&(d[6]<<8|d[7]));}var n=void 0!==e.msecs?e.msecs:(new Date).getTime(),t=void 0!==e.nsecs?e.nsecs:_lastNSecs+1,i=n-_lastMSecs+(t-_lastNSecs)/1e4;if(i<0&&void 0===e.clockseq&&(a=a+1&16383),(i<0||n>_lastMSecs)&&void 0===e.nsecs&&(t=0),t>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");_lastMSecs=n,_lastNSecs=t,_clockseq=a;var m=(1e4*(268435455&(n+=122192928e5))+t)%4294967296;c[r++]=m>>>24&255,c[r++]=m>>>16&255,c[r++]=m>>>8&255,c[r++]=255&m;var u=n/4294967296*1e4&268435455;c[r++]=u>>>8&255,c[r++]=255&u,c[r++]=u>>>24&15|16,c[r++]=u>>>16&255,c[r++]=a>>>8|128,c[r++]=255&a;for(var _=0;_<6;++_)c[r+_]=l[_];return o||bytesToUuid$1(c)}var v1_1=v1$1;

  var rng$1=rngBrowser.exports,bytesToUuid=bytesToUuid_1;function v4$2(r,o,e){var s=o&&e||0;"string"==typeof r&&(o="binary"===r?new Array(16):null,r=null);var n=(r=r||{}).random||(r.rng||rng$1)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,o)for(var a=0;a<16;++a)o[s+a]=n[a];return o||bytesToUuid(n)}var v4_1=v4$2;

  var v1=v1_1,v4$1=v4_1,uuid=v4$1;uuid.v1=v1,uuid.v4=v4$1;var uuid_1=uuid;

  /*!
   * Core functionality for Snowplow Browser trackers v3.5.0 (http://bit.ly/sp-js)
   * Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang
   * Licensed under BSD-3-Clause
   */
  function hasLocalStorage(){try{return !!window.localStorage}catch(e){return !0}}function localStorageAccessible(){var e="modernizr";if(!hasLocalStorage())return !1;try{var t=window.localStorage;return t.setItem(e,e),t.removeItem(e),!0}catch(e){return !1}}function detectViewport(){var e,t;if("innerWidth"in window)e=window.innerWidth,t=window.innerHeight;else {var n=document.documentElement||document.body;e=n.clientWidth,t=n.clientHeight;}return e>=0&&t>=0?e+"x"+t:null}function detectDocumentSize(){var e=document.documentElement,t=document.body,n=t?Math.max(t.offsetHeight,t.scrollHeight):0,o=Math.max(e.clientWidth,e.offsetWidth,e.scrollWidth),r=Math.max(e.clientHeight,e.offsetHeight,e.scrollHeight,n);return isNaN(o)||isNaN(r)?"":o+"x"+r}function isString(e){return !(!e||"string"!=typeof e.valueOf())}function isInteger(e){return Number.isInteger&&Number.isInteger(e)||"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function fixupTitle(e){if(!isString(e)){e=e.text||"";var t=document.getElementsByTagName("title");t&&null!=t[0]&&(e=t[0].text);}return e}function getHostName(e){var t=new RegExp("^(?:(?:https?|ftp):)/*(?:[^@]+@)?([^:/#]+)").exec(e);return t?t[1]:e}function fixupDomain(e){var t=e.length;return "."===e.charAt(--t)&&(e=e.slice(0,t)),"*."===e.slice(0,2)&&(e=e.slice(1)),e}function getReferrer(e){var t=window,n=fromQuerystring("referrer",t.location.href)||fromQuerystring("referer",t.location.href);if(n)return n;if(e)return e;try{if(t.top)return t.top.document.referrer;if(t.parent)return t.parent.document.referrer}catch(e){}return document.referrer}function addEventListener(e,t,n,o){return e.addEventListener?(e.addEventListener(t,n,o),!0):e.attachEvent?e.attachEvent("on"+t,n):void(e["on"+t]=n)}function fromQuerystring(e,t){var n=new RegExp("^[^#]*[?&]"+e+"=([^&#]*)").exec(t);return n?decodeURIComponent(n[1].replace(/\+/g," ")):null}function decorateQuerystring(e,t,n){var o=t+"="+n,r=e.split("#"),i=r[0].split("?"),a=i.shift(),s=i.join("?");if(s){for(var c=!0,u=s.split("&"),d=0;d<u.length;d++)if(u[d].substr(0,t.length+1)===t+"="){c=!1,u[d]=o,s=u.join("&");break}c&&(s=o+"&"+s);}else s=o;return r[0]=a+"?"+s,r.join("#")}function attemptGetLocalStorage(e){try{var t=window.localStorage,n=t.getItem(e+".expires");return null===n||+n>Date.now()?t.getItem(e):(t.removeItem(e),void t.removeItem(e+".expires"))}catch(e){return}}function attemptWriteLocalStorage(e,t,n){void 0===n&&(n=63072e3);try{var o=window.localStorage,r=Date.now()+1e3*n;return o.setItem("".concat(e,".expires"),r.toString()),o.setItem(e,t),!0}catch(e){return !1}}function attemptDeleteLocalStorage(e){try{var t=window.localStorage;return t.removeItem(e),t.removeItem(e+".expires"),!0}catch(e){return !1}}function findRootDomain(e,t){for(var n=window.location.hostname,o="_sp_root_domain_test_",r=o+(new Date).getTime(),i="_test_value_"+(new Date).getTime(),a=n.split("."),s=a.length-1;s>=0;){var c=a.slice(s,a.length).join(".");if(cookie(r,i,0,"/",c,e,t),cookie(r)===i){deleteCookie(r,c,e,t);for(var u=getCookiesWithPrefix(o),d=0;d<u.length;d++)deleteCookie(u[d],c,e,t);return c}s-=1;}return n}function deleteCookie(e,t,n,o){cookie(e,"",-1,"/",t,n,o);}function getCookiesWithPrefix(e){for(var t=document.cookie.split("; "),n=[],o=0;o<t.length;o++)t[o].substring(0,e.length)===e&&n.push(t[o]);return n}function cookie(e,t,n,o,r,i,a){return arguments.length>1?document.cookie=e+"="+encodeURIComponent(null!=t?t:"")+(n?"; Expires="+new Date(+new Date+1e3*n).toUTCString():"")+(o?"; Path="+o:"")+(r?"; Domain="+r:"")+(i?"; SameSite="+i:"")+(a?"; Secure":""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}function getFilterByClass(e){if(null==e||"object"!=typeof e||Array.isArray(e))return function(){return !0};var t=Object.prototype.hasOwnProperty.call(e,"allowlist"),n=getSpecifiedClassesSet(e);return getFilter(e,(function(e){return checkClass(e,n)===t}))}function getCssClasses(e){return e.className.match(/\S+/g)||[]}function checkClass(e,t){for(var n=0,o=getCssClasses(e);n<o.length;n++){if(t[o[n]])return !0}return !1}function getFilter(e,t){return e.hasOwnProperty("filter")&&e.filter?e.filter:t}function getSpecifiedClassesSet(e){var t={},n=e.allowlist||e.denylist;if(n){Array.isArray(n)||(n=[n]);for(var o=0;o<n.length;o++)t[n[o]]=!0;}return t}function OutQueueManager(e,t,n,o,r,i,a,s,c,u,d,l,f,v,g,m){var p,I,h=!1,w=[],k=!0===(o="string"==typeof o?o.toLowerCase():o)||"beacon"===o||"true"===o,S=Boolean(k&&window.navigator&&window.navigator.sendBeacon&&!(function(e,t){var n=t.match("(iP.+; CPU .*OS (d+)[_d]*.*) AppleWebKit/");return !(!n||!n.length)&&parseInt(n[0])<=e}(13,I=window.navigator.userAgent)||function(e,t,n){var o=n.match("(Macintosh;.*Mac OS X (d+)_(d+)[_d]*.*) AppleWebKit/");return !(!o||!o.length)&&(parseInt(o[0])<=e||parseInt(o[0])===e&&parseInt(o[1])<=t)}(10,15,I)&&function(e){return e.match("Version/.* Safari/")&&!function(e){return e.match("Chrom(e|ium)")}(e)}(I)))&&k,x="get"===o,y=Boolean(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),T=!x&&y&&("post"===o||k),C=T?r:"/i",b="snowplowOutQueue_".concat(e,"_").concat(T?"post2":"get");if(k&&(f={}),i=n&&localStorageAccessible()&&T&&i||1,n)try{var E=window.localStorage.getItem(b);w=E?JSON.parse(E):[];}catch(e){}function L(e){var t=Object.keys(e).map((function(t){return [t,e[t]]})).reduce((function(e,t){var n=t[0],o=t[1];return e[n]=o.toString(),e}),{});return {evt:t,bytes:O(JSON.stringify(t))}}function O(e){for(var t=0,n=0;n<e.length;n++){var o=e.charCodeAt(n);o<=127?t+=1:o<=2047?t+=2:o>=55296&&o<=57343?(t+=4,n++):t+=o<65535?3:4;}return t}Array.isArray(w)||(w=[]),t.outQueues.push(w),y&&i>1&&t.bufferFlushers.push((function(e){h||N(e);}));var D=function(e){return "object"==typeof e[0]};function P(e,t){U(t,!0,!1).send(A(F([e.evt])));}function N(e){for(void 0===e&&(e=!1);w.length&&"string"!=typeof w[0]&&"object"!=typeof w[0];)w.shift();if(w.length<1)h=!1;else {if(!isString(p))throw "No collector configured";if(h=!0,y){var t,o,r=void 0;D(w)?(t=U(r=p,!0,e),o=function(e){for(var t=0,n=0;t<e.length&&!((n+=e[t].bytes)>=a);)t+=1;return t}(w)):(r=_(w[0]),t=U(r,!1,e),o=1);var i=setTimeout((function(){t.abort(),h=!1;}),d),s=function(e){for(var t=0;t<e;t++)w.shift();n&&attemptWriteLocalStorage(b,JSON.stringify(w.slice(0,u)));},c=function(e){s(e),N();};if(t.onreadystatechange=function(){4===t.readyState&&t.status>=200&&(clearTimeout(i),t.status<300?c(o):(function(e){if(e>=200&&e<300)return !1;if(g.includes(e))return !0;return !m.includes(e)}(t.status)||(LOG.error("Status ".concat(t.status,", will not retry.")),s(o)),h=!1));},D(w)){var f=w.slice(0,o);if(f.length>0){var v=!1,I=f.map((function(e){return e.evt}));if(S){var k=new Blob([A(F(I))],{type:"application/json"});try{v=navigator.sendBeacon(r,k);}catch(e){v=!1;}}!0===v?c(o):t.send(A(F(I)));}}else t.send();}else if(l||D(w))h=!1;else {var x=new Image(1,1),T=!0;x.onload=function(){T&&(T=!1,w.shift(),n&&attemptWriteLocalStorage(b,JSON.stringify(w.slice(0,u))),N());},x.onerror=function(){T&&(T=!1,h=!1);},x.src=_(w[0]),setTimeout((function(){T&&h&&(T=!1,N());}),d);}}}function U(e,t,n){var o=new XMLHttpRequest;for(var r in t?(o.open("POST",e,!n),o.setRequestHeader("Content-Type","application/json; charset=UTF-8")):o.open("GET",e,!n),o.withCredentials=v,l&&o.setRequestHeader("SP-Anonymous","*"),f)Object.prototype.hasOwnProperty.call(f,r)&&o.setRequestHeader(r,f[r]);return o}function A(e){return JSON.stringify({schema:"iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4",data:e})}function F(e){for(var t=(new Date).getTime().toString(),n=0;n<e.length;n++)e[n].stm=t;return e}function _(e){return c?p+e.replace("?","?stm="+(new Date).getTime()+"&"):p+e}return {enqueueRequest:function(e,t){p=t+C;var o=function(e,t){return LOG.warn("Event ("+e+"B) too big, max is "+t)};if(T){if((l=L(e)).bytes>=a)return o(l.bytes,a),void P(l,p);w.push(l);}else {var c=function(e){var t="?",n={co:!0,cx:!0},o=!0;for(var r in e)e.hasOwnProperty(r)&&!n.hasOwnProperty(r)&&(o?o=!1:t+="&",t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));for(var i in n)e.hasOwnProperty(i)&&n.hasOwnProperty(i)&&(t+="&"+i+"="+encodeURIComponent(e[i]));return t}(e);if(s>0){var d=O(_(c));if(d>=s){var l;if(o(d,s),y)P(l=L(e),t+r);return}}w.push(c);}var f=!1;n&&(f=attemptWriteLocalStorage(b,JSON.stringify(w.slice(0,u)))),h||f&&!(w.length>=i)||N();},executeQueue:function(){h||N();},setUseLocalStorage:function(e){n=e;},setAnonymousTracking:function(e){l=e;},setCollectorUrl:function(e){p=e+C;},setBufferSize:function(e){i=e;}}}function getParameter(e,t){var n=new RegExp("^(?:https?|ftp)(?::/*(?:[^?]+))([?][^#]+)").exec(e);return n&&(null==n?void 0:n.length)>1?fromQuerystring(t,n[1]):null}function fixupUrl(e,t,n){var o;return "translate.googleusercontent.com"===e?(""===n&&(n=t),e=getHostName(t=null!==(o=getParameter(t,"u"))&&void 0!==o?o:"")):"cc.bingj.com"!==e&&"webcache.googleusercontent.com"!==e||(e=getHostName(t=document.links[0].href)),[e,t,n]}var cookieDisabledIndex=0,domainUserIdIndex=1,createTsIndex=2,visitCountIndex=3,nowTsIndex=4,lastVisitTsIndex=5,sessionIdIndex=6,previousSessionIdIndex=7,firstEventIdIndex=8,firstEventTsInMsIndex=9,eventIndexIndex=10;function emptyIdCookie(){return ["1","",0,0,0,void 0,"","","",void 0,0]}function parseIdCookie(e,t,n,o){var r,i=new Date,a=Math.round(i.getTime()/1e3);e?(r=e.split(".")).unshift("0"):r=["1",t,a,o,a,"",n],r[sessionIdIndex]&&"undefined"!==r[sessionIdIndex]||(r[sessionIdIndex]=uuid_1.v4()),r[previousSessionIdIndex]&&"undefined"!==r[previousSessionIdIndex]||(r[previousSessionIdIndex]=""),r[firstEventIdIndex]&&"undefined"!==r[firstEventIdIndex]||(r[firstEventIdIndex]=""),r[firstEventTsInMsIndex]&&"undefined"!==r[firstEventTsInMsIndex]||(r[firstEventTsInMsIndex]=""),r[eventIndexIndex]&&"undefined"!==r[eventIndexIndex]||(r[eventIndexIndex]=0);var s=function(e,t){var n=parseInt(e);return isNaN(n)?t:n},c=function(e){return e?s(e,void 0):void 0};return [r[cookieDisabledIndex],r[domainUserIdIndex],s(r[createTsIndex],a),s(r[visitCountIndex],o),s(r[nowTsIndex],a),c(r[lastVisitTsIndex]),r[sessionIdIndex],r[previousSessionIdIndex],r[firstEventIdIndex],c(r[firstEventTsInMsIndex]),s(r[eventIndexIndex],0)]}function initializeDomainUserId(e,t){var n;return e[domainUserIdIndex]?n=e[domainUserIdIndex]:t?(n="",e[domainUserIdIndex]=n):(n=uuid_1.v4(),e[domainUserIdIndex]=n),n}function startNewIdCookieSession(e,t){void 0===t&&(t=1),cookiesEnabledInIdCookie(e)?(e[previousSessionIdIndex]=e[sessionIdIndex],e[lastVisitTsIndex]=e[nowTsIndex],e[visitCountIndex]++):e[visitCountIndex]=t;var n=uuid_1.v4();return e[sessionIdIndex]=n,e[eventIndexIndex]=0,e[firstEventIdIndex]="",e[firstEventTsInMsIndex]=void 0,n}function updateNowTsInIdCookie(e){e[nowTsIndex]=Math.round((new Date).getTime()/1e3);}function updateFirstEventInIdCookie(e,t){if(0===e[eventIndexIndex]){var n=t.build();e[firstEventIdIndex]=n.eid;var o=n.dtm||n.ttm;e[firstEventTsInMsIndex]=o?parseInt(o):void 0;}}function incrementEventIndexInIdCookie(e){e[eventIndexIndex]+=1;}function serializeIdCookie(e){return e.shift(),e.join(".")}function clientSessionFromIdCookie(e,t){var n=e[firstEventTsInMsIndex];return {userId:e[domainUserIdIndex],sessionId:e[sessionIdIndex],eventIndex:e[eventIndexIndex],sessionIndex:e[visitCountIndex],previousSessionId:e[previousSessionIdIndex]||null,storageMechanism:"localStorage"==t?"LOCAL_STORAGE":"COOKIE_1",firstEventId:e[firstEventIdIndex]||null,firstEventTimestamp:n?new Date(n).toISOString():null}}function sessionIdFromIdCookie(e){return e[sessionIdIndex]}function domainUserIdFromIdCookie(e){return e[domainUserIdIndex]}function visitCountFromIdCookie(e){return e[visitCountIndex]}function cookiesEnabledInIdCookie(e){return "0"===e[cookieDisabledIndex]}function Tracker$1(e,t,n,o,r,i){void 0===i&&(i={});var a=[],s=function(e,t,n,o,r,i){var s,c,u,d,l,f,v,g,m,p,I,h,w,k,S,x,y,T,C,b,E,L,O,D,P,N;i.eventMethod=null!==(s=i.eventMethod)&&void 0!==s?s:"post";var U=function(e){var t;return null!==(t=e.stateStorageStrategy)&&void 0!==t?t:"cookieAndLocalStorage"},A=function(e){var t,n;return "boolean"!=typeof e.anonymousTracking&&(null!==(n=!0===(null===(t=e.anonymousTracking)||void 0===t?void 0:t.withSessionTracking))&&void 0!==n&&n)},F=function(e){var t,n;return "boolean"!=typeof e.anonymousTracking&&(null!==(n=!0===(null===(t=e.anonymousTracking)||void 0===t?void 0:t.withServerAnonymisation))&&void 0!==n&&n)},_=function(e){return !!e.anonymousTracking};a.push({beforeTrack:function(e){var t,n=function(e){return xe?null:e},o=function(e){return ke?e:n(e)},r=Me("ses"),i=Je();t=!!j&&!!cookie(j),Ie||t?Xe():(cookiesEnabledInIdCookie(i)?(J=r||"none"==ye?sessionIdFromIdCookie(i):startNewIdCookieSession(i),Ce=visitCountFromIdCookie(i)):(new Date).getTime()-Te>1e3*we&&(Ce++,J=startNewIdCookieSession(i,Ce)),updateNowTsInIdCookie(i),updateFirstEventInIdCookie(i,e),incrementEventIndexInIdCookie(i),e.add("vp",detectViewport()),e.add("ds",detectDocumentSize()),e.add("vid",o(Ce)),e.add("sid",o(J)),e.add("duid",n(domainUserIdFromIdCookie(i))),e.add("uid",n(K)),Pe(),e.add("refr",Ae(M||re)),e.add("url",Ae(R||oe)),!De||ke||xe||function(e,t){var n={schema:"iglu:com.snowplowanalytics.snowplow/client_session/jsonschema/1-0-2",data:t};e.addContextEntity(n);}(e,clientSessionFromIdCookie(i,ye)),"none"!=ye&&(ze(i),We()),Te=(new Date).getTime());}}),(null===(u=null===(c=null==i?void 0:i.contexts)||void 0===c?void 0:c.webPage)||void 0===u||u)&&a.push({contexts:function(){return [{schema:"iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",data:{id:$e()}}]}}),a.push.apply(a,null!==(d=i.plugins)&&void 0!==d?d:[]);var M,R,V,B,H,j,Q,W,z,G,X,q,Y,J,K,Z=trackerCore({base64:i.encodeBase64,corePlugins:a,callback:function(e){var t;t=!!j&&!!cookie(j);Ie||t||be.enqueueRequest(e.build(),ae);}}),$=navigator.userLanguage||navigator.language,ee=document.characterSet||document.charset,te=fixupUrl(window.location.hostname,window.location.href,getReferrer()),ne=fixupDomain(te[0]),oe=te[1],re=te[2],ie=null!==(l=i.platform)&&void 0!==l?l:"web",ae=Ke(o),se=null!==(f=i.postPath)&&void 0!==f?f:"/com.snowplowanalytics.snowplow/tp2",ce=null!==(v=i.appId)&&void 0!==v?v:"",ue=document.title,de=null===(g=i.resetActivityTrackingOnPageView)||void 0===g||g,le=null!==(m=i.cookieName)&&void 0!==m?m:"_sp_",fe=null!==(p=i.cookieDomain)&&void 0!==p?p:void 0,ve="/",ge=null!==(I=i.cookieSameSite)&&void 0!==I?I:"None",me=null===(h=i.cookieSecure)||void 0===h||h,pe=navigator.doNotTrack||navigator.msDoNotTrack||window.doNotTrack,Ie=void 0!==i.respectDoNotTrack&&(i.respectDoNotTrack&&("yes"===pe||"1"===pe)),he=null!==(w=i.cookieLifetime)&&void 0!==w?w:63072e3,we=null!==(k=i.sessionCookieTimeout)&&void 0!==k?k:1800,ke=A(i),Se=F(i),xe=_(i),ye=U(i),Te=(new Date).getTime(),Ce=1,be=OutQueueManager(e,r,"localStorage"==ye||"cookieAndLocalStorage"==ye,i.eventMethod,se,null!==(S=i.bufferSize)&&void 0!==S?S:1,null!==(x=i.maxPostBytes)&&void 0!==x?x:4e4,null!==(y=i.maxGetBytes)&&void 0!==y?y:0,null===(T=i.useStm)||void 0===T||T,null!==(C=i.maxLocalStorageQueueSize)&&void 0!==C?C:1e3,null!==(b=i.connectionTimeout)&&void 0!==b?b:5e3,Se,null!==(E=i.customHeaders)&&void 0!==E?E:{},null===(L=i.withCredentials)||void 0===L||L,null!==(O=i.retryStatusCodes)&&void 0!==O?O:[],(null!==(D=i.dontRetryStatusCodes)&&void 0!==D?D:[]).concat([400,401,403,410,422])),Ee=!1,Le=!1,Oe={enabled:!1,installed:!1,configurations:{}},De=null!==(N=null===(P=i.contexts)||void 0===P?void 0:P.session)&&void 0!==N&&N;function Pe(){(te=fixupUrl(window.location.hostname,window.location.href,getReferrer()))[1]!==oe&&(re=getReferrer(oe)),ne=fixupDomain(te[0]),oe=te[1];}function Ne(e){var t=(new Date).getTime(),n=e.currentTarget;(null==n?void 0:n.href)&&(n.href=decorateQuerystring(n.href,"_sp",Y+"."+t));}function Ue(e){for(var t=0;t<document.links.length;t++){var n=document.links[t];!n.spDecorationEnabled&&e(n)&&(addEventListener(n,"click",Ne,!0),addEventListener(n,"mousedown",Ne,!0),n.spDecorationEnabled=!0);}}function Ae(e){var t;return B&&(t=new RegExp("#.*"),e=e.replace(t,"")),H&&(t=new RegExp("[{}]","g"),e=e.replace(t,"")),e}function Fe(e){var t=new RegExp("^([a-z]+):").exec(e);return t?t[1]:null}function _e(e){return le+e+"."+q}function Me(e){var t=_e(e);return "localStorage"==ye?attemptGetLocalStorage(t):"cookie"==ye||"cookieAndLocalStorage"==ye?cookie(t):void 0}function Re(){Pe(),q=sha1$1.exports((fe||ne)+(ve||"/")).slice(0,4);}function Ve(){var e=new Date;Q=e.getTime();}function Be(){!function(){var e=He(),t=e[0];t<W?W=t:t>z&&(z=t);var n=e[1];n<G?G=n:n>X&&(X=n);}(),Ve();}function He(){var e=document.documentElement;return e?[e.scrollLeft||window.pageXOffset,e.scrollTop||window.pageYOffset]:[0,0]}function je(){var e=He(),t=e[0];W=t,z=t;var n=e[1];G=n,X=n;}function Qe(e){return Math.round(e)}function We(){Ge(_e("ses"),"*",we);}function ze(e){Ge(_e("id"),serializeIdCookie(e),he);}function Ge(e,t,n){xe&&!ke||("localStorage"==ye?attemptWriteLocalStorage(e,t,n):"cookie"!=ye&&"cookieAndLocalStorage"!=ye||cookie(e,t,n,ve,fe,ge,me));}function Xe(e){var t=_e("id"),n=_e("ses");attemptDeleteLocalStorage(t),attemptDeleteLocalStorage(n),deleteCookie(t,fe,ge,me),deleteCookie(n,fe,ge,me),(null==e?void 0:e.preserveSession)||(J=uuid_1.v4(),Ce=0),(null==e?void 0:e.preserveUser)||(Y=uuid_1.v4(),K=null);}function qe(e){e&&e.stateStorageStrategy&&(i.stateStorageStrategy=e.stateStorageStrategy,ye=U(i)),xe=_(i),ke=A(i),Se=F(i),be.setUseLocalStorage("localStorage"==ye||"cookieAndLocalStorage"==ye),be.setAnonymousTracking(Se);}function Ye(){if(!xe||ke){var e="none"!=ye&&!!Me("ses"),t=Je();Y=initializeDomainUserId(t,xe),J=e?sessionIdFromIdCookie(t):startNewIdCookieSession(t),"none"!=ye&&(We(),updateNowTsInIdCookie(t),ze(t));}}function Je(){return "none"==ye?emptyIdCookie():parseIdCookie(Me("id")||void 0,Y,J,Ce)}function Ke(e){return 0===e.indexOf("http")?e:("https:"===document.location.protocol?"https":"http")+"://"+e}function Ze(){Ee&&null!=r.pageViewId||(r.pageViewId=uuid_1.v4());}function $e(){return null==r.pageViewId&&(r.pageViewId=uuid_1.v4()),r.pageViewId}function et(e,t){return (e||[]).concat(t?t():[])}function tt(e,t,n){var o=function(e,t){Pe(),e({context:t,pageViewId:$e(),minXOffset:W,minYOffset:G,maxXOffset:z,maxYOffset:X}),je();},r=function(){var r=new Date;Q+e.configHeartBeatTimer>r.getTime()&&o(e.callback,et(t,n));};0!=e.configMinimumVisitLength?e.activityInterval=window.setTimeout((function(){var i=new Date;Q+e.configMinimumVisitLength>i.getTime()&&o(e.callback,et(t,n)),e.activityInterval=window.setInterval(r,e.configHeartBeatTimer);}),e.configMinimumVisitLength):e.activityInterval=window.setInterval(r,e.configHeartBeatTimer);}function nt(e){var t=e.minimumVisitLength,n=e.heartbeatDelay,o=e.callback;if(isInteger(t)&&isInteger(n))return {configMinimumVisitLength:1e3*t,configHeartBeatTimer:1e3*n,callback:o};LOG.error("Activity tracking minimumVisitLength & heartbeatDelay must be integers");}function ot(e){var t=e.context,n=e.minXOffset,o=e.minYOffset,r=e.maxXOffset,i=e.maxYOffset,a=document.title;a!==ue&&(ue=a,V=void 0),Z.track(buildPagePing({pageUrl:Ae(R||oe),pageTitle:fixupTitle(V||ue),referrer:Ae(M||re),minXOffset:Qe(n),maxXOffset:Qe(r),minYOffset:Qe(o),maxYOffset:Qe(i)}),t);}i.hasOwnProperty("discoverRootDomain")&&i.discoverRootDomain&&(fe=findRootDomain(ge,me)),Z.setTrackerVersion(n),Z.setTrackerNamespace(t),Z.setAppId(ce),Z.setPlatform(ie),Z.addPayloadPair("cookie",navigator.cookieEnabled?"1":"0"),Z.addPayloadPair("cs",ee),Z.addPayloadPair("lang",$),Z.addPayloadPair("res",screen.width+"x"+screen.height),Z.addPayloadPair("cd",screen.colorDepth),Re(),Ye(),i.crossDomainLinker&&Ue(i.crossDomainLinker);var rt={getDomainSessionIndex:function(){return Ce},getPageViewId:function(){return $e()},newSession:function(){var e=Je();cookiesEnabledInIdCookie(e)?(J="none"!=ye?startNewIdCookieSession(e):sessionIdFromIdCookie(e),Ce=visitCountFromIdCookie(e),We()):(Ce++,J=startNewIdCookieSession(e,Ce)),updateNowTsInIdCookie(e),"none"!=ye&&(ze(e),We()),Te=(new Date).getTime();},getCookieName:function(e){return _e(e)},getUserId:function(){return K},getDomainUserId:function(){return Je()[1]},getDomainUserInfo:function(){return Je()},setReferrerUrl:function(e){M=e;},setCustomUrl:function(e){Pe(),R=function(e,t){var n;return Fe(t)?t:"/"===t.slice(0,1)?Fe(e)+"://"+getHostName(e)+t:((n=(e=Ae(e)).indexOf("?"))>=0&&(e=e.slice(0,n)),(n=e.lastIndexOf("/"))!==e.length-1&&(e=e.slice(0,n+1)),e+t)}(oe,e);},setDocumentTitle:function(e){ue=document.title,V=e;},discardHashTag:function(e){B=e;},discardBrace:function(e){H=e;},setCookiePath:function(e){ve=e,Re();},setVisitorCookieTimeout:function(e){he=e;},crossDomainLinker:function(e){Ue(e);},enableActivityTracking:function(e){Oe.configurations.pagePing||(Oe.enabled=!0,Oe.configurations.pagePing=nt(__assign(__assign({},e),{callback:ot})));},enableActivityTrackingCallback:function(e){Oe.configurations.callback||(Oe.enabled=!0,Oe.configurations.callback=nt(e));},updatePageActivity:function(){Ve();},setOptOutCookie:function(e){j=e;},setUserId:function(e){K=e;},setUserIdFromLocation:function(e){Pe(),K=fromQuerystring(e,oe);},setUserIdFromReferrer:function(e){Pe(),K=fromQuerystring(e,re);},setUserIdFromCookie:function(e){K=cookie(e);},setCollectorUrl:function(e){ae=Ke(e),be.setCollectorUrl(ae);},setBufferSize:function(e){be.setBufferSize(e);},flushBuffer:function(e){void 0===e&&(e={}),be.executeQueue(),e.newBufferSize&&be.setBufferSize(e.newBufferSize);},trackPageView:function(e){void 0===e&&(e={}),function(e){var t=e.title,n=e.context,o=e.timestamp,r=e.contextCallback;Pe(),Le&&Ze(),Le=!0,ue=document.title;var i=fixupTitle((V=t)||ue);Z.track(buildPageView({pageUrl:Ae(R||oe),pageTitle:i,referrer:Ae(M||re)}),et(n,r),o);var a=new Date,s=!1;if(Oe.enabled&&!Oe.installed){Oe.installed=!0,s=!0;var c={update:function(){if("undefined"!=typeof window&&"function"==typeof window.addEventListener){var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0;},set:function(){}}),n=function(){};window.addEventListener("testPassiveEventSupport",n,t),window.removeEventListener("testPassiveEventSupport",n,t),c.hasSupport=e;}}};c.update();var u="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll";Object.prototype.hasOwnProperty.call(c,"hasSupport")?addEventListener(document,u,Ve,{passive:!0}):addEventListener(document,u,Ve),je();var d=function(e,t){return void 0===t&&(t=Ve),function(e){return addEventListener(document,e,t)}};["click","mouseup","mousedown","mousemove","keypress","keydown","keyup"].forEach(d(document)),["resize","focus","blur"].forEach(d(window)),d(window,Be)("scroll");}if(Oe.enabled&&(de||s)){Q=a.getTime();var l=void 0;for(l in Oe.configurations){var f=Oe.configurations[l];f&&(window.clearInterval(f.activityInterval),tt(f,n,r));}}}(e);},preservePageViewId:function(){Ee=!0;},disableAnonymousTracking:function(e){i.anonymousTracking=!1,qe(e),Ye(),be.executeQueue();},enableAnonymousTracking:function(e){var t;i.anonymousTracking=null===(t=e&&(null==e?void 0:e.options))||void 0===t||t,qe(e),ke||Ze();},clearUserData:Xe};return __assign(__assign({},rt),{id:e,namespace:t,core:Z,sharedState:r})}(e,t,n,o,r,i),c=__assign(__assign({},s),{addPlugin:function(e){var t,n;c.core.addPlugin(e),null===(n=(t=e.plugin).activateBrowserPlugin)||void 0===n||n.call(t,c);}});return a.forEach((function(e){var t;null===(t=e.activateBrowserPlugin)||void 0===t||t.call(e,c);})),c}var namedTrackers={};function dispatchToTrackers(e,t){try{getTrackers(null!=e?e:allTrackerNames()).forEach(t);}catch(e){LOG.error("Function failed",e);}}function dispatchToTrackersInCollection(e,t,n){try{getTrackersFromCollection(null!=e?e:Object.keys(t),t).forEach(n);}catch(e){LOG.error("Function failed",e);}}function addTracker(e,t,n,o,r,i){return namedTrackers.hasOwnProperty(e)?null:(namedTrackers[e]=Tracker$1(e,t,n,o,r,i),namedTrackers[e])}function getTrackers(e){return getTrackersFromCollection(e,namedTrackers)}function allTrackerNames(){return Object.keys(namedTrackers)}function getTrackersFromCollection(e,t){for(var n=[],o=0,r=e;o<r.length;o++){var i=r[o];t.hasOwnProperty(i)?n.push(t[i]):LOG.warn(i+" not configured");}return n}var SharedState=function(){this.outQueues=[],this.bufferFlushers=[],this.hasLoaded=!1,this.registeredOnLoadHandlers=[];};function createSharedState(){var e=new SharedState,t=document,n=window;function o(){var t;if(!e.hasLoaded)for(e.hasLoaded=!0,t=0;t<e.registeredOnLoadHandlers.length;t++)e.registeredOnLoadHandlers[t]();return !0}return t.visibilityState&&addEventListener(t,"visibilitychange",(function(){"hidden"==t.visibilityState&&e.bufferFlushers.forEach((function(e){e(!1);}));}),!1),addEventListener(n,"beforeunload",(function(){e.bufferFlushers.forEach((function(e){e(!1);}));}),!1),"loading"===document.readyState?(t.addEventListener?t.addEventListener("DOMContentLoaded",(function e(){t.removeEventListener("DOMContentLoaded",e,!1),o();})):t.attachEvent&&t.attachEvent("onreadystatechange",(function e(){"complete"===t.readyState&&(t.detachEvent("onreadystatechange",e),o());})),addEventListener(n,"load",o,!1)):o(),e}

  /*!
   * Link Click tracking for Snowplow v3.5.0 (http://bit.ly/sp-js)
   * Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang
   * Licensed under BSD-3-Clause
   */
  var _trackers={},_configuration={};function LinkClickTrackingPlugin(){return {activateBrowserPlugin:function(n){_trackers[n.id]=n;}}}function enableLinkClickTracking(n,e){void 0===n&&(n={}),void 0===e&&(e=Object.keys(_trackers)),e.forEach((function(e){_trackers[e]&&(_trackers[e].sharedState.hasLoaded?(configureLinkClickTracking(n,e),addClickListeners(e)):_trackers[e].sharedState.registeredOnLoadHandlers.push((function(){configureLinkClickTracking(n,e),addClickListeners(e);})));}));}function refreshLinkClickTracking(n){void 0===n&&(n=Object.keys(_trackers)),n.forEach((function(n){_trackers[n]&&(_trackers[n].sharedState.hasLoaded?addClickListeners(n):_trackers[n].sharedState.registeredOnLoadHandlers.push((function(){addClickListeners(n);})));}));}function trackLinkClick(n,e){void 0===e&&(e=Object.keys(_trackers)),dispatchToTrackersInCollection(e,_trackers,(function(e){e.core.track(buildLinkClick(n),n.context,n.timestamp);}));}function processClick(n,e,t){for(var i,r,c,a,o,s;null!==(i=e.parentElement)&&null!=i&&"A"!==(r=e.tagName.toUpperCase())&&"AREA"!==r;)e=i;var l=e;if(null!=l.href){var k=l.hostname||getHostName(l.href),u=k.toLowerCase(),d=l.href.replace(k,u);new RegExp("^(javascript|vbscript|jscript|mocha|livescript|ecmascript|mailto):","i").test(d)||(c=l.id,a=getCssClasses(l),o=l.target,s=_configuration[n.id].linkTrackingContent?l.innerHTML:void 0,d=unescape(d),n.core.track(buildLinkClick({targetUrl:d,elementId:c,elementClasses:a,elementTarget:o,elementContent:s}),resolveDynamicContext(t,e)));}}function getClickHandler(n,e){return function(t){var i,r;i=(t=t||window.event).which||t.button,r=t.target||t.srcElement,"click"===t.type?r&&processClick(_trackers[n],r,e):"mousedown"===t.type?1!==i&&2!==i||!r?_configuration[n].lastButton=_configuration[n].lastTarget=null:(_configuration[n].lastButton=i,_configuration[n].lastTarget=r):"mouseup"===t.type&&(i===_configuration[n].lastButton&&r===_configuration[n].lastTarget&&processClick(_trackers[n],r,e),_configuration[n].lastButton=_configuration[n].lastTarget=null);}}function addClickListener(n,e){_configuration[n].linkTrackingPseudoClicks?(addEventListener(e,"mouseup",getClickHandler(n,_configuration[n].linkTrackingContext),!1),addEventListener(e,"mousedown",getClickHandler(n,_configuration[n].linkTrackingContext),!1)):addEventListener(e,"click",getClickHandler(n,_configuration[n].linkTrackingContext),!1);}function configureLinkClickTracking(n,e){var t=void 0===n?{}:n,i=t.options,r=t.pseudoClicks,c=t.trackContent,a=t.context;_configuration[e]={linkTrackingContent:c,linkTrackingContext:a,linkTrackingPseudoClicks:r,linkTrackingFilter:getFilterByClass(i)};}function addClickListeners(n){var e,t,i,r=document.links;for(i=0;i<r.length;i++)(null===(t=(e=_configuration[n]).linkTrackingFilter)||void 0===t?void 0:t.call(e,r[i]))&&!r[i][n]&&(addClickListener(n,r[i]),r[i][n]=!0);}

  /*!
   * Browser tracker for Snowplow v3.5.0 (http://bit.ly/sp-js)
   * Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang
   * Licensed under BSD-3-Clause
   */
  function trackPageView(e,t){dispatchToTrackers(t,(function(t){t.trackPageView(e);}));}function trackSelfDescribingEvent(e,t){dispatchToTrackers(t,(function(t){t.core.track(buildSelfDescribingEvent({event:e.event}),e.context,e.timestamp);}));}var state="undefined"!=typeof window?createSharedState():void 0;function newTracker(e,t,o){return void 0===o&&(o={}),state?addTracker(e,e,"js-".concat(version),t,state,o):void 0}

  var eventemitter3 = {exports: {}};

  !function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1;}function s(e,t,r,s,i){if("function"!=typeof r)throw new TypeError("The listener must be a function");var c=new o(r,s||e,i),f=n?n+t:t;return e._events[f]?e._events[f].fn?e._events[f]=[e._events[f],c]:e._events[f].push(c):(e._events[f]=c,e._eventsCount++),e}function i(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t];}function c(){this._events=new r,this._eventsCount=0;}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),c.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},c.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return [];if(r.fn)return [r.fn];for(var o=0,s=r.length,i=new Array(s);o<s;o++)i[o]=r[o].fn;return i},c.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},c.prototype.emit=function(e,t,r,o,s,i){var c=n?n+e:e;if(!this._events[c])return !1;var f,a,u=this._events[c],l=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),l){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,o),!0;case 5:return u.fn.call(u.context,t,r,o,s),!0;case 6:return u.fn.call(u.context,t,r,o,s,i),!0}for(a=1,f=new Array(l-1);a<l;a++)f[a-1]=arguments[a];u.fn.apply(u.context,f);}else {var p,v=u.length;for(a=0;a<v;a++)switch(u[a].once&&this.removeListener(e,u[a].fn,void 0,!0),l){case 1:u[a].fn.call(u[a].context);break;case 2:u[a].fn.call(u[a].context,t);break;case 3:u[a].fn.call(u[a].context,t,r);break;case 4:u[a].fn.call(u[a].context,t,r,o);break;default:if(!f)for(p=1,f=new Array(l-1);p<l;p++)f[p-1]=arguments[p];u[a].fn.apply(u[a].context,f);}}return !0},c.prototype.on=function(e,t,n){return s(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return s(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,r,o){var s=n?n+e:e;if(!this._events[s])return this;if(!t)return i(this,s),this;var c=this._events[s];if(c.fn)c.fn!==t||o&&!c.once||r&&c.context!==r||i(this,s);else {for(var f=0,a=[],u=c.length;f<u;f++)(c[f].fn!==t||o&&!c[f].once||r&&c[f].context!==r)&&a.push(c[f]);a.length?this._events[s]=1===a.length?a[0]:a:i(this,s);}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&i(this,t)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c;}(eventemitter3);var EventEmitter = eventemitter3.exports;

  var ATTRIBUTE_ID_ACTIVE_VIEW="id-av";var ActiveView=function(){function e(e,t,i){void 0===e&&(e=.5),void 0===t&&(t=2e3);var r=this;this.events=new EventEmitter,this.viewTime=t,this.inner=new IntersectionObserver((function(e,t){e.forEach((function(e){var t=e.target;if(e.isIntersecting)t.setAttribute(ATTRIBUTE_ID_ACTIVE_VIEW,setTimeout((function(){r.trackVisibility(t);}),r.viewTime).toString());else {var i=t.getAttribute(ATTRIBUTE_ID_ACTIVE_VIEW);if(null===i)return;clearTimeout(parseInt(i)),t.removeAttribute(ATTRIBUTE_ID_ACTIVE_VIEW);}}));}),{threshold:e,root:i});}return e.prototype.addEventListener=function(e){this.events.addListener("observe",e);},e.prototype.trackVisibility=function(e){this.inner.unobserve(e),e.removeAttribute(ATTRIBUTE_ID_ACTIVE_VIEW),this.events.emit("observe",e);},e.prototype.observe=function(e){this.inner.observe(e);},e.prototype.unobserve=function(e){this.inner.unobserve(e);},e}();

  function pageViewContext(e){return {schema:"iglu:de.id.bi.audience/page_view/jsonschema/1-0-0",data:{pvid:e.toString()}}}

  function shelfContext(e,r,t){if(!e)throw new Error("invalid shelfType");if(!r)throw new Error("invalid shelfName");if(Object.keys(t).length>16)throw new Error("a shelf must at most have 16 keys");return {schema:"iglu:de.id.bi.audience/shelf/jsonschema/1-0-0",data:{sht:e,shn:r,properties:t}}}

  function userContext(e){return {schema:"iglu:de.id.bi.audience/user/jsonschema/1-0-0",data:{utid:e.toString()}}}

  function userInteractionContext(e,n){return {schema:"iglu:de.id.bi.audience/user_interaction/jsonschema/1-0-0",data:{uiaid:"".concat(e,"-").concat(n)}}}

  function elementActiveViewEvent(e,t){return {schema:"iglu:de.id.bi.audience/element_active_view/jsonschema/1-0-0",data:{elementId:e,elementClasses:t}}}

  function elementClickEvent(e,n){return {schema:"iglu:de.id.bi.audience/element_click/jsonschema/1-0-0",data:{elementId:e,elementClasses:n}}}

  function linkClickEvent(e,l,n,t){return {schema:"iglu:com.snowplowanalytics.snowplow/link_click/jsonschema/1-0-1",data:{targetUrl:e,elementId:l,elementClasses:n,elementTarget:t}}}

  /*! js-cookie v3.0.1 | MIT */
  function assign(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 defaultConverter={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)}};function init(e,t){function n(n,r,i){if("undefined"!=typeof document){"number"==typeof(i=assign({},t,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),n=encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var c in i)i[c]&&(o+="; "+c,!0!==i[c]&&(o+="="+i[c].split(";")[0]));return document.cookie=n+"="+e.write(r,n)+o}}return Object.create({set:n,get:function(t){if("undefined"!=typeof document&&(!arguments.length||t)){for(var n=document.cookie?document.cookie.split("; "):[],r={},i=0;i<n.length;i++){var o=n[i].split("="),c=o.slice(1).join("=");try{var a=decodeURIComponent(o[0]);if(r[a]=e.read(c,a),t===a)break}catch(e){}}return t?r[t]:r}},remove:function(e,t){n(e,"",assign({},t,{expires:-1}));},withAttributes:function(e){return init(this.converter,assign({},this.attributes,e))},withConverter:function(e){return init(assign({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var api=init(defaultConverter,{path:"/"});

  let getRandomValues;const rnds8=new Uint8Array(16);function rng(){if(!getRandomValues&&(getRandomValues="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!getRandomValues))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return getRandomValues(rnds8)}

  var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;

  function validate(t){return "string"==typeof t&&REGEX.test(t)}

  const byteToHex=[];for(let e=0;e<256;++e)byteToHex.push((e+256).toString(16).slice(1));function unsafeStringify(e,t=0){return (byteToHex[e[t+0]]+byteToHex[e[t+1]]+byteToHex[e[t+2]]+byteToHex[e[t+3]]+"-"+byteToHex[e[t+4]]+byteToHex[e[t+5]]+"-"+byteToHex[e[t+6]]+byteToHex[e[t+7]]+"-"+byteToHex[e[t+8]]+byteToHex[e[t+9]]+"-"+byteToHex[e[t+10]]+byteToHex[e[t+11]]+byteToHex[e[t+12]]+byteToHex[e[t+13]]+byteToHex[e[t+14]]+byteToHex[e[t+15]]).toLowerCase()}

  function parse(e){if(!validate(e))throw TypeError("Invalid UUID");let r;const t=new Uint8Array(16);return t[0]=(r=parseInt(e.slice(0,8),16))>>>24,t[1]=r>>>16&255,t[2]=r>>>8&255,t[3]=255&r,t[4]=(r=parseInt(e.slice(9,13),16))>>>8,t[5]=255&r,t[6]=(r=parseInt(e.slice(14,18),16))>>>8,t[7]=255&r,t[8]=(r=parseInt(e.slice(19,23),16))>>>8,t[9]=255&r,t[10]=(r=parseInt(e.slice(24,36),16))/1099511627776&255,t[11]=r/4294967296&255,t[12]=r>>>24&255,t[13]=r>>>16&255,t[14]=r>>>8&255,t[15]=255&r,t}

  function stringToBytes(t){t=unescape(encodeURIComponent(t));const e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e}const DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8";const URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function v35(t,e,r){function n(t,n,o,s){var i;if("string"==typeof t&&(t=stringToBytes(t)),"string"==typeof n&&(n=parse(n)),16!==(null===(i=n)||void 0===i?void 0:i.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let a=new Uint8Array(16+t.length);if(a.set(n),a.set(t,n.length),a=r(a),a[6]=15&a[6]|e,a[8]=63&a[8]|128,o){s=s||0;for(let t=0;t<16;++t)o[s+t]=a[t];return o}return unsafeStringify(a)}try{n.name=t;}catch(t){}return n.DNS=DNS,n.URL=URL,n}

  function md5(d){if("string"==typeof d){const m=unescape(encodeURIComponent(d));d=new Uint8Array(m.length);for(let t=0;t<m.length;++t)d[t]=m.charCodeAt(t);}return md5ToHexEncodedArray(wordsToMd5(bytesToWords(d),8*d.length))}function md5ToHexEncodedArray(d){const m=[],t=32*d.length,n="0123456789abcdef";for(let f=0;f<t;f+=8){const t=d[f>>5]>>>f%32&255,e=parseInt(n.charAt(t>>>4&15)+n.charAt(15&t),16);m.push(e);}return m}function getOutputLength(d){return 14+(d+64>>>9<<4)+1}function wordsToMd5(d,m){d[m>>5]|=128<<m%32,d[getOutputLength(m)-1]=m;let t=1732584193,n=-271733879,f=-1732584194,e=271733878;for(let m=0;m<d.length;m+=16){const i=t,g=n,h=f,r=e;t=md5ff(t,n,f,e,d[m],7,-680876936),e=md5ff(e,t,n,f,d[m+1],12,-389564586),f=md5ff(f,e,t,n,d[m+2],17,606105819),n=md5ff(n,f,e,t,d[m+3],22,-1044525330),t=md5ff(t,n,f,e,d[m+4],7,-176418897),e=md5ff(e,t,n,f,d[m+5],12,1200080426),f=md5ff(f,e,t,n,d[m+6],17,-1473231341),n=md5ff(n,f,e,t,d[m+7],22,-45705983),t=md5ff(t,n,f,e,d[m+8],7,1770035416),e=md5ff(e,t,n,f,d[m+9],12,-1958414417),f=md5ff(f,e,t,n,d[m+10],17,-42063),n=md5ff(n,f,e,t,d[m+11],22,-1990404162),t=md5ff(t,n,f,e,d[m+12],7,1804603682),e=md5ff(e,t,n,f,d[m+13],12,-40341101),f=md5ff(f,e,t,n,d[m+14],17,-1502002290),n=md5ff(n,f,e,t,d[m+15],22,1236535329),t=md5gg(t,n,f,e,d[m+1],5,-165796510),e=md5gg(e,t,n,f,d[m+6],9,-1069501632),f=md5gg(f,e,t,n,d[m+11],14,643717713),n=md5gg(n,f,e,t,d[m],20,-373897302),t=md5gg(t,n,f,e,d[m+5],5,-701558691),e=md5gg(e,t,n,f,d[m+10],9,38016083),f=md5gg(f,e,t,n,d[m+15],14,-660478335),n=md5gg(n,f,e,t,d[m+4],20,-405537848),t=md5gg(t,n,f,e,d[m+9],5,568446438),e=md5gg(e,t,n,f,d[m+14],9,-1019803690),f=md5gg(f,e,t,n,d[m+3],14,-187363961),n=md5gg(n,f,e,t,d[m+8],20,1163531501),t=md5gg(t,n,f,e,d[m+13],5,-1444681467),e=md5gg(e,t,n,f,d[m+2],9,-51403784),f=md5gg(f,e,t,n,d[m+7],14,1735328473),n=md5gg(n,f,e,t,d[m+12],20,-1926607734),t=md5hh(t,n,f,e,d[m+5],4,-378558),e=md5hh(e,t,n,f,d[m+8],11,-2022574463),f=md5hh(f,e,t,n,d[m+11],16,1839030562),n=md5hh(n,f,e,t,d[m+14],23,-35309556),t=md5hh(t,n,f,e,d[m+1],4,-1530992060),e=md5hh(e,t,n,f,d[m+4],11,1272893353),f=md5hh(f,e,t,n,d[m+7],16,-155497632),n=md5hh(n,f,e,t,d[m+10],23,-1094730640),t=md5hh(t,n,f,e,d[m+13],4,681279174),e=md5hh(e,t,n,f,d[m],11,-358537222),f=md5hh(f,e,t,n,d[m+3],16,-722521979),n=md5hh(n,f,e,t,d[m+6],23,76029189),t=md5hh(t,n,f,e,d[m+9],4,-640364487),e=md5hh(e,t,n,f,d[m+12],11,-421815835),f=md5hh(f,e,t,n,d[m+15],16,530742520),n=md5hh(n,f,e,t,d[m+2],23,-995338651),t=md5ii(t,n,f,e,d[m],6,-198630844),e=md5ii(e,t,n,f,d[m+7],10,1126891415),f=md5ii(f,e,t,n,d[m+14],15,-1416354905),n=md5ii(n,f,e,t,d[m+5],21,-57434055),t=md5ii(t,n,f,e,d[m+12],6,1700485571),e=md5ii(e,t,n,f,d[m+3],10,-1894986606),f=md5ii(f,e,t,n,d[m+10],15,-1051523),n=md5ii(n,f,e,t,d[m+1],21,-2054922799),t=md5ii(t,n,f,e,d[m+8],6,1873313359),e=md5ii(e,t,n,f,d[m+15],10,-30611744),f=md5ii(f,e,t,n,d[m+6],15,-1560198380),n=md5ii(n,f,e,t,d[m+13],21,1309151649),t=md5ii(t,n,f,e,d[m+4],6,-145523070),e=md5ii(e,t,n,f,d[m+11],10,-1120210379),f=md5ii(f,e,t,n,d[m+2],15,718787259),n=md5ii(n,f,e,t,d[m+9],21,-343485551),t=safeAdd(t,i),n=safeAdd(n,g),f=safeAdd(f,h),e=safeAdd(e,r);}return [t,n,f,e]}function bytesToWords(d){if(0===d.length)return [];const m=8*d.length,t=new Uint32Array(getOutputLength(m));for(let n=0;n<m;n+=8)t[n>>5]|=(255&d[n/8])<<n%32;return t}function safeAdd(d,m){const t=(65535&d)+(65535&m);return (d>>16)+(m>>16)+(t>>16)<<16|65535&t}function bitRotateLeft(d,m){return d<<m|d>>>32-m}function md5cmn(d,m,t,n,f,e){return safeAdd(bitRotateLeft(safeAdd(safeAdd(m,d),safeAdd(n,e)),f),t)}function md5ff(d,m,t,n,f,e,i){return md5cmn(m&t|~m&n,d,m,f,e,i)}function md5gg(d,m,t,n,f,e,i){return md5cmn(m&n|t&~n,d,m,f,e,i)}function md5hh(d,m,t,n,f,e,i){return md5cmn(m^t^n,d,m,f,e,i)}function md5ii(d,m,t,n,f,e,i){return md5cmn(t^(m|~n),d,m,f,e,i)}

  v35("v3",48,md5);

  const randomUUID="undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var native = {randomUUID:randomUUID};

  function v4(r,n,t){if(native.randomUUID&&!n&&!r)return native.randomUUID();const i=(r=r||{}).random||(r.rng||rng)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,n){t=t||0;for(let r=0;r<16;++r)n[t+r]=i[r];return n}return unsafeStringify(i)}

  function f(t,e,r,n){switch(t){case 0:return e&r^~e&n;case 1:case 3:return e^r^n;case 2:return e&r^e&n^r&n}}function ROTL(t,e){return t<<e|t>>>32-e}function sha1(t){const e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);const n=t.length/4+2,o=Math.ceil(n/16),a=new Array(o);for(let e=0;e<o;++e){const r=new Uint32Array(16);for(let n=0;n<16;++n)r[n]=t[64*e+4*n]<<24|t[64*e+4*n+1]<<16|t[64*e+4*n+2]<<8|t[64*e+4*n+3];a[e]=r;}a[o-1][14]=8*(t.length-1)/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=8*(t.length-1)&4294967295;for(let t=0;t<o;++t){const n=new Uint32Array(80);for(let e=0;e<16;++e)n[e]=a[t][e];for(let t=16;t<80;++t)n[t]=ROTL(n[t-3]^n[t-8]^n[t-14]^n[t-16],1);let o=r[0],c=r[1],l=r[2],s=r[3],h=r[4];for(let t=0;t<80;++t){const r=Math.floor(t/20),a=ROTL(o,5)+f(r,c,l,s)+h+e[r]+n[t]>>>0;h=s,s=l,l=ROTL(c,30)>>>0,c=o,o=a;}r[0]=r[0]+o>>>0,r[1]=r[1]+c>>>0,r[2]=r[2]+l>>>0,r[3]=r[3]+s>>>0,r[4]=r[4]+h>>>0;}return [r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]}

  v35("v5",80,sha1);

  var UserTransientId=function(t){var i=this;this.toString=function(){return i.utid},this.utid=t;};

  var PageViewId=function(){function t(t){var n=this;this.toString=function(){return n.pvid},this.pvid=t;}return t.generate=function(){return new t("".concat(v4(),"-").concat(Math.floor(Date.now()/1e3),"-").concat(String(1).padStart(10,"0")))},t.fromCookie=function(n){var r=api.get(n);if(r)return new t(r)},t.prototype.getUserTransientId=function(){return new UserTransientId(this.pvid.substring(0,36))},t}();

  var UserInteraction=function(){function t(t){var n=this;this.toString=function(){return String(n.state).padStart(4,"0")},this.state=t||1;}return t.prototype.increment=function(){this.state+=1;},t}();

  function readDataLayer(){var i,e,a=void 0,d=void 0,t=void 0;if(window.dataLayer&&window.dataLayer instanceof Array)try{for(var n=__values(window.dataLayer),r=n.next();!r.done;r=n.next()){var p=r.value;"de.ippen-digital.page.pageViewId"in p&&p["de.ippen-digital.page.pageViewId"]&&(a=p["de.ippen-digital.page.pageViewId"]),"de.ippen-digital.user.transientId"in p&&p["de.ippen-digital.user.transientId"]&&(d=p["de.ippen-digital.user.transientId"]),"de.ippen-digital.cms.cid"in p&&p["de.ippen-digital.cms.cid"]&&(t=parseInt(p["de.ippen-digital.cms.cid"]));}}catch(e){i={error:e};}finally{try{r&&!r.done&&(e=n.return)&&e.call(n);}finally{if(i)throw i.error}}return {pvid:a,utid:d,cid:t}}

  function trackDevEvent(e,t,a,n,o,i,s,d){fetch("".concat(e,"/dev"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({metadata:{key:d},origin:{system:t,useCase:a},cmsClientId:s,pageViewId:n,payload:i,userAgent:o})});}

  function cmsClientContext(e){return {schema:"iglu:de.id.bi.audience/cms_client/jsonschema/1-0-0",data:{cid:e}}}

  var DEFAULT_ID="bi-audience-hub";var Tracker=function(){function e(e,t,n,i,r,o,s,a,c){var d=this;this.cid=e,this.pageViewId=t,this.userTransientId=n,this.userInteraction=i,this.activeView=r,this.trackerId=a,this.endpoint=s,this.originSystem=o,this.activeView.addEventListener((function(e){var t=e.id,n=getElementClasses(e),i=getElementShelf("data-id-av",e),r=i.sht,o=i.shn,s=i.p;"ActiveView"!==r&&console.warn('element has the wrong shelf type for active view, found "'.concat(r,'", expected "ActiveView"')),d.sendIndependentActiveView("ActiveView",o,t,n,s);})),newTracker(a,s,{postPath:"/bi/doop/",appId:o,discoverRootDomain:!0,cookieSameSite:"Lax",plugins:__spreadArray([LinkClickTrackingPlugin()],__read(c),!1)});}return e.prototype.sendPageView=function(){var e=[pageViewContext(this.pageViewId),userContext(this.userTransientId)];(this.cid||0===this.cid)&&e.push(cmsClientContext(this.cid)),trackPageView({context:e},[this.trackerId]);},e.prototype.enableLinkTracking=function(){var e=this;enableLinkClickTracking({context:[function(){return pageViewContext(e.pageViewId)},function(){return userContext(e.userTransientId)},function(){return e.cid||0===e.cid?cmsClientContext(e.cid):null},function(e){try{var t=getElementShelf("data-id-sh",e),n=t.shn,i=t.sht,r=t.p;return "Link"!==i&&console.warn('anchor element shelf has the wrong type, found "'.concat(i,', expected "Link""')),shelfContext(i,n,r)}catch(t){return console.warn("found anchor element without shelf:",e),null}},function(){return userInteractionContext(e.pageViewId,e.userInteraction)},function(){return e.userInteraction.increment(),null}]},[this.trackerId]);},e.prototype.refreshLinkTracking=function(){refreshLinkClickTracking([this.trackerId]);},e.prototype.sendIndependentLinkClick=function(e,t,n,i,r,o){var s=[pageViewContext(this.pageViewId),userContext(this.userTransientId),shelfContext("Link",e,o),userInteractionContext(this.pageViewId,this.userInteraction)];(this.cid||0===this.cid)&&s.push(cmsClientContext(this.cid));var a=linkClickEvent(t,n,i,r);this.userInteraction.increment(),trackLinkClick({targetUrl:a.data.targetUrl,elementClasses:a.data.elementClasses,elementId:a.data.elementId,elementTarget:a.data.elementTarget,context:s});},e.prototype.trackElementClick=function(e,t,n,i){var r=this;n.addEventListener("click",(function(){var o=n.id,s=getElementClasses(n);r.sendIndependentElementClick(e,t,o,s,i);}),{once:!0});},e.prototype.sendIndependentElementClick=function(e,t,n,i,r){var o=[pageViewContext(this.pageViewId),userContext(this.userTransientId),shelfContext(e,t,r),userInteractionContext(this.pageViewId,this.userInteraction)];(this.cid||0===this.cid)&&o.push(cmsClientContext(this.cid));var s=elementClickEvent(n,i);this.userInteraction.increment(),trackSelfDescribingEvent({context:o,event:s},[this.trackerId]);},e.prototype.trackElementActiveView=function(e){this.activeView.observe(e);},e.prototype.sendIndependentActiveView=function(e,t,n,i,r){var o=[pageViewContext(this.pageViewId),userContext(this.userTransientId),shelfContext(e,t,r),userInteractionContext(this.pageViewId,this.userInteraction)];(this.cid||0===this.cid)&&o.push(cmsClientContext(this.cid));var s=elementActiveViewEvent(n,i);this.userInteraction.increment(),trackSelfDescribingEvent({context:o,event:s},[this.trackerId]);},e.prototype.sendDevEvent=function(e,t,n){var i=navigator.userAgent;trackDevEvent(this.endpoint,this.originSystem,e,this.pageViewId.toString(),i,t,this.cid,n);},e}();function CreateTracker(e){if(!e.originSystem)throw new Error("Invalid originSystem");if(!e.endpoint)throw new Error("Invalid endpoint");var t,n,i,r=e.originSystem,o=e.endpoint,s=e.id?e.id:DEFAULT_ID,a=e.plugins?e.plugins:[],c=readDataLayer();if(e.pageViewId)t=new PageViewId(e.pageViewId);else if(c.pvid)t=new PageViewId(c.pvid);else {if(!0!==e.generatePageViewIdIfMissing)throw new Error("PageViewId not found");t=PageViewId.generate();}if(e.userTransientId)n=new UserTransientId(e.userTransientId);else if(c.utid)n=new UserTransientId(c.utid);else {if(!0!==e.generatePageViewIdIfMissing)throw new Error("UserTransientId not found");n=t.getUserTransientId();}if(e.cid)i=e.cid;else {if(!c.cid)throw new Error("cid not found");i=c.cid;}var d=new UserInteraction(e.firstUserInteraction),l=new ActiveView(e.activeViewThreshold,e.activeViewTime,e.activeViewRoot);return new Tracker(i,t,n,d,l,r,o,s,a)}

  !function(){var e=document.currentScript;if(e){var t=e.getAttribute("data-id-origin-system"),r=e.getAttribute("data-id-address"),a=e.getAttribute("data-id-features"),n=getFeatureFlags(a);if(t&&r){var i=CreateTracker({originSystem:t,endpoint:r,generatePageViewIdIfMissing:n.generate_page_view_id});if(n.track_pageview&&i.sendPageView(),n.enable_link_tracking&&(i.enableLinkTracking(),document.addEventListener("id-refresh",(function(){return i.refreshLinkTracking()}))),n.enable_element_click_tracking){var d=new TrackedElements("[data-id-ec]","data-id-em",(function(e){var t=getElementShelf("data-id-ec",e),r=t.shn,a=t.sht,n=t.p;i.trackElementClick(a,r,e,n);}));d.refresh(),document.addEventListener("id-refresh",(function(){return d.refresh()}));}if(n.enable_active_view_tracking){var c=new TrackedElements("[data-id-av]","data-id-am",(function(e){var t=getElementShelf("data-id-av",e),r=t.shn,a=t.sht,n=t.p;i.trackElementActiveView(e),i.trackElementClick(a,r,e,n);}));c.refresh(),document.addEventListener("id-refresh",(function(){return c.refresh()}));}}}}();

})();
//# sourceMappingURL=tracker.js.map