import { RANGE_SLIDER_TRACK_BELOW_FIRST_THRESHOLD, RANGE_SLIDER_TRACK_BETWEEN_THRESHOLDS, RANGE_SLIDER_TRACK_ABOVE_THRESHOLDS } from './constants';
export function useThresholdColor(percent, thresholds) {
  var singleThreshold = (thresholds === null || thresholds === void 0 ? void 0 : thresholds.length) === 1;
  var doubleThreshold = (thresholds === null || thresholds === void 0 ? void 0 : thresholds.length) === 2;
  if ((singleThreshold || doubleThreshold) && percent <= thresholds[0]) {
    return RANGE_SLIDER_TRACK_BELOW_FIRST_THRESHOLD;
  }
  if (doubleThreshold && percent < thresholds[1] && percent >= thresholds[0]) {
    return RANGE_SLIDER_TRACK_BETWEEN_THRESHOLDS;
  }
  if ((singleThreshold || doubleThreshold) && percent >= thresholds[thresholds.length - 1]) {
    return RANGE_SLIDER_TRACK_ABOVE_THRESHOLDS;
  }
  return undefined;
}