if (process.type === 'browser') { try { require('source-map-support').install(); } catch(ignored) {} }var log = require('common/utils/logger').debugLogger(__filename); var logError = require('common/utils/logger').errorLogger(__filename, false); var logFatal = require('common/utils/logger').errorLogger(__filename, true);'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getUserId = getUserId;

var _uuid = require('uuid');

var _uuid2 = _interopRequireDefault(_uuid);

var _prefs = require('common/utils/prefs');

var _prefs2 = _interopRequireDefault(_prefs);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function getUserId() {
  var uid = _prefs2.default.get('analytics-uid');

  // Generate a new one if it doesn't exist
  if (!uid) {
    uid = _uuid2.default.v4();
    _prefs2.default.set('analytics-uid', uid);
  }

  return uid;
}
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbW1vbi91dGlscy9hbmFseXRpY3MuanMiXSwibmFtZXMiOlsiZ2V0VXNlcklkIiwidWlkIiwiZ2V0IiwidjQiLCJzZXQiXSwibWFwcGluZ3MiOiI7Ozs7O1FBSWdCQSxTLEdBQUFBLFM7O0FBSmhCOzs7O0FBRUE7Ozs7OztBQUVPLFNBQVNBLFNBQVQsR0FBc0I7QUFDM0IsTUFBSUMsTUFBTSxnQkFBTUMsR0FBTixDQUFVLGVBQVYsQ0FBVjs7QUFFQTtBQUNBLE1BQUksQ0FBQ0QsR0FBTCxFQUFVO0FBQ1JBLFVBQU0sZUFBS0UsRUFBTCxFQUFOO0FBQ0Esb0JBQU1DLEdBQU4sQ0FBVSxlQUFWLEVBQTJCSCxHQUEzQjtBQUNEOztBQUVELFNBQU9BLEdBQVA7QUFDRCIsImZpbGUiOiJjb21tb24vdXRpbHMvYW5hbHl0aWNzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHV1aWQgZnJvbSAndXVpZCc7XG5cbmltcG9ydCBwcmVmcyBmcm9tICdjb21tb24vdXRpbHMvcHJlZnMnO1xuXG5leHBvcnQgZnVuY3Rpb24gZ2V0VXNlcklkICgpIHtcbiAgbGV0IHVpZCA9IHByZWZzLmdldCgnYW5hbHl0aWNzLXVpZCcpO1xuXG4gIC8vIEdlbmVyYXRlIGEgbmV3IG9uZSBpZiBpdCBkb2Vzbid0IGV4aXN0XG4gIGlmICghdWlkKSB7XG4gICAgdWlkID0gdXVpZC52NCgpO1xuICAgIHByZWZzLnNldCgnYW5hbHl0aWNzLXVpZCcsIHVpZCk7XG4gIH1cblxuICByZXR1cm4gdWlkO1xufVxuIl0sInNvdXJjZVJvb3QiOiJzcmMvc2NyaXB0cyJ9
