tods-competition-factory 1.8.36 → 1.8.37

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.
@@ -7707,15 +7707,16 @@ function addNationalityCode({
7707
7707
  persons.forEach(annotatePerson);
7708
7708
  }
7709
7709
 
7710
- function addIndividualParticipants({ participantMap }) {
7710
+ function addIndividualParticipants({ participantMap, template }) {
7711
7711
  const participantObjects = Object.values(participantMap);
7712
7712
  for (const participantObject of participantObjects) {
7713
7713
  const participant = participantObject.participant;
7714
7714
  if (participant.individualParticipantIds?.length) {
7715
7715
  participant.individualParticipants = [];
7716
7716
  for (const participantId of participant.individualParticipantIds) {
7717
+ const source = participantMap[participantId].participant;
7717
7718
  participant.individualParticipants.push(
7718
- participantMap[participantId].participant
7719
+ template ? attributeFilter({ template, source }) : source
7719
7720
  );
7720
7721
  }
7721
7722
  }
@@ -7813,8 +7814,10 @@ function getParticipantMap({
7813
7814
  withIOC
7814
7815
  });
7815
7816
  }
7816
- if (withIndividualParticipants)
7817
- addIndividualParticipants({ participantMap });
7817
+ if (withIndividualParticipants) {
7818
+ const template = isObject(withIndividualParticipants) ? withIndividualParticipants : void 0;
7819
+ addIndividualParticipants({ participantMap, template });
7820
+ }
7818
7821
  return { participantMap };
7819
7822
  }
7820
7823
  function signedIn(participant) {
@@ -7874,7 +7877,7 @@ function initializeParticipantId({ participantMap, participantId }) {
7874
7877
  participantMap[participantId] = {
7875
7878
  structureParticipation: {},
7876
7879
  potentialMatchUps: {},
7877
- scheduleConflicts: [],
7880
+ scheduleConflicts: {},
7878
7881
  scheduleItems: [],
7879
7882
  participant: {
7880
7883
  groupParticipantIds: [],
@@ -19218,15 +19221,16 @@ function getParticipantEntries(params) {
19218
19221
  const itemIsPrior = consideredMinutes >= scheduledMinutes;
19219
19222
  const timeOverlap = scheduledMinutesDifference && !isNaN(scheduledMinutesDifference) ? minutesDifference <= scheduledMinutesDifference : itemIsPrior && timeStringMinutes(consideredItem.scheduledTime) < timeStringMinutes(notBeforeTime);
19220
19223
  if (timeOverlap && !(bothPotential && sameDraw) && itemIsPrior) {
19221
- participantAggregator.scheduleConflicts.push({
19224
+ const key = [scheduleItem.matchUpId, consideredItem.matchUpId].sort().join("|");
19225
+ participantAggregator.scheduleConflicts[key] = {
19222
19226
  priorScheduledMatchUpId: scheduleItem.matchUpId,
19223
19227
  matchUpIdWithConflict: consideredItem.matchUpId
19224
- });
19228
+ };
19225
19229
  }
19226
19230
  }
19227
19231
  }
19228
19232
  const pid = participantAggregator.participant.participantId;
19229
- if (participantAggregator.scheduleConflicts.length) {
19233
+ if (Object.keys(participantAggregator.scheduleConflicts).length) {
19230
19234
  participantIdsWithConflicts.push(pid);
19231
19235
  }
19232
19236
  participantMap[pid].scheduleConflicts = participantAggregator.scheduleConflicts;
@@ -19454,7 +19458,7 @@ function getParticipants(params) {
19454
19458
  return definedAttributes(
19455
19459
  {
19456
19460
  ...participant,
19457
- scheduleConflicts: scheduleAnalysis ? scheduleConflicts : void 0,
19461
+ scheduleConflicts: scheduleAnalysis ? Object.values(scheduleConflicts) : void 0,
19458
19462
  draws: withDraws || withRankingProfile ? participantDraws : void 0,
19459
19463
  events: withEvents || withRankingProfile ? Object.values(events) : void 0,
19460
19464
  matchUps: withMatchUps || withRankingProfile ? Object.values(matchUps2) : void 0,
@@ -19481,12 +19485,14 @@ function getParticipants(params) {
19481
19485
  tournamentRecord
19482
19486
  });
19483
19487
  if (withIndividualParticipants) {
19488
+ const template2 = isObject(withIndividualParticipants) ? withIndividualParticipants : void 0;
19484
19489
  for (const participant of filteredParticipants) {
19485
19490
  for (const individualParticipantId of participant.individualParticipantIds ?? []) {
19486
19491
  if (!participant.individualParticipants)
19487
19492
  participant.individualParticipants = [];
19493
+ const source = ppMap.get(individualParticipantId);
19488
19494
  participant.individualParticipants.push(
19489
- ppMap.get(individualParticipantId)
19495
+ template2 ? attributeFilter({ template: template2, source }) : source
19490
19496
  );
19491
19497
  }
19492
19498
  }