"use strict";

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

var _color = _interopRequireDefault(require("color"));

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

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

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

/**
 * Custom override styling for the Invest primary button.
 */
// Design sanctioned non-palette colour for use with the Invest theme primary
// button only.
var INVEST_PRIMARY_BUTTON_CUSTOM_COLOR = '#fbc361';

var getBackground = function getBackground(_ref) {
  var disabled = _ref.disabled,
      isLoading = _ref.isLoading;
  return disabled && !isLoading ? (0, _branding.getPaletteColor)('greyscale-light') : "linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(0, 0, 0, 0.2) 100%), ".concat(INVEST_PRIMARY_BUTTON_CUSTOM_COLOR);
};

var getHoverBackgroundColor = function getHoverBackgroundColor() {
  return "".concat(new _color["default"](INVEST_PRIMARY_BUTTON_CUSTOM_COLOR).lighten(0.1));
};

var getActiveBackground = function getActiveBackground(_ref2) {
  var disabled = _ref2.disabled,
      isLoading = _ref2.isLoading;
  return disabled && !isLoading ? (0, _branding.getPaletteColor)('greyscale-light') : INVEST_PRIMARY_BUTTON_CUSTOM_COLOR;
};

var investSpecificCommonStyles = (0, _styledComponents.css)(["color:", ";background:", ";background-blend-mode:soft-light,normal;"], (0, _branding.getPaletteColor)('greyscale-black'), getBackground);
var investSpecificButtonStyles = (0, _styledComponents.css)(["&&{", " &:enabled:hover{background-color:", ";}&:enabled:active{background:", ";}}"], investSpecificCommonStyles, getHoverBackgroundColor, getActiveBackground);
exports.investSpecificButtonStyles = investSpecificButtonStyles;
var investSpecificLinkStyles = (0, _styledComponents.css)(["&&{", " &:hover{background-color:", ";}&:active{background:", ";}}"], investSpecificCommonStyles, getHoverBackgroundColor, getActiveBackground);
exports.investSpecificLinkStyles = investSpecificLinkStyles;