"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getTextColorInNonActiveTheme = void 0;
var _text = require("@atlaskit/editor-palette/text");
var _utils = require("./utils");
/**
 * Resolves a text (foreground) color to its equivalent value in the non-active
 * theme (i.e. dark when the editor is in light mode and vice versa).
 *
 * Shared between the text-color plugin state (`getColorInNonActiveTheme`) and the
 * color-accessibility selection walker so both evaluate colors identically.
 *
 * @param color - The raw text color mark (hex/token) or null for the default.
 * @param defaultColor - The plugin's default text color, used when `color` is
 * absent or explicitly the default.
 */
var getTextColorInNonActiveTheme = exports.getTextColorInNonActiveTheme = function getTextColorInNonActiveTheme(color, defaultColor) {
  if (!color || color === defaultColor) {
    return (0, _utils.getTokenCSSVariableValueForNonActiveTheme)("var(--ds-text, #292A2E)", defaultColor);
  }
  var colorValue = (0, _text.hexToEditorTextPaletteColor)(color) || color;
  return (0, _utils.getTokenCSSVariableValueForNonActiveTheme)(colorValue, color);
};