-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathga-autotrack-ids.js.map
1 lines (1 loc) · 25 KB
/
ga-autotrack-ids.js.map
1
{"version":3,"sources":[" [synthetic:util/defineproperty] "," [synthetic:util/global] "," [synthetic:es6/symbol] "," [synthetic:es6/util/makeiterator] "," [synthetic:es6/util/arrayfromiterator] ","../node_modules/nanoid/format.js","utilities.js","../node_modules/nanoid/url.js","ga-autotrack-ids.js","../node_modules/nanoid/random-browser.js","ga.js"," [synthetic:es6/util/arrayfromiterable] ","provide.js","constants.js","plugins/client-id-tracker.js","plugins/session-id-tracker.js","ga-task-manager.js","plugins/hit-id-tracker.js","plugins/hit-timestamp-tracker.js"],"names":["$jscomp.defineProperty","$jscomp.global","$jscomp.initSymbol","$jscomp.Symbol","$jscomp.SYMBOL_PREFIX","$jscomp.arrayIterator","$jscomp.initSymbolIterator","$jscomp.iteratorPrototype","format","random","mask","Math","log","LN2","step","ceil","size","length","id","bytes","i","byte","url","crypto","self","msCrypto","randomBrowser","getRandomValues","Uint8Array","urlSafeNanoid","ga","gaAlias","window","GoogleAnalyticsObject","push","q","args","$jscomp.arrayFromIterator","$jscomp.makeIterator","provide","pluginName","pluginConstructor","gaDevIds","indexOf","DEV_ID","gaplugins","charAt","toUpperCase","slice","constructor","ClientIdTracker","tracker","opts","customDimensionIndex","Error","set","get","remove","SessionIdTracker","SessionIdTracker.validateCustomSessionOpts","customSession","validateCustomSessionOpts","callGaTaskManager","methodName","HitIdTracker","plugins_","keys","uuid","HitTimestampTracker","Date","now"],"mappings":"A,YAoCA,IAAAA,EAC4D,UAAxD,EAAsB,MAAO,OAAA,iBAA7B,CACA,MAAA,eADA,CAEA,QAAQ,CAAC,CAAD,CAAS,CAAT,CAAmB,CAAnB,CAA+B,CAOjC,CAAJ,EAAc,KAAA,UAAd,EAAiC,CAAjC,EAA2C,MAAA,UAA3C,GACA,CAAA,CAAO,CAAP,CADA,CACmB,CAAA,MADnB,CAPqC,CAH3C,CCOAC,EA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AAA,CACEX,CADF,CAEE,oBAFF,CAGEC,CAAAC,qBAHF,CAIEc,CAJF,CAjByB,CA6B3B,CAAA,UAAA,OAAA,CAAAV,QAAM,EAAG,CACPK,CAAA,CACE,IAAAX,EADF,CAEE,sBAFF,CAGE,IAAAC,EAAAC,qBAHF,CADO,CASXd,EAAA,CAAQ,cAAR,CAAwByB,CAAxB,CCvCEf;QAVImB,EAUO,CAACjB,CAAD,CAAUC,CAAV,CAAgB,CACzB,GAAwD,EAAxD,GAAID,CAAAc,SAAAC,KAAAvB,QAAA,CAA8B,eAA9B,CAAJ,CACE,KAAUW,MAAJ,CAAU,yMAAV,CAAN,CAKF,GAAyC,QAAzC,GAAI,MAAOF,EAAAC,qBAAX,CACE,KAAUC,MAAJ,CAAU,2OAAV,CAAN,CAMF,IAAAH,EAAA;AAAeA,CACf,KAAAC,EAAA,CAAYA,CAEZU,EAAA,CACEX,CADF,CAEE,oBAFF,CAGEC,CAAAC,qBAHF,CAIE,QAAA,EAAW,CACT,MAAO,CAACgB,IAAAC,IAAA,EADC,CAJb,CAjByB,CA8B3B,CAAA,UAAA,OAAA,CAAAb,QAAM,EAAG,CACPK,CAAA,CAAkB,IAAAX,EAAlB,CAAgC,sBAAhC,CAAwD,IAAAC,EAAAC,qBAAxD,CADO,CAKXd,EAAA,CAAQ,qBAAR,CAA+B6B,CAA/B","file":"","sourcesContent":[null,null,null,null,null,"/**\n * Secure random string generator with custom alphabet.\n *\n * Alphabet must contain 256 symbols or less. Otherwise, the generator\n * will not be secure.\n *\n * @param {random} random The random bytess generator.\n * @param {string} alphabet Symbols to be used in new random string.\n * @param {size} size The number of symbols in new random string.\n *\n * @return {string} Random string.\n *\n * @example\n * var format = require('nanoid/format')\n *\n * function random (size) {\n * var result = []\n * for (var i = 0; i < size; i++) result.push(randomByte())\n * return result\n * }\n *\n * format(random, \"abcdef\", 5) //=> \"fbaef\"\n *\n * @name format\n */\nmodule.exports = function (random, alphabet, size) {\n var mask = (2 << Math.log(alphabet.length - 1) / Math.LN2) - 1\n var step = Math.ceil(1.6 * mask * size / alphabet.length)\n\n var id = ''\n while (true) {\n var bytes = random(step)\n for (var i = 0; i < step; i++) {\n var byte = bytes[i] & mask\n if (alphabet[byte]) {\n id += alphabet[byte]\n if (id.length === size) return id\n }\n }\n }\n}\n\n/**\n * @callback generator\n * @param {number} bytes The number of bytes to generate.\n * @return {number[]} Random bytes.\n */\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport format from 'nanoid/format';\nimport url from 'nanoid/url';\nimport random from 'nanoid/random-browser';\n\n\n/**\n * Accepts a function to be invoked once the DOM is ready. If the DOM is\n * already ready, the callback is invoked immediately.\n * @param {!Function} callback The ready callback.\n */\nexport function domReady(callback) {\n if (document.readyState == 'loading') {\n document.addEventListener('DOMContentLoaded', function fn() {\n document.removeEventListener('DOMContentLoaded', fn);\n callback();\n });\n } else {\n callback();\n }\n}\n\n\n/**\n * Returns a function, that, as long as it continues to be called, will not\n * actually run. The function will only run after it stops being called for\n * `wait` milliseconds.\n * @param {!Function} fn The function to debounce.\n * @param {number} wait The debounce wait timeout in ms.\n * @return {!Function} The debounced function.\n */\nexport function debounce(fn, wait) {\n let timeout;\n return function(...args) {\n clearTimeout(timeout);\n timeout = setTimeout(() => fn(...args), wait);\n };\n}\n\n\n/**\n * Accepts a function and returns a wrapped version of the function that is\n * expected to be called elsewhere in the system. If it's not called\n * elsewhere after the timeout period, it's called regardless. The wrapper\n * function also prevents the callback from being called more than once.\n * @param {!Function} callback The function to call.\n * @param {number=} wait How many milliseconds to wait before invoking\n * the callback.\n * @return {!Function} The wrapped version of the passed function.\n */\nexport function withTimeout(callback, wait = 2000) {\n let called = false;\n const fn = function() {\n if (!called) {\n called = true;\n callback();\n }\n };\n setTimeout(fn, wait);\n return fn;\n}\n\n\n/**\n * A small shim of Object.assign that aims for brevity over spec-compliant\n * handling all the edge cases.\n * @param {!Object} target The target object to assign to.\n * @param {...?Object} sources Additional objects who properties should be\n * assigned to target. Non-objects are converted to objects.\n * @return {!Object} The modified target object.\n */\nexport const assign = Object.assign || function(target, ...sources) {\n for (let i = 0, len = sources.length; i < len; i++) {\n const source = Object(sources[i]);\n for (let key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n};\n\n\n/**\n * Accepts a string containing hyphen or underscore word separators and\n * converts it to camelCase.\n * @param {string} str The string to camelCase.\n * @return {string} The camelCased version of the string.\n */\nexport function camelCase(str) {\n return str.replace(/[\\-\\_]+(\\w?)/g, function(match, p1) {\n return p1.toUpperCase();\n });\n}\n\n\n/**\n * Capitalizes the first letter of a string.\n * @param {string} str The input string.\n * @return {string} The capitalized string\n */\nexport function capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n\n\n/**\n * Indicates whether the passed variable is a JavaScript object.\n * @param {*} value The input variable to test.\n * @return {boolean} Whether or not the test is an object.\n */\nexport function isObject(value) {\n return typeof value == 'object' && value !== null;\n}\n\n\n/**\n * Accepts a value that may or may not be an array. If it is not an array,\n * it is returned as the first item in a single-item array.\n * @param {*} value The value to convert to an array if it is not.\n * @return {!Array} The array-ified value.\n */\nexport function toArray(value) {\n return Array.isArray(value) ? value : [value];\n}\n\n\n/**\n * @return {number} The current date timestamp\n */\nexport function now() {\n return +new Date();\n}\n\n/**\n * Get a tiny, secure, URL-friendly, unique string ID.\n * @return {string} The uuid.\n */\nexport function urlSafeNanoid() {\n return format(random, url, 21);\n}\n\nexport const uuid = urlSafeNanoid;\n","/**\n * URL safe symbols.\n *\n * @name url\n * @type {string}\n *\n * @example\n * var url = require('nanoid/url')\n * generate(url, 10) //=> \"Uakgb_J5m9\"\n */\nmodule.exports =\n '_~0123456789' +\n 'abcdefghijklmnopqrstuvwxyz' +\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'\n",null,"var crypto = self.crypto || self.msCrypto\n\nmodule.exports = function (bytes) {\n return crypto.getRandomValues(new Uint8Array(bytes))\n}\n","/**\n * Race condition safe way to call the analytics.js\n * ga() command queue.\n * @return {!Function}\n * @suppress {checkVars}\n */\nexport default (() => {\n const gaAlias = window.GoogleAnalyticsObject || 'ga';\n window[gaAlias] = window[gaAlias] || function(...args) {\n (window[gaAlias].q = window[gaAlias].q || []).push(args);\n };\n return (...args) => window[gaAlias](...args);\n})();\n",null,"/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nimport {DEV_ID} from './constants';\nimport {capitalize} from './utilities';\nimport ga from './ga';\n\n\n/**\n * Provides a plugin for use with analytics.js, accounting for the possibility\n * that the global command queue has been renamed or not yet defined.\n * @param {string} pluginName The plugin name identifier.\n * @param {Function} pluginConstructor The plugin constructor function.\n */\nexport default function provide(pluginName, pluginConstructor) {\n // Adds the autotrack dev ID if not already included.\n window.gaDevIds = window.gaDevIds || [];\n if (window.gaDevIds.indexOf(DEV_ID) < 0) {\n window.gaDevIds.push(DEV_ID);\n }\n\n // Formally provides the plugin for use with analytics.js.\n ga('provide', pluginName, pluginConstructor);\n\n // Registers the plugin on the global gaplugins object.\n window.gaplugins = window.gaplugins || {};\n window.gaplugins[capitalize(pluginName)] = pluginConstructor;\n}\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Modifications Copyright (C) 2018 Anki, Inc.\n */\n\n\nexport const DEV_ID = 'd8f00h';\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Modifications Copyright (C) 2018 Anki, Inc.\n */\n\nimport provide from '../provide';\n\n\n/**\n * Class for the `ClientIdTracker` analytics.js plugin.\n * @implements {ClientIdTrackerPublicInterface}\n */\nclass ClientIdTracker {\n /**\n * Registers clean URL tracking on a tracker object. The clean URL tracker\n * removes query parameters from the page value reported to Google Analytics.\n * It also helps to prevent tracking similar URLs, e.g. sometimes ending a\n * URL with a slash and sometimes not.\n * @param {!Tracker} tracker Passed internally by analytics.js\n * @param {?ClientIdTrackerOpts} opts Passed by the require command.\n */\n constructor(tracker, opts) {\n if (typeof opts.customDimensionIndex !== 'number') {\n throw new Error(`The ClientIdTracker plugin requires a\n customDimensionIndex to store the GA Client ID in. Please create a\n custom diminsion and provide its index as a number when requiring\n the ClientIdTracker plugin.`);\n }\n\n /** @type {ClientIdTrackerOpts} */\n this.opts = opts;\n\n this.tracker = tracker;\n\n tracker.set(\n 'dimension' + opts.customDimensionIndex,\n tracker.get('clientId')\n );\n }\n\n /**\n * Restores all overridden tasks and methods.\n */\n remove() {\n this.tracker.set(\n 'dimension' + this.opts.customDimensionIndex,\n null\n );\n }\n}\n\nprovide('clientIdTracker', ClientIdTracker);\n","import provide from '../provide';\nimport {uuid} from '../utilities';\n\n\n/**\n * Class for the `SessionIdTracker` analytics.js plugin.\n * @implements {SessionIdTrackerPublicInterface}\n */\nclass SessionIdTracker {\n /**\n * Registers Session ID tracking on a tracker object. This plugin registers\n * a function which sets a chosen Custom Dimension with an uuid value when\n * it's required. Although the dimension will be set at every page load,\n * given that the dimension configured by the user is session-scoped, GA will\n * report the last value set for all hits within a session.\n * @param {!Tracker} tracker Passed internally by analytics.js\n * @param {?SessionIdTrackerOpts} opts Passed by the require command.\n */\n constructor(tracker, opts) {\n // Opts validation.\n if (typeof opts.customDimensionIndex !== 'number'\n && !SessionIdTracker.validateCustomSessionOpts(opts)) {\n throw new Error(`The SessionIdTracker plugin requires a\n customDimensionIndex to store the auto generated uuid value in\n or a customSession object with customDimensionIndex number and\n id string. You can use both. Please provide the options when requiring\n the plugin.`);\n }\n\n this.tracker = tracker;\n this.opts = opts;\n\n if (typeof opts.customDimensionIndex === 'number') {\n tracker.set('dimension' + opts.customDimensionIndex, uuid());\n }\n\n if (SessionIdTracker.validateCustomSessionOpts(opts)) {\n tracker.set(\n 'dimension' + opts.customSession.customDimensionIndex,\n opts.customSession.id\n );\n }\n }\n\n /**\n * Validates the type of the id property passed in opts.\n * @param {!SessionIdTrackerOpts} opts Passed by the require command.\n * @return {boolean} Indicates if id property passed in is valid.\n */\n static validateCustomSessionOpts(opts) {\n return (typeof opts.customSession === 'object' && typeof opts.customSession.customDimensionIndex === 'number'\n && typeof opts.customSession.id === 'string');\n }\n\n /**\n * Removes Custom Dimiension seding by setting their values to null.\n */\n remove() {\n if (typeof this.opts.customDimensionIndex === 'number') {\n this.tracker.set('dimension' + this.opts.customDimensionIndex, null);\n }\n\n if (SessionIdTracker.validateCustomSessionOpts(this.opts)) {\n this.tracker.set(\n 'dimension' + this.opts.customSession.customDimensionIndex,\n null\n );\n }\n }\n}\n\nprovide('sessionIdTracker', SessionIdTracker);\n","import ga from './ga';\n\n/**\n * Wrapper for calling methods of the GaTaskManager plugin.\n * @param {!Tracker} tracker Passed internally by analytics.js\n * @param {string} methodName the GaTaskManager plugin method to invoke.\n * @param {...*} args\n */\nexport default function callGaTaskManager(tracker, methodName, ...args) {\n ga(tracker.get('name') + '.gaTaskManager:' + methodName, ...args);\n}\n","import provide from '../provide';\nimport callGaTaskManager from '../ga-task-manager';\nimport {uuid} from '../utilities';\n\n/**\n * Class for the `HitIdTracker` analytics.js plugin.\n * @implements {HitIdTrackerPublicInterface}\n */\nclass HitIdTracker {\n\n /**\n * Registers Hit ID tracking on a tracker object. This plugin registers\n * a function which sets a chosen Custom Dimension with an uuid value and\n * registers this function to run at customTask Task execution time of every\n * hit.\n * @param {!Tracker} tracker Passed internally by analytics.js\n * @param {?HitIdTrackerOpts} opts Passed by the require command.\n */\n constructor(tracker, opts) {\n if (!tracker.plugins_ || tracker.plugins_.keys.indexOf('gaTaskManager') === -1) {\n throw new Error(`The HitIdTracker plugin requires the GaTaskManager\n plugin to work. Please load and require the GaTaskManager for this\n tracker before requiring the HitIdTracker plugin.`);\n }\n\n if (typeof opts.customDimensionIndex !== 'number') {\n throw new Error(`The HitIdTracker plugin requires a customDimensionIndex\n to store the GA Client ID in. Please create a custom diminsion and\n provide its index as a number when requiring the HitIdTracker\n plugin.`);\n }\n\n this.tracker = tracker;\n this.opts = opts;\n\n callGaTaskManager(\n tracker,\n 'setCustomDimension',\n opts.customDimensionIndex,\n uuid\n );\n }\n\n\n /**\n * Restores all overridden tasks and methods.\n */\n remove() {\n callGaTaskManager(\n this.tracker,\n 'unsetCustomDimension',\n this.opts.customDimensionIndex\n );\n }\n}\n\nprovide('hitIdTracker', HitIdTracker);\n","import provide from '../provide';\nimport callGaTaskManager from '../ga-task-manager';\n\n/**\n * Class for the `HitTimestampTracker` analytics.js plugin.\n * @implements {HitTimestampTrackerPublicInterface}\n */\nclass HitTimestampTracker {\n /**\n * Registers Hit Timestamp tracking on a tracker object. This plugin registers\n * a function which sets a chosen Custom Dimension with a value of the number\n * of microseconds seconds since 1 January 1970 00:00:00 UTC and registers\n * this function to run at customTask Task execution time of every hit send\n * for this tracker.\n * @param {!Tracker} tracker Passed internally by analytics.js\n * @param {?HitTimestampTrackerOpts} opts Passed by the require command.\n */\n constructor(tracker, opts) {\n if (tracker.plugins_.keys.indexOf('gaTaskManager') === -1) {\n throw new Error(`The HitTimestampTracker plugin requires the GaTaskManager\n plugin to work. Please load and require the GaTaskManager for this\n tracker before requiring the HitTimestampTracker plugin.`);\n }\n\n if (typeof opts.customDimensionIndex !== 'number') {\n throw new Error(`The HitTimestampTracker plugin requires a\n customDimensionIndex to store the GA Client ID in. Please create a\n custom diminsion and provide its index as a number when requiring\n the HitTimestampTracker plugin.`);\n }\n\n this.tracker = tracker;\n this.opts = opts;\n\n callGaTaskManager(\n tracker,\n 'setCustomDimension',\n opts.customDimensionIndex,\n function() {\n return +Date.now();\n }\n );\n }\n\n /**\n * Restores all overridden tasks and methods.\n */\n remove() {\n callGaTaskManager(this.tracker, 'unsetCustomDimension', this.opts.customDimensionIndex);\n }\n}\n\nprovide('hitTimestampTracker', HitTimestampTracker);\n"]}