const formatValue = (tinyColor) => {
  if (!tinyColor) {
    return '';
  }
  const { r, g, b, a } = tinyColor.toRgb();
  return `${r} ${g} ${b} / ${a}`;
};
export const OverridableBorderTokens = [
  {
    name: 'border-secondary-btn',
    overrideGetter: (overrideColors, tinycolor) => {
      const overrideBaseColor = overrideColors['actionColor'];
      if (!overrideBaseColor) {
        return '';
      }
      const baseColor = overrideBaseColor
        ? tinycolor(overrideBaseColor)
        : undefined;
      let value = baseColor
        ? baseColor.clone()
        : undefined;
      return formatValue(value);
    },
  },
  {
    name: 'dark-border-secondary-btn',
  },
  {
    name: 'border-secondary-btn-hover',
    overrideGetter: (overrideColors, tinycolor) => {
      const overrideBaseColor = overrideColors['actionColor'];
      if (!overrideBaseColor) {
        return '';
      }
      const baseColor = overrideBaseColor
        ? tinycolor(overrideBaseColor)
        : undefined;
      let value = baseColor
        ? baseColor.clone()
        : undefined;
      if (baseColor === null || baseColor === void 0 ? void 0 : baseColor.isDark()) {
        value = value === null || value === void 0 ? void 0 : value.lighten(10);
      }
      else {
        value = value === null || value === void 0 ? void 0 : value.lighten(-10);
      }
      return formatValue(value);
    },
  },
  {
    name: 'dark-border-secondary-btn-hover',
  },
  {
    name: 'border-secondary-btn-active',
    overrideGetter: (overrideColors, tinycolor) => {
      const overrideBaseColor = overrideColors['actionColor'];
      if (!overrideBaseColor) {
        return '';
      }
      const baseColor = overrideBaseColor
        ? tinycolor(overrideBaseColor)
        : undefined;
      let value = baseColor
        ? baseColor.clone()
        : undefined;
      if (baseColor === null || baseColor === void 0 ? void 0 : baseColor.isDark()) {
        value = value === null || value === void 0 ? void 0 : value.lighten(15);
      }
      else {
        value = value === null || value === void 0 ? void 0 : value.lighten(-15);
      }
      return formatValue(value);
    },
  },
  {
    name: 'dark-border-secondary-btn-active',
  },
  {
    name: 'border-input-field',
    overrideGetter: (overrideColors, tinycolor) => {
      const overrideBaseColor = overrideColors['actionColor'];
      if (!overrideBaseColor) {
        return '';
      }
      const baseColor = overrideBaseColor
        ? tinycolor(overrideBaseColor)
        : undefined;
      let value = baseColor
        ? baseColor.clone()
        : undefined;
      value = value === null || value === void 0 ? void 0 : value.setAlpha(0.6);
      return formatValue(value);
    },
  },
  {
    name: 'dark-border-input-field',
  },
  {
    name: 'border-input-field-hover',
    overrideGetter: (overrideColors, tinycolor) => {
      const overrideBaseColor = overrideColors['actionColor'];
      if (!overrideBaseColor) {
        return '';
      }
      const baseColor = overrideBaseColor
        ? tinycolor(overrideBaseColor)
        : undefined;
      let value = baseColor
        ? baseColor.clone()
        : undefined;
      if (baseColor === null || baseColor === void 0 ? void 0 : baseColor.isDark()) {
        value = value === null || value === void 0 ? void 0 : value.lighten(10);
      }
      else {
        value = value === null || value === void 0 ? void 0 : value.lighten(-10);
      }
      value = value === null || value === void 0 ? void 0 : value.setAlpha(0.6);
      return formatValue(value);
    },
  },
  {
    name: 'dark-border-input-field-hover',
  },
  {
    name: 'border-input-field-focus',
    overrideGetter: (overrideColors, tinycolor) => {
      const overrideBaseColor = overrideColors['actionColor'];
      if (!overrideBaseColor) {
        return '';
      }
      const baseColor = overrideBaseColor
        ? tinycolor(overrideBaseColor)
        : undefined;
      let value = baseColor
        ? baseColor.clone()
        : undefined;
      if (baseColor === null || baseColor === void 0 ? void 0 : baseColor.isDark()) {
        value = value === null || value === void 0 ? void 0 : value.lighten(15);
      }
      else {
        value = value === null || value === void 0 ? void 0 : value.lighten(-15);
      }
      value = value === null || value === void 0 ? void 0 : value.setAlpha(0.6);
      return formatValue(value);
    },
  },
  {
    name: 'dark-border-input-field-focus',
  },
  {
    name: 'border-input-field-disabled',
    overrideGetter: (overrideColors, tinycolor) => {
      const overrideBaseColor = overrideColors['actionColor'];
      if (!overrideBaseColor) {
        return '';
      }
      const baseColor = overrideBaseColor
        ? tinycolor(overrideBaseColor)
        : undefined;
      let value = baseColor
        ? baseColor.clone()
        : undefined;
      value = tinycolor({ a: 0.2, r: 15, b: 15, g: 15 });
      return formatValue(value);
    },
  },
  {
    name: 'dark-border-input-field-disabled',
  },
  {
    name: 'border-divider',
    overrideGetter: (overrideColors, tinycolor) => {
      const overrideBaseColor = overrideColors['actionColor'];
      if (!overrideBaseColor) {
        return '';
      }
      const baseColor = overrideBaseColor
        ? tinycolor(overrideBaseColor)
        : undefined;
      let value = baseColor
        ? baseColor.clone()
        : undefined;
      value = value === null || value === void 0 ? void 0 : value.setAlpha(0.6);
      return formatValue(value);
    },
  },
  {
    name: 'dark-border-divider',
  },
  {
    name: 'border-divider-secondary',
    overrideGetter: (overrideColors, tinycolor) => {
      const overrideBaseColor = overrideColors['actionColor'];
      if (!overrideBaseColor) {
        return '';
      }
      const baseColor = overrideBaseColor
        ? tinycolor(overrideBaseColor)
        : undefined;
      let value = baseColor
        ? baseColor.clone()
        : undefined;
      if (baseColor === null || baseColor === void 0 ? void 0 : baseColor.isDark()) {
        value = value === null || value === void 0 ? void 0 : value.lighten(15);
      }
      else {
        value = value === null || value === void 0 ? void 0 : value.lighten(-15);
      }
      value = value === null || value === void 0 ? void 0 : value.setAlpha(0.4);
      return formatValue(value);
    },
  },
  {
    name: 'dark-border-divider-secondary',
  },
  {
    name: 'border-tile-selected',
    overrideGetter: (overrideColors, tinycolor) => {
      const overrideBaseColor = overrideColors['actionColor'];
      if (!overrideBaseColor) {
        return '';
      }
      const baseColor = overrideBaseColor
        ? tinycolor(overrideBaseColor)
        : undefined;
      let value = baseColor
        ? baseColor.clone()
        : undefined;
      return formatValue(value);
    },
  },
  {
    name: 'dark-border-tile-selected',
  },
  {
    name: 'border-tile-selected-hover',
    overrideGetter: (overrideColors, tinycolor) => {
      const overrideBaseColor = overrideColors['actionColor'];
      if (!overrideBaseColor) {
        return '';
      }
      const baseColor = overrideBaseColor
        ? tinycolor(overrideBaseColor)
        : undefined;
      let value = baseColor
        ? baseColor.clone()
        : undefined;
      if (baseColor === null || baseColor === void 0 ? void 0 : baseColor.isDark()) {
        value = value === null || value === void 0 ? void 0 : value.lighten(10);
      }
      else {
        value = value === null || value === void 0 ? void 0 : value.lighten(-10);
      }
      return formatValue(value);
    },
  },
  {
    name: 'dark-border-tile-selected-hover',
  },
  {
    name: 'border-tile-focus',
    overrideGetter: (overrideColors, tinycolor) => {
      const overrideBaseColor = overrideColors['actionColor'];
      if (!overrideBaseColor) {
        return '';
      }
      const baseColor = overrideBaseColor
        ? tinycolor(overrideBaseColor)
        : undefined;
      let value = baseColor
        ? baseColor.clone()
        : undefined;
      return formatValue(value);
    },
  },
  {
    name: 'dark-border-tile-focus',
  },
  {
    name: 'border-tile-selected-focus',
    overrideGetter: (overrideColors, tinycolor) => {
      const overrideBaseColor = overrideColors['actionColor'];
      if (!overrideBaseColor) {
        return '';
      }
      const baseColor = overrideBaseColor
        ? tinycolor(overrideBaseColor)
        : undefined;
      let value = baseColor
        ? baseColor.clone()
        : undefined;
      if (baseColor === null || baseColor === void 0 ? void 0 : baseColor.isDark()) {
        value = value === null || value === void 0 ? void 0 : value.lighten(15);
      }
      else {
        value = value === null || value === void 0 ? void 0 : value.lighten(-15);
      }
      value = value === null || value === void 0 ? void 0 : value.setAlpha(0.6);
      return formatValue(value);
    },
  },
  {
    name: 'dark-border-tile-selected-focus',
  },
];
