(function (D) { D.SCORE_VALUES = ['B1','B2','B3','G1','G2','G3','G4','E3','E4','E5','E6']; const SCORE_ORDER = ['', ...D.SCORE_VALUES]; D.computeWorstScore = function (scores) { let wIdx = 0, wScore = ''; for (const data of Object.values(scores)) { const m = Math.max(SCORE_ORDER.indexOf(data.dwl || ''), SCORE_ORDER.indexOf(data.bal || '')); if (m > wIdx) { wIdx = m; wScore = SCORE_ORDER[m]; } } return wScore; }; D.scoreClass = function (value) { return value ? 'score-' + value.toLowerCase() : ''; }; })(window.App.Domain);