'use strict';

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

var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = require('babel-runtime/helpers/createClass');

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = require('babel-runtime/helpers/inherits');

var _inherits3 = _interopRequireDefault(_inherits2);

var _class, _temp2;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

var _OutcomesPerStudentReport = require('outcomes-react/lib/containers/OutcomesPerStudentReport');

var _OutcomesPerStudentReport2 = _interopRequireDefault(_OutcomesPerStudentReport);

var _CustomPropTypes = require('../../../../common/util/CustomPropTypes');

var _CustomPropTypes2 = _interopRequireDefault(_CustomPropTypes);

var _ElementsForSelectors = require('../../../../common/util/ElementsForSelectors');

var _ElementsForSelectors2 = _interopRequireDefault(_ElementsForSelectors);

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

/**
---
category: components
name: OutcomeAnalysis
---
  SDK Outcome Analysis Report component

  A component to show outcomes results

  ```jsx_example
  function Example () {
    return (
      <SDKApp
        apiEndpoint={`http://${config.API_HOST}`}
        appContainer="#app"
        userToken={config.TOKEN_QUIZ_BUILD}
        outcomesEndpoint={`http://${config.OUTCOMES_HOST}`}
        outcomesToken={config.TOKEN_OUTCOMES_REPORT}
      >
        <OutcomeAnalysis quizId='1' />
      </SDKApp>
    )
  }

  <LocaleSwitcher>
    <Example />
  </LocaleSwitcher>
  ```
*/
var OutcomeAnalysis = (_temp2 = _class = function (_Component) {
  (0, _inherits3.default)(OutcomeAnalysis, _Component);

  function OutcomeAnalysis() {
    var _ref;

    var _temp, _this, _ret;

    (0, _classCallCheck3.default)(this, OutcomeAnalysis);

    for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = OutcomeAnalysis.__proto__ || Object.getPrototypeOf(OutcomeAnalysis)).call.apply(_ref, [this].concat(args))), _this), _this.applicationElement = function () {
      return (0, _ElementsForSelectors2.default)(_this.props.appContainer);
    }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);
  }

  (0, _createClass3.default)(OutcomeAnalysis, [{
    key: 'render',
    value: function render() {
      var _props = this.props,
          quizId = _props.quizId,
          contextUuid = _props.contextUuid,
          outcomesHost = _props.outcomesHost,
          outcomesToken = _props.outcomesToken,
          loadUsersOverride = _props.loadUsersOverride,
          showRollups = _props.showRollups;

      return _react2.default.createElement(_OutcomesPerStudentReport2.default, {
        applicationElement: this.applicationElement,
        artifactType: 'quizzes.quiz',
        artifactId: quizId,
        contextUuid: contextUuid,
        host: outcomesHost,
        jwt: outcomesToken,
        loadUsersOverride: loadUsersOverride,
        showRollups: showRollups
      });
    }
  }]);
  OutcomeAnalysis.displayName = 'OutcomeAnalysis'
  ;
  return OutcomeAnalysis;
}(_react.Component), _class.propTypes = {
  appContainer: _CustomPropTypes2.default.selectors.isRequired,
  quizId: _propTypes2.default.string.isRequired,
  contextUuid: _propTypes2.default.string.isRequired,
  outcomesHost: _propTypes2.default.string.isRequired,
  outcomesToken: _propTypes2.default.string.isRequired,
  loadUsersOverride: _propTypes2.default.func,
  showRollups: _propTypes2.default.bool
}, _class.defaultProps = {
  loadUsersOverride: void 0,
  showRollups: true
}, _temp2);
exports.default = OutcomeAnalysis;