tods-competition-factory 2.2.24 → 2.2.26

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.
@@ -2818,8 +2818,9 @@ interface QualifierProgressionArgs {
2818
2818
  tournamentRecord: Tournament;
2819
2819
  targetRoundNumber?: number;
2820
2820
  event: Event$1;
2821
+ randomList?: number[];
2821
2822
  }
2822
- declare function qualifierProgression({ targetRoundNumber, tournamentRecord, drawDefinition, event, }: QualifierProgressionArgs): ResultType;
2823
+ declare function qualifierProgression({ targetRoundNumber, tournamentRecord, drawDefinition, event, randomList, }: QualifierProgressionArgs): ResultType;
2823
2824
 
2824
2825
  declare function setStructureOrder({ drawDefinition, orderMap }: {
2825
2826
  drawDefinition: any;
@@ -3264,29 +3265,6 @@ type GetParticipantIdFinishingPositionsArgs = {
3264
3265
  };
3265
3266
  declare function getParticipantIdFinishingPositions({ byeAdvancements, tournamentRecord, drawDefinition, }: GetParticipantIdFinishingPositionsArgs): any;
3266
3267
 
3267
- type GetStructureSeedAssignmentsArgs = {
3268
- provisionalPositioning?: boolean;
3269
- drawDefinition?: DrawDefinition;
3270
- returnAllProxies?: boolean;
3271
- structure?: Structure;
3272
- structureId?: string;
3273
- };
3274
- declare function getStructureSeedAssignments({ provisionalPositioning, returnAllProxies, drawDefinition, structureId, structure, }: GetStructureSeedAssignmentsArgs): {
3275
- seedAssignments?: SeedAssignment[];
3276
- stageSequence?: number;
3277
- stage?: StageTypeUnion;
3278
- seedLimit?: number;
3279
- error?: ErrorType;
3280
- };
3281
-
3282
- type GetAssignedParticipantIdsArgs = {
3283
- drawDefinition: DrawDefinition;
3284
- stages?: StageTypeUnion[];
3285
- };
3286
- declare function getAssignedParticipantIds({ drawDefinition, stages }: GetAssignedParticipantIdsArgs): ResultType & {
3287
- assignedParticipantIds?: string[];
3288
- };
3289
-
3290
3268
  type GetDrawDefinitionArgs = {
3291
3269
  tournamentRecords?: {
3292
3270
  [key: string]: Tournament;
@@ -3303,6 +3281,29 @@ declare function publicFindDrawDefinition(params: GetDrawDefinitionArgs): {
3303
3281
  error?: undefined;
3304
3282
  };
3305
3283
 
3284
+ type GetAssignedParticipantIdsArgs = {
3285
+ drawDefinition: DrawDefinition;
3286
+ stages?: StageTypeUnion[];
3287
+ };
3288
+ declare function getAssignedParticipantIds({ drawDefinition, stages }: GetAssignedParticipantIdsArgs): ResultType & {
3289
+ assignedParticipantIds?: string[];
3290
+ };
3291
+
3292
+ type GetStructureSeedAssignmentsArgs = {
3293
+ provisionalPositioning?: boolean;
3294
+ drawDefinition?: DrawDefinition;
3295
+ returnAllProxies?: boolean;
3296
+ structure?: Structure;
3297
+ structureId?: string;
3298
+ };
3299
+ declare function getStructureSeedAssignments({ provisionalPositioning, returnAllProxies, drawDefinition, structureId, structure, }: GetStructureSeedAssignmentsArgs): {
3300
+ seedAssignments?: SeedAssignment[];
3301
+ stageSequence?: number;
3302
+ stage?: StageTypeUnion;
3303
+ seedLimit?: number;
3304
+ error?: ErrorType;
3305
+ };
3306
+
3306
3307
  type PositionActionsArgs = {
3307
3308
  inContextDrawMatchUps?: HydratedMatchUp[];
3308
3309
  restrictAdHocRoundParticipants?: boolean;
@@ -3326,6 +3327,18 @@ declare function positionActions(params: PositionActionsArgs): ResultType & {
3326
3327
  validActions?: any[];
3327
3328
  };
3328
3329
 
3330
+ type getDrawTypeCoercionArgs = {
3331
+ policyDefinitions?: PolicyDefinitions;
3332
+ appliedPolicies?: PolicyDefinitions;
3333
+ drawType?: string;
3334
+ };
3335
+ declare function getDrawTypeCoercion({ policyDefinitions, appliedPolicies, drawType }: getDrawTypeCoercionArgs): any;
3336
+
3337
+ interface GetRandomQualifierListParams {
3338
+ drawDefinition: DrawDefinition;
3339
+ }
3340
+ declare const getRandomQualifierList: ({ drawDefinition }: GetRandomQualifierListParams) => any[] | ResultType;
3341
+
3329
3342
  type GetPositionsPlayedOff = {
3330
3343
  drawDefinition: DrawDefinition;
3331
3344
  matchUpsMap?: MatchUpsMap;
@@ -3356,12 +3369,19 @@ declare function getPositionsPlayedOff({ drawDefinition, structureIds, matchUpsM
3356
3369
  context?: undefined;
3357
3370
  };
3358
3371
 
3359
- type getDrawTypeCoercionArgs = {
3360
- policyDefinitions?: PolicyDefinitions;
3361
- appliedPolicies?: PolicyDefinitions;
3362
- drawType?: string;
3372
+ declare function isValidForQualifying({ structureId, drawDefinition }: {
3373
+ structureId: any;
3374
+ drawDefinition: any;
3375
+ }): {
3376
+ error: {
3377
+ message: string;
3378
+ code: string;
3379
+ };
3380
+ links?: undefined;
3381
+ } | {
3382
+ valid: boolean;
3383
+ success: boolean;
3363
3384
  };
3364
- declare function getDrawTypeCoercion({ policyDefinitions, appliedPolicies, drawType }: getDrawTypeCoercionArgs): any;
3365
3385
 
3366
3386
  type GetPositionAssignmentsArgs = {
3367
3387
  tournamentRecord: Tournament;
@@ -3383,20 +3403,6 @@ declare function getPositionAssignments({ tournamentRecord, drawDefinition, stag
3383
3403
  error: ErrorType | undefined;
3384
3404
  };
3385
3405
 
3386
- declare function isValidForQualifying({ structureId, drawDefinition }: {
3387
- structureId: any;
3388
- drawDefinition: any;
3389
- }): {
3390
- error: {
3391
- message: string;
3392
- code: string;
3393
- };
3394
- links?: undefined;
3395
- } | {
3396
- valid: boolean;
3397
- success: boolean;
3398
- };
3399
-
3400
3406
  type GetSeedingThresholdsArgs = {
3401
3407
  roundRobinGroupsCount?: number;
3402
3408
  participantsCount: number;
@@ -3651,6 +3657,7 @@ declare const query$b_getMatchUpsMap: typeof getMatchUpsMap;
3651
3657
  declare const query$b_getParticipantIdFinishingPositions: typeof getParticipantIdFinishingPositions;
3652
3658
  declare const query$b_getPositionAssignments: typeof getPositionAssignments;
3653
3659
  declare const query$b_getPositionsPlayedOff: typeof getPositionsPlayedOff;
3660
+ declare const query$b_getRandomQualifierList: typeof getRandomQualifierList;
3654
3661
  declare const query$b_getSeedingThresholds: typeof getSeedingThresholds;
3655
3662
  declare const query$b_getSeedsCount: typeof getSeedsCount;
3656
3663
  declare const query$b_getStructureSeedAssignments: typeof getStructureSeedAssignments;
@@ -3661,7 +3668,7 @@ declare const query$b_isCompletedStructure: typeof isCompletedStructure;
3661
3668
  declare const query$b_isValidForQualifying: typeof isValidForQualifying;
3662
3669
  declare const query$b_positionActions: typeof positionActions;
3663
3670
  declare namespace query$b {
3664
- export { query$b_addGoesTo as addGoesTo, query$b_allPlayoffPositionsFilled as allPlayoffPositionsFilled, query$b_checkValidEntries as checkValidEntries, publicFindDrawDefinition as findDrawDefinition, query$b_getAssignedParticipantIds as getAssignedParticipantIds, query$b_getAvailableMatchUpsCount as getAvailableMatchUpsCount, query$b_getAvailablePlayoffProfiles as getAvailablePlayoffProfiles, query$b_getDrawDefinitionTimeItem as getDrawDefinitionTimeItem, query$b_getDrawParticipantRepresentativeIds as getDrawParticipantRepresentativeIds, query$b_getDrawStructures as getDrawStructures, query$b_getDrawTypeCoercion as getDrawTypeCoercion, query$b_getEligibleVoluntaryConsolationParticipants as getEligibleVoluntaryConsolationParticipants, query$b_getMatchUpsMap as getMatchUpsMap, query$b_getParticipantIdFinishingPositions as getParticipantIdFinishingPositions, query$b_getPositionAssignments as getPositionAssignments, query$b_getPositionsPlayedOff as getPositionsPlayedOff, query$b_getSeedingThresholds as getSeedingThresholds, query$b_getSeedsCount as getSeedsCount, query$b_getStructureSeedAssignments as getStructureSeedAssignments, query$b_getTeamLineUp as getTeamLineUp, query$b_getValidGroupSizes as getValidGroupSizes, query$b_isAdHoc as isAdHoc, query$b_isCompletedStructure as isCompletedStructure, query$b_isValidForQualifying as isValidForQualifying, query$b_positionActions as positionActions };
3671
+ export { query$b_addGoesTo as addGoesTo, query$b_allPlayoffPositionsFilled as allPlayoffPositionsFilled, query$b_checkValidEntries as checkValidEntries, publicFindDrawDefinition as findDrawDefinition, query$b_getAssignedParticipantIds as getAssignedParticipantIds, query$b_getAvailableMatchUpsCount as getAvailableMatchUpsCount, query$b_getAvailablePlayoffProfiles as getAvailablePlayoffProfiles, query$b_getDrawDefinitionTimeItem as getDrawDefinitionTimeItem, query$b_getDrawParticipantRepresentativeIds as getDrawParticipantRepresentativeIds, query$b_getDrawStructures as getDrawStructures, query$b_getDrawTypeCoercion as getDrawTypeCoercion, query$b_getEligibleVoluntaryConsolationParticipants as getEligibleVoluntaryConsolationParticipants, query$b_getMatchUpsMap as getMatchUpsMap, query$b_getParticipantIdFinishingPositions as getParticipantIdFinishingPositions, query$b_getPositionAssignments as getPositionAssignments, query$b_getPositionsPlayedOff as getPositionsPlayedOff, query$b_getRandomQualifierList as getRandomQualifierList, query$b_getSeedingThresholds as getSeedingThresholds, query$b_getSeedsCount as getSeedsCount, query$b_getStructureSeedAssignments as getStructureSeedAssignments, query$b_getTeamLineUp as getTeamLineUp, query$b_getValidGroupSizes as getValidGroupSizes, query$b_isAdHoc as isAdHoc, query$b_isCompletedStructure as isCompletedStructure, query$b_isValidForQualifying as isValidForQualifying, query$b_positionActions as positionActions };
3665
3672
  }
3666
3673
 
3667
3674
  type GenerateDrawTypeAndModify = {
@@ -4000,6 +4007,7 @@ declare const index$j_getMatchUpsMap: typeof getMatchUpsMap;
4000
4007
  declare const index$j_getParticipantIdFinishingPositions: typeof getParticipantIdFinishingPositions;
4001
4008
  declare const index$j_getPositionAssignments: typeof getPositionAssignments;
4002
4009
  declare const index$j_getPositionsPlayedOff: typeof getPositionsPlayedOff;
4010
+ declare const index$j_getRandomQualifierList: typeof getRandomQualifierList;
4003
4011
  declare const index$j_getSeedingThresholds: typeof getSeedingThresholds;
4004
4012
  declare const index$j_getSeedsCount: typeof getSeedsCount;
4005
4013
  declare const index$j_getStructureSeedAssignments: typeof getStructureSeedAssignments;
@@ -4034,7 +4042,7 @@ declare const index$j_swapDrawPositionAssignments: typeof swapDrawPositionAssign
4034
4042
  declare const index$j_updateTeamLineUp: typeof updateTeamLineUp;
4035
4043
  declare const index$j_withdrawParticipantAtDrawPosition: typeof withdrawParticipantAtDrawPosition;
4036
4044
  declare namespace index$j {
4037
- export { index$j_adHocPositionSwap as adHocPositionSwap, index$j_addAdHocMatchUps as addAdHocMatchUps, index$j_addDrawDefinitionTimeItem as addDrawDefinitionTimeItem, index$j_addFinishingRounds as addFinishingRounds, index$j_addGoesTo as addGoesTo, index$j_addPlayoffStructures as addPlayoffStructures, index$j_addQualifyingStructure as addQualifyingStructure, index$j_addVoluntaryConsolationStage as addVoluntaryConsolationStage, index$j_addVoluntaryConsolationStructure as addVoluntaryConsolationStructure, index$j_allPlayoffPositionsFilled as allPlayoffPositionsFilled, index$j_alternateDrawPositionAssignment as alternateDrawPositionAssignment, index$j_assignDrawPosition as assignDrawPosition, index$j_assignDrawPositionBye as assignDrawPositionBye, index$j_attachConsolationStructures as attachConsolationStructures, index$j_attachPlayoffStructures as attachPlayoffStructures, index$j_attachQualifyingStructure as attachQualifyingStructure, index$j_attachStructures as attachStructures, index$j_autoSeeding as autoSeeding, index$j_automatedPlayoffPositioning as automatedPlayoffPositioning, index$j_automatedPositioning as automatedPositioning, index$j_checkValidEntries as checkValidEntries, index$j_deleteAdHocMatchUps as deleteAdHocMatchUps, index$j_drawMatic as drawMatic, publicFindDrawDefinition as findDrawDefinition, index$j_generateAdHocMatchUps as generateAdHocMatchUps, index$j_generateAdHocRounds as generateAdHocRounds, index$j_generateAndPopulatePlayoffStructures as generateAndPopulatePlayoffStructures, index$j_generateDrawDefinition as generateDrawDefinition, index$j_generateDrawMaticRound as generateDrawMaticRound, index$j_generateDrawStructuresAndLinks as generateDrawStructuresAndLinks, index$j_generateDrawTypeAndModifyDrawDefinition as generateDrawTypeAndModifyDrawDefinition, index$j_generateQualifyingStructure as generateQualifyingStructure, index$j_generateVoluntaryConsolation as generateVoluntaryConsolation, index$j_getAssignedParticipantIds as getAssignedParticipantIds, index$j_getAvailableMatchUpsCount as getAvailableMatchUpsCount, index$j_getAvailablePlayoffProfiles as getAvailablePlayoffProfiles, index$j_getDrawDefinitionTimeItem as getDrawDefinitionTimeItem, index$j_getDrawParticipantRepresentativeIds as getDrawParticipantRepresentativeIds, index$j_getDrawStructures as getDrawStructures, index$j_getDrawTypeCoercion as getDrawTypeCoercion, index$j_getEligibleVoluntaryConsolationParticipants as getEligibleVoluntaryConsolationParticipants, index$j_getMatchUpsMap as getMatchUpsMap, index$j_getParticipantIdFinishingPositions as getParticipantIdFinishingPositions, index$j_getPositionAssignments as getPositionAssignments, index$j_getPositionsPlayedOff as getPositionsPlayedOff, index$j_getSeedingThresholds as getSeedingThresholds, index$j_getSeedsCount as getSeedsCount, index$j_getStructureSeedAssignments as getStructureSeedAssignments, index$j_getTeamLineUp as getTeamLineUp, index$j_getValidGroupSizes as getValidGroupSizes, index$j_isAdHoc as isAdHoc, index$j_isCompletedStructure as isCompletedStructure, index$j_isValidForQualifying as isValidForQualifying, index$j_luckyLoserDrawPositionAssignment as luckyLoserDrawPositionAssignment, index$j_modifyDrawDefinition as modifyDrawDefinition, index$j_modifyDrawName as modifyDrawName, index$j_modifySeedAssignment as modifySeedAssignment, mutate$c as mutate, index$j_positionActions as positionActions, index$j_pruneDrawDefinition as pruneDrawDefinition, index$j_qualifierDrawPositionAssignment as qualifierDrawPositionAssignment, index$j_qualifierProgression as qualifierProgression, query$b as query, index$j_removeDrawPositionAssignment as removeDrawPositionAssignment, index$j_removeRoundMatchUps as removeRoundMatchUps, index$j_removeSeededParticipant as removeSeededParticipant, index$j_removeStructure as removeStructure, index$j_renameStructures as renameStructures, index$j_resetDrawDefinition as resetDrawDefinition, index$j_resetQualifyingStructure as resetQualifyingStructure, index$j_resetVoluntaryConsolationStructure as resetVoluntaryConsolationStructure, index$j_setDrawParticipantRepresentativeIds as setDrawParticipantRepresentativeIds, index$j_setPositionAssignments as setPositionAssignments, index$j_setStructureOrder as setStructureOrder, index$j_setSubOrder as setSubOrder, index$j_shiftAdHocRounds as shiftAdHocRounds, index$j_swapAdHocRounds as swapAdHocRounds, index$j_swapDrawPositionAssignments as swapDrawPositionAssignments, index$j_updateTeamLineUp as updateTeamLineUp, index$j_withdrawParticipantAtDrawPosition as withdrawParticipantAtDrawPosition };
4045
+ export { index$j_adHocPositionSwap as adHocPositionSwap, index$j_addAdHocMatchUps as addAdHocMatchUps, index$j_addDrawDefinitionTimeItem as addDrawDefinitionTimeItem, index$j_addFinishingRounds as addFinishingRounds, index$j_addGoesTo as addGoesTo, index$j_addPlayoffStructures as addPlayoffStructures, index$j_addQualifyingStructure as addQualifyingStructure, index$j_addVoluntaryConsolationStage as addVoluntaryConsolationStage, index$j_addVoluntaryConsolationStructure as addVoluntaryConsolationStructure, index$j_allPlayoffPositionsFilled as allPlayoffPositionsFilled, index$j_alternateDrawPositionAssignment as alternateDrawPositionAssignment, index$j_assignDrawPosition as assignDrawPosition, index$j_assignDrawPositionBye as assignDrawPositionBye, index$j_attachConsolationStructures as attachConsolationStructures, index$j_attachPlayoffStructures as attachPlayoffStructures, index$j_attachQualifyingStructure as attachQualifyingStructure, index$j_attachStructures as attachStructures, index$j_autoSeeding as autoSeeding, index$j_automatedPlayoffPositioning as automatedPlayoffPositioning, index$j_automatedPositioning as automatedPositioning, index$j_checkValidEntries as checkValidEntries, index$j_deleteAdHocMatchUps as deleteAdHocMatchUps, index$j_drawMatic as drawMatic, publicFindDrawDefinition as findDrawDefinition, index$j_generateAdHocMatchUps as generateAdHocMatchUps, index$j_generateAdHocRounds as generateAdHocRounds, index$j_generateAndPopulatePlayoffStructures as generateAndPopulatePlayoffStructures, index$j_generateDrawDefinition as generateDrawDefinition, index$j_generateDrawMaticRound as generateDrawMaticRound, index$j_generateDrawStructuresAndLinks as generateDrawStructuresAndLinks, index$j_generateDrawTypeAndModifyDrawDefinition as generateDrawTypeAndModifyDrawDefinition, index$j_generateQualifyingStructure as generateQualifyingStructure, index$j_generateVoluntaryConsolation as generateVoluntaryConsolation, index$j_getAssignedParticipantIds as getAssignedParticipantIds, index$j_getAvailableMatchUpsCount as getAvailableMatchUpsCount, index$j_getAvailablePlayoffProfiles as getAvailablePlayoffProfiles, index$j_getDrawDefinitionTimeItem as getDrawDefinitionTimeItem, index$j_getDrawParticipantRepresentativeIds as getDrawParticipantRepresentativeIds, index$j_getDrawStructures as getDrawStructures, index$j_getDrawTypeCoercion as getDrawTypeCoercion, index$j_getEligibleVoluntaryConsolationParticipants as getEligibleVoluntaryConsolationParticipants, index$j_getMatchUpsMap as getMatchUpsMap, index$j_getParticipantIdFinishingPositions as getParticipantIdFinishingPositions, index$j_getPositionAssignments as getPositionAssignments, index$j_getPositionsPlayedOff as getPositionsPlayedOff, index$j_getRandomQualifierList as getRandomQualifierList, index$j_getSeedingThresholds as getSeedingThresholds, index$j_getSeedsCount as getSeedsCount, index$j_getStructureSeedAssignments as getStructureSeedAssignments, index$j_getTeamLineUp as getTeamLineUp, index$j_getValidGroupSizes as getValidGroupSizes, index$j_isAdHoc as isAdHoc, index$j_isCompletedStructure as isCompletedStructure, index$j_isValidForQualifying as isValidForQualifying, index$j_luckyLoserDrawPositionAssignment as luckyLoserDrawPositionAssignment, index$j_modifyDrawDefinition as modifyDrawDefinition, index$j_modifyDrawName as modifyDrawName, index$j_modifySeedAssignment as modifySeedAssignment, mutate$c as mutate, index$j_positionActions as positionActions, index$j_pruneDrawDefinition as pruneDrawDefinition, index$j_qualifierDrawPositionAssignment as qualifierDrawPositionAssignment, index$j_qualifierProgression as qualifierProgression, query$b as query, index$j_removeDrawPositionAssignment as removeDrawPositionAssignment, index$j_removeRoundMatchUps as removeRoundMatchUps, index$j_removeSeededParticipant as removeSeededParticipant, index$j_removeStructure as removeStructure, index$j_renameStructures as renameStructures, index$j_resetDrawDefinition as resetDrawDefinition, index$j_resetQualifyingStructure as resetQualifyingStructure, index$j_resetVoluntaryConsolationStructure as resetVoluntaryConsolationStructure, index$j_setDrawParticipantRepresentativeIds as setDrawParticipantRepresentativeIds, index$j_setPositionAssignments as setPositionAssignments, index$j_setStructureOrder as setStructureOrder, index$j_setSubOrder as setSubOrder, index$j_shiftAdHocRounds as shiftAdHocRounds, index$j_swapAdHocRounds as swapAdHocRounds, index$j_swapDrawPositionAssignments as swapDrawPositionAssignments, index$j_updateTeamLineUp as updateTeamLineUp, index$j_withdrawParticipantAtDrawPosition as withdrawParticipantAtDrawPosition };
4038
4046
  }
4039
4047
 
4040
4048
  type DestroyPairEntryArgs = {
@@ -7960,6 +7968,7 @@ declare const index$9_getPositionsPlayedOff: typeof getPositionsPlayedOff;
7960
7968
  declare const index$9_getPredictiveAccuracy: typeof getPredictiveAccuracy;
7961
7969
  declare const index$9_getProfileRounds: typeof getProfileRounds;
7962
7970
  declare const index$9_getPublishState: typeof getPublishState;
7971
+ declare const index$9_getRandomQualifierList: typeof getRandomQualifierList;
7963
7972
  declare const index$9_getRoundMatchUps: typeof getRoundMatchUps;
7964
7973
  declare const index$9_getRounds: typeof getRounds;
7965
7974
  declare const index$9_getScaleValues: typeof getScaleValues;
@@ -8002,7 +8011,7 @@ declare const index$9_validMatchUps: typeof validMatchUps;
8002
8011
  declare const index$9_validateCollectionDefinition: typeof validateCollectionDefinition;
8003
8012
  declare const index$9_validateLineUp: typeof validateLineUp;
8004
8013
  declare namespace index$9 {
8005
- export { index$9_addGoesTo as addGoesTo, index$9_allCompetitionMatchUps as allCompetitionMatchUps, index$9_allDrawMatchUps as allDrawMatchUps, index$9_allEventMatchUps as allEventMatchUps, index$9_allPlayoffPositionsFilled as allPlayoffPositionsFilled, index$9_allTournamentMatchUps as allTournamentMatchUps, index$9_analyzeDraws as analyzeDraws, index$9_analyzeMatchUp as analyzeMatchUp, index$9_analyzeTournament as analyzeTournament, index$9_bulkUpdatePublishedEventIds as bulkUpdatePublishedEventIds, index$9_calculateWinCriteria as calculateWinCriteria, index$9_categoryCanContain as categoryCanContain, index$9_checkMatchUpIsComplete as checkMatchUpIsComplete, index$9_checkValidEntries as checkValidEntries, index$9_compareTieFormats as compareTieFormats, index$9_competitionScheduleMatchUps as competitionScheduleMatchUps, index$9_courtGridRows as courtGridRows, index$9_credits as credits, index$9_drawMatchUps as drawMatchUps, index$9_eventMatchUps as eventMatchUps, index$9_filterMatchUps as filterMatchUps, index$9_filterParticipants as filterParticipants, publicFindDrawDefinition as findDrawDefinition, index$9_findExtension as findExtension, index$9_findVenue as findVenue, index$9_getAggregateTeamResults as getAggregateTeamResults, index$9_getAllDrawMatchUps as getAllDrawMatchUps, index$9_getAllEventData as getAllEventData, index$9_getAllStructureMatchUps as getAllStructureMatchUps, index$9_getAllowedDrawTypes as getAllowedDrawTypes, index$9_getAllowedMatchUpFormats as getAllowedMatchUpFormats, index$9_getAppliedPolicies as getAppliedPolicies, index$9_getAssignedParticipantIds as getAssignedParticipantIds, index$9_getAvailableMatchUpsCount as getAvailableMatchUpsCount, index$9_getAvailablePlayoffProfiles as getAvailablePlayoffProfiles, index$9_getCategoryAgeDetails as getCategoryAgeDetails, index$9_getCheckedInParticipantIds as getCheckedInParticipantIds, index$9_getCompetitionDateRange as getCompetitionDateRange, index$9_getCompetitionMatchUps as getCompetitionMatchUps, index$9_getCompetitionParticipants as getCompetitionParticipants, index$9_getCompetitionPenalties as getCompetitionPenalties, index$9_getCompetitionVenues as getCompetitionVenues, index$9_getCourtInfo as getCourtInfo, index$9_getCourts as getCourts, index$9_getDrawData as getDrawData, index$9_getDrawDefinitionTimeItem as getDrawDefinitionTimeItem, index$9_getDrawParticipantRepresentativeIds as getDrawParticipantRepresentativeIds, index$9_getDrawStructures as getDrawStructures, index$9_getDrawTypeCoercion as getDrawTypeCoercion, index$9_getEligibleVoluntaryConsolationParticipants as getEligibleVoluntaryConsolationParticipants, index$9_getEntriesAndSeedsCount as getEntriesAndSeedsCount, index$9_getEvent as getEvent, index$9_getEventData as getEventData, index$9_getEventMatchUpFormatTiming as getEventMatchUpFormatTiming, index$9_getEventProperties as getEventProperties, index$9_getEventPublishStatus as getEventPublishStatus, index$9_getEventStructures as getEventStructures, index$9_getEventTimeItem as getEventTimeItem, index$9_getEvents as getEvents, index$9_getFlightProfile as getFlightProfile, index$9_getHomeParticipantId as getHomeParticipantId, index$9_getLinkedTournamentIds as getLinkedTournamentIds, index$9_getMatchUpCompetitiveProfile as getMatchUpCompetitiveProfile, index$9_getMatchUpContextIds as getMatchUpContextIds, index$9_getMatchUpDailyLimits as getMatchUpDailyLimits, index$9_getMatchUpDailyLimitsUpdate as getMatchUpDailyLimitsUpdate, index$9_getMatchUpDependencies as getMatchUpDependencies, index$9_getMatchUpFormat as getMatchUpFormat, index$9_getMatchUpFormatTiming as getMatchUpFormatTiming, index$9_getMatchUpFormatTimingUpdate as getMatchUpFormatTimingUpdate, index$9_getMatchUpScheduleDetails as getMatchUpScheduleDetails, index$9_getMatchUpType as getMatchUpType, index$9_getMatchUpsMap as getMatchUpsMap, index$9_getMatchUpsStats as getMatchUpsStats, index$9_getMatchUpsToSchedule as getMatchUpsToSchedule, index$9_getMaxEntryPosition as getMaxEntryPosition, index$9_getModifiedMatchUpFormatTiming as getModifiedMatchUpFormatTiming, index$9_getPairedParticipant as getPairedParticipant, index$9_getParticipantEventDetails as getParticipantEventDetails, index$9_getParticipantIdFinishingPositions as getParticipantIdFinishingPositions, index$9_getParticipantMembership as getParticipantMembership, index$9_getParticipantResults as getParticipantResults, index$9_getParticipantScaleItem as getParticipantScaleItem, index$9_getParticipantSchedules as getParticipantSchedules, index$9_getParticipantSignInStatus as getParticipantSignInStatus, index$9_getParticipantTimeItem as getParticipantTimeItem, index$9_getParticipants as getParticipants, index$9_getPersonRequests as getPersonRequests, index$9_getPolicyDefinitions as getPolicyDefinitions, index$9_getPositionAssignments as getPositionAssignments, index$9_getPositionsPlayedOff as getPositionsPlayedOff, index$9_getPredictiveAccuracy as getPredictiveAccuracy, index$9_getProfileRounds as getProfileRounds, index$9_getPublishState as getPublishState, index$9_getRoundMatchUps as getRoundMatchUps, index$9_getRounds as getRounds, index$9_getScaleValues as getScaleValues, index$9_getScaledEntries as getScaledEntries, index$9_getScheduledRoundsDetails as getScheduledRoundsDetails, index$9_getSchedulingProfile as getSchedulingProfile, index$9_getSchedulingProfileIssues as getSchedulingProfileIssues, index$9_getSeedingThresholds as getSeedingThresholds, index$9_getSeedsCount as getSeedsCount, index$9_getStructureSeedAssignments as getStructureSeedAssignments, index$9_getTeamLineUp as getTeamLineUp, index$9_getTieFormat as getTieFormat, index$9_getTimeItem as getTimeItem, index$9_getTournamentIds as getTournamentIds, index$9_getTournamentInfo as getTournamentInfo, index$9_getTournamentPenalties as getTournamentPenalties, index$9_getTournamentPersons as getTournamentPersons, index$9_getTournamentPoints as getTournamentPoints, index$9_getTournamentPublishStatus as getTournamentPublishStatus, index$9_getTournamentStructures as getTournamentStructures, index$9_getTournamentTimeItem as getTournamentTimeItem, index$9_getValidGroupSizes as getValidGroupSizes, index$9_getVenueData as getVenueData, index$9_getVenuesAndCourts as getVenuesAndCourts, index$9_isAdHoc as isAdHoc, index$9_isCompletedStructure as isCompletedStructure, index$9_isValidForQualifying as isValidForQualifying, index$9_isValidMatchUpFormat as isValidMatchUpFormat, index$9_matchUpActions as matchUpActions, index$9_participantScaleItem as participantScaleItem, index$9_participantScheduledMatchUps as participantScheduledMatchUps, index$9_positionActions as positionActions, index$9_publicFindCourt as publicFindCourt, index$9_publicFindVenue as publicFindVenue, index$9_tallyParticipantResults as tallyParticipantResults, index$9_tieFormatGenderValidityCheck as tieFormatGenderValidityCheck, index$9_tournamentMatchUps as tournamentMatchUps, index$9_validMatchUp as validMatchUp, index$9_validMatchUps as validMatchUps, index$9_validateCollectionDefinition as validateCollectionDefinition, index$9_validateLineUp as validateLineUp };
8014
+ export { index$9_addGoesTo as addGoesTo, index$9_allCompetitionMatchUps as allCompetitionMatchUps, index$9_allDrawMatchUps as allDrawMatchUps, index$9_allEventMatchUps as allEventMatchUps, index$9_allPlayoffPositionsFilled as allPlayoffPositionsFilled, index$9_allTournamentMatchUps as allTournamentMatchUps, index$9_analyzeDraws as analyzeDraws, index$9_analyzeMatchUp as analyzeMatchUp, index$9_analyzeTournament as analyzeTournament, index$9_bulkUpdatePublishedEventIds as bulkUpdatePublishedEventIds, index$9_calculateWinCriteria as calculateWinCriteria, index$9_categoryCanContain as categoryCanContain, index$9_checkMatchUpIsComplete as checkMatchUpIsComplete, index$9_checkValidEntries as checkValidEntries, index$9_compareTieFormats as compareTieFormats, index$9_competitionScheduleMatchUps as competitionScheduleMatchUps, index$9_courtGridRows as courtGridRows, index$9_credits as credits, index$9_drawMatchUps as drawMatchUps, index$9_eventMatchUps as eventMatchUps, index$9_filterMatchUps as filterMatchUps, index$9_filterParticipants as filterParticipants, publicFindDrawDefinition as findDrawDefinition, index$9_findExtension as findExtension, index$9_findVenue as findVenue, index$9_getAggregateTeamResults as getAggregateTeamResults, index$9_getAllDrawMatchUps as getAllDrawMatchUps, index$9_getAllEventData as getAllEventData, index$9_getAllStructureMatchUps as getAllStructureMatchUps, index$9_getAllowedDrawTypes as getAllowedDrawTypes, index$9_getAllowedMatchUpFormats as getAllowedMatchUpFormats, index$9_getAppliedPolicies as getAppliedPolicies, index$9_getAssignedParticipantIds as getAssignedParticipantIds, index$9_getAvailableMatchUpsCount as getAvailableMatchUpsCount, index$9_getAvailablePlayoffProfiles as getAvailablePlayoffProfiles, index$9_getCategoryAgeDetails as getCategoryAgeDetails, index$9_getCheckedInParticipantIds as getCheckedInParticipantIds, index$9_getCompetitionDateRange as getCompetitionDateRange, index$9_getCompetitionMatchUps as getCompetitionMatchUps, index$9_getCompetitionParticipants as getCompetitionParticipants, index$9_getCompetitionPenalties as getCompetitionPenalties, index$9_getCompetitionVenues as getCompetitionVenues, index$9_getCourtInfo as getCourtInfo, index$9_getCourts as getCourts, index$9_getDrawData as getDrawData, index$9_getDrawDefinitionTimeItem as getDrawDefinitionTimeItem, index$9_getDrawParticipantRepresentativeIds as getDrawParticipantRepresentativeIds, index$9_getDrawStructures as getDrawStructures, index$9_getDrawTypeCoercion as getDrawTypeCoercion, index$9_getEligibleVoluntaryConsolationParticipants as getEligibleVoluntaryConsolationParticipants, index$9_getEntriesAndSeedsCount as getEntriesAndSeedsCount, index$9_getEvent as getEvent, index$9_getEventData as getEventData, index$9_getEventMatchUpFormatTiming as getEventMatchUpFormatTiming, index$9_getEventProperties as getEventProperties, index$9_getEventPublishStatus as getEventPublishStatus, index$9_getEventStructures as getEventStructures, index$9_getEventTimeItem as getEventTimeItem, index$9_getEvents as getEvents, index$9_getFlightProfile as getFlightProfile, index$9_getHomeParticipantId as getHomeParticipantId, index$9_getLinkedTournamentIds as getLinkedTournamentIds, index$9_getMatchUpCompetitiveProfile as getMatchUpCompetitiveProfile, index$9_getMatchUpContextIds as getMatchUpContextIds, index$9_getMatchUpDailyLimits as getMatchUpDailyLimits, index$9_getMatchUpDailyLimitsUpdate as getMatchUpDailyLimitsUpdate, index$9_getMatchUpDependencies as getMatchUpDependencies, index$9_getMatchUpFormat as getMatchUpFormat, index$9_getMatchUpFormatTiming as getMatchUpFormatTiming, index$9_getMatchUpFormatTimingUpdate as getMatchUpFormatTimingUpdate, index$9_getMatchUpScheduleDetails as getMatchUpScheduleDetails, index$9_getMatchUpType as getMatchUpType, index$9_getMatchUpsMap as getMatchUpsMap, index$9_getMatchUpsStats as getMatchUpsStats, index$9_getMatchUpsToSchedule as getMatchUpsToSchedule, index$9_getMaxEntryPosition as getMaxEntryPosition, index$9_getModifiedMatchUpFormatTiming as getModifiedMatchUpFormatTiming, index$9_getPairedParticipant as getPairedParticipant, index$9_getParticipantEventDetails as getParticipantEventDetails, index$9_getParticipantIdFinishingPositions as getParticipantIdFinishingPositions, index$9_getParticipantMembership as getParticipantMembership, index$9_getParticipantResults as getParticipantResults, index$9_getParticipantScaleItem as getParticipantScaleItem, index$9_getParticipantSchedules as getParticipantSchedules, index$9_getParticipantSignInStatus as getParticipantSignInStatus, index$9_getParticipantTimeItem as getParticipantTimeItem, index$9_getParticipants as getParticipants, index$9_getPersonRequests as getPersonRequests, index$9_getPolicyDefinitions as getPolicyDefinitions, index$9_getPositionAssignments as getPositionAssignments, index$9_getPositionsPlayedOff as getPositionsPlayedOff, index$9_getPredictiveAccuracy as getPredictiveAccuracy, index$9_getProfileRounds as getProfileRounds, index$9_getPublishState as getPublishState, index$9_getRandomQualifierList as getRandomQualifierList, index$9_getRoundMatchUps as getRoundMatchUps, index$9_getRounds as getRounds, index$9_getScaleValues as getScaleValues, index$9_getScaledEntries as getScaledEntries, index$9_getScheduledRoundsDetails as getScheduledRoundsDetails, index$9_getSchedulingProfile as getSchedulingProfile, index$9_getSchedulingProfileIssues as getSchedulingProfileIssues, index$9_getSeedingThresholds as getSeedingThresholds, index$9_getSeedsCount as getSeedsCount, index$9_getStructureSeedAssignments as getStructureSeedAssignments, index$9_getTeamLineUp as getTeamLineUp, index$9_getTieFormat as getTieFormat, index$9_getTimeItem as getTimeItem, index$9_getTournamentIds as getTournamentIds, index$9_getTournamentInfo as getTournamentInfo, index$9_getTournamentPenalties as getTournamentPenalties, index$9_getTournamentPersons as getTournamentPersons, index$9_getTournamentPoints as getTournamentPoints, index$9_getTournamentPublishStatus as getTournamentPublishStatus, index$9_getTournamentStructures as getTournamentStructures, index$9_getTournamentTimeItem as getTournamentTimeItem, index$9_getValidGroupSizes as getValidGroupSizes, index$9_getVenueData as getVenueData, index$9_getVenuesAndCourts as getVenuesAndCourts, index$9_isAdHoc as isAdHoc, index$9_isCompletedStructure as isCompletedStructure, index$9_isValidForQualifying as isValidForQualifying, index$9_isValidMatchUpFormat as isValidMatchUpFormat, index$9_matchUpActions as matchUpActions, index$9_participantScaleItem as participantScaleItem, index$9_participantScheduledMatchUps as participantScheduledMatchUps, index$9_positionActions as positionActions, index$9_publicFindCourt as publicFindCourt, index$9_publicFindVenue as publicFindVenue, index$9_tallyParticipantResults as tallyParticipantResults, index$9_tieFormatGenderValidityCheck as tieFormatGenderValidityCheck, index$9_tournamentMatchUps as tournamentMatchUps, index$9_validMatchUp as validMatchUp, index$9_validMatchUps as validMatchUps, index$9_validateCollectionDefinition as validateCollectionDefinition, index$9_validateLineUp as validateLineUp };
8006
8015
  }
8007
8016
 
8008
8017
  type StatCounters = {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  function factoryVersion() {
6
- return '2.2.24';
6
+ return '2.2.26';
7
7
  }
8
8
 
9
9
  const SINGLES_MATCHUP = 'SINGLES';
@@ -113,7 +113,7 @@ function stepRound(value, step) {
113
113
  function skewedDistribution(min, max, skew, step, significantDecimals = 2) {
114
114
  const u = 1 - Math.random();
115
115
  const v = 1 - Math.random();
116
- let num = Math.sqrt(-2.0 * Math.log(u)) * Math.cos(2.0 * Math.PI * v);
116
+ let num = Math.sqrt(-2 * Math.log(u)) * Math.cos(2.0 * Math.PI * v);
117
117
  num = num / 10.0 + 0.5;
118
118
  if (num > 1 || num < 0) {
119
119
  num = skewedDistribution(min, max, skew);
@@ -1462,7 +1462,7 @@ function addNotice$1({ topic, payload, key }, isGlobalSubscription) {
1462
1462
  return { ...SUCCESS };
1463
1463
  }
1464
1464
  function getMethods$1() {
1465
- return syncGlobalState.methods ?? {};
1465
+ return syncGlobalState.methods;
1466
1466
  }
1467
1467
  function getNotices$1({ topic }) {
1468
1468
  return syncGlobalState.notices.filter((notice) => notice.topic === topic).map((notice) => notice.payload);
@@ -2908,7 +2908,7 @@ function makeDeepCopy(sourceObject, convertExtensions, internalUse, removeExtens
2908
2908
  if (getProvider().makeDeepCopy)
2909
2909
  return getProvider().makeDeepCopy(sourceObject, convertExtensions, internalUse, removeExtensions);
2910
2910
  const deepCopy = deepCopyEnabled();
2911
- const { stringify, toJSON, ignore, modulate } = deepCopy || {};
2911
+ const { stringify, toJSON, ignore, modulate } = deepCopy;
2912
2912
  if ((!deepCopy?.enabled && !internalUse) ||
2913
2913
  typeof sourceObject !== 'object' ||
2914
2914
  isFunction(sourceObject) ||
@@ -5422,7 +5422,7 @@ function structureAssignedDrawPositions({ drawDefinition, structureId, structure
5422
5422
  const assignedPositions = positionAssignments?.filter((assignment) => {
5423
5423
  return assignment.participantId ?? assignment.bye ?? assignment.qualifier;
5424
5424
  });
5425
- const allPositionsAssigned = positionAssignments && positionAssignments?.length === assignedPositions?.length;
5425
+ const allPositionsAssigned = positionAssignments?.length === assignedPositions?.length;
5426
5426
  const unassignedPositions = positionAssignments?.filter((assignment) => {
5427
5427
  return !assignment.participantId && !assignment.bye && !assignment.qualifier;
5428
5428
  });
@@ -9093,7 +9093,7 @@ function getMatchUpParticipantIds({ matchUp }) {
9093
9093
  ?.map((side) => side.participant?.individualParticipants)
9094
9094
  .filter(Boolean) ?? [];
9095
9095
  const nestedIndividualParticipantIds = nestedIndividualParticipants.map((participants) => (participants ?? []).map((participant) => participant?.participantId).filter(Boolean));
9096
- const individualParticipantIds = [...sideIndividualParticipantIds, ...nestedIndividualParticipantIds.flat()].filter(Boolean) ?? [];
9096
+ const individualParticipantIds = [...sideIndividualParticipantIds, ...nestedIndividualParticipantIds.flat()].filter(Boolean);
9097
9097
  const allRelevantParticipantIds = unique(individualParticipantIds.concat(sideParticipantIds)).filter(Boolean) ?? [];
9098
9098
  return {
9099
9099
  nestedIndividualParticipantIds,
@@ -10954,7 +10954,7 @@ function getStructureMatchUps({ requireParticipants = true, scheduleVisibilityFi
10954
10954
  }
10955
10955
  if (matchUp.matchUpType === TEAM$2)
10956
10956
  includesTeamMatchUps = true;
10957
- const isCollectionMatchUp = matchUp.collectionId;
10957
+ const isCollectionMatchUp = Boolean(matchUp.collectionId);
10958
10958
  const collectionSidesAssigned = isCollectionMatchUp && matchUp.sides?.every((side) => side.participantId);
10959
10959
  const drawPositionsFilled = !isCollectionMatchUp && matchUp.drawPositions?.filter(Boolean).length === 2;
10960
10960
  const drawPositionsAssigned = !isCollectionMatchUp &&
@@ -12160,9 +12160,9 @@ function isActiveMatchUp({ matchUpStatus, winningSide, tieMatchUps, sides, score
12160
12160
  function getStructureDrawPositionProfiles(params) {
12161
12161
  const { drawDefinition, findContainer, structureId, event } = params;
12162
12162
  let structure = params.structure;
12163
- const matchUpFilters = { isCollectionMatchUp: false };
12164
12163
  const { containedStructures } = getContainedStructures({ drawDefinition });
12165
12164
  const containedStructureIds = structureId ? containedStructures[structureId] || [] : [];
12165
+ const matchUpFilters = { isCollectionMatchUp: false };
12166
12166
  if (!structure) {
12167
12167
  const result = findStructure({ drawDefinition, structureId });
12168
12168
  if (result.error)
@@ -12698,7 +12698,7 @@ function clearDrawPosition(params) {
12698
12698
  const positionAssignments = structureAssignedDrawPositions({
12699
12699
  drawDefinition,
12700
12700
  structure,
12701
- }).positionAssignments || [];
12701
+ }).positionAssignments;
12702
12702
  const existingAssignment = positionAssignments.find((assignment) => (participantId && assignment.participantId === participantId) ||
12703
12703
  (drawPosition && assignment.drawPosition === drawPosition));
12704
12704
  if (existingAssignment && participantId && !drawPosition) {
@@ -12749,7 +12749,7 @@ function drawPositionRemovals({ inContextDrawMatchUps, tournamentRecord, drawDef
12749
12749
  const positionAssignments = structureAssignedDrawPositions({
12750
12750
  drawDefinition,
12751
12751
  structure,
12752
- }).positionAssignments || [];
12752
+ }).positionAssignments;
12753
12753
  const drawPositionCleared = positionAssignments.some((assignment) => {
12754
12754
  if (assignment.drawPosition === drawPosition) {
12755
12755
  delete assignment.participantId;
@@ -19266,7 +19266,32 @@ function getSourceStructureIdsAndRelevantLinks({ targetRoundNumber, finishingPos
19266
19266
  return { sourceStructureIds, relevantLinks };
19267
19267
  }
19268
19268
 
19269
- function qualifierProgression({ targetRoundNumber = 1, tournamentRecord, drawDefinition, event, }) {
19269
+ const mapNumbersToIndexes = (indexArray, randNumberArray) => {
19270
+ const uniqueRandomList = [...new Set(randNumberArray.slice(0, indexArray.length))];
19271
+ const sortedRandomList = [...uniqueRandomList].sort((a, b) => a - b);
19272
+ const usedIndexes = new Set();
19273
+ const mappedNumbersToIndexes = [];
19274
+ uniqueRandomList.forEach((item) => {
19275
+ const randNumberIndex = indexArray.indexOf(item);
19276
+ if (randNumberIndex !== -1 && !usedIndexes.has(randNumberIndex)) {
19277
+ mappedNumbersToIndexes.push(randNumberIndex);
19278
+ usedIndexes.add(randNumberIndex);
19279
+ }
19280
+ else {
19281
+ const sortedIndex = sortedRandomList.indexOf(item);
19282
+ let nextAvailableIndex = indexArray.findIndex((_, i) => !usedIndexes.has(i));
19283
+ while (usedIndexes.has(nextAvailableIndex) && nextAvailableIndex === -1 && usedIndexes.size < indexArray.length) {
19284
+ nextAvailableIndex = indexArray.findIndex((_, i) => !usedIndexes.has(i) && i > nextAvailableIndex);
19285
+ }
19286
+ mappedNumbersToIndexes.push(sortedIndex);
19287
+ usedIndexes.add(sortedIndex);
19288
+ }
19289
+ });
19290
+ const remainingIndexes = indexArray.filter((_, index) => !usedIndexes.has(index));
19291
+ return [...mappedNumbersToIndexes, ...remainingIndexes];
19292
+ };
19293
+
19294
+ function qualifierProgression({ targetRoundNumber = 1, tournamentRecord, drawDefinition, event, randomList, }) {
19270
19295
  const paramsCheck = checkRequiredParameters({ drawDefinition, event, tournamentRecord }, [
19271
19296
  { [DRAW_DEFINITION]: true, [EVENT]: true, [TOURNAMENT_RECORD]: true },
19272
19297
  ]);
@@ -19280,22 +19305,26 @@ function qualifierProgression({ targetRoundNumber = 1, tournamentRecord, drawDef
19280
19305
  const appliedPolicies = getAppliedPolicies({ tournamentRecord, drawDefinition, structure: mainStructure, event }).appliedPolicies ?? {};
19281
19306
  const policy = appliedPolicies[POLICY_TYPE_POSITION_ACTIONS];
19282
19307
  const requireCompletedStructures = policy?.requireCompletedStructures;
19283
- const { qualifierPositions, positionAssignments } = structureAssignedDrawPositions({ structure: mainStructure });
19308
+ const { qualifierPositions, positionAssignments, } = structureAssignedDrawPositions({ structure: mainStructure });
19284
19309
  if (!qualifierPositions.length)
19285
19310
  return decorateResult({ result: { error: NO_DRAW_POSITIONS_AVAILABLE_FOR_QUALIFIERS } });
19311
+ let qualifierPositionIndexes = generateRange(0, qualifierPositions.length);
19312
+ if (randomList) {
19313
+ qualifierPositionIndexes = mapNumbersToIndexes(qualifierPositionIndexes, randomList);
19314
+ }
19286
19315
  const assignedParticipantIds = positionAssignments.map((assignment) => assignment.participantId).filter(Boolean);
19287
19316
  const { relevantLinks: eliminationSourceLinks } = getSourceStructureIdsAndRelevantLinks({
19288
19317
  structureId: mainStructure.structureId,
19289
19318
  targetRoundNumber,
19290
19319
  linkType: WINNER,
19291
19320
  drawDefinition,
19292
- }) || {};
19321
+ });
19293
19322
  const { relevantLinks: roundRobinSourceLinks } = getSourceStructureIdsAndRelevantLinks({
19294
19323
  structureId: mainStructure.structureId,
19295
19324
  targetRoundNumber,
19296
19325
  linkType: POSITION,
19297
19326
  drawDefinition,
19298
- }) || {};
19327
+ });
19299
19328
  for (const sourceLink of eliminationSourceLinks) {
19300
19329
  const structure = drawDefinition.structures?.find((structure) => structure.structureId === sourceLink.source.structureId);
19301
19330
  if (structure?.stage !== QUALIFYING)
@@ -19306,6 +19335,7 @@ function qualifierProgression({ targetRoundNumber = 1, tournamentRecord, drawDef
19306
19335
  const { matchUps } = getAllStructureMatchUps({
19307
19336
  matchUpFilters: {
19308
19337
  ...(qualifyingRoundNumber && { roundNumbers: [qualifyingRoundNumber] }),
19338
+ isCollectionMatchUp: false,
19309
19339
  hasWinningSide: true,
19310
19340
  },
19311
19341
  afterRecoveryTimes: false,
@@ -19348,18 +19378,19 @@ function qualifierProgression({ targetRoundNumber = 1, tournamentRecord, drawDef
19348
19378
  }
19349
19379
  if (!qualifyingParticipantIds.length)
19350
19380
  return decorateResult({ result: { error: MISSING_QUALIFIED_PARTICIPANTS } });
19351
- qualifierPositions.forEach((position) => {
19352
- const randomParticipantId = randomPop(qualifyingParticipantIds);
19353
- if (randomParticipantId) {
19381
+ qualifierPositionIndexes.forEach((positionIndex, index) => {
19382
+ const participantToAssign = qualifyingParticipantIds[index];
19383
+ const drawPosition = qualifierPositions[positionIndex].drawPosition;
19384
+ if (participantToAssign) {
19354
19385
  const positionAssignmentResult = qualifierDrawPositionAssignment({
19355
- qualifyingParticipantId: randomParticipantId,
19386
+ qualifyingParticipantId: participantToAssign,
19356
19387
  structureId: mainStructure.structureId,
19357
- drawPosition: position.drawPosition,
19388
+ drawPosition,
19358
19389
  tournamentRecord,
19359
19390
  drawDefinition,
19360
19391
  });
19361
19392
  positionAssignmentResult?.success &&
19362
- assignedParticipants.push({ participantId: randomParticipantId, drawPosition: position.drawPosition });
19393
+ assignedParticipants.push({ participantId: participantToAssign, drawPosition });
19363
19394
  }
19364
19395
  });
19365
19396
  return decorateResult({
@@ -22083,7 +22114,7 @@ function calculatePercentages({ participantResults, groupingTotal, matchUpFormat
22083
22114
  const setsLost = participantResults[participantId].setsLost;
22084
22115
  const setsTotal = tallyPolicy?.groupTotalSetsPlayed || groupingTotal === 'setsPct'
22085
22116
  ? totalSets
22086
- : perPlayer * (bracketSetsToWin || 0) || setsWon + setsLost;
22117
+ : perPlayer * (bracketSetsToWin) || setsWon + setsLost;
22087
22118
  let setsPct = Math.round((setsWon / setsTotal) * precision) / precision;
22088
22119
  if (setsPct === Infinity || isNaN(setsPct))
22089
22120
  setsPct = setsTotal;
@@ -22101,7 +22132,7 @@ function calculatePercentages({ participantResults, groupingTotal, matchUpFormat
22101
22132
  matchUpsPct = matchUpsWon;
22102
22133
  const gamesWon = participantResults[participantId].gamesWon || 0;
22103
22134
  const gamesLost = participantResults[participantId].gamesLost || 0;
22104
- const minimumExpectedGames = (perPlayer || 0) * (bracketSetsToWin || 0) * (bracketGamesForSet || 0);
22135
+ const minimumExpectedGames = (perPlayer || 0) * (bracketSetsToWin) * (bracketGamesForSet || 0);
22105
22136
  const gamesTotal = tallyPolicy?.groupTotalGamesPlayed || groupingTotal === 'gamesPct'
22106
22137
  ? totalGames
22107
22138
  : Math.max(minimumExpectedGames, gamesWon + gamesLost);
@@ -23529,7 +23560,7 @@ function updateTieMatchUpScore(params) {
23529
23560
  }) ||
23530
23561
  {};
23531
23562
  const tournamentId = params.tournamentId || params.tournamentRecord?.tournamentId;
23532
- tournamentRecords && findTournamentId({ tournamentRecords, ...params });
23563
+ findTournamentId({ tournamentRecords, ...params });
23533
23564
  const tournamentRecord = tournamentId && tournamentRecords[tournamentId];
23534
23565
  if (!tournamentRecord)
23535
23566
  return { error: MISSING_TOURNAMENT_RECORD };
@@ -26165,7 +26196,7 @@ function matchUpActions(params) {
26165
26196
  if (!structureId)
26166
26197
  return { validActions };
26167
26198
  const isAdHocMatchUp = isAdHoc({ structure });
26168
- const isCollectionMatchUp = matchUp.collectionId;
26199
+ const isCollectionMatchUp = Boolean(matchUp.collectionId);
26169
26200
  if (isAdHocMatchUp && !isCollectionMatchUp) {
26170
26201
  const adHocValidActions = adHocMatchUpActions({
26171
26202
  restrictAdHocRoundParticipants,
@@ -26498,7 +26529,7 @@ function getValidQualifiersAction({ drawPositionInitialRounds, tournamentPartici
26498
26529
  linkType: WINNER,
26499
26530
  drawDefinition,
26500
26531
  structureId,
26501
- }) || {};
26532
+ });
26502
26533
  if (eliminationSoureStructureIds?.length)
26503
26534
  sourceStructureIds.push(...eliminationSoureStructureIds);
26504
26535
  const { sourceStructureIds: roundRobinSourceStructureIds, relevantLinks: roundRobinSourceLinks } = getSourceStructureIdsAndRelevantLinks({
@@ -26506,7 +26537,7 @@ function getValidQualifiersAction({ drawPositionInitialRounds, tournamentPartici
26506
26537
  linkType: POSITION,
26507
26538
  drawDefinition,
26508
26539
  structureId,
26509
- }) || {};
26540
+ });
26510
26541
  if (roundRobinSourceStructureIds?.length)
26511
26542
  sourceStructureIds.push(...roundRobinSourceStructureIds);
26512
26543
  for (const sourceLink of eliminationSourceLinks) {
@@ -26522,6 +26553,7 @@ function getValidQualifiersAction({ drawPositionInitialRounds, tournamentPartici
26522
26553
  const { matchUps } = getAllStructureMatchUps({
26523
26554
  matchUpFilters: {
26524
26555
  roundNumbers: [qualifyingRoundNumber],
26556
+ isCollectionMatchUp: false,
26525
26557
  hasWinningSide: true,
26526
26558
  },
26527
26559
  afterRecoveryTimes: false,
@@ -26694,7 +26726,7 @@ function positionActions(params) {
26694
26726
  linkType: POSITION,
26695
26727
  drawDefinition,
26696
26728
  structureId,
26697
- }) || {};
26729
+ });
26698
26730
  let sourceStructuresComplete;
26699
26731
  if (positionSourceStructureIds?.length) {
26700
26732
  sourceStructuresComplete = positionSourceStructureIds.every((sourceStructureId) => isCompletedStructure({ structureId: sourceStructureId, drawDefinition }));
@@ -26986,6 +27018,33 @@ function getDrawTypeCoercion({ policyDefinitions, appliedPolicies, drawType }) {
26986
27018
  true);
26987
27019
  }
26988
27020
 
27021
+ const getRandomQualifierList = ({ drawDefinition }) => {
27022
+ const paramsCheck = checkRequiredParameters({ drawDefinition }, [{ [DRAW_DEFINITION]: true }]);
27023
+ if (paramsCheck.error)
27024
+ return paramsCheck;
27025
+ const mainStructure = drawDefinition.structures?.find((structure) => structure.stage === MAIN && structure.stageSequence === 1);
27026
+ if (!mainStructure)
27027
+ return decorateResult({ result: { error: MISSING_MAIN_STRUCTURE } });
27028
+ const { qualifierPositions, } = structureAssignedDrawPositions({ structure: mainStructure });
27029
+ return generateRange(0, qualifierPositions.length).sort(() => Math.random() - 0.5);
27030
+ };
27031
+
27032
+ function isValidForQualifying({ structureId, drawDefinition }) {
27033
+ if (!drawDefinition)
27034
+ return { error: MISSING_DRAW_DEFINITION };
27035
+ if (!isString(structureId))
27036
+ return { error: INVALID_VALUES };
27037
+ const result = getStructureLinks({
27038
+ drawDefinition,
27039
+ structureId,
27040
+ });
27041
+ if (result.error)
27042
+ return result;
27043
+ const targetFeedProfiles = result.links.target.flatMap((t) => t.target.feedProfile).filter(Boolean);
27044
+ const valid = !intersection([BOTTOM_UP, TOP_DOWN, RANDOM, WATERFALL], targetFeedProfiles).length;
27045
+ return { ...SUCCESS, valid };
27046
+ }
27047
+
26989
27048
  function getPositionAssignments({ tournamentRecord, drawDefinition, stage = MAIN, structureId, structure, }) {
26990
27049
  if (!tournamentRecord)
26991
27050
  return { error: MISSING_TOURNAMENT_RECORD };
@@ -27010,22 +27069,6 @@ function getPositionAssignments({ tournamentRecord, drawDefinition, stage = MAIN
27010
27069
  };
27011
27070
  }
27012
27071
 
27013
- function isValidForQualifying({ structureId, drawDefinition }) {
27014
- if (!drawDefinition)
27015
- return { error: MISSING_DRAW_DEFINITION };
27016
- if (!isString(structureId))
27017
- return { error: INVALID_VALUES };
27018
- const result = getStructureLinks({
27019
- drawDefinition,
27020
- structureId,
27021
- });
27022
- if (result.error)
27023
- return result;
27024
- const targetFeedProfiles = result.links.target.flatMap((t) => t.target.feedProfile).filter(Boolean);
27025
- const valid = !intersection([BOTTOM_UP, TOP_DOWN, RANDOM, WATERFALL], targetFeedProfiles).length;
27026
- return { ...SUCCESS, valid };
27027
- }
27028
-
27029
27072
  function getEliminationDrawSize({ participantsCount, participantCount, }) {
27030
27073
  participantsCount = participantsCount ?? participantCount;
27031
27074
  if (!participantsCount)
@@ -27189,6 +27232,7 @@ var query$b = {
27189
27232
  getParticipantIdFinishingPositions: getParticipantIdFinishingPositions,
27190
27233
  getPositionAssignments: getPositionAssignments,
27191
27234
  getPositionsPlayedOff: getPositionsPlayedOff,
27235
+ getRandomQualifierList: getRandomQualifierList,
27192
27236
  getSeedingThresholds: getSeedingThresholds,
27193
27237
  getSeedsCount: getSeedsCount,
27194
27238
  getStructureSeedAssignments: getStructureSeedAssignments,
@@ -27212,7 +27256,7 @@ function generateQualifyingStructures({ hasExistingDrawDefinition, qualifyingPro
27212
27256
  const structureProfiles = roundTargetProfile.structureProfiles || [];
27213
27257
  roundTarget = roundTargetProfile.roundTarget || roundTarget;
27214
27258
  let stageSequence = 1, targetRoundQualifiersCount = 0, finalQualifyingRoundNumber, finalQualifyingStructureId, linkType;
27215
- for (const structureProfile of (structureProfiles || []).sort(sequenceSort)) {
27259
+ for (const structureProfile of (structureProfiles).sort(sequenceSort)) {
27216
27260
  let drawSize = coerceEven(structureProfile.drawSize || structureProfile.participantsCount);
27217
27261
  const { qualifyingRoundNumber, structureOptions, matchUpFormat, structureName, structureId, drawType } = structureProfile;
27218
27262
  const matchUpType = structureProfile.matchUpType;
@@ -33209,7 +33253,7 @@ const definitionTemplate = () => ({
33209
33253
  });
33210
33254
 
33211
33255
  function newDrawDefinition(params) {
33212
- const { drawId = UUID(), processCodes, matchUpType, drawType } = params ?? {};
33256
+ const { drawId = UUID(), processCodes, matchUpType, drawType } = params;
33213
33257
  const drawDefinition = definitionTemplate();
33214
33258
  return Object.assign(drawDefinition, {
33215
33259
  processCodes,
@@ -33992,8 +34036,7 @@ function getTournamentInfo(params) {
33992
34036
  for (const event of tournamentRecord.events ?? []) {
33993
34037
  if (!params?.usePublishState || publishedEventIds.includes(event.eventId)) {
33994
34038
  const info = extractEventInfo({ event }).eventInfo;
33995
- if (info)
33996
- eventInfo.push(info);
34039
+ eventInfo.push(info);
33997
34040
  }
33998
34041
  }
33999
34042
  tournamentInfo.timeItemValues = getTimeItemValues({ element: tournamentRecord });
@@ -38204,6 +38247,7 @@ var index$f = {
38204
38247
  getPredictiveAccuracy: getPredictiveAccuracy,
38205
38248
  getProfileRounds: getProfileRounds,
38206
38249
  getPublishState: getPublishState,
38250
+ getRandomQualifierList: getRandomQualifierList,
38207
38251
  getRoundMatchUps: getRoundMatchUps,
38208
38252
  getRounds: getRounds,
38209
38253
  getScaleValues: getScaleValues,
@@ -38543,6 +38587,7 @@ var index$e = {
38543
38587
  getParticipantIdFinishingPositions: getParticipantIdFinishingPositions,
38544
38588
  getPositionAssignments: getPositionAssignments,
38545
38589
  getPositionsPlayedOff: getPositionsPlayedOff,
38590
+ getRandomQualifierList: getRandomQualifierList,
38546
38591
  getSeedingThresholds: getSeedingThresholds,
38547
38592
  getSeedsCount: getSeedsCount,
38548
38593
  getStructureSeedAssignments: getStructureSeedAssignments,
@@ -49315,10 +49360,10 @@ function genRatings(params) {
49315
49360
  const { categoryName, ageCategoryCode, ratingType } = category;
49316
49361
  const scaleName = category.categoryName || category.ratingType || category.ageCategoryCode;
49317
49362
  if ((categoryName || ageCategoryCode) && !ratingType) {
49318
- const [start, end] = rankingRange || [];
49363
+ const [start, end] = rankingRange;
49319
49364
  singlesRankings[scaleName] = shuffleArray(generateRange(start, end)).slice(0, scaledParticipantsCount || randomInt(20, 30));
49320
49365
  if ([PAIR, TEAM].includes(participantType)) {
49321
- const [start, end] = rankingRange || [];
49366
+ const [start, end] = rankingRange;
49322
49367
  doublesRankings[scaleName] = shuffleArray(generateRange(start, end)).slice(0, scaledParticipantsCount || randomInt(20, 30));
49323
49368
  }
49324
49369
  }
@@ -53945,12 +53990,12 @@ function getStructureReports(params) {
53945
53990
  participant: individualParticipants?.[0] || winningParticipant,
53946
53991
  eventType,
53947
53992
  });
53948
- const { personId: winningPersonId, personOtherId: winningPersonOtherId, tennisId: winningPersonTennisId, confidence: confidence1, wtnRating: wtnRating1, } = winningPersonWTN || {};
53993
+ const { personId: winningPersonId, personOtherId: winningPersonOtherId, tennisId: winningPersonTennisId, confidence: confidence1, wtnRating: wtnRating1, } = winningPersonWTN;
53949
53994
  const winningPerson2WTN = getDetailsWTN({
53950
53995
  participant: individualParticipants?.[1],
53951
53996
  eventType,
53952
53997
  });
53953
- const { personId: winningPerson2Id, personOtherId: winningPerson2OtherId, tennisId: winningPerson2TennisId, confidence: confidence2, wtnRating: wtnRating2, } = winningPerson2WTN || {};
53998
+ const { personId: winningPerson2Id, personOtherId: winningPerson2OtherId, tennisId: winningPerson2TennisId, confidence: confidence2, wtnRating: wtnRating2, } = winningPerson2WTN;
53954
53999
  const { ageCategoryCode, categoryName, subType } = category ?? {};
53955
54000
  const matchUpFormat = s.matchUpFormat || drawMatchUpFormat;
53956
54001
  const matchUpsInitialFormat = matchUpFormatCounts[matchUpFormat] || 0;