var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var resolve_color_exports = {};
__export(resolve_color_exports, {
  resolveColor: () => resolveColor
});
module.exports = __toCommonJS(resolve_color_exports);
const resolveColor = (scale, value) => {
  if (typeof value === "string") {
    const castedScale = scale;
    const categories = castedScale.domain();
    if (categories.includes(value)) {
      return castedScale(value);
    }
  }
  if (typeof value === "number") {
    const castedScale = scale;
    const [min, max] = castedScale.domain();
    if (value && value >= min && value <= max) {
      return castedScale(value);
    }
  }
  return void 0;
};
