import getAltCandidatePalettes from "../../colors/getAltCandidatePalettes.js";
const getContestCandidateColors = ({
  contest,
  candidates
}) => {
  if (contest.isBallot) {
    return Object.fromEntries(candidates.map(c => [c.id, c.polarity ? 'ballot-yes' : 'ballot-no']));
  }
  if (contest.contestType === 'general') {
    const supportedParties = new Set(['dem', 'gop', 'independent']);
    return Object.fromEntries(candidates.map(c => [c.id, supportedParties.has(c.party) ? c.party : 'fallback']));
  }
  return getAltCandidatePalettes(candidates);
};
export default getContestCandidateColors;