'use strict';

var _requestify;

function _load_requestify() {
  return _requestify = _interopRequireDefault(require('requestify'));
}

var _globalConfig;

function _load_globalConfig() {
  return _globalConfig = require('../api/consumer/lib/global-config');
}

var _constants;

function _load_constants() {
  return _constants = require('../constants');
}

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

var ANALYTICS_DOMAIN = (0, (_globalConfig || _load_globalConfig()).getSync)((_constants || _load_constants()).CFG_ANALYTICS_DOMAIN_KEY) || (_constants || _load_constants()).DEFAULT_ANALYTICS_DOMAIN;

process.on('message', function (msg) {
  return (_requestify || _load_requestify()).default.post(ANALYTICS_DOMAIN, msg, { timeout: 1000 }).then(function () {
    return process.exit();
  }).fail(function () {
    return process.exit();
  });
});

setTimeout(function () {
  process.exit();
}, 5000);