"use strict";

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

var _react = _interopRequireDefault(require("react"));

var _styledComponents = _interopRequireDefault(require("styled-components"));

var _spacing = require("../../../mixins/spacing");

var _loadingIndicator = require("./loading-indicator.css-rules");

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

function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }

function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }

var LoadingIndicatorNotReady = _styledComponents["default"].div.attrs(function (props) {
  return {
    style: (0, _spacing.getSpacingRules)(props)
  };
}).withConfig({
  displayName: "LoadingIndicatorNotReady",
  componentId: "in2x6g-0"
})(["min-height:", ";width:100%;background:", " no-repeat center;"], _loadingIndicator.getMinHeightValue, _loadingIndicator.getAnimationUrl);

var LoadingIndicatorReady = _styledComponents["default"].div.attrs(function (props) {
  return {
    style: (0, _spacing.getSpacingRules)(props)
  };
}).withConfig({
  displayName: "LoadingIndicatorReady",
  componentId: "in2x6g-1"
})(["min-height:", ";width:100%;"], _loadingIndicator.getMinHeightValue);

var LoadingIndicator = function LoadingIndicator(_ref) {
  var ready = _ref.ready,
      children = _ref.children,
      props = _objectWithoutProperties(_ref, ["ready", "children"]);

  return ready ? _react["default"].createElement(LoadingIndicatorReady, props, children) : _react["default"].createElement(LoadingIndicatorNotReady, props);
};

exports.LoadingIndicator = LoadingIndicator;
LoadingIndicator.displayName = 'LoadingIndicator';