UNPKG

392 kBSource Map (JSON)View Raw
1{"version":3,"file":"sp.js","sources":["../../../common/temp/node_modules/.pnpm/tslib@2.1.0/node_modules/tslib/tslib.es6.js","../../../libraries/tracker-core/dist/index.module.js","../../../libraries/browser-tracker-core/dist/index.module.js","../../../plugins/browser-plugin-client-hints/dist/index.module.js","../../../plugins/browser-plugin-optimizely-x/dist/index.module.js","../../../plugins/browser-plugin-performance-timing/dist/index.module.js","../../../plugins/browser-plugin-consent/dist/index.module.js","../../../plugins/browser-plugin-geolocation/dist/index.module.js","../../../plugins/browser-plugin-ga-cookies/dist/index.module.js","../../../plugins/browser-plugin-link-click-tracking/dist/index.module.js","../../../plugins/browser-plugin-form-tracking/dist/index.module.js","../../../plugins/browser-plugin-error-tracking/dist/index.module.js","../../../plugins/browser-plugin-timezone/dist/index.module.js","../../../plugins/browser-plugin-ecommerce/dist/index.module.js","../../../plugins/browser-plugin-enhanced-ecommerce/dist/index.module.js","../../../plugins/browser-plugin-ad-tracking/dist/index.module.js","../../../plugins/browser-plugin-site-tracking/dist/index.module.js","../../../common/temp/node_modules/.pnpm/uuid@3.4.0/node_modules/uuid/lib/bytesToUuid.js","../../../common/temp/node_modules/.pnpm/uuid@3.4.0/node_modules/uuid/lib/rng-browser.js","../../../common/temp/node_modules/.pnpm/uuid@3.4.0/node_modules/uuid/v1.js","../../../common/temp/node_modules/.pnpm/uuid@3.4.0/node_modules/uuid/v4.js","../../../common/temp/node_modules/.pnpm/uuid@3.4.0/node_modules/uuid/index.js","../../../common/temp/node_modules/.pnpm/crypt@0.0.2/node_modules/crypt/crypt.js","../../../common/temp/node_modules/.pnpm/charenc@0.0.2/node_modules/charenc/charenc.js","../../../common/temp/node_modules/.pnpm/sha1@1.1.1/node_modules/sha1/sha1.js","../../browser-tracker/dist/index.module.js","../../../common/temp/node_modules/.pnpm/jstimezonedetect@1.0.7/node_modules/jstimezonedetect/dist/jstz.min.js","../src/index.ts","../src/in_queue.ts","../src/features.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n to[j] = from[i];\r\n return to;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/*!\n * Core functionality for Snowplow JavaScript trackers v3.1.0 (http://bit.ly/sp-js)\n * Copyright 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * Licensed under BSD-3-Clause\n */\n\nimport { __spreadArray, __assign } from 'tslib';\nimport { v4 } from 'uuid';\n\nvar version$1 = \"3.1.0\";\n\n/*\n * Copyright (c) 2013 Kevin van Zonneveld (http://kvz.io)\n * and Contributors (http://phpjs.org/authors)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\n * of the Software, and to permit persons to whom the Software is furnished to do\n * so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n/**\n * Encodes a string into a url safe Base 64 encoded string\n * @remark See: {@link http://tools.ietf.org/html/rfc4648#page-7}\n * @param data - String to encode\n * @returns The url safe Base 64 string\n */\nfunction base64urlencode(data) {\n if (!data) {\n return data;\n }\n var enc = base64encode(data);\n return enc.replace(/=/g, '').replace(/\\+/g, '-').replace(/\\//g, '_');\n}\nvar b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n/**\n * Encode string as base64.\n * Any type can be passed, but will be stringified\n *\n * @param data - string to encode\n * @returns base64-encoded string\n */\nfunction base64encode(data) {\n // discuss at: http://phpjs.org/functions/base64_encode/\n // original by: Tyler Akins (http://rumkin.com)\n // improved by: Bayron Guevara\n // improved by: Thunder.m\n // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // improved by: Rafał Kukawski (http://kukawski.pl)\n // bugfixed by: Pellentesque Malesuada\n // example 1: base64_encode('Kevin van Zonneveld');\n // returns 1: 'S2V2aW4gdmFuIFpvbm5ldmVsZA=='\n // example 2: base64_encode('a');\n // returns 2: 'YQ=='\n // example 3: base64_encode('✓ à la mode');\n // returns 3: '4pyTIMOgIGxhIG1vZGU='\n var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, ac = 0;\n var tmp_arr = [];\n if (!data) {\n return data;\n }\n data = unescape(encodeURIComponent(data));\n do {\n // pack three octets into four hexets\n o1 = data.charCodeAt(i++);\n o2 = data.charCodeAt(i++);\n o3 = data.charCodeAt(i++);\n bits = (o1 << 16) | (o2 << 8) | o3;\n h1 = (bits >> 18) & 0x3f;\n h2 = (bits >> 12) & 0x3f;\n h3 = (bits >> 6) & 0x3f;\n h4 = bits & 0x3f;\n // use hexets to index into b64, and append result to encoded string\n tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);\n } while (i < data.length);\n var enc = tmp_arr.join('');\n var r = data.length % 3;\n return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);\n}\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nfunction payloadBuilder() {\n var dict = {}, allJson = [], jsonForProcessing = [];\n var processor;\n var add = function (key, value) {\n if (value != null && value !== '') {\n // null also checks undefined\n dict[key] = value;\n }\n };\n var addDict = function (dict) {\n for (var key in dict) {\n if (Object.prototype.hasOwnProperty.call(dict, key)) {\n add(key, dict[key]);\n }\n }\n };\n var addJson = function (keyIfEncoded, keyIfNotEncoded, json) {\n if (json && isNonEmptyJson(json)) {\n var jsonWithKeys = { keyIfEncoded: keyIfEncoded, keyIfNotEncoded: keyIfNotEncoded, json: json };\n jsonForProcessing.push(jsonWithKeys);\n allJson.push(jsonWithKeys);\n }\n };\n return {\n add: add,\n addDict: addDict,\n addJson: addJson,\n getPayload: function () { return dict; },\n getJson: function () { return allJson; },\n withJsonProcessor: function (jsonProcessor) {\n processor = jsonProcessor;\n },\n build: function () {\n processor === null || processor === void 0 ? void 0 : processor(this, jsonForProcessing);\n return dict;\n }\n };\n}\n/**\n * A helper to build a Snowplow request from a set of name-value pairs, provided using the add methods.\n * Will base64 encode JSON, if desired, on build\n *\n * @return The request builder, with add and build methods\n */\nfunction payloadJsonProcessor(encodeBase64) {\n return function (payloadBuilder, jsonForProcessing) {\n for (var _i = 0, jsonForProcessing_1 = jsonForProcessing; _i < jsonForProcessing_1.length; _i++) {\n var json = jsonForProcessing_1[_i];\n var str = JSON.stringify(json.json);\n if (encodeBase64) {\n payloadBuilder.add(json.keyIfEncoded, base64urlencode(str));\n }\n else {\n payloadBuilder.add(json.keyIfNotEncoded, str);\n }\n }\n jsonForProcessing.length = 0;\n };\n}\n/**\n * Is property a non-empty JSON?\n * @param property - Checks if object is non-empty json\n */\nfunction isNonEmptyJson(property) {\n if (!isJson(property)) {\n return false;\n }\n for (var key in property) {\n if (Object.prototype.hasOwnProperty.call(property, key)) {\n return true;\n }\n }\n return false;\n}\n/**\n * Is property a JSON?\n * @param property - Checks if object is json\n */\nfunction isJson(property) {\n return (typeof property !== 'undefined' &&\n property !== null &&\n (property.constructor === {}.constructor || property.constructor === [].constructor));\n}\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nvar label = 'Snowplow: ';\nvar LOG_LEVEL;\n(function (LOG_LEVEL) {\n LOG_LEVEL[LOG_LEVEL[\"none\"] = 0] = \"none\";\n LOG_LEVEL[LOG_LEVEL[\"error\"] = 1] = \"error\";\n LOG_LEVEL[LOG_LEVEL[\"warn\"] = 2] = \"warn\";\n LOG_LEVEL[LOG_LEVEL[\"debug\"] = 3] = \"debug\";\n LOG_LEVEL[LOG_LEVEL[\"info\"] = 4] = \"info\";\n})(LOG_LEVEL || (LOG_LEVEL = {}));\nvar LOG = logger();\nfunction logger(logLevel) {\n if (logLevel === void 0) { logLevel = LOG_LEVEL.warn; }\n function setLogLevel(level) {\n if (LOG_LEVEL[level]) {\n logLevel = level;\n }\n else {\n logLevel = LOG_LEVEL.warn;\n }\n }\n /**\n * Log errors, with or without error object\n */\n function error(message, error) {\n var extraParams = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n extraParams[_i - 2] = arguments[_i];\n }\n if (logLevel >= LOG_LEVEL.error && typeof console !== 'undefined') {\n var logMsg = label + message + '\\n';\n if (error) {\n console.error.apply(console, __spreadArray([logMsg + '\\n', error], extraParams));\n }\n else {\n console.error.apply(console, __spreadArray([logMsg], extraParams));\n }\n }\n }\n /**\n * Log warnings, with or without error object\n */\n function warn(message, error) {\n var extraParams = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n extraParams[_i - 2] = arguments[_i];\n }\n if (logLevel >= LOG_LEVEL.warn && typeof console !== 'undefined') {\n var logMsg = label + message;\n if (error) {\n console.warn.apply(console, __spreadArray([logMsg + '\\n', error], extraParams));\n }\n else {\n console.warn.apply(console, __spreadArray([logMsg], extraParams));\n }\n }\n }\n /**\n * Log debug messages\n */\n function debug(message) {\n var extraParams = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n extraParams[_i - 1] = arguments[_i];\n }\n if (logLevel >= LOG_LEVEL.debug && typeof console !== 'undefined') {\n console.debug.apply(console, __spreadArray([label + message], extraParams));\n }\n }\n /**\n * Log info messages\n */\n function info(message) {\n var extraParams = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n extraParams[_i - 1] = arguments[_i];\n }\n if (logLevel >= LOG_LEVEL.info && typeof console !== 'undefined') {\n console.info.apply(console, __spreadArray([label + message], extraParams));\n }\n }\n return { setLogLevel: setLogLevel, warn: warn, error: error, debug: debug, info: info };\n}\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * Contains helper functions to aid in the addition and removal of Global Contexts\n */\nfunction globalContexts() {\n var globalPrimitives = [];\n var conditionalProviders = [];\n /**\n * Returns all applicable global contexts for a specified event\n * @param event - The event to check for applicable global contexts for\n * @returns An array of contexts\n */\n var assembleAllContexts = function (event) {\n var eventSchema = getUsefulSchema(event);\n var eventType = getEventType(event);\n var contexts = [];\n var generatedPrimitives = generatePrimitives(globalPrimitives, event, eventType, eventSchema);\n contexts.push.apply(contexts, generatedPrimitives);\n var generatedConditionals = generateConditionals(conditionalProviders, event, eventType, eventSchema);\n contexts.push.apply(contexts, generatedConditionals);\n return contexts;\n };\n return {\n getGlobalPrimitives: function () {\n return globalPrimitives;\n },\n getConditionalProviders: function () {\n return conditionalProviders;\n },\n addGlobalContexts: function (contexts) {\n var acceptedConditionalContexts = [];\n var acceptedContextPrimitives = [];\n for (var _i = 0, contexts_1 = contexts; _i < contexts_1.length; _i++) {\n var context = contexts_1[_i];\n if (isConditionalContextProvider(context)) {\n acceptedConditionalContexts.push(context);\n }\n else if (isContextPrimitive(context)) {\n acceptedContextPrimitives.push(context);\n }\n }\n globalPrimitives = globalPrimitives.concat(acceptedContextPrimitives);\n conditionalProviders = conditionalProviders.concat(acceptedConditionalContexts);\n },\n clearGlobalContexts: function () {\n conditionalProviders = [];\n globalPrimitives = [];\n },\n removeGlobalContexts: function (contexts) {\n var _loop_1 = function (context) {\n if (isConditionalContextProvider(context)) {\n conditionalProviders = conditionalProviders.filter(function (item) { return JSON.stringify(item) === JSON.stringify(context); });\n }\n else if (isContextPrimitive(context)) {\n globalPrimitives = globalPrimitives.filter(function (item) { return JSON.stringify(item) === JSON.stringify(context); });\n }\n };\n for (var _i = 0, contexts_2 = contexts; _i < contexts_2.length; _i++) {\n var context = contexts_2[_i];\n _loop_1(context);\n }\n },\n getApplicableContexts: function (event) {\n return assembleAllContexts(event);\n }\n };\n}\nfunction pluginContexts(plugins) {\n /**\n * Add common contexts to every event\n *\n * @param array - additionalContexts List of user-defined contexts\n * @return userContexts combined with commonContexts\n */\n return {\n addPluginContexts: function (additionalContexts) {\n var combinedContexts = additionalContexts !== null && additionalContexts !== void 0 ? additionalContexts : [];\n plugins.forEach(function (plugin) {\n try {\n if (plugin.contexts) {\n combinedContexts.push.apply(combinedContexts, plugin.contexts());\n }\n }\n catch (ex) {\n LOG.error('Error adding plugin contexts', ex);\n }\n });\n return combinedContexts;\n }\n };\n}\n/**\n * Find dynamic context generating functions and return their results to be merged into the static contexts\n * Combine an array of unchanging contexts with the result of a context-creating function\n *\n * @param dynamicOrStaticContexts - Array of custom context Objects or custom context generating functions\n * @param Parameters - to pass to dynamic context callbacks\n * @returns An array of Self Describing JSON context\n */\nfunction resolveDynamicContext(dynamicOrStaticContexts) {\n var _a;\n var extraParams = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n extraParams[_i - 1] = arguments[_i];\n }\n return ((_a = dynamicOrStaticContexts === null || dynamicOrStaticContexts === void 0 ? void 0 : dynamicOrStaticContexts.map(function (context) {\n if (typeof context === 'function') {\n try {\n return context.apply(void 0, extraParams);\n }\n catch (e) {\n //TODO: provide warning\n return undefined;\n }\n }\n else {\n return context;\n }\n }).filter(Boolean)) !== null && _a !== void 0 ? _a : []);\n}\n/**\n * Slices a schema into its composite parts. Useful for ruleset filtering.\n * @param input - A schema string\n * @returns The vendor, schema name, major, minor and patch information of a schema string\n */\nfunction getSchemaParts(input) {\n var re = new RegExp('^iglu:([a-zA-Z0-9-_.]+)/([a-zA-Z0-9-_]+)/jsonschema/([1-9][0-9]*)-(0|[1-9][0-9]*)-(0|[1-9][0-9]*)$');\n var matches = re.exec(input);\n if (matches !== null)\n return matches.slice(1, 6);\n return undefined;\n}\n/**\n * Validates the vendor section of a schema string contains allowed wildcard values\n * @param parts - Array of parts from a schema string\n * @returns Whether the vendor validation parts are a valid combination\n */\nfunction validateVendorParts(parts) {\n if (parts[0] === '*' || parts[1] === '*') {\n return false; // no wildcard in first or second part\n }\n if (parts.slice(2).length > 0) {\n var asterisk = false;\n for (var _i = 0, _a = parts.slice(2); _i < _a.length; _i++) {\n var part = _a[_i];\n if (part === '*')\n // mark when we've found a wildcard\n asterisk = true;\n else if (asterisk)\n // invalid if alpha parts come after wildcard\n return false;\n }\n return true;\n }\n else if (parts.length == 2)\n return true;\n return false;\n}\n/**\n * Validates the vendor part of a schema string is valid for a rule set\n * @param input - Vendor part of a schema string\n * @returns Whether the vendor validation string is valid\n */\nfunction validateVendor(input) {\n var parts = input.split('.');\n if (parts && parts.length > 1)\n return validateVendorParts(parts);\n return false;\n}\n/**\n * Checks for validity of input and returns all the sections of a schema string that are used to match rules in a ruleset\n * @param input - A Schema string\n * @returns The sections of a schema string that are used to match rules in a ruleset\n */\nfunction getRuleParts(input) {\n var re = new RegExp('^iglu:((?:(?:[a-zA-Z0-9-_]+|\\\\*).)+(?:[a-zA-Z0-9-_]+|\\\\*))/([a-zA-Z0-9-_.]+|\\\\*)/jsonschema/([1-9][0-9]*|\\\\*)-(0|[1-9][0-9]*|\\\\*)-(0|[1-9][0-9]*|\\\\*)$');\n var matches = re.exec(input);\n if (matches !== null && validateVendor(matches[1]))\n return matches.slice(1, 6);\n return undefined;\n}\n/**\n * Ensures the rules specified in a schema string of a ruleset are valid\n * @param input - A Schema string\n * @returns if there rule is valid\n */\nfunction isValidRule(input) {\n var ruleParts = getRuleParts(input);\n if (ruleParts) {\n var vendor = ruleParts[0];\n return ruleParts.length === 5 && validateVendor(vendor);\n }\n return false;\n}\n/**\n * Check if a variable is an Array containing only strings\n * @param input - The variable to validate\n * @returns True if the input is an array containing only strings\n */\nfunction isStringArray(input) {\n return (Array.isArray(input) &&\n input.every(function (x) {\n return typeof x === 'string';\n }));\n}\n/**\n * Validates whether a rule set is an array of valid ruleset strings\n * @param input - The Array of rule set arguments\n * @returns True is the input is an array of valid rules\n */\nfunction isValidRuleSetArg(input) {\n if (isStringArray(input))\n return input.every(function (x) {\n return isValidRule(x);\n });\n else if (typeof input === 'string')\n return isValidRule(input);\n return false;\n}\n/**\n * Check if a variable is a valid, non-empty Self Describing JSON\n * @param input - The variable to validate\n * @returns True if a valid Self Describing JSON\n */\nfunction isSelfDescribingJson(input) {\n var sdj = input;\n if (isNonEmptyJson(sdj))\n if ('schema' in sdj && 'data' in sdj)\n return typeof sdj.schema === 'string' && typeof sdj.data === 'object';\n return false;\n}\n/**\n * Validates if the input object contains the expected properties of a ruleset\n * @param input - The object containing a rule set\n * @returns True if a valid rule set\n */\nfunction isRuleSet(input) {\n var ruleSet = input;\n var ruleCount = 0;\n if (input != null && typeof input === 'object' && !Array.isArray(input)) {\n if (Object.prototype.hasOwnProperty.call(ruleSet, 'accept')) {\n if (isValidRuleSetArg(ruleSet['accept'])) {\n ruleCount += 1;\n }\n else {\n return false;\n }\n }\n if (Object.prototype.hasOwnProperty.call(ruleSet, 'reject')) {\n if (isValidRuleSetArg(ruleSet['reject'])) {\n ruleCount += 1;\n }\n else {\n return false;\n }\n }\n // if either 'reject' or 'accept' or both exists,\n // we have a valid ruleset\n return ruleCount > 0 && ruleCount <= 2;\n }\n return false;\n}\n/**\n * Validates if the function can be a valid context generator function\n * @param input - The function to be validated\n */\nfunction isContextCallbackFunction(input) {\n return typeof input === 'function' && input.length <= 1;\n}\n/**\n * Validates if the function can be a valid context primitive function or self describing json\n * @param input - The function or orbject to be validated\n * @returns True if either a Context Generator or Self Describing JSON\n */\nfunction isContextPrimitive(input) {\n return isContextCallbackFunction(input) || isSelfDescribingJson(input);\n}\n/**\n * Validates if an array is a valid shape to be a Filter Provider\n * @param input - The Array of Context filter callbacks\n */\nfunction isFilterProvider(input) {\n if (Array.isArray(input)) {\n if (input.length === 2) {\n if (Array.isArray(input[1])) {\n return isContextCallbackFunction(input[0]) && input[1].every(isContextPrimitive);\n }\n return isContextCallbackFunction(input[0]) && isContextPrimitive(input[1]);\n }\n }\n return false;\n}\n/**\n * Validates if an array is a valid shape to be an array of rule sets\n * @param input - The Array of Rule Sets\n */\nfunction isRuleSetProvider(input) {\n if (Array.isArray(input) && input.length === 2) {\n if (!isRuleSet(input[0]))\n return false;\n if (Array.isArray(input[1]))\n return input[1].every(isContextPrimitive);\n return isContextPrimitive(input[1]);\n }\n return false;\n}\n/**\n * Checks if an input array is either a filter provider or a rule set provider\n * @param input - An array of filter providers or rule set providers\n * @returns Whether the array is a valid {@link ConditionalContextProvider}\n */\nfunction isConditionalContextProvider(input) {\n return isFilterProvider(input) || isRuleSetProvider(input);\n}\n/**\n * Checks if a given schema matches any rules within the provided rule set\n * @param ruleSet - The rule set containing rules to match schema against\n * @param schema - The schema to be matched against the rule set\n */\nfunction matchSchemaAgainstRuleSet(ruleSet, schema) {\n var rejectCount = 0;\n var acceptCount = 0;\n var acceptRules = ruleSet['accept'];\n if (Array.isArray(acceptRules)) {\n if (ruleSet.accept.some(function (rule) { return matchSchemaAgainstRule(rule, schema); })) {\n acceptCount++;\n }\n }\n else if (typeof acceptRules === 'string') {\n if (matchSchemaAgainstRule(acceptRules, schema)) {\n acceptCount++;\n }\n }\n var rejectRules = ruleSet['reject'];\n if (Array.isArray(rejectRules)) {\n if (ruleSet.reject.some(function (rule) { return matchSchemaAgainstRule(rule, schema); })) {\n rejectCount++;\n }\n }\n else if (typeof rejectRules === 'string') {\n if (matchSchemaAgainstRule(rejectRules, schema)) {\n rejectCount++;\n }\n }\n if (acceptCount > 0 && rejectCount === 0) {\n return true;\n }\n else if (acceptCount === 0 && rejectCount > 0) {\n return false;\n }\n return false;\n}\n/**\n * Checks if a given schema matches a specific rule from a rule set\n * @param rule - The rule to match schema against\n * @param schema - The schema to be matched against the rule\n */\nfunction matchSchemaAgainstRule(rule, schema) {\n if (!isValidRule(rule))\n return false;\n var ruleParts = getRuleParts(rule);\n var schemaParts = getSchemaParts(schema);\n if (ruleParts && schemaParts) {\n if (!matchVendor(ruleParts[0], schemaParts[0]))\n return false;\n for (var i = 1; i < 5; i++) {\n if (!matchPart(ruleParts[i], schemaParts[i]))\n return false;\n }\n return true; // if it hasn't failed, it passes\n }\n return false;\n}\nfunction matchVendor(rule, vendor) {\n // rule and vendor must have same number of elements\n var vendorParts = vendor.split('.');\n var ruleParts = rule.split('.');\n if (vendorParts && ruleParts) {\n if (vendorParts.length !== ruleParts.length)\n return false;\n for (var i = 0; i < ruleParts.length; i++) {\n if (!matchPart(vendorParts[i], ruleParts[i]))\n return false;\n }\n return true;\n }\n return false;\n}\nfunction matchPart(rule, schema) {\n // parts should be the string nested between slashes in the URI: /example/\n return (rule && schema && rule === '*') || rule === schema;\n}\n// Returns the \"useful\" schema, i.e. what would someone want to use to identify events.\n// For some events this is the 'e' property but for unstructured events, this is the\n// 'schema' from the 'ue_px' field.\nfunction getUsefulSchema(sb) {\n var eventJson = sb.getJson();\n for (var _i = 0, eventJson_1 = eventJson; _i < eventJson_1.length; _i++) {\n var json = eventJson_1[_i];\n if (json.keyIfEncoded === 'ue_px' && typeof json.json['data'] === 'object') {\n var schema = json.json['data']['schema'];\n if (typeof schema == 'string') {\n return schema;\n }\n }\n }\n return '';\n}\nfunction getEventType(payloadBuilder) {\n var eventType = payloadBuilder.getPayload()['e'];\n return typeof eventType === 'string' ? eventType : '';\n}\nfunction buildGenerator(generator, event, eventType, eventSchema) {\n var contextGeneratorResult = undefined;\n try {\n // try to evaluate context generator\n var args = {\n event: event.getPayload(),\n eventType: eventType,\n eventSchema: eventSchema\n };\n contextGeneratorResult = generator(args);\n // determine if the produced result is a valid SDJ\n if (Array.isArray(contextGeneratorResult) && contextGeneratorResult.every(isSelfDescribingJson)) {\n return contextGeneratorResult;\n }\n else if (isSelfDescribingJson(contextGeneratorResult)) {\n return contextGeneratorResult;\n }\n else {\n return undefined;\n }\n }\n catch (error) {\n contextGeneratorResult = undefined;\n }\n return contextGeneratorResult;\n}\nfunction normalizeToArray(input) {\n if (Array.isArray(input)) {\n return input;\n }\n return Array.of(input);\n}\nfunction generatePrimitives(contextPrimitives, event, eventType, eventSchema) {\n var _a;\n var normalizedInputs = normalizeToArray(contextPrimitives);\n var partialEvaluate = function (primitive) {\n var result = evaluatePrimitive(primitive, event, eventType, eventSchema);\n if (result && result.length !== 0) {\n return result;\n }\n return undefined;\n };\n var generatedContexts = normalizedInputs.map(partialEvaluate);\n return (_a = []).concat.apply(_a, generatedContexts.filter(function (c) { return c != null && c.filter(Boolean); }));\n}\nfunction evaluatePrimitive(contextPrimitive, event, eventType, eventSchema) {\n if (isSelfDescribingJson(contextPrimitive)) {\n return [contextPrimitive];\n }\n else if (isContextCallbackFunction(contextPrimitive)) {\n var generatorOutput = buildGenerator(contextPrimitive, event, eventType, eventSchema);\n if (isSelfDescribingJson(generatorOutput)) {\n return [generatorOutput];\n }\n else if (Array.isArray(generatorOutput)) {\n return generatorOutput;\n }\n }\n return undefined;\n}\nfunction evaluateProvider(provider, event, eventType, eventSchema) {\n if (isFilterProvider(provider)) {\n var filter = provider[0];\n var filterResult = false;\n try {\n var args = {\n event: event.getPayload(),\n eventType: eventType,\n eventSchema: eventSchema\n };\n filterResult = filter(args);\n }\n catch (error) {\n filterResult = false;\n }\n if (filterResult === true) {\n return generatePrimitives(provider[1], event, eventType, eventSchema);\n }\n }\n else if (isRuleSetProvider(provider)) {\n if (matchSchemaAgainstRuleSet(provider[0], eventSchema)) {\n return generatePrimitives(provider[1], event, eventType, eventSchema);\n }\n }\n return [];\n}\nfunction generateConditionals(providers, event, eventType, eventSchema) {\n var _a;\n var normalizedInput = normalizeToArray(providers);\n var partialEvaluate = function (provider) {\n var result = evaluateProvider(provider, event, eventType, eventSchema);\n if (result && result.length !== 0) {\n return result;\n }\n return undefined;\n };\n var generatedContexts = normalizedInput.map(partialEvaluate);\n return (_a = []).concat.apply(_a, generatedContexts.filter(function (c) { return c != null && c.filter(Boolean); }));\n}\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * Transform optional/old-behavior number timestamp into`Timestamp` ADT\n *\n * @param timestamp - optional number or timestamp object\n * @returns correct timestamp object\n */\nfunction getTimestamp(timestamp) {\n if (timestamp == null) {\n return { type: 'dtm', value: new Date().getTime() };\n }\n else if (typeof timestamp === 'number') {\n return { type: 'dtm', value: timestamp };\n }\n else if (timestamp.type === 'ttm') {\n // We can return timestamp here, but this is safer fallback\n return { type: 'ttm', value: timestamp.value };\n }\n else {\n return { type: 'dtm', value: timestamp.value || new Date().getTime() };\n }\n}\n/**\n * Create a tracker core object\n *\n * @param base64 - Whether to base 64 encode contexts and self describing event JSONs\n * @param corePlugins - The core plugins to be processed with each event\n * @param callback - Function applied to every payload dictionary object\n * @return Tracker core\n */\nfunction trackerCore(configuration) {\n if (configuration === void 0) { configuration = {}; }\n function newCore(base64, corePlugins, callback) {\n var pluginContextsHelper = pluginContexts(corePlugins), globalContextsHelper = globalContexts();\n var encodeBase64 = base64, payloadPairs = {}; // Dictionary of key-value pairs which get added to every payload, e.g. tracker version\n /**\n * Wraps an array of custom contexts in a self-describing JSON\n *\n * @param contexts - Array of custom context self-describing JSONs\n * @return Outer JSON\n */\n function completeContexts(contexts) {\n if (contexts && contexts.length) {\n return {\n schema: 'iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0',\n data: contexts\n };\n }\n return undefined;\n }\n /**\n * Adds all global contexts to a contexts array\n *\n * @param pb - PayloadData\n * @param contexts - Custom contexts relating to the event\n */\n function attachGlobalContexts(pb, contexts) {\n var applicableContexts = globalContextsHelper.getApplicableContexts(pb);\n var returnedContexts = [];\n if (contexts && contexts.length) {\n returnedContexts.push.apply(returnedContexts, contexts);\n }\n if (applicableContexts && applicableContexts.length) {\n returnedContexts.push.apply(returnedContexts, applicableContexts);\n }\n return returnedContexts;\n }\n /**\n * Gets called by every trackXXX method\n * Adds context and payloadPairs name-value pairs to the payload\n * Applies the callback to the built payload\n *\n * @param pb - Payload\n * @param context - Custom contexts relating to the event\n * @param timestamp - Timestamp of the event\n * @return Payload after the callback is applied\n */\n function track(pb, context, timestamp) {\n pb.withJsonProcessor(payloadJsonProcessor(encodeBase64));\n pb.add('eid', v4());\n pb.addDict(payloadPairs);\n var tstamp = getTimestamp(timestamp);\n pb.add(tstamp.type, tstamp.value.toString());\n var allContexts = attachGlobalContexts(pb, pluginContextsHelper.addPluginContexts(context));\n var wrappedContexts = completeContexts(allContexts);\n if (wrappedContexts !== undefined) {\n pb.addJson('cx', 'co', wrappedContexts);\n }\n corePlugins.forEach(function (plugin) {\n try {\n if (plugin.beforeTrack) {\n plugin.beforeTrack(pb);\n }\n }\n catch (ex) {\n LOG.error('Plugin beforeTrack', ex);\n }\n });\n if (typeof callback === 'function') {\n callback(pb);\n }\n var finalPayload = pb.build();\n corePlugins.forEach(function (plugin) {\n try {\n if (plugin.afterTrack) {\n plugin.afterTrack(finalPayload);\n }\n }\n catch (ex) {\n LOG.error('Plugin afterTrack', ex);\n }\n });\n return finalPayload;\n }\n /**\n * Set a persistent key-value pair to be added to every payload\n *\n * @param key - Field name\n * @param value - Field value\n */\n function addPayloadPair(key, value) {\n payloadPairs[key] = value;\n }\n var core = {\n track: track,\n addPayloadPair: addPayloadPair,\n getBase64Encoding: function () {\n return encodeBase64;\n },\n setBase64Encoding: function (encode) {\n encodeBase64 = encode;\n },\n addPayloadDict: function (dict) {\n for (var key in dict) {\n if (Object.prototype.hasOwnProperty.call(dict, key)) {\n payloadPairs[key] = dict[key];\n }\n }\n },\n resetPayloadPairs: function (dict) {\n payloadPairs = isJson(dict) ? dict : {};\n },\n setTrackerVersion: function (version) {\n addPayloadPair('tv', version);\n },\n setTrackerNamespace: function (name) {\n addPayloadPair('tna', name);\n },\n setAppId: function (appId) {\n addPayloadPair('aid', appId);\n },\n setPlatform: function (value) {\n addPayloadPair('p', value);\n },\n setUserId: function (userId) {\n addPayloadPair('uid', userId);\n },\n setScreenResolution: function (width, height) {\n addPayloadPair('res', width + 'x' + height);\n },\n setViewport: function (width, height) {\n addPayloadPair('vp', width + 'x' + height);\n },\n setColorDepth: function (depth) {\n addPayloadPair('cd', depth);\n },\n setTimezone: function (timezone) {\n addPayloadPair('tz', timezone);\n },\n setLang: function (lang) {\n addPayloadPair('lang', lang);\n },\n setIpAddress: function (ip) {\n addPayloadPair('ip', ip);\n },\n setUseragent: function (useragent) {\n addPayloadPair('ua', useragent);\n },\n addGlobalContexts: function (contexts) {\n globalContextsHelper.addGlobalContexts(contexts);\n },\n clearGlobalContexts: function () {\n globalContextsHelper.clearGlobalContexts();\n },\n removeGlobalContexts: function (contexts) {\n globalContextsHelper.removeGlobalContexts(contexts);\n }\n };\n return core;\n }\n var base64 = configuration.base64, corePlugins = configuration.corePlugins, callback = configuration.callback, plugins = corePlugins !== null && corePlugins !== void 0 ? corePlugins : [], partialCore = newCore(base64 !== null && base64 !== void 0 ? base64 : true, plugins, callback), core = __assign(__assign({}, partialCore), { addPlugin: function (configuration) {\n var _a, _b;\n var plugin = configuration.plugin;\n plugins.push(plugin);\n (_a = plugin.logger) === null || _a === void 0 ? void 0 : _a.call(plugin, LOG);\n (_b = plugin.activateCorePlugin) === null || _b === void 0 ? void 0 : _b.call(plugin, core);\n } });\n plugins === null || plugins === void 0 ? void 0 : plugins.forEach(function (plugin) {\n var _a, _b;\n (_a = plugin.logger) === null || _a === void 0 ? void 0 : _a.call(plugin, LOG);\n (_b = plugin.activateCorePlugin) === null || _b === void 0 ? void 0 : _b.call(plugin, core);\n });\n return core;\n}\n/**\n * Build a self-describing event\n * A custom event type, allowing for an event to be tracked using your own custom schema\n * and a data object which conforms to the supplied schema\n *\n * @param event - Contains the properties and schema location for the event\n * @return PayloadBuilder to be sent to {@link Core.track()}\n */\nfunction buildSelfDescribingEvent(event) {\n var _a = event.event, schema = _a.schema, data = _a.data, pb = payloadBuilder();\n var ueJson = {\n schema: 'iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0',\n data: { schema: schema, data: data }\n };\n pb.add('e', 'ue');\n pb.addJson('ue_px', 'ue_pr', ueJson);\n return pb;\n}\n/**\n * Build a Page View Event\n * Represents a Page View, which is typically fired as soon as possible when a web page\n * is loaded within the users browser. Often also fired on \"virtual page views\" within\n * Single Page Applications (SPA).\n *\n * @param event - Contains the properties for the Page View event\n * @return PayloadBuilder to be sent to {@link Core.track()}\n */\nfunction buildPageView(event) {\n var pageUrl = event.pageUrl, pageTitle = event.pageTitle, referrer = event.referrer, pb = payloadBuilder();\n pb.add('e', 'pv'); // 'pv' for Page View\n pb.add('url', pageUrl);\n pb.add('page', pageTitle);\n pb.add('refr', referrer);\n return pb;\n}\n/**\n * Build a Page Ping Event\n * Fires when activity tracking is enabled in the browser.\n * Tracks same information as the last tracked Page View and includes scroll\n * information from the current page view\n *\n * @param event - Contains the properties for the Page Ping event\n * @return PayloadBuilder to be sent to {@link Core.track()}\n */\nfunction buildPagePing(event) {\n var pageUrl = event.pageUrl, pageTitle = event.pageTitle, referrer = event.referrer, minXOffset = event.minXOffset, maxXOffset = event.maxXOffset, minYOffset = event.minYOffset, maxYOffset = event.maxYOffset, pb = payloadBuilder();\n pb.add('e', 'pp'); // 'pp' for Page Ping\n pb.add('url', pageUrl);\n pb.add('page', pageTitle);\n pb.add('refr', referrer);\n if (minXOffset && !isNaN(Number(minXOffset)))\n pb.add('pp_mix', minXOffset.toString());\n if (maxXOffset && !isNaN(Number(maxXOffset)))\n pb.add('pp_max', maxXOffset.toString());\n if (minYOffset && !isNaN(Number(minYOffset)))\n pb.add('pp_miy', minYOffset.toString());\n if (maxYOffset && !isNaN(Number(maxYOffset)))\n pb.add('pp_may', maxYOffset.toString());\n return pb;\n}\n/**\n * Build a Structured Event\n * A classic style of event tracking, allows for easier movement between analytics\n * systems. A loosely typed event, creating a Self Describing event is preferred, but\n * useful for interoperability.\n *\n * @param event - Contains the properties for the Structured event\n * @return PayloadBuilder to be sent to {@link Core.track()}\n */\nfunction buildStructEvent(event) {\n var category = event.category, action = event.action, label = event.label, property = event.property, value = event.value, pb = payloadBuilder();\n pb.add('e', 'se'); // 'se' for Structured Event\n pb.add('se_ca', category);\n pb.add('se_ac', action);\n pb.add('se_la', label);\n pb.add('se_pr', property);\n pb.add('se_va', value == null ? undefined : value.toString());\n return pb;\n}\n/**\n * Build an Ecommerce Transaction Event\n * Allows for tracking common ecommerce events, this event is usually used when\n * a consumer completes a transaction.\n *\n * @param event - Contains the properties for the Ecommerce Transactoion event\n * @return PayloadBuilder to be sent to {@link Core.track()}\n */\nfunction buildEcommerceTransaction(event) {\n var orderId = event.orderId, total = event.total, affiliation = event.affiliation, tax = event.tax, shipping = event.shipping, city = event.city, state = event.state, country = event.country, currency = event.currency, pb = payloadBuilder();\n pb.add('e', 'tr'); // 'tr' for Transaction\n pb.add('tr_id', orderId);\n pb.add('tr_af', affiliation);\n pb.add('tr_tt', total);\n pb.add('tr_tx', tax);\n pb.add('tr_sh', shipping);\n pb.add('tr_ci', city);\n pb.add('tr_st', state);\n pb.add('tr_co', country);\n pb.add('tr_cu', currency);\n return pb;\n}\n/**\n * Build an Ecommerce Transaction Item Event\n * Related to the {@link buildEcommerceTransaction}\n * Each Ecommerce Transaction may contain one or more EcommerceTransactionItem events\n *\n * @param event - Contains the properties for the Ecommerce Transaction Item event\n * @return PayloadBuilder to be sent to {@link Core.track()}\n */\nfunction buildEcommerceTransactionItem(event) {\n var orderId = event.orderId, sku = event.sku, price = event.price, name = event.name, category = event.category, quantity = event.quantity, currency = event.currency, pb = payloadBuilder();\n pb.add('e', 'ti'); // 'tr' for Transaction Item\n pb.add('ti_id', orderId);\n pb.add('ti_sk', sku);\n pb.add('ti_nm', name);\n pb.add('ti_ca', category);\n pb.add('ti_pr', price);\n pb.add('ti_qu', quantity);\n pb.add('ti_cu', currency);\n return pb;\n}\n/**\n * Build a Scren View Event\n * Similar to a Page View but less focused on typical web properties\n * Often used for mobile applications as the user is presented with\n * new views as they performance navigation events\n *\n * @param event - Contains the properties for the Screen View event. One or more properties must be included.\n * @return PayloadBuilder to be sent to {@link Core.track()}\n */\nfunction buildScreenView(event) {\n var name = event.name, id = event.id;\n return buildSelfDescribingEvent({\n event: {\n schema: 'iglu:com.snowplowanalytics.snowplow/screen_view/jsonschema/1-0-0',\n data: removeEmptyProperties({ name: name, id: id })\n }\n });\n}\n/**\n * Build a Link Click Event\n * Used when a user clicks on a link on a webpage, typically an anchor tag <a>\n *\n * @param event - Contains the properties for the Link Click event\n * @return PayloadBuilder to be sent to {@link Core.track()}\n */\nfunction buildLinkClick(event) {\n var targetUrl = event.targetUrl, elementId = event.elementId, elementClasses = event.elementClasses, elementTarget = event.elementTarget, elementContent = event.elementContent;\n var eventJson = {\n schema: 'iglu:com.snowplowanalytics.snowplow/link_click/jsonschema/1-0-1',\n data: removeEmptyProperties({ targetUrl: targetUrl, elementId: elementId, elementClasses: elementClasses, elementTarget: elementTarget, elementContent: elementContent })\n };\n return buildSelfDescribingEvent({ event: eventJson });\n}\n/**\n * Build a Ad Impression Event\n * Used to track an advertisement impression\n *\n * @remark\n * If you provide the cost field, you must also provide one of 'cpa', 'cpc', and 'cpm' for the costModel field.\n *\n * @param event - Contains the properties for the Ad Impression event\n * @return PayloadBuilder to be sent to {@link Core.track()}\n */\nfunction buildAdImpression(event) {\n var impressionId = event.impressionId, costModel = event.costModel, cost = event.cost, targetUrl = event.targetUrl, bannerId = event.bannerId, zoneId = event.zoneId, advertiserId = event.advertiserId, campaignId = event.campaignId;\n var eventJson = {\n schema: 'iglu:com.snowplowanalytics.snowplow/ad_impression/jsonschema/1-0-0',\n data: removeEmptyProperties({\n impressionId: impressionId,\n costModel: costModel,\n cost: cost,\n targetUrl: targetUrl,\n bannerId: bannerId,\n zoneId: zoneId,\n advertiserId: advertiserId,\n campaignId: campaignId\n })\n };\n return buildSelfDescribingEvent({ event: eventJson });\n}\n/**\n * Build a Ad Click Event\n * Used to track an advertisement click\n *\n * @remark\n * If you provide the cost field, you must also provide one of 'cpa', 'cpc', and 'cpm' for the costModel field.\n *\n * @param event - Contains the properties for the Ad Click event\n * @return PayloadBuilder to be sent to {@link Core.track()}\n */\nfunction buildAdClick(event) {\n var targetUrl = event.targetUrl, clickId = event.clickId, costModel = event.costModel, cost = event.cost, bannerId = event.bannerId, zoneId = event.zoneId, impressionId = event.impressionId, advertiserId = event.advertiserId, campaignId = event.campaignId;\n var eventJson = {\n schema: 'iglu:com.snowplowanalytics.snowplow/ad_click/jsonschema/1-0-0',\n data: removeEmptyProperties({\n targetUrl: targetUrl,\n clickId: clickId,\n costModel: costModel,\n cost: cost,\n bannerId: bannerId,\n zoneId: zoneId,\n impressionId: impressionId,\n advertiserId: advertiserId,\n campaignId: campaignId\n })\n };\n return buildSelfDescribingEvent({ event: eventJson });\n}\n/**\n * Build a Ad Conversion Event\n * Used to track an advertisement click\n *\n * @remark\n * If you provide the cost field, you must also provide one of 'cpa', 'cpc', and 'cpm' for the costModel field.\n *\n * @param event - Contains the properties for the Ad Conversion event\n * @return PayloadBuilder to be sent to {@link Core.track()}\n */\nfunction buildAdConversion(event) {\n var conversionId = event.conversionId, costModel = event.costModel, cost = event.cost, category = event.category, action = event.action, property = event.property, initialValue = event.initialValue, advertiserId = event.advertiserId, campaignId = event.campaignId;\n var eventJson = {\n schema: 'iglu:com.snowplowanalytics.snowplow/ad_conversion/jsonschema/1-0-0',\n data: removeEmptyProperties({\n conversionId: conversionId,\n costModel: costModel,\n cost: cost,\n category: category,\n action: action,\n property: property,\n initialValue: initialValue,\n advertiserId: advertiserId,\n campaignId: campaignId\n })\n };\n return buildSelfDescribingEvent({ event: eventJson });\n}\n/**\n * Build a Social Interaction Event\\\n * Social tracking will be used to track the way users interact\n * with Facebook, Twitter and Google + widgets\n * e.g. to capture “like this” or “tweet this” events.\n *\n * @param event - Contains the properties for the Social Interaction event\n * @return PayloadBuilder to be sent to {@link Core.track()}\n */\nfunction buildSocialInteraction(event) {\n var action = event.action, network = event.network, target = event.target;\n var eventJson = {\n schema: 'iglu:com.snowplowanalytics.snowplow/social_interaction/jsonschema/1-0-0',\n data: removeEmptyProperties({ action: action, network: network, target: target })\n };\n return buildSelfDescribingEvent({ event: eventJson });\n}\n/**\n * Build a Add To Cart Event\n * For tracking users adding items from a cart\n * on an ecommerce site.\n *\n * @param event - Contains the properties for the Add To Cart event\n * @return PayloadBuilder to be sent to {@link Core.track()}\n */\nfunction buildAddToCart(event) {\n var sku = event.sku, quantity = event.quantity, name = event.name, category = event.category, unitPrice = event.unitPrice, currency = event.currency;\n return buildSelfDescribingEvent({\n event: {\n schema: 'iglu:com.snowplowanalytics.snowplow/add_to_cart/jsonschema/1-0-0',\n data: removeEmptyProperties({\n sku: sku,\n quantity: quantity,\n name: name,\n category: category,\n unitPrice: unitPrice,\n currency: currency\n })\n }\n });\n}\n/**\n * Build a Remove From Cart Event\n * For tracking users removing items from a cart\n * on an ecommerce site.\n *\n * @param event - Contains the properties for the Remove From Cart event\n * @return PayloadBuilder to be sent to {@link Core.track()}\n */\nfunction buildRemoveFromCart(event) {\n var sku = event.sku, quantity = event.quantity, name = event.name, category = event.category, unitPrice = event.unitPrice, currency = event.currency;\n return buildSelfDescribingEvent({\n event: {\n schema: 'iglu:com.snowplowanalytics.snowplow/remove_from_cart/jsonschema/1-0-0',\n data: removeEmptyProperties({\n sku: sku,\n quantity: quantity,\n name: name,\n category: category,\n unitPrice: unitPrice,\n currency: currency\n })\n }\n });\n}\n/**\n * Build a Form Focus or Change Form Event based on schema property\n * When a user focuses on a form element or when a user makes a\n * change to a form element.\n *\n * @param event - Contains the properties for the Form Focus or Change Form event\n * @return PayloadBuilder to be sent to {@link Core.track()}\n */\nfunction buildFormFocusOrChange(event) {\n var event_schema = '';\n var schema = event.schema, formId = event.formId, elementId = event.elementId, nodeName = event.nodeName, elementClasses = event.elementClasses, value = event.value, type = event.type;\n var event_data = { formId: formId, elementId: elementId, nodeName: nodeName, elementClasses: elementClasses, value: value };\n if (schema === 'change_form') {\n event_schema = 'iglu:com.snowplowanalytics.snowplow/change_form/jsonschema/1-0-0';\n event_data.type = type;\n }\n else if (schema === 'focus_form') {\n event_schema = 'iglu:com.snowplowanalytics.snowplow/focus_form/jsonschema/1-0-0';\n event_data.elementType = type;\n }\n return buildSelfDescribingEvent({\n event: {\n schema: event_schema,\n data: removeEmptyProperties(event_data, { value: true })\n }\n });\n}\n/**\n * Build a Form Submission Event\n * Used to track when a user submits a form\n *\n * @param event - Contains the properties for the Form Submission event\n * @return PayloadBuilder to be sent to {@link Core.track()}\n */\nfunction buildFormSubmission(event) {\n var formId = event.formId, formClasses = event.formClasses, elements = event.elements;\n return buildSelfDescribingEvent({\n event: {\n schema: 'iglu:com.snowplowanalytics.snowplow/submit_form/jsonschema/1-0-0',\n data: removeEmptyProperties({ formId: formId, formClasses: formClasses, elements: elements })\n }\n });\n}\n/**\n * Build a Site Search Event\n * Used when a user performs a search action on a page\n *\n * @param event - Contains the properties for the Site Search event\n * @return PayloadBuilder to be sent to {@link Core.track()}\n */\nfunction buildSiteSearch(event) {\n var terms = event.terms, filters = event.filters, totalResults = event.totalResults, pageResults = event.pageResults;\n return buildSelfDescribingEvent({\n event: {\n schema: 'iglu:com.snowplowanalytics.snowplow/site_search/jsonschema/1-0-0',\n data: removeEmptyProperties({ terms: terms, filters: filters, totalResults: totalResults, pageResults: pageResults })\n }\n });\n}\n/**\n * Build a Consent Withdrawn Event\n * Used for tracking when a user withdraws their consent\n *\n * @param event - Contains the properties for the Consent Withdrawn event\n * @return An object containing the PayloadBuilder to be sent to {@link Core.track()} and a 'consent_document' context\n */\nfunction buildConsentWithdrawn(event) {\n var all = event.all, id = event.id, version = event.version, name = event.name, description = event.description;\n var documentJson = {\n schema: 'iglu:com.snowplowanalytics.snowplow/consent_document/jsonschema/1-0-0',\n data: removeEmptyProperties({ id: id, version: version, name: name, description: description })\n };\n return {\n event: buildSelfDescribingEvent({\n event: {\n schema: 'iglu:com.snowplowanalytics.snowplow/consent_withdrawn/jsonschema/1-0-0',\n data: removeEmptyProperties({\n all: all\n })\n }\n }),\n context: [documentJson]\n };\n}\n/**\n * Build a Consent Granted Event\n * Used for tracking when a user grants their consent\n *\n * @param event - Contains the properties for the Consent Granted event\n * @return An object containing the PayloadBuilder to be sent to {@link Core.track()} and a 'consent_document' context\n */\nfunction buildConsentGranted(event) {\n var expiry = event.expiry, id = event.id, version = event.version, name = event.name, description = event.description;\n var documentJson = {\n schema: 'iglu:com.snowplowanalytics.snowplow/consent_document/jsonschema/1-0-0',\n data: removeEmptyProperties({ id: id, version: version, name: name, description: description })\n };\n return {\n event: buildSelfDescribingEvent({\n event: {\n schema: 'iglu:com.snowplowanalytics.snowplow/consent_granted/jsonschema/1-0-0',\n data: removeEmptyProperties({\n expiry: expiry\n })\n }\n }),\n context: [documentJson]\n };\n}\n/**\n * Returns a copy of a JSON with undefined and null properties removed\n *\n * @param event - JSON object to clean\n * @param exemptFields - Set of fields which should not be removed even if empty\n * @return A cleaned copy of eventJson\n */\nfunction removeEmptyProperties(event, exemptFields) {\n if (exemptFields === void 0) { exemptFields = {}; }\n var ret = {};\n for (var k in event) {\n if (exemptFields[k] || (event[k] !== null && typeof event[k] !== 'undefined')) {\n ret[k] = event[k];\n }\n }\n return ret;\n}\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nvar version = version$1;\n\nexport { LOG, LOG_LEVEL, buildAdClick, buildAdConversion, buildAdImpression, buildAddToCart, buildConsentGranted, buildConsentWithdrawn, buildEcommerceTransaction, buildEcommerceTransactionItem, buildFormFocusOrChange, buildFormSubmission, buildLinkClick, buildPagePing, buildPageView, buildRemoveFromCart, buildScreenView, buildSelfDescribingEvent, buildSiteSearch, buildSocialInteraction, buildStructEvent, getRuleParts, getSchemaParts, globalContexts, isConditionalContextProvider, isContextCallbackFunction, isContextPrimitive, isFilterProvider, isJson, isNonEmptyJson, isRuleSet, isRuleSetProvider, isSelfDescribingJson, isStringArray, isValidRule, isValidRuleSetArg, matchSchemaAgainstRule, matchSchemaAgainstRuleSet, payloadBuilder, payloadJsonProcessor, pluginContexts, resolveDynamicContext, trackerCore, validateVendor, validateVendorParts, version };\n//# sourceMappingURL=index.module.js.map\n","/*!\n * Core functionality for Snowplow Browser trackers v3.1.0 (http://bit.ly/sp-js)\n * Copyright 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * Licensed under BSD-3-Clause\n */\n\nimport { LOG, trackerCore, buildPageView, buildPagePing } from '@snowplow/tracker-core';\nimport { __assign } from 'tslib';\nimport hash from 'sha1';\nimport { v4 } from 'uuid';\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n/*\n * Checks whether sessionStorage is available, in a way that\n * does not throw a SecurityError in Firefox if \"always ask\"\n * is enabled for cookies (https://github.com/snowplow/snowplow/issues/163).\n */\nfunction hasSessionStorage() {\n try {\n return !!window.sessionStorage;\n }\n catch (e) {\n return true; // SecurityError when referencing it means it exists\n }\n}\n/*\n * Checks whether localStorage is available, in a way that\n * does not throw a SecurityError in Firefox if \"always ask\"\n * is enabled for cookies (https://github.com/snowplow/snowplow/issues/163).\n */\nfunction hasLocalStorage() {\n try {\n return !!window.localStorage;\n }\n catch (e) {\n return true; // SecurityError when referencing it means it exists\n }\n}\n/*\n * Checks whether localStorage is accessible\n * sets and removes an item to handle private IOS5 browsing\n * (http://git.io/jFB2Xw)\n */\nfunction localStorageAccessible() {\n var mod = 'modernizr';\n if (!hasLocalStorage()) {\n return false;\n }\n try {\n var ls = window.localStorage;\n ls.setItem(mod, mod);\n ls.removeItem(mod);\n return true;\n }\n catch (e) {\n return false;\n }\n}\n/**\n * Gets the current viewport.\n *\n * Code based on:\n * - http://andylangton.co.uk/articles/javascript/get-viewport-size-javascript/\n * - http://responsejs.com/labs/dimensions/\n */\nfunction detectViewport() {\n var width, height;\n if ('innerWidth' in window) {\n width = window['innerWidth'];\n height = window['innerHeight'];\n }\n else {\n var e = document.documentElement || document.body;\n width = e['clientWidth'];\n height = e['clientHeight'];\n }\n if (width >= 0 && height >= 0) {\n return width + 'x' + height;\n }\n else {\n return null;\n }\n}\n/**\n * Gets the dimensions of the current\n * document.\n *\n * Code based on:\n * - http://andylangton.co.uk/articles/javascript/get-viewport-size-javascript/\n */\nfunction detectDocumentSize() {\n var de = document.documentElement, // Alias\n be = document.body, \n // document.body may not have rendered, so check whether be.offsetHeight is null\n bodyHeight = be ? Math.max(be.offsetHeight, be.scrollHeight) : 0;\n var w = Math.max(de.clientWidth, de.offsetWidth, de.scrollWidth);\n var h = Math.max(de.clientHeight, de.offsetHeight, de.scrollHeight, bodyHeight);\n return isNaN(w) || isNaN(h) ? '' : w + 'x' + h;\n}\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * Checks if an object is a string\n * @param str - The object to check\n */\nfunction isString(str) {\n if (str && typeof str.valueOf() === 'string') {\n return true;\n }\n return false;\n}\n/**\n * Checks if an object is an integer\n * @param int - The object to check\n */\nfunction isInteger(int) {\n return ((Number.isInteger && Number.isInteger(int)) || (typeof int === 'number' && isFinite(int) && Math.floor(int) === int));\n}\n/**\n * Checks if the input parameter is a function\n * @param func - The object to check\n */\nfunction isFunction(func) {\n if (func && typeof func === 'function') {\n return true;\n }\n return false;\n}\n/**\n * Cleans up the page title\n */\nfunction fixupTitle(title) {\n if (!isString(title)) {\n title = title.text || '';\n var tmp = document.getElementsByTagName('title');\n if (tmp && tmp[0] != null) {\n title = tmp[0].text;\n }\n }\n return title;\n}\n/**\n * Extract hostname from URL\n */\nfunction getHostName(url) {\n // scheme : // [username [: password] @] hostname [: port] [/ [path] [? query] [# fragment]]\n var e = new RegExp('^(?:(?:https?|ftp):)/*(?:[^@]+@)?([^:/#]+)'), matches = e.exec(url);\n return matches ? matches[1] : url;\n}\n/**\n * Fix-up domain\n */\nfunction fixupDomain(domain) {\n var dl = domain.length;\n // remove trailing '.'\n if (domain.charAt(--dl) === '.') {\n domain = domain.slice(0, dl);\n }\n // remove leading '*'\n if (domain.slice(0, 2) === '*.') {\n domain = domain.slice(1);\n }\n return domain;\n}\n/**\n * Get page referrer. In the case of a single-page app,\n * if the URL changes without the page reloading, pass\n * in the old URL. It will be returned unless overriden\n * by a \"refer(r)er\" parameter in the querystring.\n *\n * @param string - oldLocation Optional.\n * @return string The referrer\n */\nfunction getReferrer(oldLocation) {\n var windowAlias = window, referrer = '', fromQs = fromQuerystring('referrer', windowAlias.location.href) || fromQuerystring('referer', windowAlias.location.href);\n // Short-circuit\n if (fromQs) {\n return fromQs;\n }\n // In the case of a single-page app, return the old URL\n if (oldLocation) {\n return oldLocation;\n }\n try {\n referrer = windowAlias.top.document.referrer;\n }\n catch (e) {\n if (windowAlias.parent) {\n try {\n referrer = windowAlias.parent.document.referrer;\n }\n catch (e2) {\n referrer = '';\n }\n }\n }\n if (referrer === '') {\n referrer = document.referrer;\n }\n return referrer;\n}\n/**\n * Cross-browser helper function to add event handler\n */\nfunction addEventListener(element, eventType, eventHandler, options) {\n if (element.addEventListener) {\n element.addEventListener(eventType, eventHandler, options);\n return true;\n }\n // IE Support\n if (element.attachEvent) {\n return element.attachEvent('on' + eventType, eventHandler);\n }\n element['on' + eventType] = eventHandler;\n}\n/**\n * Return value from name-value pair in querystring\n */\nfunction fromQuerystring(field, url) {\n var match = new RegExp('^[^#]*[?&]' + field + '=([^&#]*)').exec(url);\n if (!match) {\n return null;\n }\n return decodeURIComponent(match[1].replace(/\\+/g, ' '));\n}\n/**\n * Add a name-value pair to the querystring of a URL\n *\n * @param string - url URL to decorate\n * @param string - name Name of the querystring pair\n * @param string - value Value of the querystring pair\n */\nfunction decorateQuerystring(url, name, value) {\n var initialQsParams = name + '=' + value;\n var hashSplit = url.split('#');\n var qsSplit = hashSplit[0].split('?');\n var beforeQuerystring = qsSplit.shift();\n // Necessary because a querystring may contain multiple question marks\n var querystring = qsSplit.join('?');\n if (!querystring) {\n querystring = initialQsParams;\n }\n else {\n // Whether this is the first time the link has been decorated\n var initialDecoration = true;\n var qsFields = querystring.split('&');\n for (var i = 0; i < qsFields.length; i++) {\n if (qsFields[i].substr(0, name.length + 1) === name + '=') {\n initialDecoration = false;\n qsFields[i] = initialQsParams;\n querystring = qsFields.join('&');\n break;\n }\n }\n if (initialDecoration) {\n querystring = initialQsParams + '&' + querystring;\n }\n }\n hashSplit[0] = beforeQuerystring + '?' + querystring;\n return hashSplit.join('#');\n}\n/**\n * Attempt to get a value from localStorage\n *\n * @param string - key\n * @return string The value obtained from localStorage, or\n * undefined if localStorage is inaccessible\n */\nfunction attemptGetLocalStorage(key) {\n try {\n var localStorageAlias = window.localStorage, exp = localStorageAlias.getItem(key + '.expires');\n if (exp === null || +exp > Date.now()) {\n return localStorageAlias.getItem(key);\n }\n else {\n localStorageAlias.removeItem(key);\n localStorageAlias.removeItem(key + '.expires');\n }\n return undefined;\n }\n catch (e) {\n return undefined;\n }\n}\n/**\n * Attempt to write a value to localStorage\n *\n * @param string - key\n * @param string - value\n * @param number - ttl Time to live in seconds, defaults to 2 years from Date.now()\n * @return boolean Whether the operation succeeded\n */\nfunction attemptWriteLocalStorage(key, value, ttl) {\n if (ttl === void 0) { ttl = 63072000; }\n try {\n var localStorageAlias = window.localStorage, t = Date.now() + ttl * 1000;\n localStorageAlias.setItem(key + \".expires\", t.toString());\n localStorageAlias.setItem(key, value);\n return true;\n }\n catch (e) {\n return false;\n }\n}\n/**\n * Attempt to delete a value from localStorage\n *\n * @param string - key\n * @return boolean Whether the operation succeeded\n */\nfunction attemptDeleteLocalStorage(key) {\n try {\n var localStorageAlias = window.localStorage;\n localStorageAlias.removeItem(key);\n localStorageAlias.removeItem(key + '.expires');\n return true;\n }\n catch (e) {\n return false;\n }\n}\n/**\n * Attempt to get a value from sessionStorage\n *\n * @param string - key\n * @return string The value obtained from sessionStorage, or\n * undefined if sessionStorage is inaccessible\n */\nfunction attemptGetSessionStorage(key) {\n try {\n return window.sessionStorage.getItem(key);\n }\n catch (e) {\n return undefined;\n }\n}\n/**\n * Attempt to write a value to sessionStorage\n *\n * @param string - key\n * @param string - value\n * @return boolean Whether the operation succeeded\n */\nfunction attemptWriteSessionStorage(key, value) {\n try {\n window.sessionStorage.setItem(key, value);\n return true;\n }\n catch (e) {\n return false;\n }\n}\n/**\n * Finds the root domain\n */\nfunction findRootDomain(sameSite, secure) {\n var windowLocationHostnameAlias = window.location.hostname, cookiePrefix = '_sp_root_domain_test_', cookieName = cookiePrefix + new Date().getTime(), cookieValue = '_test_value_' + new Date().getTime();\n var split = windowLocationHostnameAlias.split('.');\n var position = split.length - 1;\n while (position >= 0) {\n var currentDomain = split.slice(position, split.length).join('.');\n cookie(cookieName, cookieValue, 0, '/', currentDomain, sameSite, secure);\n if (cookie(cookieName) === cookieValue) {\n // Clean up created cookie(s)\n deleteCookie(cookieName, currentDomain, sameSite, secure);\n var cookieNames = getCookiesWithPrefix(cookiePrefix);\n for (var i = 0; i < cookieNames.length; i++) {\n deleteCookie(cookieNames[i], currentDomain, sameSite, secure);\n }\n return currentDomain;\n }\n position -= 1;\n }\n // Cookies cannot be read\n return windowLocationHostnameAlias;\n}\n/**\n * Checks whether a value is present within an array\n *\n * @param val - The value to check for\n * @param array - The array to check within\n * @return boolean Whether it exists\n */\nfunction isValueInArray(val, array) {\n for (var i = 0; i < array.length; i++) {\n if (array[i] === val) {\n return true;\n }\n }\n return false;\n}\n/**\n * Deletes an arbitrary cookie by setting the expiration date to the past\n *\n * @param cookieName - The name of the cookie to delete\n * @param domainName - The domain the cookie is in\n */\nfunction deleteCookie(cookieName, domainName, sameSite, secure) {\n cookie(cookieName, '', -1, '/', domainName, sameSite, secure);\n}\n/**\n * Fetches the name of all cookies beginning with a certain prefix\n *\n * @param cookiePrefix - The prefix to check for\n * @return array The cookies that begin with the prefix\n */\nfunction getCookiesWithPrefix(cookiePrefix) {\n var cookies = document.cookie.split('; ');\n var cookieNames = [];\n for (var i = 0; i < cookies.length; i++) {\n if (cookies[i].substring(0, cookiePrefix.length) === cookiePrefix) {\n cookieNames.push(cookies[i]);\n }\n }\n return cookieNames;\n}\n/**\n * Get and set the cookies associated with the current document in browser\n * This implementation always returns a string, returns the cookie value if only name is specified\n *\n * @param name - The cookie name (required)\n * @param value - The cookie value\n * @param ttl - The cookie Time To Live (seconds)\n * @param path - The cookies path\n * @param domain - The cookies domain\n * @param samesite - The cookies samesite attribute\n * @param secure - Boolean to specify if cookie should be secure\n * @return string The cookies value\n */\nfunction cookie(name, value, ttl, path, domain, samesite, secure) {\n if (arguments.length > 1) {\n return (document.cookie =\n name +\n '=' +\n encodeURIComponent(value !== null && value !== void 0 ? value : '') +\n (ttl ? '; Expires=' + new Date(+new Date() + ttl * 1000).toUTCString() : '') +\n (path ? '; Path=' + path : '') +\n (domain ? '; Domain=' + domain : '') +\n (samesite ? '; SameSite=' + samesite : '') +\n (secure ? '; Secure' : ''));\n }\n return decodeURIComponent((('; ' + document.cookie).split('; ' + name + '=')[1] || '').split(';')[0]);\n}\n/**\n * Parses an object and returns either the\n * integer or undefined.\n *\n * @param obj - The object to parse\n * @return the result of the parse operation\n */\nfunction parseAndValidateInt(obj) {\n var result = parseInt(obj);\n return isNaN(result) ? undefined : result;\n}\n/**\n * Parses an object and returns either the\n * number or undefined.\n *\n * @param obj - The object to parse\n * @return the result of the parse operation\n */\nfunction parseAndValidateFloat(obj) {\n var result = parseFloat(obj);\n return isNaN(result) ? undefined : result;\n}\n/**\n * Convert a criterion object to a filter function\n *\n * @param object - criterion Either {allowlist: [array of allowable strings]}\n * or {denylist: [array of allowable strings]}\n * or {filter: function (elt) {return whether to track the element}\n * @param boolean - byClass Whether to allowlist/denylist based on an element's classes (for forms)\n * or name attribute (for fields)\n */\nfunction getFilterByClass(criterion) {\n // If the criterion argument is not an object, add listeners to all elements\n if (criterion == null || typeof criterion !== 'object' || Array.isArray(criterion)) {\n return function () {\n return true;\n };\n }\n var inclusive = Object.prototype.hasOwnProperty.call(criterion, 'allowlist');\n var specifiedClassesSet = getSpecifiedClassesSet(criterion);\n return getFilter(criterion, function (elt) {\n return checkClass(elt, specifiedClassesSet) === inclusive;\n });\n}\n/**\n * Convert a criterion object to a filter function\n *\n * @param object - criterion Either {allowlist: [array of allowable strings]}\n * or {denylist: [array of allowable strings]}\n * or {filter: function (elt) {return whether to track the element}\n */\nfunction getFilterByName(criterion) {\n // If the criterion argument is not an object, add listeners to all elements\n if (criterion == null || typeof criterion !== 'object' || Array.isArray(criterion)) {\n return function () {\n return true;\n };\n }\n var inclusive = criterion.hasOwnProperty('allowlist');\n var specifiedClassesSet = getSpecifiedClassesSet(criterion);\n return getFilter(criterion, function (elt) {\n return elt.name in specifiedClassesSet === inclusive;\n });\n}\n/**\n * List the classes of a DOM element without using elt.classList (for compatibility with IE 9)\n */\nfunction getCssClasses(elt) {\n return elt.className.match(/\\S+/g) || [];\n}\n/**\n * Check whether an element has at least one class from a given list\n */\nfunction checkClass(elt, classList) {\n var classes = getCssClasses(elt);\n for (var _i = 0, classes_1 = classes; _i < classes_1.length; _i++) {\n var className = classes_1[_i];\n if (classList[className]) {\n return true;\n }\n }\n return false;\n}\nfunction getFilter(criterion, fallbackFilter) {\n if (criterion.hasOwnProperty('filter') && criterion.filter) {\n return criterion.filter;\n }\n return fallbackFilter;\n}\nfunction getSpecifiedClassesSet(criterion) {\n // Convert the array of classes to an object of the form {class1: true, class2: true, ...}\n var specifiedClassesSet = {};\n var specifiedClasses = criterion.allowlist || criterion.denylist;\n if (specifiedClasses) {\n if (!Array.isArray(specifiedClasses)) {\n specifiedClasses = [specifiedClasses];\n }\n for (var i = 0; i < specifiedClasses.length; i++) {\n specifiedClassesSet[specifiedClasses[i]] = true;\n }\n }\n return specifiedClassesSet;\n}\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * Object handling sending events to a collector.\n * Instantiated once per tracker instance.\n *\n * @param id - The Snowplow function name (used to generate the localStorage key)\n * @param sharedSate - Stores reference to the outbound queue so it can unload the page when all queues are empty\n * @param useLocalStorage - Whether to use localStorage at all\n * @param eventMethod - if null will use 'beacon' otherwise can be set to 'post', 'get', or 'beacon' to force.\n * @param postPath - The path where events are to be posted\n * @param bufferSize - How many events to batch in localStorage before sending them all\n * @param maxPostBytes - Maximum combined size in bytes of the event JSONs in a POST request\n * @param useStm - Whether to add timestamp to events\n * @param maxLocalStorageQueueSize - Maximum number of queued events we will attempt to store in local storage\n * @param connectionTimeout - Defines how long to wait before aborting the request\n * @param anonymousTracking - Defines whether to set the SP-Anonymous header for anonymous tracking on GET and POST\n * @returns object OutQueueManager instance\n */\nfunction OutQueueManager(id, sharedSate, useLocalStorage, eventMethod, postPath, bufferSize, maxPostBytes, useStm, maxLocalStorageQueueSize, connectionTimeout, anonymousTracking) {\n var executingQueue = false, configCollectorUrl, outQueue = [];\n //Force to lower case if its a string\n eventMethod = typeof eventMethod === 'string' ? eventMethod.toLowerCase() : eventMethod;\n // Use the Beacon API if eventMethod is set null, true, or 'beacon'.\n var localStorageAlias = window.localStorage, navigatorAlias = window.navigator, isBeaconRequested = eventMethod === null || eventMethod === true || eventMethod === 'beacon' || eventMethod === 'true', \n // Fall back to POST or GET for browsers which don't support Beacon API\n isBeaconAvailable = Boolean(isBeaconRequested && navigatorAlias && navigatorAlias.sendBeacon && !hasWebKitBeaconBug(navigatorAlias.userAgent)), useBeacon = isBeaconAvailable && isBeaconRequested, \n // Use GET if specified\n isGetRequested = eventMethod === 'get', \n // Don't use XhrHttpRequest for browsers which don't support CORS XMLHttpRequests (e.g. IE <= 9)\n useXhr = Boolean(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()), \n // Use POST if specified\n usePost = !isGetRequested && useXhr && (eventMethod === 'post' || isBeaconRequested), \n // Resolve all options and capabilities and decide path\n path = usePost ? postPath : '/i', \n // Different queue names for GET and POST since they are stored differently\n queueName = \"snowplowOutQueue_\" + id + \"_\" + (usePost ? 'post2' : 'get');\n // Get buffer size or set 1 if unable to buffer\n bufferSize = (localStorageAccessible() && useLocalStorage && usePost && bufferSize) || 1;\n if (useLocalStorage) {\n // Catch any JSON parse errors or localStorage that might be thrown\n try {\n var localStorageQueue = localStorageAlias.getItem(queueName);\n outQueue = localStorageQueue ? JSON.parse(localStorageQueue) : [];\n }\n catch (e) { }\n }\n // Initialize to and empty array if we didn't get anything out of localStorage\n if (!Array.isArray(outQueue)) {\n outQueue = [];\n }\n // Used by pageUnloadGuard\n sharedSate.outQueues.push(outQueue);\n if (useXhr && bufferSize > 1) {\n sharedSate.bufferFlushers.push(function (sync) {\n if (!executingQueue) {\n executeQueue(sync);\n }\n });\n }\n /*\n * Convert a dictionary to a querystring\n * The context field is the last in the querystring\n */\n function getQuerystring(request) {\n var querystring = '?', lowPriorityKeys = { co: true, cx: true }, firstPair = true;\n for (var key in request) {\n if (request.hasOwnProperty(key) && !lowPriorityKeys.hasOwnProperty(key)) {\n if (!firstPair) {\n querystring += '&';\n }\n else {\n firstPair = false;\n }\n querystring += encodeURIComponent(key) + '=' + encodeURIComponent(request[key]);\n }\n }\n for (var contextKey in lowPriorityKeys) {\n if (request.hasOwnProperty(contextKey) && lowPriorityKeys.hasOwnProperty(contextKey)) {\n querystring += '&' + contextKey + '=' + encodeURIComponent(request[contextKey]);\n }\n }\n return querystring;\n }\n /*\n * Convert numeric fields to strings to match payload_data schema\n */\n function getBody(request) {\n var cleanedRequest = Object.keys(request)\n .map(function (k) { return [k, request[k]]; })\n .reduce(function (acc, _a) {\n var key = _a[0], value = _a[1];\n acc[key] = value.toString();\n return acc;\n }, {});\n return {\n evt: cleanedRequest,\n bytes: getUTF8Length(JSON.stringify(cleanedRequest))\n };\n }\n /**\n * Count the number of bytes a string will occupy when UTF-8 encoded\n * Taken from http://stackoverflow.com/questions/2848462/count-bytes-in-textarea-using-javascript/\n *\n * @param string - s\n * @return number Length of s in bytes when UTF-8 encoded\n */\n function getUTF8Length(s) {\n var len = 0;\n for (var i = 0; i < s.length; i++) {\n var code = s.charCodeAt(i);\n if (code <= 0x7f) {\n len += 1;\n }\n else if (code <= 0x7ff) {\n len += 2;\n }\n else if (code >= 0xd800 && code <= 0xdfff) {\n // Surrogate pair: These take 4 bytes in UTF-8 and 2 chars in UCS-2\n // (Assume next char is the other [valid] half and just skip it)\n len += 4;\n i++;\n }\n else if (code < 0xffff) {\n len += 3;\n }\n else {\n len += 4;\n }\n }\n return len;\n }\n var postable = function (queue) {\n return typeof queue[0] === 'object';\n };\n /*\n * Queue for submission to the collector and start processing queue\n */\n function enqueueRequest(request, url) {\n configCollectorUrl = url + path;\n if (usePost) {\n var body = getBody(request);\n if (body.bytes >= maxPostBytes) {\n LOG.warn('Event (' + body.bytes + 'B) too big, max is ' + maxPostBytes);\n var xhr = initializeXMLHttpRequest(configCollectorUrl, true, false);\n xhr.send(encloseInPayloadDataEnvelope(attachStmToEvent([body.evt])));\n return;\n }\n else {\n outQueue.push(body);\n }\n }\n else {\n outQueue.push(getQuerystring(request));\n }\n var savedToLocalStorage = false;\n if (useLocalStorage) {\n savedToLocalStorage = attemptWriteLocalStorage(queueName, JSON.stringify(outQueue.slice(0, maxLocalStorageQueueSize)));\n }\n // If we're not processing the queue, we'll start.\n if (!executingQueue && (!savedToLocalStorage || outQueue.length >= bufferSize)) {\n executeQueue();\n }\n }\n /*\n * Run through the queue of requests, sending them one at a time.\n * Stops processing when we run out of queued requests, or we get an error.\n */\n function executeQueue(sync) {\n if (sync === void 0) { sync = false; }\n // Failsafe in case there is some way for a bad value like \"null\" to end up in the outQueue\n while (outQueue.length && typeof outQueue[0] !== 'string' && typeof outQueue[0] !== 'object') {\n outQueue.shift();\n }\n if (outQueue.length < 1) {\n executingQueue = false;\n return;\n }\n // Let's check that we have a URL\n if (!isString(configCollectorUrl)) {\n throw 'No collector configured';\n }\n executingQueue = true;\n if (useXhr) {\n // Keep track of number of events to delete from queue\n var chooseHowManyToSend = function (queue) {\n var numberToSend = 0, byteCount = 0;\n while (numberToSend < queue.length) {\n byteCount += queue[numberToSend].bytes;\n if (byteCount >= maxPostBytes) {\n break;\n }\n else {\n numberToSend += 1;\n }\n }\n return numberToSend;\n };\n var url = void 0, xhr_1, numberToSend_1;\n if (postable(outQueue)) {\n url = configCollectorUrl;\n xhr_1 = initializeXMLHttpRequest(url, true, sync);\n numberToSend_1 = chooseHowManyToSend(outQueue);\n }\n else {\n url = createGetUrl(outQueue[0]);\n xhr_1 = initializeXMLHttpRequest(url, false, sync);\n numberToSend_1 = 1;\n }\n // Time out POST requests after connectionTimeout\n var xhrTimeout_1 = setTimeout(function () {\n xhr_1.abort();\n executingQueue = false;\n }, connectionTimeout);\n // The events (`numberToSend` of them), have been sent, so we remove them from the outQueue\n // We also call executeQueue() again, to let executeQueue() check if we should keep running through the queue\n var onPostSuccess_1 = function (numberToSend) {\n for (var deleteCount = 0; deleteCount < numberToSend; deleteCount++) {\n outQueue.shift();\n }\n if (useLocalStorage) {\n attemptWriteLocalStorage(queueName, JSON.stringify(outQueue.slice(0, maxLocalStorageQueueSize)));\n }\n executeQueue();\n };\n xhr_1.onreadystatechange = function () {\n if (xhr_1.readyState === 4 && xhr_1.status >= 200 && xhr_1.status < 400) {\n clearTimeout(xhrTimeout_1);\n onPostSuccess_1(numberToSend_1);\n }\n else if (xhr_1.readyState === 4 && xhr_1.status >= 400) {\n clearTimeout(xhrTimeout_1);\n executingQueue = false;\n }\n };\n if (!postable(outQueue)) {\n // If not postable then it's a GET so just send it\n xhr_1.send();\n }\n else {\n var batch = outQueue.slice(0, numberToSend_1);\n if (batch.length > 0) {\n var beaconStatus = false;\n var eventBatch = batch.map(function (x) {\n return x.evt;\n });\n if (useBeacon) {\n var blob = new Blob([encloseInPayloadDataEnvelope(attachStmToEvent(eventBatch))], {\n type: 'application/json'\n });\n try {\n beaconStatus = navigator.sendBeacon(url, blob);\n }\n catch (error) {\n beaconStatus = false;\n }\n }\n // When beaconStatus is true, we can't _guarantee_ that it was successful (beacon queues asynchronously)\n // but the browser has taken it out of our hands, so we want to flush the queue assuming it will do its job\n if (beaconStatus === true) {\n onPostSuccess_1(numberToSend_1);\n }\n else {\n xhr_1.send(encloseInPayloadDataEnvelope(attachStmToEvent(eventBatch)));\n }\n }\n }\n }\n else if (!anonymousTracking && !postable(outQueue)) {\n // We can't send with this technique if anonymous tracking is on as we can't attach the header\n var image = new Image(1, 1), loading_1 = true;\n image.onload = function () {\n if (!loading_1)\n return;\n loading_1 = false;\n outQueue.shift();\n if (useLocalStorage) {\n attemptWriteLocalStorage(queueName, JSON.stringify(outQueue.slice(0, maxLocalStorageQueueSize)));\n }\n executeQueue();\n };\n image.onerror = function () {\n if (!loading_1)\n return;\n loading_1 = false;\n executingQueue = false;\n };\n image.src = createGetUrl(outQueue[0]);\n setTimeout(function () {\n if (loading_1 && executingQueue) {\n loading_1 = false;\n executeQueue();\n }\n }, connectionTimeout);\n }\n else {\n executingQueue = false;\n }\n }\n /**\n * Open an XMLHttpRequest for a given endpoint with the correct credentials and header\n *\n * @param string - url The destination URL\n * @return object The XMLHttpRequest\n */\n function initializeXMLHttpRequest(url, post, sync) {\n var xhr = new XMLHttpRequest();\n if (post) {\n xhr.open('POST', url, !sync);\n xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');\n }\n else {\n xhr.open('GET', url, !sync);\n }\n xhr.withCredentials = true;\n if (anonymousTracking) {\n xhr.setRequestHeader('SP-Anonymous', '*');\n }\n return xhr;\n }\n /**\n * Enclose an array of events in a self-describing payload_data JSON string\n *\n * @param array - events Batch of events\n * @return string payload_data self-describing JSON\n */\n function encloseInPayloadDataEnvelope(events) {\n return JSON.stringify({\n schema: 'iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4',\n data: events\n });\n }\n /**\n * Attaches the STM field to outbound POST events.\n *\n * @param events - the events to attach the STM to\n */\n function attachStmToEvent(events) {\n var stm = new Date().getTime().toString();\n for (var i = 0; i < events.length; i++) {\n events[i]['stm'] = stm;\n }\n return events;\n }\n /**\n * Creates the full URL for sending the GET request. Will append `stm` if enabled\n *\n * @param nextRequest - the query string of the next request\n */\n function createGetUrl(nextRequest) {\n if (useStm) {\n return configCollectorUrl + nextRequest.replace('?', '?stm=' + new Date().getTime() + '&');\n }\n return configCollectorUrl + nextRequest;\n }\n return {\n enqueueRequest: enqueueRequest,\n executeQueue: function () {\n if (!executingQueue) {\n executeQueue();\n }\n },\n setUseLocalStorage: function (localStorage) {\n useLocalStorage = localStorage;\n },\n setAnonymousTracking: function (anonymous) {\n anonymousTracking = anonymous;\n },\n setCollectorUrl: function (url) {\n configCollectorUrl = url + path;\n },\n setBufferSize: function (newBufferSize) {\n bufferSize = newBufferSize;\n }\n };\n function hasWebKitBeaconBug(useragent) {\n return (isIosVersionLessThanOrEqualTo(13, useragent) ||\n (isMacosxVersionLessThanOrEqualTo(10, 15, useragent) && isSafari(useragent)));\n function isIosVersionLessThanOrEqualTo(major, useragent) {\n var match = useragent.match('(iP.+; CPU .*OS (d+)[_d]*.*) AppleWebKit/');\n if (match && match.length) {\n return parseInt(match[0]) <= major;\n }\n return false;\n }\n function isMacosxVersionLessThanOrEqualTo(major, minor, useragent) {\n var match = useragent.match('(Macintosh;.*Mac OS X (d+)_(d+)[_d]*.*) AppleWebKit/');\n if (match && match.length) {\n return parseInt(match[0]) <= major || (parseInt(match[0]) === major && parseInt(match[1]) <= minor);\n }\n return false;\n }\n function isSafari(useragent) {\n return useragent.match('Version/.* Safari/') && !isChromiumBased(useragent);\n }\n function isChromiumBased(useragent) {\n return useragent.match('Chrom(e|ium)');\n }\n }\n}\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n/*\n * Extract parameter from URL\n */\nfunction getParameter(url, name) {\n // scheme : // [username [: password] @] hostname [: port] [/ [path] [? query] [# fragment]]\n var e = new RegExp('^(?:https?|ftp)(?::/*(?:[^?]+))([?][^#]+)'), matches = e.exec(url);\n if (matches && (matches === null || matches === void 0 ? void 0 : matches.length) > 1) {\n return fromQuerystring(name, matches[1]);\n }\n return null;\n}\n/*\n * Fix-up URL when page rendered from search engine cache or translated page.\n */\nfunction fixupUrl(hostName, href, referrer) {\n var _a;\n if (hostName === 'translate.googleusercontent.com') {\n // Google\n if (referrer === '') {\n referrer = href;\n }\n href = (_a = getParameter(href, 'u')) !== null && _a !== void 0 ? _a : '';\n hostName = getHostName(href);\n }\n else if (hostName === 'cc.bingj.com' || // Bing & Yahoo\n hostName === 'webcache.googleusercontent.com' // Google\n ) {\n href = document.links[0].href;\n hostName = getHostName(href);\n }\n return [hostName, href, referrer];\n}\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * The Snowplow Tracker\n *\n * @param trackerId - The unique identifier of the tracker\n * @param namespace - The namespace of the tracker object\n * @param version - The current version of the JavaScript Tracker\n * @param endpoint - The collector endpoint to send events to, with or without protocol\n * @param sharedState - An object containing state which is shared across tracker instances\n * @param trackerConfiguration - Dictionary of configuration options\n */\nfunction Tracker(trackerId, namespace, version, endpoint, sharedState, trackerConfiguration) {\n var _a;\n if (trackerConfiguration === void 0) { trackerConfiguration = {}; }\n var newTracker = function (trackerId, namespace, version, endpoint, state, trackerConfiguration) {\n /************************************************************\n * Private members\n ************************************************************/\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;\n //use POST if eventMethod isn't present on the newTrackerConfiguration\n trackerConfiguration.eventMethod = (_a = trackerConfiguration.eventMethod) !== null && _a !== void 0 ? _a : 'post';\n var getStateStorageStrategy = function (config) { var _a; return (_a = config.stateStorageStrategy) !== null && _a !== void 0 ? _a : 'cookieAndLocalStorage'; }, getAnonymousSessionTracking = function (config) {\n var _a, _b;\n if (typeof config.anonymousTracking === 'boolean') {\n return false;\n }\n return (_b = ((_a = config.anonymousTracking) === null || _a === void 0 ? void 0 : _a.withSessionTracking) === true) !== null && _b !== void 0 ? _b : false;\n }, getAnonymousServerTracking = function (config) {\n var _a, _b;\n if (typeof config.anonymousTracking === 'boolean') {\n return false;\n }\n return (_b = ((_a = config.anonymousTracking) === null || _a === void 0 ? void 0 : _a.withServerAnonymisation) === true) !== null && _b !== void 0 ? _b : false;\n }, getAnonymousTracking = function (config) { return !!config.anonymousTracking; };\n // Get all injected plugins\n trackerConfiguration.plugins = (_b = trackerConfiguration.plugins) !== null && _b !== void 0 ? _b : [];\n if ((_d = (_c = trackerConfiguration === null || trackerConfiguration === void 0 ? void 0 : trackerConfiguration.contexts) === null || _c === void 0 ? void 0 : _c.webPage) !== null && _d !== void 0 ? _d : true) {\n trackerConfiguration.plugins.push(getWebPagePlugin()); // Defaults to including the Web Page context\n }\n var // Tracker core\n core = trackerCore({\n base64: trackerConfiguration.encodeBase64,\n corePlugins: trackerConfiguration.plugins,\n callback: function (payloadBuilder) {\n addBrowserData(payloadBuilder);\n sendRequest(payloadBuilder);\n }\n }), \n // Aliases\n browserLanguage = navigator.userLanguage || navigator.language, documentCharset = document.characterSet || document.charset, \n // Current URL and Referrer URL\n locationArray = fixupUrl(window.location.hostname, window.location.href, getReferrer()), domainAlias = fixupDomain(locationArray[0]), locationHrefAlias = locationArray[1], configReferrerUrl = locationArray[2], customReferrer, \n // Platform defaults to web for this tracker\n configPlatform = (_e = trackerConfiguration.platform) !== null && _e !== void 0 ? _e : 'web', \n // Snowplow collector URL\n configCollectorUrl = asCollectorUrl(endpoint), \n // Custom path for post requests (to get around adblockers)\n configPostPath = (_f = trackerConfiguration.postPath) !== null && _f !== void 0 ? _f : '/com.snowplowanalytics.snowplow/tp2', \n // Site ID\n configTrackerSiteId = (_g = trackerConfiguration.appId) !== null && _g !== void 0 ? _g : '', \n // Document URL\n configCustomUrl, \n // Document title\n lastDocumentTitle = document.title, \n // Custom title\n lastConfigTitle, \n // Controls whether activity tracking page ping event timers are reset on page view events\n resetActivityTrackingOnPageView = (_h = trackerConfiguration.resetActivityTrackingOnPageView) !== null && _h !== void 0 ? _h : true, \n // Disallow hash tags in URL. TODO: Should this be set to true by default?\n configDiscardHashTag, \n // Disallow brace in URL.\n configDiscardBrace, \n // First-party cookie name prefix\n configCookieNamePrefix = (_j = trackerConfiguration.cookieName) !== null && _j !== void 0 ? _j : '_sp_', \n // First-party cookie domain\n // User agent defaults to origin hostname\n configCookieDomain = (_k = trackerConfiguration.cookieDomain) !== null && _k !== void 0 ? _k : undefined, \n // First-party cookie path\n // Default is user agent defined.\n configCookiePath = '/', \n // First-party cookie samesite attribute\n configCookieSameSite = (_l = trackerConfiguration.cookieSameSite) !== null && _l !== void 0 ? _l : 'None', \n // First-party cookie secure attribute\n configCookieSecure = (_m = trackerConfiguration.cookieSecure) !== null && _m !== void 0 ? _m : true, \n // Do Not Track browser feature\n dnt = navigator.doNotTrack || navigator.msDoNotTrack || window.doNotTrack, \n // Do Not Track\n configDoNotTrack = typeof trackerConfiguration.respectDoNotTrack !== 'undefined'\n ? trackerConfiguration.respectDoNotTrack && (dnt === 'yes' || dnt === '1')\n : false, \n // Opt out of cookie tracking\n configOptOutCookie, \n // Life of the visitor cookie (in seconds)\n configVisitorCookieTimeout = (_o = trackerConfiguration.cookieLifetime) !== null && _o !== void 0 ? _o : 63072000, // 2 years\n // Life of the session cookie (in seconds)\n configSessionCookieTimeout = (_p = trackerConfiguration.sessionCookieTimeout) !== null && _p !== void 0 ? _p : 1800, // 30 minutes\n // Allows tracking user session (using cookies or local storage), can only be used with anonymousTracking\n configAnonymousSessionTracking = getAnonymousSessionTracking(trackerConfiguration), \n // Will send a header to server to prevent returning cookie and capturing IP\n configAnonymousServerTracking = getAnonymousServerTracking(trackerConfiguration), \n // Sets tracker to work in anonymous mode without accessing client storage\n configAnonymousTracking = getAnonymousTracking(trackerConfiguration), \n // Strategy defining how to store the state: cookie, localStorage, cookieAndLocalStorage or none\n configStateStorageStrategy = getStateStorageStrategy(trackerConfiguration), \n // Last activity timestamp\n lastActivityTime, \n // The last time an event was fired on the page - used to invalidate session if cookies are disabled\n lastEventTime = new Date().getTime(), \n // How are we scrolling?\n minXOffset, maxXOffset, minYOffset, maxYOffset, \n // Domain hash value\n domainHash, \n // Domain unique user ID\n domainUserId, \n // ID for the current session\n memorizedSessionId, \n // Index for the current session - kept in memory in case cookies are disabled\n memorizedVisitCount = 1, \n // Business-defined unique user ID\n businessUserId, \n // Manager for local storage queue\n outQueue = OutQueueManager(trackerId, state, configStateStorageStrategy == 'localStorage' || configStateStorageStrategy == 'cookieAndLocalStorage', trackerConfiguration.eventMethod, configPostPath, (_q = trackerConfiguration.bufferSize) !== null && _q !== void 0 ? _q : 1, (_r = trackerConfiguration.maxPostBytes) !== null && _r !== void 0 ? _r : 40000, (_s = trackerConfiguration.useStm) !== null && _s !== void 0 ? _s : true, (_t = trackerConfiguration.maxLocalStorageQueueSize) !== null && _t !== void 0 ? _t : 1000, (_u = trackerConfiguration.connectionTimeout) !== null && _u !== void 0 ? _u : 5000, configAnonymousServerTracking), \n // Whether pageViewId should be regenerated after each trackPageView. Affect web_page context\n preservePageViewId = false, \n // Whether first trackPageView was fired and pageViewId should not be changed anymore until reload\n pageViewSent = false, \n // Activity tracking config for callback and pacge ping variants\n activityTrackingConfig = {\n enabled: false,\n installed: false,\n configurations: {}\n };\n if (trackerConfiguration.hasOwnProperty('discoverRootDomain') && trackerConfiguration.discoverRootDomain) {\n configCookieDomain = findRootDomain(configCookieSameSite, configCookieSecure);\n }\n // Set up unchanging name-value pairs\n core.setTrackerVersion(version);\n core.setTrackerNamespace(namespace);\n core.setAppId(configTrackerSiteId);\n core.setPlatform(configPlatform);\n core.addPayloadPair('cookie', navigator.cookieEnabled ? '1' : '0');\n core.addPayloadPair('cs', documentCharset);\n core.addPayloadPair('lang', browserLanguage);\n core.addPayloadPair('res', screen.width + 'x' + screen.height);\n core.addPayloadPair('cd', screen.colorDepth);\n /*\n * Initialize tracker\n */\n updateDomainHash();\n initializeIdsAndCookies();\n if (trackerConfiguration.crossDomainLinker) {\n decorateLinks(trackerConfiguration.crossDomainLinker);\n }\n /**\n * Recalculate the domain, URL, and referrer\n */\n function refreshUrl() {\n locationArray = fixupUrl(window.location.hostname, window.location.href, getReferrer());\n // If this is a single-page app and the page URL has changed, then:\n // - if the new URL's querystring contains a \"refer(r)er\" parameter, use it as the referrer\n // - otherwise use the old URL as the referer\n if (locationArray[1] !== locationHrefAlias) {\n configReferrerUrl = getReferrer(locationHrefAlias);\n }\n domainAlias = fixupDomain(locationArray[0]);\n locationHrefAlias = locationArray[1];\n }\n /**\n * Decorate the querystring of a single link\n *\n * @param event - e The event targeting the link\n */\n function linkDecorationHandler(evt) {\n var timestamp = new Date().getTime();\n var elt = evt.target;\n if (elt === null || elt === void 0 ? void 0 : elt.href) {\n elt.href = decorateQuerystring(elt.href, '_sp', domainUserId + '.' + timestamp);\n }\n }\n /**\n * Enable querystring decoration for links pasing a filter\n * Whenever such a link is clicked on or navigated to via the keyboard,\n * add \"_sp={{duid}}.{{timestamp}}\" to its querystring\n *\n * @param crossDomainLinker - Function used to determine which links to decorate\n */\n function decorateLinks(crossDomainLinker) {\n for (var i = 0; i < document.links.length; i++) {\n var elt = document.links[i];\n if (!elt.spDecorationEnabled && crossDomainLinker(elt)) {\n addEventListener(elt, 'click', linkDecorationHandler, true);\n addEventListener(elt, 'mousedown', linkDecorationHandler, true);\n // Don't add event listeners more than once\n elt.spDecorationEnabled = true;\n }\n }\n }\n /*\n * Removes hash tag from the URL\n *\n * URLs are purified before being recorded in the cookie,\n * or before being sent as GET parameters\n */\n function purify(url) {\n var targetPattern;\n if (configDiscardHashTag) {\n targetPattern = new RegExp('#.*');\n url = url.replace(targetPattern, '');\n }\n if (configDiscardBrace) {\n targetPattern = new RegExp('[{}]', 'g');\n url = url.replace(targetPattern, '');\n }\n return url;\n }\n /*\n * Extract scheme/protocol from URL\n */\n function getProtocolScheme(url) {\n var e = new RegExp('^([a-z]+):'), matches = e.exec(url);\n return matches ? matches[1] : null;\n }\n /*\n * Resolve relative reference\n *\n * Note: not as described in rfc3986 section 5.2\n */\n function resolveRelativeReference(baseUrl, url) {\n var protocol = getProtocolScheme(url), i;\n if (protocol) {\n return url;\n }\n if (url.slice(0, 1) === '/') {\n return getProtocolScheme(baseUrl) + '://' + getHostName(baseUrl) + url;\n }\n baseUrl = purify(baseUrl);\n if ((i = baseUrl.indexOf('?')) >= 0) {\n baseUrl = baseUrl.slice(0, i);\n }\n if ((i = baseUrl.lastIndexOf('/')) !== baseUrl.length - 1) {\n baseUrl = baseUrl.slice(0, i + 1);\n }\n return baseUrl + url;\n }\n /*\n * Send request\n */\n function sendRequest(request) {\n // Set to true if Opt-out cookie is defined\n var toOptoutByCookie;\n if (configOptOutCookie) {\n toOptoutByCookie = !!cookie(configOptOutCookie);\n }\n else {\n toOptoutByCookie = false;\n }\n if (!(configDoNotTrack || toOptoutByCookie)) {\n outQueue.enqueueRequest(request.build(), configCollectorUrl);\n }\n }\n /*\n * Get cookie name with prefix and domain hash\n */\n function getSnowplowCookieName(baseName) {\n return configCookieNamePrefix + baseName + '.' + domainHash;\n }\n /*\n * Cookie getter.\n */\n function getSnowplowCookieValue(cookieName) {\n var fullName = getSnowplowCookieName(cookieName);\n if (configStateStorageStrategy == 'localStorage') {\n return attemptGetLocalStorage(fullName);\n }\n else if (configStateStorageStrategy == 'cookie' || configStateStorageStrategy == 'cookieAndLocalStorage') {\n return cookie(fullName);\n }\n return undefined;\n }\n /*\n * Update domain hash\n */\n function updateDomainHash() {\n refreshUrl();\n domainHash = hash((configCookieDomain || domainAlias) + (configCookiePath || '/')).slice(0, 4); // 4 hexits = 16 bits\n }\n /*\n * Process all \"activity\" events.\n * For performance, this function must have low overhead.\n */\n function activityHandler() {\n var now = new Date();\n lastActivityTime = now.getTime();\n }\n /*\n * Process all \"scroll\" events.\n */\n function scrollHandler() {\n updateMaxScrolls();\n activityHandler();\n }\n /*\n * Returns [pageXOffset, pageYOffset]\n */\n function getPageOffsets() {\n var documentElement = document.documentElement;\n if (documentElement) {\n return [documentElement.scrollLeft || window.pageXOffset, documentElement.scrollTop || window.pageYOffset];\n }\n return [0, 0];\n }\n /*\n * Quick initialization/reset of max scroll levels\n */\n function resetMaxScrolls() {\n var offsets = getPageOffsets();\n var x = offsets[0];\n minXOffset = x;\n maxXOffset = x;\n var y = offsets[1];\n minYOffset = y;\n maxYOffset = y;\n }\n /*\n * Check the max scroll levels, updating as necessary\n */\n function updateMaxScrolls() {\n var offsets = getPageOffsets();\n var x = offsets[0];\n if (x < minXOffset) {\n minXOffset = x;\n }\n else if (x > maxXOffset) {\n maxXOffset = x;\n }\n var y = offsets[1];\n if (y < minYOffset) {\n minYOffset = y;\n }\n else if (y > maxYOffset) {\n maxYOffset = y;\n }\n }\n /*\n * Prevents offsets from being decimal or NaN\n * See https://github.com/snowplow/snowplow-javascript-tracker/issues/324\n */\n function cleanOffset(offset) {\n return Math.round(offset);\n }\n /*\n * Sets or renews the session cookie\n */\n function setSessionCookie() {\n var cookieName = getSnowplowCookieName('ses');\n var cookieValue = '*';\n setCookie(cookieName, cookieValue, configSessionCookieTimeout);\n }\n /*\n * Sets the Visitor ID cookie: either the first time loadDomainUserIdCookie is called\n * or when there is a new visit or a new page view\n */\n function setDomainUserIdCookie(domainUserId, createTs, visitCount, nowTs, lastVisitTs, sessionId) {\n var cookieName = getSnowplowCookieName('id');\n var cookieValue = domainUserId + '.' + createTs + '.' + visitCount + '.' + nowTs + '.' + lastVisitTs + '.' + sessionId;\n setCookie(cookieName, cookieValue, configVisitorCookieTimeout);\n }\n /*\n * no-op if anonymousTracking enabled, will still set cookies if anonymousSessionTracking is enabled\n * Sets a cookie based on the storage strategy:\n * - if 'localStorage': attemps to write to local storage\n * - if 'cookie' or 'cookieAndLocalStorage': writes to cookies\n * - otherwise: no-op\n */\n function setCookie(name, value, timeout) {\n if (configAnonymousTracking && !configAnonymousSessionTracking) {\n return;\n }\n if (configStateStorageStrategy == 'localStorage') {\n attemptWriteLocalStorage(name, value, timeout);\n }\n else if (configStateStorageStrategy == 'cookie' || configStateStorageStrategy == 'cookieAndLocalStorage') {\n cookie(name, value, timeout, configCookiePath, configCookieDomain, configCookieSameSite, configCookieSecure);\n }\n }\n /**\n * Clears all cookie and local storage for id and ses values\n */\n function clearUserDataAndCookies(configuration) {\n var idname = getSnowplowCookieName('id');\n var sesname = getSnowplowCookieName('ses');\n attemptDeleteLocalStorage(idname);\n attemptDeleteLocalStorage(sesname);\n deleteCookie(idname, configCookieDomain, configCookieSameSite, configCookieSecure);\n deleteCookie(sesname, configCookieDomain, configCookieSameSite, configCookieSecure);\n if (!(configuration === null || configuration === void 0 ? void 0 : configuration.preserveSession)) {\n memorizedSessionId = v4();\n memorizedVisitCount = 0;\n }\n if (!(configuration === null || configuration === void 0 ? void 0 : configuration.preserveUser)) {\n domainUserId = v4();\n businessUserId = null;\n }\n }\n /**\n * Toggle Anaonymous Tracking\n */\n function toggleAnonymousTracking(configuration) {\n if (configuration && configuration.stateStorageStrategy) {\n trackerConfiguration.stateStorageStrategy = configuration.stateStorageStrategy;\n configStateStorageStrategy = getStateStorageStrategy(trackerConfiguration);\n }\n configAnonymousTracking = getAnonymousTracking(trackerConfiguration);\n configAnonymousSessionTracking = getAnonymousSessionTracking(trackerConfiguration);\n configAnonymousServerTracking = getAnonymousServerTracking(trackerConfiguration);\n outQueue.setUseLocalStorage(configStateStorageStrategy == 'localStorage' || configStateStorageStrategy == 'cookieAndLocalStorage');\n outQueue.setAnonymousTracking(configAnonymousServerTracking);\n }\n /*\n * Load the domain user ID and the session ID\n * Set the cookies (if cookies are enabled)\n */\n function initializeIdsAndCookies() {\n if (configAnonymousTracking && !configAnonymousSessionTracking) {\n return;\n }\n var sesCookieSet = configStateStorageStrategy != 'none' && !!getSnowplowCookieValue('ses');\n var idCookieComponents = loadDomainUserIdCookie();\n if (idCookieComponents[1]) {\n domainUserId = idCookieComponents[1];\n }\n else if (!configAnonymousTracking) {\n domainUserId = v4();\n idCookieComponents[1] = domainUserId;\n }\n else {\n domainUserId = '';\n idCookieComponents[1] = domainUserId;\n }\n memorizedSessionId = idCookieComponents[6];\n if (!sesCookieSet) {\n // Increment the session ID\n idCookieComponents[3]++;\n // Create a new sessionId\n memorizedSessionId = v4();\n idCookieComponents[6] = memorizedSessionId;\n // Set lastVisitTs to currentVisitTs\n idCookieComponents[5] = idCookieComponents[4];\n }\n if (configStateStorageStrategy != 'none') {\n setSessionCookie();\n // Update currentVisitTs\n idCookieComponents[4] = Math.round(new Date().getTime() / 1000);\n idCookieComponents.shift();\n setDomainUserIdCookie.apply(null, idCookieComponents); // TODO: Remove any\n }\n }\n /*\n * Load visitor ID cookie\n */\n function loadDomainUserIdCookie() {\n if (configStateStorageStrategy == 'none') {\n return [];\n }\n var now = new Date(), nowTs = Math.round(now.getTime() / 1000), id = getSnowplowCookieValue('id'), tmpContainer;\n if (id) {\n tmpContainer = id.split('.');\n // cookies enabled\n tmpContainer.unshift('0');\n }\n else {\n tmpContainer = [\n // cookies disabled\n '1',\n // Domain user ID\n domainUserId,\n // Creation timestamp - seconds since Unix epoch\n nowTs,\n // visitCount - 0 = no previous visit\n 0,\n // Current visit timestamp\n nowTs,\n // Last visit timestamp - blank meaning no previous visit\n '',\n ];\n }\n if (!tmpContainer[6]) {\n // session id\n tmpContainer[6] = v4();\n }\n return tmpContainer;\n }\n /*\n * Attaches common web fields to every request (resolution, url, referrer, etc.)\n * Also sets the required cookies.\n */\n function addBrowserData(payloadBuilder) {\n var anonymizeOr = function (value) { return (configAnonymousTracking ? null : value); };\n var anonymizeSessionOr = function (value) {\n return configAnonymousSessionTracking ? value : anonymizeOr(value);\n };\n var nowTs = Math.round(new Date().getTime() / 1000), ses = getSnowplowCookieValue('ses'), id = loadDomainUserIdCookie(), cookiesDisabled = id[0], _domainUserId = id[1], // We could use the global (domainUserId) but this is better etiquette\n createTs = id[2], visitCount = id[3], currentVisitTs = id[4], lastVisitTs = id[5], sessionIdFromCookie = id[6];\n var toOptoutByCookie;\n if (configOptOutCookie) {\n toOptoutByCookie = !!cookie(configOptOutCookie);\n }\n else {\n toOptoutByCookie = false;\n }\n if (configDoNotTrack || toOptoutByCookie) {\n clearUserDataAndCookies();\n return;\n }\n // If cookies are enabled, base visit count and session ID on the cookies\n if (cookiesDisabled === '0') {\n memorizedSessionId = sessionIdFromCookie;\n // New session?\n if (!ses && configStateStorageStrategy != 'none') {\n // New session (aka new visit)\n visitCount++;\n // Update the last visit timestamp\n lastVisitTs = currentVisitTs;\n // Regenerate the session ID\n memorizedSessionId = v4();\n }\n memorizedVisitCount = visitCount;\n }\n else if (new Date().getTime() - lastEventTime > configSessionCookieTimeout * 1000) {\n memorizedSessionId = v4();\n memorizedVisitCount++;\n }\n payloadBuilder.add('vp', detectViewport());\n payloadBuilder.add('ds', detectDocumentSize());\n payloadBuilder.add('vid', anonymizeSessionOr(memorizedVisitCount));\n payloadBuilder.add('sid', anonymizeSessionOr(memorizedSessionId));\n payloadBuilder.add('duid', anonymizeOr(_domainUserId)); // Set to our local variable\n payloadBuilder.add('uid', anonymizeOr(businessUserId));\n refreshUrl();\n payloadBuilder.add('refr', purify(customReferrer || configReferrerUrl));\n // Add the page URL last as it may take us over the IE limit (and we don't always need it)\n payloadBuilder.add('url', purify(configCustomUrl || locationHrefAlias));\n // Update cookies\n if (configStateStorageStrategy != 'none') {\n setDomainUserIdCookie(_domainUserId, createTs, memorizedVisitCount, nowTs, lastVisitTs, memorizedSessionId);\n setSessionCookie();\n }\n lastEventTime = new Date().getTime();\n }\n /**\n * Adds the protocol in front of our collector URL\n *\n * @param string - collectorUrl The collector URL with or without protocol\n * @returns string collectorUrl The tracker URL with protocol\n */\n function asCollectorUrl(collectorUrl) {\n if (collectorUrl.indexOf('http') === 0) {\n return collectorUrl;\n }\n return ('https:' === document.location.protocol ? 'https' : 'http') + '://' + collectorUrl;\n }\n /**\n * Initialize new `pageViewId` if it shouldn't be preserved.\n * Should be called when `trackPageView` is invoked\n */\n function resetPageView() {\n if (!preservePageViewId || state.pageViewId == null) {\n state.pageViewId = v4();\n }\n }\n /**\n * Safe function to get `pageViewId`.\n * Generates it if it wasn't initialized by other tracker\n */\n function getPageViewId() {\n if (state.pageViewId == null) {\n state.pageViewId = v4();\n }\n return state.pageViewId;\n }\n /**\n * Put together a web page context with a unique UUID for the page view\n *\n * @returns web_page context\n */\n function getWebPagePlugin() {\n return {\n contexts: function () {\n return [\n {\n schema: 'iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0',\n data: {\n id: getPageViewId()\n }\n },\n ];\n }\n };\n }\n /**\n * Expires current session and starts a new session.\n */\n function newSession() {\n // If cookies are enabled, base visit count and session ID on the cookies\n var nowTs = Math.round(new Date().getTime() / 1000), id = loadDomainUserIdCookie(), cookiesDisabled = id[0], _domainUserId = id[1], // We could use the global (domainUserId) but this is better etiquette\n createTs = id[2], visitCount = id[3], currentVisitTs = id[4], lastVisitTs = id[5], sessionIdFromCookie = id[6];\n // When cookies are enabled\n if (cookiesDisabled === '0') {\n memorizedSessionId = sessionIdFromCookie;\n // When cookie/local storage is enabled - make a new session\n if (configStateStorageStrategy != 'none') {\n // New session (aka new visit)\n visitCount++;\n // Update the last visit timestamp\n lastVisitTs = currentVisitTs;\n // Regenerate the session ID\n memorizedSessionId = v4();\n }\n memorizedVisitCount = visitCount;\n // Create a new session cookie\n setSessionCookie();\n }\n else {\n memorizedSessionId = v4();\n memorizedVisitCount++;\n }\n // Update cookies\n if (configStateStorageStrategy != 'none') {\n setDomainUserIdCookie(_domainUserId, createTs, memorizedVisitCount, nowTs, lastVisitTs, memorizedSessionId);\n setSessionCookie();\n }\n lastEventTime = new Date().getTime();\n }\n /**\n * Combine an array of unchanging contexts with the result of a context-creating function\n *\n * @param staticContexts - Array of custom contexts\n * @param contextCallback - Function returning an array of contexts\n */\n function finalizeContexts(staticContexts, contextCallback) {\n return (staticContexts || []).concat(contextCallback ? contextCallback() : []);\n }\n function logPageView(_a) {\n var title = _a.title, context = _a.context, timestamp = _a.timestamp, contextCallback = _a.contextCallback;\n refreshUrl();\n if (pageViewSent) {\n // Do not reset pageViewId if previous events were not page_view\n resetPageView();\n }\n pageViewSent = true;\n // So we know what document.title was at the time of trackPageView\n lastDocumentTitle = document.title;\n lastConfigTitle = title;\n // Fixup page title\n var pageTitle = fixupTitle(lastConfigTitle || lastDocumentTitle);\n // Log page view\n core.track(buildPageView({\n pageUrl: purify(configCustomUrl || locationHrefAlias),\n pageTitle: pageTitle,\n referrer: purify(customReferrer || configReferrerUrl)\n }), finalizeContexts(context, contextCallback), timestamp);\n // Send ping (to log that user has stayed on page)\n var now = new Date();\n var installingActivityTracking = false;\n if (activityTrackingConfig.enabled && !activityTrackingConfig.installed) {\n activityTrackingConfig.installed = true;\n installingActivityTracking = true;\n // Add mousewheel event handler, detect passive event listeners for performance\n var detectPassiveEvents = {\n update: function update() {\n if (typeof window !== 'undefined' && typeof window.addEventListener === 'function') {\n var passive = false;\n var options = Object.defineProperty({}, 'passive', {\n get: function get() {\n passive = true;\n }\n });\n // note: have to set and remove a no-op listener instead of null\n // (which was used previously), becasue Edge v15 throws an error\n // when providing a null callback.\n // https://github.com/rafrex/detect-passive-events/pull/3\n var noop = function noop() { };\n window.addEventListener('testPassiveEventSupport', noop, options);\n window.removeEventListener('testPassiveEventSupport', noop, options);\n detectPassiveEvents.hasSupport = passive;\n }\n }\n };\n detectPassiveEvents.update();\n // Detect available wheel event\n var wheelEvent = 'onwheel' in document.createElement('div')\n ? 'wheel' // Modern browsers support \"wheel\"\n : document.onmousewheel !== undefined\n ? 'mousewheel' // Webkit and IE support at least \"mousewheel\"\n : 'DOMMouseScroll'; // let's assume that remaining browsers are older Firefox\n if (Object.prototype.hasOwnProperty.call(detectPassiveEvents, 'hasSupport')) {\n addEventListener(document, wheelEvent, activityHandler, { passive: true });\n }\n else {\n addEventListener(document, wheelEvent, activityHandler);\n }\n // Capture our initial scroll points\n resetMaxScrolls();\n // Add event handlers; cross-browser compatibility here varies significantly\n // @see http://quirksmode.org/dom/events\n var documentHandlers = ['click', 'mouseup', 'mousedown', 'mousemove', 'keypress', 'keydown', 'keyup'];\n var windowHandlers = ['resize', 'focus', 'blur'];\n var listener = function (_, handler) {\n if (handler === void 0) { handler = activityHandler; }\n return function (ev) {\n return addEventListener(document, ev, handler);\n };\n };\n documentHandlers.forEach(listener(document));\n windowHandlers.forEach(listener(window));\n listener(window, scrollHandler)('scroll');\n }\n if (activityTrackingConfig.enabled && (resetActivityTrackingOnPageView || installingActivityTracking)) {\n // Periodic check for activity.\n lastActivityTime = now.getTime();\n var key = void 0;\n for (key in activityTrackingConfig.configurations) {\n var config = activityTrackingConfig.configurations[key];\n if (config) {\n //Clear page ping heartbeat on new page view\n window.clearInterval(config.activityInterval);\n activityInterval(config, context, contextCallback);\n }\n }\n }\n }\n function activityInterval(config, context, contextCallback) {\n var executePagePing = function (cb, c) {\n refreshUrl();\n cb({ context: c, pageViewId: getPageViewId(), minXOffset: minXOffset, minYOffset: minYOffset, maxXOffset: maxXOffset, maxYOffset: maxYOffset });\n resetMaxScrolls();\n };\n var timeout = function () {\n var now = new Date();\n // There was activity during the heart beat period;\n // on average, this is going to overstate the visitDuration by configHeartBeatTimer/2\n if (lastActivityTime + config.configMinimumVisitLength > now.getTime()) {\n executePagePing(config.callback, finalizeContexts(context, contextCallback));\n }\n config.activityInterval = window.setInterval(heartbeat, config.configHeartBeatTimer);\n };\n var heartbeat = function () {\n var now = new Date();\n // There was activity during the heart beat period;\n // on average, this is going to overstate the visitDuration by configHeartBeatTimer/2\n if (lastActivityTime + config.configHeartBeatTimer > now.getTime()) {\n executePagePing(config.callback, finalizeContexts(context, contextCallback));\n }\n };\n if (config.configMinimumVisitLength != 0) {\n config.activityInterval = window.setTimeout(timeout, config.configMinimumVisitLength);\n }\n else {\n config.activityInterval = window.setInterval(heartbeat, config.configHeartBeatTimer);\n }\n }\n /**\n * Configure the activity tracking and ensures integer values for min visit and heartbeat\n */\n function configureActivityTracking(configuration) {\n var minimumVisitLength = configuration.minimumVisitLength, heartbeatDelay = configuration.heartbeatDelay, callback = configuration.callback;\n if (isInteger(minimumVisitLength) && isInteger(heartbeatDelay)) {\n return {\n configMinimumVisitLength: minimumVisitLength * 1000,\n configHeartBeatTimer: heartbeatDelay * 1000,\n callback: callback\n };\n }\n LOG.warn('Activity tracking not enabled, please provide integer values for minimumVisitLength and heartbeatDelay.');\n return undefined;\n }\n /**\n * Log that a user is still viewing a given page by sending a page ping.\n * Not part of the public API - only called from logPageView() above.\n */\n function logPagePing(_a) {\n var context = _a.context, minXOffset = _a.minXOffset, minYOffset = _a.minYOffset, maxXOffset = _a.maxXOffset, maxYOffset = _a.maxYOffset;\n var newDocumentTitle = document.title;\n if (newDocumentTitle !== lastDocumentTitle) {\n lastDocumentTitle = newDocumentTitle;\n lastConfigTitle = undefined;\n }\n core.track(buildPagePing({\n pageUrl: purify(configCustomUrl || locationHrefAlias),\n pageTitle: fixupTitle(lastConfigTitle || lastDocumentTitle),\n referrer: purify(customReferrer || configReferrerUrl),\n minXOffset: cleanOffset(minXOffset),\n maxXOffset: cleanOffset(maxXOffset),\n minYOffset: cleanOffset(minYOffset),\n maxYOffset: cleanOffset(maxYOffset)\n }), context);\n }\n var apiMethods = {\n getDomainSessionIndex: function () {\n return memorizedVisitCount;\n },\n getPageViewId: function () {\n return getPageViewId();\n },\n newSession: newSession,\n getCookieName: function (basename) {\n return getSnowplowCookieName(basename);\n },\n getUserId: function () {\n return businessUserId;\n },\n getDomainUserId: function () {\n return loadDomainUserIdCookie()[1];\n },\n getDomainUserInfo: function () {\n return loadDomainUserIdCookie();\n },\n setReferrerUrl: function (url) {\n customReferrer = url;\n },\n setCustomUrl: function (url) {\n refreshUrl();\n configCustomUrl = resolveRelativeReference(locationHrefAlias, url);\n },\n setDocumentTitle: function (title) {\n // So we know what document.title was at the time of trackPageView\n lastDocumentTitle = document.title;\n lastConfigTitle = title;\n },\n discardHashTag: function (enableFilter) {\n configDiscardHashTag = enableFilter;\n },\n discardBrace: function (enableFilter) {\n configDiscardBrace = enableFilter;\n },\n setCookiePath: function (path) {\n configCookiePath = path;\n updateDomainHash();\n },\n setVisitorCookieTimeout: function (timeout) {\n configVisitorCookieTimeout = timeout;\n },\n crossDomainLinker: function (crossDomainLinkerCriterion) {\n decorateLinks(crossDomainLinkerCriterion);\n },\n enableActivityTracking: function (configuration) {\n activityTrackingConfig.enabled = true;\n activityTrackingConfig.configurations.pagePing = configureActivityTracking(__assign(__assign({}, configuration), { callback: logPagePing }));\n },\n enableActivityTrackingCallback: function (configuration) {\n activityTrackingConfig.enabled = true;\n activityTrackingConfig.configurations.callback = configureActivityTracking(configuration);\n },\n updatePageActivity: function () {\n activityHandler();\n },\n setOptOutCookie: function (name) {\n configOptOutCookie = name;\n },\n setUserId: function (userId) {\n businessUserId = userId;\n },\n setUserIdFromLocation: function (querystringField) {\n refreshUrl();\n businessUserId = fromQuerystring(querystringField, locationHrefAlias);\n },\n setUserIdFromReferrer: function (querystringField) {\n refreshUrl();\n businessUserId = fromQuerystring(querystringField, configReferrerUrl);\n },\n setUserIdFromCookie: function (cookieName) {\n businessUserId = cookie(cookieName);\n },\n setCollectorUrl: function (collectorUrl) {\n configCollectorUrl = asCollectorUrl(collectorUrl);\n outQueue.setCollectorUrl(configCollectorUrl);\n },\n setBufferSize: function (newBufferSize) {\n outQueue.setBufferSize(newBufferSize);\n },\n flushBuffer: function (configuration) {\n if (configuration === void 0) { configuration = {}; }\n outQueue.executeQueue();\n if (configuration.newBufferSize) {\n outQueue.setBufferSize(configuration.newBufferSize);\n }\n },\n trackPageView: function (event) {\n if (event === void 0) { event = {}; }\n logPageView(event);\n },\n preservePageViewId: function () {\n preservePageViewId = true;\n },\n disableAnonymousTracking: function (configuration) {\n trackerConfiguration.anonymousTracking = false;\n toggleAnonymousTracking(configuration);\n initializeIdsAndCookies();\n outQueue.executeQueue(); // There might be some events in the queue we've been unable to send in anonymous mode\n },\n enableAnonymousTracking: function (configuration) {\n trackerConfiguration.anonymousTracking = (configuration && (configuration === null || configuration === void 0 ? void 0 : configuration.options)) || true;\n toggleAnonymousTracking(configuration);\n // Reset the page view, if not tracking the session, so can't stitch user into new events on the page view id\n if (!configAnonymousSessionTracking) {\n resetPageView();\n }\n },\n clearUserData: clearUserDataAndCookies\n };\n return __assign(__assign({}, apiMethods), { id: trackerId, namespace: namespace, core: core, sharedState: state });\n };\n // Initialise the tracker\n var partialTracker = newTracker(trackerId, namespace, version, endpoint, sharedState, trackerConfiguration), tracker = __assign(__assign({}, partialTracker), { addPlugin: function (configuration) {\n var _a, _b;\n tracker.core.addPlugin(configuration);\n (_b = (_a = configuration.plugin).activateBrowserPlugin) === null || _b === void 0 ? void 0 : _b.call(_a, tracker);\n } });\n // Initialise each plugin with the tracker\n (_a = trackerConfiguration.plugins) === null || _a === void 0 ? void 0 : _a.forEach(function (p) {\n var _a;\n (_a = p.activateBrowserPlugin) === null || _a === void 0 ? void 0 : _a.call(p, tracker);\n });\n return tracker;\n}\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nvar namedTrackers = {};\n/**\n * Dispatch function to all specified trackers\n *\n * @param trackers - An optional list of trackers to send the event to, or will send to all trackers\n * @param fn - The function which will run against each tracker\n */\nfunction dispatchToTrackers(trackers, fn) {\n try {\n getTrackers(trackers !== null && trackers !== void 0 ? trackers : allTrackerNames()).forEach(fn);\n }\n catch (ex) {\n LOG.error('Function failed', ex);\n }\n}\n/**\n * Dispatch function to all specified trackers from the supplied collection\n *\n * @param trackers - An optional list of trackers to send the event to, or will send to all trackers\n * @param trackerCollection - The collection which the trackers will be selected from\n * @param fn - The function which will run against each tracker\n */\nfunction dispatchToTrackersInCollection(trackers, trackerCollection, fn) {\n try {\n getTrackersFromCollection(trackers !== null && trackers !== void 0 ? trackers : Object.keys(trackerCollection), trackerCollection).forEach(fn);\n }\n catch (ex) {\n LOG.error('Function failed', ex);\n }\n}\n/**\n * Checks if a tracker has been created for a particular identifier\n * @param trackerId - The unique identifier of the tracker\n */\nfunction trackerExists(trackerId) {\n return namedTrackers.hasOwnProperty(trackerId);\n}\n/**\n * Creates a Tracker and adds it to the internal collection\n * @param trackerId - The unique identifier of the tracker\n * @param namespace - The namespace of the tracker, tracked with each event as `tna`\n * @param version - The current version of the tracker library\n * @param endpoint - The endpoint to send events to\n * @param sharedState - The instance of shared state to use for this tracker\n * @param configuration - The configuration to use for this tracker instance\n */\nfunction addTracker(trackerId, namespace, version, endpoint, sharedState, configuration) {\n if (!namedTrackers.hasOwnProperty(trackerId)) {\n namedTrackers[trackerId] = Tracker(trackerId, namespace, version, endpoint, sharedState, configuration);\n return namedTrackers[trackerId];\n }\n return null;\n}\n/**\n * Gets a single instance of the internal tracker object\n * @param trackerId - The unique identifier of the tracker\n * @returns The tracker instance, or null if not found\n */\nfunction getTracker(trackerId) {\n if (namedTrackers.hasOwnProperty(trackerId)) {\n return namedTrackers[trackerId];\n }\n LOG.warn(trackerId + ' not configured');\n return null;\n}\n/**\n * Gets an array of tracker instances based on the list of identifiers\n * @param trackerIds - An array of unique identifiers of the trackers\n * @returns The tracker instances, or empty list if none found\n */\nfunction getTrackers(trackerIds) {\n return getTrackersFromCollection(trackerIds, namedTrackers);\n}\n/**\n * Gets all the trackers as a object, keyed by their unique identifiers\n */\nfunction allTrackers() {\n return namedTrackers;\n}\n/**\n * Returns all the unique tracker identifiers\n */\nfunction allTrackerNames() {\n return Object.keys(namedTrackers);\n}\nfunction getTrackersFromCollection(trackerIds, trackerCollection) {\n var trackers = [];\n for (var _i = 0, trackerIds_1 = trackerIds; _i < trackerIds_1.length; _i++) {\n var id = trackerIds_1[_i];\n if (trackerCollection.hasOwnProperty(id)) {\n trackers.push(trackerCollection[id]);\n }\n else {\n LOG.warn(id + ' not configured');\n }\n }\n return trackers;\n}\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * A set of variables which are shared among all initialised trackers\n */\nvar SharedState = /** @class */ (function () {\n function SharedState() {\n /* List of request queues - one per Tracker instance */\n this.outQueues = [];\n this.bufferFlushers = [];\n /* DOM Ready */\n this.hasLoaded = false;\n this.registeredOnLoadHandlers = [];\n }\n return SharedState;\n}());\nfunction createSharedState() {\n var sharedState = new SharedState(), documentAlias = document, windowAlias = window;\n /*\n * Handle page visibility event\n * Works everywhere except IE9\n */\n function visibilityChangeHandler() {\n if (documentAlias.visibilityState == 'hidden') {\n // Flush all POST queues\n sharedState.bufferFlushers.forEach(function (flusher) {\n flusher(false);\n });\n }\n }\n function flushBuffers() {\n // Flush all POST queues\n sharedState.bufferFlushers.forEach(function (flusher) {\n flusher(false);\n });\n }\n /*\n * Handler for onload event\n */\n function loadHandler() {\n var i;\n if (!sharedState.hasLoaded) {\n sharedState.hasLoaded = true;\n for (i = 0; i < sharedState.registeredOnLoadHandlers.length; i++) {\n sharedState.registeredOnLoadHandlers[i]();\n }\n }\n return true;\n }\n /*\n * Add onload or DOM ready handler\n */\n function addReadyListener() {\n if (documentAlias.addEventListener) {\n documentAlias.addEventListener('DOMContentLoaded', function ready() {\n documentAlias.removeEventListener('DOMContentLoaded', ready, false);\n loadHandler();\n });\n }\n else if (documentAlias.attachEvent) {\n documentAlias.attachEvent('onreadystatechange', function ready() {\n if (documentAlias.readyState === 'complete') {\n documentAlias.detachEvent('onreadystatechange', ready);\n loadHandler();\n }\n });\n }\n // fallback\n addEventListener(windowAlias, 'load', loadHandler, false);\n }\n /************************************************************\n * Constructor\n ************************************************************/\n // initialize the Snowplow singleton\n if (documentAlias.visibilityState) {\n // Flush for mobile and modern browsers\n addEventListener(documentAlias, 'visibilitychange', visibilityChangeHandler, false);\n }\n // Last attempt at flushing in beforeunload\n addEventListener(windowAlias, 'beforeunload', flushBuffers, false);\n if (document.readyState === 'loading') {\n addReadyListener();\n }\n else {\n loadHandler();\n }\n return sharedState;\n}\n\nexport { SharedState, addEventListener, addTracker, allTrackerNames, allTrackers, attemptDeleteLocalStorage, attemptGetLocalStorage, attemptGetSessionStorage, attemptWriteLocalStorage, attemptWriteSessionStorage, cookie, createSharedState, decorateQuerystring, deleteCookie, detectDocumentSize, detectViewport, dispatchToTrackers, dispatchToTrackersInCollection, findRootDomain, fixupDomain, fixupTitle, fixupUrl, fromQuerystring, getCookiesWithPrefix, getCssClasses, getFilterByClass, getFilterByName, getHostName, getReferrer, getTracker, getTrackers, hasLocalStorage, hasSessionStorage, isFunction, isInteger, isString, isValueInArray, localStorageAccessible, parseAndValidateFloat, parseAndValidateInt, trackerExists };\n//# sourceMappingURL=index.module.js.map\n","/*!\n * Attaches Client Hints to Snowplow events v3.1.0 (http://bit.ly/sp-js)\n * Copyright 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * Licensed under BSD-3-Clause\n */\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nvar navigatorAlias = navigator;\n/**\n * Attaches Client Hint information where available\n * @param includeHighEntropy - Should high entropy values be included\n */\nfunction ClientHintsPlugin(includeHighEntropy) {\n var uaClientHints;\n if (navigatorAlias.userAgentData) {\n uaClientHints = {\n isMobile: navigatorAlias.userAgentData.mobile,\n brands: navigatorAlias.userAgentData.brands\n };\n if (includeHighEntropy && navigatorAlias.userAgentData.getHighEntropyValues) {\n navigatorAlias.userAgentData\n .getHighEntropyValues(['platform', 'platformVersion', 'architecture', 'model', 'uaFullVersion'])\n .then(function (res) {\n uaClientHints.architecture = res.architecture;\n uaClientHints.model = res.model;\n uaClientHints.platform = res.platform;\n uaClientHints.uaFullVersion = res.uaFullVersion;\n uaClientHints.platformVersion = res.platformVersion;\n });\n }\n }\n return {\n contexts: function () {\n if (uaClientHints) {\n return [\n {\n schema: 'iglu:org.ietf/http_client_hints/jsonschema/1-0-0',\n data: uaClientHints\n },\n ];\n }\n return [];\n }\n };\n}\n\nexport { ClientHintsPlugin };\n//# sourceMappingURL=index.module.js.map\n","/*!\n * Attaches OptimizelyX data to Snowplow events v3.1.0 (http://bit.ly/sp-js)\n * Copyright 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * Licensed under BSD-3-Clause\n */\n\nimport { parseAndValidateInt } from '@snowplow/browser-tracker-core';\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * Adds Opimizely X context to events\n */\nfunction OptimizelyXPlugin() {\n var windowOptimizelyAlias = window.optimizely;\n /**\n * Check that *both* optimizely and optimizely.get exist\n *\n * @param property - optimizely data property\n * @param snd - optional nested property\n */\n function getOptimizelyXData(property, snd) {\n var data;\n if (windowOptimizelyAlias && typeof windowOptimizelyAlias.get === 'function') {\n data = windowOptimizelyAlias.get(property);\n if (typeof snd !== 'undefined' && data !== undefined) {\n data = data[snd];\n }\n }\n return data;\n }\n /**\n * Get data for OptimizelyX contexts - active experiments on current page\n *\n * @returns Array content of lite optimizely lite context\n */\n function getOptimizelyXSummary() {\n var state = getOptimizelyXData('state');\n var experiment_ids = state && state.getActiveExperimentIds();\n var variationMap = state && state.getVariationMap();\n var visitor = getOptimizelyXData('visitor');\n return experiment_ids.map(function (activeExperiment) {\n var variation = variationMap[activeExperiment];\n var variationName = (variation && variation.name && variation.name.toString()) || null;\n var variationId = variation && variation.id;\n var visitorId = (visitor && visitor.visitorId && visitor.visitorId.toString()) || null;\n return {\n experimentId: parseAndValidateInt(activeExperiment) || null,\n variationName: variationName,\n variation: parseAndValidateInt(variationId) || null,\n visitorId: visitorId\n };\n });\n }\n /**\n * Creates an OptimizelyX context containing only data required to join\n * event to experiment data\n *\n * @returns Array of custom contexts\n */\n function getOptimizelyXSummaryContexts() {\n return getOptimizelyXSummary().map(function (experiment) {\n return {\n schema: 'iglu:com.optimizely.optimizelyx/summary/jsonschema/1-0-0',\n data: experiment\n };\n });\n }\n return {\n contexts: function () {\n // Add Optimizely Contexts\n if (windowOptimizelyAlias) {\n return getOptimizelyXSummaryContexts();\n }\n return [];\n }\n };\n}\n\nexport { OptimizelyXPlugin };\n//# sourceMappingURL=index.module.js.map\n","/*!\n * Attaches Performance Timing data to Snowplow events v3.1.0 (http://bit.ly/sp-js)\n * Copyright 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * Licensed under BSD-3-Clause\n */\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * Adds Performance Timing context to events\n *\n * @remark\n * May not be fully populated when inital Page View fires\n * Often a good idea to take the latest performance timing context\n * for a given page view id when analysing in the warehouse\n */\nfunction PerformanceTimingPlugin() {\n /**\n * Creates a context from the window.performance.timing object\n *\n * @return object PerformanceTiming context\n */\n function getPerformanceTimingContext() {\n var windowAlias = window, performanceAlias = windowAlias.performance ||\n windowAlias.mozPerformance ||\n windowAlias.msPerformance ||\n windowAlias.webkitPerformance, performanceTimingAlias = performanceAlias.timing;\n if (performanceAlias) {\n var performanceTiming = {\n navigationStart: performanceTimingAlias.navigationStart,\n redirectStart: performanceTimingAlias.redirectStart,\n redirectEnd: performanceTimingAlias.redirectEnd,\n fetchStart: performanceTimingAlias.fetchStart,\n domainLookupStart: performanceTimingAlias.domainLookupStart,\n domainLookupEnd: performanceTimingAlias.domainLookupEnd,\n connectStart: performanceTimingAlias.connectStart,\n secureConnectionStart: performanceTimingAlias.secureConnectionStart,\n connectEnd: performanceTimingAlias.connectEnd,\n requestStart: performanceTimingAlias.requestStart,\n responseStart: performanceTimingAlias.responseStart,\n responseEnd: performanceTimingAlias.responseEnd,\n unloadEventStart: performanceTimingAlias.unloadEventStart,\n unloadEventEnd: performanceTimingAlias.unloadEventEnd,\n domLoading: performanceTimingAlias.domLoading,\n domInteractive: performanceTimingAlias.domInteractive,\n domContentLoadedEventStart: performanceTimingAlias.domContentLoadedEventStart,\n domContentLoadedEventEnd: performanceTimingAlias.domContentLoadedEventEnd,\n domComplete: performanceTimingAlias.domComplete,\n loadEventStart: performanceTimingAlias.loadEventStart,\n loadEventEnd: performanceTimingAlias.loadEventEnd,\n msFirstPaint: performanceTimingAlias.msFirstPaint,\n chromeFirstPaint: performanceTimingAlias.chromeFirstPaint,\n requestEnd: performanceTimingAlias.requestEnd,\n proxyStart: performanceTimingAlias.proxyStart,\n proxyEnd: performanceTimingAlias.proxyEnd\n };\n return [\n {\n schema: 'iglu:org.w3/PerformanceTiming/jsonschema/1-0-0',\n data: performanceTiming\n },\n ];\n }\n return [];\n }\n return {\n contexts: function () { return getPerformanceTimingContext(); }\n };\n}\n\nexport { PerformanceTimingPlugin };\n//# sourceMappingURL=index.module.js.map\n","/*!\n * Consent and GDPR data for Snowplow events v3.1.0 (http://bit.ly/sp-js)\n * Copyright 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * Licensed under BSD-3-Clause\n */\n\nimport { dispatchToTrackersInCollection } from '@snowplow/browser-tracker-core';\nimport { buildConsentGranted, buildConsentWithdrawn } from '@snowplow/tracker-core';\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nvar gdprBasis;\n(function (gdprBasis) {\n gdprBasis[\"consent\"] = \"consent\";\n gdprBasis[\"contract\"] = \"contract\";\n gdprBasis[\"legalObligation\"] = \"legal_obligation\";\n gdprBasis[\"vitalInterests\"] = \"vital_interests\";\n gdprBasis[\"publicTask\"] = \"public_task\";\n gdprBasis[\"legitimateInterests\"] = \"legitimate_interests\";\n})(gdprBasis || (gdprBasis = {}));\nvar _trackers = {};\nvar _context = {};\nvar LOG;\n/**\n * The Consent Plugin\n *\n * Adds Consent Granted and Withdrawn events\n * and the ability to add the GDPR context to events\n */\nfunction ConsentPlugin() {\n var trackerId;\n return {\n activateBrowserPlugin: function (tracker) {\n trackerId = tracker.id;\n _trackers[tracker.id] = tracker;\n },\n contexts: function () {\n if (_context[trackerId]) {\n return [\n {\n schema: 'iglu:com.snowplowanalytics.snowplow/gdpr/jsonschema/1-0-0',\n data: _context[trackerId]\n },\n ];\n }\n return [];\n },\n logger: function (logger) {\n LOG = logger;\n }\n };\n}\n/**\n * Enable the GDPR context for each event\n * @param configuration - the configuration for the GDPR context\n * @param trackers - The tracker identifiers which should have the GDPR context enabled\n */\nfunction enableGdprContext(configuration, trackers) {\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n var basisForProcessing = configuration.basisForProcessing, documentId = configuration.documentId, documentVersion = configuration.documentVersion, documentDescription = configuration.documentDescription;\n var basis = gdprBasis[basisForProcessing];\n if (!basis) {\n LOG.warn('enableGdprContext: basisForProcessing must be one of: consent, contract, legalObligation, vitalInterests, publicTask, legitimateInterests');\n return;\n }\n else {\n trackers.forEach(function (t) {\n if (_trackers[t]) {\n _context[t] = {\n basisForProcessing: basis,\n documentId: documentId !== null && documentId !== void 0 ? documentId : null,\n documentVersion: documentVersion !== null && documentVersion !== void 0 ? documentVersion : null,\n documentDescription: documentDescription !== null && documentDescription !== void 0 ? documentDescription : null\n };\n }\n });\n }\n}\n/**\n * Track a consent granted action\n *\n * @param event - The event information\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction trackConsentGranted(event, trackers) {\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n dispatchToTrackersInCollection(trackers, _trackers, function (t) {\n var builtEvent = buildConsentGranted(event);\n t.core.track(builtEvent.event, event.context ? event.context.concat(builtEvent.context) : builtEvent.context, event.timestamp);\n });\n}\n/**\n * Track a consent withdrawn action\n *\n * @param event - The event information\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction trackConsentWithdrawn(event, trackers) {\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n dispatchToTrackersInCollection(trackers, _trackers, function (t) {\n var builtEvent = buildConsentWithdrawn(event);\n t.core.track(builtEvent.event, event.context ? event.context.concat(builtEvent.context) : builtEvent.context, event.timestamp);\n });\n}\n\nexport { ConsentPlugin, enableGdprContext, gdprBasis, trackConsentGranted, trackConsentWithdrawn };\n//# sourceMappingURL=index.module.js.map\n","/*!\n * Attaches Geolocation data to Snowplow events v3.1.0 (http://bit.ly/sp-js)\n * Copyright 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * Licensed under BSD-3-Clause\n */\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nvar navigatorAlias = navigator, _trackers = {};\nvar geolocation, geolocationContextAdded = false;\n/**\n * Captures the geolocation information from the users browser\n * The geolocation will be cached and will be only be requested once\n * @param enableAtLoad - Should the geolocation context be populated immediately\n *\n * @remark\n * Enabling this will produce a popup for the user asking for permission to read their location information\n */\nfunction GeolocationPlugin(enableAtLoad) {\n if (enableAtLoad === void 0) { enableAtLoad = false; }\n var trackerId;\n return {\n activateBrowserPlugin: function (tracker) {\n trackerId = tracker.id;\n _trackers[tracker.id] = [false, undefined];\n if (enableAtLoad) {\n enableGeolocationContext([trackerId]);\n }\n },\n contexts: function () {\n var _a;\n var context = (_a = _trackers[trackerId]) === null || _a === void 0 ? void 0 : _a[1];\n if (context) {\n return [context];\n }\n return [];\n }\n };\n}\n/**\n * Attempts to create a context using the geolocation API\n *\n * @param trackers - The tracker identifiers which the context will be sent to\n */\nfunction enableGeolocationContext(trackers) {\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n trackers.forEach(function (t) {\n //Mark as enabled\n _trackers[t] = [true, geolocation]; // Geolocation might still be undefined but it could also be set already\n });\n if (!geolocationContextAdded && navigatorAlias.geolocation && navigatorAlias.geolocation.getCurrentPosition) {\n geolocationContextAdded = true;\n navigatorAlias.geolocation.getCurrentPosition(function (position) {\n var coords = position.coords;\n geolocation = {\n schema: 'iglu:com.snowplowanalytics.snowplow/geolocation_context/jsonschema/1-1-0',\n data: {\n latitude: coords.latitude,\n longitude: coords.longitude,\n latitudeLongitudeAccuracy: coords.accuracy,\n altitude: coords.altitude,\n altitudeAccuracy: coords.altitudeAccuracy,\n bearing: coords.heading,\n speed: coords.speed,\n timestamp: Math.round(position.timestamp)\n }\n };\n // Ensure all trackers with geolocation enabled have the context set\n for (var key in _trackers) {\n if (Object.prototype.hasOwnProperty.call(_trackers, key) && _trackers[key][0]) {\n _trackers[key] = [true, geolocation];\n }\n }\n });\n }\n}\n\nexport { GeolocationPlugin, enableGeolocationContext };\n//# sourceMappingURL=index.module.js.map\n","/*!\n * Attaches GA cookie data to Snowplow events v3.1.0 (http://bit.ly/sp-js)\n * Copyright 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * Licensed under BSD-3-Clause\n */\n\nimport { cookie } from '@snowplow/browser-tracker-core';\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * Captures the GA cookies on a page and sends as context on each event\n */\nfunction GaCookiesPlugin() {\n return {\n contexts: function () {\n var gaCookieData = {\n schema: 'iglu:com.google.analytics/cookies/jsonschema/1-0-0',\n data: {}\n };\n ['__utma', '__utmb', '__utmc', '__utmv', '__utmz', '_ga'].forEach(function (cookieType) {\n var value = cookie(cookieType);\n if (value) {\n gaCookieData.data[cookieType] = value;\n }\n });\n return [gaCookieData];\n }\n };\n}\n\nexport { GaCookiesPlugin };\n//# sourceMappingURL=index.module.js.map\n","/*!\n * Link Click tracking for Snowplow v3.1.0 (http://bit.ly/sp-js)\n * Copyright 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * Licensed under BSD-3-Clause\n */\n\nimport { dispatchToTrackersInCollection, getFilterByClass, addEventListener, getHostName, getCssClasses } from '@snowplow/browser-tracker-core';\nimport { buildLinkClick, resolveDynamicContext } from '@snowplow/tracker-core';\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nvar _trackers = {};\nvar _configuration = {};\n/**\n * Link click tracking\n *\n * Will automatically tracking link clicks once enabled with 'enableLinkClickTracking'\n * or you can manually track link clicks with 'trackLinkClick'\n */\nfunction LinkClickTrackingPlugin() {\n return {\n activateBrowserPlugin: function (tracker) {\n _trackers[tracker.id] = tracker;\n }\n };\n}\n/**\n * Enable link click tracking\n *\n * @remark\n * The default behaviour is to use actual click events. However, some browsers\n * (e.g., Firefox, Opera, and Konqueror) don't generate click events for the middle mouse button.\n *\n * To capture more \"clicks\", the pseudo click-handler uses mousedown + mouseup events.\n * This is not industry standard and is vulnerable to false positives (e.g., drag events).\n */\nfunction enableLinkClickTracking(configuration, trackers) {\n if (configuration === void 0) { configuration = {}; }\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n trackers.forEach(function (id) {\n if (_trackers[id]) {\n if (_trackers[id].sharedState.hasLoaded) {\n // the load event has already fired, add the click listeners now\n configureLinkClickTracking(configuration, id);\n addClickListeners(id);\n }\n else {\n // defer until page has loaded\n _trackers[id].sharedState.registeredOnLoadHandlers.push(function () {\n configureLinkClickTracking(configuration, id);\n addClickListeners(id);\n });\n }\n }\n });\n}\n/**\n * Add click event listeners to links which have been added to the page since the\n * last time enableLinkClickTracking or refreshLinkClickTracking was used\n *\n * @param trackers - The tracker identifiers which the have their link click state refreshed\n */\nfunction refreshLinkClickTracking(trackers) {\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n trackers.forEach(function (id) {\n if (_trackers[id]) {\n if (_trackers[id].sharedState.hasLoaded) {\n addClickListeners(id);\n }\n else {\n _trackers[id].sharedState.registeredOnLoadHandlers.push(function () {\n addClickListeners(id);\n });\n }\n }\n });\n}\n/**\n * Manually log a click\n *\n * @param event - The event information\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction trackLinkClick(event, trackers) {\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n dispatchToTrackersInCollection(trackers, _trackers, function (t) {\n t.core.track(buildLinkClick(event), event.context, event.timestamp);\n });\n}\n/*\n * Process clicks\n */\nfunction processClick(tracker, sourceElement, context) {\n var parentElement, tag, elementId, elementClasses, elementTarget, elementContent;\n while ((parentElement = sourceElement.parentElement) !== null &&\n parentElement != null &&\n (tag = sourceElement.tagName.toUpperCase()) !== 'A' &&\n tag !== 'AREA') {\n sourceElement = parentElement;\n }\n var anchorElement = sourceElement;\n if (anchorElement.href != null) {\n // browsers, such as Safari, don't downcase hostname and href\n var originalSourceHostName = anchorElement.hostname || getHostName(anchorElement.href), sourceHostName = originalSourceHostName.toLowerCase(), sourceHref = anchorElement.href.replace(originalSourceHostName, sourceHostName), scriptProtocol = new RegExp('^(javascript|vbscript|jscript|mocha|livescript|ecmascript|mailto):', 'i');\n // Ignore script pseudo-protocol links\n if (!scriptProtocol.test(sourceHref)) {\n elementId = anchorElement.id;\n elementClasses = getCssClasses(anchorElement);\n elementTarget = anchorElement.target;\n elementContent = _configuration[tracker.id].linkTrackingContent ? anchorElement.innerHTML : undefined;\n // decodeUrl %xx\n sourceHref = unescape(sourceHref);\n tracker.core.track(buildLinkClick({\n targetUrl: sourceHref,\n elementId: elementId,\n elementClasses: elementClasses,\n elementTarget: elementTarget,\n elementContent: elementContent\n }), resolveDynamicContext(context, sourceElement));\n }\n }\n}\n/*\n * Return function to handle click event\n */\nfunction getClickHandler(tracker, context) {\n return function (evt) {\n var button, target;\n evt = evt || window.event;\n button = evt.which || evt.button;\n target = evt.target || evt.srcElement;\n // Using evt.type (added in IE4), we avoid defining separate handlers for mouseup and mousedown.\n if (evt.type === 'click') {\n if (target) {\n processClick(_trackers[tracker], target, context);\n }\n }\n else if (evt.type === 'mousedown') {\n if ((button === 1 || button === 2) && target) {\n _configuration[tracker].lastButton = button;\n _configuration[tracker].lastTarget = target;\n }\n else {\n _configuration[tracker].lastButton = _configuration[tracker].lastTarget = null;\n }\n }\n else if (evt.type === 'mouseup') {\n if (button === _configuration[tracker].lastButton && target === _configuration[tracker].lastTarget) {\n processClick(_trackers[tracker], target, context);\n }\n _configuration[tracker].lastButton = _configuration[tracker].lastTarget = null;\n }\n };\n}\n/*\n * Add click listener to a DOM element\n */\nfunction addClickListener(tracker, element) {\n if (_configuration[tracker].linkTrackingPseudoClicks) {\n // for simplicity and performance, we ignore drag events\n addEventListener(element, 'mouseup', getClickHandler(tracker, _configuration[tracker].linkTrackingContext), false);\n addEventListener(element, 'mousedown', getClickHandler(tracker, _configuration[tracker].linkTrackingContext), false);\n }\n else {\n addEventListener(element, 'click', getClickHandler(tracker, _configuration[tracker].linkTrackingContext), false);\n }\n}\n/*\n * Configures link click tracking: how to filter which links will be tracked,\n * whether to use pseudo click tracking, and what context to attach to link_click events\n */\nfunction configureLinkClickTracking(_a, tracker) {\n var _b = _a === void 0 ? {} : _a, options = _b.options, pseudoClicks = _b.pseudoClicks, trackContent = _b.trackContent, context = _b.context;\n _configuration[tracker] = {\n linkTrackingContent: trackContent,\n linkTrackingContext: context,\n linkTrackingPseudoClicks: pseudoClicks,\n linkTrackingFilter: getFilterByClass(options)\n };\n}\n/*\n * Add click handlers to anchor and AREA elements, except those to be ignored\n */\nfunction addClickListeners(trackerId) {\n var _a, _b;\n var linkElements = document.links, i;\n for (i = 0; i < linkElements.length; i++) {\n // Add a listener to link elements which pass the filter and aren't already tracked\n if (((_b = (_a = _configuration[trackerId]).linkTrackingFilter) === null || _b === void 0 ? void 0 : _b.call(_a, linkElements[i])) && !linkElements[i][trackerId]) {\n addClickListener(trackerId, linkElements[i]);\n linkElements[i][trackerId] = true;\n }\n }\n}\n\nexport { LinkClickTrackingPlugin, enableLinkClickTracking, refreshLinkClickTracking, trackLinkClick };\n//# sourceMappingURL=index.module.js.map\n","/*!\n * Form tracking for Snowplow v3.1.0 (http://bit.ly/sp-js)\n * Copyright 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * Licensed under BSD-3-Clause\n */\n\nimport { addEventListener, getCssClasses, getFilterByClass, getFilterByName } from '@snowplow/browser-tracker-core';\nimport { buildFormFocusOrChange, resolveDynamicContext, buildFormSubmission } from '@snowplow/tracker-core';\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nvar innerElementTags = ['textarea', 'input', 'select'];\nvar defaultTransformFn = function (x) { return x; };\n/*\n * Add submission event listeners to all form elements\n * Add value change event listeners to all mutable inner form elements\n */\nfunction addFormListeners(tracker, configuration) {\n var options = configuration.options, context = configuration.context, trackingMarker = tracker.id + 'form', config = getConfigurationForOptions(options);\n Array.prototype.slice.call(document.getElementsByTagName('form')).forEach(function (form) {\n if (config.formFilter(form) && !form[trackingMarker]) {\n Array.prototype.slice.call(innerElementTags).forEach(function (tagname) {\n Array.prototype.slice.call(form.getElementsByTagName(tagname)).forEach(function (innerElement) {\n if (config.fieldFilter(innerElement) &&\n !innerElement[trackingMarker] &&\n innerElement.type.toLowerCase() !== 'password') {\n addEventListener(innerElement, 'focus', getFormChangeListener(tracker, config, 'focus_form', context), false);\n addEventListener(innerElement, 'change', getFormChangeListener(tracker, config, 'change_form', context), false);\n innerElement[trackingMarker] = true;\n }\n });\n });\n addEventListener(form, 'submit', getFormSubmissionListener(tracker, config, trackingMarker, context));\n form[trackingMarker] = true;\n }\n });\n}\n/*\n * Configures form tracking: which forms and fields will be tracked, and the context to attach\n */\nfunction getConfigurationForOptions(options) {\n if (options) {\n return {\n formFilter: getFilterByClass(options.forms),\n fieldFilter: getFilterByName(options.fields),\n fieldTransform: getTransform(options.fields)\n };\n }\n else {\n return {\n formFilter: function () { return true; },\n fieldFilter: function () { return true; },\n fieldTransform: defaultTransformFn\n };\n }\n}\n/**\n * Convert a criterion object to a transform function\n *\n * @param object - criterion {transform: function (elt) {return the result of transform function applied to element}\n */\nfunction getTransform(criterion) {\n if (criterion && Object.prototype.hasOwnProperty.call(criterion, 'transform')) {\n return criterion.transform;\n }\n return defaultTransformFn;\n}\n/*\n * Get an identifier for a form, input, textarea, or select element\n */\nfunction getElementIdentifier(elt) {\n var properties = ['name', 'id', 'type', 'nodeName'];\n for (var _i = 0, properties_1 = properties; _i < properties_1.length; _i++) {\n var propName = properties_1[_i];\n if (elt[propName] != false && typeof elt[propName] === 'string') {\n return elt[propName];\n }\n }\n return null;\n}\n/*\n * Identifies the parent form in which an element is contained\n */\nfunction getParentFormIdentifier(elt) {\n while (elt && elt.nodeName && elt.nodeName.toUpperCase() !== 'HTML' && elt.nodeName.toUpperCase() !== 'FORM') {\n elt = elt.parentNode;\n }\n if (elt && elt.nodeName && elt.nodeName.toUpperCase() === 'FORM') {\n return getElementIdentifier(elt);\n }\n return null;\n}\n/*\n * Returns a list of the input, textarea, and select elements inside a form along with their values\n */\nfunction getInnerFormElements(trackingMarker, elt) {\n var innerElements = [];\n Array.prototype.slice.call(innerElementTags).forEach(function (tagname) {\n var trackedChildren = Array.prototype.slice.call(elt.getElementsByTagName(tagname)).filter(function (child) {\n return child.hasOwnProperty(trackingMarker);\n });\n Array.prototype.slice.call(trackedChildren).forEach(function (child) {\n if (child.type === 'submit') {\n return;\n }\n var elementJson = {\n name: getElementIdentifier(child),\n value: child.value,\n nodeName: child.nodeName\n };\n if (child.type && child.nodeName.toUpperCase() === 'INPUT') {\n elementJson.type = child.type;\n }\n if ((child.type === 'checkbox' || child.type === 'radio') && !child.checked) {\n elementJson.value = null;\n }\n innerElements.push(elementJson);\n });\n });\n return innerElements;\n}\n/*\n * Return function to handle form field change event\n */\nfunction getFormChangeListener(tracker, config, event_type, context) {\n return function (e) {\n var _a, _b;\n var elt = e.target;\n if (elt) {\n var type = elt.nodeName && elt.nodeName.toUpperCase() === 'INPUT' ? elt.type : null;\n var value = elt.type === 'checkbox' && !elt.checked ? null : config.fieldTransform(elt.value, elt);\n if (event_type === 'change_form' || (type !== 'checkbox' && type !== 'radio')) {\n tracker.core.track(buildFormFocusOrChange({\n schema: event_type,\n formId: (_a = getParentFormIdentifier(elt)) !== null && _a !== void 0 ? _a : '',\n elementId: (_b = getElementIdentifier(elt)) !== null && _b !== void 0 ? _b : '',\n nodeName: elt.nodeName,\n type: type,\n elementClasses: getCssClasses(elt),\n value: value !== null && value !== void 0 ? value : null\n }), resolveDynamicContext(context, elt, type, value));\n }\n }\n };\n}\n/*\n * Return function to handle form submission event\n */\nfunction getFormSubmissionListener(tracker, config, trackingMarker, context) {\n return function (e) {\n var _a;\n var elt = e.target;\n var innerElements = getInnerFormElements(trackingMarker, elt);\n innerElements.forEach(function (innerElement) {\n var _a;\n innerElement.value = (_a = config.fieldTransform(innerElement.value, innerElement)) !== null && _a !== void 0 ? _a : innerElement.value;\n });\n tracker.core.track(buildFormSubmission({\n formId: (_a = getElementIdentifier(elt)) !== null && _a !== void 0 ? _a : '',\n formClasses: getCssClasses(elt),\n elements: innerElements\n }), resolveDynamicContext(context, elt, innerElements));\n };\n}\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nvar _trackers = {};\n/**\n * A plugin which enabled automatic form tracking\n */\nfunction FormTrackingPlugin() {\n return {\n activateBrowserPlugin: function (tracker) {\n _trackers[tracker.id] = tracker;\n }\n };\n}\n/**\n * Enables automatic form tracking\n * An event will be fired when a form field is changed or a form submitted.\n * This can be called multiple times: only forms not already tracked will be tracked.\n *\n * @param configuration - The form tracking configuration\n * @param trackers - The tracker identifiers which the events will be sent to\n */\nfunction enableFormTracking(configuration, trackers) {\n if (configuration === void 0) { configuration = {}; }\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n trackers.forEach(function (t) {\n if (_trackers[t]) {\n if (_trackers[t].sharedState.hasLoaded) {\n addFormListeners(_trackers[t], configuration);\n }\n else {\n _trackers[t].sharedState.registeredOnLoadHandlers.push(function () {\n addFormListeners(_trackers[t], configuration);\n });\n }\n }\n });\n}\n\nexport { FormTrackingPlugin, enableFormTracking };\n//# sourceMappingURL=index.module.js.map\n","/*!\n * Error tracking for Snowplow v3.1.0 (http://bit.ly/sp-js)\n * Copyright 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * Licensed under BSD-3-Clause\n */\n\nimport { dispatchToTrackersInCollection, addEventListener, isFunction } from '@snowplow/browser-tracker-core';\nimport { buildSelfDescribingEvent } from '@snowplow/tracker-core';\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nvar _trackers = {};\nfunction ErrorTrackingPlugin() {\n return {\n activateBrowserPlugin: function (tracker) {\n _trackers[tracker.id] = tracker;\n }\n };\n}\n/**\n * Send error as self-describing event\n *\n * @param event - The event information\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction trackError(event, trackers) {\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n var message = event.message, filename = event.filename, lineno = event.lineno, colno = event.colno, error = event.error, context = event.context, timestamp = event.timestamp, stack = error && error.stack ? error.stack : null;\n dispatchToTrackersInCollection(trackers, _trackers, function (t) {\n t.core.track(buildSelfDescribingEvent({\n event: {\n schema: 'iglu:com.snowplowanalytics.snowplow/application_error/jsonschema/1-0-1',\n data: {\n programmingLanguage: 'JAVASCRIPT',\n message: message !== null && message !== void 0 ? message : \"JS Exception. Browser doesn't support ErrorEvent API\",\n stackTrace: stack,\n lineNumber: lineno,\n lineColumn: colno,\n fileName: filename\n }\n }\n }), context, timestamp);\n });\n}\n/**\n * Enable automatic error tracking, added event handler for 'error' event on window\n * @param configuration - The error tracking configuration\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction enableErrorTracking(configuration, trackers) {\n if (configuration === void 0) { configuration = {}; }\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n var filter = configuration.filter, contextAdder = configuration.contextAdder, context = configuration.context, captureError = function (errorEvent) {\n if ((filter && isFunction(filter) && filter(errorEvent)) || filter == null) {\n sendError({ errorEvent: errorEvent, commonContext: context, contextAdder: contextAdder }, trackers);\n }\n };\n addEventListener(window, 'error', captureError, true);\n}\nfunction sendError(_a, trackers) {\n var errorEvent = _a.errorEvent, commonContext = _a.commonContext, contextAdder = _a.contextAdder;\n var context = commonContext || [];\n if (contextAdder && isFunction(contextAdder)) {\n context = context.concat(contextAdder(errorEvent));\n }\n trackError({\n message: errorEvent.message,\n filename: errorEvent.filename,\n lineno: errorEvent.lineno,\n colno: errorEvent.colno,\n error: errorEvent.error,\n context: context\n }, trackers);\n}\n\nexport { ErrorTrackingPlugin, enableErrorTracking, trackError };\n//# sourceMappingURL=index.module.js.map\n","/*!\n * Attaches timezone to Snowplow events v3.1.0 (http://bit.ly/sp-js)\n * Copyright 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * Licensed under BSD-3-Clause\n */\n\nimport { determine } from 'jstimezonedetect';\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * Populated the Timezone field of the canonical event model\n *\n * @remark\n * Uses Intl where availble and has fallback in older browsers\n */\nfunction TimezonePlugin() {\n return {\n activateBrowserPlugin: function (tracker) {\n tracker.core.setTimezone(determine(typeof Intl !== 'undefined').name());\n }\n };\n}\n\nexport { TimezonePlugin };\n//# sourceMappingURL=index.module.js.map\n","/*!\n * Ecommerce tracking for Snowplow v3.1.0 (http://bit.ly/sp-js)\n * Copyright 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * Licensed under BSD-3-Clause\n */\n\nimport { dispatchToTrackersInCollection } from '@snowplow/browser-tracker-core';\nimport { buildEcommerceTransaction, buildEcommerceTransactionItem, buildAddToCart, buildRemoveFromCart } from '@snowplow/tracker-core';\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nfunction ecommerceTransactionTemplate() {\n return {\n items: []\n };\n}\nvar _trackers = {};\nvar _transactions = {};\n/**\n * Adds ecommerce and cart tracking\n */\nfunction EcommercePlugin() {\n return {\n activateBrowserPlugin: function (tracker) {\n _trackers[tracker.id] = tracker;\n _transactions[tracker.id] = ecommerceTransactionTemplate();\n }\n };\n}\n/**\n * Track an ecommerce transaction\n *\n * @param event - The event information\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction addTrans(event, trackers) {\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n trackers.forEach(function (t) {\n if (_transactions[t]) {\n _transactions[t].transaction = event;\n }\n });\n}\n/**\n * Track an ecommerce transaction item\n *\n * @param event - The event information\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction addItem(event, trackers) {\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n trackers.forEach(function (t) {\n if (_transactions[t]) {\n _transactions[t].items.push(event);\n }\n });\n}\n/**\n * Commit the ecommerce transaction\n *\n * @remark\n * This call will send the data specified with addTrans, ddItem methods to the tracking server.\n */\nfunction trackTrans(trackers) {\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n dispatchToTrackersInCollection(trackers, _trackers, function (t) {\n var transaction = _transactions[t.id].transaction;\n if (transaction) {\n t.core.track(buildEcommerceTransaction(transaction), transaction.context, transaction.timestamp);\n }\n for (var i = 0; i < _transactions[t.id].items.length; i++) {\n var item = _transactions[t.id].items[i];\n t.core.track(buildEcommerceTransactionItem(item), item.context, item.timestamp);\n }\n _transactions[t.id] = ecommerceTransactionTemplate();\n });\n}\n/**\n * Track an add-to-cart event\n *\n * @param event - The event information\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction trackAddToCart(event, trackers) {\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n dispatchToTrackersInCollection(trackers, _trackers, function (t) {\n t.core.track(buildAddToCart(event), event.context, event.timestamp);\n });\n}\n/**\n * Track a remove-from-cart event\n *\n * @param event - The event information\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction trackRemoveFromCart(event, trackers) {\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n dispatchToTrackersInCollection(trackers, _trackers, function (t) {\n t.core.track(buildRemoveFromCart(event), event.context, event.timestamp);\n });\n}\n\nexport { EcommercePlugin, addItem, addTrans, trackAddToCart, trackRemoveFromCart, trackTrans };\n//# sourceMappingURL=index.module.js.map\n","/*!\n * Enhanced Ecommerce tracking for Snowplow v3.1.0 (http://bit.ly/sp-js)\n * Copyright 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * Licensed under BSD-3-Clause\n */\n\nimport { dispatchToTrackersInCollection, parseAndValidateFloat, parseAndValidateInt } from '@snowplow/browser-tracker-core';\nimport { buildSelfDescribingEvent } from '@snowplow/tracker-core';\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nvar _trackers = {};\nvar _context = {};\n/**\n * For tracking GA Enhanced Ecommerce events and contexts\n * {@link https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce}\n */\nfunction EnhancedEcommercePlugin() {\n return {\n activateBrowserPlugin: function (tracker) {\n _trackers[tracker.id] = tracker;\n _context[tracker.id] = [];\n }\n };\n}\n/**\n * Track a GA Enhanced Ecommerce Action with all stored\n * Enhanced Ecommerce contexts\n *\n * @param event\n * @param trackers\n */\nfunction trackEnhancedEcommerceAction(event, trackers) {\n if (event === void 0) { event = {}; }\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n dispatchToTrackersInCollection(trackers, _trackers, function (t) {\n var combinedContexts = _context[t.id].concat(event.context || []);\n _context[t.id].length = 0;\n t.core.track(buildSelfDescribingEvent({\n event: {\n schema: 'iglu:com.google.analytics.enhanced-ecommerce/action/jsonschema/1-0-0',\n data: {\n action: event.action\n }\n }\n }), combinedContexts, event.timestamp);\n });\n}\n/**\n * Adds a GA Enhanced Ecommerce Action Context\n *\n * @param context - The context to be stored\n * @param trackers - The tracker identifiers which the context will be stored against\n */\nfunction addEnhancedEcommerceActionContext(context, trackers) {\n if (context === void 0) { context = {}; }\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n var id = context.id, affiliation = context.affiliation, revenue = context.revenue, tax = context.tax, shipping = context.shipping, coupon = context.coupon, list = context.list, step = context.step, option = context.option, currency = context.currency;\n trackers.forEach(function (trackerId) {\n if (_context[trackerId]) {\n _context[trackerId].push({\n schema: 'iglu:com.google.analytics.enhanced-ecommerce/actionFieldObject/jsonschema/1-0-0',\n data: {\n id: id,\n affiliation: affiliation,\n revenue: parseAndValidateFloat(revenue),\n tax: parseAndValidateFloat(tax),\n shipping: parseAndValidateFloat(shipping),\n coupon: coupon,\n list: list,\n step: parseAndValidateInt(step),\n option: option,\n currency: currency\n }\n });\n }\n });\n}\n/**\n * Adds a GA Enhanced Ecommerce Impression Context\n *\n * @param context - The context to be stored\n * @param trackers - The tracker identifiers which the context will be stored against\n */\nfunction addEnhancedEcommerceImpressionContext(context, trackers) {\n if (context === void 0) { context = {}; }\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n var id = context.id, name = context.name, list = context.list, brand = context.brand, category = context.category, variant = context.variant, position = context.position, price = context.price, currency = context.currency;\n trackers.forEach(function (trackerId) {\n if (_context[trackerId]) {\n _context[trackerId].push({\n schema: 'iglu:com.google.analytics.enhanced-ecommerce/impressionFieldObject/jsonschema/1-0-0',\n data: {\n id: id,\n name: name,\n list: list,\n brand: brand,\n category: category,\n variant: variant,\n position: parseAndValidateInt(position),\n price: parseAndValidateFloat(price),\n currency: currency\n }\n });\n }\n });\n}\n/**\n * Adds a GA Enhanced Ecommerce Product Context\n *\n * @param context - The context to be stored\n * @param trackers - The tracker identifiers which the context will be stored against\n */\nfunction addEnhancedEcommerceProductContext(context, trackers) {\n if (context === void 0) { context = {}; }\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n var id = context.id, name = context.name, list = context.list, brand = context.brand, category = context.category, variant = context.variant, price = context.price, quantity = context.quantity, coupon = context.coupon, position = context.position, currency = context.currency;\n trackers.forEach(function (trackerId) {\n if (_context[trackerId]) {\n _context[trackerId].push({\n schema: 'iglu:com.google.analytics.enhanced-ecommerce/productFieldObject/jsonschema/1-0-0',\n data: {\n id: id,\n name: name,\n list: list,\n brand: brand,\n category: category,\n variant: variant,\n price: parseAndValidateFloat(price),\n quantity: parseAndValidateInt(quantity),\n coupon: coupon,\n position: parseAndValidateInt(position),\n currency: currency\n }\n });\n }\n });\n}\n/**\n * Adds a GA Enhanced Ecommerce Promo Context\n *\n * @param context - The context to be stored\n * @param trackers - The tracker identifiers which the context will be stored against\n */\nfunction addEnhancedEcommercePromoContext(context, trackers) {\n if (context === void 0) { context = {}; }\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n var id = context.id, name = context.name, creative = context.creative, position = context.position, currency = context.currency;\n trackers.forEach(function (trackerId) {\n if (_context[trackerId]) {\n _context[trackerId].push({\n schema: 'iglu:com.google.analytics.enhanced-ecommerce/promoFieldObject/jsonschema/1-0-0',\n data: {\n id: id,\n name: name,\n creative: creative,\n position: position,\n currency: currency\n }\n });\n }\n });\n}\n\nexport { EnhancedEcommercePlugin, addEnhancedEcommerceActionContext, addEnhancedEcommerceImpressionContext, addEnhancedEcommerceProductContext, addEnhancedEcommercePromoContext, trackEnhancedEcommerceAction };\n//# sourceMappingURL=index.module.js.map\n","/*!\n * Ad tracking for Snowplow v3.1.0 (http://bit.ly/sp-js)\n * Copyright 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * Licensed under BSD-3-Clause\n */\n\nimport { dispatchToTrackersInCollection } from '@snowplow/browser-tracker-core';\nimport { buildAdImpression, buildAdClick, buildAdConversion } from '@snowplow/tracker-core';\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nvar _trackers = {};\n/**\n * Adds advertisement tracking functions\n */\nfunction AdTrackingPlugin() {\n return {\n activateBrowserPlugin: function (tracker) {\n _trackers[tracker.id] = tracker;\n }\n };\n}\n/**\n * Track an ad being served\n *\n * @param event - The event information\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction trackAdImpression(event, trackers) {\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n dispatchToTrackersInCollection(trackers, _trackers, function (t) {\n t.core.track(buildAdImpression(event), event.context, event.timestamp);\n });\n}\n/**\n * Track an ad being clicked\n *\n * @param event - The event information\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction trackAdClick(event, trackers) {\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n dispatchToTrackersInCollection(trackers, _trackers, function (t) {\n t.core.track(buildAdClick(event), event.context, event.timestamp);\n });\n}\n/**\n * Track an ad conversion event\n *\n * @param event - The event information\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction trackAdConversion(event, trackers) {\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n dispatchToTrackersInCollection(trackers, _trackers, function (t) {\n t.core.track(buildAdConversion(event), event.context, event.timestamp);\n });\n}\n\nexport { AdTrackingPlugin, trackAdClick, trackAdConversion, trackAdImpression };\n//# sourceMappingURL=index.module.js.map\n","/*!\n * Site tracking for Snowplow v3.1.0 (http://bit.ly/sp-js)\n * Copyright 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * Licensed under BSD-3-Clause\n */\n\nimport { dispatchToTrackersInCollection } from '@snowplow/browser-tracker-core';\nimport { buildSocialInteraction, buildSiteSearch, buildSelfDescribingEvent } from '@snowplow/tracker-core';\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nvar _trackers = {};\nfunction SiteTrackingPlugin() {\n return {\n activateBrowserPlugin: function (tracker) {\n _trackers[tracker.id] = tracker;\n }\n };\n}\n/**\n * Track a social interaction event\n *\n * @param event - The event information\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction trackSocialInteraction(event, trackers) {\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n dispatchToTrackersInCollection(trackers, _trackers, function (t) {\n t.core.track(buildSocialInteraction(event), event.context, event.timestamp);\n });\n}\n/**\n * Track an internal search event\n *\n * @param event - The event information\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction trackSiteSearch(event, trackers) {\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n dispatchToTrackersInCollection(trackers, _trackers, function (t) {\n t.core.track(buildSiteSearch(event), event.context, event.timestamp);\n });\n}\n/**\n * Track a timing event (such as the time taken for a resource to load)\n *\n * @param event - The event information\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction trackTiming(event, trackers) {\n if (trackers === void 0) { trackers = Object.keys(_trackers); }\n var category = event.category, variable = event.variable, timing = event.timing, label = event.label, context = event.context, timestamp = event.timestamp;\n dispatchToTrackersInCollection(trackers, _trackers, function (t) {\n t.core.track(buildSelfDescribingEvent({\n event: {\n schema: 'iglu:com.snowplowanalytics.snowplow/timing/jsonschema/1-0-0',\n data: {\n category: category,\n variable: variable,\n timing: timing,\n label: label\n }\n }\n }), context, timestamp);\n });\n}\n\nexport { SiteTrackingPlugin, trackSiteSearch, trackSocialInteraction, trackTiming };\n//# sourceMappingURL=index.module.js.map\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/uuidjs/uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","var v1 = require('./v1');\nvar v4 = require('./v4');\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n","(function() {\n var base64map\n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n\n crypt = {\n // Bit-wise rotation left\n rotl: function(n, b) {\n return (n << b) | (n >>> (32 - b));\n },\n\n // Bit-wise rotation right\n rotr: function(n, b) {\n return (n << (32 - b)) | (n >>> b);\n },\n\n // Swap big-endian to little-endian and vice versa\n endian: function(n) {\n // If number given, swap endian\n if (n.constructor == Number) {\n return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;\n }\n\n // Else, assume array and swap all items\n for (var i = 0; i < n.length; i++)\n n[i] = crypt.endian(n[i]);\n return n;\n },\n\n // Generate an array of any length of random bytes\n randomBytes: function(n) {\n for (var bytes = []; n > 0; n--)\n bytes.push(Math.floor(Math.random() * 256));\n return bytes;\n },\n\n // Convert a byte array to big-endian 32-bit words\n bytesToWords: function(bytes) {\n for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)\n words[b >>> 5] |= bytes[i] << (24 - b % 32);\n return words;\n },\n\n // Convert big-endian 32-bit words to a byte array\n wordsToBytes: function(words) {\n for (var bytes = [], b = 0; b < words.length * 32; b += 8)\n bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a hex string\n bytesToHex: function(bytes) {\n for (var hex = [], i = 0; i < bytes.length; i++) {\n hex.push((bytes[i] >>> 4).toString(16));\n hex.push((bytes[i] & 0xF).toString(16));\n }\n return hex.join('');\n },\n\n // Convert a hex string to a byte array\n hexToBytes: function(hex) {\n for (var bytes = [], c = 0; c < hex.length; c += 2)\n bytes.push(parseInt(hex.substr(c, 2), 16));\n return bytes;\n },\n\n // Convert a byte array to a base-64 string\n bytesToBase64: function(bytes) {\n for (var base64 = [], i = 0; i < bytes.length; i += 3) {\n var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];\n for (var j = 0; j < 4; j++)\n if (i * 8 + j * 6 <= bytes.length * 8)\n base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));\n else\n base64.push('=');\n }\n return base64.join('');\n },\n\n // Convert a base-64 string to a byte array\n base64ToBytes: function(base64) {\n // Remove non-base-64 characters\n base64 = base64.replace(/[^A-Z0-9+\\/]/ig, '');\n\n for (var bytes = [], i = 0, imod4 = 0; i < base64.length;\n imod4 = ++i % 4) {\n if (imod4 == 0) continue;\n bytes.push(((base64map.indexOf(base64.charAt(i - 1))\n & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))\n | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));\n }\n return bytes;\n }\n };\n\n module.exports = crypt;\n})();\n","var charenc = {\n // UTF-8 encoding\n utf8: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));\n }\n },\n\n // Binary encoding\n bin: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n for (var bytes = [], i = 0; i < str.length; i++)\n bytes.push(str.charCodeAt(i) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n for (var str = [], i = 0; i < bytes.length; i++)\n str.push(String.fromCharCode(bytes[i]));\n return str.join('');\n }\n }\n};\n\nmodule.exports = charenc;\n","(function() {\n var crypt = require('crypt'),\n utf8 = require('charenc').utf8,\n bin = require('charenc').bin,\n\n // The core\n sha1 = function (message) {\n // Convert to byte array\n if (message.constructor == String)\n message = utf8.stringToBytes(message);\n else if (typeof Buffer !== 'undefined' && typeof Buffer.isBuffer == 'function' && Buffer.isBuffer(message))\n message = Array.prototype.slice.call(message, 0);\n else if (!Array.isArray(message))\n message = message.toString();\n\n // otherwise assume byte array\n\n var m = crypt.bytesToWords(message),\n l = message.length * 8,\n w = [],\n H0 = 1732584193,\n H1 = -271733879,\n H2 = -1732584194,\n H3 = 271733878,\n H4 = -1009589776;\n\n // Padding\n m[l >> 5] |= 0x80 << (24 - l % 32);\n m[((l + 64 >>> 9) << 4) + 15] = l;\n\n for (var i = 0; i < m.length; i += 16) {\n var a = H0,\n b = H1,\n c = H2,\n d = H3,\n e = H4;\n\n for (var j = 0; j < 80; j++) {\n\n if (j < 16)\n w[j] = m[i + j];\n else {\n var n = w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16];\n w[j] = (n << 1) | (n >>> 31);\n }\n\n var t = ((H0 << 5) | (H0 >>> 27)) + H4 + (w[j] >>> 0) + (\n j < 20 ? (H1 & H2 | ~H1 & H3) + 1518500249 :\n j < 40 ? (H1 ^ H2 ^ H3) + 1859775393 :\n j < 60 ? (H1 & H2 | H1 & H3 | H2 & H3) - 1894007588 :\n (H1 ^ H2 ^ H3) - 899497514);\n\n H4 = H3;\n H3 = H2;\n H2 = (H1 << 30) | (H1 >>> 2);\n H1 = H0;\n H0 = t;\n }\n\n H0 += a;\n H1 += b;\n H2 += c;\n H3 += d;\n H4 += e;\n }\n\n return [H0, H1, H2, H3, H4];\n },\n\n // Public API\n api = function (message, options) {\n var digestbytes = crypt.wordsToBytes(sha1(message));\n return options && options.asBytes ? digestbytes :\n options && options.asString ? bin.bytesToString(digestbytes) :\n crypt.bytesToHex(digestbytes);\n };\n\n api._blocksize = 16;\n api._digestsize = 20;\n\n module.exports = api;\n})();\n","/*!\n * Browser tracker for Snowplow v3.1.0 (http://bit.ly/sp-js)\n * Copyright 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * Licensed under BSD-3-Clause\n */\n\nimport { dispatchToTrackers, createSharedState, addTracker } from '@snowplow/browser-tracker-core';\nimport { buildStructEvent, buildSelfDescribingEvent, version } from '@snowplow/tracker-core';\nexport { version } from '@snowplow/tracker-core';\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * Expires current session and starts a new session.\n *\n * @param trackers - The tracker identifiers which will have their session refreshed\n */\nfunction newSession(trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.newSession();\n });\n}\n/**\n * Override referrer\n *\n * @param url - Custom Referrer which will be used as override\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction setReferrerUrl(url, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setReferrerUrl(url);\n });\n}\n/**\n * Override url\n *\n * @param url - Custom URL which will be used as override\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction setCustomUrl(url, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setCustomUrl(url);\n });\n}\n/**\n * Override document.title\n *\n * @param title - Document title which will be used as override\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction setDocumentTitle(title, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setDocumentTitle(title);\n });\n}\n/**\n * Strip hash tag (or anchor) from URL\n *\n * @param enable - Whether to enable stripping of hash\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction discardHashTag(enable, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.discardHashTag(enable);\n });\n}\n/**\n * Strip braces from URL\n *\n * @param enable - Whther to enable stripping of braces\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction discardBrace(enable, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.discardBrace(enable);\n });\n}\n/**\n * Set first-party cookie path\n *\n * @param path - The path which will be used when setting cookies\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction setCookiePath(path, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setCookiePath(path);\n });\n}\n/**\n * Set visitor cookie timeout (in seconds)\n *\n * @param timeout - The timeout until cookies will expire\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction setVisitorCookieTimeout(timeout, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setVisitorCookieTimeout(timeout);\n });\n}\n/**\n * Enable querystring decoration for links pasing a filter\n *\n * @param crossDomainLinker - Function used to determine which links to decorate\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction crossDomainLinker(crossDomainLinkerCriterion, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.crossDomainLinker(crossDomainLinkerCriterion);\n });\n}\n/**\n * Enables page activity tracking (sends page pings to the Collector regularly).\n *\n * @param configuration - The activity tracking configuration\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction enableActivityTracking(configuration, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.enableActivityTracking(configuration);\n });\n}\n/**\n * Enables page activity tracking (replaces collector ping with callback).\n *\n * @param configuration - The activity tracking callback configuration\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction enableActivityTrackingCallback(configuration, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.enableActivityTrackingCallback(configuration);\n });\n}\n/**\n * Triggers the activityHandler manually to allow external user defined activity. i.e. While watching a video\n *\n * @param trackers - The tracker identifiers which will be updated\n */\nfunction updatePageActivity(trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.updatePageActivity();\n });\n}\n/**\n * Sets the opt out cookie.\n *\n * @param name - of the opt out cookie\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction setOptOutCookie(name, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setOptOutCookie(name);\n });\n}\n/**\n * Set the business-defined user ID for this user.\n *\n * @param userId - The business-defined user ID\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction setUserId(userId, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setUserId(userId);\n });\n}\n/**\n * Set the business-defined user ID for this user using the location querystring.\n *\n * @param querystringField - Name of a querystring name-value pair\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction setUserIdFromLocation(querystringField, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setUserIdFromLocation(querystringField);\n });\n}\n/**\n * Set the business-defined user ID for this user using the referrer querystring.\n *\n * @param querystringField - Name of a querystring name-value pair\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction setUserIdFromReferrer(querystringField, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setUserIdFromReferrer(querystringField);\n });\n}\n/**\n * Set the business-defined user ID for this user to the value of a cookie.\n *\n * @param cookieName - Name of the cookie whose value will be assigned to businessUserId\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction setUserIdFromCookie(cookieName, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setUserIdFromCookie(cookieName);\n });\n}\n/**\n * Specify the Snowplow collector URL. Specific http or https to force it\n * or leave it off to match the website protocol.\n *\n * @param collectorUrl - The collector URL, with or without protocol\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction setCollectorUrl(collectorUrl, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setCollectorUrl(collectorUrl);\n });\n}\n/**\n * Set the buffer size\n * Can be useful if you want to stop batching requests to ensure events start\n * sending closer to event creation\n *\n * @param newBufferSize - The value with which to update the bufferSize to\n * @param trackers - The tracker identifiers which will be flushed\n */\nfunction setBufferSize(newBufferSize, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setBufferSize(newBufferSize);\n });\n}\n/**\n * Send all events in the outQueue\n * Only need to use this when sending events with a bufferSize of at least 2\n *\n * @param configuration - The configuration to use following flushing the buffer\n * @param trackers - The tracker identifiers which will be flushed\n */\nfunction flushBuffer(configuration, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.flushBuffer(configuration);\n });\n}\n/**\n * Track a visit to a web page\n *\n * @param event - The Page View Event properties\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction trackPageView(event, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.trackPageView(event);\n });\n}\n/**\n * Track a structured event\n * A classic style of event tracking, allows for easier movement between analytics\n * systems. A loosely typed event, creating a Self Describing event is preferred, but\n * useful for interoperability.\n *\n * @param event - The Structured Event properties\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction trackStructEvent(event, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.core.track(buildStructEvent(event), event.context, event.timestamp);\n });\n}\n/**\n * Track a self-describing event happening on this page.\n * A custom event type, allowing for an event to be tracked using your own custom schema\n * and a data object which conforms to the supplied schema\n *\n * @param event - The event information\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction trackSelfDescribingEvent(event, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.core.track(buildSelfDescribingEvent({ event: event.event }), event.context, event.timestamp);\n });\n}\n/**\n * All provided contexts will be sent with every event\n *\n * @param contexts - An array of contexts or conditional contexts\n * @param trackers - The tracker identifiers which the global contexts will be added to\n */\nfunction addGlobalContexts(contexts, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.core.addGlobalContexts(contexts);\n });\n}\n/**\n * All provided contexts will no longer be sent with every event\n *\n * @param contexts - An array of contexts or conditional contexts\n * @param trackers - The tracker identifiers which the global contexts will be remove from\n */\nfunction removeGlobalContexts(contexts, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.core.removeGlobalContexts(contexts);\n });\n}\n/**\n * Clear all global contexts that are sent with events\n *\n * @param trackers - The tracker identifiers which the global contexts will be cleared from\n */\nfunction clearGlobalContexts(trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.core.clearGlobalContexts();\n });\n}\n/**\n * Stop regenerating `pageViewId` (available from `web_page` context)\n *\n * @param trackers - The tracker identifiers which the event will preserve their Page View Ids\n */\nfunction preservePageViewId(trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.preservePageViewId();\n });\n}\n/**\n * Disables anonymous tracking if active (ie. tracker initialized with `anonymousTracking`)\n * For stateStorageStrategy override, uses supplied value first,\n * falls back to one defined in initial config, otherwise uses cookieAndLocalStorage.\n *\n * @param configuration - The configuration for disabling anonymous tracking\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction disableAnonymousTracking(configuration, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.disableAnonymousTracking(configuration);\n });\n}\n/**\n * Enables anonymous tracking (ie. tracker initialized without `anonymousTracking`)\n *\n * @param configuration - The configuration for enabling anonymous tracking\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction enableAnonymousTracking(configuration, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.enableAnonymousTracking(configuration);\n });\n}\n/**\n * Clears all cookies and local storage containing user and session identifiers\n *\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction clearUserData(configuration, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.clearUserData(configuration);\n });\n}\n/**\n * Add a plugin into the plugin collection after trackers have already been initialised\n *\n * @param configuration - The plugin to add\n * @param trackers - The tracker identifiers which the plugin will be added to\n */\nfunction addPlugin(configuration, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.addPlugin(configuration);\n });\n}\n\n/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nvar state = typeof window !== 'undefined' ? createSharedState() : undefined;\n/**\n * Initialise a new tracker\n *\n * @param trackerId - The tracker id - also known as tracker namespace\n * @param endpoint - Collector endpoint in the form collector.mysite.com\n * @param configuration - The initialisation options of the tracker\n */\nfunction newTracker(trackerId, endpoint, configuration) {\n if (configuration === void 0) { configuration = {}; }\n if (state) {\n return addTracker(trackerId, trackerId, \"js-\" + version, endpoint, state, configuration);\n }\n else {\n return undefined;\n }\n}\n\nexport { addGlobalContexts, addPlugin, clearGlobalContexts, clearUserData, crossDomainLinker, disableAnonymousTracking, discardBrace, discardHashTag, enableActivityTracking, enableActivityTrackingCallback, enableAnonymousTracking, flushBuffer, newSession, newTracker, preservePageViewId, removeGlobalContexts, setBufferSize, setCollectorUrl, setCookiePath, setCustomUrl, setDocumentTitle, setOptOutCookie, setReferrerUrl, setUserId, setUserIdFromCookie, setUserIdFromLocation, setUserIdFromReferrer, setVisitorCookieTimeout, trackPageView, trackSelfDescribingEvent, trackStructEvent, updatePageActivity };\n//# sourceMappingURL=index.module.js.map\n","/* jstz.min.js Version: 1.0.6 Build date: 2019-09-09 */\n!function(e){var a=function(){\"use strict\";var e=\"s\",s={DAY:864e5,HOUR:36e5,MINUTE:6e4,SECOND:1e3,BASELINE_YEAR:2014,MAX_SCORE:864e6,AMBIGUITIES:{\"America/Denver\":[\"America/Mazatlan\"],\"America/Chicago\":[\"America/Mexico_City\"],\"America/Asuncion\":[\"America/Campo_Grande\",\"America/Santiago\"],\"America/Montevideo\":[\"America/Sao_Paulo\",\"America/Santiago\"],\"Asia/Beirut\":[\"Asia/Amman\",\"Asia/Jerusalem\",\"Europe/Helsinki\",\"Asia/Damascus\",\"Africa/Cairo\",\"Asia/Gaza\",\"Europe/Minsk\",\"Africa/Windhoek\"],\"Pacific/Auckland\":[\"Pacific/Fiji\"],\"America/Los_Angeles\":[\"America/Santa_Isabel\"],\"America/New_York\":[\"America/Havana\"],\"America/Halifax\":[\"America/Goose_Bay\"],\"America/Godthab\":[\"America/Miquelon\"],\"Asia/Dubai\":[\"Asia/Yerevan\"],\"Asia/Jakarta\":[\"Asia/Krasnoyarsk\"],\"Asia/Shanghai\":[\"Asia/Irkutsk\",\"Australia/Perth\"],\"Australia/Sydney\":[\"Australia/Lord_Howe\"],\"Asia/Tokyo\":[\"Asia/Yakutsk\"],\"Asia/Dhaka\":[\"Asia/Omsk\"],\"Asia/Baku\":[\"Asia/Yerevan\"],\"Australia/Brisbane\":[\"Asia/Vladivostok\"],\"Pacific/Noumea\":[\"Asia/Vladivostok\"],\"Pacific/Majuro\":[\"Asia/Kamchatka\",\"Pacific/Fiji\"],\"Pacific/Tongatapu\":[\"Pacific/Apia\"],\"Asia/Baghdad\":[\"Europe/Minsk\",\"Europe/Moscow\"],\"Asia/Karachi\":[\"Asia/Yekaterinburg\"],\"Africa/Johannesburg\":[\"Asia/Gaza\",\"Africa/Cairo\"]}},i=function(e){var a=-e.getTimezoneOffset();return null!==a?a:0},r=function(){for(var e=[],a=0;a<=11;a++)for(var r=1;r<=28;r++){var n=i(new Date(s.BASELINE_YEAR,a,r));e?e&&e[e.length-1]!==n&&e.push(n):e.push()}return e},n=function(){var a=0,s=r();return s.length>1&&(a=s[0]-s[1]),s.length>3?s[0]+\",1,weird\":a<0?s[0]+\",1\":a>0?s[1]+\",1,\"+e:s[0]+\",0\"},o=function(){var e,a;if(Intl&&\"undefined\"!=typeof Intl&&\"undefined\"!=typeof Intl.DateTimeFormat&&(e=Intl.DateTimeFormat(),\"undefined\"!=typeof e&&\"undefined\"!=typeof e.resolvedOptions))return a=e.resolvedOptions().timeZone,a&&(a.indexOf(\"/\")>-1||\"UTC\"===a)?a:void 0},t=function(e){for(var a=new Date(e,0,1,0,0,1,0).getTime(),s=new Date(e,12,31,23,59,59).getTime(),i=a,r=new Date(i).getTimezoneOffset(),n=null,o=null;i<s-864e5;){var t=new Date(i),A=t.getTimezoneOffset();A!==r&&(A<r&&(n=t),A>r&&(o=t),r=A),i+=864e5}return!(!n||!o)&&{s:u(n).getTime(),e:u(o).getTime()}},u=function f(e,a,i){\"undefined\"==typeof a&&(a=s.DAY,i=s.HOUR);for(var r=new Date(e.getTime()-a).getTime(),n=e.getTime()+a,o=new Date(r).getTimezoneOffset(),t=r,u=null;t<n-i;){var A=new Date(t),c=A.getTimezoneOffset();if(c!==o){u=A;break}t+=i}return a===s.DAY?f(u,s.HOUR,s.MINUTE):a===s.HOUR?f(u,s.MINUTE,s.SECOND):u},A=function(e,a,s,i){if(\"N/A\"!==s)return s;if(\"Asia/Beirut\"===a){if(\"Africa/Cairo\"===i.name&&13983768e5===e[6].s&&14116788e5===e[6].e)return 0;if(\"Asia/Jerusalem\"===i.name&&13959648e5===e[6].s&&14118588e5===e[6].e)return 0}else if(\"America/Santiago\"===a){if(\"America/Asuncion\"===i.name&&14124816e5===e[6].s&&1397358e6===e[6].e)return 0;if(\"America/Campo_Grande\"===i.name&&14136912e5===e[6].s&&13925196e5===e[6].e)return 0}else if(\"America/Montevideo\"===a){if(\"America/Sao_Paulo\"===i.name&&14136876e5===e[6].s&&1392516e6===e[6].e)return 0}else if(\"Pacific/Auckland\"===a&&\"Pacific/Fiji\"===i.name&&14142456e5===e[6].s&&13961016e5===e[6].e)return 0;return s},c=function(e,i){for(var r=function(a){for(var r=0,n=0;n<e.length;n++)if(a.rules[n]&&e[n]){if(!(e[n].s>=a.rules[n].s&&e[n].e<=a.rules[n].e)){r=\"N/A\";break}if(r=0,r+=Math.abs(e[n].s-a.rules[n].s),r+=Math.abs(a.rules[n].e-e[n].e),r>s.MAX_SCORE){r=\"N/A\";break}}return r=A(e,i,r,a)},n={},o=a.olson.dst_rules.zones,t=o.length,u=s.AMBIGUITIES[i],c=0;c<t;c++){var m=o[c],l=r(o[c]);\"N/A\"!==l&&(n[m.name]=l)}for(var f in n)if(n.hasOwnProperty(f))for(var d=0;d<u.length;d++)if(u[d]===f)return f;return i},m=function(e){var s=function(){for(var e=[],s=0;s<a.olson.dst_rules.years.length;s++){var i=t(a.olson.dst_rules.years[s]);e.push(i)}return e},i=function(e){for(var a=0;a<e.length;a++)if(e[a]!==!1)return!0;return!1},r=s(),n=i(r);return n?c(r,e):e},l=function(e){var i=!1,t=n();return(e||\"undefined\"==typeof e)&&(i=o()),i||(i=a.olson.timezones[t],\"undefined\"!=typeof s.AMBIGUITIES[i]&&(i=m(i))),{name:function(){return i},using_intl:e||\"undefined\"==typeof e,needle:t,offsets:r()}};return{determine:l}}();a.olson=a.olson||{},a.olson.timezones={\"-720,0\":\"Etc/GMT+12\",\"-660,0\":\"Pacific/Pago_Pago\",\"-660,1,s\":\"Pacific/Apia\",\"-600,1\":\"America/Adak\",\"-600,0\":\"Pacific/Honolulu\",\"-570,0\":\"Pacific/Marquesas\",\"-540,0\":\"Pacific/Gambier\",\"-540,1\":\"America/Anchorage\",\"-480,1\":\"America/Los_Angeles\",\"-480,0\":\"Pacific/Pitcairn\",\"-420,0\":\"America/Phoenix\",\"-420,1\":\"America/Denver\",\"-360,0\":\"America/Guatemala\",\"-360,1\":\"America/Chicago\",\"-360,1,s\":\"Pacific/Easter\",\"-300,0\":\"America/Bogota\",\"-300,1\":\"America/New_York\",\"-270,0\":\"America/Caracas\",\"-240,1\":\"America/Halifax\",\"-240,0\":\"America/Santo_Domingo\",\"-240,1,s\":\"America/Asuncion\",\"-210,1\":\"America/St_Johns\",\"-180,1\":\"America/Godthab\",\"-180,0\":\"America/Buenos_Aires\",\"-180,1,s\":\"America/Montevideo\",\"-120,0\":\"America/Noronha\",\"-120,1\":\"America/Noronha\",\"-60,1\":\"Atlantic/Azores\",\"-60,0\":\"Atlantic/Cape_Verde\",\"0,0\":\"UTC\",\"0,1\":\"Europe/London\",\"0,1,weird\":\"Africa/Casablanca\",\"60,1\":\"Europe/Berlin\",\"60,0\":\"Africa/Lagos\",\"60,1,weird\":\"Africa/Casablanca\",\"120,1\":\"Asia/Beirut\",\"120,1,weird\":\"Africa/Cairo\",\"120,0\":\"Africa/Johannesburg\",\"180,0\":\"Asia/Baghdad\",\"180,1\":\"Europe/Moscow\",\"210,1\":\"Asia/Tehran\",\"240,0\":\"Asia/Dubai\",\"240,1\":\"Asia/Baku\",\"270,0\":\"Asia/Kabul\",\"300,1\":\"Asia/Yekaterinburg\",\"300,0\":\"Asia/Karachi\",\"330,0\":\"Asia/Calcutta\",\"345,0\":\"Asia/Katmandu\",\"360,0\":\"Asia/Dhaka\",\"360,1\":\"Asia/Omsk\",\"390,0\":\"Asia/Rangoon\",\"420,1\":\"Asia/Krasnoyarsk\",\"420,0\":\"Asia/Jakarta\",\"480,0\":\"Asia/Shanghai\",\"480,1\":\"Asia/Irkutsk\",\"525,0\":\"Australia/Eucla\",\"525,1,s\":\"Australia/Eucla\",\"540,1\":\"Asia/Yakutsk\",\"540,0\":\"Asia/Tokyo\",\"570,0\":\"Australia/Darwin\",\"570,1,s\":\"Australia/Adelaide\",\"600,0\":\"Australia/Brisbane\",\"600,1\":\"Asia/Vladivostok\",\"600,1,s\":\"Australia/Sydney\",\"630,1,s\":\"Australia/Lord_Howe\",\"660,1\":\"Asia/Kamchatka\",\"660,0\":\"Pacific/Noumea\",\"690,0\":\"Pacific/Norfolk\",\"720,1,s\":\"Pacific/Auckland\",\"720,0\":\"Pacific/Majuro\",\"765,1,s\":\"Pacific/Chatham\",\"780,0\":\"Pacific/Tongatapu\",\"780,1,s\":\"Pacific/Apia\",\"840,0\":\"Pacific/Kiritimati\"},a.olson.dst_rules={years:[2008,2009,2010,2011,2012,2013,2014],zones:[{name:\"Africa/Cairo\",rules:[{e:12199572e5,s:12090744e5},{e:1250802e6,s:1240524e6},{e:12858804e5,s:12840696e5},!1,!1,!1,{e:14116788e5,s:1406844e6}]},{name:\"America/Asuncion\",rules:[{e:12050316e5,s:12243888e5},{e:12364812e5,s:12558384e5},{e:12709548e5,s:12860784e5},{e:13024044e5,s:1317528e6},{e:1333854e6,s:13495824e5},{e:1364094e6,s:1381032e6},{e:13955436e5,s:14124816e5}]},{name:\"America/Campo_Grande\",rules:[{e:12032172e5,s:12243888e5},{e:12346668e5,s:12558384e5},{e:12667212e5,s:1287288e6},{e:12981708e5,s:13187376e5},{e:13302252e5,s:1350792e6},{e:136107e7,s:13822416e5},{e:13925196e5,s:14136912e5}]},{name:\"America/Goose_Bay\",rules:[{e:122559486e4,s:120503526e4},{e:125704446e4,s:123648486e4},{e:128909886e4,s:126853926e4},{e:13205556e5,s:129998886e4},{e:13520052e5,s:13314456e5},{e:13834548e5,s:13628952e5},{e:14149044e5,s:13943448e5}]},{name:\"America/Havana\",rules:[{e:12249972e5,s:12056436e5},{e:12564468e5,s:12364884e5},{e:12885012e5,s:12685428e5},{e:13211604e5,s:13005972e5},{e:13520052e5,s:13332564e5},{e:13834548e5,s:13628916e5},{e:14149044e5,s:13943412e5}]},{name:\"America/Mazatlan\",rules:[{e:1225008e6,s:12074724e5},{e:12564576e5,s:1238922e6},{e:1288512e6,s:12703716e5},{e:13199616e5,s:13018212e5},{e:13514112e5,s:13332708e5},{e:13828608e5,s:13653252e5},{e:14143104e5,s:13967748e5}]},{name:\"America/Mexico_City\",rules:[{e:12250044e5,s:12074688e5},{e:1256454e6,s:12389184e5},{e:12885084e5,s:1270368e6},{e:1319958e6,s:13018176e5},{e:13514076e5,s:13332672e5},{e:13828572e5,s:13653216e5},{e:14143068e5,s:13967712e5}]},{name:\"America/Miquelon\",rules:[{e:12255984e5,s:12050388e5},{e:1257048e6,s:12364884e5},{e:12891024e5,s:12685428e5},{e:1320552e6,s:12999924e5},{e:13520016e5,s:1331442e6},{e:13834512e5,s:13628916e5},{e:14149008e5,s:13943412e5}]},{name:\"America/Santa_Isabel\",rules:[{e:12250116e5,s:1207476e6},{e:12564612e5,s:12389256e5},{e:12891204e5,s:12685608e5},{e:132057e7,s:13000104e5},{e:13520196e5,s:133146e7},{e:13834692e5,s:13629096e5},{e:14149188e5,s:13943592e5}]},{name:\"America/Santiago\",rules:[{e:1206846e6,s:1223784e6},{e:1237086e6,s:12552336e5},{e:127035e7,s:12866832e5},{e:13048236e5,s:13138992e5},{e:13356684e5,s:13465584e5},{e:1367118e6,s:13786128e5},{e:13985676e5,s:14100624e5}]},{name:\"America/Sao_Paulo\",rules:[{e:12032136e5,s:12243852e5},{e:12346632e5,s:12558348e5},{e:12667176e5,s:12872844e5},{e:12981672e5,s:1318734e6},{e:13302216e5,s:13507884e5},{e:13610664e5,s:1382238e6},{e:1392516e6,s:14136876e5}]},{name:\"Asia/Amman\",rules:[{e:1225404e6,s:12066552e5},{e:12568536e5,s:12381048e5},{e:12883032e5,s:12695544e5},{e:13197528e5,s:13016088e5},!1,!1,{e:14147064e5,s:13959576e5}]},{name:\"Asia/Damascus\",rules:[{e:12254868e5,s:120726e7},{e:125685e7,s:12381048e5},{e:12882996e5,s:12701592e5},{e:13197492e5,s:13016088e5},{e:13511988e5,s:13330584e5},{e:13826484e5,s:1364508e6},{e:14147028e5,s:13959576e5}]},{name:\"Asia/Dubai\",rules:[!1,!1,!1,!1,!1,!1,!1]},{name:\"Asia/Gaza\",rules:[{e:12199572e5,s:12066552e5},{e:12520152e5,s:12381048e5},{e:1281474e6,s:126964086e4},{e:1312146e6,s:130160886e4},{e:13481784e5,s:13330584e5},{e:13802292e5,s:1364508e6},{e:1414098e6,s:13959576e5}]},{name:\"Asia/Irkutsk\",rules:[{e:12249576e5,s:12068136e5},{e:12564072e5,s:12382632e5},{e:12884616e5,s:12697128e5},!1,!1,!1,!1]},{name:\"Asia/Jerusalem\",rules:[{e:12231612e5,s:12066624e5},{e:1254006e6,s:1238112e6},{e:1284246e6,s:12695616e5},{e:131751e7,s:1301616e6},{e:13483548e5,s:13330656e5},{e:13828284e5,s:13645152e5},{e:1414278e6,s:13959648e5}]},{name:\"Asia/Kamchatka\",rules:[{e:12249432e5,s:12067992e5},{e:12563928e5,s:12382488e5},{e:12884508e5,s:12696984e5},!1,!1,!1,!1]},{name:\"Asia/Krasnoyarsk\",rules:[{e:12249612e5,s:12068172e5},{e:12564108e5,s:12382668e5},{e:12884652e5,s:12697164e5},!1,!1,!1,!1]},{name:\"Asia/Omsk\",rules:[{e:12249648e5,s:12068208e5},{e:12564144e5,s:12382704e5},{e:12884688e5,s:126972e7},!1,!1,!1,!1]},{name:\"Asia/Vladivostok\",rules:[{e:12249504e5,s:12068064e5},{e:12564e8,s:1238256e6},{e:12884544e5,s:12697056e5},!1,!1,!1,!1]},{name:\"Asia/Yakutsk\",rules:[{e:1224954e6,s:120681e7},{e:12564036e5,s:12382596e5},{e:1288458e6,s:12697092e5},!1,!1,!1,!1]},{name:\"Asia/Yekaterinburg\",rules:[{e:12249684e5,s:12068244e5},{e:1256418e6,s:1238274e6},{e:12884724e5,s:12697236e5},!1,!1,!1,!1]},{name:\"Asia/Yerevan\",rules:[{e:1224972e6,s:1206828e6},{e:12564216e5,s:12382776e5},{e:1288476e6,s:12697272e5},{e:13199256e5,s:13011768e5},!1,!1,!1]},{name:\"Australia/Lord_Howe\",rules:[{e:12074076e5,s:12231342e5},{e:12388572e5,s:12545838e5},{e:12703068e5,s:12860334e5},{e:13017564e5,s:1317483e6},{e:1333206e6,s:13495374e5},{e:13652604e5,s:1380987e6},{e:139671e7,s:14124366e5}]},{name:\"Australia/Perth\",rules:[{e:12068136e5,s:12249576e5},!1,!1,!1,!1,!1,!1]},{name:\"Europe/Helsinki\",rules:[{e:12249828e5,s:12068388e5},{e:12564324e5,s:12382884e5},{e:12884868e5,s:1269738e6},{e:13199364e5,s:13011876e5},{e:1351386e6,s:13326372e5},{e:13828356e5,s:13646916e5},{e:14142852e5,s:13961412e5}]},{name:\"Europe/Minsk\",rules:[{e:12249792e5,s:12068352e5},{e:12564288e5,s:12382848e5},{e:12884832e5,s:12697344e5},!1,!1,!1,!1]},{name:\"Europe/Moscow\",rules:[{e:12249756e5,s:12068316e5},{e:12564252e5,s:12382812e5},{e:12884796e5,s:12697308e5},!1,!1,!1,!1]},{name:\"Pacific/Apia\",rules:[!1,!1,!1,{e:13017528e5,s:13168728e5},{e:13332024e5,s:13489272e5},{e:13652568e5,s:13803768e5},{e:13967064e5,s:14118264e5}]},{name:\"Pacific/Fiji\",rules:[!1,!1,{e:12696984e5,s:12878424e5},{e:13271544e5,s:1319292e6},{e:1358604e6,s:13507416e5},{e:139005e7,s:1382796e6},{e:14215032e5,s:14148504e5}]},{name:\"Europe/London\",rules:[{e:12249828e5,s:12068388e5},{e:12564324e5,s:12382884e5},{e:12884868e5,s:1269738e6},{e:13199364e5,s:13011876e5},{e:1351386e6,s:13326372e5},{e:13828356e5,s:13646916e5},{e:14142852e5,s:13961412e5}]},{name:\"Africa/Windhoek\",rules:[{e:12207492e5,s:120744e7},{e:12521988e5,s:12388896e5},{e:12836484e5,s:12703392e5},{e:1315098e6,s:13017888e5},{e:13465476e5,s:13332384e5},{e:13779972e5,s:13652928e5},{e:14100516e5,s:13967424e5}]}]},\"undefined\"!=typeof module&&\"undefined\"!=typeof module.exports?module.exports=a:\"undefined\"!=typeof define&&null!==define&&null!=define.amd?define([],function(){return a}):\"undefined\"==typeof e?window.jstz=a:e.jstz=a}();","/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport { InQueueManager, Queue } from './in_queue';\n\ndeclare global {\n interface Window {\n GlobalSnowplowNamespace: Array<string>;\n [key: string]: unknown;\n }\n}\n\nconst functionName = window.GlobalSnowplowNamespace.shift() as string,\n queue = window[functionName] as { q: Queue | Array<unknown> };\n\n// Now replace initialization array with queue manager object\nqueue.q = InQueueManager(functionName, queue.q as Array<unknown>);\n","/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport { isStringArray, LOG } from '@snowplow/tracker-core';\nimport {\n isFunction,\n addTracker,\n createSharedState,\n SharedState,\n BrowserTracker,\n addEventListener,\n getTrackers,\n} from '@snowplow/browser-tracker-core';\nimport * as Snowplow from '@snowplow/browser-tracker';\nimport { Plugins } from './features';\nimport { JavaScriptTrackerConfiguration } from './configuration';\n\ndeclare global {\n interface Window {\n [key: string]: unknown;\n }\n}\n\n/*\n * Proxy object\n * This allows the caller to continue push()'ing after the Tracker has been initialized and loaded\n */\nexport interface Queue {\n /**\n * Allows the caller to push events\n *\n * @param array - parameterArray An array comprising either:\n * [ 'functionName', optional_parameters ]\n * or:\n * [ functionObject, optional_parameters ]\n */\n push: (...args: any[]) => void;\n}\n\ninterface PluginQueueItem {\n timeout: number;\n}\n\ntype FunctionParameters = [Record<string, unknown>, Array<string>] | [Array<string>];\n\n/**\n * This allows the caller to continue push()'ing after the Tracker has been initialized and loaded\n *\n * @param functionName - The global function name this script has been created on\n * @param asyncQueue - The existing queue of items to be processed\n */\nexport function InQueueManager(functionName: string, asyncQueue: Array<unknown>): Queue {\n const windowAlias = window,\n documentAlias = document,\n sharedState: SharedState = createSharedState(),\n availableTrackerIds: Array<string> = [],\n pendingPlugins: Record<string, PluginQueueItem> = {},\n pendingQueue: Array<[string, FunctionParameters]> = [];\n\n let version: string, availableFunctions: Record<string, Function>;\n ({ version, ...availableFunctions } = Snowplow);\n\n function parseInputString(inputString: string): [string, string[] | undefined] {\n const separatedString = inputString.split(':'),\n extractedFunction = separatedString[0],\n extractedNames = separatedString.length > 1 ? separatedString[1].split(';') : undefined;\n\n return [extractedFunction, extractedNames];\n }\n\n function dispatch(f: string, parameters: FunctionParameters) {\n if (availableFunctions[f]) {\n try {\n availableFunctions[f].apply(null, parameters);\n } catch (ex) {\n LOG.error(f + ' failed', ex);\n }\n } else {\n LOG.warn(f + ' is not an available function');\n }\n }\n\n function tryProcessQueue() {\n if (Object.keys(pendingPlugins).length === 0) {\n pendingQueue.forEach((q) => {\n let fnParameters = q[1];\n if (\n typeof availableFunctions[q[0]] !== 'undefined' &&\n availableFunctions[q[0]].length > fnParameters.length &&\n Array.isArray(fnParameters[0])\n ) {\n fnParameters = [{}, fnParameters[0]];\n }\n dispatch(q[0], fnParameters);\n });\n }\n }\n\n function updateAvailableFunctions(newFunctions: Record<string, Function>) {\n // Spread in any new methods\n availableFunctions = {\n ...availableFunctions,\n ...newFunctions,\n };\n }\n\n function newTracker(parameterArray: Array<unknown>) {\n if (\n typeof parameterArray[0] === 'string' &&\n typeof parameterArray[1] === 'string' &&\n (typeof parameterArray[2] === 'undefined' || typeof parameterArray[2] === 'object')\n ) {\n const trackerId = `${functionName}_${parameterArray[0]}`,\n trackerConfiguration = parameterArray[2] as JavaScriptTrackerConfiguration,\n plugins = Plugins(trackerConfiguration),\n tracker = addTracker(trackerId, parameterArray[0], `js-${version}`, parameterArray[1], sharedState, {\n ...trackerConfiguration,\n plugins: plugins.map((p) => p[0]),\n });\n\n if (tracker) {\n availableTrackerIds.push(tracker.id);\n } else {\n LOG.warn(parameterArray[0] + ' already exists');\n return;\n }\n\n plugins.forEach((p) => {\n updateAvailableFunctions(p[1]);\n });\n } else {\n LOG.error('newTracker failed', new Error('Invalid parameters'));\n }\n }\n\n function addPlugin(parameterArray: Array<unknown>, trackerIdentifiers: Array<string>) {\n function postScriptHandler(scriptSrc: string) {\n if (Object.prototype.hasOwnProperty.call(pendingPlugins, scriptSrc)) {\n windowAlias.clearTimeout(pendingPlugins[scriptSrc].timeout);\n delete pendingPlugins[scriptSrc];\n tryProcessQueue();\n }\n }\n\n if (\n typeof parameterArray[0] === 'string' &&\n isStringArray(parameterArray[1]) &&\n (typeof parameterArray[2] === 'undefined' || Array.isArray(parameterArray[2]))\n ) {\n const scriptSrc = parameterArray[0],\n constructorPath = parameterArray[1],\n constructorParams = parameterArray[2],\n pauseTracking = parameterArray[3] ?? true;\n\n if (pauseTracking) {\n const timeout = windowAlias.setTimeout(() => {\n postScriptHandler(scriptSrc);\n }, 5000);\n pendingPlugins[scriptSrc] = {\n timeout: timeout,\n };\n }\n const pluginScript = documentAlias.createElement('script');\n pluginScript.setAttribute('src', scriptSrc);\n pluginScript.setAttribute('async', '1');\n addEventListener(\n pluginScript,\n 'error',\n () => {\n postScriptHandler(scriptSrc);\n LOG.warn(`Failed to load plugin ${constructorPath[0]} from ${scriptSrc}`);\n },\n true\n );\n addEventListener(\n pluginScript,\n 'load',\n () => {\n const [windowFn, innerFn] = constructorPath,\n plugin = windowAlias[windowFn];\n if (plugin && typeof plugin === 'object') {\n const { [innerFn]: pluginConstructor, ...api } = plugin as Record<string, Function>;\n availableFunctions['addPlugin'].apply(null, [\n { plugin: pluginConstructor.apply(null, constructorParams) },\n trackerIdentifiers,\n ]);\n updateAvailableFunctions(api);\n }\n postScriptHandler(scriptSrc);\n },\n true\n );\n documentAlias.head.appendChild(pluginScript);\n return;\n }\n\n if (\n typeof parameterArray[0] === 'object' &&\n typeof parameterArray[1] === 'string' &&\n (typeof parameterArray[2] === 'undefined' || Array.isArray(parameterArray[2]))\n ) {\n const plugin = parameterArray[0],\n constructorPath = parameterArray[1],\n constructorParams = parameterArray[2];\n if (plugin) {\n const { [constructorPath]: pluginConstructor, ...api } = plugin as Record<string, Function>;\n availableFunctions['addPlugin'].apply(null, [\n { plugin: pluginConstructor.apply(null, constructorParams) },\n trackerIdentifiers,\n ]);\n updateAvailableFunctions(api);\n return;\n }\n }\n\n LOG.warn(`Failed to add Plugin: ${parameterArray[1]}`);\n }\n\n /**\n * apply wrapper\n *\n * @param array - parameterArray An array comprising either:\n * [ 'functionName', optional_parameters ]\n * or:\n * [ functionObject, optional_parameters ]\n */\n function applyAsyncFunction(...args: any[]) {\n // Outer loop in case someone push'es in zarg of arrays\n for (let i = 0; i < args.length; i += 1) {\n let parameterArray = args[i],\n input = Array.prototype.shift.call(parameterArray);\n\n // Custom callback rather than tracker method, called with trackerDictionary as the context\n if (isFunction(input)) {\n try {\n let fnTrackers: Record<string, BrowserTracker> = {};\n for (const tracker of getTrackers(availableTrackerIds)) {\n // Strip GlobalSnowplowNamespace from ID\n fnTrackers[tracker.id.replace(`${functionName}_`, '')] = tracker;\n }\n input.apply(fnTrackers, parameterArray);\n } catch (ex) {\n LOG.error('Tracker callback failed', ex);\n } finally {\n continue;\n }\n }\n\n let parsedString = parseInputString(input),\n f = parsedString[0],\n names = parsedString[1];\n\n if (f === 'newTracker') {\n newTracker(parameterArray);\n continue;\n }\n\n const trackerIdentifiers = names ? names.map((n) => `${functionName}_${n}`) : availableTrackerIds;\n\n if (f === 'addPlugin') {\n addPlugin(parameterArray, trackerIdentifiers);\n continue;\n }\n\n let fnParameters: FunctionParameters;\n if (typeof parameterArray[0] !== 'undefined') {\n fnParameters = [parameterArray[0], trackerIdentifiers];\n } else if (typeof availableFunctions[f] !== 'undefined') {\n fnParameters = availableFunctions[f].length === 2 ? [{}, trackerIdentifiers] : [trackerIdentifiers];\n } else {\n fnParameters = [trackerIdentifiers];\n }\n\n if (Object.keys(pendingPlugins).length > 0) {\n pendingQueue.push([f, fnParameters]);\n continue;\n }\n\n dispatch(f, fnParameters);\n }\n }\n\n // We need to manually apply any events collected before this initialization\n for (let i = 0; i < asyncQueue.length; i++) {\n applyAsyncFunction(asyncQueue[i]);\n }\n\n return {\n push: applyAsyncFunction,\n };\n}\n","/*\n * Copyright (c) 2021 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as ClientHints from '@snowplow/browser-plugin-client-hints';\nimport * as Optimizely from '@snowplow/browser-plugin-optimizely';\nimport * as OptimizelyX from '@snowplow/browser-plugin-optimizely-x';\nimport * as PerformanceTiming from '@snowplow/browser-plugin-performance-timing';\nimport * as Consent from '@snowplow/browser-plugin-consent';\nimport * as Geolocation from '@snowplow/browser-plugin-geolocation';\nimport * as GaCookies from '@snowplow/browser-plugin-ga-cookies';\nimport * as LinkClickTracking from '@snowplow/browser-plugin-link-click-tracking';\nimport * as FormTracking from '@snowplow/browser-plugin-form-tracking';\nimport * as ErrorTracking from '@snowplow/browser-plugin-error-tracking';\nimport * as BrowserFeatures from '@snowplow/browser-plugin-browser-features';\nimport * as Timezone from '@snowplow/browser-plugin-timezone';\nimport * as Ecommerce from '@snowplow/browser-plugin-ecommerce';\nimport * as EnhancedEcommerce from '@snowplow/browser-plugin-enhanced-ecommerce';\nimport * as AdTracking from '@snowplow/browser-plugin-ad-tracking';\nimport * as SiteTracking from '@snowplow/browser-plugin-site-tracking';\nimport { plugins } from '../tracker.config';\nimport { BrowserPlugin } from '@snowplow/browser-tracker-core';\nimport { JavaScriptTrackerConfiguration } from './configuration';\n\n/**\n * Calculates the required plugins to intialise per tracker\n * @param configuration - The tracker configuration object\n */\nexport function Plugins(configuration: JavaScriptTrackerConfiguration) {\n const {\n performanceTiming,\n gaCookies,\n geolocation,\n optimizelyExperiments,\n optimizelyStates,\n optimizelyVariations,\n optimizelyVisitor,\n optimizelyAudiences,\n optimizelyDimensions,\n optimizelySummary,\n optimizelyXSummary,\n clientHints,\n } = configuration?.contexts ?? {};\n const activatedPlugins: Array<[BrowserPlugin, {} | Record<string, Function>]> = [];\n\n if (\n plugins.optimizely &&\n (optimizelySummary ||\n optimizelyExperiments ||\n optimizelyStates ||\n optimizelyVariations ||\n optimizelyVisitor ||\n optimizelyAudiences ||\n optimizelyDimensions)\n ) {\n const { OptimizelyPlugin, ...apiMethods } = Optimizely;\n activatedPlugins.push([\n OptimizelyPlugin(\n optimizelySummary,\n optimizelyExperiments,\n optimizelyStates,\n optimizelyVariations,\n optimizelyVisitor,\n optimizelyAudiences,\n optimizelyDimensions\n ),\n apiMethods,\n ]);\n }\n\n if (plugins.performanceTiming && performanceTiming) {\n const { PerformanceTimingPlugin, ...apiMethods } = PerformanceTiming;\n activatedPlugins.push([PerformanceTimingPlugin(), apiMethods]);\n }\n\n if (plugins.optimizelyX && optimizelyXSummary) {\n const { OptimizelyXPlugin, ...apiMethods } = OptimizelyX;\n activatedPlugins.push([OptimizelyXPlugin(), apiMethods]);\n }\n\n if (plugins.clientHints && clientHints) {\n const { ClientHintsPlugin, ...apiMethods } = ClientHints;\n activatedPlugins.push([\n ClientHintsPlugin(typeof clientHints === 'object' && clientHints.includeHighEntropy),\n apiMethods,\n ]);\n }\n\n if (plugins.gaCookies && gaCookies) {\n const { GaCookiesPlugin, ...apiMethods } = GaCookies;\n activatedPlugins.push([GaCookiesPlugin(), apiMethods]);\n }\n\n if (plugins.consent) {\n const { ConsentPlugin, ...apiMethods } = Consent;\n activatedPlugins.push([ConsentPlugin(), apiMethods]);\n }\n\n if (plugins.geolocation) {\n const { GeolocationPlugin, ...apiMethods } = Geolocation;\n activatedPlugins.push([GeolocationPlugin(geolocation), apiMethods]);\n }\n\n if (plugins.linkClickTracking) {\n const { LinkClickTrackingPlugin, ...apiMethods } = LinkClickTracking;\n activatedPlugins.push([LinkClickTrackingPlugin(), apiMethods]);\n }\n\n if (plugins.formTracking) {\n const { FormTrackingPlugin, ...apiMethods } = FormTracking;\n activatedPlugins.push([FormTrackingPlugin(), apiMethods]);\n }\n\n if (plugins.errorTracking) {\n const { ErrorTrackingPlugin, ...apiMethods } = ErrorTracking;\n activatedPlugins.push([ErrorTrackingPlugin(), apiMethods]);\n }\n\n if (plugins.ecommerce) {\n const { EcommercePlugin, ...apiMethods } = Ecommerce;\n activatedPlugins.push([EcommercePlugin(), apiMethods]);\n }\n\n if (plugins.enhancedEcommerce) {\n const { EnhancedEcommercePlugin, ...apiMethods } = EnhancedEcommerce;\n activatedPlugins.push([EnhancedEcommercePlugin(), apiMethods]);\n }\n\n if (plugins.adTracking) {\n const { AdTrackingPlugin, ...apiMethods } = AdTracking;\n activatedPlugins.push([AdTrackingPlugin(), apiMethods]);\n }\n\n if (plugins.siteTracking) {\n const { SiteTrackingPlugin, ...apiMethods } = SiteTracking;\n activatedPlugins.push([SiteTrackingPlugin(), apiMethods]);\n }\n\n if (plugins.browserFeatures) {\n const { BrowserFeaturesPlugin, ...apiMethods } = BrowserFeatures;\n activatedPlugins.push([BrowserFeaturesPlugin(), apiMethods]);\n }\n\n if (plugins.timezone) {\n const { TimezonePlugin, ...apiMethods } = Timezone;\n activatedPlugins.push([TimezonePlugin(), apiMethods]);\n }\n\n return activatedPlugins;\n}\n"],"names":["__rest","s","e","p","t","Object","i","__spreadArray","to","from","il","j","base64urlencode","data","ac","tmp_arr","unescape","encodeURIComponent","o1","o2","o3","bits","b64","h1","h2","h3","h4","enc","r","payloadBuilder","processor","dict","allJson","jsonForProcessing","add","key","value","addDict","addJson","keyIfEncoded","keyIfNotEncoded","json","isNonEmptyJson","jsonWithKeys","getPayload","getJson","withJsonProcessor","jsonProcessor","build","this","property","isJson","globalContexts","globalPrimitives","conditionalProviders","getGlobalPrimitives","getConditionalProviders","addGlobalContexts","contexts","acceptedConditionalContexts","acceptedContextPrimitives","_i","context","isContextPrimitive","clearGlobalContexts","removeGlobalContexts","_loop_1","isConditionalContextProvider","item","JSON","getApplicableContexts","event","a","eventJson_1","schema","d","eventType","generatedPrimitives","generatePrimitives","eventSchema","generateConditionals","providers","_a","normalizeToArray","partialEvaluate","provider","isFilterProvider","filter","filterResult","error","isRuleSetProvider","matchSchemaAgainstRuleSet","ruleSet","rejectCount","acceptCount","acceptRules","rule","matchSchemaAgainstRule","rejectRules","result","generatedContexts","c","Boolean","generatedConditionals","resolveDynamicContext","dynamicOrStaticContexts","extraParams","arguments","validateVendor","input","parts","validateVendorParts","asterisk","getRuleParts","matches","re","isValidRule","ruleParts","vendor","isStringArray","x","isValidRuleSetArg","isSelfDescribingJson","isContextCallbackFunction","Array","isRuleSet","ruleCount","undefined","schemaParts","matchVendor","vendorParts","matchPart","contextPrimitives","primitive","b","contextGeneratorResult","l","generatorOutput","trackerCore","configuration","base64","corePlugins","plugins","newCore","callback","attachGlobalContexts","pb","applicableContexts","globalContextsHelper","returnedContexts","pluginContextsHelper","pluginContexts","addPluginContexts","additionalContexts","combinedContexts","plugin","ex","LOG","encodeBase64","payloadPairs","core","track","timestamp","payloadJsonProcessor","str","v4","getTimestamp","type","getTime","Date","tstamp","allContexts","wrappedContexts","finalPayload","addPayloadPair","getBase64Encoding","setBase64Encoding","encode","addPayloadDict","resetPayloadPairs","setTrackerVersion","version","setTrackerNamespace","name","setAppId","appId","setPlatform","setUserId","userId","setScreenResolution","width","height","setViewport","setColorDepth","depth","setTimezone","timezone","setLang","lang","setIpAddress","ip","setUseragent","useragent","__assign","partialCore","addPlugin","_b","buildSelfDescribingEvent","ueJson","buildPageView","pageUrl","pageTitle","referrer","buildPagePing","minXOffset","maxXOffset","minYOffset","isNaN","Number","maxYOffset","buildEcommerceTransactionItem","orderId","sku","price","category","quantity","currency","buildLinkClick","eventJson","removeEmptyProperties","targetUrl","elementId","elementClasses","elementTarget","elementContent","exemptFields","k","ret","isInteger","int","isFinite","Math","isFunction","func","fixupTitle","title","tmp","document","getHostName","url","fixupDomain","domain","dl","getReferrer","oldLocation","windowAlias","window","fromQs","fromQuerystring","e2","addEventListener","element","eventHandler","options","field","match","exec","RegExp","decodeURIComponent","attemptWriteLocalStorage","ttl","localStorageAlias","attemptDeleteLocalStorage","cookie","path","samesite","secure","toUTCString","parseAndValidateInt","obj","parseInt","parseAndValidateFloat","parseFloat","getFilterByClass","criterion","inclusive","specifiedClassesSet","getSpecifiedClassesSet","elt","classes_1","getCssClasses","getFilterByName","getFilter","fallbackFilter","specifiedClasses","OutQueueManager","id","sharedSate","useLocalStorage","eventMethod","postPath","bufferSize","maxPostBytes","useStm","maxLocalStorageQueueSize","connectionTimeout","anonymousTracking","getUTF8Length","len","code","executeQueue","sync","outQueue","executingQueue","configCollectorUrl","useXhr","chooseHowManyToSend","queue","numberToSend","byteCount","postable","xhr_1","initializeXMLHttpRequest","numberToSend_1","createGetUrl","xhrTimeout_1","setTimeout","onPostSuccess_1","deleteCount","queueName","xhr_1.onreadystatechange","clearTimeout","batch","beaconStatus","useBeacon","blob","Blob","encloseInPayloadDataEnvelope","attachStmToEvent","eventBatch","navigator","image","Image","loading_1","image.onload","image.onerror","post","xhr","XMLHttpRequest","events","stm","nextRequest","navigatorAlias","isBeaconRequested","hasWebKitBeaconBug","major","isMacosxVersionLessThanOrEqualTo","minor","isSafari","usePost","localStorageAccessible","ls","mod","localStorageQueue","enqueueRequest","request","body","getBody","cleanedRequest","acc","evt","bytes","getQuerystring","querystring","lowPriorityKeys","co","cx","firstPair","contextKey","savedToLocalStorage","setUseLocalStorage","localStorage","setAnonymousTracking","anonymous","setCollectorUrl","setBufferSize","newBufferSize","fixupUrl","hostName","href","Tracker","trackerId","namespace","endpoint","sharedState","trackerConfiguration","newTracker","state","refreshUrl","locationArray","locationHrefAlias","configReferrerUrl","linkDecorationHandler","initialQsParams","domainUserId","hashSplit","qsSplit","beforeQuerystring","initialDecoration","qsFields","decorateLinks","crossDomainLinker","purify","configDiscardHashTag","targetPattern","configDiscardBrace","getProtocolScheme","getSnowplowCookieValue","cookieName","fullName","configCookieNamePrefix","domainHash","configStateStorageStrategy","exp","updateDomainHash","hash","configCookieDomain","domainAlias","configCookiePath","activityHandler","lastActivityTime","scrollHandler","offsets","getPageOffsets","y","documentElement","resetMaxScrolls","setSessionCookie","setCookie","baseName","cookieValue","configSessionCookieTimeout","setDomainUserIdCookie","createTs","visitCount","nowTs","lastVisitTs","sessionId","configVisitorCookieTimeout","timeout","configAnonymousTracking","configAnonymousSessionTracking","configCookieSameSite","configCookieSecure","clearUserDataAndCookies","idname","sesname","memorizedSessionId","memorizedVisitCount","businessUserId","toggleAnonymousTracking","getStateStorageStrategy","getAnonymousSessionTracking","getAnonymousServerTracking","configAnonymousServerTracking","initializeIdsAndCookies","sesCookieSet","idCookieComponents","loadDomainUserIdCookie","tmpContainer","asCollectorUrl","collectorUrl","resetPageView","preservePageViewId","getPageViewId","activityInterval","config","contextCallback","executePagePing","cb","pageViewId","heartbeat","configureActivityTracking","minimumVisitLength","heartbeatDelay","configMinimumVisitLength","configHeartBeatTimer","logPagePing","newDocumentTitle","lastDocumentTitle","lastConfigTitle","configCustomUrl","customReferrer","_c","_d","_e","_f","_g","_h","_j","_k","_l","_m","_o","_p","_q","_r","_s","_t","_u","configOptOutCookie","ses","cookiesDisabled","_domainUserId","currentVisitTs","toOptoutByCookie","sessionIdFromCookie","lastEventTime","detectViewport","detectDocumentSize","de","be","w","h","browserLanguage","documentCharset","configPlatform","configPostPath","configTrackerSiteId","resetActivityTrackingOnPageView","dnt","configDoNotTrack","pageViewSent","activityTrackingConfig","enabled","installed","configurations","findRootDomain","sameSite","windowLocationHostnameAlias","cookiePrefix","split","position","currentDomain","cookies","length","cookieNames","screen","apiMethods","getDomainSessionIndex","newSession","getCookieName","basename","getUserId","getDomainUserId","getDomainUserInfo","setReferrerUrl","setCustomUrl","Ka","baseUrl","setDocumentTitle","discardHashTag","enableFilter","discardBrace","setCookiePath","setVisitorCookieTimeout","crossDomainLinkerCriterion","enableActivityTracking","enableActivityTrackingCallback","updatePageActivity","setOptOutCookie","setUserIdFromLocation","querystringField","setUserIdFromReferrer","setUserIdFromCookie","flushBuffer","trackPageView","logPageView","installingActivityTracking","detectPassiveEvents","update","passive","get","noop","wheelEvent","listener","_","handler","ev","documentHandlers","now","disableAnonymousTracking","enableAnonymousTracking","clearUserData","tracker","partialTracker","dispatchToTrackers","trackers","fn","getTrackersFromCollection","namedTrackers","dispatchToTrackersInCollection","trackerCollection","addTracker","trackerIds","createSharedState","loadHandler","SharedState","documentAlias","visibilityChangeHandler","flusher","flushBuffers","ready","ClientHintsPlugin","includeHighEntropy","uaClientHints","isMobile","brands","res","OptimizelyXPlugin","getOptimizelyXData","snd","windowOptimizelyAlias","getOptimizelyXSummaryContexts","getOptimizelyXSummary","experiment_ids","variationMap","visitor","activeExperiment","variation","variationName","visitorId","experimentId","variationId","experiment","PerformanceTimingPlugin","performanceTimingAlias","performanceAlias","performanceTiming","navigationStart","redirectStart","redirectEnd","fetchStart","domainLookupStart","domainLookupEnd","connectStart","secureConnectionStart","connectEnd","requestStart","responseStart","responseEnd","unloadEventStart","unloadEventEnd","domLoading","domInteractive","domContentLoadedEventStart","domContentLoadedEventEnd","domComplete","loadEventStart","loadEventEnd","msFirstPaint","chromeFirstPaint","requestEnd","proxyStart","proxyEnd","ConsentPlugin","activateBrowserPlugin","_context","logger","GeolocationPlugin","enableAtLoad","enableGeolocationContext","_trackers","geolocation","geolocationContextAdded","coords","latitude","longitude","latitudeLongitudeAccuracy","altitude","altitudeAccuracy","bearing","speed","GaCookiesPlugin","gaCookieData","cookieType","LinkClickTrackingPlugin","processClick","sourceElement","parentElement","tag","originalSourceHostName","anchorElement","sourceHref","sourceHostName","_configuration","getClickHandler","button","target","configureLinkClickTracking","linkTrackingContent","linkTrackingContext","linkTrackingPseudoClicks","linkTrackingFilter","addClickListeners","linkElements","addFormListeners","trackingMarker","getConfigurationForOptions","formFilter","fieldFilter","fieldTransform","getTransform","defaultTransformFn","form","innerElementTags","tagname","innerElement","getFormChangeListener","getFormSubmissionListener","innerElements","getInnerFormElements","trackedChildren","child","elementJson","getElementIdentifier","nodeName","buildFormSubmission","formId","formClasses","elements","properties_1","properties","propName","getParentFormIdentifier","event_type","buildFormFocusOrChange","event_schema","event_data","FormTrackingPlugin","ErrorTrackingPlugin","trackError","message","filename","lineno","colno","stack","programmingLanguage","stackTrace","lineNumber","lineColumn","fileName","TimezonePlugin","determine","EcommercePlugin","items","EnhancedEcommercePlugin","AdTrackingPlugin","SiteTrackingPlugin","n","getRandomValues","crypto","msCrypto","rnds8","Uint8Array","module.exports","rnds","byteToHex","_nodeId","_clockseq","bytesToUuid","buf","offset","_lastMSecs","_lastNSecs","rng","ii","v1","node","clockseq","seedBytes","msecs","nsecs","dt","tl","tmh","LOG_LEVEL","gdprBasis","logLevel","setLogLevel","level","warn","logMsg","label","console","debug","info","crypt","rotl","rotr","endian","randomBytes","bytesToWords","words","wordsToBytes","bytesToHex","hex","hexToBytes","bytesToBase64","triplet","base64map","base64ToBytes","imod4","charenc","utf8","stringToBytes","bytesToString","escape","bin","String","sha1","api","require$$1","Buffer","m","require$$0","H0","H1","H2","H3","H4","digestbytes","enable","trackSelfDescribingEvent","trackStructEvent","buildStructEvent","action","version$1","enableGdprContext","documentId","documentVersion","documentDescription","basis","basisForProcessing","trackConsentGranted","expiry","documentJson","description","trackConsentWithdrawn","all","enableLinkClickTracking","refreshLinkClickTracking","trackLinkClick","enableFormTracking","enableErrorTracking","contextAdder","captureError","errorEvent","America/Denver","America/Chicago","America/Asuncion","America/Montevideo","Asia/Beirut","Pacific/Auckland","America/Los_Angeles","America/New_York","America/Halifax","America/Godthab","Asia/Dubai","Asia/Jakarta","Asia/Shanghai","Australia/Sydney","Asia/Tokyo","Asia/Dhaka","Asia/Baku","Australia/Brisbane","Pacific/Noumea","Pacific/Majuro","Pacific/Tongatapu","Asia/Baghdad","Asia/Karachi","Africa/Johannesburg","getTimezoneOffset","BASELINE_YEAR","u","DAY","HOUR","o","A","f","MINUTE","SECOND","AMBIGUITIES","MAX_SCORE","Intl","using_intl","needle","_transactions","addItem","addTrans","trackAddToCart","unitPrice","trackRemoveFromCart","trackTrans","transaction","buildEcommerceTransaction","total","affiliation","tax","shipping","city","country","addEnhancedEcommerceActionContext","revenue","coupon","list","step","option","addEnhancedEcommerceImpressionContext","brand","variant","addEnhancedEcommerceProductContext","addEnhancedEcommercePromoContext","creative","trackEnhancedEcommerceAction","trackAdClick","buildAdClick","clickId","costModel","cost","bannerId","zoneId","impressionId","advertiserId","campaignId","trackAdConversion","buildAdConversion","conversionId","initialValue","trackAdImpression","buildAdImpression","trackSiteSearch","terms","filters","totalResults","pageResults","trackSocialInteraction","buildSocialInteraction","network","trackTiming","variable","timing","functionName","asyncQueue","parseInputString","inputString","separatedString","dispatch","parameters","availableFunctions","tryProcessQueue","pendingPlugins","pendingQueue","q","fnParameters","updateAvailableFunctions","newFunctions","parameterArray","Error","optimizelyXSummary","activatedPlugins","PerformanceTiming","PerformanceTiming.PerformanceTimingPlugin","OptimizelyX","OptimizelyX.OptimizelyXPlugin","ClientHints","ClientHints.ClientHintsPlugin","clientHints","GaCookies","GaCookies.GaCookiesPlugin","Consent","Consent.ConsentPlugin","Geolocation","Geolocation.GeolocationPlugin","LinkClickTracking","LinkClickTracking.LinkClickTrackingPlugin","FormTracking","FormTracking.FormTrackingPlugin","ErrorTracking","ErrorTracking.ErrorTrackingPlugin","Ecommerce","Ecommerce.EcommercePlugin","EnhancedEcommerce","EnhancedEcommerce.EnhancedEcommercePlugin","AdTracking","AdTracking.AdTrackingPlugin","SiteTracking","SiteTracking.SiteTrackingPlugin","Timezone","Timezone.TimezonePlugin","Plugins","availableTrackerIds","trackerIdentifiers","postScriptHandler","scriptSrc","scriptSrc_1","constructorPath_1","constructorParams_1","pluginScript","innerFn","pluginConstructor","constructorPath","constructorParams","applyAsyncFunction","args","fnTrackers","parsedString","names","Snowplow","push"],"mappings":";;;;;;yBA0COA,WAAgBC,EAAGC,GACtB,IACSC,EADLC,EAAI,OACCD,OAAYE,qCAAqCJ,EAAGE,IAAqB,EAAfD,UAAUC,KACzEC,EAAED,GAAKF,EAAEE,OACJ,MAALF,GAAqD,gDACrD,CAAA,IAASK,EAAI,MAAGH,EAAIE,6BAA6BJ,GAAIK,EAAIH,SAAUG,IACzC,EAAlBJ,UAAUC,EAAEG,KAAWD,2CAA2CJ,EAAGE,EAAEG,MACvEF,EAAED,EAAEG,IAAML,EAAEE,EAAEG,KAE1B,SAiHGC,WAAuBC,EAAIC,GAC9B,IADoC,IAC3BH,EAAI,EAAGI,EAAKD,SAAaE,EAAIH,SAAWF,EAAII,EAAIJ,IAAKK,IAC1DH,EAAGG,GAAKF,EAAKH,6EC/HrBM,WAAyBC,GACrB,IAAKA,EACD,aA4BkCP,EAAI,EAAGQ,EAAK,EAC9CC,EAAU,MACTF,EAAL,CAGAA,EAAOG,SAASC,mBAAmBJ,MAChC,CAEC,IAAAK,EAAKL,aAAgBP,KACrBa,EAAKN,aAAgBP,KACrBc,EAAKP,a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