tods-competition-factory 1.8.21 → 1.8.23

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.
@@ -1521,7 +1521,6 @@ const DIRECT_ENTRY_STATUSES = [
1521
1521
  const STRUCTURE_SELECTED_STATUSES = [
1522
1522
  CONFIRMED,
1523
1523
  DIRECT_ACCEPTANCE,
1524
- FEED_IN,
1525
1524
  JUNIOR_EXEMPT,
1526
1525
  LUCKY_LOSER,
1527
1526
  QUALIFIER,
@@ -5062,7 +5061,7 @@ function getMatchUpFormatTiming({
5062
5061
  }) {
5063
5062
  if (!tournamentRecord)
5064
5063
  return { error: MISSING_TOURNAMENT_RECORD };
5065
- eventType = eventType || event?.eventType || TypeEnum.Singles;
5064
+ eventType = eventType ?? event?.eventType ?? TypeEnum.Singles;
5066
5065
  const defaultTiming = {
5067
5066
  averageTimes: [{ minutes: { default: defaultAverageMinutes } }],
5068
5067
  recoveryTimes: [{ minutes: { default: defaultRecoveryMinutes } }]
@@ -5390,7 +5389,7 @@ function findVenue({
5390
5389
  if (!venue && tournamentRecords) {
5391
5390
  const linkedTournamentIds = getLinkedTournamentIds({
5392
5391
  tournamentRecords
5393
- }).linkedTournamentIds || [];
5392
+ }).linkedTournamentIds ?? [];
5394
5393
  const relevantIds = linkedTournamentIds[tournamentRecord.tournamentId];
5395
5394
  for (const tournamentId of relevantIds) {
5396
5395
  const record = tournamentRecords[tournamentId];
@@ -5932,7 +5931,7 @@ function getPairedParticipant({
5932
5931
  result: { error: MISSING_PARTICIPANT_IDS },
5933
5932
  stack
5934
5933
  });
5935
- tournamentParticipants = tournamentParticipants || tournamentRecord?.participants || [];
5934
+ tournamentParticipants = tournamentParticipants ?? tournamentRecord?.participants ?? [];
5936
5935
  const existingPairedParticipants = tournamentParticipants.filter(
5937
5936
  (participant) => participant.participantType === PAIR && intersection(participantIds, participant.individualParticipantIds).length === participantIds.length && participant.individualParticipantIds.length === participantIds.length
5938
5937
  );
@@ -6810,7 +6809,7 @@ function getRoundContextProfile({
6810
6809
  ...(drawDefinition?.structures ?? []).filter((structure2) => structure2.stage === QUALIFYING).map(({ stageSequence }) => stageSequence ?? 1),
6811
6810
  0
6812
6811
  ) : 0;
6813
- const preQualifyingSequence = qualifyingStageSequences ? qualifyingStageSequences - (structure.stageSequence || 1) || "" : "";
6812
+ const preQualifyingSequence = qualifyingStageSequences ? qualifyingStageSequences - (structure.stageSequence ?? 1) || "" : "";
6814
6813
  const preQualifyingAffix = preQualifyingSequence ? roundNamingPolicy?.affixes?.preQualifying || defaultRoundNamingPolicy.affixes.preQualifying || "" : "";
6815
6814
  const roundNamingMap = roundNamingPolicy?.roundNamingMap || defaultRoundNamingPolicy.roundNamingMap || {};
6816
6815
  const abbreviatedRoundNamingMap = roundNamingPolicy?.abbreviatedRoundNamingMap || defaultRoundNamingPolicy.abbreviatedRoundNamingMap || {};
@@ -7109,7 +7108,13 @@ function getAllStructureMatchUps({
7109
7108
  matchUps
7110
7109
  }));
7111
7110
  }
7112
- return { matchUps, roundMatchUps, roundProfile, collectionPositionMatchUps };
7111
+ return {
7112
+ collectionPositionMatchUps,
7113
+ roundMatchUps,
7114
+ roundProfile,
7115
+ matchUpsMap,
7116
+ matchUps
7117
+ };
7113
7118
  function addMatchUpContext({
7114
7119
  scheduleVisibilityFilters: scheduleVisibilityFilters2,
7115
7120
  sourceDrawPositionRanges,
@@ -8555,7 +8560,7 @@ function parseScoreString({
8555
8560
  isSide1: winningSide === 2,
8556
8561
  tiebreakTo
8557
8562
  });
8558
- const setTiebreak = side1TiebreakPerspective || [];
8563
+ const setTiebreak = side1TiebreakPerspective ?? [];
8559
8564
  const [side1Score, side2Score] = setScores || [];
8560
8565
  const [side1TiebreakScore, side2TiebreakScore] = matchTiebreak || setTiebreak || [];
8561
8566
  return {
@@ -9870,12 +9875,12 @@ function matchUpActions$1({
9870
9875
  if (!tournamentRecord)
9871
9876
  return { error: MISSING_TOURNAMENT_RECORD };
9872
9877
  if (!drawId) {
9873
- const matchUps = allTournamentMatchUps({ tournamentRecord }).matchUps || [];
9878
+ const matchUps = allTournamentMatchUps({ tournamentRecord }).matchUps ?? [];
9874
9879
  drawId = matchUps.reduce((drawId2, candidate) => {
9875
9880
  return candidate.matchUpId === matchUpId ? candidate.drawId : drawId2;
9876
9881
  }, void 0);
9877
- const events = tournamentRecord.events || [];
9878
- const drawDefinitions = events.map((event2) => event2.drawDefinitions || []).flat();
9882
+ const events = tournamentRecord.events ?? [];
9883
+ const drawDefinitions = events.map((event2) => event2.drawDefinitions ?? []).flat();
9879
9884
  drawDefinition = drawDefinitions.reduce(
9880
9885
  (drawDefinition2, candidate) => {
9881
9886
  return candidate.drawId === drawId ? candidate : drawDefinition2;
@@ -9889,7 +9894,7 @@ function matchUpActions$1({
9889
9894
  drawDefinition,
9890
9895
  event
9891
9896
  });
9892
- policyDefinitions = policyDefinitions || attachedPolicy;
9897
+ policyDefinitions = policyDefinitions ?? attachedPolicy;
9893
9898
  if (drawDefinition) {
9894
9899
  return matchUpActions$2({
9895
9900
  tournamentParticipants: tournamentRecord.participants,
@@ -9960,7 +9965,6 @@ function getVenuesAndCourts({
9960
9965
  tournamentIds.forEach((tournamentId) => {
9961
9966
  const tournamentRecord = tournamentRecords[tournamentId];
9962
9967
  for (const venue of tournamentRecord.venues || []) {
9963
- tournamentRecord.venues;
9964
9968
  if (venueIds.length && !venueIds.includes(venue.venueId))
9965
9969
  continue;
9966
9970
  if (ignoreDisabled) {
@@ -10559,12 +10563,12 @@ function getParticipantEventDetails({
10559
10563
  if (!participantId)
10560
10564
  return { error: MISSING_PARTICIPANT_ID };
10561
10565
  const relevantParticipantIds = [participantId].concat(
10562
- (tournamentRecord.participants || []).filter(
10566
+ (tournamentRecord.participants ?? []).filter(
10563
10567
  (participant) => participant?.participantType && [TEAM$2, PAIR].includes(participant.participantType) && participant.individualParticipantIds?.includes(participantId)
10564
10568
  ).map((participant) => participant.participantId)
10565
10569
  );
10566
- const relevantEvents = (tournamentRecord.events || []).filter((event) => {
10567
- const enteredParticipantIds = (event?.entries || []).map(
10570
+ const relevantEvents = (tournamentRecord.events ?? []).filter((event) => {
10571
+ const enteredParticipantIds = (event?.entries ?? []).map(
10568
10572
  (entry) => entry.participantId
10569
10573
  );
10570
10574
  return overlap(enteredParticipantIds, relevantParticipantIds);
@@ -11356,7 +11360,7 @@ function filterParticipants({
11356
11360
  );
11357
11361
  if (event.eventType === SINGLES)
11358
11362
  return enteredParticipantIds;
11359
- const individualParticipantIds = (tournamentRecord?.participants || []).filter(
11363
+ const individualParticipantIds = (tournamentRecord?.participants ?? []).filter(
11360
11364
  (participant) => enteredParticipantIds.includes(participant.participantId)
11361
11365
  ).map((participant) => participant.individualParticipantIds).flat(1);
11362
11366
  return enteredParticipantIds.concat(...individualParticipantIds);
@@ -13075,7 +13079,7 @@ function getContainedStructures({
13075
13079
  const containerStructures = {};
13076
13080
  const structureContainers = drawDefinitions.map((dd) => dd?.structures?.filter((structure) => structure?.structures)).flat().filter(Boolean);
13077
13081
  for (const structureContainer of structureContainers) {
13078
- const { structures, structureId } = structureContainer || {};
13082
+ const { structures, structureId } = structureContainer ?? {};
13079
13083
  structures && structureId && (containedStructures[structureId] = structures?.map(
13080
13084
  (structure) => structure.structureId
13081
13085
  )) && structures.forEach(