"use strict";

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

var _stub = _interopRequireDefault(require("./clients/stub"));

var _env = _interopRequireDefault(require("../env"));

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

/**
 * Internal dependencies
 */

/* eslint-disable camelcase */
const client_info = {
  cli_version: _env.default.app.version,
  os_name: _env.default.os.name,
  os_version: _env.default.os.version,
  node_version: _env.default.node.version
};
/* eslint-enable camelcase */

class Analytics {
  constructor({
    tracks = new _stub.default()
  }) {
    this.tracks = tracks;
  }

  async trackEvent(name, props = {}) {
    return Promise.all([this.tracks.trackEvent(name, Object.assign({}, client_info, props))]);
  }

}

exports.default = Analytics;