import { includeScores, MINIMUM_SCORE_VALUE, } from "~/sdks/NeighborhoodHighlights/constants";
export function getHighlightScoreKeys(scores) {
    const highlightKeys = [];
    if (typeof scores === "undefined") {
        // Safety check just in case
        return highlightKeys;
    }
    const filteredScores = includeScores
        .map((scoreName) => {
        var _a;
        return ({
            scoreName,
            value: (Math.round(Number((_a = scores[scoreName]) === null || _a === void 0 ? void 0 : _a.value) * 10) / 10) * 2,
        });
    })
        .filter((score) => score.value > MINIMUM_SCORE_VALUE)
        .sort((a, b) => (a.value < b.value ? 1 : -1))
        .slice(0, 3);
    filteredScores.map((item) => highlightKeys.push(item.scoreName));
    return highlightKeys;
}
//# sourceMappingURL=index.js.map