"use strict";

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

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _createClass = 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _react = require("react");

var _react2 = _interopRequireDefault(_react);

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

function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var FilterIcon = exports.FilterIcon = function (_Component) {
  _inherits(FilterIcon, _Component);

  function FilterIcon() {
    _classCallCheck(this, FilterIcon);

    return _possibleConstructorReturn(this, (FilterIcon.__proto__ || Object.getPrototypeOf(FilterIcon)).apply(this, arguments));
  }

  _createClass(FilterIcon, [{
    key: "render",
    value: function render() {
      return _react2.default.createElement(
        _react.Fragment,
        null,
        this.renderAnimation()
      );
    }
  }, {
    key: "renderAnimation",
    value: function renderAnimation() {
      var _props = this.props,
          color = _props.color,
          duration = _props.duration,
          type = _props.type,
          name = _props.name,
          begin = _props.begin,
          animated = _props.animated,
          others = _objectWithoutProperties(_props, ["color", "duration", "type", "name", "begin", "animated"]);

      var dur = animated ? duration : 0;

      return _react2.default.createElement(
        "svg",
        _extends({
          version: "1.1",
          xmlns: "http://www.w3.org/2000/svg",
          x: "0px",
          y: "0px",
          width: "20px",
          height: "24px",
          viewBox: "0 0 20 24",
          fill: color
        }, others),
        _react2.default.createElement(
          "title",
          null,
          "Filter icon"
        ),
        _react2.default.createElement(
          "rect",
          { x: "2", width: "2", height: "10" },
          _react2.default.createElement("animate", {
            attributeType: type,
            attributeName: name,
            values: "-4; 0; -4",
            begin: begin,
            dur: dur,
            repeatCount: "indefinite"
          })
        ),
        _react2.default.createElement(
          "rect",
          { x: "2", y: "14", width: "2", height: "10" },
          _react2.default.createElement("animate", {
            attributeType: type,
            attributeName: name,
            values: "14; 18; 14",
            begin: begin,
            dur: dur,
            repeatCount: "indefinite"
          })
        ),
        _react2.default.createElement(
          "path",
          { d: "M4,9v2H2V9H4 M6,7H0v6h6V7L6,7z" },
          _react2.default.createElement("animateTransform", {
            attributeType: type,
            attributeName: "transform",
            type: "translate",
            values: "0 0; 0 4; 0 0",
            begin: begin,
            dur: dur,
            repeatCount: "indefinite"
          })
        ),
        _react2.default.createElement(
          "rect",
          { x: "9", width: "2", height: "14" },
          _react2.default.createElement("animate", {
            attributeType: type,
            attributeName: name,
            values: "0; -12; 0",
            begin: begin,
            dur: dur,
            repeatCount: "indefinite"
          })
        ),
        _react2.default.createElement(
          "rect",
          { x: "9", y: "22", width: "2", height: "14" },
          _react2.default.createElement("animate", {
            attributeType: type,
            attributeName: name,
            values: "22; 10; 22",
            begin: begin,
            dur: dur,
            repeatCount: "indefinite"
          })
        ),
        _react2.default.createElement(
          "path",
          { d: "M11,17v2H9v-2H11 M13,15H7v6h6V15L13,15z" },
          _react2.default.createElement("animateTransform", {
            attributeType: type,
            attributeName: "transform",
            type: "translate",
            values: "0 0; 0 -12; 0 0",
            begin: begin,
            dur: dur,
            repeatCount: "indefinite"
          })
        ),
        _react2.default.createElement(
          "rect",
          { x: "16", width: "2", height: "12" },
          _react2.default.createElement("animate", {
            attributeType: type,
            attributeName: name,
            values: "-8; 0; -8",
            begin: begin,
            dur: dur,
            repeatCount: "indefinite"
          })
        ),
        _react2.default.createElement(
          "rect",
          { x: "16", y: "12", width: "2", height: "12" },
          _react2.default.createElement("animate", {
            attributeType: type,
            attributeName: name,
            values: "12; 20; 12",
            begin: begin,
            dur: dur,
            repeatCount: "indefinite"
          })
        ),
        _react2.default.createElement(
          "path",
          { d: "M18,7v2h-2V7H18 M20,5h-6v6h6V5L20,5z" },
          _react2.default.createElement("animateTransform", {
            attributeType: type,
            attributeName: "transform",
            type: "translate",
            values: "0 0; 0 8; 0 0",
            begin: begin,
            dur: dur,
            repeatCount: "indefinite"
          })
        )
      );
    }
  }]);

  return FilterIcon;
}(_react.Component);

FilterIcon.defaultProps = {
  color: null,
  duration: '1.5s',
  animated: false,
  type: 'xml',
  name: 'y',
  begin: '0'
};