Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@snowplow/browser-tracker-core

Package Overview
Dependencies
Maintainers
3
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@snowplow/browser-tracker-core - npm Package Compare versions

Comparing version 4.0.2 to 4.0.3

4

dist/index.umd.min.js
/*!
* Core functionality for Snowplow Browser trackers v4.0.2 (http://bit.ly/sp-js)
* Core functionality for Snowplow Browser trackers v4.0.3 (http://bit.ly/sp-js)
* Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang

@@ -7,3 +7,3 @@ * Licensed under BSD-3-Clause

"use strict";!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).snowplowBrowserTrackerCore={})}(this,(function(e){function t(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(a,u)}c((r=r.apply(e,t||[])).next())}))}function n(e,t){function n(n){return function(c){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;u&&(u=0,n[0]&&(a=0)),a;)try{if(r=1,o&&(i=2&n[0]?o.return:n[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,n[1])).done)return i;switch(o=0,i&&(n=[2&n[0],i.value]),n[0]){case 0:case 1:i=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,o=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=0<i.length&&i[i.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&n[1]<i[3]))a.label=n[1];else if(6===n[0]&&a.label<i[1])a.label=i[1],i=n;else{if(!(i&&a.label<i[2])){i[2]&&a.ops.pop(),a.trys.pop();continue}a.label=i[2],a.ops.push(n)}}n=t.call(e,a)}catch(e){n=[6,e],o=0}finally{r=i=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,c])}}var r,o,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=n(0),u.throw=n(1),u.return=n(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u}function r(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function o(){if(!we&&!(we="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return we(ke)}function i(e,t,n){if(Te.randomUUID&&!t&&!e)return Te.randomUUID();if((e=(e=e||{}).random||(e.rng||o)())[6]=15&e[6]|64,e[8]=63&e[8]|128,t){n=n||0;for(var r=0;16>r;++r)t[n+r]=e[r];return t}return function(e,t=0){return(me[e[t+0]]+me[e[t+1]]+me[e[t+2]]+me[e[t+3]]+"-"+me[e[t+4]]+me[e[t+5]]+"-"+me[e[t+6]]+me[e[t+7]]+"-"+me[e[t+8]]+me[e[t+9]]+"-"+me[e[t+10]]+me[e[t+11]]+me[e[t+12]]+me[e[t+13]]+me[e[t+14]]+me[e[t+15]]).toLowerCase()}(e)}function a(){var e,t={},n=[],r=[],o=[],i=function(e,n){null!=n&&""!==n&&(t[e]=n)};return{add:i,addDict:function(e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&i(t,e[t])},addJson:function(e,t,o){o&&c(o)&&(e={keyIfEncoded:e,keyIfNotEncoded:t,json:o},r.push(e),n.push(e))},addContextEntity:function(e){o.push(e)},getPayload:function(){return t},getJson:function(){return n},withJsonProcessor:function(t){e=t},build:function(){return null==e||e(this,r,o),t}}}function u(e){return function(t,n,o){for(var i=function(n,r,o){if(n=JSON.stringify(n),e){if(o=t.add,n){var i=0,a=0,u=[];if(n){n=unescape(encodeURIComponent(n));do{var c=n.charCodeAt(i++),s=n.charCodeAt(i++),l=n.charCodeAt(i++),f=c<<16|s<<8|l;c=f>>18&63,s=f>>12&63,l=f>>6&63,f&=63,u[a++]=xe.charAt(c)+xe.charAt(s)+xe.charAt(l)+xe.charAt(f)}while(i<n.length);i=u.join(""),n=((n=n.length%3)?i.slice(0,n-3):i)+"===".slice(n||3)}n=n.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o.call(t,r,n)}else t.add(o,n)},a=function(n,r){if(!n){var o=t.getPayload();if(e?o.cx:o.co){var i=(n=JSON).parse;if(e){if(o=o.cx){switch(4-o.length%4){case 2:o+="==";break;case 3:o+="="}o=function(e){var t,n=0,r=0,o="",i=[];if(!e)return e;e+="";do{var a=xe.indexOf(e.charAt(n++)),u=xe.indexOf(e.charAt(n++));o=xe.indexOf(e.charAt(n++));var c=xe.indexOf(e.charAt(n++)),s=a<<18|u<<12|o<<6|c;a=s>>16&255,u=s>>8&255,s&=255,i[r++]=64===o?String.fromCharCode(a):64===c?String.fromCharCode(a,u):String.fromCharCode(a,u,s)}while(n<e.length);return o=i.join(""),t=o.replace(/\0+$/,""),decodeURIComponent(t.split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))}(o=o.replace(/-/g,"+").replace(/_/g,"/"))}}else o=o.co;n=i.call(n,o)}else n=void 0}return n?n.data=n.data.concat(r.data):n=r,n},u=void 0,c=0;c<n.length;c++){var s=n[c];"cx"===s.keyIfEncoded?u=a(u,s.json):i(s.json,s.keyIfEncoded,s.keyIfNotEncoded)}n.length=0,o.length&&(u=a(u,n={schema:"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",data:r([],o,!0)}),o.length=0),u&&i(u,"cx","co")}}function c(e){if(!s(e))return!1;for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function s(e){return null!=e&&(e.constructor==={}.constructor||e.constructor===[].constructor)}function l(){var e=[],t=[],n={},r={};return{getGlobalPrimitives:function(){return e.concat(Object.values(n))},getConditionalProviders:function(){return t.concat(Object.values(r))},addGlobalContexts:function(o){if(Array.isArray(o)){for(var i=[],a=[],u=0;u<o.length;u++){var c=o[u];b(c)?i.push(c):m(c)&&a.push(c)}e=e.concat(a),t=t.concat(i)}else for(i=0,o=Object.entries(o);i<o.length;i++)a=(c=o[i])[0],b(c=c[1])?r[a]=c:m(c)&&(n[a]=c)},clearGlobalContexts:function(){t=[],e=[],r={},n={}},removeGlobalContexts:function(o){for(var i=function(o){"string"==typeof o?(delete r[o],delete n[o]):b(o)?t=t.filter((function(e){return!C(o,e)})):m(o)&&(e=e.filter((function(e){return!C(o,e)})))},a=0;a<o.length;a++)i(o[a])},getApplicableContexts:function(o){e:{for(var i=0,a=o.getJson();i<a.length;i++){var u=a[i];if("ue_px"===u.keyIfEncoded&&"object"==typeof u.json.data&&"string"==typeof(u=u.json.data.schema)){i=u;break e}}i=""}u="string"==typeof(a=o.getPayload().e)?a:"",a=[];var c=x(e.concat(Object.values(n)),o,u,i);return a.push.apply(a,c),o=function(e,t,n,r){var o;return e=T(e).map((function(e){e:{if(y(e)){var o=e[0],i=!1;try{i=o({event:t.getPayload(),eventType:n,eventSchema:r})}catch(e){i=!1}if(!0===i){e=x(e[1],t,n,r);break e}}else if(w(e)&&function(e,t){var n=0,r=0,o=e.accept;return Array.isArray(o)?e.accept.some((function(e){return S(e,t)}))&&r++:"string"==typeof o&&S(o,t)&&r++,o=e.reject,Array.isArray(o)?e.reject.some((function(e){return S(e,t)}))&&n++:"string"==typeof o&&S(o,t)&&n++,0<r&&0===n}(e[0],r)){e=x(e[1],t,n,r);break e}e=[]}if(e&&0!==e.length)return e})),(o=[]).concat.apply(o,e.filter((function(e){return null!=e&&e.filter(Boolean)})))}(t.concat(Object.values(r)),o,u,i),a.push.apply(a,o),a}}}function f(e){return!!((e=e.split("."))&&1<e.length)&&function(e){if("*"===e[0]||"*"===e[1])return!1;if(0<e.slice(2).length){var t=!1,n=0;for(e=e.slice(2);n<e.length;n++)if("*"===e[n])t=!0;else if(t)return!1;return!0}return 2==e.length}(e)}function d(e){if(null!==(e=/^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))&&f(e[1]))return e.slice(1,6)}function v(e){if(e=d(e)){var t=e[0];return 5===e.length&&f(t)}return!1}function g(e){return function(e){return Array.isArray(e)&&e.every((function(e){return"string"==typeof e}))}(e)?e.every((function(e){return v(e)})):"string"==typeof e&&v(e)}function p(e){return!!(c(e)&&"schema"in e&&"data"in e)&&("string"==typeof e.schema&&"object"==typeof e.data)}function h(e){return"function"==typeof e&&1>=e.length}function m(e){return h(e)||p(e)}function y(e){return!(!Array.isArray(e)||2!==e.length)&&(Array.isArray(e[1])?h(e[0])&&e[1].every(m):h(e[0])&&m(e[1]))}function w(e){return!(!Array.isArray(e)||2!==e.length)&&(!!function(e){var t=0;if(null!=e&&"object"==typeof e&&!Array.isArray(e)){if(Object.prototype.hasOwnProperty.call(e,"accept")){if(!g(e.accept))return!1;t+=1}if(Object.prototype.hasOwnProperty.call(e,"reject")){if(!g(e.reject))return!1;t+=1}return 0<t&&2>=t}return!1}(e[0])&&(Array.isArray(e[1])?e[1].every(m):m(e[1])))}function b(e){return y(e)||w(e)}function S(e,t){if(!v(e))return!1;if(e=d(e),t=null!==(t=/^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(t))?t.slice(1,6):void 0,e&&t){if(!function(e,t){if(t=t.split("."),e=e.split("."),t&&e){if(t.length!==e.length)return!1;for(var n=0;n<e.length;n++)if(!k(t[n],e[n]))return!1;return!0}return!1}(e[0],t[0]))return!1;for(var n=1;5>n;n++)if(!k(e[n],t[n]))return!1;return!0}return!1}function k(e,t){return e&&t&&"*"===e||e===t}function T(e){return Array.isArray(e)?e:[e]}function x(e,t,n,r){var o;return e=T(e).map((function(e){e:if(p(e))e=[e];else{if(h(e)){t:{var o=void 0;try{if(o=e({event:t.getPayload(),eventType:n,eventSchema:r}),Array.isArray(o)&&o.every(p)||p(o)){var i=o;break t}i=void 0;break t}catch(e){}i=void 0}if(p(i)){e=[i];break e}if(Array.isArray(i)){e=i;break e}}e=void 0}if(e&&0!==e.length)return e})),(o=[]).concat.apply(o,e.filter((function(e){return null!=e&&e.filter(Boolean)})))}function A(e,t){return"function"==typeof e?e===t:JSON.stringify(e)===JSON.stringify(t)}function C(e,t){if(b(e)){if(!b(t))return!1;var n=e[1],r=t[1];return!!A(e[0],t[0])&&(Array.isArray(n)?!(!Array.isArray(r)||n.length!==r.length)&&n.reduce((function(e,t,n){return e&&A(t,r[n])}),!0):!Array.isArray(r)&&A(n,r))}return!!m(e)&&(!!m(t)&&A(e,t))}function P(e){void 0===e&&(e={});var t,n,o,a,c,f,d,v=e.base64,g=e.corePlugins,p=null!=g?g:[];t=null==v||v,n=p,o=e.callback,a=function(e){return{addPluginContexts:function(t){var n=t?r([],t,!0):[];return e.forEach((function(e){try{e.contexts&&n.push.apply(n,e.contexts())}catch(e){Ae.error("Error adding plugin contexts",e)}})),n}}}(n),c=l(),f=t,d={};var h=he(he({},e={track:function(e,t,r){if(e.withJsonProcessor(u(f)),e.add("eid",i()),e.addDict(d),r=function(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()}}(r),e.add(r.type,r.value.toString()),t=function(e,t){e=c.getApplicableContexts(e);var n=[];return t&&t.length&&n.push.apply(n,t),e&&e.length&&n.push.apply(n,e),n}(e,a.addPluginContexts(t)),void 0!==(t=t&&t.length?{schema:"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",data:t}:void 0)&&e.addJson("cx","co",t),n.forEach((function(t){try{t.beforeTrack&&t.beforeTrack(e)}catch(e){Ae.error("Plugin beforeTrack",e)}})),!n.find((function(t){try{return t.filter&&!1===t.filter(e.build())}catch(e){return Ae.error("Plugin filter",e),!1}}))){"function"==typeof o&&o(e);var s=e.build();return n.forEach((function(e){try{e.afterTrack&&e.afterTrack(s)}catch(e){Ae.error("Plugin afterTrack",e)}})),s}},addPayloadPair:function(e,t){d[e]=t},getBase64Encoding:function(){return f},setBase64Encoding:function(e){f=e},addPayloadDict:function(e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(d[t]=e[t])},resetPayloadPairs:function(e){d=s(e)?e:{}},setTrackerVersion:function(e){d.tv=e},setTrackerNamespace:function(e){d.tna=e},setAppId:function(e){d.aid=e},setPlatform:function(e){d.p=e},setUserId:function(e){d.uid=e},setScreenResolution:function(e,t){d.res=e+"x"+t},setViewport:function(e,t){d.vp=e+"x"+t},setColorDepth:function(e){d.cd=e},setTimezone:function(e){d.tz=e},setLang:function(e){d.lang=e},setIpAddress:function(e){d.ip=e},setUseragent:function(e){d.ua=e},addGlobalContexts:function(e){c.addGlobalContexts(e)},clearGlobalContexts:function(){c.clearGlobalContexts()},removeGlobalContexts:function(e){c.removeGlobalContexts(e)}}),{addPlugin:function(e){var t,n;e=e.plugin,p.push(e),null===(t=e.logger)||void 0===t||t.call(e,Ae),null===(n=e.activateCorePlugin)||void 0===n||n.call(e,h)}});return null==p||p.forEach((function(e){var t,n;null===(t=e.logger)||void 0===t||t.call(e,Ae),null===(n=e.activateCorePlugin)||void 0===n||n.call(e,h)})),h}function I(e){var t=e.maxSize,n=void 0===t?1e3:t,o=r([],void 0===(e=e.events)?[]:e,!0),i=function(){return Promise.resolve(o.length)};return{count:i,add:function(e){for(o.push(e);o.length>n;)o.shift();return i()},removeHead:function(e){for(var t=0;t<e;t++)o.shift();return Promise.resolve()},iterator:function(){var e=0,t=r([],o,!0);return{next:function(){return e<t.length?Promise.resolve({value:t[e++],done:!1}):Promise.resolve({value:void 0,done:!0})}}},getAll:function(){return Promise.resolve(r([],o,!0))},getAllPayloads:function(){return Promise.resolve(o.map((function(e){return e.payload})))}}}function E(e){function t(){var e=S.reduce((function(e,t){return e+(k?t.getPOSTRequestBytesCount():t.getGETRequestBytesCount())}),0);return k&&(e+=88),e}function n(){var e=new Headers;return k&&e.append("Content-Type","application/json; charset=UTF-8"),v&&Object.keys(v).forEach((function(t){e.append(t,v[t])})),0<S.length&&S[0].getServerAnonymization()&&e.append("SP-Anonymous","*"),e}function r(){var e=u;return u.includes("://")||(e="".concat(s,"://").concat(u)),l&&(e="".concat(e,":").concat(l)),e+(k?m:"/i")}function o(e,t){return a(!1),d=new AbortController,f=setTimeout((function(){console.error("Request timed out"),f=void 0,a(!1,"Request timed out")}),null!=g?g:5e3),t=he({headers:n(),signal:d.signal,keepalive:h,credentials:b},t),new Request(e,t)}function i(){var e=function(e){for(var t=(new Date).getTime().toString(),n=0;n<e.length;n++)e[n].stm=t;return e}(S.map((function(e){return e.getPOSTRequestBody()})));return o(r(),{method:"POST",body:JSON.stringify({schema:"iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4",data:e})})}function a(e,t){if(void 0!==f&&(clearTimeout(f),f=void 0),void 0!==d){var n=d;d=void 0,e||n.abort(t)}}var u=e.endpoint,c=e.protocol,s=void 0===c?"https":c,l=e.port;c=e.eventMethod;var f,d,v=e.customHeaders,g=e.connectionTimeout,p=e.keepalive,h=void 0!==p&&p,m=void 0===(p=e.postPath)?"/com.snowplowanalytics.snowplow/tp2":p,y=void 0===(p=e.useStm)||p,w=void 0===(p=e.maxPostBytes)?4e4:p,b=void 0===(e=e.credentials)?"include":e,S=[],k="post"===(void 0===c?"post":c).toLowerCase();return{addEvent:function(e){return!(0<S.length&&(0<S.length?S[0].getServerAnonymization():void 0)!==e.getServerAnonymization())&&(S.push(e),!0)},getEvents:function(){return S},toRequest:function(){if(0!==S.length){if(k)return i();if(1!==S.length)throw Error("Only one event can be sent in a GET request");return o(S[0].getGETRequestURL(r(),y),{method:"GET"})}},countBytes:t,countEvents:function(){return S.length},isFull:function(){return k?t()>=w:1<=S.length},closeRequest:a}}function O(e){for(var t=0,n=0;n<e.length;n++){var r=e.charCodeAt(n);127>=r?t+=1:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,n++):t=65535>r?t+3:t+4}return t}function L(e){function t(){return e.payload}function n(e){if(null===o){var t,n={co:!0,cx:!0},r=[];for(t in e)e.hasOwnProperty(t)&&!n[t]&&r.push(t+"="+encodeURIComponent(e[t]));for(var i in n)e.hasOwnProperty(i)&&n[i]&&r.push(i+"="+encodeURIComponent(e[i]));o="?"+r.join("&")}return o}function r(){return null===i&&(i=function(e){return Object.keys(e).map((function(t){return[t,e[t]]})).reduce((function(e,t){return e[t[0]]=t[1].toString(),e}),{})}(t())),i}var o=null,i=null,a=null,u=null;return{getPayload:t,getServerAnonymization:function(){var t;return null!==(t=e.svrAnon)&&void 0!==t&&t},getGETRequestURL:function(e,r){var o=n(t());return r?e+o.replace("?","?stm="+(new Date).getTime()+"&"):e+o},getGETRequestBytesCount:function(){if(null===a){var e=n(t());a=O(e)}return a},getPOSTRequestBody:r,getPOSTRequestBytesCount:function(){return null===u&&(u=O(JSON.stringify(r()))),u}}}function D(e){function r(e,t){void 0!==C&&setTimeout((function(){try{null==C||C(e,t)}catch(e){Ae.error("Error in onRequestFailure",e)}}),0)}function o(e){return t(this,void 0,void 0,(function(){var t,o,i,a,u,c;return n(this,(function(n){switch(n.label){case 0:if(void 0===(t=e.toRequest()))throw Error("Empty batch");o=e.getEvents().map((function(e){return e.getPayload()})),n.label=1;case 1:return n.trys.push([1,4,,5]),[4,O(t)];case 2:return[4,(i=n.sent()).text()];case 3:return n.sent(),e.closeRequest(!0),i.ok?(function(e,t){void 0!==P&&setTimeout((function(){try{null==P||P(e,t)}catch(e){Ae.error("Error in onRequestSuccess",e)}}),0)}(o,i),[2,{success:!0,retry:!1,status:i.status}]):(a=function(e){return!(200<=e&&300>e||!A||!x.includes(e)&&T.includes(e))}(i.status),r({events:o,status:i.status,message:i.statusText,willRetry:a},i),[2,{success:!1,retry:a,status:i.status}]);case 4:return u=n.sent(),e.closeRequest(!1),c="string"==typeof u?u:u?u.message:"Unknown error",r({events:o,message:c,willRetry:!0}),[2,{success:!1,retry:!0}];case 5:return[2]}}))}))}function i(){return E({endpoint:s,protocol:v,port:g,eventMethod:f,customHeaders:y,connectionTimeout:b,keepalive:S,maxPostBytes:p,useStm:D,credentials:j,postPath:d})}function a(){return t(this,void 0,void 0,(function(){var e;return n(this,(function(t){switch(t.label){case 0:return!k||R?[3,2]:(R=!0,e=new Request(k,{method:"GET"}),[4,O(e)]);case 1:t.sent(),t.label=2;case 2:return[2]}}))}))}function u(){return t(this,void 0,void 0,(function(){var e;return n(this,(function(t){switch(t.label){case 0:if(B)return[3,5];B=!0,t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,c()];case 2:return t.sent(),[3,5];case 3:return e=t.sent(),Ae.error("Error sending events",e),[3,5];case 4:return B=!1,[7];case 5:return[2]}}))}))}function c(){return t(this,void 0,void 0,(function(){var e,t,r,u,s,l,f,d,v;return n(this,(function(n){switch(n.label){case 0:return[4,a()];case 1:n.sent(),e=i(),t=U.iterator(),n.label=2;case 2:return e.isFull()?[3,4]:[4,t.next()];case 3:return r=n.sent(),u=r.value,r.done||void 0===u?[3,4]:(s=L(u),e.addEvent(s)?[3,2]:[3,4]);case 4:return 0===e.countEvents()?[2]:[4,o(e)];case 5:return l=n.sent(),f=l.success,d=l.retry,v=l.status,!f&&d?[3,7]:(f||Ae.error("Status ".concat(v,", will not retry.")),[4,U.removeHead(e.countEvents())]);case 6:n.sent(),n.label=7;case 7:return f?[4,c()]:[3,9];case 8:n.sent(),n.label=9;case 9:return[2]}}))}))}var s=e.endpoint,l=e.eventMethod,f=void 0===l?"post":l,d=e.postPath,v=e.protocol,g=e.port,p=void 0===(l=e.maxPostBytes)?4e4:l,h=e.maxGetBytes,m=void 0===(l=e.bufferSize)?1:l,y=e.customHeaders,w=e.serverAnonymization,b=e.connectionTimeout,S=e.keepalive,k=e.idService,T=void 0===(l=e.dontRetryStatusCodes)?[]:l,x=void 0===(l=e.retryStatusCodes)?[]:l,A=void 0===(l=e.retryFailedRequests)||l,C=e.onRequestFailure,P=e.onRequestSuccess,O=void 0===(l=e.customFetch)?fetch:l,D=e.useStm,U=void 0===(l=e.eventStore)?I({}):l,j=e.credentials,R=!1,B=!1,N="post"===f.toLowerCase();return T=T.concat([400,401,403,410,422]),{flush:u,input:function(e){return t(this,void 0,void 0,(function(){var t,r,a;return n(this,(function(n){switch(n.label){case 0:e:{if(n=r=L(t={payload:e,svrAnon:void 0!==(n=w)&&n}),N){var c=(n=n.getPOSTRequestBytesCount()+88)>p;c&&Ae.warn("Event ("+n+"B) too big, max is "+p)}else{if(void 0===h){n=!1;break e}(c=(n=n.getGETRequestBytesCount())>h)&&Ae.warn("Event ("+n+"B) too big, max is "+h)}n=c}return n?((a=i()).addEvent(r),[4,o(a)]):[3,2];case 1:return n.sent(),[3,5];case 2:return[4,U.add(t)];case 3:return n.sent()>=m?[4,u()]:[3,5];case 4:n.sent(),n.label=5;case 5:return[2]}}))}))},setCollectorUrl:function(e){s=e},setAnonymousTracking:function(e){w=e},setBufferSize:function(e){m=e}}}function U(e){try{var t=window.localStorage,n=t.getItem(e+".expires");if(null===n||+n>Date.now())return t.getItem(e);t.removeItem(e),t.removeItem(e+".expires")}catch(e){}}function j(e,t,n){void 0===n&&(n=63072e3);try{var r=window.localStorage,o=Date.now()+1e3*n;return r.setItem("".concat(e,".expires"),o.toString()),r.setItem(e,t),!0}catch(e){return!1}}function R(e){try{var t=window.localStorage;return t.removeItem(e),t.removeItem(e+".expires"),!0}catch(e){return!1}}function B(e){try{return window.sessionStorage.getItem(e)}catch(e){}}function N(e,t){try{return window.sessionStorage.setItem(e,t),!0}catch(e){return!1}}function V(e,t,n){var r,o=(new Date).getTime();t=he(he({},De),t);var i=n.domainUserId,a=n.userId,u=n.sessionId,c=n.sourceId,s=n.sourcePlatform,l=n.event,f=l.currentTarget;return l="function"==typeof t.reason?t.reason(l):null===(r=null==f?void 0:f.textContent)||void 0===r?void 0:r.trim(),e?[i,o,t.sessionId&&u,t.userId&&_(a||""),t.sourceId&&_(c||""),t.sourcePlatform&&s,t.reason&&_(l||"")].map((function(e){return e||""})).join(".").replace(/([.]*$)/,""):n.domainUserId+"."+o}function _(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function z(e){return!(!e||"string"!=typeof e.valueOf())}function M(e){return Number.isInteger&&Number.isInteger(e)||"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function q(){if("object"==typeof Intl&&"function"==typeof Intl.DateTimeFormat)return(new Intl.DateTimeFormat).resolvedOptions().timeZone}function F(e){if(!z(e)){e=e.text||"";var t=document.getElementsByTagName("title");t&&null!=t[0]&&(e=t[0].text)}return e}function H(e){var t=/^(?:(?:https?|ftp):)\/*(?:[^@]+@)?([^:/#]+)/.exec(e);return t?t[1]:e}function G(e){var t=e.length;return"."===e.charAt(--t)&&(e=e.slice(0,t)),"*."===e.slice(0,2)&&(e=e.slice(1)),e}function J(e){var t=window,n=Z("referrer",t.location.href)||Z("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 W(e,t,n,r){return e.addEventListener?(e.addEventListener(t,n,r),!0):e.attachEvent?e.attachEvent("on"+t,n):void(e["on"+t]=n)}function Z(e,t){return(e=new RegExp("^[^#]*[?&]"+e+"=([^&#]*)").exec(t))?decodeURIComponent(e[1].replace(/\+/g," ")):null}function Q(e,t,n){n=t+"="+n;var r=(e=e.split("#"))[0].split("?"),o=r.shift();if(r=r.join("?")){for(var i=!0,a=r.split("&"),u=0;u<a.length;u++)if(a[u].substr(0,t.length+1)===t+"="){i=!1,a[u]=n,r=a.join("&");break}i&&(r=n+"&"+r)}else r=n;return e[0]=o+"?"+r,e.join("#")}function X(e,t){for(var n=window.location.hostname,r="_sp_root_domain_test_"+(new Date).getTime(),o="_test_value_"+(new Date).getTime(),i=n.split("."),a=i.length-2;0<=a;a--){var u=i.slice(a).join(".");if($(r,o,0,"/",u,e,t),$(r)===o){for(Y(r,"/",u,e,t),n=K("_sp_root_domain_test_"),r=0;r<n.length;r++)Y(n[r],"/",u,e,t);return u}}return n}function Y(e,t,n,r,o){$(e,"",-1,t,n,r,o)}function K(e){for(var t=document.cookie.split("; "),n=[],r=0;r<t.length;r++)t[r].substring(0,e.length)===e&&n.push(t[r]);return n}function $(e,t,n,r,o,i,a){return 1<arguments.length?document.cookie=e+"="+encodeURIComponent(null!=t?t:"")+(n?"; Expires="+new Date(+new Date+1e3*n).toUTCString():"")+(r?"; Path="+r:"")+(o?"; Domain="+o:"")+(i?"; SameSite="+i:"")+(a?"; Secure":""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}function ee(e){return e.className.match(/\S+/g)||[]}function te(e,t){return e.hasOwnProperty("filter")&&e.filter?e.filter:t}function ne(e){var t={};if(e=e.allowlist||e.denylist){Array.isArray(e)||(e=[e]);for(var n=0;n<e.length;n++)t[e[n]]=!0}return t}function re(e,t){var n,r=null!==(n=e.eventStore)&&void 0!==n?n:function(e){function t(){return o?a().then((function(e){window.localStorage.setItem(i,JSON.stringify(e))})):Promise.resolve()}var n=e.maxLocalStorageQueueSize,r=void 0===n?1e3:n,o=void 0===(n=e.useLocalStorage)||n,i="snowplowOutQueue_".concat(e.trackerId),a=(e=function(){if(o){var e=window.localStorage.getItem(i);return e=e?JSON.parse(e):[],I({maxSize:r,events:e})}return I({maxSize:r})}()).getAll,u=e.add,c=e.count,s=e.removeHead;return{count:c,add:function(e){return u(e),t().then(c)},removeHead:function(e){return s(e),t()},iterator:e.iterator,getAll:a,getAllPayloads:e.getAllPayloads,setUseLocalStorage:function(e){o=e}}}(e);return e.eventStore=r,e=D(e),t.bufferFlushers.push(e.flush),{enqueueRequest:e.input,executeQueue:e.flush,setAnonymousTracking:e.setAnonymousTracking,setCollectorUrl:e.setCollectorUrl,setBufferSize:e.setBufferSize,setUseLocalStorage:function(e){r.hasOwnProperty("setUseLocalStorage")&&r.setUseLocalStorage(e)}}}function oe(e,t,n){return"translate.googleusercontent.com"===e?(""===n&&(n=t),e=H(t=null!=(e=(e=/^(?:https?|ftp)(?::\/*(?:[^?]+))([?][^#]+)/.exec(t))&&1<(null==e?void 0:e.length)?Z("u",e[1]):null)?e:"")):"cc.bingj.com"!==e&&"webcache.googleusercontent.com"!==e||(e=H(t=document.links[0].href)),[e,t,n]}function ie(e,t){return void 0===t&&(t={memorizedVisitCount:1}),t=t.memorizedVisitCount,"0"===e[0]?(e[7]=e[6],e[5]=e[4],e[3]++):e[3]=t,t=i(),e[6]=t,e[10]=0,e[8]="",e[9]=void 0,t}function ae(e){e[4]=Math.round((new Date).getTime()/1e3)}function ue(e,t,n){var r=e[9];return{userId:n?"00000000-0000-0000-0000-000000000000":e[1],sessionId:e[6],eventIndex:e[10],sessionIndex:e[3],previousSessionId:n?null:e[7]||null,storageMechanism:"localStorage"==t?"LOCAL_STORAGE":"COOKIE_1",firstEventId:e[8]||null,firstEventTimestamp:r?new Date(r).toISOString():null}}function ce(){return"ResizeObserver"in window?(Oe||(Oe=se()),function(){if(!Ue&&document&&document.body&&document.documentElement){Ue=!0;var e=new ResizeObserver((function(e){for(var t=0;t<e.length;t++){var n=e[t];n.target!==document.body&&n.target!==document.documentElement||(Oe=se())}}));e.observe(document.body),e.observe(document.documentElement)}}(),Oe):se()}function se(){var e=le;if("innerWidth"in window)var t=window.innerWidth,n=window.innerHeight;else t=(n=document.documentElement||document.body).clientWidth,n=n.clientHeight;e=e(Math.max(0,t)+je+Math.max(0,n)),t=le;var r=document.documentElement,o=document.body;return n=Math.max(r.clientWidth,r.offsetWidth,r.scrollWidth),r=Math.max(r.clientHeight,r.offsetHeight,r.scrollHeight,o?Math.max(o.offsetHeight,o.scrollHeight):0),{viewport:e,documentSize:t(n=isNaN(n)||isNaN(r)?"":n+je+r),resolution:le(screen.width+je+screen.height),colorDepth:screen.colorDepth,devicePixelRatio:window.devicePixelRatio,cookiesEnabled:window.navigator.cookieEnabled,online:window.navigator.onLine,browserLanguage:window.navigator.language||window.navigator.userLanguage,documentLanguage:document.documentElement.lang,webdriver:window.navigator.webdriver,deviceMemory:window.navigator.deviceMemory,hardwareConcurrency:window.navigator.hardwareConcurrency}}function le(e){return e&&e.split(je).map((function(e){return Math.floor(Number(e))})).join(je)}function fe(e,t,n,o,u,c){void 0===c&&(c={});var s=[];e=function(e,t,n,o,u,c){function l(){(tt=oe(window.location.hostname,window.location.href,J()))[1]!==rt&&(ot=J(rt)),nt=G(tt[0]),rt=tt[1]}function f(e){for(var t=function(e){return function(t){var n=t.currentTarget;t=V(e,Bt,{domainUserId:Ze,userId:Xe||void 0,sessionId:Qe,sourceId:at,sourcePlatform:it,event:t}),null!=n&&n.href&&(n.href=Q(n.href,"_sp",t))}}(Rt),n=0;n<document.links.length;n++){var r=document.links[n];!r.spDecorationEnabled&&e(r)&&(r.addEventListener("click",t,!0),r.addEventListener("mousedown",t,!0),r.spDecorationEnabled=!0)}}function d(e){if(_e){var t=/#.*/;e=e.replace(t,"")}return ze&&(t=/[{}]/g,e=e.replace(t,"")),e}function v(e){return(e=/^([a-z]+):/.exec(e))?e[1]:null}function g(e){return e=lt+e+"."+We,"localStorage"==Tt?U(e):"cookie"==Tt||"cookieAndLocalStorage"==Tt?Ue.getCookie(e):void 0}function p(){l(),We=Le((ft||nt)+(vt||"/")).slice(0,4)}function h(){qe=(new Date).getTime()}function m(){var e=y(),t=e[0];t<Fe?Fe=t:t>He&&(He=t),(e=e[1])<Ge?Ge=e:e>Je&&(Je=e),h()}function y(){var e=document.documentElement;return e?[e.scrollLeft||window.pageXOffset,e.scrollTop||window.pageYOffset]:[0,0]}function w(){var e=y(),t=e[0];He=Fe=t,Je=Ge=e=e[1]}function b(){return k(lt+"ses."+We,"*",wt)}function S(e){var t=lt+"id."+We,n=kt;return e=r([],e,!0),n&&(e[1]="",e[7]=""),e.shift(),k(t,n=e.join("."),yt)}function k(e,t,n){return!(kt&&!bt)&&("localStorage"==Tt?j(e,t,n):("cookie"==Tt||"cookieAndLocalStorage"==Tt)&&Ue.setCookie(e,t,n,vt,ft,gt,pt))}function T(e){var t=lt+"id."+We,n=lt+"ses."+We;R(t),R(n),Ue.deleteCookie(t,vt,ft,gt,pt),Ue.deleteCookie(n,vt,ft,gt,pt),null!=e&&e.preserveSession||(Qe=i(),At=1),null!=e&&e.preserveUser||(Ze=kt?"":i(),Xe=null)}function x(e){e&&e.stateStorageStrategy&&(c.stateStorageStrategy=e.stateStorageStrategy,Tt=Pe(c)),kt=!!c.anonymousTracking,bt=Ie(c),St=Ee(c),Ct.setUseLocalStorage("localStorage"==Tt||"cookieAndLocalStorage"==Tt),Ct.setAnonymousTracking(St)}function A(){if(!kt||bt){var e="none"!=Tt&&!!g("ses"),t=C();if(t[1])var n=t[1];else n=kt?"":i(),t[1]=n;Ze=n,Qe=e?t[6]:ie(t),At=t[3],"none"!=Tt&&(b(),ae(t),S(t))}}function C(){return"none"==Tt?["1","",0,0,0,void 0,"","","",void 0,0]:function(e,t,n,r){var o=Math.round((new Date).getTime()/1e3);e?(e=e.split(".")).unshift("0"):e=["1",t,o,r,o,"",n],e[6]&&"undefined"!==e[6]||(e[6]=i()),e[7]&&"undefined"!==e[7]||(e[7]=""),e[8]&&"undefined"!==e[8]||(e[8]=""),e[9]&&"undefined"!==e[9]||(e[9]=""),e[10]&&"undefined"!==e[10]||(e[10]=0);var a=function(e,t){return e=parseInt(e),isNaN(e)?t:e};return t=function(e){return e?a(e,void 0):void 0},[e[0],e[1],a(e[2],o),a(e[3],r),a(e[4],o),t(e[5]),e[6],e[7],e[8],t(e[9]),a(e[10],0)]}(g("id")||void 0,Ze,Qe,At)}function I(e){return 0===e.indexOf("http")?e:("https:"===document.location.protocol?"https":"http")+"://"+e}function E(){Pt&&null!=u.pageViewId||(u.pageViewId=i(),u.pageViewUrl=Ne||rt)}function O(){return function(){if(null==u.pageViewId)return!0;if(Pt||!It)return!1;if(void 0===u.pageViewUrl)return!0;var e=Ne||rt;if(!0===It||"full"==It||!("URL"in window))return u.pageViewUrl!=e;e=new URL(e);var t=new URL(u.pageViewUrl);return"pathname"==It?e.pathname!=t.pathname:"pathnameAndSearch"==It&&(e.pathname!=t.pathname||e.search!=t.search)}()&&(u.pageViewId=i(),u.pageViewUrl=Ne||rt),u.pageViewId}function L(){if("none"===Tt||kt||!De)return null;var e=B("_sp_tab_id");return e||(N("_sp_tab_id",i()),e=B("_sp_tab_id")),e||null}function D(e){var t=e.title,n=e.context,r=e.timestamp;if(e=e.contextCallback,l(),Et&&Et==O()&&E(),Et=O(),ut=document.title,t?(Ve=t,ct=!0):ct&&(Ve=null),t=F(Ve||ut),$e.track(function(e){var t=e.pageUrl,n=e.pageTitle;e=e.referrer;var r=a();return r.add("e","pv"),r.add("url",t),r.add("page",n),r.add("refr",e),r}({pageUrl:d(Ne||rt),pageTitle:t,referrer:d(je||ot)}),(n||[]).concat(e?e():[]),r),r=new Date,t=!1,Ot.enabled&&!Ot.installed){t=Ot.installed=!0;var o={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),o.hasSupport=e}}};o.update();var i="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll";Object.prototype.hasOwnProperty.call(o,"hasSupport")?W(document,i,h,{passive:!0}):W(document,i,h),w(),i=function(e,t){return void 0===t&&(t=h),function(e){return W(document,e,t)}},"click mouseup mousedown mousemove keypress keydown keyup touchend touchstart".split(" ").forEach(i(document)),["resize","focus","blur"].forEach(i(window)),i(window,m)("scroll")}if(Ot.enabled&&(st||t))for(r in qe=r.getTime(),r=void 0,Ot.configurations)(t=Ot.configurations[r])&&(window.clearInterval(t.activityInterval),_(t,n,e))}function _(e,t,n){var r=function(e,t){l(),e({context:t,pageViewId:O(),minXOffset:Fe,minYOffset:Ge,maxXOffset:He,maxYOffset:Je}),w()},o=function(){qe+e.configHeartBeatTimer>(new Date).getTime()&&r(e.callback,(t||[]).concat(n?n():[]))};e.activityInterval=0===e.configMinimumVisitLength?window.setInterval(o,e.configHeartBeatTimer):window.setTimeout((function(){qe+e.configMinimumVisitLength>(new Date).getTime()&&r(e.callback,(t||[]).concat(n?n():[])),e.activityInterval=window.setInterval(o,e.configHeartBeatTimer)}),e.configMinimumVisitLength)}function z(e){var t=e.minimumVisitLength,n=e.heartbeatDelay;if(e=e.callback,M(t)&&M(n))return{configMinimumVisitLength:1e3*t,configHeartBeatTimer:1e3*n,callback:e};Ae.error("Activity tracking minimumVisitLength & heartbeatDelay must be integers")}function Y(e){var t=e.context,n=e.minXOffset,r=e.minYOffset,o=e.maxXOffset,i=e.maxYOffset;(e=document.title)!==ut&&(ut=e,Ve=void 0);var u=(e=$e).track,c=d(Ne||rt),s=F(Ve||ut),l=d(je||ot);n=Math.round(n),o=Math.round(o),r=Math.round(r),i=Math.round(i);var f=a();f.add("e","pp"),f.add("url",c),f.add("page",s),f.add("refr",l),n&&!isNaN(Number(n))&&f.add("pp_mix",n.toString()),o&&!isNaN(Number(o))&&f.add("pp_max",o.toString()),r&&!isNaN(Number(r))&&f.add("pp_miy",r.toString()),i&&!isNaN(Number(i))&&f.add("pp_may",i.toString()),u.call(e,f,t)}function K(e){var t=Ot.configurations[e];0===(null==t?void 0:t.configMinimumVisitLength)?window.clearTimeout(null==t?void 0:t.activityInterval):window.clearInterval(null==t?void 0:t.activityInterval),Ot.configurations[e]=void 0}var $,ee,te,ne,se,le,fe,de,ve,ge,pe,me,ye,we,be,Se,ke,Te,xe,Ce;c.eventMethod=null!==($=c.eventMethod)&&void 0!==$?$:"post";var Pe=function(e){var t;return null!==(t=e.stateStorageStrategy)&&void 0!==t?t:"cookieAndLocalStorage"},Ie=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)},Ee=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)},Oe=null!==(te=null===(ee=null==c?void 0:c.contexts)||void 0===ee?void 0:ee.browser)&&void 0!==te&&te,De=null===(se=null===(ne=null==c?void 0:c.contexts)||void 0===ne?void 0:ne.webPage)||void 0===se||se,Ue=c.synchronousCookieWrite?Be:Re;s.push({beforeTrack:function(e){var t=g("ses"),n=C(),r=0===n[10];if(Ye=!!Me&&!!Ue.getCookie(Me),mt||Ye)T();else{if("0"===n[0]?(Qe=t||"none"==Tt?n[6]:ie(n),At=n[3]):(new Date).getTime()-xt>1e3*wt&&(At++,Qe=ie(n,{memorizedVisitCount:At})),ae(n),0===n[10]){var o=e.build();n[8]=o.eid,o=o.dtm||o.ttm,n[9]=o?parseInt(o):void 0}n[10]+=1;var i=(o=ce()).documentSize;e.add("vp",o.viewport),e.add("ds",i),e.add("vid",bt?At:kt?null:At),e.add("sid",bt?Qe:kt?null:Qe),e.add("duid",kt?null:n[1]),e.add("uid",kt?null:Xe),l(),e.add("refr",d(je||ot)),e.add("url",d(Ne||rt)),o=ue(n,Tt,kt),!Lt||kt&&!bt||e.addContextEntity({schema:"iglu:com.snowplowanalytics.snowplow/client_session/jsonschema/1-0-2",data:o}),"none"!=Tt&&(S(n),e=b(),t&&!r||!e||!Dt||Ut||(Dt(o),Ut=!1)),xt=(new Date).getTime()}}}),De&&s.push({contexts:function(){return[{schema:"iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",data:{id:O()}}]}}),Oe&&s.push({contexts:function(){return[{schema:"iglu:com.snowplowanalytics.snowplow/browser_context/jsonschema/2-0-0",data:he(he({},ce()),{tabId:L()})}]}}),s.push.apply(s,null!==(le=c.plugins)&&void 0!==le?le:[]);var je,Ne,Ve,_e,ze,Me,qe,Fe,He,Ge,Je,We,Ze,Qe,Xe,Ye,Ke,$e=P({base64:null!==(fe=c.encodeBase64)&&void 0!==fe?fe:"post"!==c.eventMethod,corePlugins:s,callback:function(e){mt||Ye||Ct.enqueueRequest(e.build())}}),et=document.characterSet||document.charset,tt=oe(window.location.hostname,window.location.href,J()),nt=G(tt[0]),rt=tt[1],ot=tt[2],it=null!==(de=c.platform)&&void 0!==de?de:"web",at=null!==(ve=c.appId)&&void 0!==ve?ve:"",ut=document.title,ct=!1,st=null===(ge=c.resetActivityTrackingOnPageView)||void 0===ge||ge,lt=null!==(pe=c.cookieName)&&void 0!==pe?pe:"_sp_",ft=null!==(me=c.cookieDomain)&&void 0!==me?me:void 0,dt=null!==(ye=c.discoverRootDomain)&&void 0!==ye?ye:void 0===ft,vt="/",gt=null!==(we=c.cookieSameSite)&&void 0!==we?we:"Lax",pt=null===(be=c.cookieSecure)||void 0===be||be,ht=window.navigator.doNotTrack||window.navigator.msDoNotTrack||window.doNotTrack,mt=void 0!==c.respectDoNotTrack&&(c.respectDoNotTrack&&("yes"===ht||"1"===ht)),yt=null!==(Se=c.cookieLifetime)&&void 0!==Se?Se:63072e3,wt=null!==(ke=c.sessionCookieTimeout)&&void 0!==ke?ke:1800,bt=Ie(c),St=Ee(c),kt=!!c.anonymousTracking,Tt=Pe(c),xt=(new Date).getTime(),At=1,Ct=re(he({trackerId:e,endpoint:I(o),serverAnonymization:St,useLocalStorage:"localStorage"==Tt||"cookieAndLocalStorage"==Tt},c),u),Pt=!1,It=null!==(Te=c.preservePageViewIdForUrl)&&void 0!==Te&&Te,Et=void 0,Ot={enabled:!1,installed:!1,configurations:{}},Lt=null!==(Ce=null===(xe=c.contexts)||void 0===xe?void 0:xe.session)&&void 0!==Ce&&Ce,Dt=c.onSessionUpdateCallback,Ut=!1,jt="boolean"==typeof(Ke=c.useExtendedCrossDomainLinker||!1)?{useExtendedCrossDomainLinker:Ke}:{useExtendedCrossDomainLinker:!0,collectCrossDomainAttributes:Ke},Rt=jt.useExtendedCrossDomainLinker,Bt=jt.collectCrossDomainAttributes;dt&&!ft&&(ft=X(gt,pt));var Nt=ce(),Vt=Nt.browserLanguage,_t=Nt.resolution,zt=Nt.colorDepth,Mt=Nt.cookiesEnabled,qt=q();return $e.setTrackerVersion(n),$e.setTrackerNamespace(t),$e.setAppId(at),$e.setPlatform(it),$e.addPayloadPair("cookie",Mt?"1":"0"),$e.addPayloadPair("cs",et),$e.addPayloadPair("lang",Vt),$e.addPayloadPair("res",_t),$e.addPayloadPair("cd",zt),qt&&$e.addPayloadPair("tz",qt),p(),A(),c.crossDomainLinker&&f(c.crossDomainLinker),he(he({},{getDomainSessionIndex:function(){return At},getPageViewId:O,getTabId:L,newSession:function(){var e=C();if("0"===e[0]?(Qe="none"!=Tt?ie(e):e[6],At=e[3]):(At++,Qe=ie(e,{memorizedVisitCount:At})),ae(e),"none"!=Tt){var t=ue(e,Tt,kt);S(e),b()&&Dt&&(Ut=!0,Dt(t))}xt=(new Date).getTime()},getCookieName:function(e){return lt+e+"."+We},getUserId:function(){return Xe},getDomainUserId:function(){return C()[1]},getDomainUserInfo:function(){return C()},setReferrerUrl:function(e){je=e},setCustomUrl:function(e){l();var t,n=rt;v(e)?Ne=e:"/"===e.slice(0,1)?Ne=v(n)+"://"+H(n)+e:(0<=(t=(n=d(n)).indexOf("?"))&&(n=n.slice(0,t)),(t=n.lastIndexOf("/"))!==n.length-1&&(n=n.slice(0,t+1)),Ne=n+e)},setDocumentTitle:function(e){ut=document.title,Ve=e,ct=!1},discardHashTag:function(e){_e=e},discardBrace:function(e){ze=e},setCookiePath:function(e){vt=e,p()},setVisitorCookieTimeout:function(e){yt=e},crossDomainLinker:function(e){f(e)},enableActivityTracking:function(e){Ot.configurations.pagePing||(Ot.enabled=!0,Ot.configurations.pagePing=z(he(he({},e),{callback:Y})))},enableActivityTrackingCallback:function(e){Ot.configurations.callback||(Ot.enabled=!0,Ot.configurations.callback=z(e))},disableActivityTracking:function(){K("pagePing")},disableActivityTrackingCallback:function(){K("callback")},updatePageActivity:function(){h()},setOptOutCookie:function(e){Me=e},setUserId:function(e){Xe=e},setUserIdFromLocation:function(e){l(),Xe=Z(e,rt)},setUserIdFromReferrer:function(e){l(),Xe=Z(e,ot)},setUserIdFromCookie:function(e){Xe=Ue.getCookie(e)},setCollectorUrl:function(e){Ct.setCollectorUrl(I(e))},setBufferSize:function(e){Ct.setBufferSize(e)},flushBuffer:function(e){void 0===e&&(e={}),Ct.executeQueue(),e.newBufferSize&&Ct.setBufferSize(e.newBufferSize)},trackPageView:function(e){void 0===e&&(e={}),D(e)},preservePageViewId:function(){Pt=!0},preservePageViewIdForUrl:function(e){It=e},disableAnonymousTracking:function(e){c.anonymousTracking=!1,x(e),A(),Ct.executeQueue()},enableAnonymousTracking:function(e){var t;c.anonymousTracking=null===(t=e&&(null==e?void 0:e.options))||void 0===t||t,x(e),bt||E()},clearUserData:T}),{id:e,namespace:t,core:$e,sharedState:u})}(e,t,n,o,u,c);var l=he(he({},e),{addPlugin:function(e){var t,n;l.core.addPlugin(e),null===(n=(t=e.plugin).activateBrowserPlugin)||void 0===n||n.call(t,l)}});return s.forEach((function(e){var t;null===(t=e.activateBrowserPlugin)||void 0===t||t.call(e,l)})),l}function de(e){return ge(e,Ne)}function ve(){return Object.keys(Ne)}function ge(e,t){for(var n=[],r=0;r<e.length;r++){var o=e[r];t.hasOwnProperty(o)?n.push(t[o]):Ae.warn(o+" not configured")}return n}function pe(){try{return!!window.localStorage}catch(e){return!0}}var he=function(){return he=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},he.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;for(var me=[],ye=0;256>ye;++ye)me.push((ye+256).toString(16).slice(1));var we,be,Se,ke=new Uint8Array(16),Te={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},xe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";(Se=be||(be={}))[Se.none=0]="none",Se[Se.error=1]="error",Se[Se.warn=2]="warn",Se[Se.debug=3]="debug",Se[Se.info=4]="info";var Ae=function(e){return void 0===e&&(e=be.warn),{setLogLevel:function(t){e=be[t]?t:be.warn},warn:function(t,n){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];e>=be.warn&&"undefined"!=typeof console&&(i="Snowplow: "+t,n?console.warn.apply(console,r([i+"\n",n],o,!1)):console.warn.apply(console,r([i],o,!1)))},error:function(t,n){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];e>=be.error&&"undefined"!=typeof console&&(i="Snowplow: "+t+"\n",n?console.error.apply(console,r([i+"\n",n],o,!1)):console.error.apply(console,r([i],o,!1)))},debug:function(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];e>=be.debug&&"undefined"!=typeof console&&console.debug.apply(console,r(["Snowplow: "+t],n,!1))},info:function(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];e>=be.info&&"undefined"!=typeof console&&console.info.apply(console,r(["Snowplow: "+t],n,!1))}}}(),Ce={},Pe={};!function(){var e={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(t){if(t.constructor==Number)return 16711935&e.rotl(t,8)|4278255360&e.rotl(t,24);for(var n=0;n<t.length;n++)t[n]=e.endian(t[n]);return t},randomBytes:function(e){for(var t=[];0<e;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var t=[],n=0;n<e.length;n+=3)for(var r=e[n]<<16|e[n+1]<<8|e[n+2],o=0;4>o;o++)8*n+6*o<=8*e.length?t.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>>6*(3-o)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],n=0,r=0;n<e.length;r=++n%4)0!=r&&t.push(("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(n-1))&Math.pow(2,-2*r+8)-1)<<2*r|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(n))>>>6-2*r);return t}};Pe=e}();var Ie={utf8:{stringToBytes:function(e){return Ie.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(Ie.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}},Ee=Ie;!function(){var e=Pe,t=Ee.utf8,n=Ee.bin,r=function(r,o){var i=e.wordsToBytes,a=r;a.constructor==String?a=t.stringToBytes(a):"undefined"!=typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(a)?a=Array.prototype.slice.call(a,0):Array.isArray(a)||(a=a.toString()),r=e.bytesToWords(a);var u=8*a.length;a=[];var c=1732584193,s=-271733879,l=-1732584194,f=271733878,d=-1009589776;for(r[u>>5]|=128<<24-u%32,r[15+(u+64>>>9<<4)]=u,u=0;u<r.length;u+=16){for(var v=c,g=s,p=l,h=f,m=d,y=0;80>y;y++){if(16>y)a[y]=r[u+y];else{var w=a[y-3]^a[y-8]^a[y-14]^a[y-16];a[y]=w<<1|w>>>31}w=(c<<5|c>>>27)+d+(a[y]>>>0)+(20>y?1518500249+(s&l|~s&f):40>y?1859775393+(s^l^f):60>y?(s&l|s&f|l&f)-1894007588:(s^l^f)-899497514),d=f,f=l,l=s<<30|s>>>2,s=c,c=w}c+=v,s+=g,l+=p,f+=h,d+=m}return i=i.call(e,[c,s,l,f,d]),o&&o.asBytes?i:o&&o.asString?n.bytesToString(i):e.bytesToHex(i)};r._blocksize=16,r._digestsize=20,Ce=r}();var Oe,Le=Ce,De={sessionId:!0,sourceId:!0,sourcePlatform:!1,userId:!1,reason:!1},Ue=!1,je="x",Re=function(){function e(e){return t[e]||(t[e]=function(e){function t(){void 0!==n&&(clearTimeout(n),n=void 0),i||(i=!0,void 0!==r&&$(e,r[0],r[1],r[2],r[3],r[4],r[5]))}var n,r,o,i=!0;return{getValue:function(){var t;return r&&(!o||o>new Date)&&null!==(t=r[0])&&void 0!==t?t:$(e)},setValue:function(e,a,u,c,s,l){return r=[e,a,u,c,s,l],i=!1,void 0===n&&(n=setTimeout((function(){n=void 0,t()}),10)),o=new Date(Date.now()+1e3*Math.min(.05,null!=a?a:.05)),!0},deleteValue:function(t,o,a,u){r=void 0,i=!0,void 0!==n&&(clearTimeout(n),n=void 0),Y(e,t,o,a,u)},flush:t}}(e)),t[e]}var t={};return{getCookie:function(t){return e(t).getValue()},setCookie:function(t,n,r,o,i,a,u){return e(t).setValue(n,r,o,i,a,u)},deleteCookie:function(t,n,r,o,i){e(t).deleteValue(n,r,o,i)},clearCache:function(){t={}},flush:function(){for(var e=0,n=Object.values(t);e<n.length;e++)n[e].flush()}}}(),Be={getCookie:$,setCookie:function(e,t,n,r,o,i,a){return $(e,t,n,r,o,i,a),-1!==document.cookie.indexOf("".concat(e,"="))},deleteCookie:Y},Ne={},Ve=function(){this.bufferFlushers=[],this.hasLoaded=!1,this.registeredOnLoadHandlers=[]};e.SharedState=Ve,e.addEventListener=W,e.addTracker=function(e,t,n,r,o,i){return Ne.hasOwnProperty(e)?null:(Ne[e]=fe(e,t,n,r,o,i),Ne[e])},e.allTrackerNames=ve,e.allTrackers=function(){return Ne},e.attemptDeleteLocalStorage=R,e.attemptGetLocalStorage=U,e.attemptGetSessionStorage=B,e.attemptWriteLocalStorage=j,e.attemptWriteSessionStorage=N,e.cookie=$,e.createCrossDomainParameterValue=V,e.createSharedState=function(){function e(){var e;if(!t.hasLoaded)for(t.hasLoaded=!0,e=0;e<t.registeredOnLoadHandlers.length;e++)t.registeredOnLoadHandlers[e]();return!0}var t=new Ve,n=document,r=window;return n.visibilityState&&W(n,"visibilitychange",(function(){"hidden"==n.visibilityState&&t.bufferFlushers.forEach((function(e){e(!1)}))}),!1),W(r,"beforeunload",(function(){t.bufferFlushers.forEach((function(e){e(!1)}))}),!1),"loading"===document.readyState?(n.addEventListener?n.addEventListener("DOMContentLoaded",(function t(){n.removeEventListener("DOMContentLoaded",t,!1),e()})):n.attachEvent&&n.attachEvent("onreadystatechange",(function t(){"complete"===n.readyState&&(n.detachEvent("onreadystatechange",t),e())})),W(r,"load",e,!1)):e(),t},e.decorateQuerystring=Q,e.deleteCookie=Y,e.dispatchToTrackers=function(e,t){try{de(null!=e?e:ve()).forEach(t)}catch(e){Ae.error("Function failed",e)}},e.dispatchToTrackersInCollection=function(e,t,n){try{ge(null!=e?e:Object.keys(t),t).forEach(n)}catch(e){Ae.error("Function failed",e)}},e.findRootDomain=X,e.fixupDomain=G,e.fixupTitle=F,e.fixupUrl=oe,e.flushPendingCookies=function(){Re.flush()},e.fromQuerystring=Z,e.getCookiesWithPrefix=K,e.getCssClasses=ee,e.getFilterByClass=function(e){if(null==e||"object"!=typeof e||Array.isArray(e))return function(){return!0};var t=Object.prototype.hasOwnProperty.call(e,"allowlist"),n=ne(e);return te(e,(function(e){e:{var r=0;for(e=ee(e);r<e.length;r++)if(n[e[r]]){r=!0;break e}r=!1}return r===t}))},e.getFilterByName=function(e){if(null==e||"object"!=typeof e||Array.isArray(e))return function(){return!0};var t=e.hasOwnProperty("allowlist"),n=ne(e);return te(e,(function(e){return e.name in n===t}))},e.getHostName=H,e.getReferrer=J,e.getTimeZone=q,e.getTracker=function(e){return Ne.hasOwnProperty(e)?Ne[e]:(Ae.warn(e+" not configured"),null)},e.getTrackers=de,e.hasLocalStorage=pe,e.hasSessionStorage=function(){try{return!!window.sessionStorage}catch(e){return!0}},e.isFunction=function(e){return!(!e||"function"!=typeof e)},e.isInteger=M,e.isString=z,e.isValueInArray=function(e,t){for(var n=0;n<t.length;n++)if(t[n]===e)return!0;return!1},e.localStorageAccessible=function(){if(!pe())return!1;try{var e=window.localStorage;return e.setItem("modernizr","modernizr"),e.removeItem("modernizr"),!0}catch(e){return!1}},e.parseAndValidateFloat=function(e){return e=parseFloat(e),isNaN(e)?void 0:e},e.parseAndValidateInt=function(e){return e=parseInt(e),isNaN(e)?void 0:e},e.trackerExists=function(e){return Ne.hasOwnProperty(e)},e.urlSafeBase64Encode=_,Object.defineProperty(e,"__esModule",{value:!0})}));
"use strict";!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).snowplowBrowserTrackerCore={})}(this,(function(e){function t(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(a,u)}c((r=r.apply(e,t||[])).next())}))}function n(e,t){function n(n){return function(c){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;u&&(u=0,n[0]&&(a=0)),a;)try{if(r=1,o&&(i=2&n[0]?o.return:n[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,n[1])).done)return i;switch(o=0,i&&(n=[2&n[0],i.value]),n[0]){case 0:case 1:i=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,o=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=0<i.length&&i[i.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&n[1]<i[3]))a.label=n[1];else if(6===n[0]&&a.label<i[1])a.label=i[1],i=n;else{if(!(i&&a.label<i[2])){i[2]&&a.ops.pop(),a.trys.pop();continue}a.label=i[2],a.ops.push(n)}}n=t.call(e,a)}catch(e){n=[6,e],o=0}finally{r=i=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,c])}}var r,o,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=n(0),u.throw=n(1),u.return=n(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u}function r(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function o(){if(!we&&!(we="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return we(ke)}function i(e,t,n){if(Te.randomUUID&&!t&&!e)return Te.randomUUID();if((e=(e=e||{}).random||(e.rng||o)())[6]=15&e[6]|64,e[8]=63&e[8]|128,t){n=n||0;for(var r=0;16>r;++r)t[n+r]=e[r];return t}return function(e,t=0){return(me[e[t+0]]+me[e[t+1]]+me[e[t+2]]+me[e[t+3]]+"-"+me[e[t+4]]+me[e[t+5]]+"-"+me[e[t+6]]+me[e[t+7]]+"-"+me[e[t+8]]+me[e[t+9]]+"-"+me[e[t+10]]+me[e[t+11]]+me[e[t+12]]+me[e[t+13]]+me[e[t+14]]+me[e[t+15]]).toLowerCase()}(e)}function a(){var e,t={},n=[],r=[],o=[],i=function(e,n){null!=n&&""!==n&&(t[e]=n)};return{add:i,addDict:function(e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&i(t,e[t])},addJson:function(e,t,o){o&&c(o)&&(e={keyIfEncoded:e,keyIfNotEncoded:t,json:o},r.push(e),n.push(e))},addContextEntity:function(e){o.push(e)},getPayload:function(){return t},getJson:function(){return n},withJsonProcessor:function(t){e=t},build:function(){return null==e||e(this,r,o),t}}}function u(e){return function(t,n,o){for(var i=function(n,r,o){if(n=JSON.stringify(n),e){if(o=t.add,n){var i=0,a=0,u=[];if(n){n=unescape(encodeURIComponent(n));do{var c=n.charCodeAt(i++),s=n.charCodeAt(i++),l=n.charCodeAt(i++),f=c<<16|s<<8|l;c=f>>18&63,s=f>>12&63,l=f>>6&63,f&=63,u[a++]=xe.charAt(c)+xe.charAt(s)+xe.charAt(l)+xe.charAt(f)}while(i<n.length);i=u.join(""),n=((n=n.length%3)?i.slice(0,n-3):i)+"===".slice(n||3)}n=n.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o.call(t,r,n)}else t.add(o,n)},a=function(n,r){if(!n){var o=t.getPayload();if(e?o.cx:o.co){var i=(n=JSON).parse;if(e){if(o=o.cx){switch(4-o.length%4){case 2:o+="==";break;case 3:o+="="}o=function(e){var t,n=0,r=0,o="",i=[];if(!e)return e;e+="";do{var a=xe.indexOf(e.charAt(n++)),u=xe.indexOf(e.charAt(n++));o=xe.indexOf(e.charAt(n++));var c=xe.indexOf(e.charAt(n++)),s=a<<18|u<<12|o<<6|c;a=s>>16&255,u=s>>8&255,s&=255,i[r++]=64===o?String.fromCharCode(a):64===c?String.fromCharCode(a,u):String.fromCharCode(a,u,s)}while(n<e.length);return o=i.join(""),t=o.replace(/\0+$/,""),decodeURIComponent(t.split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))}(o=o.replace(/-/g,"+").replace(/_/g,"/"))}}else o=o.co;n=i.call(n,o)}else n=void 0}return n?n.data=n.data.concat(r.data):n=r,n},u=void 0,c=0;c<n.length;c++){var s=n[c];"cx"===s.keyIfEncoded?u=a(u,s.json):i(s.json,s.keyIfEncoded,s.keyIfNotEncoded)}n.length=0,o.length&&(u=a(u,n={schema:"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",data:r([],o,!0)}),o.length=0),u&&i(u,"cx","co")}}function c(e){if(!s(e))return!1;for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function s(e){return null!=e&&(e.constructor==={}.constructor||e.constructor===[].constructor)}function l(){var e=[],t=[],n={},r={};return{getGlobalPrimitives:function(){return e.concat(Object.values(n))},getConditionalProviders:function(){return t.concat(Object.values(r))},addGlobalContexts:function(o){if(Array.isArray(o)){for(var i=[],a=[],u=0;u<o.length;u++){var c=o[u];b(c)?i.push(c):m(c)&&a.push(c)}e=e.concat(a),t=t.concat(i)}else for(i=0,o=Object.entries(o);i<o.length;i++)a=(c=o[i])[0],b(c=c[1])?r[a]=c:m(c)&&(n[a]=c)},clearGlobalContexts:function(){t=[],e=[],r={},n={}},removeGlobalContexts:function(o){for(var i=function(o){"string"==typeof o?(delete r[o],delete n[o]):b(o)?t=t.filter((function(e){return!C(o,e)})):m(o)&&(e=e.filter((function(e){return!C(o,e)})))},a=0;a<o.length;a++)i(o[a])},getApplicableContexts:function(o){e:{for(var i=0,a=o.getJson();i<a.length;i++){var u=a[i];if("ue_px"===u.keyIfEncoded&&"object"==typeof u.json.data&&"string"==typeof(u=u.json.data.schema)){i=u;break e}}i=""}u="string"==typeof(a=o.getPayload().e)?a:"",a=[];var c=x(e.concat(Object.values(n)),o,u,i);return a.push.apply(a,c),o=function(e,t,n,r){var o;return e=T(e).map((function(e){e:{if(y(e)){var o=e[0],i=!1;try{i=o({event:t.getPayload(),eventType:n,eventSchema:r})}catch(e){i=!1}if(!0===i){e=x(e[1],t,n,r);break e}}else if(w(e)&&function(e,t){var n=0,r=0,o=e.accept;return Array.isArray(o)?e.accept.some((function(e){return S(e,t)}))&&r++:"string"==typeof o&&S(o,t)&&r++,o=e.reject,Array.isArray(o)?e.reject.some((function(e){return S(e,t)}))&&n++:"string"==typeof o&&S(o,t)&&n++,0<r&&0===n}(e[0],r)){e=x(e[1],t,n,r);break e}e=[]}if(e&&0!==e.length)return e})),(o=[]).concat.apply(o,e.filter((function(e){return null!=e&&e.filter(Boolean)})))}(t.concat(Object.values(r)),o,u,i),a.push.apply(a,o),a}}}function f(e){return!!((e=e.split("."))&&1<e.length)&&function(e){if("*"===e[0]||"*"===e[1])return!1;if(0<e.slice(2).length){var t=!1,n=0;for(e=e.slice(2);n<e.length;n++)if("*"===e[n])t=!0;else if(t)return!1;return!0}return 2==e.length}(e)}function d(e){if(null!==(e=/^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))&&f(e[1]))return e.slice(1,6)}function v(e){if(e=d(e)){var t=e[0];return 5===e.length&&f(t)}return!1}function g(e){return function(e){return Array.isArray(e)&&e.every((function(e){return"string"==typeof e}))}(e)?e.every((function(e){return v(e)})):"string"==typeof e&&v(e)}function p(e){return!!(c(e)&&"schema"in e&&"data"in e)&&("string"==typeof e.schema&&"object"==typeof e.data)}function h(e){return"function"==typeof e&&1>=e.length}function m(e){return h(e)||p(e)}function y(e){return!(!Array.isArray(e)||2!==e.length)&&(Array.isArray(e[1])?h(e[0])&&e[1].every(m):h(e[0])&&m(e[1]))}function w(e){return!(!Array.isArray(e)||2!==e.length)&&(!!function(e){var t=0;if(null!=e&&"object"==typeof e&&!Array.isArray(e)){if(Object.prototype.hasOwnProperty.call(e,"accept")){if(!g(e.accept))return!1;t+=1}if(Object.prototype.hasOwnProperty.call(e,"reject")){if(!g(e.reject))return!1;t+=1}return 0<t&&2>=t}return!1}(e[0])&&(Array.isArray(e[1])?e[1].every(m):m(e[1])))}function b(e){return y(e)||w(e)}function S(e,t){if(!v(e))return!1;if(e=d(e),t=null!==(t=/^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(t))?t.slice(1,6):void 0,e&&t){if(!function(e,t){if(t=t.split("."),e=e.split("."),t&&e){if(t.length!==e.length)return!1;for(var n=0;n<e.length;n++)if(!k(t[n],e[n]))return!1;return!0}return!1}(e[0],t[0]))return!1;for(var n=1;5>n;n++)if(!k(e[n],t[n]))return!1;return!0}return!1}function k(e,t){return e&&t&&"*"===e||e===t}function T(e){return Array.isArray(e)?e:[e]}function x(e,t,n,r){var o;return e=T(e).map((function(e){e:if(p(e))e=[e];else{if(h(e)){t:{var o=void 0;try{if(o=e({event:t.getPayload(),eventType:n,eventSchema:r}),Array.isArray(o)&&o.every(p)||p(o)){var i=o;break t}i=void 0;break t}catch(e){}i=void 0}if(p(i)){e=[i];break e}if(Array.isArray(i)){e=i;break e}}e=void 0}if(e&&0!==e.length)return e})),(o=[]).concat.apply(o,e.filter((function(e){return null!=e&&e.filter(Boolean)})))}function A(e,t){return"function"==typeof e?e===t:JSON.stringify(e)===JSON.stringify(t)}function C(e,t){if(b(e)){if(!b(t))return!1;var n=e[1],r=t[1];return!!A(e[0],t[0])&&(Array.isArray(n)?!(!Array.isArray(r)||n.length!==r.length)&&n.reduce((function(e,t,n){return e&&A(t,r[n])}),!0):!Array.isArray(r)&&A(n,r))}return!!m(e)&&(!!m(t)&&A(e,t))}function P(e){void 0===e&&(e={});var t,n,o,a,c,f,d,v=e.base64,g=e.corePlugins,p=null!=g?g:[];t=null==v||v,n=p,o=e.callback,a=function(e){return{addPluginContexts:function(t){var n=t?r([],t,!0):[];return e.forEach((function(e){try{e.contexts&&n.push.apply(n,e.contexts())}catch(e){Ae.error("Error adding plugin contexts",e)}})),n}}}(n),c=l(),f=t,d={};var h=he(he({},e={track:function(e,t,r){if(e.withJsonProcessor(u(f)),e.add("eid",i()),e.addDict(d),r=function(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()}}(r),e.add(r.type,r.value.toString()),t=function(e,t){e=c.getApplicableContexts(e);var n=[];return t&&t.length&&n.push.apply(n,t),e&&e.length&&n.push.apply(n,e),n}(e,a.addPluginContexts(t)),void 0!==(t=t&&t.length?{schema:"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",data:t}:void 0)&&e.addJson("cx","co",t),n.forEach((function(t){try{t.beforeTrack&&t.beforeTrack(e)}catch(e){Ae.error("Plugin beforeTrack",e)}})),!n.find((function(t){try{return t.filter&&!1===t.filter(e.build())}catch(e){return Ae.error("Plugin filter",e),!1}}))){"function"==typeof o&&o(e);var s=e.build();return n.forEach((function(e){try{e.afterTrack&&e.afterTrack(s)}catch(e){Ae.error("Plugin afterTrack",e)}})),s}},addPayloadPair:function(e,t){d[e]=t},getBase64Encoding:function(){return f},setBase64Encoding:function(e){f=e},addPayloadDict:function(e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(d[t]=e[t])},resetPayloadPairs:function(e){d=s(e)?e:{}},setTrackerVersion:function(e){d.tv=e},setTrackerNamespace:function(e){d.tna=e},setAppId:function(e){d.aid=e},setPlatform:function(e){d.p=e},setUserId:function(e){d.uid=e},setScreenResolution:function(e,t){d.res=e+"x"+t},setViewport:function(e,t){d.vp=e+"x"+t},setColorDepth:function(e){d.cd=e},setTimezone:function(e){d.tz=e},setLang:function(e){d.lang=e},setIpAddress:function(e){d.ip=e},setUseragent:function(e){d.ua=e},addGlobalContexts:function(e){c.addGlobalContexts(e)},clearGlobalContexts:function(){c.clearGlobalContexts()},removeGlobalContexts:function(e){c.removeGlobalContexts(e)}}),{addPlugin:function(e){var t,n;e=e.plugin,p.push(e),null===(t=e.logger)||void 0===t||t.call(e,Ae),null===(n=e.activateCorePlugin)||void 0===n||n.call(e,h)}});return null==p||p.forEach((function(e){var t,n;null===(t=e.logger)||void 0===t||t.call(e,Ae),null===(n=e.activateCorePlugin)||void 0===n||n.call(e,h)})),h}function I(e){var t=e.maxSize,n=void 0===t?1e3:t,o=r([],void 0===(e=e.events)?[]:e,!0),i=function(){return Promise.resolve(o.length)};return{count:i,add:function(e){for(o.push(e);o.length>n;)o.shift();return i()},removeHead:function(e){for(var t=0;t<e;t++)o.shift();return Promise.resolve()},iterator:function(){var e=0,t=r([],o,!0);return{next:function(){return e<t.length?Promise.resolve({value:t[e++],done:!1}):Promise.resolve({value:void 0,done:!0})}}},getAll:function(){return Promise.resolve(r([],o,!0))},getAllPayloads:function(){return Promise.resolve(o.map((function(e){return e.payload})))}}}function E(e){function t(){var e=S.reduce((function(e,t){return e+(k?t.getPOSTRequestBytesCount():t.getGETRequestBytesCount())}),0);return k&&(e+=88),e}function n(){var e=new Headers;return k&&e.append("Content-Type","application/json; charset=UTF-8"),v&&Object.keys(v).forEach((function(t){e.append(t,v[t])})),0<S.length&&S[0].getServerAnonymization()&&e.append("SP-Anonymous","*"),e}function r(){var e=u;return u.includes("://")||(e="".concat(s,"://").concat(u)),l&&(e="".concat(e,":").concat(l)),e+(k?m:"/i")}function o(e,t){return a(!1),d=new AbortController,f=setTimeout((function(){console.error("Request timed out"),f=void 0,a(!1,"Request timed out")}),null!=g?g:5e3),t=he({headers:n(),signal:d.signal,keepalive:h,credentials:b},t),new Request(e,t)}function i(){var e=function(e){for(var t=(new Date).getTime().toString(),n=0;n<e.length;n++)e[n].stm=t;return e}(S.map((function(e){return e.getPOSTRequestBody()})));return o(r(),{method:"POST",body:JSON.stringify({schema:"iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4",data:e})})}function a(e,t){if(void 0!==f&&(clearTimeout(f),f=void 0),void 0!==d){var n=d;d=void 0,e||n.abort(t)}}var u=e.endpoint,c=e.protocol,s=void 0===c?"https":c,l=e.port;c=e.eventMethod;var f,d,v=e.customHeaders,g=e.connectionTimeout,p=e.keepalive,h=void 0!==p&&p,m=void 0===(p=e.postPath)?"/com.snowplowanalytics.snowplow/tp2":p,y=void 0===(p=e.useStm)||p,w=void 0===(p=e.maxPostBytes)?4e4:p,b=void 0===(e=e.credentials)?"include":e,S=[],k="post"===(void 0===c?"post":c).toLowerCase();return{addEvent:function(e){return!(0<S.length&&(0<S.length?S[0].getServerAnonymization():void 0)!==e.getServerAnonymization())&&(S.push(e),!0)},getEvents:function(){return S},toRequest:function(){if(0!==S.length){if(k)return i();if(1!==S.length)throw Error("Only one event can be sent in a GET request");return o(S[0].getGETRequestURL(r(),y),{method:"GET"})}},countBytes:t,countEvents:function(){return S.length},isFull:function(){return k?t()>=w:1<=S.length},closeRequest:a}}function O(e){for(var t=0,n=0;n<e.length;n++){var r=e.charCodeAt(n);127>=r?t+=1:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,n++):t=65535>r?t+3:t+4}return t}function L(e){function t(){return e.payload}function n(e){if(null===o){var t,n={co:!0,cx:!0},r=[];for(t in e)e.hasOwnProperty(t)&&!n[t]&&r.push(t+"="+encodeURIComponent(e[t]));for(var i in n)e.hasOwnProperty(i)&&n[i]&&r.push(i+"="+encodeURIComponent(e[i]));o="?"+r.join("&")}return o}function r(){return null===i&&(i=function(e){return Object.keys(e).map((function(t){return[t,e[t]]})).reduce((function(e,t){return e[t[0]]=t[1].toString(),e}),{})}(t())),i}var o=null,i=null,a=null,u=null;return{getPayload:t,getServerAnonymization:function(){var t;return null!==(t=e.svrAnon)&&void 0!==t&&t},getGETRequestURL:function(e,r){var o=n(t());return r?e+o.replace("?","?stm="+(new Date).getTime()+"&"):e+o},getGETRequestBytesCount:function(){if(null===a){var e=n(t());a=O(e)}return a},getPOSTRequestBody:r,getPOSTRequestBytesCount:function(){return null===u&&(u=O(JSON.stringify(r()))),u}}}function D(e){function r(e,t){void 0!==C&&setTimeout((function(){try{null==C||C(e,t)}catch(e){Ae.error("Error in onRequestFailure",e)}}),0)}function o(e){return t(this,void 0,void 0,(function(){var t,o,i,a,u,c;return n(this,(function(n){switch(n.label){case 0:if(void 0===(t=e.toRequest()))throw Error("Empty batch");o=e.getEvents().map((function(e){return e.getPayload()})),n.label=1;case 1:return n.trys.push([1,4,,5]),[4,O(t)];case 2:return[4,(i=n.sent()).text()];case 3:return n.sent(),e.closeRequest(!0),i.ok?(function(e,t){void 0!==P&&setTimeout((function(){try{null==P||P(e,t)}catch(e){Ae.error("Error in onRequestSuccess",e)}}),0)}(o,i),[2,{success:!0,retry:!1,status:i.status}]):(a=function(e){return!(200<=e&&300>e||!A||!x.includes(e)&&T.includes(e))}(i.status),r({events:o,status:i.status,message:i.statusText,willRetry:a},i),[2,{success:!1,retry:a,status:i.status}]);case 4:return u=n.sent(),e.closeRequest(!1),c="string"==typeof u?u:u?u.message:"Unknown error",r({events:o,message:c,willRetry:!0}),[2,{success:!1,retry:!0}];case 5:return[2]}}))}))}function i(){return E({endpoint:s,protocol:v,port:g,eventMethod:f,customHeaders:y,connectionTimeout:b,keepalive:S,maxPostBytes:p,useStm:D,credentials:j,postPath:d})}function a(){return t(this,void 0,void 0,(function(){var e;return n(this,(function(t){switch(t.label){case 0:return!k||R?[3,2]:(R=!0,e=new Request(k,{method:"GET"}),[4,O(e)]);case 1:t.sent(),t.label=2;case 2:return[2]}}))}))}function u(){return t(this,void 0,void 0,(function(){var e;return n(this,(function(t){switch(t.label){case 0:if(B)return[3,5];B=!0,t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,c()];case 2:return t.sent(),[3,5];case 3:return e=t.sent(),Ae.error("Error sending events",e),[3,5];case 4:return B=!1,[7];case 5:return[2]}}))}))}function c(){return t(this,void 0,void 0,(function(){var e,t,r,u,s,l,f,d,v;return n(this,(function(n){switch(n.label){case 0:return[4,a()];case 1:n.sent(),e=i(),t=U.iterator(),n.label=2;case 2:return e.isFull()?[3,4]:[4,t.next()];case 3:return r=n.sent(),u=r.value,r.done||void 0===u?[3,4]:(s=L(u),e.addEvent(s)?[3,2]:[3,4]);case 4:return 0===e.countEvents()?[2]:[4,o(e)];case 5:return l=n.sent(),f=l.success,d=l.retry,v=l.status,!f&&d?[3,7]:(f||Ae.error("Status ".concat(v,", will not retry.")),[4,U.removeHead(e.countEvents())]);case 6:n.sent(),n.label=7;case 7:return f?[4,c()]:[3,9];case 8:n.sent(),n.label=9;case 9:return[2]}}))}))}var s=e.endpoint,l=e.eventMethod,f=void 0===l?"post":l,d=e.postPath,v=e.protocol,g=e.port,p=void 0===(l=e.maxPostBytes)?4e4:l,h=e.maxGetBytes,m=void 0===(l=e.bufferSize)?1:l,y=e.customHeaders,w=e.serverAnonymization,b=e.connectionTimeout,S=e.keepalive,k=e.idService,T=void 0===(l=e.dontRetryStatusCodes)?[]:l,x=void 0===(l=e.retryStatusCodes)?[]:l,A=void 0===(l=e.retryFailedRequests)||l,C=e.onRequestFailure,P=e.onRequestSuccess,O=void 0===(l=e.customFetch)?fetch:l,D=e.useStm,U=void 0===(l=e.eventStore)?I({}):l,j=e.credentials,R=!1,B=!1,N="post"===f.toLowerCase();return T=T.concat([400,401,403,410,422]),{flush:u,input:function(e){return t(this,void 0,void 0,(function(){var t,r,a;return n(this,(function(n){switch(n.label){case 0:e:{if(n=r=L(t={payload:e,svrAnon:void 0!==(n=w)&&n}),N){var c=(n=n.getPOSTRequestBytesCount()+88)>p;c&&Ae.warn("Event ("+n+"B) too big, max is "+p)}else{if(void 0===h){n=!1;break e}(c=(n=n.getGETRequestBytesCount())>h)&&Ae.warn("Event ("+n+"B) too big, max is "+h)}n=c}return n?((a=i()).addEvent(r),[4,o(a)]):[3,2];case 1:return n.sent(),[3,5];case 2:return[4,U.add(t)];case 3:return n.sent()>=m?[4,u()]:[3,5];case 4:n.sent(),n.label=5;case 5:return[2]}}))}))},setCollectorUrl:function(e){s=e},setAnonymousTracking:function(e){w=e},setBufferSize:function(e){m=e}}}function U(e){try{var t=window.localStorage,n=t.getItem(e+".expires");if(null===n||+n>Date.now())return t.getItem(e);t.removeItem(e),t.removeItem(e+".expires")}catch(e){}}function j(e,t,n){void 0===n&&(n=63072e3);try{var r=window.localStorage,o=Date.now()+1e3*n;return r.setItem("".concat(e,".expires"),o.toString()),r.setItem(e,t),!0}catch(e){return!1}}function R(e){try{var t=window.localStorage;return t.removeItem(e),t.removeItem(e+".expires"),!0}catch(e){return!1}}function B(e){try{return window.sessionStorage.getItem(e)}catch(e){}}function N(e,t){try{return window.sessionStorage.setItem(e,t),!0}catch(e){return!1}}function V(e,t,n){var r,o=(new Date).getTime();t=he(he({},De),t);var i=n.domainUserId,a=n.userId,u=n.sessionId,c=n.sourceId,s=n.sourcePlatform,l=n.event,f=l.currentTarget;return l="function"==typeof t.reason?t.reason(l):null===(r=null==f?void 0:f.textContent)||void 0===r?void 0:r.trim(),e?[i,o,t.sessionId&&u,t.userId&&_(a||""),t.sourceId&&_(c||""),t.sourcePlatform&&s,t.reason&&_(l||"")].map((function(e){return e||""})).join(".").replace(/([.]*$)/,""):n.domainUserId+"."+o}function _(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function z(e){return!(!e||"string"!=typeof e.valueOf())}function M(e){return Number.isInteger&&Number.isInteger(e)||"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function q(){if("object"==typeof Intl&&"function"==typeof Intl.DateTimeFormat)return(new Intl.DateTimeFormat).resolvedOptions().timeZone}function F(e){if(!z(e)){e=e.text||"";var t=document.getElementsByTagName("title");t&&null!=t[0]&&(e=t[0].text)}return e}function H(e){var t=/^(?:(?:https?|ftp):)\/*(?:[^@]+@)?([^:/#]+)/.exec(e);return t?t[1]:e}function G(e){var t=e.length;return"."===e.charAt(--t)&&(e=e.slice(0,t)),"*."===e.slice(0,2)&&(e=e.slice(1)),e}function J(e){var t=window,n=Z("referrer",t.location.href)||Z("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 W(e,t,n,r){return e.addEventListener?(e.addEventListener(t,n,r),!0):e.attachEvent?e.attachEvent("on"+t,n):void(e["on"+t]=n)}function Z(e,t){return(e=new RegExp("^[^#]*[?&]"+e+"=([^&#]*)").exec(t))?decodeURIComponent(e[1].replace(/\+/g," ")):null}function Q(e,t,n){n=t+"="+n;var r=(e=e.split("#"))[0].split("?"),o=r.shift();if(r=r.join("?")){for(var i=!0,a=r.split("&"),u=0;u<a.length;u++)if(a[u].substr(0,t.length+1)===t+"="){i=!1,a[u]=n,r=a.join("&");break}i&&(r=n+"&"+r)}else r=n;return e[0]=o+"?"+r,e.join("#")}function X(e,t){for(var n=window.location.hostname,r="_sp_root_domain_test_"+(new Date).getTime(),o="_test_value_"+(new Date).getTime(),i=n.split("."),a=i.length-2;0<=a;a--){var u=i.slice(a).join(".");if($(r,o,0,"/",u,e,t),$(r)===o){for(Y(r,"/",u,e,t),n=K("_sp_root_domain_test_"),r=0;r<n.length;r++)Y(n[r],"/",u,e,t);return u}}return n}function Y(e,t,n,r,o){$(e,"",-1,t,n,r,o)}function K(e){for(var t=document.cookie.split("; "),n=[],r=0;r<t.length;r++)t[r].substring(0,e.length)===e&&n.push(t[r]);return n}function $(e,t,n,r,o,i,a){return 1<arguments.length?document.cookie=e+"="+encodeURIComponent(null!=t?t:"")+(n?"; Expires="+new Date(+new Date+1e3*n).toUTCString():"")+(r?"; Path="+r:"")+(o?"; Domain="+o:"")+(i?"; SameSite="+i:"")+(a?"; Secure":""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}function ee(e){return e.className.match(/\S+/g)||[]}function te(e,t){return e.hasOwnProperty("filter")&&e.filter?e.filter:t}function ne(e){var t={};if(e=e.allowlist||e.denylist){Array.isArray(e)||(e=[e]);for(var n=0;n<e.length;n++)t[e[n]]=!0}return t}function re(e,t){var n,r=null!==(n=e.eventStore)&&void 0!==n?n:function(e){function t(){return o?a().then((function(e){window.localStorage.setItem(i,JSON.stringify(e))})):Promise.resolve()}var n=e.maxLocalStorageQueueSize,r=void 0===n?1e3:n,o=void 0===(n=e.useLocalStorage)||n,i="snowplowOutQueue_".concat(e.trackerId),a=(e=function(){if(o){var e=window.localStorage.getItem(i);return e=e?JSON.parse(e):[],I({maxSize:r,events:e})}return I({maxSize:r})}()).getAll,u=e.add,c=e.count,s=e.removeHead;return{count:c,add:function(e){return u(e),t().then(c)},removeHead:function(e){return s(e),t()},iterator:e.iterator,getAll:a,getAllPayloads:e.getAllPayloads,setUseLocalStorage:function(e){o=e}}}(e);return e.eventStore=r,e=D(e),t.bufferFlushers.push(e.flush),{enqueueRequest:e.input,executeQueue:e.flush,setAnonymousTracking:e.setAnonymousTracking,setCollectorUrl:e.setCollectorUrl,setBufferSize:e.setBufferSize,setUseLocalStorage:function(e){r.hasOwnProperty("setUseLocalStorage")&&r.setUseLocalStorage(e)}}}function oe(e,t,n){return"translate.googleusercontent.com"===e?(""===n&&(n=t),e=H(t=null!=(e=(e=/^(?:https?|ftp)(?::\/*(?:[^?]+))([?][^#]+)/.exec(t))&&1<(null==e?void 0:e.length)?Z("u",e[1]):null)?e:"")):"cc.bingj.com"!==e&&"webcache.googleusercontent.com"!==e||(e=H(t=document.links[0].href)),[e,t,n]}function ie(e,t){return void 0===t&&(t={memorizedVisitCount:1}),t=t.memorizedVisitCount,"0"===e[0]?(e[7]=e[6],e[5]=e[4],e[3]++):e[3]=t,t=i(),e[6]=t,e[10]=0,e[8]="",e[9]=void 0,t}function ae(e){e[4]=Math.round((new Date).getTime()/1e3)}function ue(e,t,n){var r=e[9];return{userId:n?"00000000-0000-0000-0000-000000000000":e[1],sessionId:e[6],eventIndex:e[10],sessionIndex:e[3],previousSessionId:n?null:e[7]||null,storageMechanism:"localStorage"==t?"LOCAL_STORAGE":"COOKIE_1",firstEventId:e[8]||null,firstEventTimestamp:r?new Date(r).toISOString():null}}function ce(){return"ResizeObserver"in window?(Oe||(Oe=se()),function(){if(!Ue&&document&&document.body&&document.documentElement){Ue=!0;var e=new ResizeObserver((function(e){for(var t=0;t<e.length;t++){var n=e[t];n.target!==document.body&&n.target!==document.documentElement||(Oe=se())}}));e.observe(document.body),e.observe(document.documentElement)}}(),Oe):se()}function se(){var e=le;if("innerWidth"in window)var t=window.innerWidth,n=window.innerHeight;else t=(n=document.documentElement||document.body).clientWidth,n=n.clientHeight;e=e(Math.max(0,t)+je+Math.max(0,n)),t=le;var r=document.documentElement,o=document.body;return n=Math.max(r.clientWidth,r.offsetWidth,r.scrollWidth),r=Math.max(r.clientHeight,r.offsetHeight,r.scrollHeight,o?Math.max(o.offsetHeight,o.scrollHeight):0),{viewport:e,documentSize:t(n=isNaN(n)||isNaN(r)?"":n+je+r),resolution:le(screen.width+je+screen.height),colorDepth:screen.colorDepth,devicePixelRatio:window.devicePixelRatio,cookiesEnabled:window.navigator.cookieEnabled,online:window.navigator.onLine,browserLanguage:window.navigator.language||window.navigator.userLanguage,documentLanguage:document.documentElement.lang,webdriver:window.navigator.webdriver,deviceMemory:window.navigator.deviceMemory,hardwareConcurrency:window.navigator.hardwareConcurrency}}function le(e){return e&&e.split(je).map((function(e){return Math.floor(Number(e))})).join(je)}function fe(e,t,n,o,u,c){void 0===c&&(c={});var s=[];e=function(e,t,n,o,u,c){function l(){(tt=oe(window.location.hostname,window.location.href,J()))[1]!==rt&&(ot=J(rt)),nt=G(tt[0]),rt=tt[1]}function f(e){for(var t=function(e){return function(t){var n=t.currentTarget;t=V(e,Bt,{domainUserId:Ze,userId:Xe||void 0,sessionId:Qe,sourceId:at,sourcePlatform:it,event:t}),null!=n&&n.href&&(n.href=Q(n.href,"_sp",t))}}(Rt),n=0;n<document.links.length;n++){var r=document.links[n];!r.spDecorationEnabled&&e(r)&&(r.addEventListener("click",t,!0),r.addEventListener("mousedown",t,!0),r.spDecorationEnabled=!0)}}function d(e){if(_e){var t=/#.*/;e=e.replace(t,"")}return ze&&(t=/[{}]/g,e=e.replace(t,"")),e}function v(e){return(e=/^([a-z]+):/.exec(e))?e[1]:null}function g(e){return e=lt+e+"."+We,"localStorage"==Tt?U(e):"cookie"==Tt||"cookieAndLocalStorage"==Tt?Ue.getCookie(e):void 0}function p(){l(),We=Le((ft||nt)+(vt||"/")).slice(0,4)}function h(){qe=(new Date).getTime()}function m(){var e=y(),t=e[0];t<Fe?Fe=t:t>He&&(He=t),(e=e[1])<Ge?Ge=e:e>Je&&(Je=e),h()}function y(){var e=document.documentElement;return e?[e.scrollLeft||window.pageXOffset,e.scrollTop||window.pageYOffset]:[0,0]}function w(){var e=y(),t=e[0];He=Fe=t,Je=Ge=e=e[1]}function b(){return k(lt+"ses."+We,"*",wt)}function S(e){var t=lt+"id."+We,n=kt;return e=r([],e,!0),n&&(e[1]="",e[7]=""),e.shift(),k(t,n=e.join("."),yt)}function k(e,t,n){return!(kt&&!bt)&&("localStorage"==Tt?j(e,t,n):("cookie"==Tt||"cookieAndLocalStorage"==Tt)&&Ue.setCookie(e,t,n,vt,ft,gt,pt))}function T(e){var t=lt+"id."+We,n=lt+"ses."+We;R(t),R(n),Ue.deleteCookie(t,vt,ft,gt,pt),Ue.deleteCookie(n,vt,ft,gt,pt),null!=e&&e.preserveSession||(Qe=i(),At=1),null!=e&&e.preserveUser||(Ze=kt?"":i(),Xe=null)}function x(e){e&&e.stateStorageStrategy&&(c.stateStorageStrategy=e.stateStorageStrategy,Tt=Pe(c)),kt=!!c.anonymousTracking,bt=Ie(c),St=Ee(c),Ct.setUseLocalStorage("localStorage"==Tt||"cookieAndLocalStorage"==Tt),Ct.setAnonymousTracking(St)}function A(){if(!kt||bt){var e="none"!=Tt&&!!g("ses"),t=C();if(t[1])var n=t[1];else n=kt?"":i(),t[1]=n;Ze=n,Qe=e?t[6]:ie(t),At=t[3],"none"!=Tt&&(b(),ae(t),S(t),t[10]||Ue.flush())}}function C(){return"none"==Tt?["1","",0,0,0,void 0,"","","",void 0,0]:function(e,t,n,r){var o=Math.round((new Date).getTime()/1e3);e?(e=e.split(".")).unshift("0"):e=["1",t,o,r,o,"",n],e[6]&&"undefined"!==e[6]||(e[6]=i()),e[7]&&"undefined"!==e[7]||(e[7]=""),e[8]&&"undefined"!==e[8]||(e[8]=""),e[9]&&"undefined"!==e[9]||(e[9]=""),e[10]&&"undefined"!==e[10]||(e[10]=0);var a=function(e,t){return e=parseInt(e),isNaN(e)?t:e};return t=function(e){return e?a(e,void 0):void 0},[e[0],e[1],a(e[2],o),a(e[3],r),a(e[4],o),t(e[5]),e[6],e[7],e[8],t(e[9]),a(e[10],0)]}(g("id")||void 0,Ze,Qe,At)}function I(e){return 0===e.indexOf("http")?e:("https:"===document.location.protocol?"https":"http")+"://"+e}function E(){Pt&&null!=u.pageViewId||(u.pageViewId=i(),u.pageViewUrl=Ne||rt)}function O(){return function(){if(null==u.pageViewId)return!0;if(Pt||!It)return!1;if(void 0===u.pageViewUrl)return!0;var e=Ne||rt;if(!0===It||"full"==It||!("URL"in window))return u.pageViewUrl!=e;e=new URL(e);var t=new URL(u.pageViewUrl);return"pathname"==It?e.pathname!=t.pathname:"pathnameAndSearch"==It&&(e.pathname!=t.pathname||e.search!=t.search)}()&&(u.pageViewId=i(),u.pageViewUrl=Ne||rt),u.pageViewId}function L(){if("none"===Tt||kt||!De)return null;var e=B("_sp_tab_id");return e||(N("_sp_tab_id",i()),e=B("_sp_tab_id")),e||null}function D(e){var t=e.title,n=e.context,r=e.timestamp;if(e=e.contextCallback,l(),Et&&Et==O()&&E(),Et=O(),ut=document.title,t?(Ve=t,ct=!0):ct&&(Ve=null),t=F(Ve||ut),$e.track(function(e){var t=e.pageUrl,n=e.pageTitle;e=e.referrer;var r=a();return r.add("e","pv"),r.add("url",t),r.add("page",n),r.add("refr",e),r}({pageUrl:d(Ne||rt),pageTitle:t,referrer:d(je||ot)}),(n||[]).concat(e?e():[]),r),r=new Date,t=!1,Ot.enabled&&!Ot.installed){t=Ot.installed=!0;var o={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),o.hasSupport=e}}};o.update();var i="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll";Object.prototype.hasOwnProperty.call(o,"hasSupport")?W(document,i,h,{passive:!0}):W(document,i,h),w(),i=function(e,t){return void 0===t&&(t=h),function(e){return W(document,e,t)}},"click mouseup mousedown mousemove keypress keydown keyup touchend touchstart".split(" ").forEach(i(document)),["resize","focus","blur"].forEach(i(window)),i(window,m)("scroll")}if(Ot.enabled&&(st||t))for(r in qe=r.getTime(),r=void 0,Ot.configurations)(t=Ot.configurations[r])&&(window.clearInterval(t.activityInterval),_(t,n,e))}function _(e,t,n){var r=function(e,t){l(),e({context:t,pageViewId:O(),minXOffset:Fe,minYOffset:Ge,maxXOffset:He,maxYOffset:Je}),w()},o=function(){qe+e.configHeartBeatTimer>(new Date).getTime()&&r(e.callback,(t||[]).concat(n?n():[]))};e.activityInterval=0===e.configMinimumVisitLength?window.setInterval(o,e.configHeartBeatTimer):window.setTimeout((function(){qe+e.configMinimumVisitLength>(new Date).getTime()&&r(e.callback,(t||[]).concat(n?n():[])),e.activityInterval=window.setInterval(o,e.configHeartBeatTimer)}),e.configMinimumVisitLength)}function z(e){var t=e.minimumVisitLength,n=e.heartbeatDelay;if(e=e.callback,M(t)&&M(n))return{configMinimumVisitLength:1e3*t,configHeartBeatTimer:1e3*n,callback:e};Ae.error("Activity tracking minimumVisitLength & heartbeatDelay must be integers")}function Y(e){var t=e.context,n=e.minXOffset,r=e.minYOffset,o=e.maxXOffset,i=e.maxYOffset;(e=document.title)!==ut&&(ut=e,Ve=void 0);var u=(e=$e).track,c=d(Ne||rt),s=F(Ve||ut),l=d(je||ot);n=Math.round(n),o=Math.round(o),r=Math.round(r),i=Math.round(i);var f=a();f.add("e","pp"),f.add("url",c),f.add("page",s),f.add("refr",l),n&&!isNaN(Number(n))&&f.add("pp_mix",n.toString()),o&&!isNaN(Number(o))&&f.add("pp_max",o.toString()),r&&!isNaN(Number(r))&&f.add("pp_miy",r.toString()),i&&!isNaN(Number(i))&&f.add("pp_may",i.toString()),u.call(e,f,t)}function K(e){var t=Ot.configurations[e];0===(null==t?void 0:t.configMinimumVisitLength)?window.clearTimeout(null==t?void 0:t.activityInterval):window.clearInterval(null==t?void 0:t.activityInterval),Ot.configurations[e]=void 0}var $,ee,te,ne,se,le,fe,de,ve,ge,pe,me,ye,we,be,Se,ke,Te,xe,Ce;c.eventMethod=null!==($=c.eventMethod)&&void 0!==$?$:"post";var Pe=function(e){var t;return null!==(t=e.stateStorageStrategy)&&void 0!==t?t:"cookieAndLocalStorage"},Ie=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)},Ee=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)},Oe=null!==(te=null===(ee=null==c?void 0:c.contexts)||void 0===ee?void 0:ee.browser)&&void 0!==te&&te,De=null===(se=null===(ne=null==c?void 0:c.contexts)||void 0===ne?void 0:ne.webPage)||void 0===se||se,Ue=c.synchronousCookieWrite?Be:Re;s.push({beforeTrack:function(e){var t=g("ses"),n=C(),r=0===n[10];if(Ye=!!Me&&!!Ue.getCookie(Me),mt||Ye)T();else{if("0"===n[0]?(Qe=t||"none"==Tt?n[6]:ie(n),At=n[3]):(new Date).getTime()-xt>1e3*wt&&(At++,Qe=ie(n,{memorizedVisitCount:At})),ae(n),0===n[10]){var o=e.build();n[8]=o.eid,o=o.dtm||o.ttm,n[9]=o?parseInt(o):void 0}n[10]+=1;var i=(o=ce()).documentSize;e.add("vp",o.viewport),e.add("ds",i),e.add("vid",bt?At:kt?null:At),e.add("sid",bt?Qe:kt?null:Qe),e.add("duid",kt?null:n[1]),e.add("uid",kt?null:Xe),l(),e.add("refr",d(je||ot)),e.add("url",d(Ne||rt)),o=ue(n,Tt,kt),!Lt||kt&&!bt||e.addContextEntity({schema:"iglu:com.snowplowanalytics.snowplow/client_session/jsonschema/1-0-2",data:o}),"none"!=Tt&&(S(n),e=b(),t&&!r||!e||!Dt||Ut||(Ue.flush(),Dt(o),Ut=!1)),xt=(new Date).getTime()}}}),De&&s.push({contexts:function(){return[{schema:"iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",data:{id:O()}}]}}),Oe&&s.push({contexts:function(){return[{schema:"iglu:com.snowplowanalytics.snowplow/browser_context/jsonschema/2-0-0",data:he(he({},ce()),{tabId:L()})}]}}),s.push.apply(s,null!==(le=c.plugins)&&void 0!==le?le:[]);var je,Ne,Ve,_e,ze,Me,qe,Fe,He,Ge,Je,We,Ze,Qe,Xe,Ye,Ke,$e=P({base64:null!==(fe=c.encodeBase64)&&void 0!==fe?fe:"post"!==c.eventMethod,corePlugins:s,callback:function(e){mt||Ye||Ct.enqueueRequest(e.build())}}),et=document.characterSet||document.charset,tt=oe(window.location.hostname,window.location.href,J()),nt=G(tt[0]),rt=tt[1],ot=tt[2],it=null!==(de=c.platform)&&void 0!==de?de:"web",at=null!==(ve=c.appId)&&void 0!==ve?ve:"",ut=document.title,ct=!1,st=null===(ge=c.resetActivityTrackingOnPageView)||void 0===ge||ge,lt=null!==(pe=c.cookieName)&&void 0!==pe?pe:"_sp_",ft=null!==(me=c.cookieDomain)&&void 0!==me?me:void 0,dt=null!==(ye=c.discoverRootDomain)&&void 0!==ye?ye:void 0===ft,vt="/",gt=null!==(we=c.cookieSameSite)&&void 0!==we?we:"Lax",pt=null===(be=c.cookieSecure)||void 0===be||be,ht=window.navigator.doNotTrack||window.navigator.msDoNotTrack||window.doNotTrack,mt=void 0!==c.respectDoNotTrack&&(c.respectDoNotTrack&&("yes"===ht||"1"===ht)),yt=null!==(Se=c.cookieLifetime)&&void 0!==Se?Se:63072e3,wt=null!==(ke=c.sessionCookieTimeout)&&void 0!==ke?ke:1800,bt=Ie(c),St=Ee(c),kt=!!c.anonymousTracking,Tt=Pe(c),xt=(new Date).getTime(),At=1,Ct=re(he({trackerId:e,endpoint:I(o),serverAnonymization:St,useLocalStorage:"localStorage"==Tt||"cookieAndLocalStorage"==Tt},c),u),Pt=!1,It=null!==(Te=c.preservePageViewIdForUrl)&&void 0!==Te&&Te,Et=void 0,Ot={enabled:!1,installed:!1,configurations:{}},Lt=null!==(Ce=null===(xe=c.contexts)||void 0===xe?void 0:xe.session)&&void 0!==Ce&&Ce,Dt=c.onSessionUpdateCallback,Ut=!1,jt="boolean"==typeof(Ke=c.useExtendedCrossDomainLinker||!1)?{useExtendedCrossDomainLinker:Ke}:{useExtendedCrossDomainLinker:!0,collectCrossDomainAttributes:Ke},Rt=jt.useExtendedCrossDomainLinker,Bt=jt.collectCrossDomainAttributes;dt&&!ft&&(ft=X(gt,pt));var Nt=ce(),Vt=Nt.browserLanguage,_t=Nt.resolution,zt=Nt.colorDepth,Mt=Nt.cookiesEnabled,qt=q();return $e.setTrackerVersion(n),$e.setTrackerNamespace(t),$e.setAppId(at),$e.setPlatform(it),$e.addPayloadPair("cookie",Mt?"1":"0"),$e.addPayloadPair("cs",et),$e.addPayloadPair("lang",Vt),$e.addPayloadPair("res",_t),$e.addPayloadPair("cd",zt),qt&&$e.addPayloadPair("tz",qt),p(),A(),c.crossDomainLinker&&f(c.crossDomainLinker),he(he({},{getDomainSessionIndex:function(){return At},getPageViewId:O,getTabId:L,newSession:function(){var e=C();if("0"===e[0]?(Qe="none"!=Tt?ie(e):e[6],At=e[3]):(At++,Qe=ie(e,{memorizedVisitCount:At})),ae(e),"none"!=Tt){var t=ue(e,Tt,kt);S(e),e=b(),Ue.flush(),e&&Dt&&(Ut=!0,Dt(t))}xt=(new Date).getTime()},getCookieName:function(e){return lt+e+"."+We},getUserId:function(){return Xe},getDomainUserId:function(){return C()[1]},getDomainUserInfo:function(){return C()},setReferrerUrl:function(e){je=e},setCustomUrl:function(e){l();var t,n=rt;v(e)?Ne=e:"/"===e.slice(0,1)?Ne=v(n)+"://"+H(n)+e:(0<=(t=(n=d(n)).indexOf("?"))&&(n=n.slice(0,t)),(t=n.lastIndexOf("/"))!==n.length-1&&(n=n.slice(0,t+1)),Ne=n+e)},setDocumentTitle:function(e){ut=document.title,Ve=e,ct=!1},discardHashTag:function(e){_e=e},discardBrace:function(e){ze=e},setCookiePath:function(e){vt=e,p()},setVisitorCookieTimeout:function(e){yt=e},crossDomainLinker:function(e){f(e)},enableActivityTracking:function(e){Ot.configurations.pagePing||(Ot.enabled=!0,Ot.configurations.pagePing=z(he(he({},e),{callback:Y})))},enableActivityTrackingCallback:function(e){Ot.configurations.callback||(Ot.enabled=!0,Ot.configurations.callback=z(e))},disableActivityTracking:function(){K("pagePing")},disableActivityTrackingCallback:function(){K("callback")},updatePageActivity:function(){h()},setOptOutCookie:function(e){Me=e},setUserId:function(e){Xe=e},setUserIdFromLocation:function(e){l(),Xe=Z(e,rt)},setUserIdFromReferrer:function(e){l(),Xe=Z(e,ot)},setUserIdFromCookie:function(e){Xe=Ue.getCookie(e)},setCollectorUrl:function(e){Ct.setCollectorUrl(I(e))},setBufferSize:function(e){Ct.setBufferSize(e)},flushBuffer:function(e){void 0===e&&(e={}),Ct.executeQueue(),e.newBufferSize&&Ct.setBufferSize(e.newBufferSize)},trackPageView:function(e){void 0===e&&(e={}),D(e)},preservePageViewId:function(){Pt=!0},preservePageViewIdForUrl:function(e){It=e},disableAnonymousTracking:function(e){c.anonymousTracking=!1,x(e),A(),Ct.executeQueue()},enableAnonymousTracking:function(e){var t;c.anonymousTracking=null===(t=e&&(null==e?void 0:e.options))||void 0===t||t,x(e),bt||E()},clearUserData:T}),{id:e,namespace:t,core:$e,sharedState:u})}(e,t,n,o,u,c);var l=he(he({},e),{addPlugin:function(e){var t,n;l.core.addPlugin(e),null===(n=(t=e.plugin).activateBrowserPlugin)||void 0===n||n.call(t,l)}});return s.forEach((function(e){var t;null===(t=e.activateBrowserPlugin)||void 0===t||t.call(e,l)})),l}function de(e){return ge(e,Ne)}function ve(){return Object.keys(Ne)}function ge(e,t){for(var n=[],r=0;r<e.length;r++){var o=e[r];t.hasOwnProperty(o)?n.push(t[o]):Ae.warn(o+" not configured")}return n}function pe(){try{return!!window.localStorage}catch(e){return!0}}var he=function(){return he=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},he.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;for(var me=[],ye=0;256>ye;++ye)me.push((ye+256).toString(16).slice(1));var we,be,Se,ke=new Uint8Array(16),Te={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},xe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";(Se=be||(be={}))[Se.none=0]="none",Se[Se.error=1]="error",Se[Se.warn=2]="warn",Se[Se.debug=3]="debug",Se[Se.info=4]="info";var Ae=function(e){return void 0===e&&(e=be.warn),{setLogLevel:function(t){e=be[t]?t:be.warn},warn:function(t,n){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];e>=be.warn&&"undefined"!=typeof console&&(i="Snowplow: "+t,n?console.warn.apply(console,r([i+"\n",n],o,!1)):console.warn.apply(console,r([i],o,!1)))},error:function(t,n){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];e>=be.error&&"undefined"!=typeof console&&(i="Snowplow: "+t+"\n",n?console.error.apply(console,r([i+"\n",n],o,!1)):console.error.apply(console,r([i],o,!1)))},debug:function(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];e>=be.debug&&"undefined"!=typeof console&&console.debug.apply(console,r(["Snowplow: "+t],n,!1))},info:function(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];e>=be.info&&"undefined"!=typeof console&&console.info.apply(console,r(["Snowplow: "+t],n,!1))}}}(),Ce={},Pe={};!function(){var e={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(t){if(t.constructor==Number)return 16711935&e.rotl(t,8)|4278255360&e.rotl(t,24);for(var n=0;n<t.length;n++)t[n]=e.endian(t[n]);return t},randomBytes:function(e){for(var t=[];0<e;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var t=[],n=0;n<e.length;n+=3)for(var r=e[n]<<16|e[n+1]<<8|e[n+2],o=0;4>o;o++)8*n+6*o<=8*e.length?t.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>>6*(3-o)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],n=0,r=0;n<e.length;r=++n%4)0!=r&&t.push(("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(n-1))&Math.pow(2,-2*r+8)-1)<<2*r|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(n))>>>6-2*r);return t}};Pe=e}();var Ie={utf8:{stringToBytes:function(e){return Ie.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(Ie.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}},Ee=Ie;!function(){var e=Pe,t=Ee.utf8,n=Ee.bin,r=function(r,o){var i=e.wordsToBytes,a=r;a.constructor==String?a=t.stringToBytes(a):"undefined"!=typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(a)?a=Array.prototype.slice.call(a,0):Array.isArray(a)||(a=a.toString()),r=e.bytesToWords(a);var u=8*a.length;a=[];var c=1732584193,s=-271733879,l=-1732584194,f=271733878,d=-1009589776;for(r[u>>5]|=128<<24-u%32,r[15+(u+64>>>9<<4)]=u,u=0;u<r.length;u+=16){for(var v=c,g=s,p=l,h=f,m=d,y=0;80>y;y++){if(16>y)a[y]=r[u+y];else{var w=a[y-3]^a[y-8]^a[y-14]^a[y-16];a[y]=w<<1|w>>>31}w=(c<<5|c>>>27)+d+(a[y]>>>0)+(20>y?1518500249+(s&l|~s&f):40>y?1859775393+(s^l^f):60>y?(s&l|s&f|l&f)-1894007588:(s^l^f)-899497514),d=f,f=l,l=s<<30|s>>>2,s=c,c=w}c+=v,s+=g,l+=p,f+=h,d+=m}return i=i.call(e,[c,s,l,f,d]),o&&o.asBytes?i:o&&o.asString?n.bytesToString(i):e.bytesToHex(i)};r._blocksize=16,r._digestsize=20,Ce=r}();var Oe,Le=Ce,De={sessionId:!0,sourceId:!0,sourcePlatform:!1,userId:!1,reason:!1},Ue=!1,je="x",Re=function(){function e(e){return t[e]||(t[e]=function(e){function t(){void 0!==n&&(clearTimeout(n),n=void 0),i||(i=!0,void 0!==r&&$(e,r[0],r[1],r[2],r[3],r[4],r[5]))}var n,r,o,i=!0;return{getValue:function(){var t;return r&&(!o||o>new Date)&&null!==(t=r[0])&&void 0!==t?t:$(e)},setValue:function(e,a,u,c,s,l){return r=[e,a,u,c,s,l],i=!1,void 0===n&&(n=setTimeout((function(){n=void 0,t()}),10)),o=new Date(Date.now()+1e3*Math.min(.05,null!=a?a:.05)),!0},deleteValue:function(t,o,a,u){r=void 0,i=!0,void 0!==n&&(clearTimeout(n),n=void 0),Y(e,t,o,a,u)},flush:t}}(e)),t[e]}var t={};return{getCookie:function(t){return e(t).getValue()},setCookie:function(t,n,r,o,i,a,u){return e(t).setValue(n,r,o,i,a,u)},deleteCookie:function(t,n,r,o,i){e(t).deleteValue(n,r,o,i)},clearCache:function(){t={}},flush:function(){for(var e=0,n=Object.values(t);e<n.length;e++)n[e].flush()}}}(),Be={getCookie:$,setCookie:function(e,t,n,r,o,i,a){return $(e,t,n,r,o,i,a),-1!==document.cookie.indexOf("".concat(e,"="))},deleteCookie:Y,flush:function(){}},Ne={},Ve=function(){this.bufferFlushers=[],this.hasLoaded=!1,this.registeredOnLoadHandlers=[]};e.SharedState=Ve,e.addEventListener=W,e.addTracker=function(e,t,n,r,o,i){return Ne.hasOwnProperty(e)?null:(Ne[e]=fe(e,t,n,r,o,i),Ne[e])},e.allTrackerNames=ve,e.allTrackers=function(){return Ne},e.attemptDeleteLocalStorage=R,e.attemptGetLocalStorage=U,e.attemptGetSessionStorage=B,e.attemptWriteLocalStorage=j,e.attemptWriteSessionStorage=N,e.cookie=$,e.createCrossDomainParameterValue=V,e.createSharedState=function(){function e(){var e;if(!t.hasLoaded)for(t.hasLoaded=!0,e=0;e<t.registeredOnLoadHandlers.length;e++)t.registeredOnLoadHandlers[e]();return!0}var t=new Ve,n=document,r=window;return n.visibilityState&&W(n,"visibilitychange",(function(){"hidden"==n.visibilityState&&t.bufferFlushers.forEach((function(e){e(!1)}))}),!1),W(r,"beforeunload",(function(){t.bufferFlushers.forEach((function(e){e(!1)}))}),!1),"loading"===document.readyState?(n.addEventListener?n.addEventListener("DOMContentLoaded",(function t(){n.removeEventListener("DOMContentLoaded",t,!1),e()})):n.attachEvent&&n.attachEvent("onreadystatechange",(function t(){"complete"===n.readyState&&(n.detachEvent("onreadystatechange",t),e())})),W(r,"load",e,!1)):e(),t},e.decorateQuerystring=Q,e.deleteCookie=Y,e.dispatchToTrackers=function(e,t){try{de(null!=e?e:ve()).forEach(t)}catch(e){Ae.error("Function failed",e)}},e.dispatchToTrackersInCollection=function(e,t,n){try{ge(null!=e?e:Object.keys(t),t).forEach(n)}catch(e){Ae.error("Function failed",e)}},e.findRootDomain=X,e.fixupDomain=G,e.fixupTitle=F,e.fixupUrl=oe,e.flushPendingCookies=function(){Re.flush()},e.fromQuerystring=Z,e.getCookiesWithPrefix=K,e.getCssClasses=ee,e.getFilterByClass=function(e){if(null==e||"object"!=typeof e||Array.isArray(e))return function(){return!0};var t=Object.prototype.hasOwnProperty.call(e,"allowlist"),n=ne(e);return te(e,(function(e){e:{var r=0;for(e=ee(e);r<e.length;r++)if(n[e[r]]){r=!0;break e}r=!1}return r===t}))},e.getFilterByName=function(e){if(null==e||"object"!=typeof e||Array.isArray(e))return function(){return!0};var t=e.hasOwnProperty("allowlist"),n=ne(e);return te(e,(function(e){return e.name in n===t}))},e.getHostName=H,e.getReferrer=J,e.getTimeZone=q,e.getTracker=function(e){return Ne.hasOwnProperty(e)?Ne[e]:(Ae.warn(e+" not configured"),null)},e.getTrackers=de,e.hasLocalStorage=pe,e.hasSessionStorage=function(){try{return!!window.sessionStorage}catch(e){return!0}},e.isFunction=function(e){return!(!e||"function"!=typeof e)},e.isInteger=M,e.isString=z,e.isValueInArray=function(e,t){for(var n=0;n<t.length;n++)if(t[n]===e)return!0;return!1},e.localStorageAccessible=function(){if(!pe())return!1;try{var e=window.localStorage;return e.setItem("modernizr","modernizr"),e.removeItem("modernizr"),!0}catch(e){return!1}},e.parseAndValidateFloat=function(e){return e=parseFloat(e),isNaN(e)?void 0:e},e.parseAndValidateInt=function(e){return e=parseInt(e),isNaN(e)?void 0:e},e.trackerExists=function(e){return Ne.hasOwnProperty(e)},e.urlSafeBase64Encode=_,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=index.umd.min.js.map
{
"name": "@snowplow/browser-tracker-core",
"version": "4.0.2",
"version": "4.0.3",
"description": "Core functionality for Snowplow Browser trackers",

@@ -24,3 +24,3 @@ "homepage": "http://bit.ly/sp-js",

"uuid": "^10.0.0",
"@snowplow/tracker-core": "4.0.2"
"@snowplow/tracker-core": "4.0.3"
},

@@ -27,0 +27,0 @@ "devDependencies": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc