"use strict";

exports.__esModule = true;
exports.default = exports.TYPE_VIDEO = exports.TYPE_IMAGE = exports.TYPE_AUDIO = exports.MediaViewPropTypes = void 0;
var _propTypes = _interopRequireDefault(require("prop-types"));
var _propTypes2 = _interopRequireDefault(require("../video-player/prop-types"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const TYPE_IMAGE = exports.TYPE_IMAGE = 'img';
const TYPE_VIDEO = exports.TYPE_VIDEO = 'video';
const TYPE_AUDIO = exports.TYPE_AUDIO = 'audio';
const isType = name => _propTypes.default.oneOf([name]);
const videoPropType = _propTypes.default.shape({
  ..._propTypes2.default,
  type: isType(TYPE_VIDEO).isRequired
});
const imgPropType = _propTypes.default.shape({
  type: isType(TYPE_IMAGE).isRequired,
  url: _propTypes.default.string.isRequired
});
const audioPropType = _propTypes.default.shape({
  type: isType(TYPE_AUDIO).isRequired,
  mediaUrl: _propTypes.default.string.isRequired
});
const MediaViewPropTypes = exports.MediaViewPropTypes = {
  media: _propTypes.default.oneOfType([videoPropType, imgPropType, audioPropType])
};
const SelectOptionsPropTypes = _propTypes.default.shape({
  name: _propTypes.default.string,
  selected: _propTypes.default.bool,
  validOption: _propTypes.default.bool,
  value: _propTypes.default.string
});
const AnswerPropTypes = _propTypes.default.shape({
  title: _propTypes.default.string.isRequired,
  'aria-label': _propTypes.default.string,
  onClick: _propTypes.default.func,
  onChange: _propTypes.default.func,
  selected: _propTypes.default.bool,
  image: _propTypes.default.string,
  options: _propTypes.default.arrayOf(SelectOptionsPropTypes),
  type: _propTypes.default.oneOf(['text', 'select']),
  name: _propTypes.default.string
});
const propTypes = {
  model: _propTypes.default.shape({
    type: _propTypes.default.oneOf(['qcmDrag', 'qcm', 'qcmGraphic', 'freeText', 'dropDown', 'slider', 'template']).isRequired,
    answer: _propTypes.default.arrayOf(AnswerPropTypes)
  }).isRequired,
  help: _propTypes.default.string,
  question: _propTypes.default.string,
  media: MediaViewPropTypes.media
};
var _default = exports.default = propTypes;
//# sourceMappingURL=prop-types.js.map