"use strict";

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

var _menus = require("./menus");

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; }

var _default = /*#__PURE__*/function () {
  function _default(history) {
    _classCallCheck(this, _default);

    this.history = null;
    this.history = history;
  }

  _createClass(_default, [{
    key: "highlight",
    value: function highlight(cb) {
      if (this.isEvaluationManage()) {
        cb(_menus.PAGE_SURVEY_MANAGE);
      } else if (this.isMyInvolved()) {
        cb(_menus.PAGE_SURVEY_MY_INVOLVED);
      } else if (this.isAssessTemplated()) {
        cb(_menus.PAGE_SURVEY_TEMPLATED);
      } else if (this.isAssessSettings()) {
        cb(_menus.PAGE_SURVEY_ASSESS_SETTINGS);
      }

      return null;
    }
  }, {
    key: "isMyInvolved",
    value: function isMyInvolved() {
      var pathname = this.history.location.pathname;
      return pathname.match(/survey\/my-involved/);
    }
  }, {
    key: "isEvaluationManage",
    value: function isEvaluationManage() {
      var pathname = this.history.location.pathname;
      return pathname.match(/survey\/manage/);
    }
  }, {
    key: "isAssessTemplated",
    value: function isAssessTemplated() {
      var pathname = this.history.location.pathname;
      return pathname.match(/survey\/templated/);
    }
  }, {
    key: "isAssessSettings",
    value: function isAssessSettings() {
      var pathname = this.history.location.pathname;
      return pathname.match(/survey\/assess-settings/);
    }
  }]);

  return _default;
}();

exports["default"] = _default;