"use strict";

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

var _propTypes = _interopRequireDefault(require("prop-types"));

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

var cardMetaObjectProperties = {
  title: _propTypes["default"].string.isRequired,
  slug: _propTypes["default"].string,
  introText: _propTypes["default"].node,
  additionalText: _propTypes["default"].node,
  shareText: _propTypes["default"].string,
  tags: _propTypes["default"].arrayOf(_propTypes["default"].string),
  selector: _propTypes["default"].node,
  analysis: _propTypes["default"].node,
  metadata: _propTypes["default"].node,
  metadataQA: _propTypes["default"].arrayOf(_propTypes["default"].oneOfType([_propTypes["default"].shape({
    section: _propTypes["default"].string
  }), _propTypes["default"].shape({
    question: _propTypes["default"].string,
    answer: _propTypes["default"].string
  })])),
  resources: _propTypes["default"].arrayOf(_propTypes["default"].shape({
    heading: _propTypes["default"].string,
    items: _propTypes["default"].arrayOf(_propTypes["default"].shape({
      link: _propTypes["default"].string,
      description: _propTypes["default"].string
    }))
  })),
  authors: _propTypes["default"].oneOfType([_propTypes["default"].arrayOf(_propTypes["default"].string), _propTypes["default"].oneOf(["Demo"])])
};
var optionalCardMetaKeys = {
  selector: true,
  metadataQA: true
};
exports.optionalCardMetaKeys = optionalCardMetaKeys;

var getKeyNames = function getKeyNames(obj) {
  var keyNames = {};
  Object.keys(obj).forEach(function (key) {
    keyNames[key] = key;
  });
  return keyNames;
};

var cardMetaKeys = getKeyNames(cardMetaObjectProperties);
exports.cardMetaKeys = cardMetaKeys;

var cardMetaTypes = _propTypes["default"].shape(cardMetaObjectProperties);

var _default = cardMetaTypes;
exports["default"] = _default;