"use strict";

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

var _branding = require("../../../mixins/branding");

var getBackgroundColor = function getBackgroundColor(_ref) {
  var theme = _ref.theme;
  return (0, _branding.getPaletteColor)('greyscale-light')({
    theme: theme
  });
};

exports.getBackgroundColor = getBackgroundColor;

var getBarColor = function getBarColor(_ref2) {
  var theme = _ref2.theme,
      _ref2$error = _ref2.error,
      error = _ref2$error === void 0 ? false : _ref2$error;

  if (error) {
    return (0, _branding.getPaletteColor)('error-fg')({
      theme: theme
    });
  }

  return (0, _branding.getPaletteColor)('brand-secondary-fg')({
    theme: theme
  });
};

exports.getBarColor = getBarColor;

var getBarWidth = function getBarWidth(_ref3) {
  var totalSteps = _ref3.totalSteps,
      currentStep = _ref3.currentStep,
      _ref3$quickProgress = _ref3.quickProgress,
      quickProgress = _ref3$quickProgress === void 0 ? false : _ref3$quickProgress;
  var percentage = totalSteps ? 100 * currentStep / totalSteps : 0;

  if (quickProgress) {
    var v = currentStep / totalSteps;
    percentage = (1 - (1 - v) * (1 - v)) * 100;
  }

  return "".concat(percentage, "%");
};

exports.getBarWidth = getBarWidth;