| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267 |
- (function webpackUniversalModuleDefinition(root, factory) {
- if(typeof exports === 'object' && typeof module === 'object')
- module.exports = factory(require("react"), require("prop-types"));
- else if(typeof define === 'function' && define.amd)
- define(["react", "prop-types"], factory);
- else {
- var a = typeof exports === 'object' ? factory(require("react"), require("prop-types")) : factory(root["react"], root["prop-types"]);
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
- }
- })(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE__13__, __WEBPACK_EXTERNAL_MODULE__14__) {
- return /******/ (function(modules) { // webpackBootstrap
- /******/ // The module cache
- /******/ var installedModules = {};
- /******/
- /******/ // The require function
- /******/ function __webpack_require__(moduleId) {
- /******/
- /******/ // Check if module is in cache
- /******/ if(installedModules[moduleId]) {
- /******/ return installedModules[moduleId].exports;
- /******/ }
- /******/ // Create a new module (and put it into the cache)
- /******/ var module = installedModules[moduleId] = {
- /******/ i: moduleId,
- /******/ l: false,
- /******/ exports: {}
- /******/ };
- /******/
- /******/ // Execute the module function
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
- /******/
- /******/ // Flag the module as loaded
- /******/ module.l = true;
- /******/
- /******/ // Return the exports of the module
- /******/ return module.exports;
- /******/ }
- /******/
- /******/
- /******/ // expose the modules object (__webpack_modules__)
- /******/ __webpack_require__.m = modules;
- /******/
- /******/ // expose the module cache
- /******/ __webpack_require__.c = installedModules;
- /******/
- /******/ // define getter function for harmony exports
- /******/ __webpack_require__.d = function(exports, name, getter) {
- /******/ if(!__webpack_require__.o(exports, name)) {
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
- /******/ }
- /******/ };
- /******/
- /******/ // define __esModule on exports
- /******/ __webpack_require__.r = function(exports) {
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
- /******/ }
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
- /******/ };
- /******/
- /******/ // create a fake namespace object
- /******/ // mode & 1: value is a module id, require it
- /******/ // mode & 2: merge all properties of value into the ns
- /******/ // mode & 4: return value when already ns object
- /******/ // mode & 8|1: behave like require
- /******/ __webpack_require__.t = function(value, mode) {
- /******/ if(mode & 1) value = __webpack_require__(value);
- /******/ if(mode & 8) return value;
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
- /******/ var ns = Object.create(null);
- /******/ __webpack_require__.r(ns);
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
- /******/ return ns;
- /******/ };
- /******/
- /******/ // getDefaultExport function for compatibility with non-harmony modules
- /******/ __webpack_require__.n = function(module) {
- /******/ var getter = module && module.__esModule ?
- /******/ function getDefault() { return module['default']; } :
- /******/ function getModuleExports() { return module; };
- /******/ __webpack_require__.d(getter, 'a', getter);
- /******/ return getter;
- /******/ };
- /******/
- /******/ // Object.prototype.hasOwnProperty.call
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
- /******/
- /******/ // __webpack_public_path__
- /******/ __webpack_require__.p = "";
- /******/
- /******/
- /******/ // Load entry module and return exports
- /******/ return __webpack_require__(__webpack_require__.s = 11);
- /******/ })
- /************************************************************************/
- /******/ ([
- /* 0 */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = warn;
-
- function warn(s) {
- console.warn('[react-ga]', s);
- }
-
- /***/ }),
- /* 1 */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = trim;
-
- // GA strings need to have leading/trailing whitespace trimmed, and not all
- // browsers have String.prototoype.trim().
- function trim(s) {
- return s && s.toString().replace(/^\s+|\s+$/g, '');
- }
-
- /***/ }),
- /* 2 */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.addTrackers = addTrackers;
- exports["default"] = void 0;
- exports.event = event;
- exports.exception = exception;
- exports.ga = ga;
- exports.initialize = initialize;
- exports.modalview = modalview;
- exports.outboundLink = outboundLink;
- exports.pageview = pageview;
- exports.plugin = void 0;
- exports.send = send;
- exports.set = set;
- exports.testModeAPI = void 0;
- exports.timing = timing;
-
- var _format2 = _interopRequireDefault(__webpack_require__(3));
-
- var _removeLeadingSlash = _interopRequireDefault(__webpack_require__(7));
-
- var _trim = _interopRequireDefault(__webpack_require__(1));
-
- var _loadGA = _interopRequireDefault(__webpack_require__(8));
-
- var _warn = _interopRequireDefault(__webpack_require__(0));
-
- var _log = _interopRequireDefault(__webpack_require__(9));
-
- var _testModeAPI = _interopRequireDefault(__webpack_require__(10));
-
- var _excluded = ["category", "action", "label", "value", "nonInteraction", "transport"];
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
-
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
-
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
-
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
-
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
-
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
-
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
-
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
-
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
-
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
-
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
-
- var _isNotBrowser = typeof window === 'undefined' || typeof document === 'undefined';
-
- var _debug = false;
- var _titleCase = true;
- var _testMode = false;
- var _alwaysSendToDefaultTracker = true;
- var _redactEmail = true;
-
- var internalGa = function internalGa() {
- var _window;
-
- if (_testMode) return _testModeAPI["default"].ga.apply(_testModeAPI["default"], arguments);
- if (_isNotBrowser) return false;
- if (!window.ga) return (0, _warn["default"])('ReactGA.initialize must be called first or GoogleAnalytics should be loaded manually');
- return (_window = window).ga.apply(_window, arguments);
- };
-
- function _format(s) {
- return (0, _format2["default"])(s, _titleCase, _redactEmail);
- }
-
- function _gaCommand(trackerNames) {
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- var command = args[0];
-
- if (typeof internalGa === 'function') {
- if (typeof command !== 'string') {
- (0, _warn["default"])('ga command must be a string');
- return;
- }
-
- if (_alwaysSendToDefaultTracker || !Array.isArray(trackerNames)) internalGa.apply(void 0, args);
-
- if (Array.isArray(trackerNames)) {
- trackerNames.forEach(function (name) {
- internalGa.apply(void 0, _toConsumableArray(["".concat(name, ".").concat(command)].concat(args.slice(1))));
- });
- }
- }
- }
-
- function _initialize(gaTrackingID, options) {
- if (!gaTrackingID) {
- (0, _warn["default"])('gaTrackingID is required in initialize()');
- return;
- }
-
- if (options) {
- if (options.debug && options.debug === true) {
- _debug = true;
- }
-
- if (options.titleCase === false) {
- _titleCase = false;
- }
-
- if (options.redactEmail === false) {
- _redactEmail = false;
- }
-
- if (options.useExistingGa) {
- return;
- }
- }
-
- if (options && options.gaOptions) {
- internalGa('create', gaTrackingID, options.gaOptions);
- } else {
- internalGa('create', gaTrackingID, 'auto');
- }
- }
-
- function addTrackers(configsOrTrackingId, options) {
- if (Array.isArray(configsOrTrackingId)) {
- configsOrTrackingId.forEach(function (config) {
- if (_typeof(config) !== 'object') {
- (0, _warn["default"])('All configs must be an object');
- return;
- }
-
- _initialize(config.trackingId, config);
- });
- } else {
- _initialize(configsOrTrackingId, options);
- }
-
- return true;
- }
-
- function initialize(configsOrTrackingId, options) {
- if (options && options.testMode === true) {
- _testMode = true;
- } else {
- if (_isNotBrowser) {
- return;
- }
-
- if (!options || options.standardImplementation !== true) (0, _loadGA["default"])(options);
- }
-
- _alwaysSendToDefaultTracker = options && typeof options.alwaysSendToDefaultTracker === 'boolean' ? options.alwaysSendToDefaultTracker : true;
- addTrackers(configsOrTrackingId, options);
- }
- /**
- * ga:
- * Returns the original GA object.
- */
-
-
- function ga() {
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- args[_key2] = arguments[_key2];
- }
-
- if (args.length > 0) {
- internalGa.apply(void 0, args);
-
- if (_debug) {
- (0, _log["default"])("called ga('arguments');");
- (0, _log["default"])("with arguments: ".concat(JSON.stringify(args)));
- }
- }
-
- return window.ga;
- }
- /**
- * set:
- * GA tracker set method
- * @param {Object} fieldsObject - a field/value pair or a group of field/value pairs on the tracker
- * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on
- */
-
-
- function set(fieldsObject, trackerNames) {
- if (!fieldsObject) {
- (0, _warn["default"])('`fieldsObject` is required in .set()');
- return;
- }
-
- if (_typeof(fieldsObject) !== 'object') {
- (0, _warn["default"])('Expected `fieldsObject` arg to be an Object');
- return;
- }
-
- if (Object.keys(fieldsObject).length === 0) {
- (0, _warn["default"])('empty `fieldsObject` given to .set()');
- }
-
- _gaCommand(trackerNames, 'set', fieldsObject);
-
- if (_debug) {
- (0, _log["default"])("called ga('set', fieldsObject);");
- (0, _log["default"])("with fieldsObject: ".concat(JSON.stringify(fieldsObject)));
- }
- }
- /**
- * send:
- * Clone of the low level `ga.send` method
- * WARNING: No validations will be applied to this
- * @param {Object} fieldObject - field object for tracking different analytics
- * @param {Array} trackerNames - trackers to send the command to
- * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on
- */
-
-
- function send(fieldObject, trackerNames) {
- _gaCommand(trackerNames, 'send', fieldObject);
-
- if (_debug) {
- (0, _log["default"])("called ga('send', fieldObject);");
- (0, _log["default"])("with fieldObject: ".concat(JSON.stringify(fieldObject)));
- (0, _log["default"])("with trackers: ".concat(JSON.stringify(trackerNames)));
- }
- }
- /**
- * pageview:
- * Basic GA pageview tracking
- * @param {String} path - the current page page e.g. '/about'
- * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on
- * @param {String} title - (optional) the page title e. g. 'My Website'
- */
-
-
- function pageview(rawPath, trackerNames, title) {
- if (!rawPath) {
- (0, _warn["default"])('path is required in .pageview()');
- return;
- }
-
- var path = (0, _trim["default"])(rawPath);
-
- if (path === '') {
- (0, _warn["default"])('path cannot be an empty string in .pageview()');
- return;
- }
-
- var extraFields = {};
-
- if (title) {
- extraFields.title = title;
- }
-
- if (typeof ga === 'function') {
- _gaCommand(trackerNames, 'send', _objectSpread({
- hitType: 'pageview',
- page: path
- }, extraFields));
-
- if (_debug) {
- (0, _log["default"])("called ga('send', 'pageview', path);");
- var extraLog = '';
-
- if (title) {
- extraLog = " and title: ".concat(title);
- }
-
- (0, _log["default"])("with path: ".concat(path).concat(extraLog));
- }
- }
- }
- /**
- * modalview:
- * a proxy to basic GA pageview tracking to consistently track
- * modal views that are an equivalent UX to a traditional pageview
- * @param {String} modalName e.g. 'add-or-edit-club'
- * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on
- */
-
-
- function modalview(rawModalName, trackerNames) {
- if (!rawModalName) {
- (0, _warn["default"])('modalName is required in .modalview(modalName)');
- return;
- }
-
- var modalName = (0, _removeLeadingSlash["default"])((0, _trim["default"])(rawModalName));
-
- if (modalName === '') {
- (0, _warn["default"])('modalName cannot be an empty string or a single / in .modalview()');
- return;
- }
-
- if (typeof ga === 'function') {
- var path = "/modal/".concat(modalName);
-
- _gaCommand(trackerNames, 'send', 'pageview', path);
-
- if (_debug) {
- (0, _log["default"])("called ga('send', 'pageview', path);");
- (0, _log["default"])("with path: ".concat(path));
- }
- }
- }
- /**
- * timing:
- * GA timing
- * @param args.category {String} required
- * @param args.variable {String} required
- * @param args.value {Int} required
- * @param args.label {String} required
- * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on
- */
-
-
- function timing() {
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
- category = _ref.category,
- variable = _ref.variable,
- value = _ref.value,
- label = _ref.label;
-
- var trackerNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
-
- if (typeof ga === 'function') {
- if (!category || !variable || typeof value !== 'number') {
- (0, _warn["default"])('args.category, args.variable ' + 'AND args.value are required in timing() ' + 'AND args.value has to be a number');
- return;
- } // Required Fields
-
-
- var fieldObject = {
- hitType: 'timing',
- timingCategory: _format(category),
- timingVar: _format(variable),
- timingValue: value
- };
-
- if (label) {
- fieldObject.timingLabel = _format(label);
- }
-
- send(fieldObject, trackerNames);
- }
- }
- /**
- * event:
- * GA event tracking
- * @param args.category {String} required
- * @param args.action {String} required
- * @param args.label {String} optional
- * @param args.value {Int} optional
- * @param args.nonInteraction {boolean} optional
- * @param args.transport {string} optional
- * @param {{action: string, category: string}} trackerNames - (optional) a list of extra trackers to run the command on
- */
-
-
- function event() {
- var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
- category = _ref2.category,
- action = _ref2.action,
- label = _ref2.label,
- value = _ref2.value,
- nonInteraction = _ref2.nonInteraction,
- transport = _ref2.transport,
- args = _objectWithoutProperties(_ref2, _excluded);
-
- var trackerNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
-
- if (typeof ga === 'function') {
- // Simple Validation
- if (!category || !action) {
- (0, _warn["default"])('args.category AND args.action are required in event()');
- return;
- } // Required Fields
-
-
- var fieldObject = {
- hitType: 'event',
- eventCategory: _format(category),
- eventAction: _format(action)
- }; // Optional Fields
-
- if (label) {
- fieldObject.eventLabel = _format(label);
- }
-
- if (typeof value !== 'undefined') {
- if (typeof value !== 'number') {
- (0, _warn["default"])('Expected `args.value` arg to be a Number.');
- } else {
- fieldObject.eventValue = value;
- }
- }
-
- if (typeof nonInteraction !== 'undefined') {
- if (typeof nonInteraction !== 'boolean') {
- (0, _warn["default"])('`args.nonInteraction` must be a boolean.');
- } else {
- fieldObject.nonInteraction = nonInteraction;
- }
- }
-
- if (typeof transport !== 'undefined') {
- if (typeof transport !== 'string') {
- (0, _warn["default"])('`args.transport` must be a string.');
- } else {
- if (['beacon', 'xhr', 'image'].indexOf(transport) === -1) {
- (0, _warn["default"])('`args.transport` must be either one of these values: `beacon`, `xhr` or `image`');
- }
-
- fieldObject.transport = transport;
- }
- }
-
- Object.keys(args).filter(function (key) {
- return key.substr(0, 'dimension'.length) === 'dimension';
- }).forEach(function (key) {
- fieldObject[key] = args[key];
- });
- Object.keys(args).filter(function (key) {
- return key.substr(0, 'metric'.length) === 'metric';
- }).forEach(function (key) {
- fieldObject[key] = args[key];
- }); // Send to GA
-
- send(fieldObject, trackerNames);
- }
- }
- /**
- * exception:
- * GA exception tracking
- * @param args.description {String} optional
- * @param args.fatal {boolean} optional
- * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on
- */
-
-
- function exception(_ref3, trackerNames) {
- var description = _ref3.description,
- fatal = _ref3.fatal;
-
- if (typeof ga === 'function') {
- // Required Fields
- var fieldObject = {
- hitType: 'exception'
- }; // Optional Fields
-
- if (description) {
- fieldObject.exDescription = _format(description);
- }
-
- if (typeof fatal !== 'undefined') {
- if (typeof fatal !== 'boolean') {
- (0, _warn["default"])('`args.fatal` must be a boolean.');
- } else {
- fieldObject.exFatal = fatal;
- }
- } // Send to GA
-
-
- send(fieldObject, trackerNames);
- }
- }
-
- var plugin = {
- /**
- * require:
- * GA requires a plugin
- * @param name {String} e.g. 'ecommerce' or 'myplugin'
- * @param options {Object} optional e.g {path: '/log', debug: true}
- * @param trackerName {String} optional e.g 'trackerName'
- */
- require: function require(rawName, options, trackerName) {
- if (typeof ga === 'function') {
- // Required Fields
- if (!rawName) {
- (0, _warn["default"])('`name` is required in .require()');
- return;
- }
-
- var name = (0, _trim["default"])(rawName);
-
- if (name === '') {
- (0, _warn["default"])('`name` cannot be an empty string in .require()');
- return;
- }
-
- var requireString = trackerName ? "".concat(trackerName, ".require") : 'require'; // Optional Fields
-
- if (options) {
- if (_typeof(options) !== 'object') {
- (0, _warn["default"])('Expected `options` arg to be an Object');
- return;
- }
-
- if (Object.keys(options).length === 0) {
- (0, _warn["default"])('Empty `options` given to .require()');
- }
-
- ga(requireString, name, options);
-
- if (_debug) {
- (0, _log["default"])("called ga('require', '".concat(name, "', ").concat(JSON.stringify(options)));
- }
- } else {
- ga(requireString, name);
-
- if (_debug) {
- (0, _log["default"])("called ga('require', '".concat(name, "');"));
- }
- }
- }
- },
-
- /**
- * execute:
- * GA execute action for plugin
- * Takes variable number of arguments
- * @param pluginName {String} e.g. 'ecommerce' or 'myplugin'
- * @param action {String} e.g. 'addItem' or 'myCustomAction'
- * @param actionType {String} optional e.g. 'detail'
- * @param payload {Object} optional e.g { id: '1x5e', name : 'My product to track' }
- */
- execute: function execute(pluginName, action) {
- var payload;
- var actionType;
-
- for (var _len3 = arguments.length, args = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
- args[_key3 - 2] = arguments[_key3];
- }
-
- if (args.length === 1) {
- payload = args[0];
- } else {
- actionType = args[0];
- payload = args[1];
- }
-
- if (typeof ga === 'function') {
- if (typeof pluginName !== 'string') {
- (0, _warn["default"])('Expected `pluginName` arg to be a String.');
- } else if (typeof action !== 'string') {
- (0, _warn["default"])('Expected `action` arg to be a String.');
- } else {
- var command = "".concat(pluginName, ":").concat(action);
- payload = payload || null;
-
- if (actionType && payload) {
- ga(command, actionType, payload);
-
- if (_debug) {
- (0, _log["default"])("called ga('".concat(command, "');"));
- (0, _log["default"])("actionType: \"".concat(actionType, "\" with payload: ").concat(JSON.stringify(payload)));
- }
- } else if (payload) {
- ga(command, payload);
-
- if (_debug) {
- (0, _log["default"])("called ga('".concat(command, "');"));
- (0, _log["default"])("with payload: ".concat(JSON.stringify(payload)));
- }
- } else {
- ga(command);
-
- if (_debug) {
- (0, _log["default"])("called ga('".concat(command, "');"));
- }
- }
- }
- }
- }
- };
- /**
- * outboundLink:
- * GA outboundLink tracking
- * @param args.label {String} e.g. url, or 'Create an Account'
- * @param {function} hitCallback - Called after processing a hit.
- */
-
- exports.plugin = plugin;
-
- function outboundLink(args, hitCallback, trackerNames) {
- if (typeof hitCallback !== 'function') {
- (0, _warn["default"])('hitCallback function is required');
- return;
- }
-
- if (typeof ga === 'function') {
- // Simple Validation
- if (!args || !args.label) {
- (0, _warn["default"])('args.label is required in outboundLink()');
- return;
- } // Required Fields
-
-
- var fieldObject = {
- hitType: 'event',
- eventCategory: 'Outbound',
- eventAction: 'Click',
- eventLabel: _format(args.label)
- };
- var safetyCallbackCalled = false;
-
- var safetyCallback = function safetyCallback() {
- // This prevents a delayed response from GA
- // causing hitCallback from being fired twice
- safetyCallbackCalled = true;
- hitCallback();
- }; // Using a timeout to ensure the execution of critical application code
- // in the case when the GA server might be down
- // or an ad blocker prevents sending the data
- // register safety net timeout:
-
-
- var t = setTimeout(safetyCallback, 250);
-
- var clearableCallbackForGA = function clearableCallbackForGA() {
- clearTimeout(t);
-
- if (!safetyCallbackCalled) {
- hitCallback();
- }
- };
-
- fieldObject.hitCallback = clearableCallbackForGA; // Send to GA
-
- send(fieldObject, trackerNames);
- } else {
- // if ga is not defined, return the callback so the application
- // continues to work as expected
- setTimeout(hitCallback, 0);
- }
- }
-
- var testModeAPI = _testModeAPI["default"];
- exports.testModeAPI = testModeAPI;
- var _default = {
- initialize: initialize,
- ga: ga,
- set: set,
- send: send,
- pageview: pageview,
- modalview: modalview,
- timing: timing,
- event: event,
- exception: exception,
- plugin: plugin,
- outboundLink: outboundLink,
- testModeAPI: _testModeAPI["default"]
- };
- exports["default"] = _default;
-
- /***/ }),
- /* 3 */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = format;
-
- var _redactEmail = _interopRequireDefault(__webpack_require__(4));
-
- var _toTitleCase = _interopRequireDefault(__webpack_require__(6));
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function format() {
- var s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
- var titleCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var redactingEmail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
-
- var _str = s || '';
-
- if (titleCase) {
- _str = (0, _toTitleCase["default"])(s);
- }
-
- if (redactingEmail) {
- _str = (0, _redactEmail["default"])(_str);
- }
-
- return _str;
- }
-
- /***/ }),
- /* 4 */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = redactEmail;
-
- var _warn = _interopRequireDefault(__webpack_require__(0));
-
- var _mightBeEmail = _interopRequireDefault(__webpack_require__(5));
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- var redacted = 'REDACTED (Potential Email Address)';
-
- function redactEmail(string) {
- if ((0, _mightBeEmail["default"])(string)) {
- (0, _warn["default"])('This arg looks like an email address, redacting.');
- return redacted;
- }
-
- return string;
- }
-
- /***/ }),
- /* 5 */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = mightBeEmail;
-
- // See if s could be an email address. We don't want to send personal data like email.
- // https://support.google.com/analytics/answer/2795983?hl=en
- function mightBeEmail(s) {
- // There's no point trying to validate rfc822 fully, just look for ...@...
- return typeof s === 'string' && s.indexOf('@') !== -1;
- }
-
- /***/ }),
- /* 6 */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = toTitleCase;
-
- var _trim = _interopRequireDefault(__webpack_require__(1));
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- /**
- * To Title Case 2.1 - http://individed.com/code/to-title-case/
- * Copyright 2008-2013 David Gouch. Licensed under the MIT License.
- * https://github.com/gouch/to-title-case
- */
- var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i; // test
-
- function toTitleCase(string) {
- return (0, _trim["default"])(string).replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function (match, index, title) {
- if (index > 0 && index + match.length !== title.length && match.search(smallWords) > -1 && title.charAt(index - 2) !== ':' && (title.charAt(index + match.length) !== '-' || title.charAt(index - 1) === '-') && title.charAt(index - 1).search(/[^\s-]/) < 0) {
- return match.toLowerCase();
- }
-
- if (match.substr(1).search(/[A-Z]|\../) > -1) {
- return match;
- }
-
- return match.charAt(0).toUpperCase() + match.substr(1);
- });
- }
-
- /***/ }),
- /* 7 */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = removeLeadingSlash;
-
- function removeLeadingSlash(string) {
- if (string.substring(0, 1) === '/') {
- return string.substring(1);
- }
-
- return string;
- }
-
- /***/ }),
- /* 8 */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = _default;
- var isLoaded = false;
-
- function _default(options) {
- if (isLoaded) return;
- isLoaded = true;
- var gaAddress = 'https://www.google-analytics.com/analytics.js';
-
- if (options && options.gaAddress) {
- gaAddress = options.gaAddress;
- } else if (options && options.debug) {
- gaAddress = 'https://www.google-analytics.com/analytics_debug.js';
- }
-
- var onerror = options && options.onerror; // https://developers.google.com/analytics/devguides/collection/analyticsjs/
-
- /* eslint-disable */
-
- (function (i, s, o, g, r, a, m) {
- i['GoogleAnalyticsObject'] = r;
- i[r] = i[r] || function () {
- (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;
- a.onerror = onerror;
- m.parentNode.insertBefore(a, m);
- })(window, document, 'script', gaAddress, 'ga');
- /* eslint-enable */
-
- }
-
- /***/ }),
- /* 9 */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = log;
-
- function log(s) {
- console.info('[react-ga]', s);
- }
-
- /***/ }),
- /* 10 */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.gaCalls = exports["default"] = void 0;
- var gaCalls = [];
- exports.gaCalls = gaCalls;
- var _default = {
- calls: gaCalls,
- ga: function ga() {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- gaCalls.push([].concat(args));
- },
- resetCalls: function resetCalls() {
- gaCalls.length = 0;
- }
- };
- exports["default"] = _default;
-
- /***/ }),
- /* 11 */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.timing = exports.testModeAPI = exports.set = exports.send = exports.plugin = exports.pageview = exports.outboundLink = exports.modalview = exports.initialize = exports.ga = exports.exception = exports.event = exports["default"] = exports.addTrackers = exports.OutboundLink = void 0;
-
- var _OutboundLink = _interopRequireDefault(__webpack_require__(12));
-
- var Defaults = _interopRequireWildcard(__webpack_require__(2));
-
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
-
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
-
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
-
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
- var initialize = Defaults.initialize;
- exports.initialize = initialize;
- var addTrackers = Defaults.addTrackers;
- exports.addTrackers = addTrackers;
- var ga = Defaults.ga;
- exports.ga = ga;
- var set = Defaults.set;
- exports.set = set;
- var send = Defaults.send;
- exports.send = send;
- var pageview = Defaults.pageview;
- exports.pageview = pageview;
- var modalview = Defaults.modalview;
- exports.modalview = modalview;
- var timing = Defaults.timing;
- exports.timing = timing;
- var event = Defaults.event;
- exports.event = event;
- var exception = Defaults.exception;
- exports.exception = exception;
- var plugin = Defaults.plugin;
- exports.plugin = plugin;
- var outboundLink = Defaults.outboundLink;
- exports.outboundLink = outboundLink;
- var testModeAPI = Defaults.testModeAPI;
- exports.testModeAPI = testModeAPI;
- _OutboundLink["default"].origTrackLink = _OutboundLink["default"].trackLink;
- _OutboundLink["default"].trackLink = Defaults.outboundLink;
- var OutboundLink = _OutboundLink["default"];
- exports.OutboundLink = OutboundLink;
-
- var _default = _objectSpread(_objectSpread({}, Defaults), {}, {
- OutboundLink: OutboundLink
- });
-
- exports["default"] = _default;
-
- /***/ }),
- /* 12 */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
-
- var _react = _interopRequireWildcard(__webpack_require__(13));
-
- var _propTypes = _interopRequireDefault(__webpack_require__(14));
-
- var _warn = _interopRequireDefault(__webpack_require__(0));
-
- var _excluded = ["to", "target"];
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
-
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
-
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
-
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
-
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
-
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
-
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
-
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
-
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
-
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
-
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
-
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
-
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
-
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
- var NEWTAB = '_blank';
- var MIDDLECLICK = 1;
-
- var OutboundLink = /*#__PURE__*/function (_Component) {
- _inherits(OutboundLink, _Component);
-
- var _super = _createSuper(OutboundLink);
-
- function OutboundLink() {
- var _this;
-
- _classCallCheck(this, OutboundLink);
-
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- _this = _super.call.apply(_super, [this].concat(args));
-
- _defineProperty(_assertThisInitialized(_this), "handleClick", function (event) {
- var _this$props = _this.props,
- target = _this$props.target,
- eventLabel = _this$props.eventLabel,
- to = _this$props.to,
- onClick = _this$props.onClick,
- trackerNames = _this$props.trackerNames;
- var eventMeta = {
- label: eventLabel
- };
- var sameTarget = target !== NEWTAB;
- var normalClick = !(event.ctrlKey || event.shiftKey || event.metaKey || event.button === MIDDLECLICK);
-
- if (sameTarget && normalClick) {
- event.preventDefault();
- OutboundLink.trackLink(eventMeta, function () {
- window.location.href = to;
- }, trackerNames);
- } else {
- OutboundLink.trackLink(eventMeta, function () {}, trackerNames);
- }
-
- if (onClick) {
- onClick(event);
- }
- });
-
- return _this;
- }
-
- _createClass(OutboundLink, [{
- key: "render",
- value: function render() {
- var _this$props2 = this.props,
- href = _this$props2.to,
- target = _this$props2.target,
- oldProps = _objectWithoutProperties(_this$props2, _excluded);
-
- var props = _objectSpread(_objectSpread({}, oldProps), {}, {
- target: target,
- href: href,
- onClick: this.handleClick
- });
-
- if (target === NEWTAB) {
- props.rel = "".concat(props.rel ? props.rel : '', " noopener noreferrer").trim();
- }
-
- delete props.eventLabel;
- delete props.trackerNames;
- return /*#__PURE__*/_react["default"].createElement('a', props);
- }
- }]);
-
- return OutboundLink;
- }(_react.Component);
-
- exports["default"] = OutboundLink;
-
- _defineProperty(OutboundLink, "trackLink", function () {
- (0, _warn["default"])('ga tracking not enabled');
- });
-
- OutboundLink.propTypes = {
- eventLabel: _propTypes["default"].string.isRequired,
- target: _propTypes["default"].string,
- to: _propTypes["default"].string,
- onClick: _propTypes["default"].func,
- trackerNames: _propTypes["default"].arrayOf(_propTypes["default"].string)
- };
- OutboundLink.defaultProps = {
- target: null,
- to: null,
- onClick: null,
- trackerNames: null
- };
-
- /***/ }),
- /* 13 */
- /***/ (function(module, exports) {
-
- module.exports = __WEBPACK_EXTERNAL_MODULE__13__;
-
- /***/ }),
- /* 14 */
- /***/ (function(module, exports) {
-
- module.exports = __WEBPACK_EXTERNAL_MODULE__14__;
-
- /***/ })
- /******/ ]);
- });
|