tods-competition-factory 1.6.11 → 1.6.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/forge/generate.mjs +83 -71
- package/dist/forge/generate.mjs.map +1 -1
- package/dist/forge/query.mjs +5 -4
- package/dist/forge/query.mjs.map +1 -1
- package/dist/forge/transform.mjs +82 -70
- package/dist/forge/transform.mjs.map +1 -1
- package/dist/index.mjs +91 -79
- package/dist/index.mjs.map +1 -1
- package/dist/tods-competition-factory.development.cjs.js +120 -107
- package/dist/tods-competition-factory.development.cjs.js.map +1 -1
- package/dist/tods-competition-factory.production.cjs.min.js +1 -1
- package/dist/tods-competition-factory.production.cjs.min.js.map +1 -1
- package/package.json +2 -2
|
@@ -362,7 +362,7 @@ var matchUpFormatCode = {
|
|
|
362
362
|
};
|
|
363
363
|
|
|
364
364
|
function factoryVersion() {
|
|
365
|
-
return '1.6.
|
|
365
|
+
return '1.6.13';
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
/******************************************************************************
|
|
@@ -3753,7 +3753,7 @@ function validMatchUp(matchUp) {
|
|
|
3753
3753
|
var validDrawPositions = !drawPositions ||
|
|
3754
3754
|
(Array.isArray(drawPositions) &&
|
|
3755
3755
|
drawPositions.length <= 2 &&
|
|
3756
|
-
drawPositions.every(function (dp) { return isConvertableInteger(dp) || dp === undefined; }));
|
|
3756
|
+
drawPositions.every(function (dp) { return isConvertableInteger(dp) || dp === undefined || dp === null; }));
|
|
3757
3757
|
return validMatchUpId && validDrawPositions;
|
|
3758
3758
|
}
|
|
3759
3759
|
function validMatchUps(matchUps) {
|
|
@@ -4078,7 +4078,7 @@ function getParticipantResults(_a) {
|
|
|
4078
4078
|
});
|
|
4079
4079
|
var winningParticipantId = winningSide && getWinningSideId(matchUp);
|
|
4080
4080
|
var losingParticipantId = winningSide && getLosingSideId(matchUp);
|
|
4081
|
-
if (!winningParticipantId
|
|
4081
|
+
if (!winningParticipantId && !losingParticipantId) {
|
|
4082
4082
|
if (completedMatchUpStatuses.includes(matchUpStatus)) {
|
|
4083
4083
|
var participantIdSide1 = getSideId(matchUp, 0);
|
|
4084
4084
|
var participantIdSide2 = getSideId(matchUp, 1);
|
|
@@ -4091,64 +4091,62 @@ function getParticipantResults(_a) {
|
|
|
4091
4091
|
participantResults[participantIdSide2].matchUpsCancelled += 1;
|
|
4092
4092
|
}
|
|
4093
4093
|
}
|
|
4094
|
-
else {
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
var
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
var
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
participantResults[tieLosingParticipantId].tieDoublesLost += 1;
|
|
4119
|
-
}
|
|
4094
|
+
else if (tieMatchUps === null || tieMatchUps === void 0 ? void 0 : tieMatchUps.length) {
|
|
4095
|
+
perPlayer = 0; // if any matchUps are matchUpType: TEAM don't calculate perPlayer
|
|
4096
|
+
var _loop_1 = function (tieMatchUp) {
|
|
4097
|
+
if (tieMatchUp.winningSide) {
|
|
4098
|
+
var tieWinningParticipantId = (_e = sides.find(function (_a) {
|
|
4099
|
+
var sideNumber = _a.sideNumber;
|
|
4100
|
+
return sideNumber === tieMatchUp.winningSide;
|
|
4101
|
+
})) === null || _e === void 0 ? void 0 : _e.participantId;
|
|
4102
|
+
var tieLosingParticipantId = (_f = sides.find(function (_a) {
|
|
4103
|
+
var sideNumber = _a.sideNumber;
|
|
4104
|
+
return sideNumber === tieMatchUp.winningSide;
|
|
4105
|
+
})) === null || _f === void 0 ? void 0 : _f.participantId;
|
|
4106
|
+
if (tieWinningParticipantId && tieLosingParticipantId) {
|
|
4107
|
+
checkInitializeParticipant(participantResults, tieWinningParticipantId);
|
|
4108
|
+
checkInitializeParticipant(participantResults, tieLosingParticipantId);
|
|
4109
|
+
participantResults[tieWinningParticipantId].tieMatchUpsWon += 1;
|
|
4110
|
+
participantResults[tieLosingParticipantId].tieMatchUpsLost += 1;
|
|
4111
|
+
if (tieMatchUp.matchUpType === SINGLES$1) {
|
|
4112
|
+
participantResults[tieWinningParticipantId].tieSinglesWon += 1;
|
|
4113
|
+
participantResults[tieLosingParticipantId].tieSinglesLost += 1;
|
|
4114
|
+
}
|
|
4115
|
+
else if (tieMatchUp.matchUpType === DOUBLES$1) {
|
|
4116
|
+
participantResults[tieWinningParticipantId].tieDoublesWon += 1;
|
|
4117
|
+
participantResults[tieLosingParticipantId].tieDoublesLost += 1;
|
|
4120
4118
|
}
|
|
4121
4119
|
}
|
|
4122
|
-
processScore({
|
|
4123
|
-
score: tieMatchUp.score,
|
|
4124
|
-
manualGamesOverride: manualGamesOverride,
|
|
4125
|
-
participantResults: participantResults,
|
|
4126
|
-
sides: sides,
|
|
4127
|
-
});
|
|
4128
|
-
};
|
|
4129
|
-
try {
|
|
4130
|
-
for (var tieMatchUps_1 = (e_2 = void 0, __values(tieMatchUps)), tieMatchUps_1_1 = tieMatchUps_1.next(); !tieMatchUps_1_1.done; tieMatchUps_1_1 = tieMatchUps_1.next()) {
|
|
4131
|
-
var tieMatchUp = tieMatchUps_1_1.value;
|
|
4132
|
-
_loop_1(tieMatchUp);
|
|
4133
|
-
}
|
|
4134
|
-
}
|
|
4135
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
4136
|
-
finally {
|
|
4137
|
-
try {
|
|
4138
|
-
if (tieMatchUps_1_1 && !tieMatchUps_1_1.done && (_c = tieMatchUps_1.return)) _c.call(tieMatchUps_1);
|
|
4139
|
-
}
|
|
4140
|
-
finally { if (e_2) throw e_2.error; }
|
|
4141
4120
|
}
|
|
4142
|
-
}
|
|
4143
|
-
else {
|
|
4144
4121
|
processScore({
|
|
4122
|
+
score: tieMatchUp.score,
|
|
4145
4123
|
manualGamesOverride: manualGamesOverride,
|
|
4146
4124
|
participantResults: participantResults,
|
|
4147
|
-
score: score,
|
|
4148
4125
|
sides: sides,
|
|
4149
4126
|
});
|
|
4127
|
+
};
|
|
4128
|
+
try {
|
|
4129
|
+
for (var tieMatchUps_1 = (e_2 = void 0, __values(tieMatchUps)), tieMatchUps_1_1 = tieMatchUps_1.next(); !tieMatchUps_1_1.done; tieMatchUps_1_1 = tieMatchUps_1.next()) {
|
|
4130
|
+
var tieMatchUp = tieMatchUps_1_1.value;
|
|
4131
|
+
_loop_1(tieMatchUp);
|
|
4132
|
+
}
|
|
4133
|
+
}
|
|
4134
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
4135
|
+
finally {
|
|
4136
|
+
try {
|
|
4137
|
+
if (tieMatchUps_1_1 && !tieMatchUps_1_1.done && (_c = tieMatchUps_1.return)) _c.call(tieMatchUps_1);
|
|
4138
|
+
}
|
|
4139
|
+
finally { if (e_2) throw e_2.error; }
|
|
4150
4140
|
}
|
|
4151
4141
|
}
|
|
4142
|
+
else {
|
|
4143
|
+
processScore({
|
|
4144
|
+
manualGamesOverride: manualGamesOverride,
|
|
4145
|
+
participantResults: participantResults,
|
|
4146
|
+
score: score,
|
|
4147
|
+
sides: sides,
|
|
4148
|
+
});
|
|
4149
|
+
}
|
|
4152
4150
|
}
|
|
4153
4151
|
else {
|
|
4154
4152
|
checkInitializeParticipant(participantResults, winningParticipantId);
|
|
@@ -8351,9 +8349,10 @@ function getSourceDrawPositionRanges(_a) {
|
|
|
8351
8349
|
structureId: sourceStructureId,
|
|
8352
8350
|
matchUpsMap: matchUpsMap,
|
|
8353
8351
|
});
|
|
8354
|
-
var
|
|
8352
|
+
var roundMatchUpsResult = getRoundMatchUps$1({
|
|
8355
8353
|
matchUps: structureMatchUps,
|
|
8356
|
-
})
|
|
8354
|
+
});
|
|
8355
|
+
var roundProfile = roundMatchUpsResult.roundProfile;
|
|
8357
8356
|
return _a = {}, _a[sourceStructureId] = roundProfile, _a;
|
|
8358
8357
|
})), false));
|
|
8359
8358
|
var structureMatchUps = getMappedStructureMatchUps({
|
|
@@ -11086,9 +11085,8 @@ function modifyMatchUpScore(_a) {
|
|
|
11086
11085
|
(matchUp = findResult.matchUp, structure = findResult.structure);
|
|
11087
11086
|
}
|
|
11088
11087
|
}
|
|
11089
|
-
else {
|
|
11090
|
-
|
|
11091
|
-
console.log('!!!!!');
|
|
11088
|
+
else if (matchUp.matchUpId !== matchUpId) {
|
|
11089
|
+
console.log('!!!!!');
|
|
11092
11090
|
}
|
|
11093
11091
|
if ((matchUpStatus && [WALKOVER$2, DOUBLE_WALKOVER].includes(matchUpStatus)) ||
|
|
11094
11092
|
removeScore) {
|
|
@@ -11136,37 +11134,50 @@ function modifyMatchUpScore(_a) {
|
|
|
11136
11134
|
defaultedProcessCodes =
|
|
11137
11135
|
(_g = (_f = appliedPolicies === null || appliedPolicies === void 0 ? void 0 : appliedPolicies[POLICY_TYPE_SCORING]) === null || _f === void 0 ? void 0 : _f.processCodes) === null || _g === void 0 ? void 0 : _g.incompleteAssignmentsOnDefault;
|
|
11138
11136
|
}
|
|
11139
|
-
|
|
11140
|
-
|
|
11141
|
-
|
|
11142
|
-
|
|
11143
|
-
|
|
11144
|
-
|
|
11145
|
-
|
|
11146
|
-
|
|
11147
|
-
|
|
11148
|
-
|
|
11149
|
-
|
|
11150
|
-
|
|
11151
|
-
|
|
11152
|
-
|
|
11153
|
-
|
|
11154
|
-
|
|
11155
|
-
|
|
11156
|
-
|
|
11157
|
-
|
|
11158
|
-
|
|
11159
|
-
|
|
11160
|
-
|
|
11161
|
-
|
|
11162
|
-
|
|
11163
|
-
|
|
11164
|
-
|
|
11165
|
-
|
|
11166
|
-
|
|
11167
|
-
|
|
11168
|
-
|
|
11169
|
-
|
|
11137
|
+
if (!matchUp.collectionId) {
|
|
11138
|
+
var isRoundRobin = (structure === null || structure === void 0 ? void 0 : structure.structureType) === CONTAINER;
|
|
11139
|
+
var isAdHocStructure_1 = isAdHoc({ drawDefinition: drawDefinition, structure: structure });
|
|
11140
|
+
if (isLucky({ drawDefinition: drawDefinition, structure: structure }) ||
|
|
11141
|
+
isAdHocStructure_1 ||
|
|
11142
|
+
isRoundRobin) {
|
|
11143
|
+
var updateTally = function (structure) {
|
|
11144
|
+
var _a, _b, _c;
|
|
11145
|
+
// matchUpFormat set here is only used in updateAssignmentParticipantResults
|
|
11146
|
+
matchUpFormat = isDualMatchUp
|
|
11147
|
+
? 'SET1-S:T100'
|
|
11148
|
+
: (_c = (_b = (_a = matchUpFormat !== null && matchUpFormat !== void 0 ? matchUpFormat : matchUp.matchUpFormat) !== null && _a !== void 0 ? _a : structure === null || structure === void 0 ? void 0 : structure.matchUpFormat) !== null && _b !== void 0 ? _b : drawDefinition === null || drawDefinition === void 0 ? void 0 : drawDefinition.matchUpFormat) !== null && _c !== void 0 ? _c : event === null || event === void 0 ? void 0 : event.matchUpFormat;
|
|
11149
|
+
var matchUpFilters = isDualMatchUp
|
|
11150
|
+
? { matchUpTypes: [TEAM$2] }
|
|
11151
|
+
: undefined;
|
|
11152
|
+
var matchUps = getAllStructureMatchUps({
|
|
11153
|
+
afterRecoveryTimes: false,
|
|
11154
|
+
inContext: true,
|
|
11155
|
+
matchUpFilters: matchUpFilters,
|
|
11156
|
+
structure: structure,
|
|
11157
|
+
event: event,
|
|
11158
|
+
}).matchUps;
|
|
11159
|
+
if (isAdHocStructure_1) {
|
|
11160
|
+
structure.positionAssignments = unique(matchUps
|
|
11161
|
+
.flatMap(function (matchUp) { var _a; return ((_a = matchUp.sides) !== null && _a !== void 0 ? _a : []).map(function (side) { return side.participantId; }); })
|
|
11162
|
+
.filter(Boolean)).map(function (participantId) { return ({ participantId: participantId }); });
|
|
11163
|
+
}
|
|
11164
|
+
return updateAssignmentParticipantResults({
|
|
11165
|
+
positionAssignments: structure.positionAssignments,
|
|
11166
|
+
tournamentRecord: tournamentRecord,
|
|
11167
|
+
drawDefinition: drawDefinition,
|
|
11168
|
+
matchUpFormat: matchUpFormat,
|
|
11169
|
+
matchUps: matchUps,
|
|
11170
|
+
event: event,
|
|
11171
|
+
});
|
|
11172
|
+
};
|
|
11173
|
+
var itemStructure = isRoundRobin &&
|
|
11174
|
+
structure.structures.find(function (itemStructure) {
|
|
11175
|
+
return itemStructure === null || itemStructure === void 0 ? void 0 : itemStructure.matchUps.find(function (matchUp) { return matchUp.matchUpId === matchUpId; });
|
|
11176
|
+
});
|
|
11177
|
+
var result = updateTally(itemStructure || structure);
|
|
11178
|
+
if (result.error)
|
|
11179
|
+
return decorateResult({ result: result, stack: stack });
|
|
11180
|
+
}
|
|
11170
11181
|
}
|
|
11171
11182
|
if (notes) {
|
|
11172
11183
|
var result = addNotes({ element: matchUp, notes: notes });
|
|
@@ -25042,7 +25053,7 @@ function getSeedingThresholds(_a) {
|
|
|
25042
25053
|
}
|
|
25043
25054
|
|
|
25044
25055
|
function getValidSeedBlocks(_a) {
|
|
25045
|
-
var _b;
|
|
25056
|
+
var _b, _c;
|
|
25046
25057
|
var provisionalPositioning = _a.provisionalPositioning, appliedPolicies = _a.appliedPolicies, drawDefinition = _a.drawDefinition, allPositions = _a.allPositions, structure = _a.structure;
|
|
25047
25058
|
var validSeedBlocks = [];
|
|
25048
25059
|
if (!structure)
|
|
@@ -25059,7 +25070,7 @@ function getValidSeedBlocks(_a) {
|
|
|
25059
25070
|
}).seedAssignments;
|
|
25060
25071
|
var positionAssignments = structureAssignedDrawPositions({ structure: structure }).positionAssignments;
|
|
25061
25072
|
var positionsCount = positionAssignments === null || positionAssignments === void 0 ? void 0 : positionAssignments.length;
|
|
25062
|
-
var seedsCount = (seedAssignments === null || seedAssignments === void 0 ? void 0 : seedAssignments.length)
|
|
25073
|
+
var seedsCount = (_b = seedAssignments === null || seedAssignments === void 0 ? void 0 : seedAssignments.length) !== null && _b !== void 0 ? _b : 0;
|
|
25063
25074
|
var allDrawPositions = [];
|
|
25064
25075
|
var roundNumbers = Object.keys(roundMatchUps)
|
|
25065
25076
|
.map(function (n) { return parseInt(n); })
|
|
@@ -25078,7 +25089,7 @@ function getValidSeedBlocks(_a) {
|
|
|
25078
25089
|
.reverse();
|
|
25079
25090
|
var firstRoundDrawPositions = uniqueDrawPositionsByRound.pop();
|
|
25080
25091
|
var firstRoundDrawPositionOffset = (firstRoundDrawPositions && Math.min.apply(Math, __spreadArray([], __read(firstRoundDrawPositions), false)) - 1) || 0;
|
|
25081
|
-
var seedingProfile = (
|
|
25092
|
+
var seedingProfile = (_c = appliedPolicies === null || appliedPolicies === void 0 ? void 0 : appliedPolicies.seeding) === null || _c === void 0 ? void 0 : _c.seedingProfile;
|
|
25082
25093
|
var baseDrawSize = (firstRoundDrawPositions === null || firstRoundDrawPositions === void 0 ? void 0 : firstRoundDrawPositions.length) || 0;
|
|
25083
25094
|
// firstRoundDrawPositions have been popped
|
|
25084
25095
|
// seedRangeDrawPositionBlocks determines FEED_IN
|
|
@@ -25291,7 +25302,7 @@ function isValidSeedPosition(_a) {
|
|
|
25291
25302
|
return validSeedPositions.includes(drawPosition);
|
|
25292
25303
|
}
|
|
25293
25304
|
function getNextSeedBlock(params) {
|
|
25294
|
-
var _a, _b;
|
|
25305
|
+
var _a, _b, _c;
|
|
25295
25306
|
var provisionalPositioning = params.provisionalPositioning, drawDefinition = params.drawDefinition, seedBlockInfo = params.seedBlockInfo, structureId = params.structureId, randomize = params.randomize;
|
|
25296
25307
|
var structure = findStructure({ drawDefinition: drawDefinition, structureId: structureId }).structure;
|
|
25297
25308
|
var seedAssignments = getStructureSeedAssignments({
|
|
@@ -25322,7 +25333,9 @@ function getNextSeedBlock(params) {
|
|
|
25322
25333
|
var unplacedSeedIds = assignedSeedParticipantIds === null || assignedSeedParticipantIds === void 0 ? void 0 : assignedSeedParticipantIds.filter(function (participantId) { return !(assignedPositionParticipantIds === null || assignedPositionParticipantIds === void 0 ? void 0 : assignedPositionParticipantIds.includes(participantId)); });
|
|
25323
25334
|
var unplacedSeedAssignments = seedAssignments === null || seedAssignments === void 0 ? void 0 : seedAssignments.filter(function (assignment) { return unplacedSeedIds === null || unplacedSeedIds === void 0 ? void 0 : unplacedSeedIds.includes(assignment.participantId); });
|
|
25324
25335
|
var seedsWithoutDrawPositions = seedAssignments === null || seedAssignments === void 0 ? void 0 : seedAssignments.filter(function (assignment) { return !assignment.participantId; });
|
|
25325
|
-
var seedsLeftToAssign = (unplacedSeedAssignments === null || unplacedSeedAssignments === void 0 ? void 0 : unplacedSeedAssignments.length)
|
|
25336
|
+
var seedsLeftToAssign = (unplacedSeedAssignments === null || unplacedSeedAssignments === void 0 ? void 0 : unplacedSeedAssignments.length) && unplacedSeedAssignments.length > 0
|
|
25337
|
+
? unplacedSeedAssignments.length
|
|
25338
|
+
: (_b = seedsWithoutDrawPositions === null || seedsWithoutDrawPositions === void 0 ? void 0 : seedsWithoutDrawPositions.length) !== null && _b !== void 0 ? _b : 0;
|
|
25326
25339
|
var unfilled = (seedsLeftToAssign &&
|
|
25327
25340
|
(nextSeedBlock === null || nextSeedBlock === void 0 ? void 0 : nextSeedBlock.drawPositions.filter(function (drawPosition) { return !(assignedDrawPositions === null || assignedDrawPositions === void 0 ? void 0 : assignedDrawPositions.includes(drawPosition)); }))) ||
|
|
25328
25341
|
[];
|
|
@@ -25347,7 +25360,7 @@ function getNextSeedBlock(params) {
|
|
|
25347
25360
|
var unplacedSeedNumberIds = seedAssignments === null || seedAssignments === void 0 ? void 0 : seedAssignments.filter(function (assignment) {
|
|
25348
25361
|
return unplacedSeedNumbers.includes(assignment.seedNumber);
|
|
25349
25362
|
}).map(function (assignment) { return assignment.participantId; });
|
|
25350
|
-
var duplicateSeedNumbers = (
|
|
25363
|
+
var duplicateSeedNumbers = (_c = appliedPolicies === null || appliedPolicies === void 0 ? void 0 : appliedPolicies.seeding) === null || _c === void 0 ? void 0 : _c.duplicateSeedNumbers;
|
|
25351
25364
|
var allowsDuplicateSeedNumbers = duplicateSeedNumbers !== undefined ? duplicateSeedNumbers : true;
|
|
25352
25365
|
var unplacedSeedParticipantIds = allowsDuplicateSeedNumbers
|
|
25353
25366
|
? randomlySelectedUnplacedSeedValueIds
|
|
@@ -30751,8 +30764,8 @@ function getParticipantEntries(params) {
|
|
|
30751
30764
|
// id is the pair, team or individual participant currently being processed
|
|
30752
30765
|
// whereas participantId is the id of the entry into the event
|
|
30753
30766
|
var addEventEntry = function (id) {
|
|
30754
|
-
var _a;
|
|
30755
|
-
if ((_a = participantMap[id]) === null || _a === void 0 ? void 0 : _a.events[eventId])
|
|
30767
|
+
var _a, _b;
|
|
30768
|
+
if ((_b = (_a = participantMap[id]) === null || _a === void 0 ? void 0 : _a.events) === null || _b === void 0 ? void 0 : _b[eventId])
|
|
30756
30769
|
return;
|
|
30757
30770
|
var participant = participantMap[id];
|
|
30758
30771
|
processEventEntry({
|
|
@@ -30855,7 +30868,7 @@ function getParticipantEntries(params) {
|
|
|
30855
30868
|
var participantId = _a.participantId;
|
|
30856
30869
|
return assignedParticipantIds.includes(participantId);
|
|
30857
30870
|
});
|
|
30858
|
-
var publishedSeeding_1 = (_d = eventsPublishStatuses[eventId]) === null || _d === void 0 ? void 0 : _d.publishedSeeding;
|
|
30871
|
+
var publishedSeeding_1 = (_d = eventsPublishStatuses === null || eventsPublishStatuses === void 0 ? void 0 : eventsPublishStatuses[eventId]) === null || _d === void 0 ? void 0 : _d.publishedSeeding;
|
|
30859
30872
|
var seedingPublished = !usePublishState ||
|
|
30860
30873
|
((publishedSeeding_1 === null || publishedSeeding_1 === void 0 ? void 0 : publishedSeeding_1.published) &&
|
|
30861
30874
|
(((_e = publishedSeeding_1 === null || publishedSeeding_1 === void 0 ? void 0 : publishedSeeding_1.drawIds) === null || _e === void 0 ? void 0 : _e.length) === 0 ||
|
|
@@ -30872,18 +30885,18 @@ function getParticipantEntries(params) {
|
|
|
30872
30885
|
// id is the pair, team or individual participant currently being processed
|
|
30873
30886
|
// whereas participantId is the id of the entry into the draw
|
|
30874
30887
|
var addDrawEntry = function (id) {
|
|
30875
|
-
var _a, _b, _c, _d, _e;
|
|
30876
|
-
if (participantMap[id].draws[drawId])
|
|
30888
|
+
var _a, _b, _c, _d, _e, _f;
|
|
30889
|
+
if ((_a = participantMap[id].draws) === null || _a === void 0 ? void 0 : _a[drawId])
|
|
30877
30890
|
return;
|
|
30878
30891
|
var includeSeeding = withSeeding && seedingPublished;
|
|
30879
30892
|
var seedAssignments = includeSeeding ? {} : undefined;
|
|
30880
30893
|
var mainSeeding = includeSeeding
|
|
30881
|
-
? ((
|
|
30882
|
-
((
|
|
30894
|
+
? ((_b = mainSeedingMap === null || mainSeedingMap === void 0 ? void 0 : mainSeedingMap[participantId]) === null || _b === void 0 ? void 0 : _b.seedValue) ||
|
|
30895
|
+
((_c = mainSeedingMap === null || mainSeedingMap === void 0 ? void 0 : mainSeedingMap[participantId]) === null || _c === void 0 ? void 0 : _c.seedNumber)
|
|
30883
30896
|
: undefined;
|
|
30884
30897
|
var qualifyingSeeding = includeSeeding
|
|
30885
|
-
? ((
|
|
30886
|
-
((
|
|
30898
|
+
? ((_d = qualifyingSeedingMap === null || qualifyingSeedingMap === void 0 ? void 0 : qualifyingSeedingMap[participantId]) === null || _d === void 0 ? void 0 : _d.seedValue) ||
|
|
30899
|
+
((_e = qualifyingSeedingMap === null || qualifyingSeedingMap === void 0 ? void 0 : qualifyingSeedingMap[participantId]) === null || _e === void 0 ? void 0 : _e.seedNumber)
|
|
30887
30900
|
: undefined;
|
|
30888
30901
|
if (seedAssignments && mainSeeding)
|
|
30889
30902
|
seedAssignments[MAIN] = mainSeeding;
|
|
@@ -30895,7 +30908,7 @@ function getParticipantEntries(params) {
|
|
|
30895
30908
|
participantMap[id].events[eventId].seedValue =
|
|
30896
30909
|
mainSeeding || qualifyingSeeding;
|
|
30897
30910
|
}
|
|
30898
|
-
else if ((
|
|
30911
|
+
else if ((_f = participantMap[id].events[eventId]) === null || _f === void 0 ? void 0 : _f.seedValue) {
|
|
30899
30912
|
// if seeding for specific drawIds is NOT published, remove from event
|
|
30900
30913
|
participantMap[id].events[eventId].seedValue = undefined;
|
|
30901
30914
|
}
|
|
@@ -31280,9 +31293,9 @@ function getParticipants$1(params) {
|
|
|
31280
31293
|
withIOC: withIOC,
|
|
31281
31294
|
}).participantMap;
|
|
31282
31295
|
var entriesResult = getParticipantEntries({
|
|
31283
|
-
withMatchUps: withMatchUps
|
|
31284
|
-
withEvents: withEvents
|
|
31285
|
-
withDraws: withDraws
|
|
31296
|
+
withMatchUps: withMatchUps !== null && withMatchUps !== void 0 ? withMatchUps : withRankingProfile,
|
|
31297
|
+
withEvents: withEvents !== null && withEvents !== void 0 ? withEvents : withRankingProfile,
|
|
31298
|
+
withDraws: withDraws !== null && withDraws !== void 0 ? withDraws : withRankingProfile,
|
|
31286
31299
|
withPotentialMatchUps: withPotentialMatchUps,
|
|
31287
31300
|
participantFilters: participantFilters,
|
|
31288
31301
|
withRankingProfile: withRankingProfile,
|
|
@@ -31302,7 +31315,7 @@ function getParticipants$1(params) {
|
|
|
31302
31315
|
var participantIdsWithConflicts = entriesResult.participantIdsWithConflicts, eventsPublishStatuses = entriesResult.eventsPublishStatuses, derivedEventInfo = entriesResult.derivedEventInfo, derivedDrawInfo = entriesResult.derivedDrawInfo, mappedMatchUps = entriesResult.mappedMatchUps;
|
|
31303
31316
|
var matchUps = entriesResult.matchUps;
|
|
31304
31317
|
participantMap = entriesResult.participantMap;
|
|
31305
|
-
var nextMatchUps = scheduleAnalysis
|
|
31318
|
+
var nextMatchUps = scheduleAnalysis !== null && scheduleAnalysis !== void 0 ? scheduleAnalysis : withPotentialMatchUps;
|
|
31306
31319
|
var processedParticipants = Object.values(participantMap).map(function (_a) {
|
|
31307
31320
|
var potentialMatchUps = _a.potentialMatchUps, scheduleConflicts = _a.scheduleConflicts, participant = _a.participant, statistics = _a.statistics, opponents = _a.opponents, matchUps = _a.matchUps, events = _a.events, draws = _a.draws;
|
|
31308
31321
|
var participantDraws = Object.values(draws);
|