@snowplow/browser-tracker-core
Advanced tools
Comparing version 4.0.0-beta.2 to 4.0.0-beta.3
/*! | ||
* Core functionality for Snowplow Browser trackers v4.0.0-beta.2 (http://bit.ly/sp-js) | ||
* Core functionality for Snowplow Browser trackers v4.0.0-beta.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,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).snowplowBrowserTrackerCore={})}(this,(function(e){function n(e,n,t,r){return new(t||(t=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 t?e:new t((function(n){n(e)}))}(e.value).then(a,u)}c((r=r.apply(e,n||[])).next())}))}function t(e,n){function t(t){return function(c){return function(t){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,t[0]&&(u=0)),u;)try{if(r=1,o&&(i=2&t[0]?o.return:t[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,t[1])).done)return i;switch(o=0,i&&(t=[2&t[0],i.value]),t[0]){case 0:case 1:i=t;break;case 4:return u.label++,{value:t[1],done:!1};case 5:u.label++,o=t[1],t=[0];continue;case 7:t=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=0<i.length&&i[i.length-1])||6!==t[0]&&2!==t[0])){u=0;continue}if(3===t[0]&&(!i||t[1]>i[0]&&t[1]<i[3]))u.label=t[1];else if(6===t[0]&&u.label<i[1])u.label=i[1],i=t;else{if(!(i&&u.label<i[2])){i[2]&&u.ops.pop(),u.trys.pop();continue}u.label=i[2],u.ops.push(t)}}t=n.call(e,u)}catch(e){t=[6,e],o=0}finally{r=i=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,c])}}var r,o,i,a,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a}function r(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}function o(){if(!pe&&!(pe="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return pe(me)}function i(e,n,t){if((e=(e=e||{}).random||(e.rng||o)())[6]=15&e[6]|64,e[8]=63&e[8]|128,n){t=t||0;for(var r=0;16>r;++r)n[t+r]=e[r];return n}return function(e){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;if("string"!=typeof(n=(ye[e[n+0]]+ye[e[n+1]]+ye[e[n+2]]+ye[e[n+3]]+"-"+ye[e[n+4]]+ye[e[n+5]]+"-"+ye[e[n+6]]+ye[e[n+7]]+"-"+ye[e[n+8]]+ye[e[n+9]]+"-"+ye[e[n+10]]+ye[e[n+11]]+ye[e[n+12]]+ye[e[n+13]]+ye[e[n+14]]+ye[e[n+15]]).toLowerCase())||!he.test(n))throw TypeError("Stringified UUID is invalid");return n}(e)}function a(){var e,n={},t=[],r=[],o=[],i=function(e,t){null!=t&&""!==t&&(n[e]=t)};return{add:i,addDict:function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&i(n,e[n])},addJson:function(e,n,o){o&&c(o)&&(e={keyIfEncoded:e,keyIfNotEncoded:n,json:o},r.push(e),t.push(e))},addContextEntity:function(e){o.push(e)},getPayload:function(){return n},getJson:function(){return t},withJsonProcessor:function(n){e=n},build:function(){return null==e||e(this,r,o),n}}}function u(e){return function(n,t,o){for(var i=function(t,r,o){if(t=JSON.stringify(t),e){if(o=n.add,t){var i=0,a=0,u=[];if(t){t=unescape(encodeURIComponent(t));do{var c=t.charCodeAt(i++),s=t.charCodeAt(i++),l=t.charCodeAt(i++),f=c<<16|s<<8|l;c=f>>18&63,s=f>>12&63,l=f>>6&63,f&=63,u[a++]=ke.charAt(c)+ke.charAt(s)+ke.charAt(l)+ke.charAt(f)}while(i<t.length);i=u.join(""),t=((t=t.length%3)?i.slice(0,t-3):i)+"===".slice(t||3)}t=t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o.call(n,r,t)}else n.add(o,t)},a=function(t,r){if(!t){var o=n.getPayload();if(e?o.cx:o.co){var i=(t=JSON).parse;if(e){if(o=o.cx){switch(4-o.length%4){case 2:o+="==";break;case 3:o+="="}o=function(e){var n,t=0,r=0,o="",i=[];if(!e)return e;e+="";do{var a=ke.indexOf(e.charAt(t++)),u=ke.indexOf(e.charAt(t++));o=ke.indexOf(e.charAt(t++));var c=ke.indexOf(e.charAt(t++)),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(t<e.length);return o=i.join(""),n=o.replace(/\0+$/,""),decodeURIComponent(n.split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))}(o=o.replace(/-/g,"+").replace(/_/g,"/"))}}else o=o.co;t=i.call(t,o)}else t=void 0}return t?t.data=t.data.concat(r.data):t=r,t},u=void 0,c=0;c<t.length;c++){var s=t[c];"cx"===s.keyIfEncoded?u=a(u,s.json):i(s.json,s.keyIfEncoded,s.keyIfNotEncoded)}t.length=0,o.length&&(u=a(u,t={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 n in e)if(Object.prototype.hasOwnProperty.call(e,n))return!0;return!1}function s(e){return null!=e&&(e.constructor==={}.constructor||e.constructor===[].constructor)}function l(){var e=[],n=[],t={},r={};return{getGlobalPrimitives:function(){return e.concat(Object.values(t))},getConditionalProviders:function(){return n.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):h(c)&&a.push(c)}e=e.concat(a),n=n.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:h(c)&&(t[a]=c)},clearGlobalContexts:function(){n=[],e=[],r={},t={}},removeGlobalContexts:function(o){for(var i=function(o){"string"==typeof o?(delete r[o],delete t[o]):b(o)?n=n.filter((function(e){return JSON.stringify(e)!==JSON.stringify(o)})):h(o)&&(e=e.filter((function(e){return JSON.stringify(e)!==JSON.stringify(o)})))},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(t)),o,u,i);return a.push.apply(a,c),o=function(e,n,t,r){var o;return e=T(e).map((function(e){e:{if(y(e)){var o=e[0],i=!1;try{i=o({event:n.getPayload(),eventType:t,eventSchema:r})}catch(e){i=!1}if(!0===i){e=x(e[1],n,t,r);break e}}else if(w(e)&&function(e,n){var t=0,r=0,o=e.accept;return Array.isArray(o)?e.accept.some((function(e){return S(e,n)}))&&r++:"string"==typeof o&&S(o,n)&&r++,o=e.reject,Array.isArray(o)?e.reject.some((function(e){return S(e,n)}))&&t++:"string"==typeof o&&S(o,n)&&t++,0<r&&0===t}(e[0],r)){e=x(e[1],n,t,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)})))}(n.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 n=!1,t=0;for(e=e.slice(2);t<e.length;t++)if("*"===e[t])n=!0;else if(n)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 n=e[0];return 5===e.length&&f(n)}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 m(e){return"function"==typeof e&&1>=e.length}function h(e){return m(e)||p(e)}function y(e){return!(!Array.isArray(e)||2!==e.length)&&(Array.isArray(e[1])?m(e[0])&&e[1].every(h):m(e[0])&&h(e[1]))}function w(e){return!(!Array.isArray(e)||2!==e.length)&&(!!function(e){var n=0;if(null!=e&&"object"==typeof e&&!Array.isArray(e)){if(Object.prototype.hasOwnProperty.call(e,"accept")){if(!g(e.accept))return!1;n+=1}if(Object.prototype.hasOwnProperty.call(e,"reject")){if(!g(e.reject))return!1;n+=1}return 0<n&&2>=n}return!1}(e[0])&&(Array.isArray(e[1])?e[1].every(h):h(e[1])))}function b(e){return y(e)||w(e)}function S(e,n){if(!v(e))return!1;if(e=d(e),n=null!==(n=/^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(n))?n.slice(1,6):void 0,e&&n){if(!function(e,n){if(n=n.split("."),e=e.split("."),n&&e){if(n.length!==e.length)return!1;for(var t=0;t<e.length;t++)if(!k(n[t],e[t]))return!1;return!0}return!1}(e[0],n[0]))return!1;for(var t=1;5>t;t++)if(!k(e[t],n[t]))return!1;return!0}return!1}function k(e,n){return e&&n&&"*"===e||e===n}function T(e){return Array.isArray(e)?e:[e]}function x(e,n,t,r){var o;return e=T(e).map((function(e){e:if(p(e))e=[e];else{if(m(e)){n:{var o=void 0;try{if(o=e({event:n.getPayload(),eventType:t,eventSchema:r}),Array.isArray(o)&&o.every(p)||p(o)){var i=o;break n}i=void 0;break n}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 C(e){void 0===e&&(e={});var n,t,o,a,c,f,d,v=e.base64,g=e.corePlugins,p=null!=g?g:[];n=null==v||v,t=p,o=e.callback,a=function(e){return{addPluginContexts:function(n){var t=n?r([],n,!0):[];return e.forEach((function(e){try{e.contexts&&t.push.apply(t,e.contexts())}catch(e){Te.error("Error adding plugin contexts",e)}})),t}}}(t),c=l(),f=n,d={};var m=ge(ge({},e={track:function(e,n,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()),n=function(e,n){e=c.getApplicableContexts(e);var t=[];return n&&n.length&&t.push.apply(t,n),e&&e.length&&t.push.apply(t,e),t}(e,a.addPluginContexts(n)),void 0!==(n=n&&n.length?{schema:"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",data:n}:void 0)&&e.addJson("cx","co",n),t.forEach((function(n){try{n.beforeTrack&&n.beforeTrack(e)}catch(e){Te.error("Plugin beforeTrack",e)}})),!t.find((function(n){try{return n.filter&&!1===n.filter(e.build())}catch(e){return Te.error("Plugin filter",e),!1}}))){"function"==typeof o&&o(e);var s=e.build();return t.forEach((function(e){try{e.afterTrack&&e.afterTrack(s)}catch(e){Te.error("Plugin afterTrack",e)}})),s}},addPayloadPair:function(e,n){d[e]=n},getBase64Encoding:function(){return f},setBase64Encoding:function(e){f=e},addPayloadDict:function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(d[n]=e[n])},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,n){d.res=e+"x"+n},setViewport:function(e,n){d.vp=e+"x"+n},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 n,t;e=e.plugin,p.push(e),null===(n=e.logger)||void 0===n||n.call(e,Te),null===(t=e.activateCorePlugin)||void 0===t||t.call(e,m)}});return null==p||p.forEach((function(e){var n,t;null===(n=e.logger)||void 0===n||n.call(e,Te),null===(t=e.activateCorePlugin)||void 0===t||t.call(e,m)})),m}function A(e){var n=e.maxSize,t=void 0===n?1e3:n,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>t;)o.shift();return i()},removeHead:function(e){for(var n=0;n<e;n++)o.shift();return Promise.resolve()},iterator:function(){var e=0,n=r([],o,!0);return{next:function(){return e<n.length?Promise.resolve({value:n[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 P(e){function n(){return S.reduce((function(e,n){return e+(k?n.getPOSTRequestBytesCount():n.getGETRequestBytesCount())}),0)}function t(){return S.length}function r(){var e=new Headers;return k&&e.append("Content-Type","application/json; charset=UTF-8"),d&&Object.keys(d).forEach((function(n){e.append(n,d[n])})),0<S.length&&S[0].getServerAnonymization()&&e.append("SP-Anonymous","*"),e}function o(){var e=u;return u.includes("://")||(e="".concat(s,"://").concat(u)),l&&(e="".concat(e,":").concat(l)),e+(k?m:"/i")}function i(e,n){var t=new AbortController;return f=setTimeout((function(){console.error("Request timed out"),t.abort()}),null!=v?v:5e3),n=ge({headers:r(),signal:t.signal,keepalive:p,credentials:b},n),new Request(e,n)}function a(){var e=function(e){for(var n=(new Date).getTime().toString(),t=0;t<e.length;t++)e[t].stm=n;return e}(S.map((function(e){return e.getPOSTRequestBody()})));return i(o(),{method:"POST",body:JSON.stringify({schema:"iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4",data:e})})}var u=e.endpoint,c=e.protocol,s=void 0===c?"https":c,l=e.port;c=e.eventMethod;var f,d=e.customHeaders,v=e.connectionTimeout,g=e.keepalive,p=void 0===g||g,m=void 0===(g=e.postPath)?"/com.snowplowanalytics.snowplow/tp2":g,h=void 0===(g=e.useStm)||g,y=e.bufferSize,w=void 0===(g=e.maxPostBytes)?4e4:g,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 a();if(1!==S.length)throw Error("Only one event can be sent in a GET request");return i(S[0].getGETRequestURL(o(),h),{method:"GET"})}},countBytes:n,countEvents:t,isFull:function(){return k?void 0!==y&&t()>=Math.max(1,y)||n()>=w:1<=S.length},cancelTimeoutTimer:function(){f&&(clearTimeout(f),f=void 0)}}}function I(e){for(var n=0,t=0;t<e.length;t++){var r=e.charCodeAt(t);127>=r?n+=1:2047>=r?n+=2:55296<=r&&57343>=r?(n+=4,t++):n=65535>r?n+3:n+4}return n}function E(e){function n(){return e.payload}function t(e){if(null===o){var n,t={co:!0,cx:!0},r=[];for(n in e)e.hasOwnProperty(n)&&!t[n]&&r.push(n+"="+encodeURIComponent(e[n]));for(var i in t)e.hasOwnProperty(i)&&t[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(n){return[n,e[n]]})).reduce((function(e,n){return e[n[0]]=n[1].toString(),e}),{})}(n())),i}var o=null,i=null,a=null,u=null;return{getPayload:n,getServerAnonymization:function(){var n;return null!==(n=e.svrAnon)&&void 0!==n&&n},getGETRequestURL:function(e,r){var o=t(n());return r?e+o.replace("?","?stm="+(new Date).getTime()+"&"):e+o},getGETRequestBytesCount:function(){if(null===a){var e=t(n());a=I(e)}return a},getPOSTRequestBody:r,getPOSTRequestBytesCount:function(){return null===u&&(u=I(JSON.stringify(r()))),u}}}function O(e){function r(e,n){void 0!==C&&setTimeout((function(){try{null==C||C(e,n)}catch(e){Te.error("Error in onRequestFailure",e)}}),0)}function o(e){return n(this,void 0,void 0,(function(){var n,o,i,a,u,c;return t(this,(function(t){switch(t.label){case 0:if(void 0===(n=e.toRequest()))throw Error("Empty batch");o=e.getEvents().map((function(e){return e.getPayload()})),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,O(n)];case 2:return i=t.sent(),e.cancelTimeoutTimer(),i.ok?(function(e,n){void 0!==I&&setTimeout((function(){try{null==I||I(e,n)}catch(e){Te.error("Error in onRequestSuccess",e)}}),0)}(o,i),[2,{success:!0,retry:!1,status:i.status}]):(a=function(e){return!(200<=e&&300>e||!x||!T.includes(e)&&k.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 3:return u=t.sent(),c="string"==typeof u?u:u?u.message:"Unknown error",r({events:o,message:c,willRetry:!0}),[2,{success:!1,retry:!0}];case 4:return[2]}}))}))}function i(){return P({endpoint:s,protocol:d,port:v,eventMethod:f,customHeaders:h,connectionTimeout:w,keepalive:b,bufferSize:m,maxPostBytes:g,useStm:L,credentials:j})}function a(){return n(this,void 0,void 0,(function(){var e;return t(this,(function(n){switch(n.label){case 0:return!S||B?[3,2]:(B=!0,e=new Request(S,{method:"GET"}),[4,O(e)]);case 1:n.sent(),n.label=2;case 2:return[2]}}))}))}function u(){return n(this,void 0,void 0,(function(){var e;return t(this,(function(n){switch(n.label){case 0:if(U)return[3,5];U=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,c()];case 2:return n.sent(),[3,5];case 3:return e=n.sent(),Te.error("Error sending events",e),[3,5];case 4:return U=!1,[7];case 5:return[2]}}))}))}function c(){return n(this,void 0,void 0,(function(){var e,n,r,u,s,l,f,d,v;return t(this,(function(t){switch(t.label){case 0:return[4,a()];case 1:t.sent(),e=i(),n=D.iterator(),t.label=2;case 2:return e.isFull()?[3,4]:[4,n.next()];case 3:return r=t.sent(),u=r.value,r.done||void 0===u?[3,4]:(s=E(u),e.addEvent(s)?[3,2]:[3,4]);case 4:return 0===e.countEvents()?[2]:[4,o(e)];case 5:return l=t.sent(),f=l.success,d=l.retry,v=l.status,!f&&d?[3,7]:(f||Te.error("Status ".concat(v,", will not retry.")),[4,D.removeHead(e.countEvents())]);case 6:t.sent(),t.label=7;case 7:return f?[4,c()]:[3,9];case 8:t.sent(),t.label=9;case 9:return[2]}}))}))}var s=e.endpoint,l=e.eventMethod,f=void 0===l?"post":l,d=e.protocol,v=e.port,g=void 0===(l=e.maxPostBytes)?4e4:l,p=e.maxGetBytes,m=void 0===(l=e.bufferSize)?1:l,h=e.customHeaders,y=e.serverAnonymization,w=e.connectionTimeout,b=e.keepalive,S=e.idService,k=void 0===(l=e.dontRetryStatusCodes)?[]:l,T=void 0===(l=e.retryStatusCodes)?[]:l,x=void 0===(l=e.retryFailedRequests)||l,C=e.onRequestFailure,I=e.onRequestSuccess,O=void 0===(l=e.customFetch)?fetch:l,L=e.useStm,D=void 0===(l=e.eventStore)?A({}):l,j=e.credentials,B=!1,U=!1,R="post"===f.toLowerCase();return k=k.concat([400,401,403,410,422]),{flush:u,input:function(e){return n(this,void 0,void 0,(function(){var n,r,a;return t(this,(function(t){switch(t.label){case 0:e:{if(t=r=E(n={payload:e,svrAnon:void 0!==(t=y)&&t}),R){var c=(t=t.getPOSTRequestBytesCount())>g;c&&Te.warn("Event ("+t+"B) too big, max is "+g)}else{if(void 0===p){t=!1;break e}(c=(t=t.getGETRequestBytesCount())>p)&&Te.warn("Event ("+t+"B) too big, max is "+p)}t=c}return t?((a=i()).addEvent(r),[4,o(a)]):[3,2];case 1:return t.sent(),[3,5];case 2:return[4,D.add(n)];case 3:return t.sent()>=m?[4,u()]:[3,5];case 4:t.sent(),t.label=5;case 5:return[2]}}))}))},setCollectorUrl:function(e){s=e},setAnonymousTracking:function(e){y=e},setBufferSize:function(e){m=e}}}function L(e){try{var n=window.localStorage,t=n.getItem(e+".expires");if(null===t||+t>Date.now())return n.getItem(e);n.removeItem(e),n.removeItem(e+".expires")}catch(e){}}function D(e,n,t){void 0===t&&(t=63072e3);try{var r=window.localStorage,o=Date.now()+1e3*t;return r.setItem("".concat(e,".expires"),o.toString()),r.setItem(e,n),!0}catch(e){return!1}}function j(e){try{var n=window.localStorage;return n.removeItem(e),n.removeItem(e+".expires"),!0}catch(e){return!1}}function B(e){try{return window.sessionStorage.getItem(e)}catch(e){}}function U(e,n){try{return window.sessionStorage.setItem(e,n),!0}catch(e){return!1}}function R(e,n,t){var r,o=(new Date).getTime();n=ge(ge({},Oe),n);var i=t.domainUserId,a=t.userId,u=t.sessionId,c=t.sourceId,s=t.sourcePlatform,l=t.event,f=l.currentTarget;return l="function"==typeof n.reason?n.reason(l):null===(r=null==f?void 0:f.textContent)||void 0===r?void 0:r.trim(),e?[i,o,n.sessionId&&u,n.userId&&N(a||""),n.sourceId&&N(c||""),n.sourcePlatform&&s,n.reason&&N(l||"")].map((function(e){return e||""})).join(".").replace(/([.]*$)/,""):t.domainUserId+"."+o}function N(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function V(e){return!(!e||"string"!=typeof e.valueOf())}function _(e){return Number.isInteger&&Number.isInteger(e)||"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function z(){if("object"==typeof Intl&&"function"==typeof Intl.DateTimeFormat)return(new Intl.DateTimeFormat).resolvedOptions().timeZone}function M(e){if(!V(e)){e=e.text||"";var n=document.getElementsByTagName("title");n&&null!=n[0]&&(e=n[0].text)}return e}function F(e){var n=/^(?:(?:https?|ftp):)\/*(?:[^@]+@)?([^:/#]+)/.exec(e);return n?n[1]:e}function H(e){var n=e.length;return"."===e.charAt(--n)&&(e=e.slice(0,n)),"*."===e.slice(0,2)&&(e=e.slice(1)),e}function q(e){var n=window,t=J("referrer",n.location.href)||J("referer",n.location.href);if(t)return t;if(e)return e;try{if(n.top)return n.top.document.referrer;if(n.parent)return n.parent.document.referrer}catch(e){}return document.referrer}function G(e,n,t,r){return e.addEventListener?(e.addEventListener(n,t,r),!0):e.attachEvent?e.attachEvent("on"+n,t):void(e["on"+n]=t)}function J(e,n){return(e=new RegExp("^[^#]*[?&]"+e+"=([^&#]*)").exec(n))?decodeURIComponent(e[1].replace(/\+/g," ")):null}function W(e,n,t){t=n+"="+t;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,n.length+1)===n+"="){i=!1,a[u]=t,r=a.join("&");break}i&&(r=t+"&"+r)}else r=t;return e[0]=o+"?"+r,e.join("#")}function Z(e,n){for(var t=window.location.hostname,r="_sp_root_domain_test_"+(new Date).getTime(),o="_test_value_"+(new Date).getTime(),i=t.split("."),a=i.length-2;0<=a;a--){var u=i.slice(a).join(".");if(Y(r,o,0,"/",u,e,n),Y(r)===o){for(Q(r,"/",u,e,n),t=X("_sp_root_domain_test_"),r=0;r<t.length;r++)Q(t[r],"/",u,e,n);return u}}return t}function Q(e,n,t,r,o){Y(e,"",-1,n,t,r,o)}function X(e){for(var n=document.cookie.split("; "),t=[],r=0;r<n.length;r++)n[r].substring(0,e.length)===e&&t.push(n[r]);return t}function Y(e,n,t,r,o,i,a){return 1<arguments.length?document.cookie=e+"="+encodeURIComponent(null!=n?n:"")+(t?"; Expires="+new Date(+new Date+1e3*t).toUTCString():"")+(r?"; Path="+r:"")+(o?"; Domain="+o:"")+(i?"; SameSite="+i:"")+(a?"; Secure":""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}function $(e){return e.className.match(/\S+/g)||[]}function K(e,n){return e.hasOwnProperty("filter")&&e.filter?e.filter:n}function ee(e){var n={};if(e=e.allowlist||e.denylist){Array.isArray(e)||(e=[e]);for(var t=0;t<e.length;t++)n[e[t]]=!0}return n}function ne(e,n){var t,r=null!==(t=e.eventStore)&&void 0!==t?t:function(e){function n(){return o?a().then((function(e){window.localStorage.setItem(i,JSON.stringify(e))})):Promise.resolve()}var t=e.maxLocalStorageQueueSize,r=void 0===t?1e3:t,o=void 0===(t=e.useLocalStorage)||t,i="snowplowOutQueue_".concat(e.trackerId),a=(e=function(){if(o){var e=window.localStorage.getItem(i);return e=e?JSON.parse(e):[],A({maxSize:r,events:e})}return A({maxSize:r})}()).getAll,u=e.add,c=e.count,s=e.removeHead;return{count:c,add:function(e){return u(e),n().then(c)},removeHead:function(e){return s(e),n()},iterator:e.iterator,getAll:a,getAllPayloads:e.getAllPayloads,setUseLocalStorage:function(e){o=e}}}(e);return e.eventStore=r,e=O(e),n.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 te(e,n,t){return"translate.googleusercontent.com"===e?(""===t&&(t=n),e=F(n=null!=(e=(e=/^(?:https?|ftp)(?::\/*(?:[^?]+))([?][^#]+)/.exec(n))&&1<(null==e?void 0:e.length)?J("u",e[1]):null)?e:"")):"cc.bingj.com"!==e&&"webcache.googleusercontent.com"!==e||(e=F(n=document.links[0].href)),[e,n,t]}function re(e,n){return void 0===n&&(n={memorizedVisitCount:1}),n=n.memorizedVisitCount,"0"===e[0]?(e[7]=e[6],e[5]=e[4],e[3]++):e[3]=n,n=i(),e[6]=n,e[10]=0,e[8]="",e[9]=void 0,n}function oe(e){e[4]=Math.round((new Date).getTime()/1e3)}function ie(e,n,t){var r=e[9];return{userId:t?"00000000-0000-0000-0000-000000000000":e[1],sessionId:e[6],eventIndex:e[10],sessionIndex:e[3],previousSessionId:t?null:e[7]||null,storageMechanism:"localStorage"==n?"LOCAL_STORAGE":"COOKIE_1",firstEventId:e[8]||null,firstEventTimestamp:r?new Date(r).toISOString():null}}function ae(){return"ResizeObserver"in window?(Ie||(Ie=ue()),function(){if(!Le&&document&&document.body&&document.documentElement){Le=!0;var e=new ResizeObserver((function(e){for(var n=0;n<e.length;n++){var t=e[n];t.target!==document.body&&t.target!==document.documentElement||(Ie=ue())}}));e.observe(document.body),e.observe(document.documentElement)}}(),Ie):ue()}function ue(){var e=ce;if("innerWidth"in window)var n=window.innerWidth,t=window.innerHeight;else n=(t=document.documentElement||document.body).clientWidth,t=t.clientHeight;e=e(n=0<=n&&0<=t?n+De+t:null),n=ce;var r=document.documentElement,o=document.body;return t=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:n(t=isNaN(t)||isNaN(r)?"":t+De+r),resolution:ce(screen.width+De+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 ce(e){return e&&e.split(De).map((function(e){return Math.floor(Number(e))})).join(De)}function se(e,n,t,o,u,c){void 0===c&&(c={});var s=[];e=function(e,n,t,o,u,c){function l(){(nn=te(window.location.hostname,window.location.href,q()))[1]!==rn&&(on=q(rn)),tn=H(nn[0]),rn=nn[1]}function f(e){for(var n=function(e){return function(n){var t=n.currentTarget;n=R(e,Nn,{domainUserId:Ze,userId:Xe||void 0,sessionId:Qe,sourceId:un,sourcePlatform:an,event:n}),null!=t&&t.href&&(t.href=W(t.href,"_sp",n))}}(Rn),t=0;t<document.links.length;t++){var r=document.links[t];!r.spDecorationEnabled&&e(r)&&(r.addEventListener("click",n,!0),r.addEventListener("mousedown",n,!0),r.spDecorationEnabled=!0)}}function d(e){if(_e){var n=/#.*/;e=e.replace(n,"")}return ze&&(n=/[{}]/g,e=e.replace(n,"")),e}function v(e){return(e=/^([a-z]+):/.exec(e))?e[1]:null}function g(e){return e=fn+e+"."+We,"localStorage"==xn?L(e):"cookie"==xn||"cookieAndLocalStorage"==xn?Ue.getCookie(e):void 0}function p(){l(),We=Ee((dn||tn)+(gn||"/")).slice(0,4)}function m(){Fe=(new Date).getTime()}function h(){var e=y(),n=e[0];n<He?He=n:n>qe&&(qe=n),(e=e[1])<Ge?Ge=e:e>Je&&(Je=e),m()}function y(){var e=document.documentElement;return e?[e.scrollLeft||window.pageXOffset,e.scrollTop||window.pageYOffset]:[0,0]}function w(){var e=y(),n=e[0];qe=He=n,Je=Ge=e=e[1]}function b(){return k(fn+"ses."+We,"*",bn)}function S(e){var n=fn+"id."+We,t=Tn;return e=r([],e,!0),t&&(e[1]="",e[7]=""),e.shift(),k(n,t=e.join("."),wn)}function k(e,n,t){return!(Tn&&!Sn)&&("localStorage"==xn?D(e,n,t):("cookie"==xn||"cookieAndLocalStorage"==xn)&&Ue.setCookie(e,n,t,gn,dn,pn,mn))}function T(e){var n=fn+"id."+We,t=fn+"ses."+We;j(n),j(t),Ue.deleteCookie(n,gn,dn,pn,mn),Ue.deleteCookie(t,gn,dn,pn,mn),null!=e&&e.preserveSession||(Qe=i(),An=1),null!=e&&e.preserveUser||(Ze=Tn?"":i(),Xe=null)}function x(e){e&&e.stateStorageStrategy&&(c.stateStorageStrategy=e.stateStorageStrategy,xn=Pe(c)),Tn=!!c.anonymousTracking,Sn=Ie(c),kn=Oe(c),Pn.setUseLocalStorage("localStorage"==xn||"cookieAndLocalStorage"==xn),Pn.setAnonymousTracking(kn)}function A(){if(!Tn||Sn){var e="none"!=xn&&!!g("ses"),n=P();if(n[1])var t=n[1];else t=Tn?"":i(),n[1]=t;Ze=t,Qe=e?n[6]:re(n),An=n[3],"none"!=xn&&(b(),oe(n),S(n))}}function P(){return"none"==xn?["1","",0,0,0,void 0,"","","",void 0,0]:function(e,n,t,r){var o=Math.round((new Date).getTime()/1e3);e?(e=e.split(".")).unshift("0"):e=["1",n,o,r,o,"",t],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,n){return e=parseInt(e),isNaN(e)?n:e};return n=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),n(e[5]),e[6],e[7],e[8],n(e[9]),a(e[10],0)]}(g("id")||void 0,Ze,Qe,An)}function I(e){return 0===e.indexOf("http")?e:("https:"===document.location.protocol?"https":"http")+"://"+e}function E(){In&&null!=u.pageViewId||(u.pageViewId=i(),u.pageViewUrl=Ne||rn)}function O(){return function(){if(null==u.pageViewId)return!0;if(In||!En)return!1;if(void 0===u.pageViewUrl)return!0;var e=Ne||rn;if(!0===En||"full"==En||!("URL"in window))return u.pageViewUrl!=e;e=new URL(e);var n=new URL(u.pageViewUrl);return"pathname"==En?e.pathname!=n.pathname:"pathnameAndSearch"==En&&(e.pathname!=n.pathname||e.search!=n.search)}()&&(u.pageViewId=i(),u.pageViewUrl=Ne||rn),u.pageViewId}function N(){if("none"===xn||Tn||!De)return null;var e=B("_sp_tab_id");return e||(U("_sp_tab_id",i()),e=B("_sp_tab_id")),e||null}function V(e){var n=e.title,t=e.context,r=e.timestamp;if(e=e.contextCallback,l(),On&&On==O()&&E(),On=O(),cn=document.title,n?(Ve=n,sn=!0):sn&&(Ve=null),n=M(Ve||cn),Ke.track(function(e){var n=e.pageUrl,t=e.pageTitle;e=e.referrer;var r=a();return r.add("e","pv"),r.add("url",n),r.add("page",t),r.add("refr",e),r}({pageUrl:d(Ne||rn),pageTitle:n,referrer:d(Re||on)}),(t||[]).concat(e?e():[]),r),r=new Date,n=!1,Ln.enabled&&!Ln.installed){n=Ln.installed=!0;var o={update:function(){if("undefined"!=typeof window&&"function"==typeof window.addEventListener){var e=!1,n=Object.defineProperty({},"passive",{get:function(){e=!0},set:function(){}}),t=function(){};window.addEventListener("testPassiveEventSupport",t,n),window.removeEventListener("testPassiveEventSupport",t,n),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")?G(document,i,m,{passive:!0}):G(document,i,m),w(),i=function(e,n){return void 0===n&&(n=m),function(e){return G(document,e,n)}},"click mouseup mousedown mousemove keypress keydown keyup touchend touchstart".split(" ").forEach(i(document)),["resize","focus","blur"].forEach(i(window)),i(window,h)("scroll")}if(Ln.enabled&&(ln||n))for(r in Fe=r.getTime(),r=void 0,Ln.configurations)(n=Ln.configurations[r])&&(window.clearInterval(n.activityInterval),Q(n,t,e))}function Q(e,n,t){var r=function(e,n){l(),e({context:n,pageViewId:O(),minXOffset:He,minYOffset:Ge,maxXOffset:qe,maxYOffset:Je}),w()},o=function(){Fe+e.configHeartBeatTimer>(new Date).getTime()&&r(e.callback,(n||[]).concat(t?t():[]))};e.activityInterval=0===e.configMinimumVisitLength?window.setInterval(o,e.configHeartBeatTimer):window.setTimeout((function(){Fe+e.configMinimumVisitLength>(new Date).getTime()&&r(e.callback,(n||[]).concat(t?t():[])),e.activityInterval=window.setInterval(o,e.configHeartBeatTimer)}),e.configMinimumVisitLength)}function X(e){var n=e.minimumVisitLength,t=e.heartbeatDelay;if(e=e.callback,_(n)&&_(t))return{configMinimumVisitLength:1e3*n,configHeartBeatTimer:1e3*t,callback:e};Te.error("Activity tracking minimumVisitLength & heartbeatDelay must be integers")}function Y(e){var n=e.context,t=e.minXOffset,r=e.minYOffset,o=e.maxXOffset,i=e.maxYOffset;(e=document.title)!==cn&&(cn=e,Ve=void 0);var u=(e=Ke).track,c=d(Ne||rn),s=M(Ve||cn),l=d(Re||on);t=Math.round(t),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),t&&!isNaN(Number(t))&&f.add("pp_mix",t.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,n)}function $(e){var n=Ln.configurations[e];0===(null==n?void 0:n.configMinimumVisitLength)?window.clearTimeout(null==n?void 0:n.activityInterval):window.clearInterval(null==n?void 0:n.activityInterval),Ln.configurations[e]=void 0}var K,ee,ue,ce,se,le,fe,de,ve,pe,me,he,ye,we,be,Se,ke,xe,Ce,Ae;c.eventMethod=null!==(K=c.eventMethod)&&void 0!==K?K:"post";var Pe=function(e){var n;return null!==(n=e.stateStorageStrategy)&&void 0!==n?n:"cookieAndLocalStorage"},Ie=function(e){var n,t;return"boolean"!=typeof e.anonymousTracking&&(null!==(t=!0===(null===(n=e.anonymousTracking)||void 0===n?void 0:n.withSessionTracking))&&void 0!==t&&t)},Oe=function(e){var n,t;return"boolean"!=typeof e.anonymousTracking&&(null!==(t=!0===(null===(n=e.anonymousTracking)||void 0===n?void 0:n.withServerAnonymisation))&&void 0!==t&&t)},Le=null!==(ue=null===(ee=null==c?void 0:c.contexts)||void 0===ee?void 0:ee.browser)&&void 0!==ue&&ue,De=null===(se=null===(ce=null==c?void 0:c.contexts)||void 0===ce?void 0:ce.webPage)||void 0===se||se,Ue=c.synchronousCookieWrite?Be:je;s.push({beforeTrack:function(e){var n=g("ses"),t=P(),r=0===t[10];if(Ye=!!Me&&!!Ue.getCookie(Me),yn||Ye)T();else{if("0"===t[0]?(Qe=n||"none"==xn?t[6]:re(t),An=t[3]):(new Date).getTime()-Cn>1e3*bn&&(An++,Qe=re(t,{memorizedVisitCount:An})),oe(t),0===t[10]){var o=e.build();t[8]=o.eid,o=o.dtm||o.ttm,t[9]=o?parseInt(o):void 0}t[10]+=1;var i=(o=ae()).documentSize;e.add("vp",o.viewport),e.add("ds",i),e.add("vid",Sn?An:Tn?null:An),e.add("sid",Sn?Qe:Tn?null:Qe),e.add("duid",Tn?null:t[1]),e.add("uid",Tn?null:Xe),l(),e.add("refr",d(Re||on)),e.add("url",d(Ne||rn)),o=ie(t,xn,Tn),!Dn||Tn&&!Sn||e.addContextEntity({schema:"iglu:com.snowplowanalytics.snowplow/client_session/jsonschema/1-0-2",data:o}),"none"!=xn&&(S(t),e=b(),n&&!r||!e||!jn||Bn||(jn(o),Bn=!1)),Cn=(new Date).getTime()}}}),De&&s.push({contexts:function(){return[{schema:"iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",data:{id:O()}}]}}),Le&&s.push({contexts:function(){return[{schema:"iglu:com.snowplowanalytics.snowplow/browser_context/jsonschema/2-0-0",data:ge(ge({},ae()),{tabId:N()})}]}}),s.push.apply(s,null!==(le=c.plugins)&&void 0!==le?le:[]);var Re,Ne,Ve,_e,ze,Me,Fe,He,qe,Ge,Je,We,Ze,Qe,Xe,Ye,$e,Ke=C({base64:null!==(fe=c.encodeBase64)&&void 0!==fe?fe:"post"!==c.eventMethod,corePlugins:s,callback:function(e){yn||Ye||Pn.enqueueRequest(e.build())}}),en=document.characterSet||document.charset,nn=te(window.location.hostname,window.location.href,q()),tn=H(nn[0]),rn=nn[1],on=nn[2],an=null!==(de=c.platform)&&void 0!==de?de:"web",un=null!==(ve=c.appId)&&void 0!==ve?ve:"",cn=document.title,sn=!1,ln=null===(pe=c.resetActivityTrackingOnPageView)||void 0===pe||pe,fn=null!==(me=c.cookieName)&&void 0!==me?me:"_sp_",dn=null!==(he=c.cookieDomain)&&void 0!==he?he:void 0,vn=null!==(ye=c.discoverRootDomain)&&void 0!==ye?ye:void 0===dn,gn="/",pn=null!==(we=c.cookieSameSite)&&void 0!==we?we:"Lax",mn=null===(be=c.cookieSecure)||void 0===be||be,hn=window.navigator.doNotTrack||window.navigator.msDoNotTrack||window.doNotTrack,yn=void 0!==c.respectDoNotTrack&&(c.respectDoNotTrack&&("yes"===hn||"1"===hn)),wn=null!==(Se=c.cookieLifetime)&&void 0!==Se?Se:63072e3,bn=null!==(ke=c.sessionCookieTimeout)&&void 0!==ke?ke:1800,Sn=Ie(c),kn=Oe(c),Tn=!!c.anonymousTracking,xn=Pe(c),Cn=(new Date).getTime(),An=1,Pn=ne(ge({trackerId:e,endpoint:I(o),serverAnonymization:kn,useLocalStorage:"localStorage"==xn||"cookieAndLocalStorage"==xn},c),u),In=!1,En=null!==(xe=c.preservePageViewIdForUrl)&&void 0!==xe&&xe,On=void 0,Ln={enabled:!1,installed:!1,configurations:{}},Dn=null!==(Ae=null===(Ce=c.contexts)||void 0===Ce?void 0:Ce.session)&&void 0!==Ae&&Ae,jn=c.onSessionUpdateCallback,Bn=!1,Un="boolean"==typeof($e=c.useExtendedCrossDomainLinker||!1)?{useExtendedCrossDomainLinker:$e}:{useExtendedCrossDomainLinker:!0,collectCrossDomainAttributes:$e},Rn=Un.useExtendedCrossDomainLinker,Nn=Un.collectCrossDomainAttributes;vn&&!dn&&(dn=Z(pn,mn));var Vn=ae(),_n=Vn.browserLanguage,zn=Vn.resolution,Mn=Vn.colorDepth,Fn=Vn.cookiesEnabled,Hn=z();return Ke.setTrackerVersion(t),Ke.setTrackerNamespace(n),Ke.setAppId(un),Ke.setPlatform(an),Ke.addPayloadPair("cookie",Fn?"1":"0"),Ke.addPayloadPair("cs",en),Ke.addPayloadPair("lang",_n),Ke.addPayloadPair("res",zn),Ke.addPayloadPair("cd",Mn),Hn&&Ke.addPayloadPair("tz",Hn),p(),A(),c.crossDomainLinker&&f(c.crossDomainLinker),ge(ge({},{getDomainSessionIndex:function(){return An},getPageViewId:O,getTabId:N,newSession:function(){var e=P();if("0"===e[0]?(Qe="none"!=xn?re(e):e[6],An=e[3]):(An++,Qe=re(e,{memorizedVisitCount:An})),oe(e),"none"!=xn){var n=ie(e,xn,Tn);S(e),b()&&jn&&(Bn=!0,jn(n))}Cn=(new Date).getTime()},getCookieName:function(e){return fn+e+"."+We},getUserId:function(){return Xe},getDomainUserId:function(){return P()[1]},getDomainUserInfo:function(){return P()},setReferrerUrl:function(e){Re=e},setCustomUrl:function(e){l();var n,t=rn;v(e)?Ne=e:"/"===e.slice(0,1)?Ne=v(t)+"://"+F(t)+e:(0<=(n=(t=d(t)).indexOf("?"))&&(t=t.slice(0,n)),(n=t.lastIndexOf("/"))!==t.length-1&&(t=t.slice(0,n+1)),Ne=t+e)},setDocumentTitle:function(e){cn=document.title,Ve=e,sn=!1},discardHashTag:function(e){_e=e},discardBrace:function(e){ze=e},setCookiePath:function(e){gn=e,p()},setVisitorCookieTimeout:function(e){wn=e},crossDomainLinker:function(e){f(e)},enableActivityTracking:function(e){Ln.configurations.pagePing||(Ln.enabled=!0,Ln.configurations.pagePing=X(ge(ge({},e),{callback:Y})))},enableActivityTrackingCallback:function(e){Ln.configurations.callback||(Ln.enabled=!0,Ln.configurations.callback=X(e))},disableActivityTracking:function(){$("pagePing")},disableActivityTrackingCallback:function(){$("callback")},updatePageActivity:function(){m()},setOptOutCookie:function(e){Me=e},setUserId:function(e){Xe=e},setUserIdFromLocation:function(e){l(),Xe=J(e,rn)},setUserIdFromReferrer:function(e){l(),Xe=J(e,on)},setUserIdFromCookie:function(e){Xe=Ue.getCookie(e)},setCollectorUrl:function(e){Pn.setCollectorUrl(I(e))},setBufferSize:function(e){Pn.setBufferSize(e)},flushBuffer:function(e){void 0===e&&(e={}),Pn.executeQueue(),e.newBufferSize&&Pn.setBufferSize(e.newBufferSize)},trackPageView:function(e){void 0===e&&(e={}),V(e)},preservePageViewId:function(){In=!0},preservePageViewIdForUrl:function(e){En=e},disableAnonymousTracking:function(e){c.anonymousTracking=!1,x(e),A(),Pn.executeQueue()},enableAnonymousTracking:function(e){var n;c.anonymousTracking=null===(n=e&&(null==e?void 0:e.options))||void 0===n||n,x(e),Sn||E()},clearUserData:T}),{id:e,namespace:n,core:Ke,sharedState:u})}(e,n,t,o,u,c);var l=ge(ge({},e),{addPlugin:function(e){var n,t;l.core.addPlugin(e),null===(t=(n=e.plugin).activateBrowserPlugin)||void 0===t||t.call(n,l)}});return s.forEach((function(e){var n;null===(n=e.activateBrowserPlugin)||void 0===n||n.call(e,l)})),l}function le(e){return de(e,Ue)}function fe(){return Object.keys(Ue)}function de(e,n){for(var t=[],r=0;r<e.length;r++){var o=e[r];n.hasOwnProperty(o)?t.push(n[o]):Te.warn(o+" not configured")}return t}function ve(){try{return!!window.localStorage}catch(e){return!0}}var ge=function(){return ge=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},ge.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;for(var pe,me=new Uint8Array(16),he=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,ye=[],we=0;256>we;++we)ye.push((we+256).toString(16).substr(1));var be,Se,ke="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 Te=function(e){return void 0===e&&(e=be.warn),{setLogLevel:function(n){e=be[n]?n:be.warn},warn:function(n,t){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];e>=be.warn&&"undefined"!=typeof console&&(i="Snowplow: "+n,t?console.warn.apply(console,r([i+"\n",t],o,!1)):console.warn.apply(console,r([i],o,!1)))},error:function(n,t){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];e>=be.error&&"undefined"!=typeof console&&(i="Snowplow: "+n+"\n",t?console.error.apply(console,r([i+"\n",t],o,!1)):console.error.apply(console,r([i],o,!1)))},debug:function(n){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];e>=be.debug&&"undefined"!=typeof console&&console.debug.apply(console,r(["Snowplow: "+n],t,!1))},info:function(n){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];e>=be.info&&"undefined"!=typeof console&&console.info.apply(console,r(["Snowplow: "+n],t,!1))}}}(),xe={},Ce={};!function(){var e={rotl:function(e,n){return e<<n|e>>>32-n},rotr:function(e,n){return e<<32-n|e>>>n},endian:function(n){if(n.constructor==Number)return 16711935&e.rotl(n,8)|4278255360&e.rotl(n,24);for(var t=0;t<n.length;t++)n[t]=e.endian(n[t]);return n},randomBytes:function(e){for(var n=[];0<e;e--)n.push(Math.floor(256*Math.random()));return n},bytesToWords:function(e){for(var n=[],t=0,r=0;t<e.length;t++,r+=8)n[r>>>5]|=e[t]<<24-r%32;return n},wordsToBytes:function(e){for(var n=[],t=0;t<32*e.length;t+=8)n.push(e[t>>>5]>>>24-t%32&255);return n},bytesToHex:function(e){for(var n=[],t=0;t<e.length;t++)n.push((e[t]>>>4).toString(16)),n.push((15&e[t]).toString(16));return n.join("")},hexToBytes:function(e){for(var n=[],t=0;t<e.length;t+=2)n.push(parseInt(e.substr(t,2),16));return n},bytesToBase64:function(e){for(var n=[],t=0;t<e.length;t+=3)for(var r=e[t]<<16|e[t+1]<<8|e[t+2],o=0;4>o;o++)8*t+6*o<=8*e.length?n.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>>6*(3-o)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],t=0,r=0;t<e.length;r=++t%4)0!=r&&n.push(("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(t-1))&Math.pow(2,-2*r+8)-1)<<2*r|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(t))>>>6-2*r);return n}};Ce=e}();var Ae={utf8:{stringToBytes:function(e){return Ae.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(Ae.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var n=[],t=0;t<e.length;t++)n.push(255&e.charCodeAt(t));return n},bytesToString:function(e){for(var n=[],t=0;t<e.length;t++)n.push(String.fromCharCode(e[t]));return n.join("")}}},Pe=Ae;!function(){var e=Ce,n=Pe.utf8,t=Pe.bin,r=function(r,o){var i=e.wordsToBytes,a=r;a.constructor==String?a=n.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,m=f,h=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+=m,d+=h}return i=i.call(e,[c,s,l,f,d]),o&&o.asBytes?i:o&&o.asString?t.bytesToString(i):e.bytesToHex(i)};r._blocksize=16,r._digestsize=20,xe=r}();var Ie,Ee=xe,Oe={sessionId:!0,sourceId:!0,sourcePlatform:!1,userId:!1,reason:!1},Le=!1,De="x",je=function(){function e(e){return n[e]||(n[e]=function(e){function n(){void 0!==t&&(clearTimeout(t),t=void 0),i||(i=!0,void 0!==r&&Y(e,r[0],r[1],r[2],r[3],r[4],r[5]))}var t,r,o,i=!0;return{getValue:function(){var n;return r&&(!o||o>new Date)&&null!==(n=r[0])&&void 0!==n?n:Y(e)},setValue:function(e,a,u,c,s,l){return r=[e,a,u,c,s,l],i=!1,void 0===t&&(t=setTimeout((function(){t=void 0,n()}),10)),o=new Date(Date.now()+1e3*Math.min(.05,null!=a?a:.05)),!0},deleteValue:function(n,o,a,u){r=void 0,i=!0,void 0!==t&&(clearTimeout(t),t=void 0),Q(e,n,o,a,u)},flush:n}}(e)),n[e]}var n={};return{getCookie:function(n){return e(n).getValue()},setCookie:function(n,t,r,o,i,a,u){return e(n).setValue(t,r,o,i,a,u)},deleteCookie:function(n,t,r,o,i){e(n).deleteValue(t,r,o,i)},clearCache:function(){n={}},flush:function(){for(var e=0,t=Object.values(n);e<t.length;e++)t[e].flush()}}}(),Be={getCookie:Y,setCookie:function(e,n,t,r,o,i,a){return Y(e,n,t,r,o,i,a),-1!==document.cookie.indexOf("".concat(e,"="))},deleteCookie:Q},Ue={},Re=function(){this.bufferFlushers=[],this.hasLoaded=!1,this.registeredOnLoadHandlers=[]};e.SharedState=Re,e.addEventListener=G,e.addTracker=function(e,n,t,r,o,i){return Ue.hasOwnProperty(e)?null:(Ue[e]=se(e,n,t,r,o,i),Ue[e])},e.allTrackerNames=fe,e.allTrackers=function(){return Ue},e.attemptDeleteLocalStorage=j,e.attemptGetLocalStorage=L,e.attemptGetSessionStorage=B,e.attemptWriteLocalStorage=D,e.attemptWriteSessionStorage=U,e.cookie=Y,e.createCrossDomainParameterValue=R,e.createSharedState=function(){function e(){var e;if(!n.hasLoaded)for(n.hasLoaded=!0,e=0;e<n.registeredOnLoadHandlers.length;e++)n.registeredOnLoadHandlers[e]();return!0}var n=new Re,t=document,r=window;return t.visibilityState&&G(t,"visibilitychange",(function(){"hidden"==t.visibilityState&&n.bufferFlushers.forEach((function(e){e(!1)}))}),!1),G(r,"beforeunload",(function(){n.bufferFlushers.forEach((function(e){e(!1)}))}),!1),"loading"===document.readyState?(t.addEventListener?t.addEventListener("DOMContentLoaded",(function n(){t.removeEventListener("DOMContentLoaded",n,!1),e()})):t.attachEvent&&t.attachEvent("onreadystatechange",(function n(){"complete"===t.readyState&&(t.detachEvent("onreadystatechange",n),e())})),G(r,"load",e,!1)):e(),n},e.decorateQuerystring=W,e.deleteCookie=Q,e.dispatchToTrackers=function(e,n){try{le(null!=e?e:fe()).forEach(n)}catch(e){Te.error("Function failed",e)}},e.dispatchToTrackersInCollection=function(e,n,t){try{de(null!=e?e:Object.keys(n),n).forEach(t)}catch(e){Te.error("Function failed",e)}},e.findRootDomain=Z,e.fixupDomain=H,e.fixupTitle=M,e.fixupUrl=te,e.flushPendingCookies=function(){je.flush()},e.fromQuerystring=J,e.getCookiesWithPrefix=X,e.getCssClasses=$,e.getFilterByClass=function(e){if(null==e||"object"!=typeof e||Array.isArray(e))return function(){return!0};var n=Object.prototype.hasOwnProperty.call(e,"allowlist"),t=ee(e);return K(e,(function(e){e:{var r=0;for(e=$(e);r<e.length;r++)if(t[e[r]]){r=!0;break e}r=!1}return r===n}))},e.getFilterByName=function(e){if(null==e||"object"!=typeof e||Array.isArray(e))return function(){return!0};var n=e.hasOwnProperty("allowlist"),t=ee(e);return K(e,(function(e){return e.name in t===n}))},e.getHostName=F,e.getReferrer=q,e.getTimeZone=z,e.getTracker=function(e){return Ue.hasOwnProperty(e)?Ue[e]:(Te.warn(e+" not configured"),null)},e.getTrackers=le,e.hasLocalStorage=ve,e.hasSessionStorage=function(){try{return!!window.sessionStorage}catch(e){return!0}},e.isFunction=function(e){return!(!e||"function"!=typeof e)},e.isInteger=_,e.isString=V,e.isValueInArray=function(e,n){for(var t=0;t<n.length;t++)if(n[t]===e)return!0;return!1},e.localStorageAccessible=function(){if(!ve())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 Ue.hasOwnProperty(e)},e.urlSafeBase64Encode=N,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
"use strict";!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).snowplowBrowserTrackerCore={})}(this,(function(e){function n(e,n,t,r){return new(t||(t=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 t?e:new t((function(n){n(e)}))}(e.value).then(a,u)}c((r=r.apply(e,n||[])).next())}))}function t(e,n){function t(t){return function(c){return function(t){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,t[0]&&(u=0)),u;)try{if(r=1,o&&(i=2&t[0]?o.return:t[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,t[1])).done)return i;switch(o=0,i&&(t=[2&t[0],i.value]),t[0]){case 0:case 1:i=t;break;case 4:return u.label++,{value:t[1],done:!1};case 5:u.label++,o=t[1],t=[0];continue;case 7:t=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=0<i.length&&i[i.length-1])||6!==t[0]&&2!==t[0])){u=0;continue}if(3===t[0]&&(!i||t[1]>i[0]&&t[1]<i[3]))u.label=t[1];else if(6===t[0]&&u.label<i[1])u.label=i[1],i=t;else{if(!(i&&u.label<i[2])){i[2]&&u.ops.pop(),u.trys.pop();continue}u.label=i[2],u.ops.push(t)}}t=n.call(e,u)}catch(e){t=[6,e],o=0}finally{r=i=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,c])}}var r,o,i,a,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a}function r(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}function o(){if(!pe&&!(pe="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return pe(me)}function i(e,n,t){if((e=(e=e||{}).random||(e.rng||o)())[6]=15&e[6]|64,e[8]=63&e[8]|128,n){t=t||0;for(var r=0;16>r;++r)n[t+r]=e[r];return n}return function(e){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;if("string"!=typeof(n=(ye[e[n+0]]+ye[e[n+1]]+ye[e[n+2]]+ye[e[n+3]]+"-"+ye[e[n+4]]+ye[e[n+5]]+"-"+ye[e[n+6]]+ye[e[n+7]]+"-"+ye[e[n+8]]+ye[e[n+9]]+"-"+ye[e[n+10]]+ye[e[n+11]]+ye[e[n+12]]+ye[e[n+13]]+ye[e[n+14]]+ye[e[n+15]]).toLowerCase())||!he.test(n))throw TypeError("Stringified UUID is invalid");return n}(e)}function a(){var e,n={},t=[],r=[],o=[],i=function(e,t){null!=t&&""!==t&&(n[e]=t)};return{add:i,addDict:function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&i(n,e[n])},addJson:function(e,n,o){o&&c(o)&&(e={keyIfEncoded:e,keyIfNotEncoded:n,json:o},r.push(e),t.push(e))},addContextEntity:function(e){o.push(e)},getPayload:function(){return n},getJson:function(){return t},withJsonProcessor:function(n){e=n},build:function(){return null==e||e(this,r,o),n}}}function u(e){return function(n,t,o){for(var i=function(t,r,o){if(t=JSON.stringify(t),e){if(o=n.add,t){var i=0,a=0,u=[];if(t){t=unescape(encodeURIComponent(t));do{var c=t.charCodeAt(i++),s=t.charCodeAt(i++),l=t.charCodeAt(i++),f=c<<16|s<<8|l;c=f>>18&63,s=f>>12&63,l=f>>6&63,f&=63,u[a++]=ke.charAt(c)+ke.charAt(s)+ke.charAt(l)+ke.charAt(f)}while(i<t.length);i=u.join(""),t=((t=t.length%3)?i.slice(0,t-3):i)+"===".slice(t||3)}t=t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o.call(n,r,t)}else n.add(o,t)},a=function(t,r){if(!t){var o=n.getPayload();if(e?o.cx:o.co){var i=(t=JSON).parse;if(e){if(o=o.cx){switch(4-o.length%4){case 2:o+="==";break;case 3:o+="="}o=function(e){var n,t=0,r=0,o="",i=[];if(!e)return e;e+="";do{var a=ke.indexOf(e.charAt(t++)),u=ke.indexOf(e.charAt(t++));o=ke.indexOf(e.charAt(t++));var c=ke.indexOf(e.charAt(t++)),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(t<e.length);return o=i.join(""),n=o.replace(/\0+$/,""),decodeURIComponent(n.split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))}(o=o.replace(/-/g,"+").replace(/_/g,"/"))}}else o=o.co;t=i.call(t,o)}else t=void 0}return t?t.data=t.data.concat(r.data):t=r,t},u=void 0,c=0;c<t.length;c++){var s=t[c];"cx"===s.keyIfEncoded?u=a(u,s.json):i(s.json,s.keyIfEncoded,s.keyIfNotEncoded)}t.length=0,o.length&&(u=a(u,t={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 n in e)if(Object.prototype.hasOwnProperty.call(e,n))return!0;return!1}function s(e){return null!=e&&(e.constructor==={}.constructor||e.constructor===[].constructor)}function l(){var e=[],n=[],t={},r={};return{getGlobalPrimitives:function(){return e.concat(Object.values(t))},getConditionalProviders:function(){return n.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):h(c)&&a.push(c)}e=e.concat(a),n=n.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:h(c)&&(t[a]=c)},clearGlobalContexts:function(){n=[],e=[],r={},t={}},removeGlobalContexts:function(o){for(var i=function(o){"string"==typeof o?(delete r[o],delete t[o]):b(o)?n=n.filter((function(e){return JSON.stringify(e)!==JSON.stringify(o)})):h(o)&&(e=e.filter((function(e){return JSON.stringify(e)!==JSON.stringify(o)})))},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(t)),o,u,i);return a.push.apply(a,c),o=function(e,n,t,r){var o;return e=T(e).map((function(e){e:{if(y(e)){var o=e[0],i=!1;try{i=o({event:n.getPayload(),eventType:t,eventSchema:r})}catch(e){i=!1}if(!0===i){e=x(e[1],n,t,r);break e}}else if(w(e)&&function(e,n){var t=0,r=0,o=e.accept;return Array.isArray(o)?e.accept.some((function(e){return S(e,n)}))&&r++:"string"==typeof o&&S(o,n)&&r++,o=e.reject,Array.isArray(o)?e.reject.some((function(e){return S(e,n)}))&&t++:"string"==typeof o&&S(o,n)&&t++,0<r&&0===t}(e[0],r)){e=x(e[1],n,t,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)})))}(n.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 n=!1,t=0;for(e=e.slice(2);t<e.length;t++)if("*"===e[t])n=!0;else if(n)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 n=e[0];return 5===e.length&&f(n)}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 m(e){return"function"==typeof e&&1>=e.length}function h(e){return m(e)||p(e)}function y(e){return!(!Array.isArray(e)||2!==e.length)&&(Array.isArray(e[1])?m(e[0])&&e[1].every(h):m(e[0])&&h(e[1]))}function w(e){return!(!Array.isArray(e)||2!==e.length)&&(!!function(e){var n=0;if(null!=e&&"object"==typeof e&&!Array.isArray(e)){if(Object.prototype.hasOwnProperty.call(e,"accept")){if(!g(e.accept))return!1;n+=1}if(Object.prototype.hasOwnProperty.call(e,"reject")){if(!g(e.reject))return!1;n+=1}return 0<n&&2>=n}return!1}(e[0])&&(Array.isArray(e[1])?e[1].every(h):h(e[1])))}function b(e){return y(e)||w(e)}function S(e,n){if(!v(e))return!1;if(e=d(e),n=null!==(n=/^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(n))?n.slice(1,6):void 0,e&&n){if(!function(e,n){if(n=n.split("."),e=e.split("."),n&&e){if(n.length!==e.length)return!1;for(var t=0;t<e.length;t++)if(!k(n[t],e[t]))return!1;return!0}return!1}(e[0],n[0]))return!1;for(var t=1;5>t;t++)if(!k(e[t],n[t]))return!1;return!0}return!1}function k(e,n){return e&&n&&"*"===e||e===n}function T(e){return Array.isArray(e)?e:[e]}function x(e,n,t,r){var o;return e=T(e).map((function(e){e:if(p(e))e=[e];else{if(m(e)){n:{var o=void 0;try{if(o=e({event:n.getPayload(),eventType:t,eventSchema:r}),Array.isArray(o)&&o.every(p)||p(o)){var i=o;break n}i=void 0;break n}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 C(e){void 0===e&&(e={});var n,t,o,a,c,f,d,v=e.base64,g=e.corePlugins,p=null!=g?g:[];n=null==v||v,t=p,o=e.callback,a=function(e){return{addPluginContexts:function(n){var t=n?r([],n,!0):[];return e.forEach((function(e){try{e.contexts&&t.push.apply(t,e.contexts())}catch(e){Te.error("Error adding plugin contexts",e)}})),t}}}(t),c=l(),f=n,d={};var m=ge(ge({},e={track:function(e,n,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()),n=function(e,n){e=c.getApplicableContexts(e);var t=[];return n&&n.length&&t.push.apply(t,n),e&&e.length&&t.push.apply(t,e),t}(e,a.addPluginContexts(n)),void 0!==(n=n&&n.length?{schema:"iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",data:n}:void 0)&&e.addJson("cx","co",n),t.forEach((function(n){try{n.beforeTrack&&n.beforeTrack(e)}catch(e){Te.error("Plugin beforeTrack",e)}})),!t.find((function(n){try{return n.filter&&!1===n.filter(e.build())}catch(e){return Te.error("Plugin filter",e),!1}}))){"function"==typeof o&&o(e);var s=e.build();return t.forEach((function(e){try{e.afterTrack&&e.afterTrack(s)}catch(e){Te.error("Plugin afterTrack",e)}})),s}},addPayloadPair:function(e,n){d[e]=n},getBase64Encoding:function(){return f},setBase64Encoding:function(e){f=e},addPayloadDict:function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(d[n]=e[n])},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,n){d.res=e+"x"+n},setViewport:function(e,n){d.vp=e+"x"+n},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 n,t;e=e.plugin,p.push(e),null===(n=e.logger)||void 0===n||n.call(e,Te),null===(t=e.activateCorePlugin)||void 0===t||t.call(e,m)}});return null==p||p.forEach((function(e){var n,t;null===(n=e.logger)||void 0===n||n.call(e,Te),null===(t=e.activateCorePlugin)||void 0===t||t.call(e,m)})),m}function A(e){var n=e.maxSize,t=void 0===n?1e3:n,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>t;)o.shift();return i()},removeHead:function(e){for(var n=0;n<e;n++)o.shift();return Promise.resolve()},iterator:function(){var e=0,n=r([],o,!0);return{next:function(){return e<n.length?Promise.resolve({value:n[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 P(e){function n(){var e=S.reduce((function(e,n){return e+(k?n.getPOSTRequestBytesCount():n.getGETRequestBytesCount())}),0);return k&&(e+=88),e}function t(){var e=new Headers;return k&&e.append("Content-Type","application/json; charset=UTF-8"),v&&Object.keys(v).forEach((function(n){e.append(n,v[n])})),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?h:"/i")}function o(e,n){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),n=ge({headers:t(),signal:d.signal,keepalive:m,credentials:b},n),new Request(e,n)}function i(){var e=function(e){for(var n=(new Date).getTime().toString(),t=0;t<e.length;t++)e[t].stm=n;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,n){if(void 0!==f&&(clearTimeout(f),f=void 0),void 0!==d){var t=d;d=void 0,e||t.abort(n)}}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,m=void 0===p||p,h=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:n,countEvents:function(){return S.length},isFull:function(){return k?n()>=w:1<=S.length},closeRequest:a}}function I(e){for(var n=0,t=0;t<e.length;t++){var r=e.charCodeAt(t);127>=r?n+=1:2047>=r?n+=2:55296<=r&&57343>=r?(n+=4,t++):n=65535>r?n+3:n+4}return n}function E(e){function n(){return e.payload}function t(e){if(null===o){var n,t={co:!0,cx:!0},r=[];for(n in e)e.hasOwnProperty(n)&&!t[n]&&r.push(n+"="+encodeURIComponent(e[n]));for(var i in t)e.hasOwnProperty(i)&&t[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(n){return[n,e[n]]})).reduce((function(e,n){return e[n[0]]=n[1].toString(),e}),{})}(n())),i}var o=null,i=null,a=null,u=null;return{getPayload:n,getServerAnonymization:function(){var n;return null!==(n=e.svrAnon)&&void 0!==n&&n},getGETRequestURL:function(e,r){var o=t(n());return r?e+o.replace("?","?stm="+(new Date).getTime()+"&"):e+o},getGETRequestBytesCount:function(){if(null===a){var e=t(n());a=I(e)}return a},getPOSTRequestBody:r,getPOSTRequestBytesCount:function(){return null===u&&(u=I(JSON.stringify(r()))),u}}}function O(e){function r(e,n){void 0!==C&&setTimeout((function(){try{null==C||C(e,n)}catch(e){Te.error("Error in onRequestFailure",e)}}),0)}function o(e){return n(this,void 0,void 0,(function(){var n,o,i,a,u,c;return t(this,(function(t){switch(t.label){case 0:if(void 0===(n=e.toRequest()))throw Error("Empty batch");o=e.getEvents().map((function(e){return e.getPayload()})),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,O(n)];case 2:return i=t.sent(),e.closeRequest(!0),i.ok?(function(e,n){void 0!==I&&setTimeout((function(){try{null==I||I(e,n)}catch(e){Te.error("Error in onRequestSuccess",e)}}),0)}(o,i),[2,{success:!0,retry:!1,status:i.status}]):(a=function(e){return!(200<=e&&300>e||!x||!T.includes(e)&&k.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 3:return u=t.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 4:return[2]}}))}))}function i(){return P({endpoint:s,protocol:d,port:v,eventMethod:f,customHeaders:h,connectionTimeout:w,keepalive:b,maxPostBytes:g,useStm:L,credentials:j})}function a(){return n(this,void 0,void 0,(function(){var e;return t(this,(function(n){switch(n.label){case 0:return!S||R?[3,2]:(R=!0,e=new Request(S,{method:"GET"}),[4,O(e)]);case 1:n.sent(),n.label=2;case 2:return[2]}}))}))}function u(){return n(this,void 0,void 0,(function(){var e;return t(this,(function(n){switch(n.label){case 0:if(B)return[3,5];B=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,c()];case 2:return n.sent(),[3,5];case 3:return e=n.sent(),Te.error("Error sending events",e),[3,5];case 4:return B=!1,[7];case 5:return[2]}}))}))}function c(){return n(this,void 0,void 0,(function(){var e,n,r,u,s,l,f,d,v;return t(this,(function(t){switch(t.label){case 0:return[4,a()];case 1:t.sent(),e=i(),n=D.iterator(),t.label=2;case 2:return e.isFull()?[3,4]:[4,n.next()];case 3:return r=t.sent(),u=r.value,r.done||void 0===u?[3,4]:(s=E(u),e.addEvent(s)?[3,2]:[3,4]);case 4:return 0===e.countEvents()?[2]:[4,o(e)];case 5:return l=t.sent(),f=l.success,d=l.retry,v=l.status,!f&&d?[3,7]:(f||Te.error("Status ".concat(v,", will not retry.")),[4,D.removeHead(e.countEvents())]);case 6:t.sent(),t.label=7;case 7:return f?[4,c()]:[3,9];case 8:t.sent(),t.label=9;case 9:return[2]}}))}))}var s=e.endpoint,l=e.eventMethod,f=void 0===l?"post":l,d=e.protocol,v=e.port,g=void 0===(l=e.maxPostBytes)?4e4:l,p=e.maxGetBytes,m=void 0===(l=e.bufferSize)?1:l,h=e.customHeaders,y=e.serverAnonymization,w=e.connectionTimeout,b=e.keepalive,S=e.idService,k=void 0===(l=e.dontRetryStatusCodes)?[]:l,T=void 0===(l=e.retryStatusCodes)?[]:l,x=void 0===(l=e.retryFailedRequests)||l,C=e.onRequestFailure,I=e.onRequestSuccess,O=void 0===(l=e.customFetch)?fetch:l,L=e.useStm,D=void 0===(l=e.eventStore)?A({}):l,j=e.credentials,R=!1,B=!1,U="post"===f.toLowerCase();return k=k.concat([400,401,403,410,422]),{flush:u,input:function(e){return n(this,void 0,void 0,(function(){var n,r,a;return t(this,(function(t){switch(t.label){case 0:e:{if(t=r=E(n={payload:e,svrAnon:void 0!==(t=y)&&t}),U){var c=(t=t.getPOSTRequestBytesCount()+88)>g;c&&Te.warn("Event ("+t+"B) too big, max is "+g)}else{if(void 0===p){t=!1;break e}(c=(t=t.getGETRequestBytesCount())>p)&&Te.warn("Event ("+t+"B) too big, max is "+p)}t=c}return t?((a=i()).addEvent(r),[4,o(a)]):[3,2];case 1:return t.sent(),[3,5];case 2:return[4,D.add(n)];case 3:return t.sent()>=m?[4,u()]:[3,5];case 4:t.sent(),t.label=5;case 5:return[2]}}))}))},setCollectorUrl:function(e){s=e},setAnonymousTracking:function(e){y=e},setBufferSize:function(e){m=e}}}function L(e){try{var n=window.localStorage,t=n.getItem(e+".expires");if(null===t||+t>Date.now())return n.getItem(e);n.removeItem(e),n.removeItem(e+".expires")}catch(e){}}function D(e,n,t){void 0===t&&(t=63072e3);try{var r=window.localStorage,o=Date.now()+1e3*t;return r.setItem("".concat(e,".expires"),o.toString()),r.setItem(e,n),!0}catch(e){return!1}}function j(e){try{var n=window.localStorage;return n.removeItem(e),n.removeItem(e+".expires"),!0}catch(e){return!1}}function R(e){try{return window.sessionStorage.getItem(e)}catch(e){}}function B(e,n){try{return window.sessionStorage.setItem(e,n),!0}catch(e){return!1}}function U(e,n,t){var r,o=(new Date).getTime();n=ge(ge({},Oe),n);var i=t.domainUserId,a=t.userId,u=t.sessionId,c=t.sourceId,s=t.sourcePlatform,l=t.event,f=l.currentTarget;return l="function"==typeof n.reason?n.reason(l):null===(r=null==f?void 0:f.textContent)||void 0===r?void 0:r.trim(),e?[i,o,n.sessionId&&u,n.userId&&N(a||""),n.sourceId&&N(c||""),n.sourcePlatform&&s,n.reason&&N(l||"")].map((function(e){return e||""})).join(".").replace(/([.]*$)/,""):t.domainUserId+"."+o}function N(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function V(e){return!(!e||"string"!=typeof e.valueOf())}function _(e){return Number.isInteger&&Number.isInteger(e)||"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function z(){if("object"==typeof Intl&&"function"==typeof Intl.DateTimeFormat)return(new Intl.DateTimeFormat).resolvedOptions().timeZone}function M(e){if(!V(e)){e=e.text||"";var n=document.getElementsByTagName("title");n&&null!=n[0]&&(e=n[0].text)}return e}function q(e){var n=/^(?:(?:https?|ftp):)\/*(?:[^@]+@)?([^:/#]+)/.exec(e);return n?n[1]:e}function F(e){var n=e.length;return"."===e.charAt(--n)&&(e=e.slice(0,n)),"*."===e.slice(0,2)&&(e=e.slice(1)),e}function H(e){var n=window,t=J("referrer",n.location.href)||J("referer",n.location.href);if(t)return t;if(e)return e;try{if(n.top)return n.top.document.referrer;if(n.parent)return n.parent.document.referrer}catch(e){}return document.referrer}function G(e,n,t,r){return e.addEventListener?(e.addEventListener(n,t,r),!0):e.attachEvent?e.attachEvent("on"+n,t):void(e["on"+n]=t)}function J(e,n){return(e=new RegExp("^[^#]*[?&]"+e+"=([^&#]*)").exec(n))?decodeURIComponent(e[1].replace(/\+/g," ")):null}function W(e,n,t){t=n+"="+t;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,n.length+1)===n+"="){i=!1,a[u]=t,r=a.join("&");break}i&&(r=t+"&"+r)}else r=t;return e[0]=o+"?"+r,e.join("#")}function Z(e,n){for(var t=window.location.hostname,r="_sp_root_domain_test_"+(new Date).getTime(),o="_test_value_"+(new Date).getTime(),i=t.split("."),a=i.length-2;0<=a;a--){var u=i.slice(a).join(".");if(Y(r,o,0,"/",u,e,n),Y(r)===o){for(Q(r,"/",u,e,n),t=X("_sp_root_domain_test_"),r=0;r<t.length;r++)Q(t[r],"/",u,e,n);return u}}return t}function Q(e,n,t,r,o){Y(e,"",-1,n,t,r,o)}function X(e){for(var n=document.cookie.split("; "),t=[],r=0;r<n.length;r++)n[r].substring(0,e.length)===e&&t.push(n[r]);return t}function Y(e,n,t,r,o,i,a){return 1<arguments.length?document.cookie=e+"="+encodeURIComponent(null!=n?n:"")+(t?"; Expires="+new Date(+new Date+1e3*t).toUTCString():"")+(r?"; Path="+r:"")+(o?"; Domain="+o:"")+(i?"; SameSite="+i:"")+(a?"; Secure":""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}function $(e){return e.className.match(/\S+/g)||[]}function K(e,n){return e.hasOwnProperty("filter")&&e.filter?e.filter:n}function ee(e){var n={};if(e=e.allowlist||e.denylist){Array.isArray(e)||(e=[e]);for(var t=0;t<e.length;t++)n[e[t]]=!0}return n}function ne(e,n){var t,r=null!==(t=e.eventStore)&&void 0!==t?t:function(e){function n(){return o?a().then((function(e){window.localStorage.setItem(i,JSON.stringify(e))})):Promise.resolve()}var t=e.maxLocalStorageQueueSize,r=void 0===t?1e3:t,o=void 0===(t=e.useLocalStorage)||t,i="snowplowOutQueue_".concat(e.trackerId),a=(e=function(){if(o){var e=window.localStorage.getItem(i);return e=e?JSON.parse(e):[],A({maxSize:r,events:e})}return A({maxSize:r})}()).getAll,u=e.add,c=e.count,s=e.removeHead;return{count:c,add:function(e){return u(e),n().then(c)},removeHead:function(e){return s(e),n()},iterator:e.iterator,getAll:a,getAllPayloads:e.getAllPayloads,setUseLocalStorage:function(e){o=e}}}(e);return e.eventStore=r,e=O(e),n.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 te(e,n,t){return"translate.googleusercontent.com"===e?(""===t&&(t=n),e=q(n=null!=(e=(e=/^(?:https?|ftp)(?::\/*(?:[^?]+))([?][^#]+)/.exec(n))&&1<(null==e?void 0:e.length)?J("u",e[1]):null)?e:"")):"cc.bingj.com"!==e&&"webcache.googleusercontent.com"!==e||(e=q(n=document.links[0].href)),[e,n,t]}function re(e,n){return void 0===n&&(n={memorizedVisitCount:1}),n=n.memorizedVisitCount,"0"===e[0]?(e[7]=e[6],e[5]=e[4],e[3]++):e[3]=n,n=i(),e[6]=n,e[10]=0,e[8]="",e[9]=void 0,n}function oe(e){e[4]=Math.round((new Date).getTime()/1e3)}function ie(e,n,t){var r=e[9];return{userId:t?"00000000-0000-0000-0000-000000000000":e[1],sessionId:e[6],eventIndex:e[10],sessionIndex:e[3],previousSessionId:t?null:e[7]||null,storageMechanism:"localStorage"==n?"LOCAL_STORAGE":"COOKIE_1",firstEventId:e[8]||null,firstEventTimestamp:r?new Date(r).toISOString():null}}function ae(){return"ResizeObserver"in window?(Ie||(Ie=ue()),function(){if(!Le&&document&&document.body&&document.documentElement){Le=!0;var e=new ResizeObserver((function(e){for(var n=0;n<e.length;n++){var t=e[n];t.target!==document.body&&t.target!==document.documentElement||(Ie=ue())}}));e.observe(document.body),e.observe(document.documentElement)}}(),Ie):ue()}function ue(){var e=ce;if("innerWidth"in window)var n=window.innerWidth,t=window.innerHeight;else n=(t=document.documentElement||document.body).clientWidth,t=t.clientHeight;e=e(n=0<=n&&0<=t?n+De+t:null),n=ce;var r=document.documentElement,o=document.body;return t=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:n(t=isNaN(t)||isNaN(r)?"":t+De+r),resolution:ce(screen.width+De+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 ce(e){return e&&e.split(De).map((function(e){return Math.floor(Number(e))})).join(De)}function se(e,n,t,o,u,c){void 0===c&&(c={});var s=[];e=function(e,n,t,o,u,c){function l(){(nn=te(window.location.hostname,window.location.href,H()))[1]!==rn&&(on=H(rn)),tn=F(nn[0]),rn=nn[1]}function f(e){for(var n=function(e){return function(n){var t=n.currentTarget;n=U(e,Nn,{domainUserId:Ze,userId:Xe||void 0,sessionId:Qe,sourceId:un,sourcePlatform:an,event:n}),null!=t&&t.href&&(t.href=W(t.href,"_sp",n))}}(Un),t=0;t<document.links.length;t++){var r=document.links[t];!r.spDecorationEnabled&&e(r)&&(r.addEventListener("click",n,!0),r.addEventListener("mousedown",n,!0),r.spDecorationEnabled=!0)}}function d(e){if(_e){var n=/#.*/;e=e.replace(n,"")}return ze&&(n=/[{}]/g,e=e.replace(n,"")),e}function v(e){return(e=/^([a-z]+):/.exec(e))?e[1]:null}function g(e){return e=fn+e+"."+We,"localStorage"==xn?L(e):"cookie"==xn||"cookieAndLocalStorage"==xn?Be.getCookie(e):void 0}function p(){l(),We=Ee((dn||tn)+(gn||"/")).slice(0,4)}function m(){qe=(new Date).getTime()}function h(){var e=y(),n=e[0];n<Fe?Fe=n:n>He&&(He=n),(e=e[1])<Ge?Ge=e:e>Je&&(Je=e),m()}function y(){var e=document.documentElement;return e?[e.scrollLeft||window.pageXOffset,e.scrollTop||window.pageYOffset]:[0,0]}function w(){var e=y(),n=e[0];He=Fe=n,Je=Ge=e=e[1]}function b(){return k(fn+"ses."+We,"*",bn)}function S(e){var n=fn+"id."+We,t=Tn;return e=r([],e,!0),t&&(e[1]="",e[7]=""),e.shift(),k(n,t=e.join("."),wn)}function k(e,n,t){return!(Tn&&!Sn)&&("localStorage"==xn?D(e,n,t):("cookie"==xn||"cookieAndLocalStorage"==xn)&&Be.setCookie(e,n,t,gn,dn,pn,mn))}function T(e){var n=fn+"id."+We,t=fn+"ses."+We;j(n),j(t),Be.deleteCookie(n,gn,dn,pn,mn),Be.deleteCookie(t,gn,dn,pn,mn),null!=e&&e.preserveSession||(Qe=i(),An=1),null!=e&&e.preserveUser||(Ze=Tn?"":i(),Xe=null)}function x(e){e&&e.stateStorageStrategy&&(c.stateStorageStrategy=e.stateStorageStrategy,xn=Pe(c)),Tn=!!c.anonymousTracking,Sn=Ie(c),kn=Oe(c),Pn.setUseLocalStorage("localStorage"==xn||"cookieAndLocalStorage"==xn),Pn.setAnonymousTracking(kn)}function A(){if(!Tn||Sn){var e="none"!=xn&&!!g("ses"),n=P();if(n[1])var t=n[1];else t=Tn?"":i(),n[1]=t;Ze=t,Qe=e?n[6]:re(n),An=n[3],"none"!=xn&&(b(),oe(n),S(n))}}function P(){return"none"==xn?["1","",0,0,0,void 0,"","","",void 0,0]:function(e,n,t,r){var o=Math.round((new Date).getTime()/1e3);e?(e=e.split(".")).unshift("0"):e=["1",n,o,r,o,"",t],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,n){return e=parseInt(e),isNaN(e)?n:e};return n=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),n(e[5]),e[6],e[7],e[8],n(e[9]),a(e[10],0)]}(g("id")||void 0,Ze,Qe,An)}function I(e){return 0===e.indexOf("http")?e:("https:"===document.location.protocol?"https":"http")+"://"+e}function E(){In&&null!=u.pageViewId||(u.pageViewId=i(),u.pageViewUrl=Ne||rn)}function O(){return function(){if(null==u.pageViewId)return!0;if(In||!En)return!1;if(void 0===u.pageViewUrl)return!0;var e=Ne||rn;if(!0===En||"full"==En||!("URL"in window))return u.pageViewUrl!=e;e=new URL(e);var n=new URL(u.pageViewUrl);return"pathname"==En?e.pathname!=n.pathname:"pathnameAndSearch"==En&&(e.pathname!=n.pathname||e.search!=n.search)}()&&(u.pageViewId=i(),u.pageViewUrl=Ne||rn),u.pageViewId}function N(){if("none"===xn||Tn||!De)return null;var e=R("_sp_tab_id");return e||(B("_sp_tab_id",i()),e=R("_sp_tab_id")),e||null}function V(e){var n=e.title,t=e.context,r=e.timestamp;if(e=e.contextCallback,l(),On&&On==O()&&E(),On=O(),cn=document.title,n?(Ve=n,sn=!0):sn&&(Ve=null),n=M(Ve||cn),Ke.track(function(e){var n=e.pageUrl,t=e.pageTitle;e=e.referrer;var r=a();return r.add("e","pv"),r.add("url",n),r.add("page",t),r.add("refr",e),r}({pageUrl:d(Ne||rn),pageTitle:n,referrer:d(Ue||on)}),(t||[]).concat(e?e():[]),r),r=new Date,n=!1,Ln.enabled&&!Ln.installed){n=Ln.installed=!0;var o={update:function(){if("undefined"!=typeof window&&"function"==typeof window.addEventListener){var e=!1,n=Object.defineProperty({},"passive",{get:function(){e=!0},set:function(){}}),t=function(){};window.addEventListener("testPassiveEventSupport",t,n),window.removeEventListener("testPassiveEventSupport",t,n),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")?G(document,i,m,{passive:!0}):G(document,i,m),w(),i=function(e,n){return void 0===n&&(n=m),function(e){return G(document,e,n)}},"click mouseup mousedown mousemove keypress keydown keyup touchend touchstart".split(" ").forEach(i(document)),["resize","focus","blur"].forEach(i(window)),i(window,h)("scroll")}if(Ln.enabled&&(ln||n))for(r in qe=r.getTime(),r=void 0,Ln.configurations)(n=Ln.configurations[r])&&(window.clearInterval(n.activityInterval),Q(n,t,e))}function Q(e,n,t){var r=function(e,n){l(),e({context:n,pageViewId:O(),minXOffset:Fe,minYOffset:Ge,maxXOffset:He,maxYOffset:Je}),w()},o=function(){qe+e.configHeartBeatTimer>(new Date).getTime()&&r(e.callback,(n||[]).concat(t?t():[]))};e.activityInterval=0===e.configMinimumVisitLength?window.setInterval(o,e.configHeartBeatTimer):window.setTimeout((function(){qe+e.configMinimumVisitLength>(new Date).getTime()&&r(e.callback,(n||[]).concat(t?t():[])),e.activityInterval=window.setInterval(o,e.configHeartBeatTimer)}),e.configMinimumVisitLength)}function X(e){var n=e.minimumVisitLength,t=e.heartbeatDelay;if(e=e.callback,_(n)&&_(t))return{configMinimumVisitLength:1e3*n,configHeartBeatTimer:1e3*t,callback:e};Te.error("Activity tracking minimumVisitLength & heartbeatDelay must be integers")}function Y(e){var n=e.context,t=e.minXOffset,r=e.minYOffset,o=e.maxXOffset,i=e.maxYOffset;(e=document.title)!==cn&&(cn=e,Ve=void 0);var u=(e=Ke).track,c=d(Ne||rn),s=M(Ve||cn),l=d(Ue||on);t=Math.round(t),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),t&&!isNaN(Number(t))&&f.add("pp_mix",t.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,n)}function $(e){var n=Ln.configurations[e];0===(null==n?void 0:n.configMinimumVisitLength)?window.clearTimeout(null==n?void 0:n.activityInterval):window.clearInterval(null==n?void 0:n.activityInterval),Ln.configurations[e]=void 0}var K,ee,ue,ce,se,le,fe,de,ve,pe,me,he,ye,we,be,Se,ke,xe,Ce,Ae;c.eventMethod=null!==(K=c.eventMethod)&&void 0!==K?K:"post";var Pe=function(e){var n;return null!==(n=e.stateStorageStrategy)&&void 0!==n?n:"cookieAndLocalStorage"},Ie=function(e){var n,t;return"boolean"!=typeof e.anonymousTracking&&(null!==(t=!0===(null===(n=e.anonymousTracking)||void 0===n?void 0:n.withSessionTracking))&&void 0!==t&&t)},Oe=function(e){var n,t;return"boolean"!=typeof e.anonymousTracking&&(null!==(t=!0===(null===(n=e.anonymousTracking)||void 0===n?void 0:n.withServerAnonymisation))&&void 0!==t&&t)},Le=null!==(ue=null===(ee=null==c?void 0:c.contexts)||void 0===ee?void 0:ee.browser)&&void 0!==ue&&ue,De=null===(se=null===(ce=null==c?void 0:c.contexts)||void 0===ce?void 0:ce.webPage)||void 0===se||se,Be=c.synchronousCookieWrite?Re:je;s.push({beforeTrack:function(e){var n=g("ses"),t=P(),r=0===t[10];if(Ye=!!Me&&!!Be.getCookie(Me),yn||Ye)T();else{if("0"===t[0]?(Qe=n||"none"==xn?t[6]:re(t),An=t[3]):(new Date).getTime()-Cn>1e3*bn&&(An++,Qe=re(t,{memorizedVisitCount:An})),oe(t),0===t[10]){var o=e.build();t[8]=o.eid,o=o.dtm||o.ttm,t[9]=o?parseInt(o):void 0}t[10]+=1;var i=(o=ae()).documentSize;e.add("vp",o.viewport),e.add("ds",i),e.add("vid",Sn?An:Tn?null:An),e.add("sid",Sn?Qe:Tn?null:Qe),e.add("duid",Tn?null:t[1]),e.add("uid",Tn?null:Xe),l(),e.add("refr",d(Ue||on)),e.add("url",d(Ne||rn)),o=ie(t,xn,Tn),!Dn||Tn&&!Sn||e.addContextEntity({schema:"iglu:com.snowplowanalytics.snowplow/client_session/jsonschema/1-0-2",data:o}),"none"!=xn&&(S(t),e=b(),n&&!r||!e||!jn||Rn||(jn(o),Rn=!1)),Cn=(new Date).getTime()}}}),De&&s.push({contexts:function(){return[{schema:"iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",data:{id:O()}}]}}),Le&&s.push({contexts:function(){return[{schema:"iglu:com.snowplowanalytics.snowplow/browser_context/jsonschema/2-0-0",data:ge(ge({},ae()),{tabId:N()})}]}}),s.push.apply(s,null!==(le=c.plugins)&&void 0!==le?le:[]);var Ue,Ne,Ve,_e,ze,Me,qe,Fe,He,Ge,Je,We,Ze,Qe,Xe,Ye,$e,Ke=C({base64:null!==(fe=c.encodeBase64)&&void 0!==fe?fe:"post"!==c.eventMethod,corePlugins:s,callback:function(e){yn||Ye||Pn.enqueueRequest(e.build())}}),en=document.characterSet||document.charset,nn=te(window.location.hostname,window.location.href,H()),tn=F(nn[0]),rn=nn[1],on=nn[2],an=null!==(de=c.platform)&&void 0!==de?de:"web",un=null!==(ve=c.appId)&&void 0!==ve?ve:"",cn=document.title,sn=!1,ln=null===(pe=c.resetActivityTrackingOnPageView)||void 0===pe||pe,fn=null!==(me=c.cookieName)&&void 0!==me?me:"_sp_",dn=null!==(he=c.cookieDomain)&&void 0!==he?he:void 0,vn=null!==(ye=c.discoverRootDomain)&&void 0!==ye?ye:void 0===dn,gn="/",pn=null!==(we=c.cookieSameSite)&&void 0!==we?we:"Lax",mn=null===(be=c.cookieSecure)||void 0===be||be,hn=window.navigator.doNotTrack||window.navigator.msDoNotTrack||window.doNotTrack,yn=void 0!==c.respectDoNotTrack&&(c.respectDoNotTrack&&("yes"===hn||"1"===hn)),wn=null!==(Se=c.cookieLifetime)&&void 0!==Se?Se:63072e3,bn=null!==(ke=c.sessionCookieTimeout)&&void 0!==ke?ke:1800,Sn=Ie(c),kn=Oe(c),Tn=!!c.anonymousTracking,xn=Pe(c),Cn=(new Date).getTime(),An=1,Pn=ne(ge({trackerId:e,endpoint:I(o),serverAnonymization:kn,useLocalStorage:"localStorage"==xn||"cookieAndLocalStorage"==xn},c),u),In=!1,En=null!==(xe=c.preservePageViewIdForUrl)&&void 0!==xe&&xe,On=void 0,Ln={enabled:!1,installed:!1,configurations:{}},Dn=null!==(Ae=null===(Ce=c.contexts)||void 0===Ce?void 0:Ce.session)&&void 0!==Ae&&Ae,jn=c.onSessionUpdateCallback,Rn=!1,Bn="boolean"==typeof($e=c.useExtendedCrossDomainLinker||!1)?{useExtendedCrossDomainLinker:$e}:{useExtendedCrossDomainLinker:!0,collectCrossDomainAttributes:$e},Un=Bn.useExtendedCrossDomainLinker,Nn=Bn.collectCrossDomainAttributes;vn&&!dn&&(dn=Z(pn,mn));var Vn=ae(),_n=Vn.browserLanguage,zn=Vn.resolution,Mn=Vn.colorDepth,qn=Vn.cookiesEnabled,Fn=z();return Ke.setTrackerVersion(t),Ke.setTrackerNamespace(n),Ke.setAppId(un),Ke.setPlatform(an),Ke.addPayloadPair("cookie",qn?"1":"0"),Ke.addPayloadPair("cs",en),Ke.addPayloadPair("lang",_n),Ke.addPayloadPair("res",zn),Ke.addPayloadPair("cd",Mn),Fn&&Ke.addPayloadPair("tz",Fn),p(),A(),c.crossDomainLinker&&f(c.crossDomainLinker),ge(ge({},{getDomainSessionIndex:function(){return An},getPageViewId:O,getTabId:N,newSession:function(){var e=P();if("0"===e[0]?(Qe="none"!=xn?re(e):e[6],An=e[3]):(An++,Qe=re(e,{memorizedVisitCount:An})),oe(e),"none"!=xn){var n=ie(e,xn,Tn);S(e),b()&&jn&&(Rn=!0,jn(n))}Cn=(new Date).getTime()},getCookieName:function(e){return fn+e+"."+We},getUserId:function(){return Xe},getDomainUserId:function(){return P()[1]},getDomainUserInfo:function(){return P()},setReferrerUrl:function(e){Ue=e},setCustomUrl:function(e){l();var n,t=rn;v(e)?Ne=e:"/"===e.slice(0,1)?Ne=v(t)+"://"+q(t)+e:(0<=(n=(t=d(t)).indexOf("?"))&&(t=t.slice(0,n)),(n=t.lastIndexOf("/"))!==t.length-1&&(t=t.slice(0,n+1)),Ne=t+e)},setDocumentTitle:function(e){cn=document.title,Ve=e,sn=!1},discardHashTag:function(e){_e=e},discardBrace:function(e){ze=e},setCookiePath:function(e){gn=e,p()},setVisitorCookieTimeout:function(e){wn=e},crossDomainLinker:function(e){f(e)},enableActivityTracking:function(e){Ln.configurations.pagePing||(Ln.enabled=!0,Ln.configurations.pagePing=X(ge(ge({},e),{callback:Y})))},enableActivityTrackingCallback:function(e){Ln.configurations.callback||(Ln.enabled=!0,Ln.configurations.callback=X(e))},disableActivityTracking:function(){$("pagePing")},disableActivityTrackingCallback:function(){$("callback")},updatePageActivity:function(){m()},setOptOutCookie:function(e){Me=e},setUserId:function(e){Xe=e},setUserIdFromLocation:function(e){l(),Xe=J(e,rn)},setUserIdFromReferrer:function(e){l(),Xe=J(e,on)},setUserIdFromCookie:function(e){Xe=Be.getCookie(e)},setCollectorUrl:function(e){Pn.setCollectorUrl(I(e))},setBufferSize:function(e){Pn.setBufferSize(e)},flushBuffer:function(e){void 0===e&&(e={}),Pn.executeQueue(),e.newBufferSize&&Pn.setBufferSize(e.newBufferSize)},trackPageView:function(e){void 0===e&&(e={}),V(e)},preservePageViewId:function(){In=!0},preservePageViewIdForUrl:function(e){En=e},disableAnonymousTracking:function(e){c.anonymousTracking=!1,x(e),A(),Pn.executeQueue()},enableAnonymousTracking:function(e){var n;c.anonymousTracking=null===(n=e&&(null==e?void 0:e.options))||void 0===n||n,x(e),Sn||E()},clearUserData:T}),{id:e,namespace:n,core:Ke,sharedState:u})}(e,n,t,o,u,c);var l=ge(ge({},e),{addPlugin:function(e){var n,t;l.core.addPlugin(e),null===(t=(n=e.plugin).activateBrowserPlugin)||void 0===t||t.call(n,l)}});return s.forEach((function(e){var n;null===(n=e.activateBrowserPlugin)||void 0===n||n.call(e,l)})),l}function le(e){return de(e,Be)}function fe(){return Object.keys(Be)}function de(e,n){for(var t=[],r=0;r<e.length;r++){var o=e[r];n.hasOwnProperty(o)?t.push(n[o]):Te.warn(o+" not configured")}return t}function ve(){try{return!!window.localStorage}catch(e){return!0}}var ge=function(){return ge=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},ge.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;for(var pe,me=new Uint8Array(16),he=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,ye=[],we=0;256>we;++we)ye.push((we+256).toString(16).substr(1));var be,Se,ke="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 Te=function(e){return void 0===e&&(e=be.warn),{setLogLevel:function(n){e=be[n]?n:be.warn},warn:function(n,t){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];e>=be.warn&&"undefined"!=typeof console&&(i="Snowplow: "+n,t?console.warn.apply(console,r([i+"\n",t],o,!1)):console.warn.apply(console,r([i],o,!1)))},error:function(n,t){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];e>=be.error&&"undefined"!=typeof console&&(i="Snowplow: "+n+"\n",t?console.error.apply(console,r([i+"\n",t],o,!1)):console.error.apply(console,r([i],o,!1)))},debug:function(n){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];e>=be.debug&&"undefined"!=typeof console&&console.debug.apply(console,r(["Snowplow: "+n],t,!1))},info:function(n){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];e>=be.info&&"undefined"!=typeof console&&console.info.apply(console,r(["Snowplow: "+n],t,!1))}}}(),xe={},Ce={};!function(){var e={rotl:function(e,n){return e<<n|e>>>32-n},rotr:function(e,n){return e<<32-n|e>>>n},endian:function(n){if(n.constructor==Number)return 16711935&e.rotl(n,8)|4278255360&e.rotl(n,24);for(var t=0;t<n.length;t++)n[t]=e.endian(n[t]);return n},randomBytes:function(e){for(var n=[];0<e;e--)n.push(Math.floor(256*Math.random()));return n},bytesToWords:function(e){for(var n=[],t=0,r=0;t<e.length;t++,r+=8)n[r>>>5]|=e[t]<<24-r%32;return n},wordsToBytes:function(e){for(var n=[],t=0;t<32*e.length;t+=8)n.push(e[t>>>5]>>>24-t%32&255);return n},bytesToHex:function(e){for(var n=[],t=0;t<e.length;t++)n.push((e[t]>>>4).toString(16)),n.push((15&e[t]).toString(16));return n.join("")},hexToBytes:function(e){for(var n=[],t=0;t<e.length;t+=2)n.push(parseInt(e.substr(t,2),16));return n},bytesToBase64:function(e){for(var n=[],t=0;t<e.length;t+=3)for(var r=e[t]<<16|e[t+1]<<8|e[t+2],o=0;4>o;o++)8*t+6*o<=8*e.length?n.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>>6*(3-o)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],t=0,r=0;t<e.length;r=++t%4)0!=r&&n.push(("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(t-1))&Math.pow(2,-2*r+8)-1)<<2*r|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(t))>>>6-2*r);return n}};Ce=e}();var Ae={utf8:{stringToBytes:function(e){return Ae.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(Ae.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var n=[],t=0;t<e.length;t++)n.push(255&e.charCodeAt(t));return n},bytesToString:function(e){for(var n=[],t=0;t<e.length;t++)n.push(String.fromCharCode(e[t]));return n.join("")}}},Pe=Ae;!function(){var e=Ce,n=Pe.utf8,t=Pe.bin,r=function(r,o){var i=e.wordsToBytes,a=r;a.constructor==String?a=n.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,m=f,h=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+=m,d+=h}return i=i.call(e,[c,s,l,f,d]),o&&o.asBytes?i:o&&o.asString?t.bytesToString(i):e.bytesToHex(i)};r._blocksize=16,r._digestsize=20,xe=r}();var Ie,Ee=xe,Oe={sessionId:!0,sourceId:!0,sourcePlatform:!1,userId:!1,reason:!1},Le=!1,De="x",je=function(){function e(e){return n[e]||(n[e]=function(e){function n(){void 0!==t&&(clearTimeout(t),t=void 0),i||(i=!0,void 0!==r&&Y(e,r[0],r[1],r[2],r[3],r[4],r[5]))}var t,r,o,i=!0;return{getValue:function(){var n;return r&&(!o||o>new Date)&&null!==(n=r[0])&&void 0!==n?n:Y(e)},setValue:function(e,a,u,c,s,l){return r=[e,a,u,c,s,l],i=!1,void 0===t&&(t=setTimeout((function(){t=void 0,n()}),10)),o=new Date(Date.now()+1e3*Math.min(.05,null!=a?a:.05)),!0},deleteValue:function(n,o,a,u){r=void 0,i=!0,void 0!==t&&(clearTimeout(t),t=void 0),Q(e,n,o,a,u)},flush:n}}(e)),n[e]}var n={};return{getCookie:function(n){return e(n).getValue()},setCookie:function(n,t,r,o,i,a,u){return e(n).setValue(t,r,o,i,a,u)},deleteCookie:function(n,t,r,o,i){e(n).deleteValue(t,r,o,i)},clearCache:function(){n={}},flush:function(){for(var e=0,t=Object.values(n);e<t.length;e++)t[e].flush()}}}(),Re={getCookie:Y,setCookie:function(e,n,t,r,o,i,a){return Y(e,n,t,r,o,i,a),-1!==document.cookie.indexOf("".concat(e,"="))},deleteCookie:Q},Be={},Ue=function(){this.bufferFlushers=[],this.hasLoaded=!1,this.registeredOnLoadHandlers=[]};e.SharedState=Ue,e.addEventListener=G,e.addTracker=function(e,n,t,r,o,i){return Be.hasOwnProperty(e)?null:(Be[e]=se(e,n,t,r,o,i),Be[e])},e.allTrackerNames=fe,e.allTrackers=function(){return Be},e.attemptDeleteLocalStorage=j,e.attemptGetLocalStorage=L,e.attemptGetSessionStorage=R,e.attemptWriteLocalStorage=D,e.attemptWriteSessionStorage=B,e.cookie=Y,e.createCrossDomainParameterValue=U,e.createSharedState=function(){function e(){var e;if(!n.hasLoaded)for(n.hasLoaded=!0,e=0;e<n.registeredOnLoadHandlers.length;e++)n.registeredOnLoadHandlers[e]();return!0}var n=new Ue,t=document,r=window;return t.visibilityState&&G(t,"visibilitychange",(function(){"hidden"==t.visibilityState&&n.bufferFlushers.forEach((function(e){e(!1)}))}),!1),G(r,"beforeunload",(function(){n.bufferFlushers.forEach((function(e){e(!1)}))}),!1),"loading"===document.readyState?(t.addEventListener?t.addEventListener("DOMContentLoaded",(function n(){t.removeEventListener("DOMContentLoaded",n,!1),e()})):t.attachEvent&&t.attachEvent("onreadystatechange",(function n(){"complete"===t.readyState&&(t.detachEvent("onreadystatechange",n),e())})),G(r,"load",e,!1)):e(),n},e.decorateQuerystring=W,e.deleteCookie=Q,e.dispatchToTrackers=function(e,n){try{le(null!=e?e:fe()).forEach(n)}catch(e){Te.error("Function failed",e)}},e.dispatchToTrackersInCollection=function(e,n,t){try{de(null!=e?e:Object.keys(n),n).forEach(t)}catch(e){Te.error("Function failed",e)}},e.findRootDomain=Z,e.fixupDomain=F,e.fixupTitle=M,e.fixupUrl=te,e.flushPendingCookies=function(){je.flush()},e.fromQuerystring=J,e.getCookiesWithPrefix=X,e.getCssClasses=$,e.getFilterByClass=function(e){if(null==e||"object"!=typeof e||Array.isArray(e))return function(){return!0};var n=Object.prototype.hasOwnProperty.call(e,"allowlist"),t=ee(e);return K(e,(function(e){e:{var r=0;for(e=$(e);r<e.length;r++)if(t[e[r]]){r=!0;break e}r=!1}return r===n}))},e.getFilterByName=function(e){if(null==e||"object"!=typeof e||Array.isArray(e))return function(){return!0};var n=e.hasOwnProperty("allowlist"),t=ee(e);return K(e,(function(e){return e.name in t===n}))},e.getHostName=q,e.getReferrer=H,e.getTimeZone=z,e.getTracker=function(e){return Be.hasOwnProperty(e)?Be[e]:(Te.warn(e+" not configured"),null)},e.getTrackers=le,e.hasLocalStorage=ve,e.hasSessionStorage=function(){try{return!!window.sessionStorage}catch(e){return!0}},e.isFunction=function(e){return!(!e||"function"!=typeof e)},e.isInteger=_,e.isString=V,e.isValueInArray=function(e,n){for(var t=0;t<n.length;t++)if(n[t]===e)return!0;return!1},e.localStorageAccessible=function(){if(!ve())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 Be.hasOwnProperty(e)},e.urlSafeBase64Encode=N,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.umd.min.js.map |
{ | ||
"name": "@snowplow/browser-tracker-core", | ||
"version": "4.0.0-beta.2", | ||
"version": "4.0.0-beta.3", | ||
"description": "Core functionality for Snowplow Browser trackers", | ||
@@ -24,3 +24,3 @@ "homepage": "http://bit.ly/sp-js", | ||
"uuid": "^8.3.2", | ||
"@snowplow/tracker-core": "4.0.0-beta.2" | ||
"@snowplow/tracker-core": "4.0.0-beta.3" | ||
}, | ||
@@ -27,0 +27,0 @@ "devDependencies": { |
Sorry, the diff of this file is too big to display
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2345143
10237
+ Added@snowplow/tracker-core@4.0.0-beta.3(transitive)
- Removed@snowplow/tracker-core@4.0.0-beta.2(transitive)