"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const kit_internal_color = require("../internal/color.cjs");
const kit_internal_Theme_theme = require("../internal/Theme/theme.cjs");
const kit_internal_types = require("../internal/types.cjs");
const kit_Theme_themeUtils = require("./themeUtils.cjs");
const ShirtSize = {
  Small: "small",
  Medium: "medium",
  Large: "large"
};
const STRONG_WEAK_DELTA = 45;
const generateStrongWeak = (theme) => {
  const rgbaStrong = kit_internal_color.str2rgba(theme.strong);
  const rgbaWeak = kit_internal_color.str2rgba(theme.weak);
  for (const [key, value] of Object.entries(theme)) {
    const matches = key.match(/^(.+)(Strong|Weak)$/);
    if ((matches == null ? void 0 : matches.length) === 3 && value === void 0) {
      const isStrong = matches[2] === "Strong";
      const baseKey = matches[1];
      const baseValue = theme[baseKey];
      if (baseValue && kit_internal_color.isColor(baseValue)) {
        const rgba = kit_internal_color.str2rgba(baseValue);
        const mixer = isStrong ? rgbaStrong : rgbaWeak;
        theme[key] = kit_internal_color.rgba2str(kit_internal_color.rgbaMix(rgba, mixer, STRONG_WEAK_DELTA));
      }
    }
  }
  return theme;
};
const themeLightDetermined = generateStrongWeak(Object.assign({}, kit_Theme_themeUtils.themeBase, kit_internal_Theme_theme.themeLight));
const themeDarkDetermined = generateStrongWeak(Object.assign({}, kit_Theme_themeUtils.themeBase, kit_internal_Theme_theme.themeDark));
const themeHpe = { brand: "rgba(1, 169, 130, 1.0)" };
const themeLightHpe = generateStrongWeak(Object.assign({}, kit_Theme_themeUtils.themeBase, kit_internal_Theme_theme.themeLight, themeHpe));
const themeDarkHpe = generateStrongWeak(Object.assign({}, kit_Theme_themeUtils.themeBase, kit_internal_Theme_theme.themeDark, themeHpe));
const DefaultTheme = {
  Light: themeLightDetermined,
  Dark: themeDarkDetermined,
  HPELight: themeLightHpe,
  HPEDark: themeDarkHpe
};
const stateColorMapping = {
  [kit_internal_types.RunState.Active]: "active",
  [kit_internal_types.RunState.Canceled]: "inactive",
  [kit_internal_types.RunState.Completed]: "success",
  [kit_internal_types.RunState.Deleted]: "critical",
  [kit_internal_types.RunState.Deleting]: "critical",
  [kit_internal_types.RunState.DeleteFailed]: "critical",
  [kit_internal_types.RunState.Error]: "critical",
  [kit_internal_types.RunState.Paused]: "warning",
  [kit_internal_types.RunState.StoppingCanceled]: "inactive",
  [kit_internal_types.RunState.StoppingCompleted]: "success",
  [kit_internal_types.RunState.StoppingError]: "critical",
  [kit_internal_types.RunState.StoppingKilled]: "killed",
  [kit_internal_types.CheckpointState.PartiallyDeleted]: "warning",
  [kit_internal_types.RunState.Unspecified]: "inactive",
  [kit_internal_types.RunState.Queued]: "warning",
  [kit_internal_types.RunState.Pulling]: "pending",
  [kit_internal_types.RunState.Starting]: "pending",
  [kit_internal_types.RunState.Running]: "active",
  [kit_internal_types.CommandState.Waiting]: "inactive",
  [kit_internal_types.CommandState.Pulling]: "active",
  [kit_internal_types.CommandState.Starting]: "active",
  [kit_internal_types.CommandState.Running]: "active",
  [kit_internal_types.CommandState.Terminating]: "inactive",
  [kit_internal_types.CommandState.Terminated]: "inactive",
  [kit_internal_types.ResourceState.Unspecified]: "inactive",
  [kit_internal_types.ResourceState.Running]: "active",
  [kit_internal_types.ResourceState.Assigned]: "pending",
  [kit_internal_types.ResourceState.Pulling]: "pending",
  [kit_internal_types.ResourceState.Starting]: "pending",
  [kit_internal_types.ResourceState.Warm]: "free",
  [kit_internal_types.SlotState.Free]: "free",
  [kit_internal_types.SlotState.Pending]: "pending",
  [kit_internal_types.SlotState.Running]: "active",
  [kit_internal_types.SlotState.Potential]: "potential",
  [kit_internal_types.JobState.SCHEDULED]: "active",
  [kit_internal_types.JobState.SCHEDULEDBACKFILLED]: "active",
  [kit_internal_types.JobState.QUEUED]: "warning",
  [kit_internal_types.JobState.UNSPECIFIED]: "inactive"
};
const getStateColorCssVar = (state, options = {}) => {
  const name = state ? stateColorMapping[state] : "active";
  const on = options.isOn ? "-on" : "";
  const strongWeak = options.strongWeak ? `-${options.strongWeak}` : "";
  return `var(--theme-status-${name}${on}${strongWeak})`;
};
exports.Spacing = kit_Theme_themeUtils.Spacing;
exports.DefaultTheme = DefaultTheme;
exports.ShirtSize = ShirtSize;
exports.getStateColorCssVar = getStateColorCssVar;
exports.stateColorMapping = stateColorMapping;
