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GACjC,gBAAgB,KAAM,GAEtB,IAAI,EAAQ,2BAA2B,MAAO,EAA0B,WAAa,OAAO,eAAe,IAA4B,KAAK,KAAM,IAKlJ,OAHA,EAAM,MAAQ,CACZ,MAAO,MAEF,CACT,CAyDA,OApEA,UAAU,EAqEV,OAAO,WAxDP,aAAa,EAA2B,CAAC,CACvC,IAAK,oBACL,MAAO,WACL,IAAI,EAAQ,WAAW,QAAQ,YAAY,MAAM,cAAc,YAAc,GACzE,EAAc,KAAK,MAAM,SAAW,EAAQ,IAChD,KAAK,SAAS,CACZ,MAAO,GAEX,GACC,CACD,IAAK,SACL,MAAO,WACL,IACI,EAAU,CACZ,gBAFa,KAAK,YAAY,KAAK,OAGnC,OAAU,MACV,MAAS,KAAK,MAAM,MAAQ,KAC5B,WAAc,MACd,YAAe,OAEjB,OAAO,QAAQ,QAAQ,cAAc,KAAM,CAAE,GAAI,iBAAkB,MAAO,GAC5E,GACC,CACD,IAAK,cACL,MAAO,SAAqB,GA2B1B,OAzBI,EAAM,OACG,EAAM,OAEb,EAAM,SACJ,EAAM,UAAY,GACT,QACF,EAAM,SAAW,IAAM,EAAM,UAAY,GACvC,OACF,EAAM,SAAW,IAAM,EAAM,UAAY,GACvC,SAEA,MAGT,EAAM,UAAY,GACT,MACF,EAAM,SAAW,IAAM,EAAM,UAAY,GACvC,SACF,EAAM,SAAW,IAAM,EAAM,UAAY,GACvC,OAEA,OAKnB,KAGK,CACT,CAtEgC,GAwEhC,QAAQ,QAAU","file":"/npm/react-npm-horizontal-status-indicator@1.3.0/lib/component/horizontal_status_indicator.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/react-npm-horizontal-status-indicator@1.3.0/lib/component/horizontal_status_indicator.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _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; }; }();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactDom = require('react-dom');\n\nvar _reactDom2 = _interopRequireDefault(_reactDom);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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; }\n\nfunction _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; }\n\nvar HorizontalStatusIndicator = function (_Component) {\n  _inherits(HorizontalStatusIndicator, _Component);\n\n  function HorizontalStatusIndicator(props) {\n    _classCallCheck(this, HorizontalStatusIndicator);\n\n    var _this = _possibleConstructorReturn(this, (HorizontalStatusIndicator.__proto__ || Object.getPrototypeOf(HorizontalStatusIndicator)).call(this, props));\n\n    _this.state = {\n      width: null\n    };\n    return _this;\n  }\n\n  _createClass(HorizontalStatusIndicator, [{\n    key: 'componentDidMount',\n    value: function componentDidMount() {\n      var width = _reactDom2.default.findDOMNode(this).parentElement.offsetWidth - 10;\n      var actualWidth = this.props.children * width / 100;\n      this.setState({\n        width: actualWidth\n      });\n    }\n  }, {\n    key: 'render',\n    value: function render() {\n      var barColor = this.getBarColor(this.props);\n      var mystyle = {\n        'backgroundColor': barColor,\n        'height': '2px',\n        'width': this.state.width + 'px',\n        'marginLeft': '5px',\n        'marginRight': '5px'\n      };\n      return _react2.default.createElement('hr', { id: 'horizontal-bar', style: mystyle });\n    }\n  }, {\n    key: 'getBarColor',\n    value: function getBarColor(props) {\n      var barColor = null;\n      if (props.colour) {\n        barColor = props.colour;\n      } else {\n        if (props.inverted) {\n          if (props.children <= 25) {\n            barColor = 'green';\n          } else if (props.children > 25 && props.children <= 50) {\n            barColor = 'blue';\n          } else if (props.children > 50 && props.children <= 75) {\n            barColor = 'yellow';\n          } else {\n            barColor = 'red';\n          }\n        } else {\n          if (props.children <= 25) {\n            barColor = 'red';\n          } else if (props.children > 25 && props.children <= 50) {\n            barColor = 'yellow';\n          } else if (props.children > 50 && props.children <= 75) {\n            barColor = 'blue';\n          } else {\n            barColor = 'green';\n          }\n        }\n      }\n      return barColor;\n    }\n  }]);\n\n  return HorizontalStatusIndicator;\n}(_react.Component);\n\nexports.default = HorizontalStatusIndicator;"]}