-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalytics-ga.min.map
More file actions
1 lines (1 loc) · 17.4 KB
/
analytics-ga.min.map
File metadata and controls
1 lines (1 loc) · 17.4 KB
1
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./react/features/analytics/handlers/AbstractHandler.js","webpack:///./react/features/analytics/handlers/GoogleAnalyticsHandler.js","webpack:///./react/features/base/util/helpers.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","AbstractHandler","constructor","options","this","_enabled","_whiteListedEvents","whiteListedEvents","_blackListedEvents","blackListedEvents","_extractName","event","type","action","actionSubject","source","_shouldIgnore","Array","isArray","indexOf","globalNS","window","JitsiMeetJS","app","analyticsHandlers","push","super","_userProperties","googleAnalyticsTrackingId","Error","_initGoogleAnalytics","a","document","q","arguments","Date","createElement","getElementsByTagName","async","src","parentNode","insertBefore","ga","_extractValue","attributes","Math","round","parseFloat","_extractLabel","labelsArray","keys","map","_userPropertiesString","join","setUserProperties","userProps","filter","sendEvent","gaEvent","isNaN","eventValue"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,I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AAWC,aAAaV,EAAE1D,GAG/JqE,GAAG,SAAUvC,EAAQyB,0BAA2B,QAChDc,GAAG,OAAQ,YAafC,cAAchC,GACV,IAAIzB,EAAQyB,GAASA,EAAMiC,YAAcjC,EAAMiC,WAAW1D,MAK1D,OAFAA,EAAQ2D,KAAKC,MAAMC,WAAW7D,IAclC8D,cAAcrC,GACV,MAAM,WAAEiC,EAAa,IAAOjC,EACtBsC,EACAtE,OAAOuE,KAAKN,GAAYO,IAAI3D,GAAQ,GAAEA,KAAOoD,EAAWpD,MAI9D,OAFAyD,EAAYxB,KAAKrB,KAAKgD,uBAEfH,EAAYI,KAAK,KAS5BC,kBAAkBC,EAAY,IAC1B,IAAKnD,KAAKC,SACN,OAMJ,MAAMmD,EAAS,CAAE,aAAc,kBAE/BpD,KAAKgD,sBACCzE,OAAOuE,KAAKK,GACTC,OAAOhE,IAAgC,IAAzBgE,EAAOrC,QAAQ3B,IAC7B2D,IAAI3D,GAAQ,aAAYA,KAAO+D,EAAU/D,MACzC6D,KAAK,KAYlBI,UAAU9C,GACN,GAAIP,KAAKY,cAAcL,GACnB,OAGJ,MAAM+C,EAAU,CACZ,cAAiB,aACjB,YAAetD,KAAKM,aAAaC,GACjC,WAAcP,KAAK4C,cAAcrC,IAE/BzB,EAAQkB,KAAKuC,cAAchC,GAE5BgD,MAAMzE,KACPwE,EAAQE,WAAa1E,GAGzBwD,GAAG,OAAQ,QAASgB","file":"analytics-ga.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/libs/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/**\n * Abstract implementation of analytics handler\n */\nexport default class AbstractHandler {\n /**\n * Creates new instance.\n *\n * @param {Object} options - Optional parameters.\n */\n constructor(options = {}) {\n this._enabled = false;\n this._whiteListedEvents = options.whiteListedEvents;\n\n // FIXME:\n // Keeping the list with the very noisy events so that we don't flood with events whoever hasn't configured\n // white/black lists yet. We need to solve this issue properly by either making these events not so noisy or\n // by removing them completely from the code.\n this._blackListedEvents = [\n ...(options.blackListedEvents || []), // eslint-disable-line no-extra-parens\n 'e2e_rtt', 'rtp.stats', 'rtt.by.region', 'available.device', 'stream.switch.delay', 'ice.state.changed',\n 'ice.duration', 'peer.conn.status.duration'\n ];\n }\n\n /**\n * Extracts a name for the event from the event properties.\n *\n * @param {Object} event - The analytics event.\n * @returns {string} - The extracted name.\n */\n _extractName(event) {\n // Page events have a single 'name' field.\n if (event.type === 'page') {\n return event.name;\n }\n\n const {\n action,\n actionSubject,\n source\n } = event;\n\n // All events have action, actionSubject, and source fields. All\n // three fields are required, and often jitsi-meet and\n // lib-jitsi-meet use the same value when separate values are not\n // necessary (i.e. event.action == event.actionSubject).\n // Here we concatenate these three fields, but avoid adding the same\n // value twice, because it would only make the event's name harder\n // to read.\n let name = action;\n\n if (actionSubject && actionSubject !== action) {\n name = `${actionSubject}.${action}`;\n }\n if (source && source !== action) {\n name = `${source}.${name}`;\n }\n\n return name;\n }\n\n /**\n * Checks if an event should be ignored or not.\n *\n * @param {Object} event - The event.\n * @returns {boolean}\n */\n _shouldIgnore(event) {\n if (!event || !this._enabled) {\n return true;\n }\n\n const name = this._extractName(event);\n\n if (Array.isArray(this._whiteListedEvents)) {\n return this._whiteListedEvents.indexOf(name) === -1;\n }\n\n if (Array.isArray(this._blackListedEvents)) {\n return this._blackListedEvents.indexOf(name) !== -1;\n }\n\n return false;\n }\n}\n","/* global ga */\n\nimport { getJitsiMeetGlobalNS } from '../../base/util';\n\nimport AbstractHandler from './AbstractHandler';\n\n/**\n * Analytics handler for Google Analytics.\n */\nclass GoogleAnalyticsHandler extends AbstractHandler {\n\n /**\n * Creates new instance of the GA analytics handler.\n *\n * @param {Object} options -\n * @param {string} options.googleAnalyticsTrackingId - The GA track id\n * required by the GA API.\n */\n constructor(options) {\n super(options);\n\n this._userProperties = {};\n\n if (!options.googleAnalyticsTrackingId) {\n throw new Error('Failed to initialize Google Analytics handler, no tracking ID');\n }\n\n this._enabled = true;\n this._initGoogleAnalytics(options);\n }\n\n /**\n * Initializes the ga object.\n *\n * @param {Object} options -\n * @param {string} options.googleAnalyticsTrackingId - The GA track id\n * required by the GA API.\n * @returns {void}\n */\n _initGoogleAnalytics(options) {\n /**\n * TODO: Keep this local, there's no need to add it to window.\n */\n /* eslint-disable */\n (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n /* eslint-enable */\n ga('create', options.googleAnalyticsTrackingId, 'auto');\n ga('send', 'pageview');\n }\n\n /**\n * Extracts the integer to use for a Google Analytics event's value field\n * from a lib-jitsi-meet analytics event.\n *\n * @param {Object} event - The lib-jitsi-meet analytics event.\n * @returns {number} - The integer to use for the 'value' of a Google\n * analytics event, or NaN if the lib-jitsi-meet event doesn't contain a\n * suitable value.\n * @private\n */\n _extractValue(event) {\n let value = event && event.attributes && event.attributes.value;\n\n // Try to extract an integer from the \"value\" attribute.\n value = Math.round(parseFloat(value));\n\n return value;\n }\n\n /**\n * Extracts the string to use for a Google Analytics event's label field\n * from a lib-jitsi-meet analytics event.\n *\n * @param {Object} event - The lib-jitsi-meet analytics event.\n * @returns {string} - The string to use for the 'label' of a Google\n * analytics event.\n * @private\n */\n _extractLabel(event) {\n const { attributes = {} } = event;\n const labelsArray\n = Object.keys(attributes).map(key => `${key}=${attributes[key]}`);\n\n labelsArray.push(this._userPropertiesString);\n\n return labelsArray.join('&');\n }\n\n /**\n * Sets the permanent properties for the current session.\n *\n * @param {Object} userProps - The permanent portperties.\n * @returns {void}\n */\n setUserProperties(userProps = {}) {\n if (!this._enabled) {\n return;\n }\n\n // The label field is limited to 500B. We will concatenate all\n // attributes of the event, except the user agent because it may be\n // lengthy and is probably included from elsewhere.\n const filter = [ 'user_agent', 'callstats_name' ];\n\n this._userPropertiesString\n = Object.keys(userProps)\n .filter(key => filter.indexOf(key) === -1)\n .map(key => `permanent_${key}=${userProps[key]}`)\n .join('&');\n }\n\n /**\n * This is the entry point of the API. The function sends an event to\n * google analytics. The format of the event is described in\n * analyticsAdapter in lib-jitsi-meet.\n *\n * @param {Object} event - The event in the format specified by\n * lib-jitsi-meet.\n * @returns {void}\n */\n sendEvent(event) {\n if (this._shouldIgnore(event)) {\n return;\n }\n\n const gaEvent = {\n 'eventCategory': 'jitsi-meet',\n 'eventAction': this._extractName(event),\n 'eventLabel': this._extractLabel(event)\n };\n const value = this._extractValue(event);\n\n if (!isNaN(value)) {\n gaEvent.eventValue = value;\n }\n\n ga('send', 'event', gaEvent);\n }\n\n}\n\nconst globalNS = getJitsiMeetGlobalNS();\n\nglobalNS.analyticsHandlers = globalNS.analyticsHandlers || [];\nglobalNS.analyticsHandlers.push(GoogleAnalyticsHandler);\n","// @flow\n\n/**\n * Creates a deferred object.\n *\n * @returns {{promise, resolve, reject}}\n */\nexport function createDeferred(): Object {\n const deferred = {};\n\n deferred.promise = new Promise((resolve, reject) => {\n deferred.resolve = resolve;\n deferred.reject = reject;\n });\n\n return deferred;\n}\n\nconst MATCH_OPERATOR_REGEXP = /[|\\\\{}()[\\]^$+*?.-]/g;\n\n/**\n * Escape RegExp special characters.\n *\n * Based on https://github.com/sindresorhus/escape-string-regexp.\n *\n * @param {string} s - The regexp string to escape.\n * @returns {string}\n */\nexport function escapeRegexp(s: string) {\n if (typeof s !== 'string') {\n throw new TypeError('Expected a string');\n }\n\n return s.replace(MATCH_OPERATOR_REGEXP, '\\\\$&');\n}\n\n/**\n * Returns the base URL of the app.\n *\n * @param {Object} w - Window object to use instead of the built in one.\n * @returns {string}\n */\nexport function getBaseUrl(w: Object = window) {\n const doc = w.document;\n const base = doc.querySelector('base');\n\n if (base && base.href) {\n return base.href;\n }\n\n const { protocol, host } = w.location;\n\n return `${protocol}//${host}`;\n}\n\n/**\n * Returns the namespace for all global variables, functions, etc that we need.\n *\n * @returns {Object} The namespace.\n *\n * NOTE: After React-ifying everything this should be the only global.\n */\nexport function getJitsiMeetGlobalNS() {\n if (!window.JitsiMeetJS) {\n window.JitsiMeetJS = {};\n }\n\n if (!window.JitsiMeetJS.app) {\n window.JitsiMeetJS.app = {};\n }\n\n return window.JitsiMeetJS.app;\n}\n\n/**\n * A helper function that behaves similar to Object.assign, but only reassigns a\n * property in target if it's defined in source.\n *\n * @param {Object} target - The target object to assign the values into.\n * @param {Object} source - The source object.\n * @returns {Object}\n */\nexport function assignIfDefined(target: Object, source: Object) {\n const to = Object(target);\n\n for (const nextKey in source) {\n if (source.hasOwnProperty(nextKey)) {\n const value = source[nextKey];\n\n if (typeof value !== 'undefined') {\n to[nextKey] = value;\n }\n }\n }\n\n return to;\n}\n\n/**\n * Prints the error and reports it to the global error handler.\n *\n * @param {Error} e - The error object.\n * @param {string} msg - A custom message to print in addition to the error.\n * @returns {void}\n */\nexport function reportError(e: Object, msg: string = '') {\n console.error(msg, e);\n window.onerror && window.onerror(msg, null, null, null, e);\n}\n"],"sourceRoot":""}