courthive-components 0.8.1 → 0.8.2

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.
@@ -1,4 +1,4 @@
1
- var BS, Nt = "colors", si = "sizes", fe = "space", g0 = { gap: fe, gridGap: fe, columnGap: fe, gridColumnGap: fe, rowGap: fe, gridRowGap: fe, inset: fe, insetBlock: fe, insetBlockEnd: fe, insetBlockStart: fe, insetInline: fe, insetInlineEnd: fe, insetInlineStart: fe, margin: fe, marginTop: fe, marginRight: fe, marginBottom: fe, marginLeft: fe, marginBlock: fe, marginBlockEnd: fe, marginBlockStart: fe, marginInline: fe, marginInlineEnd: fe, marginInlineStart: fe, padding: fe, paddingTop: fe, paddingRight: fe, paddingBottom: fe, paddingLeft: fe, paddingBlock: fe, paddingBlockEnd: fe, paddingBlockStart: fe, paddingInline: fe, paddingInlineEnd: fe, paddingInlineStart: fe, top: fe, right: fe, bottom: fe, left: fe, scrollMargin: fe, scrollMarginTop: fe, scrollMarginRight: fe, scrollMarginBottom: fe, scrollMarginLeft: fe, scrollMarginX: fe, scrollMarginY: fe, scrollMarginBlock: fe, scrollMarginBlockEnd: fe, scrollMarginBlockStart: fe, scrollMarginInline: fe, scrollMarginInlineEnd: fe, scrollMarginInlineStart: fe, scrollPadding: fe, scrollPaddingTop: fe, scrollPaddingRight: fe, scrollPaddingBottom: fe, scrollPaddingLeft: fe, scrollPaddingX: fe, scrollPaddingY: fe, scrollPaddingBlock: fe, scrollPaddingBlockEnd: fe, scrollPaddingBlockStart: fe, scrollPaddingInline: fe, scrollPaddingInlineEnd: fe, scrollPaddingInlineStart: fe, fontSize: "fontSizes", background: Nt, backgroundColor: Nt, backgroundImage: Nt, borderImage: Nt, border: Nt, borderBlock: Nt, borderBlockEnd: Nt, borderBlockStart: Nt, borderBottom: Nt, borderBottomColor: Nt, borderColor: Nt, borderInline: Nt, borderInlineEnd: Nt, borderInlineStart: Nt, borderLeft: Nt, borderLeftColor: Nt, borderRight: Nt, borderRightColor: Nt, borderTop: Nt, borderTopColor: Nt, caretColor: Nt, color: Nt, columnRuleColor: Nt, fill: Nt, outline: Nt, outlineColor: Nt, stroke: Nt, textDecorationColor: Nt, fontFamily: "fonts", fontWeight: "fontWeights", lineHeight: "lineHeights", letterSpacing: "letterSpacings", blockSize: si, minBlockSize: si, maxBlockSize: si, inlineSize: si, minInlineSize: si, maxInlineSize: si, width: si, minWidth: si, maxWidth: si, height: si, minHeight: si, maxHeight: si, flexBasis: si, gridTemplateColumns: si, gridTemplateRows: si, borderWidth: "borderWidths", borderTopWidth: "borderWidths", borderRightWidth: "borderWidths", borderBottomWidth: "borderWidths", borderLeftWidth: "borderWidths", borderStyle: "borderStyles", borderTopStyle: "borderStyles", borderRightStyle: "borderStyles", borderBottomStyle: "borderStyles", borderLeftStyle: "borderStyles", borderRadius: "radii", borderTopLeftRadius: "radii", borderTopRightRadius: "radii", borderBottomRightRadius: "radii", borderBottomLeftRadius: "radii", boxShadow: "shadows", textShadow: "shadows", transition: "transitions", zIndex: "zIndices" }, I0 = (e, t) => typeof t == "function" ? { "()": Function.prototype.toString.call(t) } : t, qu = () => {
1
+ var BS, Nt = "colors", si = "sizes", fe = "space", g0 = { gap: fe, gridGap: fe, columnGap: fe, gridColumnGap: fe, rowGap: fe, gridRowGap: fe, inset: fe, insetBlock: fe, insetBlockEnd: fe, insetBlockStart: fe, insetInline: fe, insetInlineEnd: fe, insetInlineStart: fe, margin: fe, marginTop: fe, marginRight: fe, marginBottom: fe, marginLeft: fe, marginBlock: fe, marginBlockEnd: fe, marginBlockStart: fe, marginInline: fe, marginInlineEnd: fe, marginInlineStart: fe, padding: fe, paddingTop: fe, paddingRight: fe, paddingBottom: fe, paddingLeft: fe, paddingBlock: fe, paddingBlockEnd: fe, paddingBlockStart: fe, paddingInline: fe, paddingInlineEnd: fe, paddingInlineStart: fe, top: fe, right: fe, bottom: fe, left: fe, scrollMargin: fe, scrollMarginTop: fe, scrollMarginRight: fe, scrollMarginBottom: fe, scrollMarginLeft: fe, scrollMarginX: fe, scrollMarginY: fe, scrollMarginBlock: fe, scrollMarginBlockEnd: fe, scrollMarginBlockStart: fe, scrollMarginInline: fe, scrollMarginInlineEnd: fe, scrollMarginInlineStart: fe, scrollPadding: fe, scrollPaddingTop: fe, scrollPaddingRight: fe, scrollPaddingBottom: fe, scrollPaddingLeft: fe, scrollPaddingX: fe, scrollPaddingY: fe, scrollPaddingBlock: fe, scrollPaddingBlockEnd: fe, scrollPaddingBlockStart: fe, scrollPaddingInline: fe, scrollPaddingInlineEnd: fe, scrollPaddingInlineStart: fe, fontSize: "fontSizes", background: Nt, backgroundColor: Nt, backgroundImage: Nt, borderImage: Nt, border: Nt, borderBlock: Nt, borderBlockEnd: Nt, borderBlockStart: Nt, borderBottom: Nt, borderBottomColor: Nt, borderColor: Nt, borderInline: Nt, borderInlineEnd: Nt, borderInlineStart: Nt, borderLeft: Nt, borderLeftColor: Nt, borderRight: Nt, borderRightColor: Nt, borderTop: Nt, borderTopColor: Nt, caretColor: Nt, color: Nt, columnRuleColor: Nt, fill: Nt, outline: Nt, outlineColor: Nt, stroke: Nt, textDecorationColor: Nt, fontFamily: "fonts", fontWeight: "fontWeights", lineHeight: "lineHeights", letterSpacing: "letterSpacings", blockSize: si, minBlockSize: si, maxBlockSize: si, inlineSize: si, minInlineSize: si, maxInlineSize: si, width: si, minWidth: si, maxWidth: si, height: si, minHeight: si, maxHeight: si, flexBasis: si, gridTemplateColumns: si, gridTemplateRows: si, borderWidth: "borderWidths", borderTopWidth: "borderWidths", borderRightWidth: "borderWidths", borderBottomWidth: "borderWidths", borderLeftWidth: "borderWidths", borderStyle: "borderStyles", borderTopStyle: "borderStyles", borderRightStyle: "borderStyles", borderBottomStyle: "borderStyles", borderLeftStyle: "borderStyles", borderRadius: "radii", borderTopLeftRadius: "radii", borderTopRightRadius: "radii", borderBottomRightRadius: "radii", borderBottomLeftRadius: "radii", boxShadow: "shadows", textShadow: "shadows", transition: "transitions", zIndex: "zIndices" }, I0 = (e, t) => typeof t == "function" ? { "()": Function.prototype.toString.call(t) } : t, Hu = () => {
2
2
  const e = /* @__PURE__ */ Object.create(null);
3
3
  return (t, r, ...i) => {
4
4
  const n = ((a) => JSON.stringify(a, I0))(t);
@@ -51,7 +51,7 @@ var BS, Nt = "colors", si = "sizes", fe = "space", g0 = { gap: fe, gridGap: fe,
51
51
  let i = r.length;
52
52
  for (; i; ) t = 33 * t ^ r.charCodeAt(--i);
53
53
  return t;
54
- })(5381, JSON.stringify(e)) >>> 0), Xc = ["themed", "global", "styled", "onevar", "resonevar", "allvar", "inline"], b0 = (e) => {
54
+ })(5381, JSON.stringify(e)) >>> 0), Qc = ["themed", "global", "styled", "onevar", "resonevar", "allvar", "inline"], b0 = (e) => {
55
55
  if (e.href && !e.href.startsWith(location.origin)) return !1;
56
56
  try {
57
57
  return !!e.cssRules;
@@ -92,7 +92,7 @@ var BS, Nt = "colors", si = "sizes", fe = "space", g0 = { gap: fe, gridGap: fe,
92
92
  ++c;
93
93
  const { cssText: p } = l;
94
94
  if (!p.startsWith("--sxs")) continue;
95
- const m = p.slice(14, -3).trim().split(/\s+/), f = Xc[m[0]];
95
+ const m = p.slice(14, -3).trim().split(/\s+/), f = Qc[m[0]];
96
96
  f && (t || (t = { sheet: o, reset: i, rules: {}, toString: r }), t.rules[f] = { group: d, index: c, cache: new Set(m) });
97
97
  }
98
98
  if (t) break;
@@ -106,10 +106,10 @@ var BS, Nt = "colors", si = "sizes", fe = "space", g0 = { gap: fe, gridGap: fe,
106
106
  t = { sheet: e ? (e.head || e).appendChild(document.createElement("style")).sheet : o("", "text/css"), rules: {}, reset: i, toString: r };
107
107
  }
108
108
  const { sheet: a, rules: s } = t;
109
- for (let o = Xc.length - 1; o >= 0; --o) {
110
- const c = Xc[o];
109
+ for (let o = Qc.length - 1; o >= 0; --o) {
110
+ const c = Qc[o];
111
111
  if (!s[c]) {
112
- const u = Xc[o + 1], l = s[u] ? s[u].index : a.cssRules.length;
112
+ const u = Qc[o + 1], l = s[u] ? s[u].index : a.cssRules.length;
113
113
  a.insertRule("@media{}", l), a.insertRule(`--sxs{--sxs:${o}}`, l), s[c] = { group: a.cssRules[l + 1], index: l, cache: /* @__PURE__ */ new Set([o]) };
114
114
  }
115
115
  R0(s[c]);
@@ -125,7 +125,7 @@ var BS, Nt = "colors", si = "sizes", fe = "space", g0 = { gap: fe, gridGap: fe,
125
125
  } catch {
126
126
  }
127
127
  };
128
- }, zc = /* @__PURE__ */ Symbol(), N0 = qu(), E0 = (e, t) => N0(e, (() => (...r) => {
128
+ }, zc = /* @__PURE__ */ Symbol(), N0 = Hu(), E0 = (e, t) => N0(e, (() => (...r) => {
129
129
  let i = { type: null, composers: /* @__PURE__ */ new Set() };
130
130
  for (const n of r) if (n != null) if (n[hd]) {
131
131
  i.type == null && (i.type = n[hd].type);
@@ -163,7 +163,7 @@ var BS, Nt = "colors", si = "sizes", fe = "space", g0 = { gap: fe, gridGap: fe,
163
163
  }
164
164
  return p[zc] = [], null;
165
165
  }
166
- return p[zc] = [], p.rules = {}, Xc.forEach(((m) => p.rules[m] = { apply: (f) => p[zc].push([m, f]) })), p;
166
+ return p[zc] = [], p.rules = {}, Qc.forEach(((m) => p.rules[m] = { apply: (f) => p[zc].push([m, f]) })), p;
167
167
  })(r) : null, c = (o || r).rules, u = `.${i}${n.length > 1 ? `:where(.${n.slice(1).join(".")})` : ""}`, l = (d) => {
168
168
  d = typeof d == "object" && d || k0;
169
169
  const { css: p, ...m } = d, f = {};
@@ -243,7 +243,7 @@ var BS, Nt = "colors", si = "sizes", fe = "space", g0 = { gap: fe, gridGap: fe,
243
243
  (n[u] = n[u] || []).push([i ? "cv" : `${c}-${a[c]}`, s, l]);
244
244
  }
245
245
  return n;
246
- }, k0 = {}, x0 = qu(), F0 = (e, t) => x0(e, (() => (...r) => {
246
+ }, k0 = {}, x0 = Hu(), F0 = (e, t) => x0(e, (() => (...r) => {
247
247
  const i = () => {
248
248
  for (let n of r) {
249
249
  n = typeof n == "object" && n || {};
@@ -262,7 +262,7 @@ var BS, Nt = "colors", si = "sizes", fe = "space", g0 = { gap: fe, gridGap: fe,
262
262
  return "";
263
263
  };
264
264
  return sg(i, { toString: i });
265
- })), L0 = qu(), _0 = (e, t) => L0(e, (() => (r) => {
265
+ })), L0 = Hu(), _0 = (e, t) => L0(e, (() => (r) => {
266
266
  const i = `${ha(e.prefix)}k-${Ps(r)}`, n = () => {
267
267
  if (!t.rules.global.cache.has(i)) {
268
268
  t.rules.global.cache.add(i);
@@ -289,7 +289,7 @@ var BS, Nt = "colors", si = "sizes", fe = "space", g0 = { gap: fe, gridGap: fe,
289
289
  toString() {
290
290
  return this.computedValue;
291
291
  }
292
- }, V0 = qu(), j0 = (e, t) => V0(e, (() => (r, i) => {
292
+ }, V0 = Hu(), j0 = (e, t) => V0(e, (() => (r, i) => {
293
293
  i = typeof r == "object" && r || Object(i);
294
294
  const n = `.${r = (r = typeof r == "string" ? r : "") || `${ha(e.prefix)}t-${Ps(i)}`}`, a = {}, s = [];
295
295
  for (const c in i) {
@@ -310,7 +310,7 @@ var BS, Nt = "colors", si = "sizes", fe = "space", g0 = { gap: fe, gridGap: fe,
310
310
  return { ...a, get className() {
311
311
  return o();
312
312
  }, selector: n, toString: o };
313
- })), G0 = qu(), Lw = (e) => {
313
+ })), G0 = Hu(), Lw = (e) => {
314
314
  let t = !1;
315
315
  const r = G0(e, ((i) => {
316
316
  t = !0;
@@ -741,7 +741,7 @@ function Dp() {
741
741
  var ug = {};
742
742
  Te(ug, { competitionGovernor: () => _w, drawsGovernor: () => OP, entriesGovernor: () => GN, eventGovernor: () => KN, generationGovernor: () => pE, matchUpFormatGovernor: () => up, matchUpGovernor: () => wE, mocksGovernor: () => sS, participantGovernor: () => hA, policyGovernor: () => mN, publishingGovernor: () => _A, queryGovernor: () => yN, reportGovernor: () => zA, scheduleGovernor: () => YA, scoreGovernor: () => Hy, tieFormatGovernor: () => sC, tournamentGovernor: () => hC, venueGovernor: () => NC });
743
743
  var _w = {};
744
- Te(_w, { getLinkedTournamentIds: () => ll, getTournamentIds: () => cl, linkTournaments: () => NP, mutate: () => Bw, query: () => CP, unlinkTournament: () => AP, unlinkTournaments: () => EP });
744
+ Te(_w, { getLinkedTournamentIds: () => dl, getTournamentIds: () => ul, linkTournaments: () => NP, mutate: () => Bw, query: () => CP, unlinkTournament: () => AP, unlinkTournaments: () => EP });
745
745
  var Bw = {};
746
746
  Te(Bw, { linkTournaments: () => NP, unlinkTournament: () => AP, unlinkTournaments: () => EP });
747
747
  var bs = "SINGLES", ze = "SINGLES", Wa = "DOUBLES", We = "DOUBLES", Jr = "TEAM", rt = "TEAM", h1 = { SINGLES_MATCHUP: bs, SINGLES: ze, DOUBLES_MATCHUP: Wa, DOUBLES: We, TEAM_MATCHUP: Jr, TEAM: rt }, Vw = { [ze]: [ze, "S"], [We]: [We, "D"], [rt]: [rt, "T"], S: [ze, "S"], D: [We, "D"], T: [rt, "T"] };
@@ -947,8 +947,8 @@ function Xw({ collectionValueProfiles: e, matchUpCount: t }) {
947
947
  return i.length !== ye(i).length ? (r.push("collectionPositions are not unique"), { errors: r }) : { ...x };
948
948
  }
949
949
  var E1 = {};
950
- Te(E1, { addNotice: () => Ue, callListener: () => Sh, createInstanceState: () => pO, cycleMutationStatus: () => jg, deepCopyEnabled: () => Vg, deleteNotice: () => Gg, deleteNotices: () => Zu, disableNotifications: () => cT, enableNotifications: () => Ud, getDevContext: () => ei, getMethods: () => dT, getNotices: () => pT, getProvider: () => vh, getTopics: () => fi, getTournamentId: () => Zs, getTournamentRecord: () => $g, getTournamentRecords: () => eo, globalLog: () => hT, handleCaughtError: () => Vp, hasTopic: () => _p, removeTournamentRecord: () => fT, setDeepCopy: () => gu, setDevContext: () => hu, setGlobalLog: () => oT, setGlobalMethods: () => uT, setGlobalSubscriptions: () => fO, setMethods: () => lT, setStateMethods: () => gT, setStateProvider: () => dO, setSubscriptions: () => hO, setTournamentId: () => Iu, setTournamentRecord: () => mT, setTournamentRecords: () => Bp, timeKeeper: () => mO });
951
- var dh = { message: "Chronological error; time violation.", code: "ANACHRONISM" }, mu = { message: "Duplicate entry", code: "DUPLICATE_ENTRY" }, Qw = { message: "Cannot remove main structure", code: "ERR_CANNOT_REMOVE_MAIN_STRUCTURE" }, ph = { message: "records must be an object with tournamentId keys", code: "ERR_INVALID_TOURNAMENTS" }, mt = { message: "Missing tournamentRecords", code: "ERR_MISSING_TOURNAMENTS" }, J = { message: "Missing tournamentRecord", code: "ERR_MISSING_TOURNAMENT" }, Hu = { message: "Invalid tournamentRecord", code: "ERR_INVALID_TOURNAMENT" }, $o = { message: "Missing tournamentId", code: "ERR_MISSING_TOURNAMENT_ID" }, Ms = { message: "Invalid drawDefinition", code: "ERR_INVALID_DRAWDEF" }, ne = { message: "Missing drawDefinition", code: "ERR_MISSING_DRAWDEF" }, Jw = { message: "Existing drawDefinition(s)", code: "ERR_EXISTING_DRAWDEFS" }, Zr = { message: "drawDefinition not found", code: "ERR_NOT_FOUND_DRAWDEF" }, as = { message: "Invalid structure", code: "ERR_INVALID_STRUCTURE" }, pg = { message: "Incomplete source structure", code: "ERR_INCOMPLETE_STRUCTURE" }, mg = { message: "Invalid drawPosition for seedAssignment", code: "ERR_INVALID_SEEDING_POSITION" }, Wo = { message: "drawPosition already assigned", code: "ERR_EXISTING_POSITION_ASSIGNMENT" }, Zw = { message: "Schedule not cleared", code: "ERR_UNCHANGED_SCHEDULE_NOT_CLEARED" }, eD = { message: "drawPosition not cleared", code: "ERR_FAILURE_POSITION_NOT_CLEARED" }, A1 = { message: "drawPosition not found", code: "ERR_NOT_FOUND_DRAW_POSITION" }, fg = { message: "Unrecognized drawType", code: "ERR_UNRECOGNIZED_DRAW_TYPE" }, zu = { message: "Missing drawPositions", code: "ERR_MISSING_DRAW_POSITIONS" }, Pp = { message: "drawPosition is active", code: "ERR_ACTIVE_DRAW_POSITION" }, C1 = { message: "drawPosition is occupied", code: "ERR_OCCUPIED_DRAW_POSITION" }, mc = { message: "Invlid drawPosition", code: "ERR_INVALID_DRAW_POSITION" }, fc = { message: "Missing drawPosition", code: "ERR_MISSING_DRAW_POSITION" }, hg = { message: "Invalid drawType", code: "ERR_INVALID_DRAW_TYPE" }, bp = { message: "Invalid drawSize", code: "ERR_INVALID_DRAW_SIZE" }, tD = { message: "Cannot set drawSize to be less than existing entries", code: "ERR_INVALID_DRAW_SIZE_MISMATCH" }, Yu = { message: "Missing drawSize", code: "ERR_MISSING_DRAW_SIZE" }, zi = { message: "Missing drawId", code: "ERR_MISSING_DRAW_ID" }, rD = { message: "drawId exists", code: "ERR_EXISTING_DRAW_ID" }, iD = { message: "participantId cannot be assigned to multiple seedNumbers", code: "INVALID_PARTICIPANT_SEEDING" }, nD = { message: "seedsCount greater than drawSize", code: "ERR_INVALID_SEED_COUNT" }, aD = { message: "Missing seedCountThresholds", code: "ERR_MISSING_SEED_COUNT_THRESHOLD" }, sD = { message: "Invalid action", code: "ERR_INVALID_ACTION" }, mh = { message: "Invalid assignment", code: "ERR_INVALID_ASSIGNMENT" }, oD = { message: "Missing seedAssignments", code: "ERR_MISSING_SEED_ASSIGNMENTS" }, cD = { message: "Invalid seedNumber", code: "ERR_INVALID_SEED_NUMBER" }, uD = { message: "Invalid seedPosition", code: "ERR_INVALID_SEED_POSITION" }, gg = { message: "Missing targetLink", code: "ERR_MISSING_LINK_TARGET" }, lD = { message: "Existing round", code: "ERR_EXISTING_ROUND" }, O1 = { message: "Missing roundNumber", code: "ERR_MISSING_ROUND_NUMBER" }, ri = { message: "Missing structureId", code: "ERR_MISSING_STRUCTURE_ID" }, lt = { message: "structure not found", code: "ERR_NOT_FOUND_STRUCTURE" }, Ig = { message: "Missing structures", code: "ERR_MISSING_STRUCTURES" }, ss = { message: "Missing structure", code: "ERR_MISSING_STRUCTURE" }, yg = { message: "Missing MAIN structure", code: "ERR_MISSING_MAIN_STRUCTURE" }, dD = { message: "drawDefinition contains unlinked structures", code: "ERR_MISSING_STRUCTURE_LINKS" }, Tn = { message: "Invalid eventType", code: "ERR_INVALID_EVENT_TYPE" }, it = { message: "Missing event / eventId", code: "ERR_MISSING_EVENT_ID" }, li = { message: "Event not found", code: "ERR_NOT_FOUND_EVENT" }, pD = { message: "Event exists", code: "ERR_EXISTING_EVENT" }, mD = { message: "Missing entries", code: "ERR_MISSING_ENTRIES" }, fD = { message: "Invalid entries", code: "ERR_INVALID_ENTRIES" }, Ug = { message: "Missing assignments", code: "ERR_MISSING_ASSIGNMENTS" }, hD = { message: "Missing stage", code: "ERR_MISSING_STAGE" }, os = { message: "Invalid stage", code: "ERR_INVALID_STAGE" }, gD = { message: "stageSequence limit", code: "ERR_LIMIT_STAGE_SEQUENCE" }, ID = { message: "Missing positionAssignments", code: "ERR_MISSING_POSITION_ASSIGNMENTS" }, yD = { message: "Cannot Assign BYE status if no assignment: { bye: true }", code: "ERR_UNCHANGED_CANNOT_ASSIGN_BYE" }, fh = { message: "Unrecognized matchUpStatus", code: "ERR_UNRECOGNIZED_MATCHUP_STATUS" }, Ku = { message: "Unrecognized matchUpFormat", code: "ERR_UNRECOGNIZED_MATCHUP_FORMAT" }, Id = { message: "Incompatible matchUpStatus", code: "ERR_INCOMPATIBLE_MATCHUP_STATUS" }, k1 = { message: "Propagated exits downstream", code: "ERR_PROPAGATED_EXITS_DOWNSTREAM" }, hc = { message: "Invalid matchUpStatus", code: "ERR_INVALID_MATCHUP_STATUS" }, In = { message: "Invalid tieFormat", code: "ERR_INVALID_TIE_FORMAT" }, Sg = { message: "Invalid matchUpFormat", code: "ERR_INVALID_MATCHUP_FORMAT" }, vg = { message: "Missing matchUpFormat", code: "ERR_MISSING_MATCHUP_FORMAT" }, UD = { message: "Missing collectionDefinition", code: "ERR_MISSING_COLLECTION_DEFINITION" }, gc = { message: "Missing tieFormat", code: "ERR_MISSING_TIE_FORMAT" }, hr = { message: "Missing matchUpId", code: "ERR_MISSING_MATCHUP_ID" }, Ys = { message: "Missing matchUpIds", code: "ERR_MISSING_MATCHUP_IDS" }, dr = { message: "matchUp not found", code: "ERR_NOT_FOUND_MATCHUP" }, ea = { message: "Missing matchUps", code: "ERR_MISSING_MATCHUPS" }, br = { message: "Missing matchUp", code: "ERR_MISSING_MATCHUP" }, xr = { message: "Invalid matchUp", code: "ERR_INVALID_MATCHUP" }, wg = { message: "Missing policyType", code: "ERR_MISSING_POLICY_TYPE" }, Mp = { message: "Missing policyDefinitions", code: "ERR_MISSING_POLICY_DEFINITIONS" }, x1 = { message: "Missing seeding policy", code: "ERR_MISSING_POLICY_SEEDING" }, SD = { message: "Missing avoidance policy", code: "ERR_MISSING_POLICY_AVOIDANCE" }, Dg = { message: "Missing policy attributes", code: "ERR_MISSING_POLICY_ATTRIBUTES" }, vD = { message: "Invalid policyDefinitions", code: "ERR_INVALID_POLICY_DEFINITIONS" }, Tg = { message: "existing policyType", code: "ERR_EXISTING_POLICY_TYPE" }, F1 = { message: "Policy not attached", code: "ERR_FAILURE_POLICY_NOT_ATTACHED" }, Xu = { message: "Policy not found", code: "ERR_NOT_FOUND_POLICY" }, L1 = { message: "Missing scoring policy / matchUpFormats", code: "ERR_MISSING_POLICY_SCORING_MATCHUP_FORMATS" }, Pg = { message: "Invalid sideNumber", code: "ERR_INVALID_SIDE_NUMBER" }, _1 = { message: "Invalid setNumber", code: "ERR_INVALID_SET_NUMBER" }, Rp = { message: "Missing setObject", code: "ERR_MISSING_SET_ATTRIBUTE" }, B1 = { message: "Missing setNumber", code: "ERR_MISSING_SET_NUMBER" }, V1 = { message: "Missing sideNumber", code: "ERR_MISSING_SIDE_NUMBER" }, Ks = { message: "Missing courtId", code: "ERR_MISSING_COURT_ID" }, ce = { message: "Missing value", code: "ERR_MISSING_VALUE" }, wD = { message: "Missing birthdate", code: "ERR_MISSING_BIRTH_DATE" }, DD = { message: "Missing date", code: "ERR_MISSING_DATE" }, TD = { message: "No valid dates", code: "ERR_NO_VALID_DATES" }, Ld = { message: "Invalid bookings", code: "ERR_INVALID_BOOKINGS" }, yd = { message: "Invalid dateAvailability", code: "ERR_INVALID_DATE_AVAILABILITY" }, PD = { message: "Missing dateAvailability", code: "ERR_MISSING_DATE_AVAILABILITY" }, Ht = { message: "Invalid Date", code: "ERR_INVALID_DATE" }, Si = { message: "Invalid time", code: "ERR_INVALID_TIME" }, bD = { message: "Invalid tournament dates", code: "ERR_INVALID_DATES_TOURNAMENT" }, hh = { message: "Invalid game scores", code: "ERR_INVALID_SCORES_GAME" }, MD = { message: "Invalid score", code: "ERR_INVALID_SCORE" }, Np = { message: "Invalid winningSide", code: "ERR_INVALID_WINNING_SIDE" }, j1 = { message: "No participants generated", code: "ERR_NO_PARTICIPANTS_GENERATED" }, bg = { message: "Cannot modify tieFormat", code: "ERR_UNCHANGED_CANNOT_MODIFY_TIEFORMAT" }, RD = { message: "Cannot modify participantType", code: "ERR_UNCHANGED_CANNOT_MODIFY_PARTICIPANT_TYPE" }, Ep = { message: "Cannot remove participants", code: "ERR_UNCHANGED_CANNOT_REMOVE_PARTICIPANTS" }, gh = { message: "Participant category mismatch", code: "ERR_CATEGORY_MISMATCH" }, Ap = { message: "Cannot change winningSide", code: "ERR_UNCHANGED_CANNOT_CHANGE_WINNING_SIDE" }, Xs = { message: "Invalid participant", code: "ERR_INVALID_PARTICIPANT" }, Wi = { message: "Invalid participantId", code: "ERR_INVALID_PARTICIPANT_ID" }, Gr = { message: "Invalid participantIds", code: "ERR_INVALID_PARTICIPANT_IDS" }, ND = { message: "Invalid participantRole", code: "ERR_INVALID_PARTICIPANT_ROLE" }, qi = { message: "Invalid participantType", code: "ERR_INVALID_PARTICIPANT_TYPE" }, ED = { message: "Missing participantRole", code: "ERR_MISSING_PARTICIPANT_ROLE" }, Qs = { message: "Missing participant", code: "ERR_MISSING_PARTICIPANT" }, Qu = { message: "Missing participants", code: "ERR_MISSING_PARTICIPANTS" }, kt = { message: "Missing participantId", code: "ERR_MISSING_PARTICIPANT_ID" }, AD = { message: "Missing qualified participants", code: "ERR_MISSING_QUALIFIED_PARTICIPANTS" }, Dt = { message: "Participant Not Found", code: "ERR_NOT_FOUND_PARTICIPANT" }, CD = { message: "participantId exists", code: "ERR_EXISTING_PARTICIPANT_ID" }, G1 = { message: "participant pair exists", code: "ERR_EXISTING_PARTICIPANT_PAIR" }, OD = { message: "No participant removed", code: "ERR_UNCHANGED_NO_PARTICIPANT_REMOVED" }, Pa = { message: "Missing participantIds", code: "ERR_MISSING_PARTICIPANT_IDS" }, kD = { message: "Missing participantsCount", code: "ERR_MISSING_PARTICIPANT_COUNT" }, xD = { message: "Participant not checked in", code: "ERR_UNCHANGED_PARTICIPANT_NOT_CHECKED_IN" }, FD = { message: "Missing person details", code: "ERR_MISSING_PERSON_DETAILS" }, Ic = { message: "Existing participant drawPosition assignment", code: "ERR_EXISTING_PARTICIPANT_DRAW_POSITION_ASSIGNMENT" }, Cp = { message: "Existing participant", code: "ERR_EXISTING_PARTICIPANT" }, Mg = { message: "participantsCount exceeds drawSize", code: "ERR_INVALID_PARTICIPANT_COUNT" }, Ih = { message: "Invalid entry status", code: "ERR_INVALID_ENTRY_STATUS" }, LD = { message: "Participant Entry Not Found", code: "ERR_NOT_FOUND_PARTICIPANT_ENTRY" }, $1 = { message: "Participant not entered in stage", code: "ERR_UNCHANGED_PARTICIPANT_NOT_ENTERED" }, W1 = { message: "Participant not found in stageSequence", code: "ERR_NOT_FOUND_PARTICIPANT_IN_STAGE" }, _D = { message: "entryStatus not allowed in stage", code: "ERR_INVALID_ENTRY_STATUS_IN_STAGE" }, BD = { message: "entryStatus not allowed for event", code: "ERR_INVALID_ENTRY_STATUS_IN_EVENT" }, yh = { message: "No stage space available for entryStatus", code: "ERR_UNCHANGED_NO_AVAILABLE_STAGE_SPACE" }, Rg = { message: "Insufficient drawPositions to accommodate qualifiers", code: "ERR_UNCHANGED_NO_DRAW_POSITIONS_FOR_QUALIFIERS" }, Ng = { message: "Insufficient drawPositions to accommodate entries", code: "ERR_INSUFFICIENT_DRAW_POSITIONS" }, VD = { message: "Missing penaltyType", code: "ERR_MISSING_PENALTY_TYPE" }, Eg = { message: "Missing penaltyId", code: "ERR_MISSING_PENALTY_ID" }, qo = { message: "Penalty not found", code: "ERR_NOT_FOUND_PENALTY" }, jD = { message: "Missing courtsCount/courtNames", code: "ERR_MISSING_COURTS_INFO" }, yc = { message: "Court not found", code: "ERR_NOT_FOUND_COURT" }, GD = { message: "Court exists", code: "ERR_EXISTING_COURT" }, $D = { message: "Venue exists", code: "ERR_EXISTING_VENUE" }, Js = { message: "Venue not found", code: "ERR_NOT_FOUND_VENUE" }, ba = { message: "Missing venueId", code: "ERR_MISSING_VENUE_ID" }, WD = { message: "Invalid endTime", code: "ERR_INVALID_END_TIME" }, Ag = { message: "Existing endTime", code: "ERR_EXISTING_END_TIME" }, qD = { message: "Invalid stopTime", code: "ERR_INVALID_STOP_TIME" }, HD = { message: "Invalid startTime", code: "ERR_INVALID_START_TIME" }, q1 = { message: "Invalid resumeTime", code: "ERR_INVALID_RESUME_TIME" }, Cg = { message: "Invalid timeItem", code: "ERR_INVALID_TIME_ITEMS" }, zD = { message: "Missing async state provider", code: "ERR_MISSING_ASYNC_STATE_PROVIDER" }, Og = { message: "Missing timeItem", code: "ERR_MISSING_TIME_ITEM" }, kg = { message: "Missing timeItems", code: "ERR_MISSING_TIME_ITEMS" }, Op = { message: "Missing context", code: "ERR_MISSING_CONTEXT" }, YD = { message: "Missing schedule", code: "ERR_MISSING_SCHEDULE" }, Fs = { message: "Invalid scaleItem", code: "ERR_INVALID_SCALE_ITEM" }, KD = { message: "Modifications failed", code: "ERR_FAILURE_MODIFICATIONS" }, Uc = { message: "No modifications applied", code: "ERR_UNCHANGED_NO_MODIFICATIONS_APPLIED" }, XD = { message: "Unable to assign court", code: "ERR_UNCHANGED_COURT_NOT_ASSIGNED" }, kp = { message: "No Candidates", code: "ERR_UNCHANGED_NO_CANDIDATES" }, QD = { message: "Invalid configuration", code: "ERR_INVALID_CONFIG" }, JD = { message: "Invalid collectionDefinition", code: "ERR_INVALID_COLLECTION_DEFINITION" }, ta = { message: "Invalid object", code: "ERR_INVALID_OBJECT" }, eu = { message: "Invalid gender", code: "ERR_INVALID_GENDER" }, fu = { message: "Invalid category", code: "ERR_INVALID_CATEGORY" }, z = { message: "Invalid values", code: "ERR_INVALID_VALUES" }, ZD = { message: "Duplicate value", code: "ERR_DUPLICATE_VALUE" }, xg = { message: "Team not found", code: "ERR_NOT_FOUND_TEAM" }, eT = { message: "No valid actions", code: "ERR_NO_VALID_ACTIONS" }, xp = { message: "No valid attributes", code: "ERR_NO_VALID_ATTRIBUTES" }, Fg = { message: "Value unchanged", code: "ABORT_UNCHANGED" }, Kt = { message: "Not found", code: "ERR_NOT_FOUND" }, Fp = { message: "Not implemented", code: "ERR_NOT_IMPLEMENTED" }, tT = { message: "Existing flight", code: "ERR_EXISTING_FLIGHT" }, Lg = { message: "Existing flight profile", code: "ERR_EXISTING_FLIGHT_PROFILE" }, rT = { message: "Existing outcome", code: "ERR_EXISTING_OUTCOME" }, iT = { message: "Existing matchUpId", code: "ERR_EXISTING_MATCHUP_ID" }, Uh = { message: "Existing stage", code: "ERR_EXISTING_STAGE" }, _g = { message: "Existing structure", code: "ERR_EXISTING_STRUCTURE" }, Lp = { message: "Method not found", code: "ERR_NOT_FOUND_METHOD" }, nT = { message: "Scheduled matchUps", code: "ERR_SCHEDULED_MATCHUPS" }, Ju = { message: "Scores present", code: "ERR_SCORES_PRESENT" }, H1 = { ANACHRONISM: dh, CANNOT_CHANGE_WINNING_SIDE: Ap, CANNOT_MODIFY_TIEFORMAT: bg, CANNOT_MODIFY_PARTICIPANT_TYPE: RD, CANNOT_REMOVE_MAIN_STRUCTURE: Qw, CANNOT_REMOVE_PARTICIPANTS: Ep, CATEGORY_MISMATCH: gh, COURT_EXISTS: GD, COURT_NOT_FOUND: yc, DRAW_DEFINITION_NOT_FOUND: Zr, DRAW_ID_EXISTS: rD, DRAW_POSITION_ACTIVE: Pp, DRAW_POSITION_ASSIGNED: Wo, DRAW_POSITION_NOT_CLEARED: eD, DRAW_POSITION_NOT_FOUND: A1, DRAW_SIZE_MISMATCH: tD, DUPLICATE_ENTRY: mu, DUPLICATE_VALUE: ZD, ENTRY_STATUS_NOT_ALLOWED_FOR_EVENT: BD, ENTRY_STATUS_NOT_ALLOWED_IN_STAGE: _D, EVENT_EXISTS: pD, EVENT_NOT_FOUND: li, EXISTING_DRAW_DEFINITIONS: Jw, EXISTING_END_TIME: Ag, EXISTING_FLIGHT: tT, EXISTING_MATCHUP_ID: iT, EXISTING_OUTCOME: rT, EXISTING_PARTICIPANT_DRAW_POSITION_ASSIGNMENT: Ic, EXISTING_PARTICIPANT: Cp, EXISTING_POLICY_TYPE: Tg, EXISTING_PROFILE: Lg, EXISTING_ROUND: lD, EXISTING_STAGE: Uh, EXISTING_STRUCTURE: _g, INCOMPATIBLE_MATCHUP_STATUS: Id, INCOMPLETE_SOURCE_STRUCTURE: pg, INSUFFICIENT_DRAW_POSITIONS: Ng, INVALID_ACTION: sD, INVALID_ASSIGNMENT: mh, INVALID_BOOKINGS: Ld, INVALID_CATEGORY: fu, INVALID_COLLECTION_DEFINITION: JD, INVALID_CONFIGURATION: QD, INVALID_DATE_AVAILABILITY: yd, INVALID_DATE: Ht, INVALID_DRAW_DEFINITION: Ms, INVALID_DRAW_POSITION_FOR_SEEDING: mg, INVALID_DRAW_POSITION: mc, INVALID_DRAW_SIZE: bp, INVALID_END_TIME: WD, INVALID_ENTRIES: fD, INVALID_EVENT_TYPE: Tn, INVALID_GAME_SCORES: hh, INVALID_GENDER: eu, INVALID_MATCHUP_FORMAT: Sg, INVALID_MATCHUP_STATUS: hc, INVALID_MATCHUP_STATUS_BYE: yD, INVALID_MATCHUP: xr, INVALID_OBJECT: ta, INVALID_PARTICIPANT_ID: Wi, INVALID_PARTICIPANT_IDS: Gr, INVALID_PARTICIPANT_ROLE: ND, INVALID_PARTICIPANT_SEEDING: iD, INVALID_PARTICIPANT_TYPE: qi, INVALID_PARTICIPANT: Xs, INVALID_POLICY_DEFINITION: vD, INVALID_RECORDS: ph, INVALID_SCALE_ITEM: Fs, INVALID_SEED_NUMBER: cD, INVALID_SEED_POSITION: uD, INVALID_SET_NUMBER: _1, INVALID_SIDE_NUMBER: Pg, INVALID_SCORE: MD, INVALID_STAGE: os, INVALID_START_TIME: HD, INVALID_STRUCTURE: as, INVALID_STOP_TIME: qD, INVALID_TIE_FORMAT: In, INVALID_TIME: Si, INVALID_TIME_ITEM: Cg, INVALID_TOURNAMENT_DATES: bD, INVALID_TOURNAMENT_RECORD: Hu, INVALID_VALUES: z, INVALID_WINNING_SIDE: Np, MATCHUP_NOT_FOUND: dr, METHOD_NOT_FOUND: Lp, MISSING_ASSIGNMENTS: Ug, MISSING_ASYNC_STATE_PROVIDER: zD, MISSING_AVOIDANCE_POLICY: SD, MISSING_BIRTH_DATE: wD, MISSING_COLLECTION_DEFINITION: UD, MISSING_COURT_ID: Ks, MISSING_COURTS_INFO: jD, MISSING_DATE_AVAILABILITY: PD, MISSING_DATE: DD, MISSING_DRAW_DEFINITION: ne, MISSING_DRAW_ID: zi, MISSING_DRAW_POSITION: fc, MISSING_DRAW_POSITIONS: zu, MISSING_DRAW_SIZE: Yu, MISSING_ENTRIES: mD, MISSING_EVENT: it, MISSING_QUALIFIED_PARTICIPANTS: AD, MISSING_MATCHUP_FORMAT: vg, MISSING_MATCHUP_ID: hr, MISSING_MATCHUP_IDS: Ys, MISSING_MATCHUP: br, MISSING_MATCHUPS: ea, MISSING_PARTICIPANT_COUNT: kD, MISSING_PARTICIPANT_ID: kt, MISSING_PARTICIPANT_IDS: Pa, MISSING_PARTICIPANT_ROLE: ED, MISSING_PARTICIPANT: Qs, MISSING_PARTICIPANTS: Qu, MISSING_PENALTY_ID: Eg, MISSING_PENALTY_TYPE: VD, MISSING_PERSON_DETAILS: FD, MISSING_POLICY_ATTRIBUTES: Dg, MISSING_POLICY_DEFINITION: Mp, MISSING_POLICY_TYPE: wg, MISSING_POSITION_ASSIGNMENTS: ID, MISSING_ROUND_NUMBER: O1, MISSING_SCHEDULE: YD, MISSING_SCORING_POLICY: L1, MISSING_SEED_ASSIGNMENTS: oD, MISSING_SEEDCOUNT_THRESHOLDS: aD, MISSING_SEEDING_POLICY: x1, MISSING_SET_NUMBER: B1, MISSING_SET_OBJECT: Rp, MISSING_SIDE_NUMBER: V1, MISSING_STAGE: hD, MISSING_STRUCTURE_ID: ri, MISSING_STRUCTURE: ss, MISSING_MAIN_STRUCTURE: yg, MISSING_STRUCTURES: Ig, MISSING_TARGET_LINK: gg, MISSING_TIE_FORMAT: gc, MISSING_TIME_ITEM: Og, MISSING_TIME_ITEMS: kg, MISSING_TOURNAMENT_ID: $o, MISSING_TOURNAMENT_RECORD: J, MISSING_TOURNAMENT_RECORDS: mt, MISSING_VALUE: ce, MISSING_VENUE_ID: ba, MODIFICATIONS_FAILED: KD, NO_CANDIDATES: kp, NO_DRAW_POSITIONS_AVAILABLE_FOR_QUALIFIERS: Rg, NO_MODIFICATIONS_APPLIED: Uc, NO_STAGE_SPACE_AVAILABLE_FOR_ENTRY_STATUS: yh, NO_PARTICIPANT_REMOVED: OD, NO_VALID_ACTIONS: eT, NO_VALID_ATTRIBUTES: xp, NO_VALID_DATES: TD, NOT_FOUND: Kt, NOT_IMPLEMENTED: Fp, PARTICIPANT_COUNT_EXCEEDS_DRAW_SIZE: Mg, PARTICIPANT_ID_EXISTS: CD, PARTICIPANT_NOT_CHECKED_IN: xD, PARTICIPANT_NOT_FOUND: Dt, PARTICIPANT_PAIR_EXISTS: G1, PENALTY_NOT_FOUND: qo, POLICY_NOT_ATTACHED: F1, POLICY_NOT_FOUND: Xu, SCHEDULE_NOT_CLEARED: Zw, SCHEDULED_MATCHUPS: nT, SCORES_PRESENT: Ju, SEEDSCOUNT_GREATER_THAN_DRAW_SIZE: nD, STAGE_SEQUENCE_LIMIT: gD, STRUCTURE_NOT_FOUND: lt, TEAM_NOT_FOUND: xg, UNABLE_TO_ASSIGN_COURT: XD, UNLINKED_STRUCTURES: dD, UNRECOGNIZED_DRAW_TYPE: fg, UNRECOGNIZED_MATCHUP_FORMAT: Ku, UNRECOGNIZED_MATCHUP_STATUS: fh, VALUE_UNCHANGED: Fg, VENUE_EXISTS: $D }, ut = { disableNotifications: !1, tournamentId: void 0, tournamentRecords: {}, subscriptions: {}, modified: !1, methods: {}, notices: [] }, aT = { addNotice: nO, callListener: uO, cycleMutationStatus: iO, deleteNotice: oO, deleteNotices: sO, disableNotifications: z1, enableNotifications: Y1, getMethods: Bg, getNotices: aO, getTopics: cO, getTournamentId: sT, getTournamentRecord: K1, getTournamentRecords: X1, removeTournamentRecord: eO, setMethods: rO, setSubscriptions: tO, setTournamentId: J1, setTournamentRecord: Q1, setTournamentRecords: Z1, handleCaughtError: lO };
950
+ Te(E1, { addNotice: () => Ue, callListener: () => Sh, createInstanceState: () => pO, cycleMutationStatus: () => jg, deepCopyEnabled: () => Vg, deleteNotice: () => Gg, deleteNotices: () => el, disableNotifications: () => cT, enableNotifications: () => Ud, getDevContext: () => ei, getMethods: () => dT, getNotices: () => pT, getProvider: () => vh, getTopics: () => fi, getTournamentId: () => Zs, getTournamentRecord: () => $g, getTournamentRecords: () => eo, globalLog: () => hT, handleCaughtError: () => Vp, hasTopic: () => _p, removeTournamentRecord: () => fT, setDeepCopy: () => Iu, setDevContext: () => gu, setGlobalLog: () => oT, setGlobalMethods: () => uT, setGlobalSubscriptions: () => fO, setMethods: () => lT, setStateMethods: () => gT, setStateProvider: () => dO, setSubscriptions: () => hO, setTournamentId: () => yu, setTournamentRecord: () => mT, setTournamentRecords: () => Bp, timeKeeper: () => mO });
951
+ var dh = { message: "Chronological error; time violation.", code: "ANACHRONISM" }, fu = { message: "Duplicate entry", code: "DUPLICATE_ENTRY" }, Qw = { message: "Cannot remove main structure", code: "ERR_CANNOT_REMOVE_MAIN_STRUCTURE" }, ph = { message: "records must be an object with tournamentId keys", code: "ERR_INVALID_TOURNAMENTS" }, mt = { message: "Missing tournamentRecords", code: "ERR_MISSING_TOURNAMENTS" }, J = { message: "Missing tournamentRecord", code: "ERR_MISSING_TOURNAMENT" }, zu = { message: "Invalid tournamentRecord", code: "ERR_INVALID_TOURNAMENT" }, $o = { message: "Missing tournamentId", code: "ERR_MISSING_TOURNAMENT_ID" }, Ms = { message: "Invalid drawDefinition", code: "ERR_INVALID_DRAWDEF" }, ne = { message: "Missing drawDefinition", code: "ERR_MISSING_DRAWDEF" }, Jw = { message: "Existing drawDefinition(s)", code: "ERR_EXISTING_DRAWDEFS" }, Zr = { message: "drawDefinition not found", code: "ERR_NOT_FOUND_DRAWDEF" }, as = { message: "Invalid structure", code: "ERR_INVALID_STRUCTURE" }, pg = { message: "Incomplete source structure", code: "ERR_INCOMPLETE_STRUCTURE" }, mg = { message: "Invalid drawPosition for seedAssignment", code: "ERR_INVALID_SEEDING_POSITION" }, Wo = { message: "drawPosition already assigned", code: "ERR_EXISTING_POSITION_ASSIGNMENT" }, Zw = { message: "Schedule not cleared", code: "ERR_UNCHANGED_SCHEDULE_NOT_CLEARED" }, eD = { message: "drawPosition not cleared", code: "ERR_FAILURE_POSITION_NOT_CLEARED" }, A1 = { message: "drawPosition not found", code: "ERR_NOT_FOUND_DRAW_POSITION" }, fg = { message: "Unrecognized drawType", code: "ERR_UNRECOGNIZED_DRAW_TYPE" }, Yu = { message: "Missing drawPositions", code: "ERR_MISSING_DRAW_POSITIONS" }, Pp = { message: "drawPosition is active", code: "ERR_ACTIVE_DRAW_POSITION" }, C1 = { message: "drawPosition is occupied", code: "ERR_OCCUPIED_DRAW_POSITION" }, mc = { message: "Invlid drawPosition", code: "ERR_INVALID_DRAW_POSITION" }, fc = { message: "Missing drawPosition", code: "ERR_MISSING_DRAW_POSITION" }, hg = { message: "Invalid drawType", code: "ERR_INVALID_DRAW_TYPE" }, bp = { message: "Invalid drawSize", code: "ERR_INVALID_DRAW_SIZE" }, tD = { message: "Cannot set drawSize to be less than existing entries", code: "ERR_INVALID_DRAW_SIZE_MISMATCH" }, Ku = { message: "Missing drawSize", code: "ERR_MISSING_DRAW_SIZE" }, zi = { message: "Missing drawId", code: "ERR_MISSING_DRAW_ID" }, rD = { message: "drawId exists", code: "ERR_EXISTING_DRAW_ID" }, iD = { message: "participantId cannot be assigned to multiple seedNumbers", code: "INVALID_PARTICIPANT_SEEDING" }, nD = { message: "seedsCount greater than drawSize", code: "ERR_INVALID_SEED_COUNT" }, aD = { message: "Missing seedCountThresholds", code: "ERR_MISSING_SEED_COUNT_THRESHOLD" }, sD = { message: "Invalid action", code: "ERR_INVALID_ACTION" }, mh = { message: "Invalid assignment", code: "ERR_INVALID_ASSIGNMENT" }, oD = { message: "Missing seedAssignments", code: "ERR_MISSING_SEED_ASSIGNMENTS" }, cD = { message: "Invalid seedNumber", code: "ERR_INVALID_SEED_NUMBER" }, uD = { message: "Invalid seedPosition", code: "ERR_INVALID_SEED_POSITION" }, gg = { message: "Missing targetLink", code: "ERR_MISSING_LINK_TARGET" }, lD = { message: "Existing round", code: "ERR_EXISTING_ROUND" }, O1 = { message: "Missing roundNumber", code: "ERR_MISSING_ROUND_NUMBER" }, ri = { message: "Missing structureId", code: "ERR_MISSING_STRUCTURE_ID" }, lt = { message: "structure not found", code: "ERR_NOT_FOUND_STRUCTURE" }, Ig = { message: "Missing structures", code: "ERR_MISSING_STRUCTURES" }, ss = { message: "Missing structure", code: "ERR_MISSING_STRUCTURE" }, yg = { message: "Missing MAIN structure", code: "ERR_MISSING_MAIN_STRUCTURE" }, dD = { message: "drawDefinition contains unlinked structures", code: "ERR_MISSING_STRUCTURE_LINKS" }, Tn = { message: "Invalid eventType", code: "ERR_INVALID_EVENT_TYPE" }, it = { message: "Missing event / eventId", code: "ERR_MISSING_EVENT_ID" }, li = { message: "Event not found", code: "ERR_NOT_FOUND_EVENT" }, pD = { message: "Event exists", code: "ERR_EXISTING_EVENT" }, mD = { message: "Missing entries", code: "ERR_MISSING_ENTRIES" }, fD = { message: "Invalid entries", code: "ERR_INVALID_ENTRIES" }, Ug = { message: "Missing assignments", code: "ERR_MISSING_ASSIGNMENTS" }, hD = { message: "Missing stage", code: "ERR_MISSING_STAGE" }, os = { message: "Invalid stage", code: "ERR_INVALID_STAGE" }, gD = { message: "stageSequence limit", code: "ERR_LIMIT_STAGE_SEQUENCE" }, ID = { message: "Missing positionAssignments", code: "ERR_MISSING_POSITION_ASSIGNMENTS" }, yD = { message: "Cannot Assign BYE status if no assignment: { bye: true }", code: "ERR_UNCHANGED_CANNOT_ASSIGN_BYE" }, fh = { message: "Unrecognized matchUpStatus", code: "ERR_UNRECOGNIZED_MATCHUP_STATUS" }, Xu = { message: "Unrecognized matchUpFormat", code: "ERR_UNRECOGNIZED_MATCHUP_FORMAT" }, Id = { message: "Incompatible matchUpStatus", code: "ERR_INCOMPATIBLE_MATCHUP_STATUS" }, k1 = { message: "Propagated exits downstream", code: "ERR_PROPAGATED_EXITS_DOWNSTREAM" }, hc = { message: "Invalid matchUpStatus", code: "ERR_INVALID_MATCHUP_STATUS" }, In = { message: "Invalid tieFormat", code: "ERR_INVALID_TIE_FORMAT" }, Sg = { message: "Invalid matchUpFormat", code: "ERR_INVALID_MATCHUP_FORMAT" }, vg = { message: "Missing matchUpFormat", code: "ERR_MISSING_MATCHUP_FORMAT" }, UD = { message: "Missing collectionDefinition", code: "ERR_MISSING_COLLECTION_DEFINITION" }, gc = { message: "Missing tieFormat", code: "ERR_MISSING_TIE_FORMAT" }, hr = { message: "Missing matchUpId", code: "ERR_MISSING_MATCHUP_ID" }, Ys = { message: "Missing matchUpIds", code: "ERR_MISSING_MATCHUP_IDS" }, dr = { message: "matchUp not found", code: "ERR_NOT_FOUND_MATCHUP" }, ea = { message: "Missing matchUps", code: "ERR_MISSING_MATCHUPS" }, br = { message: "Missing matchUp", code: "ERR_MISSING_MATCHUP" }, xr = { message: "Invalid matchUp", code: "ERR_INVALID_MATCHUP" }, wg = { message: "Missing policyType", code: "ERR_MISSING_POLICY_TYPE" }, Mp = { message: "Missing policyDefinitions", code: "ERR_MISSING_POLICY_DEFINITIONS" }, x1 = { message: "Missing seeding policy", code: "ERR_MISSING_POLICY_SEEDING" }, SD = { message: "Missing avoidance policy", code: "ERR_MISSING_POLICY_AVOIDANCE" }, Dg = { message: "Missing policy attributes", code: "ERR_MISSING_POLICY_ATTRIBUTES" }, vD = { message: "Invalid policyDefinitions", code: "ERR_INVALID_POLICY_DEFINITIONS" }, Tg = { message: "existing policyType", code: "ERR_EXISTING_POLICY_TYPE" }, F1 = { message: "Policy not attached", code: "ERR_FAILURE_POLICY_NOT_ATTACHED" }, Qu = { message: "Policy not found", code: "ERR_NOT_FOUND_POLICY" }, L1 = { message: "Missing scoring policy / matchUpFormats", code: "ERR_MISSING_POLICY_SCORING_MATCHUP_FORMATS" }, Pg = { message: "Invalid sideNumber", code: "ERR_INVALID_SIDE_NUMBER" }, _1 = { message: "Invalid setNumber", code: "ERR_INVALID_SET_NUMBER" }, Rp = { message: "Missing setObject", code: "ERR_MISSING_SET_ATTRIBUTE" }, B1 = { message: "Missing setNumber", code: "ERR_MISSING_SET_NUMBER" }, V1 = { message: "Missing sideNumber", code: "ERR_MISSING_SIDE_NUMBER" }, Ks = { message: "Missing courtId", code: "ERR_MISSING_COURT_ID" }, ce = { message: "Missing value", code: "ERR_MISSING_VALUE" }, wD = { message: "Missing birthdate", code: "ERR_MISSING_BIRTH_DATE" }, DD = { message: "Missing date", code: "ERR_MISSING_DATE" }, TD = { message: "No valid dates", code: "ERR_NO_VALID_DATES" }, Ld = { message: "Invalid bookings", code: "ERR_INVALID_BOOKINGS" }, yd = { message: "Invalid dateAvailability", code: "ERR_INVALID_DATE_AVAILABILITY" }, PD = { message: "Missing dateAvailability", code: "ERR_MISSING_DATE_AVAILABILITY" }, Ht = { message: "Invalid Date", code: "ERR_INVALID_DATE" }, Si = { message: "Invalid time", code: "ERR_INVALID_TIME" }, bD = { message: "Invalid tournament dates", code: "ERR_INVALID_DATES_TOURNAMENT" }, hh = { message: "Invalid game scores", code: "ERR_INVALID_SCORES_GAME" }, MD = { message: "Invalid score", code: "ERR_INVALID_SCORE" }, Np = { message: "Invalid winningSide", code: "ERR_INVALID_WINNING_SIDE" }, j1 = { message: "No participants generated", code: "ERR_NO_PARTICIPANTS_GENERATED" }, bg = { message: "Cannot modify tieFormat", code: "ERR_UNCHANGED_CANNOT_MODIFY_TIEFORMAT" }, RD = { message: "Cannot modify participantType", code: "ERR_UNCHANGED_CANNOT_MODIFY_PARTICIPANT_TYPE" }, Ep = { message: "Cannot remove participants", code: "ERR_UNCHANGED_CANNOT_REMOVE_PARTICIPANTS" }, gh = { message: "Participant category mismatch", code: "ERR_CATEGORY_MISMATCH" }, Ap = { message: "Cannot change winningSide", code: "ERR_UNCHANGED_CANNOT_CHANGE_WINNING_SIDE" }, Xs = { message: "Invalid participant", code: "ERR_INVALID_PARTICIPANT" }, Wi = { message: "Invalid participantId", code: "ERR_INVALID_PARTICIPANT_ID" }, Gr = { message: "Invalid participantIds", code: "ERR_INVALID_PARTICIPANT_IDS" }, ND = { message: "Invalid participantRole", code: "ERR_INVALID_PARTICIPANT_ROLE" }, qi = { message: "Invalid participantType", code: "ERR_INVALID_PARTICIPANT_TYPE" }, ED = { message: "Missing participantRole", code: "ERR_MISSING_PARTICIPANT_ROLE" }, Qs = { message: "Missing participant", code: "ERR_MISSING_PARTICIPANT" }, Ju = { message: "Missing participants", code: "ERR_MISSING_PARTICIPANTS" }, kt = { message: "Missing participantId", code: "ERR_MISSING_PARTICIPANT_ID" }, AD = { message: "Missing qualified participants", code: "ERR_MISSING_QUALIFIED_PARTICIPANTS" }, Dt = { message: "Participant Not Found", code: "ERR_NOT_FOUND_PARTICIPANT" }, CD = { message: "participantId exists", code: "ERR_EXISTING_PARTICIPANT_ID" }, G1 = { message: "participant pair exists", code: "ERR_EXISTING_PARTICIPANT_PAIR" }, OD = { message: "No participant removed", code: "ERR_UNCHANGED_NO_PARTICIPANT_REMOVED" }, Pa = { message: "Missing participantIds", code: "ERR_MISSING_PARTICIPANT_IDS" }, kD = { message: "Missing participantsCount", code: "ERR_MISSING_PARTICIPANT_COUNT" }, xD = { message: "Participant not checked in", code: "ERR_UNCHANGED_PARTICIPANT_NOT_CHECKED_IN" }, FD = { message: "Missing person details", code: "ERR_MISSING_PERSON_DETAILS" }, Ic = { message: "Existing participant drawPosition assignment", code: "ERR_EXISTING_PARTICIPANT_DRAW_POSITION_ASSIGNMENT" }, Cp = { message: "Existing participant", code: "ERR_EXISTING_PARTICIPANT" }, Mg = { message: "participantsCount exceeds drawSize", code: "ERR_INVALID_PARTICIPANT_COUNT" }, Ih = { message: "Invalid entry status", code: "ERR_INVALID_ENTRY_STATUS" }, LD = { message: "Participant Entry Not Found", code: "ERR_NOT_FOUND_PARTICIPANT_ENTRY" }, $1 = { message: "Participant not entered in stage", code: "ERR_UNCHANGED_PARTICIPANT_NOT_ENTERED" }, W1 = { message: "Participant not found in stageSequence", code: "ERR_NOT_FOUND_PARTICIPANT_IN_STAGE" }, _D = { message: "entryStatus not allowed in stage", code: "ERR_INVALID_ENTRY_STATUS_IN_STAGE" }, BD = { message: "entryStatus not allowed for event", code: "ERR_INVALID_ENTRY_STATUS_IN_EVENT" }, yh = { message: "No stage space available for entryStatus", code: "ERR_UNCHANGED_NO_AVAILABLE_STAGE_SPACE" }, Rg = { message: "Insufficient drawPositions to accommodate qualifiers", code: "ERR_UNCHANGED_NO_DRAW_POSITIONS_FOR_QUALIFIERS" }, Ng = { message: "Insufficient drawPositions to accommodate entries", code: "ERR_INSUFFICIENT_DRAW_POSITIONS" }, VD = { message: "Missing penaltyType", code: "ERR_MISSING_PENALTY_TYPE" }, Eg = { message: "Missing penaltyId", code: "ERR_MISSING_PENALTY_ID" }, qo = { message: "Penalty not found", code: "ERR_NOT_FOUND_PENALTY" }, jD = { message: "Missing courtsCount/courtNames", code: "ERR_MISSING_COURTS_INFO" }, yc = { message: "Court not found", code: "ERR_NOT_FOUND_COURT" }, GD = { message: "Court exists", code: "ERR_EXISTING_COURT" }, $D = { message: "Venue exists", code: "ERR_EXISTING_VENUE" }, Js = { message: "Venue not found", code: "ERR_NOT_FOUND_VENUE" }, ba = { message: "Missing venueId", code: "ERR_MISSING_VENUE_ID" }, WD = { message: "Invalid endTime", code: "ERR_INVALID_END_TIME" }, Ag = { message: "Existing endTime", code: "ERR_EXISTING_END_TIME" }, qD = { message: "Invalid stopTime", code: "ERR_INVALID_STOP_TIME" }, HD = { message: "Invalid startTime", code: "ERR_INVALID_START_TIME" }, q1 = { message: "Invalid resumeTime", code: "ERR_INVALID_RESUME_TIME" }, Cg = { message: "Invalid timeItem", code: "ERR_INVALID_TIME_ITEMS" }, zD = { message: "Missing async state provider", code: "ERR_MISSING_ASYNC_STATE_PROVIDER" }, Og = { message: "Missing timeItem", code: "ERR_MISSING_TIME_ITEM" }, kg = { message: "Missing timeItems", code: "ERR_MISSING_TIME_ITEMS" }, Op = { message: "Missing context", code: "ERR_MISSING_CONTEXT" }, YD = { message: "Missing schedule", code: "ERR_MISSING_SCHEDULE" }, Fs = { message: "Invalid scaleItem", code: "ERR_INVALID_SCALE_ITEM" }, KD = { message: "Modifications failed", code: "ERR_FAILURE_MODIFICATIONS" }, Uc = { message: "No modifications applied", code: "ERR_UNCHANGED_NO_MODIFICATIONS_APPLIED" }, XD = { message: "Unable to assign court", code: "ERR_UNCHANGED_COURT_NOT_ASSIGNED" }, kp = { message: "No Candidates", code: "ERR_UNCHANGED_NO_CANDIDATES" }, QD = { message: "Invalid configuration", code: "ERR_INVALID_CONFIG" }, JD = { message: "Invalid collectionDefinition", code: "ERR_INVALID_COLLECTION_DEFINITION" }, ta = { message: "Invalid object", code: "ERR_INVALID_OBJECT" }, tu = { message: "Invalid gender", code: "ERR_INVALID_GENDER" }, hu = { message: "Invalid category", code: "ERR_INVALID_CATEGORY" }, z = { message: "Invalid values", code: "ERR_INVALID_VALUES" }, ZD = { message: "Duplicate value", code: "ERR_DUPLICATE_VALUE" }, xg = { message: "Team not found", code: "ERR_NOT_FOUND_TEAM" }, eT = { message: "No valid actions", code: "ERR_NO_VALID_ACTIONS" }, xp = { message: "No valid attributes", code: "ERR_NO_VALID_ATTRIBUTES" }, Fg = { message: "Value unchanged", code: "ABORT_UNCHANGED" }, Kt = { message: "Not found", code: "ERR_NOT_FOUND" }, Fp = { message: "Not implemented", code: "ERR_NOT_IMPLEMENTED" }, tT = { message: "Existing flight", code: "ERR_EXISTING_FLIGHT" }, Lg = { message: "Existing flight profile", code: "ERR_EXISTING_FLIGHT_PROFILE" }, rT = { message: "Existing outcome", code: "ERR_EXISTING_OUTCOME" }, iT = { message: "Existing matchUpId", code: "ERR_EXISTING_MATCHUP_ID" }, Uh = { message: "Existing stage", code: "ERR_EXISTING_STAGE" }, _g = { message: "Existing structure", code: "ERR_EXISTING_STRUCTURE" }, Lp = { message: "Method not found", code: "ERR_NOT_FOUND_METHOD" }, nT = { message: "Scheduled matchUps", code: "ERR_SCHEDULED_MATCHUPS" }, Zu = { message: "Scores present", code: "ERR_SCORES_PRESENT" }, H1 = { ANACHRONISM: dh, CANNOT_CHANGE_WINNING_SIDE: Ap, CANNOT_MODIFY_TIEFORMAT: bg, CANNOT_MODIFY_PARTICIPANT_TYPE: RD, CANNOT_REMOVE_MAIN_STRUCTURE: Qw, CANNOT_REMOVE_PARTICIPANTS: Ep, CATEGORY_MISMATCH: gh, COURT_EXISTS: GD, COURT_NOT_FOUND: yc, DRAW_DEFINITION_NOT_FOUND: Zr, DRAW_ID_EXISTS: rD, DRAW_POSITION_ACTIVE: Pp, DRAW_POSITION_ASSIGNED: Wo, DRAW_POSITION_NOT_CLEARED: eD, DRAW_POSITION_NOT_FOUND: A1, DRAW_SIZE_MISMATCH: tD, DUPLICATE_ENTRY: fu, DUPLICATE_VALUE: ZD, ENTRY_STATUS_NOT_ALLOWED_FOR_EVENT: BD, ENTRY_STATUS_NOT_ALLOWED_IN_STAGE: _D, EVENT_EXISTS: pD, EVENT_NOT_FOUND: li, EXISTING_DRAW_DEFINITIONS: Jw, EXISTING_END_TIME: Ag, EXISTING_FLIGHT: tT, EXISTING_MATCHUP_ID: iT, EXISTING_OUTCOME: rT, EXISTING_PARTICIPANT_DRAW_POSITION_ASSIGNMENT: Ic, EXISTING_PARTICIPANT: Cp, EXISTING_POLICY_TYPE: Tg, EXISTING_PROFILE: Lg, EXISTING_ROUND: lD, EXISTING_STAGE: Uh, EXISTING_STRUCTURE: _g, INCOMPATIBLE_MATCHUP_STATUS: Id, INCOMPLETE_SOURCE_STRUCTURE: pg, INSUFFICIENT_DRAW_POSITIONS: Ng, INVALID_ACTION: sD, INVALID_ASSIGNMENT: mh, INVALID_BOOKINGS: Ld, INVALID_CATEGORY: hu, INVALID_COLLECTION_DEFINITION: JD, INVALID_CONFIGURATION: QD, INVALID_DATE_AVAILABILITY: yd, INVALID_DATE: Ht, INVALID_DRAW_DEFINITION: Ms, INVALID_DRAW_POSITION_FOR_SEEDING: mg, INVALID_DRAW_POSITION: mc, INVALID_DRAW_SIZE: bp, INVALID_END_TIME: WD, INVALID_ENTRIES: fD, INVALID_EVENT_TYPE: Tn, INVALID_GAME_SCORES: hh, INVALID_GENDER: tu, INVALID_MATCHUP_FORMAT: Sg, INVALID_MATCHUP_STATUS: hc, INVALID_MATCHUP_STATUS_BYE: yD, INVALID_MATCHUP: xr, INVALID_OBJECT: ta, INVALID_PARTICIPANT_ID: Wi, INVALID_PARTICIPANT_IDS: Gr, INVALID_PARTICIPANT_ROLE: ND, INVALID_PARTICIPANT_SEEDING: iD, INVALID_PARTICIPANT_TYPE: qi, INVALID_PARTICIPANT: Xs, INVALID_POLICY_DEFINITION: vD, INVALID_RECORDS: ph, INVALID_SCALE_ITEM: Fs, INVALID_SEED_NUMBER: cD, INVALID_SEED_POSITION: uD, INVALID_SET_NUMBER: _1, INVALID_SIDE_NUMBER: Pg, INVALID_SCORE: MD, INVALID_STAGE: os, INVALID_START_TIME: HD, INVALID_STRUCTURE: as, INVALID_STOP_TIME: qD, INVALID_TIE_FORMAT: In, INVALID_TIME: Si, INVALID_TIME_ITEM: Cg, INVALID_TOURNAMENT_DATES: bD, INVALID_TOURNAMENT_RECORD: zu, INVALID_VALUES: z, INVALID_WINNING_SIDE: Np, MATCHUP_NOT_FOUND: dr, METHOD_NOT_FOUND: Lp, MISSING_ASSIGNMENTS: Ug, MISSING_ASYNC_STATE_PROVIDER: zD, MISSING_AVOIDANCE_POLICY: SD, MISSING_BIRTH_DATE: wD, MISSING_COLLECTION_DEFINITION: UD, MISSING_COURT_ID: Ks, MISSING_COURTS_INFO: jD, MISSING_DATE_AVAILABILITY: PD, MISSING_DATE: DD, MISSING_DRAW_DEFINITION: ne, MISSING_DRAW_ID: zi, MISSING_DRAW_POSITION: fc, MISSING_DRAW_POSITIONS: Yu, MISSING_DRAW_SIZE: Ku, MISSING_ENTRIES: mD, MISSING_EVENT: it, MISSING_QUALIFIED_PARTICIPANTS: AD, MISSING_MATCHUP_FORMAT: vg, MISSING_MATCHUP_ID: hr, MISSING_MATCHUP_IDS: Ys, MISSING_MATCHUP: br, MISSING_MATCHUPS: ea, MISSING_PARTICIPANT_COUNT: kD, MISSING_PARTICIPANT_ID: kt, MISSING_PARTICIPANT_IDS: Pa, MISSING_PARTICIPANT_ROLE: ED, MISSING_PARTICIPANT: Qs, MISSING_PARTICIPANTS: Ju, MISSING_PENALTY_ID: Eg, MISSING_PENALTY_TYPE: VD, MISSING_PERSON_DETAILS: FD, MISSING_POLICY_ATTRIBUTES: Dg, MISSING_POLICY_DEFINITION: Mp, MISSING_POLICY_TYPE: wg, MISSING_POSITION_ASSIGNMENTS: ID, MISSING_ROUND_NUMBER: O1, MISSING_SCHEDULE: YD, MISSING_SCORING_POLICY: L1, MISSING_SEED_ASSIGNMENTS: oD, MISSING_SEEDCOUNT_THRESHOLDS: aD, MISSING_SEEDING_POLICY: x1, MISSING_SET_NUMBER: B1, MISSING_SET_OBJECT: Rp, MISSING_SIDE_NUMBER: V1, MISSING_STAGE: hD, MISSING_STRUCTURE_ID: ri, MISSING_STRUCTURE: ss, MISSING_MAIN_STRUCTURE: yg, MISSING_STRUCTURES: Ig, MISSING_TARGET_LINK: gg, MISSING_TIE_FORMAT: gc, MISSING_TIME_ITEM: Og, MISSING_TIME_ITEMS: kg, MISSING_TOURNAMENT_ID: $o, MISSING_TOURNAMENT_RECORD: J, MISSING_TOURNAMENT_RECORDS: mt, MISSING_VALUE: ce, MISSING_VENUE_ID: ba, MODIFICATIONS_FAILED: KD, NO_CANDIDATES: kp, NO_DRAW_POSITIONS_AVAILABLE_FOR_QUALIFIERS: Rg, NO_MODIFICATIONS_APPLIED: Uc, NO_STAGE_SPACE_AVAILABLE_FOR_ENTRY_STATUS: yh, NO_PARTICIPANT_REMOVED: OD, NO_VALID_ACTIONS: eT, NO_VALID_ATTRIBUTES: xp, NO_VALID_DATES: TD, NOT_FOUND: Kt, NOT_IMPLEMENTED: Fp, PARTICIPANT_COUNT_EXCEEDS_DRAW_SIZE: Mg, PARTICIPANT_ID_EXISTS: CD, PARTICIPANT_NOT_CHECKED_IN: xD, PARTICIPANT_NOT_FOUND: Dt, PARTICIPANT_PAIR_EXISTS: G1, PENALTY_NOT_FOUND: qo, POLICY_NOT_ATTACHED: F1, POLICY_NOT_FOUND: Qu, SCHEDULE_NOT_CLEARED: Zw, SCHEDULED_MATCHUPS: nT, SCORES_PRESENT: Zu, SEEDSCOUNT_GREATER_THAN_DRAW_SIZE: nD, STAGE_SEQUENCE_LIMIT: gD, STRUCTURE_NOT_FOUND: lt, TEAM_NOT_FOUND: xg, UNABLE_TO_ASSIGN_COURT: XD, UNLINKED_STRUCTURES: dD, UNRECOGNIZED_DRAW_TYPE: fg, UNRECOGNIZED_MATCHUP_FORMAT: Xu, UNRECOGNIZED_MATCHUP_STATUS: fh, VALUE_UNCHANGED: Fg, VENUE_EXISTS: $D }, ut = { disableNotifications: !1, tournamentId: void 0, tournamentRecords: {}, subscriptions: {}, modified: !1, methods: {}, notices: [] }, aT = { addNotice: nO, callListener: uO, cycleMutationStatus: iO, deleteNotice: oO, deleteNotices: sO, disableNotifications: z1, enableNotifications: Y1, getMethods: Bg, getNotices: aO, getTopics: cO, getTournamentId: sT, getTournamentRecord: K1, getTournamentRecords: X1, removeTournamentRecord: eO, setMethods: rO, setSubscriptions: tO, setTournamentId: J1, setTournamentRecord: Q1, setTournamentRecords: Z1, handleCaughtError: lO };
952
952
  function z1() {
953
953
  ut.disableNotifications = !0;
954
954
  }
@@ -966,7 +966,7 @@ function X1() {
966
966
  }
967
967
  function Q1(e) {
968
968
  let t = e?.tournamentId;
969
- return t ? (ut.tournamentRecords[t] = e, { success: !0 }) : { error: Hu };
969
+ return t ? (ut.tournamentRecords[t] = e, { success: !0 }) : { error: zu };
970
970
  }
971
971
  function J1(e) {
972
972
  return e ? ut.tournamentRecords[e] ? (ut.tournamentId = e, { success: !0 }) : { error: J } : (ut.tournamentId = void 0, { success: !0 });
@@ -1065,7 +1065,7 @@ function mO(e = "reset", t = "default") {
1065
1065
  function oT(e) {
1066
1066
  Vr(e) ? Xe.globalLog = e : delete Xe.globalLog;
1067
1067
  }
1068
- function hu(e) {
1068
+ function gu(e) {
1069
1069
  Xe.devContext = e;
1070
1070
  }
1071
1071
  function cT() {
@@ -1074,7 +1074,7 @@ function cT() {
1074
1074
  function Ud() {
1075
1075
  Xt.enableNotifications();
1076
1076
  }
1077
- function gu(e, t) {
1077
+ function Iu(e, t) {
1078
1078
  typeof e == "boolean" && (Xe.deepCopy = e), typeof t == "object" && (Array.isArray(t.ignore) && (Xe.deepCopyAttributes.ignore = t.ignore), Array.isArray(t.toJSON) && (Xe.deepCopyAttributes.toJSON = t.toJSON), Array.isArray(t.stringify) && (Xe.deepCopyAttributes.stringify = t.stringify), t.threshold && (Xe.deepCopyAttributes.threshold = t.threshold));
1079
1079
  }
1080
1080
  function Vg() {
@@ -1113,7 +1113,7 @@ function pT(e) {
1113
1113
  function Gg({ key: e, topic: t }) {
1114
1114
  return Xt.deleteNotice({ key: e, topic: t });
1115
1115
  }
1116
- function Zu() {
1116
+ function el() {
1117
1117
  return Xt.deleteNotices();
1118
1118
  }
1119
1119
  function fi() {
@@ -1140,7 +1140,7 @@ function mT(e) {
1140
1140
  function Bp(e) {
1141
1141
  return Xt.setTournamentRecords(e);
1142
1142
  }
1143
- function Iu(e) {
1143
+ function yu(e) {
1144
1144
  return Xt.setTournamentId(e);
1145
1145
  }
1146
1146
  function fT(e) {
@@ -1213,13 +1213,13 @@ function rn(e) {
1213
1213
  var IO = "MIXED events can not contain mixed singles or { gender: ANY } collections", yO = "events with { gender: ANY } can not contain MIXED singles collections";
1214
1214
  function jp(e) {
1215
1215
  let t = "tieFormatGenderValidityCheck", { referenceGender: r, matchUpType: i, gender: n } = e;
1216
- return r && n && rn(r) && ur(r) !== ur(n) ? F({ result: { valid: !1, error: eu }, context: { gender: n }, stack: t }) : Qr(r) && (yn(n) || Qr(n) && i !== We) ? F({ result: { error: eu, valid: !1 }, info: IO, stack: t }) : yn(r) && Qr(n) && i !== We ? F({ result: { error: eu, valid: !1 }, info: yO, stack: t }) : { valid: !0 };
1216
+ return r && n && rn(r) && ur(r) !== ur(n) ? F({ result: { valid: !1, error: tu }, context: { gender: n }, stack: t }) : Qr(r) && (yn(n) || Qr(n) && i !== We) ? F({ result: { error: tu, valid: !1 }, info: IO, stack: t }) : yn(r) && Qr(n) && i !== We ? F({ result: { error: tu, valid: !1 }, info: yO, stack: t }) : { valid: !0 };
1217
1217
  }
1218
1218
  var UO = "normal", JS = "timed", SO = "final", qg = "NOAD", vO = { S: UO, F: SO };
1219
1219
  function Gp(e, t) {
1220
1220
  if ((e?.bestOf || e?.exactly) && e?.setFormat) return wO(e, t);
1221
1221
  }
1222
- function yu(e) {
1222
+ function Uu(e) {
1223
1223
  return !isNaN(Number(e)) && Number(e);
1224
1224
  }
1225
1225
  function IT(e) {
@@ -1227,7 +1227,7 @@ function IT(e) {
1227
1227
  return e.based && (t += e.based), e.modifier && (t += `@${e.modifier}`), t;
1228
1228
  }
1229
1229
  function wO(e, t) {
1230
- let r = yu(e.bestOf) || void 0, i = yu(e.exactly) || void 0, n = r || i;
1230
+ let r = Uu(e.bestOf) || void 0, i = Uu(e.exactly) || void 0, n = r || i;
1231
1231
  if (e.setFormat?.timed && e.simplified && n === 1) return IT(e.setFormat);
1232
1232
  let a = n && `SET${n}` || "", s = ZS(e.setFormat, t), o = s && `S:${s}` || "", c = ZS(e.finalSetFormat, t), u = n && n > 1 && c && s !== c && `F:${c}` || "";
1233
1233
  if (a && s) return [a, o, u].filter((l) => l).join("-");
@@ -1236,9 +1236,9 @@ function ZS(e, t) {
1236
1236
  if (typeof e == "object" && Object.keys(e).length) {
1237
1237
  if (e.timed) return IT(e);
1238
1238
  if (e.tiebreakSet) return ev(e.tiebreakSet);
1239
- let r = yu(e.setTo);
1239
+ let r = Uu(e.setTo);
1240
1240
  if (r) {
1241
- let i = e.NoAD && qg || "", n = ev(e.tiebreakFormat), a = n && `/${n}` || "", s = yu(e.tiebreakAt), o = s && (s !== r || t) && `@${s}` || "";
1241
+ let i = e.NoAD && qg || "", n = ev(e.tiebreakFormat), a = n && `/${n}` || "", s = Uu(e.tiebreakAt), o = s && (s !== r || t) && `@${s}` || "";
1242
1242
  if (n !== !1) return `${r}${i}${a}${o}`;
1243
1243
  }
1244
1244
  }
@@ -1246,7 +1246,7 @@ function ZS(e, t) {
1246
1246
  function ev(e) {
1247
1247
  if (e) {
1248
1248
  if (typeof e == "object" && !e.tiebreakTo) return "";
1249
- if (typeof e == "object" && yu(e.tiebreakTo)) {
1249
+ if (typeof e == "object" && Uu(e.tiebreakTo)) {
1250
1250
  let t = `TB${e.tiebreakTo}${e.NoAD ? qg : ""}`;
1251
1251
  return e.modifier && (t += `@${e.modifier}`), t;
1252
1252
  } else return !1;
@@ -1263,7 +1263,7 @@ function Dr(e) {
1263
1263
  }
1264
1264
  }
1265
1265
  function DO(e) {
1266
- let t = e.split("-"), r = el(t[0].slice(3)), i = r === 1 || r % 2 !== 0 ? r : void 0, n = r !== 1 && r % 2 === 0 ? r : void 0, a = t && tv(t[1]), s = t && tv(t[2]), o = a && a.timed || s && s.timed, c = i && i < 6 || o && n, u = !t[2] || s, l = a, d = ae({ setFormat: a, exactly: n, bestOf: i });
1266
+ let t = e.split("-"), r = tl(t[0].slice(3)), i = r === 1 || r % 2 !== 0 ? r : void 0, n = r !== 1 && r % 2 === 0 ? r : void 0, a = t && tv(t[1]), s = t && tv(t[2]), o = a && a.timed || s && s.timed, c = i && i < 6 || o && n, u = !t[2] || s, l = a, d = ae({ setFormat: a, exactly: n, bestOf: i });
1267
1267
  if (s && (d.finalSetFormat = s), c && l && u) return d;
1268
1268
  }
1269
1269
  function tv(e) {
@@ -1275,18 +1275,18 @@ function tv(e) {
1275
1275
  return f === !1 ? !1 : typeof f == "object" ? { tiebreakSet: f } : void 0;
1276
1276
  }
1277
1277
  if (i.startsWith("T")) return UT(i);
1278
- let n = e.match(/^[FS]:(\d+)([A-Za-z]*)/), a = n && ST(n[2]) || !1, s = !n?.[2] || a, o = n ? el(n[1]) : void 0, c = yT(i), u = c !== !1, l = u && c || o, d = rv(i.split("/")[1]), p = d !== !1, m = { setTo: o };
1278
+ let n = e.match(/^[FS]:(\d+)([A-Za-z]*)/), a = n && ST(n[2]) || !1, s = !n?.[2] || a, o = n ? tl(n[1]) : void 0, c = yT(i), u = c !== !1, l = u && c || o, d = rv(i.split("/")[1]), p = d !== !1, m = { setTo: o };
1279
1279
  return a && (m.NoAD = !0), d ? (m.tiebreakFormat = d, m.tiebreakAt = l) : m.noTiebreak = !0, o && s && p && u && m || !1;
1280
1280
  }
1281
1281
  }
1282
1282
  }
1283
1283
  function yT(e, t = !0) {
1284
1284
  let r = e?.indexOf("@") > 0 && e.split("@");
1285
- if (r) return (t ? el(r[1]) : r[1]) || !1;
1285
+ if (r) return (t ? tl(r[1]) : r[1]) || !1;
1286
1286
  }
1287
1287
  function rv(e) {
1288
1288
  if (e) if (e.startsWith("TB")) {
1289
- let t = yT(e, !1), r = e.match(/^TB(\d+)([A-Za-z]*)/), i = r?.[1], n = r && ST(r[2]), a = !r?.[2] || n, s = el(i);
1289
+ let t = yT(e, !1), r = e.match(/^TB(\d+)([A-Za-z]*)/), i = r?.[1], n = r && ST(r[2]), a = !r?.[2] || n, s = tl(i);
1290
1290
  if (s && a) {
1291
1291
  let o = { tiebreakTo: s };
1292
1292
  return t && typeof t == "string" && !Ie(t) && (o.modifier = t), n && (o.NoAD = !0), o;
@@ -1294,7 +1294,7 @@ function rv(e) {
1294
1294
  } else return !1;
1295
1295
  }
1296
1296
  function UT(e) {
1297
- let t = e.slice(1), r = t.match(/^(\d+)(@?[A-Za-z]*)/), i = el(r?.[1]);
1297
+ let t = e.slice(1), r = t.match(/^(\d+)(@?[A-Za-z]*)/), i = tl(r?.[1]);
1298
1298
  if (!i) return;
1299
1299
  let n = { timed: !0, minutes: i }, a = r?.[2], s = [void 0, "P", "G"].includes(a);
1300
1300
  if (a && !s) {
@@ -1306,7 +1306,7 @@ function UT(e) {
1306
1306
  function ST(e) {
1307
1307
  return e && e.indexOf(qg) >= 0;
1308
1308
  }
1309
- function el(e) {
1309
+ function tl(e) {
1310
1310
  return isNaN(Number(e)) ? 0 : Number(e);
1311
1311
  }
1312
1312
  function qr({ matchUpFormat: e }) {
@@ -1340,11 +1340,11 @@ function bO(e, t) {
1340
1340
  return (!t || t?.displaySeconds ? i + ":" + n + ":" + a : i + ":" + n).split(":").map(ci).join(":");
1341
1341
  }
1342
1342
  var Hg = (e) => {
1343
- let t = Uu(e) || qa(e) ? new Date(e) : /* @__PURE__ */ new Date(), r = t.getUTCMonth() + 1, i = r < 10 ? `0${r}` : `${r}`;
1343
+ let t = Su(e) || qa(e) ? new Date(e) : /* @__PURE__ */ new Date(), r = t.getUTCMonth() + 1, i = r < 10 ? `0${r}` : `${r}`;
1344
1344
  return `${t.getUTCFullYear()}-${ci(i)}-${ci(t.getUTCDate())}`;
1345
1345
  };
1346
1346
  function MO(e) {
1347
- let t = Uu(e) || qa(e) ? new Date(e) : /* @__PURE__ */ new Date();
1347
+ let t = Su(e) || qa(e) ? new Date(e) : /* @__PURE__ */ new Date();
1348
1348
  return Date.UTC(t.getFullYear(), t.getMonth(), t.getDate());
1349
1349
  }
1350
1350
  function Pi(e, t = "-", r = "YMD") {
@@ -1360,14 +1360,14 @@ function Vd(e) {
1360
1360
  function RO(e) {
1361
1361
  return Vd(e).getTime();
1362
1362
  }
1363
- function Uu(e) {
1363
+ function Su(e) {
1364
1364
  if (typeof e == "boolean") return !1;
1365
1365
  let t = e instanceof Date && e || !isNaN(e) && new Date(e) || !1;
1366
1366
  return t && !isNaN(t.valueOf());
1367
1367
  }
1368
1368
  function Ho(e, t) {
1369
1369
  if (!kr(e) || !kr(t)) return [];
1370
- let r = ve(e) + "T00:00", i = ve(t) + "T00:00", n = new Date(r), a = new Date(i), s = Uu(a) && Uu(n) && u(n, a), o = [], c = 0;
1370
+ let r = ve(e) + "T00:00", i = ve(t) + "T00:00", n = new Date(r), a = new Date(i), s = Su(a) && Su(n) && u(n, a), o = [], c = 0;
1371
1371
  if (s) {
1372
1372
  let l = n, d = l.getTime();
1373
1373
  for (; d <= a.getTime() && c < 300; ) c += 1, o.push(new Date(l)), d = l.setDate(l.getDate() + 1);
@@ -1405,7 +1405,7 @@ function nt(e) {
1405
1405
  function ve(e) {
1406
1406
  return qa(e) || nn.test(e) ? e.split("T")[0] : void 0;
1407
1407
  }
1408
- function Qc(e, t) {
1408
+ function Jc(e, t) {
1409
1409
  let r = new Date(e);
1410
1410
  return r.setDate(r.getDate() + t), ve(r.toISOString());
1411
1411
  }
@@ -1455,7 +1455,7 @@ function Mt(e, t = void 0) {
1455
1455
  let [r, i] = (e || "00:00").split(":").map(ci), n = Vd(t).setHours(r, i, 0, 0);
1456
1456
  return Vd(n);
1457
1457
  }
1458
- function tl(e, t, r = !0) {
1458
+ function rl(e, t, r = !0) {
1459
1459
  let i = new Date(e), n = (new Date(t).getTime() - i.getTime()) / 1e3 / 60;
1460
1460
  return r ? Math.abs(Math.round(n)) : Math.round(n);
1461
1461
  }
@@ -1476,15 +1476,15 @@ function Pn(e, t) {
1476
1476
  let r = new Date(e), i = new Date(t);
1477
1477
  return r.getFullYear() === i.getFullYear() && r.getMonth() === i.getMonth() && r.getDate() === i.getDate();
1478
1478
  }
1479
- var DT = { addDays: Yg, addWeek: OO, addMinutesToTimeString: Or, convertTime: ro, getIsoDateString: Bd, getUTCdateString: Hg, DateHHMM: PO, extractDate: ve, extractTime: nt, formatDate: Pi, getDateByWeek: kO, isISODateString: qa, isDate: Uu, isTimeString: zg, offsetDate: Vd, offsetTime: RO, sameDay: Pn, timeStringMinutes: ke, timeToDate: Mt, timeUTC: MO, validTimeValue: Sc, validDateString: _d, timeValidation: Ba, dateValidation: nn }, FO = (e, t) => e.filter(Boolean).every((r) => typeof r === t), LO = (e) => e.filter(Boolean).every(ft);
1479
+ var DT = { addDays: Yg, addWeek: OO, addMinutesToTimeString: Or, convertTime: ro, getIsoDateString: Bd, getUTCdateString: Hg, DateHHMM: PO, extractDate: ve, extractTime: nt, formatDate: Pi, getDateByWeek: kO, isISODateString: qa, isDate: Su, isTimeString: zg, offsetDate: Vd, offsetTime: RO, sameDay: Pn, timeStringMinutes: ke, timeToDate: Mt, timeUTC: MO, validTimeValue: Sc, validDateString: _d, timeValidation: Ba, dateValidation: nn }, FO = (e, t) => e.filter(Boolean).every((r) => typeof r === t), LO = (e) => e.filter(Boolean).every(ft);
1480
1480
  function Ls(e) {
1481
1481
  let t = e.category;
1482
- if (typeof t != "object") return { error: fu };
1482
+ if (typeof t != "object") return { error: hu };
1483
1483
  let { ageCategoryCode: r, ageMaxDate: i, ageMinDate: n, ageMax: a, ageMin: s } = t, o = t.categoryName, c;
1484
- if (!(FO([r, i, n, o], "string") && LO([a, s]) && [i, n].filter(Boolean).every(kr))) return { error: fu };
1484
+ if (!(FO([r, i, n, o], "string") && LO([a, s]) && [i, n].filter(Boolean).every(kr))) return { error: hu };
1485
1485
  let u = e.consideredDate ?? ve((/* @__PURE__ */ new Date()).toLocaleDateString("sv"));
1486
1486
  if (!kr(u)) return { error: Ht };
1487
- let [l] = u.split("-").slice(0, 3).map((L) => parseInt(L)), d = Qc(u, -1), [p, m] = d.split("-").slice(1, 3).map((L) => parseInt(L)), f = `${ci(p)}-${ci(m)}`, h = Qc(u, 1), [g, I] = h.split("-").slice(1, 3).map((L) => parseInt(L)), y = `${ci(g)}-${ci(I)}`, U = s && Qc(u, -1 * 365 * s), D = a && Qc(u, -1 * 365 * a), v = [], w = (L) => !v.includes(L) && v.push(L);
1487
+ let [l] = u.split("-").slice(0, 3).map((L) => parseInt(L)), d = Jc(u, -1), [p, m] = d.split("-").slice(1, 3).map((L) => parseInt(L)), f = `${ci(p)}-${ci(m)}`, h = Jc(u, 1), [g, I] = h.split("-").slice(1, 3).map((L) => parseInt(L)), y = `${ci(g)}-${ci(I)}`, U = s && Jc(u, -1 * 365 * s), D = a && Jc(u, -1 * 365 * a), v = [], w = (L) => !v.includes(L) && v.push(L);
1488
1488
  r = r ?? o;
1489
1489
  let S = /^([UO]?)(\d{1,2})([UO]?)$/, T = /^C(\d{1,2})-(\d{1,2})$/, b = r?.includes("-"), P = b && r?.match(T), M = r?.match(S), R = (L, _) => `${L}-${_}`, E = (L) => {
1490
1490
  let _ = l - L, B = R(_, y);
@@ -1518,18 +1518,18 @@ function Ls(e) {
1518
1518
  let O = ae({ consideredDate: u, combinedAge: c, ageMaxDate: i, ageMinDate: n, ageMax: a, ageMin: s });
1519
1519
  return v.length && (O.errors = v), O;
1520
1520
  }
1521
- function Su({ category: e }) {
1521
+ function vu({ category: e }) {
1522
1522
  if (!Ce(e)) return { error: z };
1523
1523
  let t = Ls({ category: e });
1524
1524
  if (t.error) return { error: t };
1525
1525
  let { ratingMax: r, ratingMin: i } = e;
1526
1526
  return r && !ft(r) ? F({ result: { error: z }, context: { ratingMax: r } }) : i && !ft(i) ? F({ result: { error: z }, context: { ratingMin: i } }) : { ...t };
1527
1527
  }
1528
- function rl({ childCategory: e, withDetails: t, category: r }) {
1529
- let i = Su({ category: r }), n = Su({ category: e }), a = n.ageMin && (i.ageMin && n.ageMin < i.ageMin || i.ageMax && n.ageMin > i.ageMax), s = n.ageMax && (i.ageMax && n.ageMax > i.ageMax || i.ageMin && n.ageMax < i.ageMin), o = n.ageMinDate && i.ageMaxDate && new Date(n.ageMinDate) > new Date(i.ageMaxDate), c = n.ageMaxDate && i.ageMinDate && new Date(n.ageMaxDate) < new Date(i.ageMinDate), u = r?.ratingType && e?.ratingType && r.ratingType === e.ratingType && (r.ratingMin && e.ratingMin && e.ratingMin < r.ratingMin || r.ratingMax && e.ratingMax && e.ratingMax > r.ratingMax || r.ratingMin && e.ratingMax && e.ratingMax < r.ratingMin || r.ratingMax && e.ratingMin && e.ratingMin > r.ratingMax), l = r?.ballType && e?.ballType && r.ballType !== e.ballType, d = ae({ invalidRatingRange: u, invalidAgeMinDate: o, invalidAgeMaxDate: c, invalidBallType: l, invalidAgeMax: s, invalidAgeMin: a, valid: !u && !o && !c && !l && !s && !a }, !0);
1528
+ function il({ childCategory: e, withDetails: t, category: r }) {
1529
+ let i = vu({ category: r }), n = vu({ category: e }), a = n.ageMin && (i.ageMin && n.ageMin < i.ageMin || i.ageMax && n.ageMin > i.ageMax), s = n.ageMax && (i.ageMax && n.ageMax > i.ageMax || i.ageMin && n.ageMax < i.ageMin), o = n.ageMinDate && i.ageMaxDate && new Date(n.ageMinDate) > new Date(i.ageMaxDate), c = n.ageMaxDate && i.ageMinDate && new Date(n.ageMaxDate) < new Date(i.ageMinDate), u = r?.ratingType && e?.ratingType && r.ratingType === e.ratingType && (r.ratingMin && e.ratingMin && e.ratingMin < r.ratingMin || r.ratingMax && e.ratingMax && e.ratingMax > r.ratingMax || r.ratingMin && e.ratingMax && e.ratingMax < r.ratingMin || r.ratingMax && e.ratingMin && e.ratingMin > r.ratingMax), l = r?.ballType && e?.ballType && r.ballType !== e.ballType, d = ae({ invalidRatingRange: u, invalidAgeMinDate: o, invalidAgeMaxDate: c, invalidBallType: l, invalidAgeMax: s, invalidAgeMin: a, valid: !u && !o && !c && !l && !s && !a }, !0);
1530
1530
  return t && Object.assign(d, { categoryDetails: i, childCategoryDetails: n }), d;
1531
1531
  }
1532
- function il({ checkCategory: e = !0, collectionDefinition: t, checkCollectionIds: r, checkGender: i = !0, referenceCategory: n, referenceGender: a, event: s }) {
1532
+ function nl({ checkCategory: e = !0, collectionDefinition: t, checkCollectionIds: r, checkGender: i = !0, referenceCategory: n, referenceGender: a, event: s }) {
1533
1533
  a = a ?? s?.gender;
1534
1534
  let o = "validateCollectionDefinition", c = [];
1535
1535
  if (typeof t != "object") return c.push(`collectionDefinition must be an object: ${t}`), F({ result: { errors: c, error: ta }, stack: o });
@@ -1543,8 +1543,8 @@ function il({ checkCategory: e = !0, collectionDefinition: t, checkCollectionIds
1543
1543
  if (v.error) return F({ context: { referenceGender: a, gender: D }, result: v, stack: o });
1544
1544
  }
1545
1545
  if (e && n && U) {
1546
- let v = rl({ category: n, childCategory: U });
1547
- if (!v.valid) return F({ result: { error: fu }, context: v, stack: o });
1546
+ let v = il({ category: n, childCategory: U });
1547
+ if (!v.valid) return F({ result: { error: hu }, context: v, stack: o });
1548
1548
  }
1549
1549
  return c.length ? F({ result: { errors: c, error: JD }, stack: o }) : { valid: !0 };
1550
1550
  }
@@ -1554,7 +1554,7 @@ function Mr(e) {
1554
1554
  let u, l = n.collectionDefinitions.every((g) => {
1555
1555
  let { setValue: I, scoreValue: y, collectionValue: U } = g;
1556
1556
  (I || y) && !U && (u = !0);
1557
- let { valid: D, errors: v } = il({ referenceCategory: e.category, referenceGender: e.gender, collectionDefinition: g, checkCollectionIds: i, checkCategory: t, checkGender: r, event: a });
1557
+ let { valid: D, errors: v } = nl({ referenceCategory: e.category, referenceGender: e.gender, collectionDefinition: g, checkCollectionIds: i, checkCategory: t, checkGender: r, event: a });
1558
1558
  return D ? !0 : (Array.isArray(v) && o.push(...v), !1);
1559
1559
  }), d = typeof n.winCriteria?.valueGoal == "number" && n.winCriteria?.valueGoal > 0 && !u || n.winCriteria?.aggregateValue;
1560
1560
  if (!(d || n.winCriteria?.aggregateValue)) return u ? o.push("aggregateValue is required") : o.push("Either non-zero valueGoal, or { aggregateValue: true } must be specified in winCriteria"), F({ context: { tieFormat: n, errors: o, aggregateValueImperative: u }, result: { error: In }, stack: s });
@@ -1607,7 +1607,7 @@ var PT = { collectionDefinitions: [{ collectionName: "Male Singles", matchUpForm
1607
1607
  return s.hydrate ? (i = { winCriteria: { valueGoal: s.valueGoal }, collectionDefinitions: [{ collectionId: o(0), matchUpFormat: xT, collectionName: "Doubles", matchUpType: We, ...s.doubles }, { collectionId: o(1), matchUpFormat: bi, collectionName: "Singles", matchUpType: ze, ...s.singles }] }, s.tieFormatName && (i.tieFormatName = s.tieFormatName)) : (s.collectionDefinitions.forEach((c, u) => c.collectionId = o(u)), i = s), e?.hydrateCollections && i.collectionDefinitions.forEach((c) => {
1608
1608
  n && !c.category && (c.category = n), a && !c.gender && (c.gender = a);
1609
1609
  }), i;
1610
- }, qn = YO, an = "SINGLES", _s = "SINGLES", di = "DOUBLES", Hn = "DOUBLES", Ct = "TEAM", Hr = "TEAM", KO = "RATING", XO = "BOTH", QO = { AGE: "AGE", BOTH: XO, DOUBLES: di, DOUBLES_EVENT: Hn, RATING: KO, SINGLES: an, SINGLES_EVENT: _s, TEAM_EVENT: Hr, TEAM: Ct }, re = "MAIN", oe = "QUALIFYING", sr = "CONSOLATION", zt = "VOLUNTARY_CONSOLATION", yt = "PLAY_OFF", $p = [re, oe, sr, yt, zt], Bs = { [oe]: 1, [re]: 2, [yt]: 3, [sr]: 3, [zt]: 4 }, oP = "finishingPositions", cP = "aggregateEventStructures", uP = { [re]: 1, [yt]: 2, [sr]: 3, [oe]: 4, [zt]: 5 }, JO = { [yt]: 1, [re]: 2, [sr]: 3, [oe]: 4, [zt]: 5 }, Wp = "CLUSTER", ZO = "SEPARATE", Ha = "WATERFALL", qp = "ITEM", Tr = "CONTAINER", Di = "DRAW", Hp = "RANDOM", Ti = "TOP_DOWN", za = "BOTTOM_UP", bn = "POSITION", Mn = "WINNER", Rn = "LOSER", sn = "FIRST_MATCHUP", zr = "AD_HOC", ek = "AD_HOC", vc = "FEED_IN", Xo = "COMPASS", Qo = "OLYMPIC", tk = "SINGLE_ELIMINATION", Zi = "SINGLE_ELIMINATION", nl = "DOUBLE_ELIMINATION", Jo = "FIRST_MATCH_LOSER_CONSOLATION", al = "FIRST_ROUND_LOSER_CONSOLATION", cs = "LUCKY_DRAW", zp = "CURTIS_CONSOLATION", rk = "CURTIS_CONSOLATION", Qg = "FEED_IN_CHAMPIONSHIP_TO_SF", vu = "FEED_IN_CHAMPIONSHIP_TO_SF", Jg = "FEED_IN_CHAMPIONSHIP_TO_QF", wu = "FEED_IN_CHAMPIONSHIP_TO_QF", Zg = "FEED_IN_CHAMPIONSHIP_TO_R16", Du = "FEED_IN_CHAMPIONSHIP_TO_R16", lP = "MODIFIED_FEED_IN_CHAMPIONSHIP", Tu = "MODIFIED_FEED_IN_CHAMPIONSHIP", sl = "FEED_IN_CHAMPIONSHIP", ik = "DOUBLE_ROUND_ROBIN", Ei = "ROUND_ROBIN", Nn = "ROUND_ROBIN_WITH_PLAYOFF", dP = "DECIDER", pP = "BACKDRAW", eI = { 0: { name: "East", abbreviation: "E" }, "0-1": { name: "West", abbreviation: "W" }, "0-2": { name: "North", abbreviation: "N" }, "0-3": { name: "Northeast", abbreviation: "NE" }, "0-1-1": { name: "South", abbreviation: "S" }, "0-1-2": { name: "Southwest", abbreviation: "SW" }, "0-2-1": { name: "Northwest", abbreviation: "NW" }, "0-1-1-1": { name: "Southeast", abbreviation: "SE" } }, tI = { 0: { name: "East", abbreviation: "E" }, "0-1": { name: "West", abbreviation: "W" }, "0-2": { name: "North", abbreviation: "N" }, "0-1-1": { name: "South", abbreviation: "S" } }, Ya = "WIN_RATIO", io = "ROUND_OUTCOME", mP = [Xo, zp, wu, Du, vu, sl, Jg, Zg, Qg, Jo, al, cs, Tu, Qo, yt, Nn], nk = [zr, Xo, zp, nl, wu, Du, vu, sl, vc, Jo, al, cs, Tu, Qo, yt, Ei, Nn, Zi], fP = { MAIN: re, QUALIFYING: oe, CONSOLATION: sr, ITEM: qp, CONTAINER: Tr, FIRST_MATCHUP: sn, WINNER: Mn, LOSER: Rn, AD_HOC: zr, FEED_IN: vc, FLEX_ROUNDS: ek, COMPASS: Xo, PLAY_OFF: yt, OLYMPIC: Qo, KNOCKOUT: tk, SINGLE_ELIMINATION: Zi, DOUBLE_ELIMINATION: nl, CURTIS: zp, FICSF: Qg, FICQF: Jg, FICR16: Zg, MFIC: lP, VOLUNTARY_CONSOLATION: zt, FIRST_MATCH_LOSER_CONSOLATION: Jo, FIRST_ROUND_LOSER_CONSOLATION: al, MODIFIED_FEED_IN_CHAMPIONSHIP: Tu, FEED_IN_CHAMPIONSHIP_TO_R16: Du, FEED_IN_CHAMPIONSHIP_TO_QF: wu, FEED_IN_CHAMPIONSHIP_TO_SF: vu, FEED_IN_CHAMPIONSHIP: sl, LUCKY_DRAW: cs, ROUND_ROBIN_WITH_PLAYOFF: Nn, ROUND_ROBIN: Ei, DECIDER: dP, BACKDRAW: pP, COMPASS_ATTRIBUTES: eI, OLYMPIC_ATTRIBUTES: tI, DRAW: Di, RANDOM: Hp, TOP_DOWN: Ti, BOTTOM_UP: za, WATERFALL: Ha, WIN_RATIO: Ya, ROUND_OUTCOME: io, MULTI_STRUCTURE_DRAWS: mP, generatedDrawTypes: nk, stageOrder: Bs, finishOrder: uP, AGGREGATE_EVENT_STRUCTURES: cP, FINISHING_POSITIONS: oP }, ak = fP, pr = "tournamentRecords", rI = "policyDefinitions", _t = "tournamentRecord", iI = "onlineResource", mr = "drawDefinition", hP = "tieFormatName", nI = "matchUpFormat", En = "participantId", gP = "scheduleDates", sk = "tournamentId", ok = "scheduleDate", ck = "roundNumber", Yp = "structureId", aI = "participant", ol = "matchUpIds", IP = "entryStage", uk = "policyType", yP = "structures", sI = "eventType", dn = "matchUpId", Kp = "tieFormat", Xp = "inContext", Qp = "structure", Jp = "courtIds", lk = "personId", Zp = "venueIds", oI = "matchUps", UP = "courtId", SP = "eventId", xn = "matchUp", vP = "drawId", Mi = "error", ra = "event", wc = "param", cI = "uuids", dk = "averageMatchUpMinutes", pk = "recoveryMinutes", mk = "periodLength", fk = "number", Cr = "object", cr = "array", ir = "_validate", wP = "_message", ti = "_invalid", Er = "_ofType", uI = "_anyOf", Zo = "_oneOf", nv = { [iI]: (e) => St(Object.keys(e), [zo, Yo, Ko]).length === 3, [hP]: (e) => e && qn({ namedFormat: e }), [cI]: (e) => !e || Array.isArray(e) && e.every(ct), [Kp]: (e) => !Mr({ tieFormat: e }).error, [sI]: (e) => [an, di, Ct].includes(e), [IP]: (e) => $p.includes(e) }, hk = { [pr]: mt, [_t]: J, [rI]: Mp, [mr]: ne, [En]: kt, [nI]: vg, [sk]: $o, [Yp]: ri, [ol]: Ys, [aI]: Qs, [iI]: ta, [sI]: Tn, [yP]: Ig, [dn]: hr, [Kp]: In, [Qp]: ss, [UP]: Ks, [oI]: ea, [SP]: li, [xn]: br, [Jp]: ce, [Zp]: ce, [vP]: zi, [ra]: it }, gk = { [pr]: Cr, [rI]: Cr, [_t]: Cr, [mr]: Cr, [iI]: Cr, [gP]: cr, [aI]: Cr, [ol]: cr, [yP]: cr, [Kp]: Cr, [Qp]: Cr, [Jp]: cr, [Zp]: cr, [oI]: cr, [xn]: Cr, [ra]: Cr, [cI]: cr };
1610
+ }, qn = YO, an = "SINGLES", _s = "SINGLES", di = "DOUBLES", Hn = "DOUBLES", Ct = "TEAM", Hr = "TEAM", KO = "RATING", XO = "BOTH", QO = { AGE: "AGE", BOTH: XO, DOUBLES: di, DOUBLES_EVENT: Hn, RATING: KO, SINGLES: an, SINGLES_EVENT: _s, TEAM_EVENT: Hr, TEAM: Ct }, re = "MAIN", oe = "QUALIFYING", sr = "CONSOLATION", zt = "VOLUNTARY_CONSOLATION", yt = "PLAY_OFF", $p = [re, oe, sr, yt, zt], Bs = { [oe]: 1, [re]: 2, [yt]: 3, [sr]: 3, [zt]: 4 }, oP = "finishingPositions", cP = "aggregateEventStructures", uP = { [re]: 1, [yt]: 2, [sr]: 3, [oe]: 4, [zt]: 5 }, JO = { [yt]: 1, [re]: 2, [sr]: 3, [oe]: 4, [zt]: 5 }, Wp = "CLUSTER", ZO = "SEPARATE", Ha = "WATERFALL", qp = "ITEM", Tr = "CONTAINER", Di = "DRAW", Hp = "RANDOM", Ti = "TOP_DOWN", za = "BOTTOM_UP", bn = "POSITION", Mn = "WINNER", Rn = "LOSER", sn = "FIRST_MATCHUP", zr = "AD_HOC", ek = "AD_HOC", vc = "FEED_IN", Xo = "COMPASS", Qo = "OLYMPIC", tk = "SINGLE_ELIMINATION", Zi = "SINGLE_ELIMINATION", al = "DOUBLE_ELIMINATION", Jo = "FIRST_MATCH_LOSER_CONSOLATION", sl = "FIRST_ROUND_LOSER_CONSOLATION", cs = "LUCKY_DRAW", zp = "CURTIS_CONSOLATION", rk = "CURTIS_CONSOLATION", Qg = "FEED_IN_CHAMPIONSHIP_TO_SF", wu = "FEED_IN_CHAMPIONSHIP_TO_SF", Jg = "FEED_IN_CHAMPIONSHIP_TO_QF", Du = "FEED_IN_CHAMPIONSHIP_TO_QF", Zg = "FEED_IN_CHAMPIONSHIP_TO_R16", Tu = "FEED_IN_CHAMPIONSHIP_TO_R16", lP = "MODIFIED_FEED_IN_CHAMPIONSHIP", Pu = "MODIFIED_FEED_IN_CHAMPIONSHIP", ol = "FEED_IN_CHAMPIONSHIP", ik = "DOUBLE_ROUND_ROBIN", Ei = "ROUND_ROBIN", Nn = "ROUND_ROBIN_WITH_PLAYOFF", dP = "DECIDER", pP = "BACKDRAW", eI = { 0: { name: "East", abbreviation: "E" }, "0-1": { name: "West", abbreviation: "W" }, "0-2": { name: "North", abbreviation: "N" }, "0-3": { name: "Northeast", abbreviation: "NE" }, "0-1-1": { name: "South", abbreviation: "S" }, "0-1-2": { name: "Southwest", abbreviation: "SW" }, "0-2-1": { name: "Northwest", abbreviation: "NW" }, "0-1-1-1": { name: "Southeast", abbreviation: "SE" } }, tI = { 0: { name: "East", abbreviation: "E" }, "0-1": { name: "West", abbreviation: "W" }, "0-2": { name: "North", abbreviation: "N" }, "0-1-1": { name: "South", abbreviation: "S" } }, Ya = "WIN_RATIO", io = "ROUND_OUTCOME", mP = [Xo, zp, Du, Tu, wu, ol, Jg, Zg, Qg, Jo, sl, cs, Pu, Qo, yt, Nn], nk = [zr, Xo, zp, al, Du, Tu, wu, ol, vc, Jo, sl, cs, Pu, Qo, yt, Ei, Nn, Zi], fP = { MAIN: re, QUALIFYING: oe, CONSOLATION: sr, ITEM: qp, CONTAINER: Tr, FIRST_MATCHUP: sn, WINNER: Mn, LOSER: Rn, AD_HOC: zr, FEED_IN: vc, FLEX_ROUNDS: ek, COMPASS: Xo, PLAY_OFF: yt, OLYMPIC: Qo, KNOCKOUT: tk, SINGLE_ELIMINATION: Zi, DOUBLE_ELIMINATION: al, CURTIS: zp, FICSF: Qg, FICQF: Jg, FICR16: Zg, MFIC: lP, VOLUNTARY_CONSOLATION: zt, FIRST_MATCH_LOSER_CONSOLATION: Jo, FIRST_ROUND_LOSER_CONSOLATION: sl, MODIFIED_FEED_IN_CHAMPIONSHIP: Pu, FEED_IN_CHAMPIONSHIP_TO_R16: Tu, FEED_IN_CHAMPIONSHIP_TO_QF: Du, FEED_IN_CHAMPIONSHIP_TO_SF: wu, FEED_IN_CHAMPIONSHIP: ol, LUCKY_DRAW: cs, ROUND_ROBIN_WITH_PLAYOFF: Nn, ROUND_ROBIN: Ei, DECIDER: dP, BACKDRAW: pP, COMPASS_ATTRIBUTES: eI, OLYMPIC_ATTRIBUTES: tI, DRAW: Di, RANDOM: Hp, TOP_DOWN: Ti, BOTTOM_UP: za, WATERFALL: Ha, WIN_RATIO: Ya, ROUND_OUTCOME: io, MULTI_STRUCTURE_DRAWS: mP, generatedDrawTypes: nk, stageOrder: Bs, finishOrder: uP, AGGREGATE_EVENT_STRUCTURES: cP, FINISHING_POSITIONS: oP }, ak = fP, pr = "tournamentRecords", rI = "policyDefinitions", _t = "tournamentRecord", iI = "onlineResource", mr = "drawDefinition", hP = "tieFormatName", nI = "matchUpFormat", En = "participantId", gP = "scheduleDates", sk = "tournamentId", ok = "scheduleDate", ck = "roundNumber", Yp = "structureId", aI = "participant", cl = "matchUpIds", IP = "entryStage", uk = "policyType", yP = "structures", sI = "eventType", dn = "matchUpId", Kp = "tieFormat", Xp = "inContext", Qp = "structure", Jp = "courtIds", lk = "personId", Zp = "venueIds", oI = "matchUps", UP = "courtId", SP = "eventId", xn = "matchUp", vP = "drawId", Mi = "error", ra = "event", wc = "param", cI = "uuids", dk = "averageMatchUpMinutes", pk = "recoveryMinutes", mk = "periodLength", fk = "number", Cr = "object", cr = "array", ir = "_validate", wP = "_message", ti = "_invalid", Er = "_ofType", uI = "_anyOf", Zo = "_oneOf", nv = { [iI]: (e) => St(Object.keys(e), [zo, Yo, Ko]).length === 3, [hP]: (e) => e && qn({ namedFormat: e }), [cI]: (e) => !e || Array.isArray(e) && e.every(ct), [Kp]: (e) => !Mr({ tieFormat: e }).error, [sI]: (e) => [an, di, Ct].includes(e), [IP]: (e) => $p.includes(e) }, hk = { [pr]: mt, [_t]: J, [rI]: Mp, [mr]: ne, [En]: kt, [nI]: vg, [sk]: $o, [Yp]: ri, [cl]: Ys, [aI]: Qs, [iI]: ta, [sI]: Tn, [yP]: Ig, [dn]: hr, [Kp]: In, [Qp]: ss, [UP]: Ks, [oI]: ea, [SP]: li, [xn]: br, [Jp]: ce, [Zp]: ce, [vP]: zi, [ra]: it }, gk = { [pr]: Cr, [rI]: Cr, [_t]: Cr, [mr]: Cr, [iI]: Cr, [gP]: cr, [aI]: Cr, [cl]: cr, [yP]: cr, [Kp]: Cr, [Qp]: Cr, [Jp]: cr, [Zp]: cr, [oI]: cr, [xn]: Cr, [ra]: Cr, [cI]: cr };
1611
1611
  function se(e, t, r) {
1612
1612
  if (!e && !Ce(e)) return { error: z };
1613
1613
  if (!t?.length || e?._bypassParamCheck) return { valid: !0 };
@@ -1696,7 +1696,7 @@ function Vs(e) {
1696
1696
  }
1697
1697
  }
1698
1698
  }
1699
- var Th = "voluntaryConsolation", Vn = "competitiveBands", dI = "roundRobinTally", An = "positionActions", Yt = "matchUpActions", Sd = "rankingPoints", zn = "roundNaming", Tc = "participant", Pu = "progression", Ma = "scheduling", bu = "avoidance", Dk = "participant", Tk = "display", pi = "scoring", wi = "seeding", ec = "feedIn", Pk = "audit", Wd = "draws", bk = { POLICY_TYPE_VOLUNTARY_CONSOLATION: Th, POLICY_TYPE_COMPETITIVE_BANDS: Vn, POLICY_TYPE_ROUND_ROBIN_TALLY: dI, POLICY_TYPE_POSITION_ACTIONS: An, POLICY_TYPE_MATCHUP_ACTIONS: Yt, POLICY_TYPE_RANKING_POINTS: Sd, POLICY_TYPE_ROUND_NAMING: zn, POLICY_TYPE_PARTICIPANT: Tc, POLICY_TYPE_PROGRESSION: Pu, POLICY_TYPE_SCHEDULING: Ma, POLICY_TYPE_AVOIDANCE: bu, POLICY_TYPE_DISPLAY: Tk, POLICY_TYPE_PRIVACY: Dk, POLICY_TYPE_FEED_IN: ec, POLICY_TYPE_SCORING: pi, POLICY_TYPE_SEEDING: wi, POLICY_TYPE_AUDIT: Pk, POLICY_TYPE_DRAWS: Wd };
1699
+ var Th = "voluntaryConsolation", Vn = "competitiveBands", dI = "roundRobinTally", An = "positionActions", Yt = "matchUpActions", Sd = "rankingPoints", zn = "roundNaming", Tc = "participant", bu = "progression", Ma = "scheduling", Mu = "avoidance", Dk = "participant", Tk = "display", pi = "scoring", wi = "seeding", ec = "feedIn", Pk = "audit", Wd = "draws", bk = { POLICY_TYPE_VOLUNTARY_CONSOLATION: Th, POLICY_TYPE_COMPETITIVE_BANDS: Vn, POLICY_TYPE_ROUND_ROBIN_TALLY: dI, POLICY_TYPE_POSITION_ACTIONS: An, POLICY_TYPE_MATCHUP_ACTIONS: Yt, POLICY_TYPE_RANKING_POINTS: Sd, POLICY_TYPE_ROUND_NAMING: zn, POLICY_TYPE_PARTICIPANT: Tc, POLICY_TYPE_PROGRESSION: bu, POLICY_TYPE_SCHEDULING: Ma, POLICY_TYPE_AVOIDANCE: Mu, POLICY_TYPE_DISPLAY: Tk, POLICY_TYPE_PRIVACY: Dk, POLICY_TYPE_FEED_IN: ec, POLICY_TYPE_SCORING: pi, POLICY_TYPE_SEEDING: wi, POLICY_TYPE_AUDIT: Pk, POLICY_TYPE_DRAWS: Wd };
1700
1700
  function Ia({ tournamentParticipants: e = [], policyDefinitions: t = {}, contextProfile: r, participantId: i, internalUse: n, personId: a }) {
1701
1701
  let s = e.find((c) => i && c.participantId === i || a && c.person && c.person.personId === a), o = ie(s, !1, n);
1702
1702
  if (o) {
@@ -1780,7 +1780,7 @@ function bP(e) {
1780
1780
  let t = e.tournamentRecord?.participants || [], r = Ia({ participantId: e.participantId, tournamentParticipants: t });
1781
1781
  return r ? yr({ element: r, name: e.name }) : { error: Dt };
1782
1782
  }
1783
- function cl({ tournamentRecords: e }) {
1783
+ function ul({ tournamentRecords: e }) {
1784
1784
  return { tournamentIds: Ce(e) ? Object.keys(e) : [], ...x };
1785
1785
  }
1786
1786
  var Nk = "extensionQueries";
@@ -1798,10 +1798,10 @@ function De({ discover: e, element: t, name: r, ...i }) {
1798
1798
  let n = t.extensions.find((a) => a?.name === r);
1799
1799
  return { extension: n, info: n ? void 0 : Kt };
1800
1800
  }
1801
- var Ek = "activeSuspension", Mu = "appliedPolicies", MP = "context", rm = "delegatedOutcome", ji = "disabled", js = "disableAutoCalc", im = "disableLinks", qd = "display", ja = "drawDeletions", Ak = "drawProfile", Hd = "entryProfile", Ck = "eventProfile", Ok = "eventWithdrawalRequests", kk = "factory", Ai = "flightProfile", Ph = "groupingAttribute", Yn = "lineUps", Xa = "linkedTournamentsIds", nm = "matchUpHistory", fI = "participantRepresentatives", Pc = "personRequests", Bo = "positionActions", xk = "rankingPoints", Fk = "registration", pn = "roundTarget", ul = "scheduleLimits", Kn = "scheduleTiming", Gs = "schedulingProfile", Lk = "statusDetail", tc = "subOrder", Xn = "tally", tu = "tieFormatModification", RP = { ACTIVE_SUSPENSION: Ek, APPLIED_POLICIES: Mu, CONTEXT: MP, DELEGATED_OUTCOME: rm, DISABLED: ji, DISABLE_LINKS: im, DISABLE_AUTO_CALC: js, DISPLAY: qd, DRAW_DELETIONS: ja, DRAW_PROFILE: Ak, ENTRY_PROFILE: Hd, EVENT_PROFILE: Ck, EVENT_WITHDRAWAL_REQUESTS: Ok, FLIGHT_PROFILE: Ai, GROUPING_ATTRIBUTE: Ph, LINEUPS: Yn, LINKED_TOURNAMENTS: Xa, MATCHUP_HISTORY: nm, PARTICIPANT_REPRESENTATIVES: fI, PERSON_REQUESTS: Pc, POSITION_ACTIONS: Bo, RANKING_POINTS: xk, REGISTRATION: Fk, ROUND_TARGET: pn, SCHEDULE_LIMITS: ul, SCHEDULE_TIMING: Kn, SCHEDULING_PROFILE: Gs, STATUS_DETAIL: Lk, SUB_ORDER: tc, TALLY: Xn, TIE_FORMAT_MODIFICATIONS: tu, FACTORY: kk }, av = [rm, ji, js, im, Ai, Yn, Xa, nm, fI, Pc, pn, ul, Kn, Gs, tc, Xn, tu];
1801
+ var Ek = "activeSuspension", Ru = "appliedPolicies", MP = "context", rm = "delegatedOutcome", ji = "disabled", js = "disableAutoCalc", im = "disableLinks", qd = "display", ja = "drawDeletions", Ak = "drawProfile", Hd = "entryProfile", Ck = "eventProfile", Ok = "eventWithdrawalRequests", kk = "factory", Ai = "flightProfile", Ph = "groupingAttribute", Yn = "lineUps", Xa = "linkedTournamentsIds", nm = "matchUpHistory", fI = "participantRepresentatives", Pc = "personRequests", Bo = "positionActions", xk = "rankingPoints", Fk = "registration", pn = "roundTarget", ll = "scheduleLimits", Kn = "scheduleTiming", Gs = "schedulingProfile", Lk = "statusDetail", tc = "subOrder", Xn = "tally", ru = "tieFormatModification", RP = { ACTIVE_SUSPENSION: Ek, APPLIED_POLICIES: Ru, CONTEXT: MP, DELEGATED_OUTCOME: rm, DISABLED: ji, DISABLE_LINKS: im, DISABLE_AUTO_CALC: js, DISPLAY: qd, DRAW_DELETIONS: ja, DRAW_PROFILE: Ak, ENTRY_PROFILE: Hd, EVENT_PROFILE: Ck, EVENT_WITHDRAWAL_REQUESTS: Ok, FLIGHT_PROFILE: Ai, GROUPING_ATTRIBUTE: Ph, LINEUPS: Yn, LINKED_TOURNAMENTS: Xa, MATCHUP_HISTORY: nm, PARTICIPANT_REPRESENTATIVES: fI, PERSON_REQUESTS: Pc, POSITION_ACTIONS: Bo, RANKING_POINTS: xk, REGISTRATION: Fk, ROUND_TARGET: pn, SCHEDULE_LIMITS: ll, SCHEDULE_TIMING: Kn, SCHEDULING_PROFILE: Gs, STATUS_DETAIL: Lk, SUB_ORDER: tc, TALLY: Xn, TIE_FORMAT_MODIFICATIONS: ru, FACTORY: kk }, av = [rm, ji, js, im, Ai, Yn, Xa, nm, fI, Pc, pn, ll, Kn, Gs, tc, Xn, ru];
1802
1802
  function NP({ tournamentRecords: e }) {
1803
1803
  if (typeof e != "object" || !Object.keys(e).length) return { error: mt };
1804
- let t = cl({ tournamentRecords: e }), { tournamentIds: r } = t;
1804
+ let t = ul({ tournamentRecords: e }), { tournamentIds: r } = t;
1805
1805
  return r?.length > 1 ? Le({ tournamentRecords: e, discover: !0, extension: { name: Xa, value: { tournamentIds: r } } }) : { ...x };
1806
1806
  }
1807
1807
  function EP({ tournamentRecords: e }) {
@@ -1812,7 +1812,7 @@ function EP({ tournamentRecords: e }) {
1812
1812
  function AP({ tournamentRecords: e, tournamentId: t }) {
1813
1813
  if (typeof e != "object") return { error: z };
1814
1814
  if (!t) return { error: $o };
1815
- let r = cl({ tournamentRecords: e }), { tournamentIds: i } = r;
1815
+ let r = ul({ tournamentRecords: e }), { tournamentIds: i } = r;
1816
1816
  if (!i.includes(t)) return { error: $o };
1817
1817
  let n;
1818
1818
  return i.every((a) => {
@@ -1830,18 +1830,18 @@ function AP({ tournamentRecords: e, tournamentId: t }) {
1830
1830
  }), n ? { error: n } : { ...x };
1831
1831
  }
1832
1832
  var CP = {};
1833
- Te(CP, { getLinkedTournamentIds: () => ll, getTournamentIds: () => cl });
1834
- function ll({ tournamentRecords: e }) {
1833
+ Te(CP, { getLinkedTournamentIds: () => dl, getTournamentIds: () => ul });
1834
+ function dl({ tournamentRecords: e }) {
1835
1835
  return typeof e != "object" || !Object.keys(e).length ? { error: mt } : { linkedTournamentIds: Object.assign({}, ...Object.keys(e).map((t) => {
1836
1836
  let r = e[t], i = r?.tournamentId, { extension: n } = De({ element: r, name: Xa }), a = (n?.value?.tournamentIds || []).filter((s) => s !== i);
1837
1837
  return { [t]: a };
1838
1838
  })) };
1839
1839
  }
1840
1840
  var OP = {};
1841
- Te(OP, { adHocPositionSwap: () => bM, addAdHocMatchUps: () => Cm, addDrawDefinitionTimeItem: () => gy, addFinishingRounds: () => Pl, addGoesTo: () => Ja, addPlayoffStructures: () => Am, addQualifyingStructure: () => PM, addVoluntaryConsolationStage: () => yM, addVoluntaryConsolationStructure: () => iy, allPlayoffPositionsFilled: () => my, alternateDrawPositionAssignment: () => sM, assignDrawPosition: () => QM, assignDrawPositionBye: () => ai, attachConsolationStructures: () => zM, attachPlayoffStructures: () => Cy, attachQualifyingStructure: () => hy, attachStructures: () => Em, autoSeeding: () => _V, automatedPlayoffPositioning: () => Oc, automatedPositioning: () => xl, checkValidEntries: () => xm, deleteAdHocMatchUps: () => ZM, drawMatic: () => rU, findDrawDefinition: () => Ly, generateAdHocMatchUps: () => Fm, generateAdHocRounds: () => tU, generateAndPopulatePlayoffStructures: () => Ey, generateDrawDefinition: () => Jl, generateDrawMaticRound: () => qy, generateDrawStructuresAndLinks: () => Gy, generateDrawTypeAndModifyDrawDefinition: () => $y, generateQualifyingStructure: () => wy, generateVoluntaryConsolation: () => TR, getAssignedParticipantIds: () => gs, getAvailableMatchUpsCount: () => Om, getAvailablePlayoffProfiles: () => _l, getDrawDefinitionTimeItem: () => kI, getDrawParticipantRepresentativeIds: () => xy, getDrawStructures: () => Ci, getDrawTypeCoercion: () => Wl, getEligibleVoluntaryConsolationParticipants: () => ky, getMatchUpsMap: () => er, getParticipantIdFinishingPositions: () => Fy, getPositionAssignments: () => xu, getPositionsPlayedOff: () => kc, getRandomQualifierList: () => Vy, getSeedingThresholds: () => oy, getSeedsCount: () => ql, getStructureSeedAssignments: () => mi, getTeamLineUp: () => Qa, getValidGroupSizes: () => Ol, isAdHoc: () => Rr, isCompletedStructure: () => kn, isValidForQualifying: () => jy, luckyLoserDrawPositionAssignment: () => eM, modifyDrawDefinition: () => YM, modifyDrawName: () => Oy, modifySeedAssignment: () => dM, mutate: () => kP, positionActions: () => By, pruneDrawDefinition: () => XM, qualifierDrawPositionAssignment: () => fy, qualifierProgression: () => pM, query: () => rR, removeDrawPositionAssignment: () => Cu, removeRoundMatchUps: () => eR, removeSeededParticipant: () => TM, removeStructure: () => gM, renameStructures: () => hM, resetDrawDefinition: () => KM, resetQualifyingStructure: () => UM, resetVoluntaryConsolationStructure: () => QP, setDrawParticipantRepresentativeIds: () => xP, setPositionAssignments: () => nM, setStructureOrder: () => mM, setSubOrder: () => tR, shiftAdHocRounds: () => iM, swapAdHocRounds: () => aM, swapDrawPositionAssignments: () => wM, updateTeamLineUp: () => yo, withdrawParticipantAtDrawPosition: () => Hb });
1841
+ Te(OP, { adHocPositionSwap: () => bM, addAdHocMatchUps: () => Cm, addDrawDefinitionTimeItem: () => gy, addFinishingRounds: () => bl, addGoesTo: () => Ja, addPlayoffStructures: () => Am, addQualifyingStructure: () => PM, addVoluntaryConsolationStage: () => yM, addVoluntaryConsolationStructure: () => iy, allPlayoffPositionsFilled: () => my, alternateDrawPositionAssignment: () => sM, assignDrawPosition: () => QM, assignDrawPositionBye: () => ai, attachConsolationStructures: () => zM, attachPlayoffStructures: () => Cy, attachQualifyingStructure: () => hy, attachStructures: () => Em, autoSeeding: () => _V, automatedPlayoffPositioning: () => Oc, automatedPositioning: () => Fl, checkValidEntries: () => xm, deleteAdHocMatchUps: () => ZM, drawMatic: () => rU, findDrawDefinition: () => Ly, generateAdHocMatchUps: () => Fm, generateAdHocRounds: () => tU, generateAndPopulatePlayoffStructures: () => Ey, generateDrawDefinition: () => Zl, generateDrawMaticRound: () => qy, generateDrawStructuresAndLinks: () => Gy, generateDrawTypeAndModifyDrawDefinition: () => $y, generateQualifyingStructure: () => wy, generateVoluntaryConsolation: () => TR, getAssignedParticipantIds: () => gs, getAvailableMatchUpsCount: () => Om, getAvailablePlayoffProfiles: () => Bl, getDrawDefinitionTimeItem: () => kI, getDrawParticipantRepresentativeIds: () => xy, getDrawStructures: () => Ci, getDrawTypeCoercion: () => ql, getEligibleVoluntaryConsolationParticipants: () => ky, getMatchUpsMap: () => er, getParticipantIdFinishingPositions: () => Fy, getPositionAssignments: () => Fu, getPositionsPlayedOff: () => kc, getRandomQualifierList: () => Vy, getSeedingThresholds: () => oy, getSeedsCount: () => Hl, getStructureSeedAssignments: () => mi, getTeamLineUp: () => Qa, getValidGroupSizes: () => kl, isAdHoc: () => Rr, isCompletedStructure: () => kn, isValidForQualifying: () => jy, luckyLoserDrawPositionAssignment: () => eM, modifyDrawDefinition: () => YM, modifyDrawName: () => Oy, modifySeedAssignment: () => dM, mutate: () => kP, positionActions: () => By, pruneDrawDefinition: () => XM, qualifierDrawPositionAssignment: () => fy, qualifierProgression: () => pM, query: () => rR, removeDrawPositionAssignment: () => Ou, removeRoundMatchUps: () => eR, removeSeededParticipant: () => TM, removeStructure: () => gM, renameStructures: () => hM, resetDrawDefinition: () => KM, resetQualifyingStructure: () => UM, resetVoluntaryConsolationStructure: () => QP, setDrawParticipantRepresentativeIds: () => xP, setPositionAssignments: () => nM, setStructureOrder: () => mM, setSubOrder: () => tR, shiftAdHocRounds: () => iM, swapAdHocRounds: () => aM, swapDrawPositionAssignments: () => wM, updateTeamLineUp: () => yo, withdrawParticipantAtDrawPosition: () => Hb });
1842
1842
  var kP = {};
1843
- Te(kP, { adHocPositionSwap: () => bM, addAdHocMatchUps: () => Cm, addDrawDefinitionTimeItem: () => gy, addPlayoffStructures: () => Am, addQualifyingStructure: () => PM, addVoluntaryConsolationStage: () => yM, addVoluntaryConsolationStructure: () => iy, alternateDrawPositionAssignment: () => sM, assignDrawPosition: () => QM, assignDrawPositionBye: () => ai, attachConsolationStructures: () => zM, attachPlayoffStructures: () => Cy, attachQualifyingStructure: () => hy, attachStructures: () => Em, automatedPlayoffPositioning: () => Oc, automatedPositioning: () => xl, deleteAdHocMatchUps: () => ZM, luckyLoserDrawPositionAssignment: () => eM, modifyDrawDefinition: () => YM, modifyDrawName: () => Oy, modifySeedAssignment: () => dM, pruneDrawDefinition: () => XM, qualifierDrawPositionAssignment: () => fy, qualifierProgression: () => pM, removeDrawPositionAssignment: () => Cu, removeRoundMatchUps: () => eR, removeSeededParticipant: () => TM, removeStructure: () => gM, renameStructures: () => hM, resetDrawDefinition: () => KM, resetQualifyingStructure: () => UM, resetVoluntaryConsolationStructure: () => QP, setDrawParticipantRepresentativeIds: () => xP, setPositionAssignments: () => nM, setStructureOrder: () => mM, setSubOrder: () => tR, shiftAdHocRounds: () => iM, swapAdHocRounds: () => aM, swapDrawPositionAssignments: () => wM, updateTeamLineUp: () => yo, withdrawParticipantAtDrawPosition: () => Hb });
1844
- var hI = (e) => (t) => e[t], gI = (e = []) => e.map(Gt).filter(Boolean), bh = (e = []) => e.map(Pe).filter(Boolean), Pe = (e = {}) => hI(e)("participantId"), Gt = (e = {}) => hI(e)("matchUpId"), Ru = (e = {}) => hI(e)("drawId");
1843
+ Te(kP, { adHocPositionSwap: () => bM, addAdHocMatchUps: () => Cm, addDrawDefinitionTimeItem: () => gy, addPlayoffStructures: () => Am, addQualifyingStructure: () => PM, addVoluntaryConsolationStage: () => yM, addVoluntaryConsolationStructure: () => iy, alternateDrawPositionAssignment: () => sM, assignDrawPosition: () => QM, assignDrawPositionBye: () => ai, attachConsolationStructures: () => zM, attachPlayoffStructures: () => Cy, attachQualifyingStructure: () => hy, attachStructures: () => Em, automatedPlayoffPositioning: () => Oc, automatedPositioning: () => Fl, deleteAdHocMatchUps: () => ZM, luckyLoserDrawPositionAssignment: () => eM, modifyDrawDefinition: () => YM, modifyDrawName: () => Oy, modifySeedAssignment: () => dM, pruneDrawDefinition: () => XM, qualifierDrawPositionAssignment: () => fy, qualifierProgression: () => pM, removeDrawPositionAssignment: () => Ou, removeRoundMatchUps: () => eR, removeSeededParticipant: () => TM, removeStructure: () => gM, renameStructures: () => hM, resetDrawDefinition: () => KM, resetQualifyingStructure: () => UM, resetVoluntaryConsolationStructure: () => QP, setDrawParticipantRepresentativeIds: () => xP, setPositionAssignments: () => nM, setStructureOrder: () => mM, setSubOrder: () => tR, shiftAdHocRounds: () => iM, swapAdHocRounds: () => aM, swapDrawPositionAssignments: () => wM, updateTeamLineUp: () => yo, withdrawParticipantAtDrawPosition: () => Hb });
1844
+ var hI = (e) => (t) => e[t], gI = (e = []) => e.map(Gt).filter(Boolean), bh = (e = []) => e.map(Pe).filter(Boolean), Pe = (e = {}) => hI(e)("participantId"), Gt = (e = {}) => hI(e)("matchUpId"), Nu = (e = {}) => hI(e)("drawId");
1845
1845
  function xP({ representativeParticipantIds: e, drawDefinition: t }) {
1846
1846
  if (!t) return { error: Zr };
1847
1847
  if (!Array.isArray(e)) return { error: z };
@@ -1931,7 +1931,7 @@ function Ee({ drawDefinition: e, tournamentId: t, structureId: r, context: i, ev
1931
1931
  function jk({ tournamentId: e, inContextMatchUp: t }) {
1932
1932
  return t ? (Ue({ payload: { inContextMatchUp: t, tournamentId: e }, topic: sm, key: t.matchUpId }), { ...x }) : { error: br };
1933
1933
  }
1934
- function dl({ tournamentId: e, eventId: t, drawDefinition: r }) {
1934
+ function pl({ tournamentId: e, eventId: t, drawDefinition: r }) {
1935
1935
  return r ? (om(r), Ue({ payload: { drawDefinition: r, tournamentId: e, eventId: t }, topic: UI, key: r.drawId }), { ...x }) : (console.log(ne), { error: ne });
1936
1936
  }
1937
1937
  function Gk({ tournamentId: e, eventId: t, drawId: r }) {
@@ -1995,7 +1995,7 @@ function um(e) {
1995
1995
  function hi(e) {
1996
1996
  return e?.tournamentRecords ?? (e?.tournamentRecord && { [e.tournamentRecord.tournamentId]: e.tournamentRecord }) ?? {};
1997
1997
  }
1998
- var pl = "SIGN_IN_STATUS", JP = "SIGNED_OUT", Nu = "SIGNED_IN", Pr = "TEAM", be = "INDIVIDUAL", ii = "GROUP", we = "PAIR", Ge = "TEAM", ru = { TEAM_PARTICIPANT: Pr, INDIVIDUAL: be, GROUP: ii, TEAM: Ge, PAIR: we }, $k = { INDIVIDUAL: be, GROUP: ii, PAIR: we, TEAM: Ge, SIGN_IN_STATUS: pl, SIGNED_OUT: JP, SIGNED_IN: Nu };
1998
+ var ml = "SIGN_IN_STATUS", JP = "SIGNED_OUT", Eu = "SIGNED_IN", Pr = "TEAM", be = "INDIVIDUAL", ii = "GROUP", we = "PAIR", Ge = "TEAM", iu = { TEAM_PARTICIPANT: Pr, INDIVIDUAL: be, GROUP: ii, TEAM: Ge, PAIR: we }, $k = { INDIVIDUAL: be, GROUP: ii, PAIR: we, TEAM: Ge, SIGN_IN_STATUS: ml, SIGNED_OUT: JP, SIGNED_IN: Eu };
1999
1999
  function lm({ participantsProfile: e, participants: t = [], deepCopy: r }) {
2000
2000
  let i = /* @__PURE__ */ new Map(), n = r !== !1 ? ie(t, e?.convertExtensions, !0) : t, a = n.filter((c) => c.participantType === Ge), s = n.filter((c) => c.participantType === ii), o = n.filter((c) => c.participantType === we);
2001
2001
  return n.forEach((c) => {
@@ -2085,7 +2085,7 @@ function kI({ returnPreviousValues: e, drawDefinition: t, itemSubTypes: r, itemT
2085
2085
  let { timeItem: n, previousItems: a, info: s } = gi({ element: t, returnPreviousValues: e, itemSubTypes: r, itemType: i });
2086
2086
  return n && { timeItem: n, previousItems: a } || { info: s };
2087
2087
  }
2088
- function ml({ returnPreviousValues: e, itemSubTypes: t, itemType: r, event: i }) {
2088
+ function fl({ returnPreviousValues: e, itemSubTypes: t, itemType: r, event: i }) {
2089
2089
  if (!i) return { error: it };
2090
2090
  if (!i.timeItems) return { info: Kt };
2091
2091
  let { timeItem: n, previousItems: a, info: s } = gi({ returnPreviousValues: e, element: i, itemSubTypes: t, itemType: r });
@@ -2138,8 +2138,8 @@ function rb({ withIndividualParticipants: e, convertExtensions: t, tournamentRec
2138
2138
  return a && (d = lm({ participants: Object.values(l).map(({ participant: p }) => p), participantsProfile: { convertExtensions: t }, deepCopy: !1 }).groupInfo), { missingParticipantIds: u, participantMap: l, groupInfo: d };
2139
2139
  }
2140
2140
  function Yk(e) {
2141
- let { timeItem: t } = gi({ itemType: pl, element: e });
2142
- return t?.itemValue === Nu;
2141
+ let { timeItem: t } = gi({ itemType: ml, element: e });
2142
+ return t?.itemValue === Eu;
2143
2143
  }
2144
2144
  function Kk({ individualParticipantIds: e, participantCopy: t, participantMap: r, participantType: i, participantId: n }) {
2145
2145
  let a = [];
@@ -2181,7 +2181,7 @@ function xe({ onlySpecifiedPolicyTypes: e = !1, policyTypes: t = [], tournamentR
2181
2181
  let s = {};
2182
2182
  return r && o(r), a && o(a), i && o(i), n && o(n), { appliedPolicies: s, ...x };
2183
2183
  function o(c) {
2184
- let u = c?.extensions?.find((l) => l.name === Mu)?.value;
2184
+ let u = c?.extensions?.find((l) => l.name === Ru)?.value;
2185
2185
  if (u) for (let l of Object.keys(u)) (e ? t.includes(l) : !t.length || t.includes(l)) && (s[l] = ie(u[l], !1, !0));
2186
2186
  }
2187
2187
  }
@@ -2192,9 +2192,9 @@ function ia({ policyTypes: e = [], tournamentRecord: t, drawDefinition: r, struc
2192
2192
  let c = a?.[o];
2193
2193
  c && (s[o] = c);
2194
2194
  }
2195
- return Object.keys(s).length ? { policyDefinitions: s } : { info: Xu.message };
2195
+ return Object.keys(s).length ? { policyDefinitions: s } : { info: Qu.message };
2196
2196
  }
2197
- var ib = "WALKOVER", sv = "RETIRED", FI = "COMPETITIVE", Eu = "ROUTINE", Au = "DECISIVE", vd = "winRatio", Qk = { [Vn]: { policyName: "Competitive Bands Default", profileBands: { [Au]: 20, [Eu]: 50 } } }, LI = Qk;
2197
+ var ib = "WALKOVER", sv = "RETIRED", FI = "COMPETITIVE", Au = "ROUTINE", Cu = "DECISIVE", vd = "winRatio", Qk = { [Vn]: { policyName: "Competitive Bands Default", profileBands: { [Cu]: 20, [Au]: 50 } } }, LI = Qk;
2198
2198
  function na({ policyDefinitions: e, tournamentRecord: t, contextProfile: r, drawDefinition: i, event: n }) {
2199
2199
  let a = { policies: {} };
2200
2200
  if (!r) return a;
@@ -2208,9 +2208,9 @@ function na({ policyDefinitions: e, tournamentRecord: t, contextProfile: r, draw
2208
2208
  function ps({ tournamentRecord: e, drawDefinition: t, policyType: r, structure: i, event: n }) {
2209
2209
  if (!e) return { error: J };
2210
2210
  let { appliedPolicies: a } = xe({ tournamentRecord: e, drawDefinition: t, structure: i, event: n });
2211
- return a?.[r] ? { policy: a[r] } : { info: Xu?.message };
2211
+ return a?.[r] ? { policy: a[r] } : { info: Qu?.message };
2212
2212
  }
2213
- function fl({ tournamentRecord: e, categoryName: t, categoryType: r, event: i }) {
2213
+ function hl({ tournamentRecord: e, categoryName: t, categoryType: r, event: i }) {
2214
2214
  t = t ?? i?.category?.categoryName ?? i?.category?.ageCategoryCode, r = r ?? i?.category?.categoryType ?? i?.category?.subType;
2215
2215
  let { policy: n } = ps({ policyType: Ma, tournamentRecord: e, event: i }), a = (e ? De({ element: e, name: Kn }).extension : void 0)?.value, s = (i && De({ name: Kn, element: i }).extension)?.value;
2216
2216
  return { scheduleTiming: { tournamentScheduling: a, eventScheduling: s, categoryName: t, categoryType: r, policy: n } };
@@ -2223,13 +2223,13 @@ function _I({ drawDefinition: e, attributes: t }) {
2223
2223
  });
2224
2224
  }), r = { name: Hd, value: i }, em({ drawDefinition: e, extension: r }), { entryProfile: i };
2225
2225
  }
2226
- function hl({ drawDefinition: e }) {
2226
+ function gl({ drawDefinition: e }) {
2227
2227
  let { extension: t } = De({ element: e, name: Hd });
2228
2228
  return { entryProfile: t?.value || {} };
2229
2229
  }
2230
- var Ri = "ALTERNATE", gl = "CONFIRMED", Lr = "DIRECT_ACCEPTANCE", Il = "FEED_IN", yl = "JUNIOR_EXEMPT", Qn = "LUCKY_LOSER", Ul = "ORGANISER_ACCEPTANCE", Sl = "QUALIFIER", Jk = "REGISTERED", vl = "SPECIAL_EXEMPT", Ii = "UNGROUPED", ms = "UNPAIRED", rc = "WILDCARD", Cn = "WITHDRAWN", wd = [gl, Lr, yl, Ul, vl], nb = [Il, Qn, Sl], fs = [gl, Lr, Il, yl, Ul, vl, rc], Fi = [gl, Lr, yl, Qn, Sl, Ul, vl, rc], ab = [Ri, gl, Lr, Il, yl, Qn, Ul, Sl, Jk, vl, Ii, ms, rc, Cn], Zk = { ALTERNATE: Ri, CONFIRMED: gl, DIRECT_ACCEPTANCE: Lr, DIRECT_ENTRY_STATUSES: fs, DRAW_SPECIFIC_STATUSES: nb, EQUIVALENT_ACCEPTANCE_STATUSES: wd, FEED_IN: Il, JUNIOR_EXEMPT: yl, LUCKY_LOSER: Qn, ORGANISER_ACCEPTANCE: Ul, QUALIFIER: Sl, SPECIAL_EXEMPT: vl, STRUCTURE_SELECTED_STATUSES: Fi, UNGROUPED: Ii, UNPAIRED: ms, VALID_ENTRY_STATUSES: ab, WILDCARD: rc, WITHDRAWN: Cn };
2230
+ var Ri = "ALTERNATE", Il = "CONFIRMED", Lr = "DIRECT_ACCEPTANCE", yl = "FEED_IN", Ul = "JUNIOR_EXEMPT", Qn = "LUCKY_LOSER", Sl = "ORGANISER_ACCEPTANCE", vl = "QUALIFIER", Jk = "REGISTERED", wl = "SPECIAL_EXEMPT", Ii = "UNGROUPED", ms = "UNPAIRED", rc = "WILDCARD", Cn = "WITHDRAWN", wd = [Il, Lr, Ul, Sl, wl], nb = [yl, Qn, vl], fs = [Il, Lr, yl, Ul, Sl, wl, rc], Fi = [Il, Lr, Ul, Qn, vl, Sl, wl, rc], ab = [Ri, Il, Lr, yl, Ul, Qn, Sl, vl, Jk, wl, Ii, ms, rc, Cn], Zk = { ALTERNATE: Ri, CONFIRMED: Il, DIRECT_ACCEPTANCE: Lr, DIRECT_ENTRY_STATUSES: fs, DRAW_SPECIFIC_STATUSES: nb, EQUIVALENT_ACCEPTANCE_STATUSES: wd, FEED_IN: yl, JUNIOR_EXEMPT: Ul, LUCKY_LOSER: Qn, ORGANISER_ACCEPTANCE: Sl, QUALIFIER: vl, SPECIAL_EXEMPT: wl, STRUCTURE_SELECTED_STATUSES: Fi, UNGROUPED: Ii, UNPAIRED: ms, VALID_ENTRY_STATUSES: ab, WILDCARD: rc, WITHDRAWN: Cn };
2231
2231
  function BI({ stage: e, drawDefinition: t }) {
2232
- let { entryProfile: r } = hl({ drawDefinition: t }), i = Object.keys(r).includes(e);
2232
+ let { entryProfile: r } = gl({ drawDefinition: t }), i = Object.keys(r).includes(e);
2233
2233
  if (!i && $p.includes(e)) {
2234
2234
  let n = [{ [e]: { drawSize: void 0, alternates: !0 } }];
2235
2235
  return _I({ drawDefinition: t, attributes: n }), !0;
@@ -2237,11 +2237,11 @@ function BI({ stage: e, drawDefinition: t }) {
2237
2237
  return i;
2238
2238
  }
2239
2239
  function ex({ stage: e, drawDefinition: t }) {
2240
- let { entryProfile: r } = hl({ drawDefinition: t });
2240
+ let { entryProfile: r } = gl({ drawDefinition: t });
2241
2241
  return r[e]?.alternates || 0;
2242
2242
  }
2243
2243
  function tx({ stage: e, drawDefinition: t }) {
2244
- let { entryProfile: r } = hl({ drawDefinition: t });
2244
+ let { entryProfile: r } = gl({ drawDefinition: t });
2245
2245
  return r[e]?.wildcardsCount || 0;
2246
2246
  }
2247
2247
  function Nh({ stage: e, drawDefinition: t, entryStatus: r }) {
@@ -2275,7 +2275,7 @@ function rx({ provisionalPositioning: e, drawDefinition: t, structureId: r }) {
2275
2275
  });
2276
2276
  (!e || m) && f.forEach((h) => {
2277
2277
  let g = p[h], { groupOrder: I, provisionalOrder: y, GEMscore: U } = g, D = I || e && y, v = [...a ?? []].sort(At).indexOf(D) + 1;
2278
- i.push({ entryStage: yt, entryStatus: Il, placementGroup: v, groupingValue: d, participantId: h, GEMscore: U });
2278
+ i.push({ entryStage: yt, entryStatus: yl, placementGroup: v, groupingValue: d, participantId: h, GEMscore: U });
2279
2279
  });
2280
2280
  });
2281
2281
  }
@@ -2304,7 +2304,7 @@ function Ki(e) {
2304
2304
  if (e.tieFormat) return e.tieFormat;
2305
2305
  if (t && Array.isArray(r)) return r.find((i) => i.tieFormatId === t);
2306
2306
  }
2307
- function iu({ item: e, drawDefinition: t, structure: r, event: i }) {
2307
+ function nu({ item: e, drawDefinition: t, structure: r, event: i }) {
2308
2308
  if (e) {
2309
2309
  if (e.tieFormat) return e.tieFormat;
2310
2310
  if (e.tieFormatId)
@@ -2317,7 +2317,7 @@ function iu({ item: e, drawDefinition: t, structure: r, event: i }) {
2317
2317
  }
2318
2318
  }
2319
2319
  function fr({ drawDefinition: e, structure: t, matchUp: r, event: i }) {
2320
- return { tieFormat: iu({ item: r, drawDefinition: e, structure: t, event: i }) || iu({ item: t, drawDefinition: e, structure: t, event: i }) || Ki(e) || Ki(i) };
2320
+ return { tieFormat: nu({ item: r, drawDefinition: e, structure: t, event: i }) || nu({ item: t, drawDefinition: e, structure: t, event: i }) || Ki(e) || Ki(i) };
2321
2321
  }
2322
2322
  function nx({ matchUps: e }) {
2323
2323
  let t = e.reduce((r, i) => !i.collectionPosition || r.includes(i.collectionPosition) ? r : r.concat(i.collectionPosition), []).map((r) => ({ [r]: e.filter((i) => i.collectionPosition === r) }));
@@ -2525,7 +2525,7 @@ function cb({ roundNamingPolicy: e, drawDefinition: t, structure: r, matchUps: i
2525
2525
  var cx = (e, t) => (e || 0) + (t || 0);
2526
2526
  function ub(e, t) {
2527
2527
  let r = Array.isArray(e) ? e[0] : e;
2528
- return isNaN(r) && ib || r <= t[Au] && Au || r <= t[Eu] && Eu || FI;
2528
+ return isNaN(r) && ib || r <= t[Cu] && Cu || r <= t[Au] && Au || FI;
2529
2529
  }
2530
2530
  function lb({ score: e }) {
2531
2531
  let t = e?.sets || [], r = t.reduce((n, a) => (n[0] += a.side1Score || 0, n[1] += a.side2Score || 0, n), [0, 0]), i = t.reduce((n, a) => (n[0] += a.side1TiebreakScore || 0, n[1] += a.side2TiebreakScore || 0, n), [0, 0]);
@@ -2538,7 +2538,7 @@ function ux(e) {
2538
2538
  function db(e) {
2539
2539
  return e.map(ux).sort().map((t) => parseFloat(t.toFixed(2)));
2540
2540
  }
2541
- function wl({ tournamentRecord: e, profileBands: t, matchUp: r }) {
2541
+ function Dl({ tournamentRecord: e, profileBands: t, matchUp: r }) {
2542
2542
  if (!r) return { error: br };
2543
2543
  let { score: i, winningSide: n } = r;
2544
2544
  if (!n) return { error: z };
@@ -2573,11 +2573,11 @@ var Tt = (e) => (t) => {
2573
2573
  let r = Ce(t) && t?.matchUpType || ct(t) && t;
2574
2574
  return r && Vw[e].includes(r);
2575
2575
  };
2576
- function nu(e) {
2576
+ function au(e) {
2577
2577
  let { matchUpAverageTimes: t, matchUpFormat: r } = e || {}, i = t?.map(({ matchUpFormatCodes: a }) => a?.filter((s) => s === r)).flat().filter(Boolean).sort((a, s) => (a?.length || 0) - (s?.length || 0)) || [], n = i.includes(r) ? r : i[0];
2578
2578
  return t?.find(({ matchUpFormatCodes: a, averageTimes: s }) => a?.find((o) => n === o) && s)?.averageTimes;
2579
2579
  }
2580
- function au(e) {
2580
+ function su(e) {
2581
2581
  let { matchUpRecoveryTimes: t, averageMinutes: r, matchUpFormat: i } = e || {};
2582
2582
  return t?.find(({ matchUpFormatCodes: n, averageTimes: a, recoveryTimes: s }) => {
2583
2583
  if (a && r) {
@@ -2591,18 +2591,18 @@ function vb({ timesBlockArray: e, categoryName: t, categoryType: r }) {
2591
2591
  return e.filter((i) => Array.isArray(i)).map((i) => i.sort((n, a) => (a.categoryNames?.length || 0) - (n.categoryNames?.length || 0)).find(({ categoryTypes: n, categoryNames: a }) => !a?.length && !n?.length || a?.includes(t) || n?.includes(r))).find(Boolean);
2592
2592
  }
2593
2593
  function wx({ tournamentScheduling: e, eventScheduling: t, averageMinutes: r, defaultTiming: i, matchUpFormat: n, categoryName: a, categoryType: s, policy: o }) {
2594
- let c = t?.matchUpRecoveryTimes && au({ ...t, averageMinutes: r, matchUpFormat: n }), u = e?.matchUpRecoveryTimes && au({ ...e, averageMinutes: r, matchUpFormat: n }), l = o?.matchUpRecoveryTimes && au({ ...o, averageMinutes: r, matchUpFormat: n }), d = [c, u, l, o?.defaultTimes?.recoveryTimes, i?.recoveryTimes];
2594
+ let c = t?.matchUpRecoveryTimes && su({ ...t, averageMinutes: r, matchUpFormat: n }), u = e?.matchUpRecoveryTimes && su({ ...e, averageMinutes: r, matchUpFormat: n }), l = o?.matchUpRecoveryTimes && su({ ...o, averageMinutes: r, matchUpFormat: n }), d = [c, u, l, o?.defaultTimes?.recoveryTimes, i?.recoveryTimes];
2595
2595
  return vb({ categoryName: a, categoryType: s, timesBlockArray: d });
2596
2596
  }
2597
2597
  function Dx({ matchUpFormat: e, categoryName: t, categoryType: r, defaultTiming: i, tournamentScheduling: n, eventScheduling: a, policy: s }) {
2598
- let o = a?.matchUpAverageTimes && nu({ ...a, matchUpFormat: e }), c = n?.matchUpAverageTimes && nu({ ...n, matchUpFormat: e }), u = s?.matchUpAverageTimes && nu({ ...s, matchUpFormat: e }), l = [o, c, u, s?.defaultTimes?.averageTimes, i?.averageTimes];
2598
+ let o = a?.matchUpAverageTimes && au({ ...a, matchUpFormat: e }), c = n?.matchUpAverageTimes && au({ ...n, matchUpFormat: e }), u = s?.matchUpAverageTimes && au({ ...s, matchUpFormat: e }), l = [o, c, u, s?.defaultTimes?.averageTimes, i?.averageTimes];
2599
2599
  return vb({ categoryName: t, categoryType: r, timesBlockArray: l });
2600
2600
  }
2601
2601
  var wb = "DOUBLES_SINGLES", Db = "SINGLES_DOUBLES", Ni = "total", Ah = "participantConflict", ua = "matchUpConflict", Tb = "ISSUE_IDS", xa = "CONFLICT", Fa = "WARNING", Ch = "ERROR", Oh = "ISSUE", Td = "STATE", Tx = { SINGLES_DOUBLES: Db, DOUBLES_SINGLES: wb, TOTAL: Ni, CONFLICT_MATCHUP_ORDER: ua, CONFLICT_PARTICIPANTS: Ah, SCHEDULE_ISSUE_IDS: Tb, SCHEDULE_CONFLICT: xa, SCHEDULE_WARNING: Fa, SCHEDULE_ERROR: Ch, SCHEDULE_ISSUE: Oh, SCHEDULE_STATE: Td };
2602
- function Dl({ defaultAverageMinutes: e = 90, defaultRecoveryMinutes: t = 0, tournamentRecord: r, matchUpFormat: i, categoryName: n, categoryType: a, eventType: s, event: o }) {
2602
+ function Tl({ defaultAverageMinutes: e = 90, defaultRecoveryMinutes: t = 0, tournamentRecord: r, matchUpFormat: i, categoryName: n, categoryType: a, eventType: s, event: o }) {
2603
2603
  if (!r) return { error: J };
2604
2604
  s = s ?? o?.eventType ?? _s;
2605
- let c = { averageTimes: [{ minutes: { default: e } }], recoveryTimes: [{ minutes: { default: t } }] }, { scheduleTiming: u } = fl({ tournamentRecord: r, categoryName: n, categoryType: a, event: o }), l = { ...u, matchUpFormat: i, categoryType: a, defaultTiming: c };
2605
+ let c = { averageTimes: [{ minutes: { default: e } }], recoveryTimes: [{ minutes: { default: t } }] }, { scheduleTiming: u } = hl({ tournamentRecord: r, categoryName: n, categoryType: a, event: o }), l = { ...u, matchUpFormat: i, categoryType: a, defaultTiming: c };
2606
2606
  return hm({ eventType: s, timingDetails: l });
2607
2607
  }
2608
2608
  function hm({ timingDetails: e, eventType: t }) {
@@ -2674,7 +2674,7 @@ function Mx({ matchUp: e }) {
2674
2674
  return a && (!i || r(a) < r(i)) ? a : i;
2675
2675
  }, void 0)?.itemValue };
2676
2676
  }
2677
- function Tl(e) {
2677
+ function Pl(e) {
2678
2678
  let { disableNotice: t, venue: r, context: i } = e;
2679
2679
  if (typeof r != "object") return { error: z };
2680
2680
  let n = hi(e);
@@ -2695,10 +2695,10 @@ function Ln({ tournamentRecords: e, tournamentRecord: t, venueId: r }) {
2695
2695
  if (!r) return { error: ba };
2696
2696
  let i = (t.venues ?? []).reduce((n, a) => a.venueId === r ? a : n, void 0);
2697
2697
  if (!i && e) {
2698
- let n = (ll({ tournamentRecords: e }).linkedTournamentIds ?? [])[t.tournamentId];
2698
+ let n = (dl({ tournamentRecords: e }).linkedTournamentIds ?? [])[t.tournamentId];
2699
2699
  for (let a of n) {
2700
2700
  let s = e[a], o = Ln({ tournamentRecord: s, venueId: r });
2701
- if (o.success && o.venue) return Tl({ tournamentRecord: t, venue: o.venue }), { ...x, venue: i };
2701
+ if (o.success && o.venue) return Pl({ tournamentRecord: t, venue: o.venue }), { ...x, venue: i };
2702
2702
  }
2703
2703
  }
2704
2704
  return i ? { ...x, venue: i } : { error: Js };
@@ -2717,10 +2717,10 @@ function mo({ tournamentRecords: e, tournamentRecord: t, courtId: r }) {
2717
2717
  });
2718
2718
  }), n) return { ...x, court: n, venue: a };
2719
2719
  if (e) {
2720
- let s = (ll({ tournamentRecords: e }).linkedTournamentIds ?? [])[t.tournamentId];
2720
+ let s = (dl({ tournamentRecords: e }).linkedTournamentIds ?? [])[t.tournamentId];
2721
2721
  for (let o of s) {
2722
2722
  let c = e[o], u = mo({ tournamentRecord: c, courtId: r });
2723
- if (u.success) return u.venue && Tl({ tournamentRecord: t, venue: u.venue }), { ...x, court: n, venue: a };
2723
+ if (u.success) return u.venue && Pl({ tournamentRecord: t, venue: u.venue }), { ...x, court: n, venue: a };
2724
2724
  }
2725
2725
  }
2726
2726
  return F({ result: { error: yc }, stack: i });
@@ -2933,7 +2933,7 @@ function kx({ seedAssignments: e, participantId: t }) {
2933
2933
  }
2934
2934
  function bb({ scheduleVisibilityFilters: e, sourceDrawPositionRanges: t, tournamentParticipants: r, positionAssignments: i, drawPositionsRanges: n, hydrateParticipants: a, afterRecoveryTimes: s, initialRoundOfPlay: o, additionalContext: c, roundNamingProfile: u, tournamentRecord: l, tieDrawPositions: d, appliedPolicies: p, isCollectionBye: m, seedAssignments: f, usePublishState: h, participantMap: g, contextContent: I, scheduleTiming: y, contextProfile: U, drawDefinition: D, publishStatus: v, scoringActive: w, matchUpTieId: S, isRoundRobin: T, roundProfile: b, sideLineUps: P, structure: M, context: R, matchUp: E, event: A }) {
2935
2935
  c = c ?? {};
2936
- let N = fr({ drawDefinition: D, structure: M, matchUp: E, event: A })?.tieFormat, { roundOffset: C, structureId: k, structureName: O, stage: L, stageSequence: _ } = M, { drawId: B, drawName: G, drawType: $ } = D ?? {}, j = N?.collectionDefinitions, V = E.collectionId && j?.find((Se) => Se.collectionId === E.collectionId), H = E.collectionId ? V?.matchUpFormat : E.matchUpFormat ?? M?.matchUpFormat ?? D?.matchUpFormat ?? A?.matchUpFormat, W = E.matchUpType || V?.matchUpType || M?.matchUpType || D?.matchUpType || !Tt(Ct)(A?.eventType) && A?.eventType, Y = m ? "BYE" : E.matchUpStatus, { schedule: q, endDate: K } = Im({ scheduleVisibilityFilters: e, afterRecoveryTimes: s, tournamentRecord: l, usePublishState: h, scheduleTiming: y, drawDefinition: D, matchUpFormat: H, publishStatus: v, matchUpType: W, matchUp: E, event: A }), X = d ?? E.drawPositions ?? [], { collectionPosition: Q, collectionId: Z, roundPosition: ee } = E, ue = E.roundNumber ?? c.roundNumber, he = Z ? Ax({ tournamentParticipants: r, positionAssignments: i, collectionPosition: Q, participantMap: g, drawDefinition: D, drawPositions: X, collectionId: Z, sideLineUps: P, matchUpType: W }) : void 0, qe = u?.[ue]?.roundName || c.roundName, Fe = u?.[ue]?.abbreviatedRoundName || c.abbreviatedRoundName, Ke = b?.[ue]?.feedRound, bt = b?.[ue]?.preFeedRound, Jt = b?.[ue]?.roundFactor, Pt = n?.[ue], de = ee ? Pt?.[ee] : void 0, ot = t?.[ue], le = V?.category ? { ...R?.category || {}, ...V.category } : R?.category ?? A?.category, $e = E.processCodes?.length && E.processCodes || V?.processCodes?.length && V?.processCodes || M?.processCodes?.length && M?.processCodes || D?.processCodes?.length && D?.processCodes || A?.processCodes?.length && A?.processCodes || l?.processCodes, Re = U?.withCompetitiveness && wl({ ...I, matchUp: E }), et = E.finishingPositionRange ?? c.finishingPositionRange, Me = L !== oe && Ie(o) && o + (ue || 0), Ze = (Se) => ae(Se, void 0, !0), ge = { ...Ze(R), ...Ze({ matchUpFormat: W === Ct ? void 0 : H, tieFormat: W !== Ct ? void 0 : N, gender: V?.gender ?? A?.gender, endDate: E.endDate ?? K, discipline: A?.discipline, category: le, finishingPositionRange: et, abbreviatedRoundName: Fe, drawPositionsRange: de, competitiveProfile: Re, structureName: O, stageSequence: _, drawPositions: X, matchUpStatus: Y, processCodes: $e, isRoundRobin: T, matchUpTieId: S, preFeedRound: bt, matchUpType: W, roundFactor: Jt, roundOffset: C, structureId: k, roundNumber: ue, roundOfPlay: Me, feedRound: Ke, roundName: qe, drawName: G, drawType: $, schedule: q, drawId: B, stage: L }), ...ie(Ze(E), !0, !0) };
2936
+ let N = fr({ drawDefinition: D, structure: M, matchUp: E, event: A })?.tieFormat, { roundOffset: C, structureId: k, structureName: O, stage: L, stageSequence: _ } = M, { drawId: B, drawName: G, drawType: $ } = D ?? {}, j = N?.collectionDefinitions, V = E.collectionId && j?.find((Se) => Se.collectionId === E.collectionId), H = E.collectionId ? V?.matchUpFormat : E.matchUpFormat ?? M?.matchUpFormat ?? D?.matchUpFormat ?? A?.matchUpFormat, W = E.matchUpType || V?.matchUpType || M?.matchUpType || D?.matchUpType || !Tt(Ct)(A?.eventType) && A?.eventType, Y = m ? "BYE" : E.matchUpStatus, { schedule: q, endDate: K } = Im({ scheduleVisibilityFilters: e, afterRecoveryTimes: s, tournamentRecord: l, usePublishState: h, scheduleTiming: y, drawDefinition: D, matchUpFormat: H, publishStatus: v, matchUpType: W, matchUp: E, event: A }), X = d ?? E.drawPositions ?? [], { collectionPosition: Q, collectionId: Z, roundPosition: ee } = E, ue = E.roundNumber ?? c.roundNumber, he = Z ? Ax({ tournamentParticipants: r, positionAssignments: i, collectionPosition: Q, participantMap: g, drawDefinition: D, drawPositions: X, collectionId: Z, sideLineUps: P, matchUpType: W }) : void 0, qe = u?.[ue]?.roundName || c.roundName, Fe = u?.[ue]?.abbreviatedRoundName || c.abbreviatedRoundName, Ke = b?.[ue]?.feedRound, bt = b?.[ue]?.preFeedRound, Jt = b?.[ue]?.roundFactor, Pt = n?.[ue], de = ee ? Pt?.[ee] : void 0, ot = t?.[ue], le = V?.category ? { ...R?.category || {}, ...V.category } : R?.category ?? A?.category, $e = E.processCodes?.length && E.processCodes || V?.processCodes?.length && V?.processCodes || M?.processCodes?.length && M?.processCodes || D?.processCodes?.length && D?.processCodes || A?.processCodes?.length && A?.processCodes || l?.processCodes, Re = U?.withCompetitiveness && Dl({ ...I, matchUp: E }), et = E.finishingPositionRange ?? c.finishingPositionRange, Me = L !== oe && Ie(o) && o + (ue || 0), Ze = (Se) => ae(Se, void 0, !0), ge = { ...Ze(R), ...Ze({ matchUpFormat: W === Ct ? void 0 : H, tieFormat: W !== Ct ? void 0 : N, gender: V?.gender ?? A?.gender, endDate: E.endDate ?? K, discipline: A?.discipline, category: le, finishingPositionRange: et, abbreviatedRoundName: Fe, drawPositionsRange: de, competitiveProfile: Re, structureName: O, stageSequence: _, drawPositions: X, matchUpStatus: Y, processCodes: $e, isRoundRobin: T, matchUpTieId: S, preFeedRound: bt, matchUpType: W, roundFactor: Jt, roundOffset: C, structureId: k, roundNumber: ue, roundOfPlay: Me, feedRound: Ke, roundName: qe, drawName: G, drawType: $, schedule: q, drawId: B, stage: L }), ...ie(Ze(E), !0, !0) };
2937
2937
  if (H && E.score?.scoreStringSide1) {
2938
2938
  let Se = Dr(H), { bestOf: He, finalSetFormat: Ne, setFormat: Oe } = Se ?? {};
2939
2939
  (Ne?.tiebreakSet || Oe?.tiebreakSet || Oe?.timed) && (ge.score.sets = ge.score.sets.sort((Ae, qt) => Ae.setNumber - qt.setNumber).map((Ae, qt) => (qt + 1 === He ? (Ne?.tiebreakSet || Ne?.timed) && (Ae.tiebreakSet = !0) : (Oe?.tiebreakSet || Oe?.timed) && (Ae.tiebreakSet = !0), Ae)));
@@ -3237,7 +3237,7 @@ function _n(e) {
3237
3237
  let A = ds({ participantsProfile: s, useParticipantMap: u, tournamentRecord: l, contextProfile: f, inContext: g });
3238
3238
  i = A.participantMap, t = A.participants ?? [], M = A.groupInfo;
3239
3239
  }
3240
- let R = y.drawDefinitions ?? [], E = fl({ tournamentRecord: l, event: y }).scheduleTiming;
3240
+ let R = y.drawDefinitions ?? [], E = hl({ tournamentRecord: l, event: y }).scheduleTiming;
3241
3241
  return { matchUps: R.flatMap((A) => {
3242
3242
  let { matchUps: N } = Rt({ tournamentParticipants: t, tournamentAppliedPolicies: a, scheduleVisibilityFilters: n, context: P, participantsProfile: s, afterRecoveryTimes: o, policyDefinitions: c, tournamentRecord: l, usePublishState: d, contextFilters: p, contextProfile: f, drawDefinition: A, contextContent: r, matchUpFilters: m, participantMap: i, scheduleTiming: E, nextMatchUps: h, inContext: g, event: y });
3243
3243
  return N ?? [];
@@ -3290,7 +3290,7 @@ function Rs({ element: e, accessor: t }) {
3290
3290
  }
3291
3291
  }
3292
3292
  var Rb = (e) => (t) => !e || typeof t != "object" ? void 0 : Array.isArray(e) && e.map((r) => ({ [r]: Rs({ element: t, accessor: r })?.value })) || typeof e == "object" && Object.keys(e).map((r) => ({ [r]: Rs({ element: t, accessor: r })?.value })) || (typeof e == "string" && Rs({ element: t, accessor: e }))?.value, Kr = Rb;
3293
- function Pl({ finishingPositionOffset: e = 0, finishingPositionLimit: t, positionsFed: r, roundsCount: i, roundLimit: n, matchUps: a, lucky: s, fmlc: o }) {
3293
+ function bl({ finishingPositionOffset: e = 0, finishingPositionLimit: t, positionsFed: r, roundsCount: i, roundLimit: n, matchUps: a, lucky: s, fmlc: o }) {
3294
3294
  if (!yi(a)) return [];
3295
3295
  let { roundProfile: c, roundNumbers: u = [] } = vr({ interpolate: !0, matchUps: a });
3296
3296
  i = i ?? Math.max(...u, 0);
@@ -3313,7 +3313,7 @@ function Ja({ inContextDrawMatchUps: e, drawDefinition: t, matchUpsMap: r }) {
3313
3313
  let i = { loserMatchUpIds: {}, winnerMatchUpIds: {} };
3314
3314
  if (e || ({ matchUps: e, matchUpsMap: r } = Rt({ inContext: !0, drawDefinition: t, matchUpsMap: r })), !r?.drawMatchUps.some((n) => n.finishingPositionRange) && t?.structures?.length === 1 && !t?.structures[0].structures) {
3315
3315
  let n = r?.drawMatchUps ?? [];
3316
- Pl({ matchUps: n });
3316
+ bl({ matchUps: n });
3317
3317
  }
3318
3318
  return (e ?? []).filter(({ collectionId: n }) => !n).forEach((n) => {
3319
3319
  let { matchUpId: a, structureId: s } = n, o = wr({ inContextDrawMatchUps: e, drawDefinition: t, matchUpId: a }), { winnerMatchUp: c, loserMatchUp: u } = o.targetMatchUps, l = c?.matchUpId, d = u?.matchUpId, p = va({ matchUpsMap: r, structureId: s }).find((m) => m.matchUpId === a);
@@ -3389,7 +3389,7 @@ function Lt(e) {
3389
3389
  let t = e?.matchUp, r = e?.score || t?.score, i = r?.sets?.[0], { side1Score: n, side2Score: a, side1TiebreakScore: s, side2TiebreakScore: o, side1PointScore: c, side2PointScore: u } = i || {}, l = n || a || s || o || c || u;
3390
3390
  return !!(r?.sets?.length > 1 || l);
3391
3391
  }
3392
- function bl({ matchUpStatus: e }) {
3392
+ function Ml({ matchUpStatus: e }) {
3393
3393
  return _P.includes(e);
3394
3394
  }
3395
3395
  function qx({ matchUpStatus: e }) {
@@ -3402,7 +3402,7 @@ function zI({ matchUpStatus: e, winningSide: t, tieMatchUps: r, sides: i, score:
3402
3402
  let a = i?.find(({ participantId: o }) => o), s = r?.filter(zI)?.length;
3403
3403
  return Lt({ score: n }) || s || t && a || e && qx({ matchUpStatus: e }) && ![Qe, st, xi].includes(e);
3404
3404
  }
3405
- function Ml(e) {
3405
+ function Rl(e) {
3406
3406
  let { drawDefinition: t, findContainer: r, structureId: i, event: n } = e, a = e.structure, { containedStructures: s } = Mc({ drawDefinition: t }), o = i ? s[i] || [] : [], c = { isCollectionMatchUp: !1 };
3407
3407
  if (!a) {
3408
3408
  let S = me({ drawDefinition: t, structureId: i });
@@ -3456,7 +3456,7 @@ function ai({ provisionalPositioning: e, isPositionAction: t, tournamentRecord:
3456
3456
  o || ({ structureId: o } = c);
3457
3457
  let l = "assignDrawPositionBye";
3458
3458
  $r({ method: l, color: "cyan", drawPosition: n }), s || (s = er({ drawDefinition: i }));
3459
- let { positionAssignments: d } = Ye({ structure: c }), { activeDrawPositions: p } = Ml({ drawDefinition: i, structureId: o });
3459
+ let { positionAssignments: d } = Ye({ structure: c }), { activeDrawPositions: p } = Rl({ drawDefinition: i, structureId: o });
3460
3460
  if (d?.find((M) => M.drawPosition === n)?.bye) return { ...x };
3461
3461
  let m = !!(a && s.drawMatchUps.find((M) => M.loserMatchUpId === a?.matchUpId && lr(M.matchUpStatus)));
3462
3462
  if (p?.includes(n) && !m) return { error: Pp };
@@ -3541,11 +3541,11 @@ function Ab({ positionAssignments: e, tournamentRecord: t, drawDefinition: r, ma
3541
3541
  o.winningSide || (Object.assign(o, { matchUpStatus: c ? "BYE" : vt }), Ee({ tournamentId: t?.tournamentId, context: "modifyRoundRobinMatchUpsStatus", eventId: a?.eventId, drawDefinition: r, matchUp: o }));
3542
3542
  });
3543
3543
  }
3544
- function Rl(e) {
3544
+ function Nl(e) {
3545
3545
  let { inContextDrawMatchUps: t, participantId: r, drawPosition: i } = e, { tournamentRecord: n, drawDefinition: a, structureId: s, matchUpsMap: o, event: c } = e, { structure: u } = me({ drawDefinition: a, structureId: s }), l = (Ft({ drawDefinition: a, structure: u }).positionAssignments || []).find((p) => r && p.participantId === r || i && p.drawPosition === i);
3546
3546
  if (l && r && !i && (i = l?.drawPosition), !i) return { error: fc };
3547
3547
  r || (r = l?.participantId);
3548
- let { activeDrawPositions: d } = Ml({ drawDefinition: a, structureId: s });
3548
+ let { activeDrawPositions: d } = Rl({ drawDefinition: a, structureId: s });
3549
3549
  return d.includes(i) ? { error: Pp } : (t || ({ matchUps: t } = Rt({ inContext: !0, drawDefinition: a, matchUpsMap: o })), xh({ inContextDrawMatchUps: t, tournamentRecord: n, drawDefinition: a, structureId: s, drawPosition: i, matchUpsMap: o, event: c }).drawPositionCleared ? (Sa({ tournamentId: n?.tournamentId, drawDefinition: a, structure: u, event: c }), { ...x, participantId: r }) : { error: eD });
3550
3550
  }
3551
3551
  function xh({ inContextDrawMatchUps: e, tournamentRecord: t, drawDefinition: r, drawPosition: i, matchUpsMap: n, structureId: a, event: s }) {
@@ -3607,7 +3607,7 @@ function Cb({ inContextDrawMatchUps: e, positionAssignments: t, tournamentRecord
3607
3607
  function Zx({ loserMatchUpDrawPosition: e, inContextDrawMatchUps: t, tournamentRecord: r, drawDefinition: i, loserMatchUp: n, matchUpsMap: a, event: s }) {
3608
3608
  let { structure: o } = me({ structureId: n.structureId, drawDefinition: i }), { positionAssignments: c } = Ye({ structure: o });
3609
3609
  if (c?.find((u) => u.drawPosition === e)?.bye) {
3610
- let u = Rl({ drawPosition: e, structureId: n.structureId, inContextDrawMatchUps: t, tournamentRecord: r, drawDefinition: i, matchUpsMap: a, event: s });
3610
+ let u = Nl({ drawPosition: e, structureId: n.structureId, inContextDrawMatchUps: t, tournamentRecord: r, drawDefinition: i, matchUpsMap: a, event: s });
3611
3611
  if (u.error) return u;
3612
3612
  }
3613
3613
  return { ...x };
@@ -3749,7 +3749,7 @@ function tF({ convertExtensions: e, seedAssignments: t, participant: r, withSeed
3749
3749
  let { entryStatus: c, entryStage: u, entryPosition: l, extensions: d } = o, p = d?.length && e ? Object.assign({}, ...Xg(d ?? [])) : {}, m = Object.assign(p, { entryPosition: l, entryStatus: c, entryStage: u, ranking: s, eventId: a });
3750
3750
  r.events[a] = ae(m, !1, !1, !0), i && (t && (r.events[a].seedAssignments = t), n && (r.events[a].seedValue = n));
3751
3751
  }
3752
- function Nl(e) {
3752
+ function El(e) {
3753
3753
  let t = se(e, [{ [_t]: !0 }]);
3754
3754
  if (t.error) return t;
3755
3755
  let { tournamentRecord: r, status: i = ni } = e, n = `${Aa}.${Ca}`;
@@ -3761,7 +3761,7 @@ function rF(e) {
3761
3761
  }
3762
3762
  function Ui({ event: e, status: t = ni }) {
3763
3763
  let r = `${Aa}.${Ca}`;
3764
- return ml({ itemType: r, event: e })?.timeItem?.itemValue?.[t];
3764
+ return fl({ itemType: r, event: e })?.timeItem?.itemValue?.[t];
3765
3765
  }
3766
3766
  function XI({ drawDetails: e, drawId: t }) {
3767
3767
  return e?.[t]?.publishingDetail?.published;
@@ -3785,7 +3785,7 @@ function ho(e) {
3785
3785
  let d = Ff({ event: o }), p = {};
3786
3786
  if (s) return r ? { publishState: { status: { published: !!d.status.publishedDrawIds?.includes(s), drawDetail: d.status.drawDetails?.[s] }, ...x } } : { error: Zr };
3787
3787
  if (Array.isArray(a) && a?.length) {
3788
- let m = o.drawDefinitions?.map(Ru) ?? [];
3788
+ let m = o.drawDefinitions?.map(Nu) ?? [];
3789
3789
  for (let f of a) {
3790
3790
  if (!ct(f)) return { error: z };
3791
3791
  if (!m.includes(f)) return { error: Zr };
@@ -3804,7 +3804,7 @@ function ho(e) {
3804
3804
  }
3805
3805
  }
3806
3806
  if (t) {
3807
- let d = Nl({ tournamentRecord: t });
3807
+ let d = El({ tournamentRecord: t });
3808
3808
  l.tournament = d ?? {}, (d?.orderOfPlay?.published || d?.participants?.published) && (u = !0), l.tournament.status = { published: u, publishedEventIds: c };
3809
3809
  }
3810
3810
  return { ...x, publishState: l };
@@ -3815,7 +3815,7 @@ function Ff({ event: e }) {
3815
3815
  let r = { published: void 0, seedingScaleNames: [], drawIds: [] };
3816
3816
  t.seeding && Object.assign(r, t.seeding);
3817
3817
  let i = t.drawDetails ?? {};
3818
- for (let o of e.drawDefinitions?.map(Ru) || []) i[o] || (i[o] = { publishingDetail: { published: !1 } });
3818
+ for (let o of e.drawDefinitions?.map(Nu) || []) i[o] || (i[o] = { publishingDetail: { published: !1 } });
3819
3819
  let n = i && Object.keys(i).length && Object.keys(i).filter((o) => XI({ drawDetails: i, drawId: o })), a = n?.length ? n : t.drawIds ?? [];
3820
3820
  if (a?.length && !n?.length) for (let o of a) i[o] = { publishingDetail: { published: !0 } };
3821
3821
  let s = a?.length > 0;
@@ -3929,7 +3929,7 @@ function nF(e) {
3929
3929
  }
3930
3930
  let Y = M?.[G]?.publishedSeeding;
3931
3931
  if (D || d || y) {
3932
- let q = (X) => X ? Object.assign({}, ...X.map(({ participantId: Q, seedValue: Z, seedNumber: ee }) => ({ [Q]: { seedValue: Z, seedNumber: ee } }))) : void 0, K = ye([...C.map(Ru), ...V.map(Ru)]);
3932
+ let q = (X) => X ? Object.assign({}, ...X.map(({ participantId: Q, seedValue: Z, seedNumber: ee }) => ({ [Q]: { seedValue: Z, seedNumber: ee } }))) : void 0, K = ye([...C.map(Nu), ...V.map(Nu)]);
3933
3933
  for (let X of K) {
3934
3934
  let Q = C.find((Se) => Se.drawId === X), Z = [_?.categoryName, _?.ageCategoryCode].filter(Boolean), { structures: ee = [], drawOrder: ue, drawName: he, drawType: qe } = Q ?? {}, Fe = V?.find((Se) => Se.drawId === X), Ke = Q?.entries || Fe?.drawEntries, bt = Fe?.flightNumber, Jt = (Q?.structures || []).sort((Se, He) => ao(Se, He)).map(({ structureId: Se, structures: He }) => [Se, ...(He || []).map(({ structureId: Ne }) => Ne)]).flat(1 / 0), Pt, de, ot, le, $e = 0, Re = ee.filter(({ stage: Se, stageSequence: He }) => Se === re && He === 1 || Se === oe).flatMap((Se) => {
3935
3935
  let { positionAssignments: He } = Ye({ structure: Se }), { seedAssignments: Ne, stageSequence: Oe, stage: Ae } = Se;
@@ -4017,14 +4017,14 @@ function nF(e) {
4017
4017
  }
4018
4018
  return { participantIdsWithConflicts: T, eventsPublishStatuses: M, derivedEventInfo: R, derivedDrawInfo: E, mappedMatchUps: b, participantMap: c, matchUps: P };
4019
4019
  }
4020
- function El({ participantFilters: e = {}, tournamentRecord: t, participants: r = [] }) {
4020
+ function Al({ participantFilters: e = {}, tournamentRecord: t, participants: r = [] }) {
4021
4021
  if (!Object.keys(e).length) return r;
4022
4022
  let { accessorValues: i, drawEntryStatuses: n, positionedParticipants: a, eventEntryStatuses: s, participantRoles: o, participantRoleResponsibilities: c, participantTypes: u, participantIds: l, signInStatus: d, enableOrFiltering: p, eventIds: m, genders: f } = e, h = gn(m) && t?.events?.filter((D) => m?.includes(D.eventId)) || t?.events || [], g = n && aF({ drawEntryStatuses: n, tournamentEvents: h }), I = s && sF({ eventEntryStatuses: s, tournamentEvents: h }), y = a !== void 0 && [!0, !1].includes(a) && h.reduce((D, v) => D.concat(...(v.drawDefinitions || []).map((w) => GP({ drawDefinition: w }).allPositionedParticipantIds).filter(Boolean)), []), U = (D) => i?.reduce((v, w) => {
4023
4023
  let { accessor: S, value: T } = w, { values: b } = Rs({ element: D, accessor: S });
4024
4024
  return v && b?.includes(T);
4025
4025
  }, !0);
4026
4026
  if (r = r?.filter((D) => {
4027
- let v = gi({ element: D, itemType: pl })?.timeItem?.itemValue, { participantRoleResponsibilities: w, participantType: S, participantRole: T, participantId: b, person: P } = D, M = Array.isArray(f) && f?.length && P?.sex && f.includes(P.sex);
4027
+ let v = gi({ element: D, itemType: ml })?.timeItem?.itemValue, { participantRoleResponsibilities: w, participantType: S, participantRole: T, participantId: b, person: P } = D, M = Array.isArray(f) && f?.length && P?.sex && f.includes(P.sex);
4028
4028
  return p ? f && M || a && y.includes(b) || a === !1 && !y.includes(b) || g?.includes(b) || I?.includes(b) || l?.includes(b) || d && v === d || u && S && gn(u) && u.includes(S) || o && T && gn(o) && o.includes(T) || c && gn(w) && gn(c) && c.find((R) => w?.includes(R)) || i?.length && gn(i) && U(D) : (!f || M) && (a === void 0 || a && y.includes(b) || a === !1 && !y.includes(b)) && (!g || g.includes(b)) && (!I || I.includes(b)) && (!l || l.includes(b)) && (!d || v === d) && (!u || S && gn(u) && u.includes(S)) && (!o || T && gn(o) && o.includes(T)) && (!c || gn(w) && gn(c) && c.find((R) => w?.includes(R))) && (!i?.length || gn(i) && U(D));
4029
4029
  }), h.length && m) {
4030
4030
  let D = h.filter((v) => m.includes(v.eventId)).map((v) => {
@@ -4066,7 +4066,7 @@ function pt(e) {
4066
4066
  }), ae({ ...q, scheduleConflicts: u ? Object.values(W) : void 0, draws: S || n ? ue : void 0, events: w || n ? Object.values(Z) : void 0, matchUps: U || n ? Object.values(Q) : void 0, opponents: y ? he : void 0, potentialMatchUps: L ? Object.values(H) : void 0, statistics: f ? Object.values(K) : void 0, scheduleItems: o ? Y : void 0 }, !1, !1, !0);
4067
4067
  }, B = /* @__PURE__ */ new Map();
4068
4068
  for (let H of Object.keys(M)) B.set(H, _(M[H]));
4069
- let G = [...B.values()], $ = s?.[Tc]?.participant, j = El({ participants: G, participantFilters: r, tournamentRecord: c });
4069
+ let G = [...B.values()], $ = s?.[Tc]?.participant, j = Al({ participants: G, participantFilters: r, tournamentRecord: c });
4070
4070
  if (t) {
4071
4071
  let H = Ce(t) ? t : void 0;
4072
4072
  for (let W of j) for (let Y of W.individualParticipantIds ?? []) {
@@ -4086,7 +4086,7 @@ function Ns({ participantId: e, drawDefinition: t, entryStatus: r, entryStage: i
4086
4086
  function Ec(e) {
4087
4087
  let { provisionalPositioning: t, drawDefinition: r, stageSequence: i, structureId: n, stage: a } = e;
4088
4088
  if (!r) return { error: ne };
4089
- let { entryProfile: s } = hl({ drawDefinition: r }), o = a && i && s?.[a]?.stageSequence?.[i]?.qualifiersCount || a && s?.[a]?.qualifiersCount || 0, c = {};
4089
+ let { entryProfile: s } = gl({ drawDefinition: r }), o = a && i && s?.[a]?.stageSequence?.[i]?.qualifiersCount || a && s?.[a]?.qualifiersCount || 0, c = {};
4090
4090
  if (!n) return { qualifiersCount: o, roundQualifiersCounts: c };
4091
4091
  let { structure: u } = me({ drawDefinition: r, structureId: n }), l = r.links?.filter((m) => m?.target?.structureId === u?.structureId), d = 0;
4092
4092
  if (l?.length) for (let m of l) {
@@ -4108,7 +4108,7 @@ function Ec(e) {
4108
4108
  return d = Math.max(d, o), { qualifiersCount: d, roundQualifiersCounts: c };
4109
4109
  }
4110
4110
  function Jd({ stage: e, drawDefinition: t }) {
4111
- let { entryProfile: r } = hl({ drawDefinition: t });
4111
+ let { entryProfile: r } = gl({ drawDefinition: t });
4112
4112
  return r?.[e]?.drawSize || 0;
4113
4113
  }
4114
4114
  function oF(e) {
@@ -4134,7 +4134,7 @@ function QI(e) {
4134
4134
  let I = e.participantId || u?.participantId;
4135
4135
  if (!I) return F({ result: { error: kt }, stack: h });
4136
4136
  let y = i === Qn && Ns({ participantId: I, drawDefinition: o, entryStatus: i }), U = a === zt && Ns({ participantId: I, drawDefinition: o, entryStage: a }), D = Ns({ participantId: I, drawDefinition: o }), v = i !== Qn && a !== zt && D;
4137
- if (v) return r ? (Ue({ payload: { drawId: o.drawId, eventId: f?.eventId, error: mu, participantId: I }, topic: vI }), { ...x }) : F({ result: { error: mu }, context: { participantId: I }, stack: h });
4137
+ if (v) return r ? (Ue({ payload: { drawId: o.drawId, eventId: f?.eventId, error: fu, participantId: I }, topic: vI }), { ...x }) : F({ result: { error: fu }, context: { participantId: I }, stack: h });
4138
4138
  if (y || U) return F({ context: { invalidEntry: v, invalidLuckyLoser: y, invalidVoluntaryConsolation: U }, result: { error: Cp }, stack: h });
4139
4139
  let w = ae({ entryStageSequence: n, participantId: I, entryPosition: c, entryStatus: i, entryStage: a, extensions: d });
4140
4140
  return p && Le({ element: w, extension: p }), l && Le({ extension: { name: "roundEntry", value: l }, element: w }), o.entries || (o.entries = []), o.entries.push(w), Je({ drawDefinition: o }), { ...x };
@@ -4152,9 +4152,9 @@ function cF(e) {
4152
4152
  if (!a && !m && u !== zt && h < s.length) return { error: Mg };
4153
4153
  let g = [], I = o.drawId, y = p?.eventId, U = s.reduce((D, v) => {
4154
4154
  let w = i === Qn && Ns({ participantId: v, drawDefinition: o, entryStatus: i }), S = u === zt && Ns({ entryStage: u, drawDefinition: o, participantId: v }), T = Ns({ participantId: v, drawDefinition: o });
4155
- return i !== Qn && u !== zt && T && (g.push(v), r && Ue({ payload: { error: mu, participantId: v, eventId: y, drawId: I }, topic: vI })), w || S ? D.concat(v) : D;
4155
+ return i !== Qn && u !== zt && T && (g.push(v), r && Ue({ payload: { error: fu, participantId: v, eventId: y, drawId: I }, topic: vI })), w || S ? D.concat(v) : D;
4156
4156
  }, []);
4157
- return g.length && !r ? F({ context: { eventId: y, drawId: I, duplicateEntries: g }, result: { error: mu }, stack: t }) : (s.filter((D) => D && !U.includes(D)).forEach((D) => {
4157
+ return g.length && !r ? F({ context: { eventId: y, drawId: I, duplicateEntries: g }, result: { error: fu }, stack: t }) : (s.filter((D) => D && !U.includes(D)).forEach((D) => {
4158
4158
  let v = { entryStageSequence: c, entryStage: u, participantId: D, entryStatus: i };
4159
4159
  d && Le({ element: v, extension: d }), l && Le({ extension: { name: pn, value: l }, element: v }), o.entries || (o.entries = []), o.entries.push(v);
4160
4160
  }), n && (o.entries = Gi({ entries: o.entries })), Je({ drawDefinition: o }), U?.length || g?.length ? { info: "some participantIds could not be added", participantIdsNotAdded: U, duplicateEntries: g, ...x } : { ...x });
@@ -4179,7 +4179,7 @@ function Lf({ participantId: e, entryStatus: t, entryStage: r, flight: i }) {
4179
4179
  let n = i.drawEntries?.find((a) => a.participantId === e && (!t || t === a.entryStatus) && (!r || r === a.entryStage));
4180
4180
  return e && n;
4181
4181
  }
4182
- function Al({ autoEntryPositions: e = !0, participantIds: t = [], entryStatuses: r, stage: i, event: n }) {
4182
+ function Cl({ autoEntryPositions: e = !0, participantIds: t = [], entryStatuses: r, stage: i, event: n }) {
4183
4183
  let a = "removeEventEntries";
4184
4184
  if (!n?.eventId) return { error: it };
4185
4185
  if (!Array.isArray(t) || t.some((d) => !ct(d))) return F({ result: { error: Wi }, stack: a });
@@ -4226,7 +4226,7 @@ function en(e) {
4226
4226
  }
4227
4227
  if (h.eventType && [Hn, Hr].includes(h.eventType)) {
4228
4228
  let N = (h.entries || []).map((L) => L.participantId), C = (h.entries || []).filter((L) => La(L.entryStatus)).map((L) => L.participantId), k = (c?.participants ?? []).filter((L) => N.includes(L.participantId) && L.participantType && [we, Ge].includes(L.participantType)).map((L) => L.individualParticipantIds).flat(1 / 0), O = C.filter((L) => k.includes(L));
4229
- O.length && (w.push(...O), Al({ participantIds: O, autoEntryPositions: !1, event: h }));
4229
+ O.length && (w.push(...O), Cl({ participantIds: O, autoEntryPositions: !1, event: h }));
4230
4230
  }
4231
4231
  if (M.length !== I.length) return F({ context: { mismatchedGender: T, gender: h.gender }, result: { error: Gr }, stack: g });
4232
4232
  i && (h.entries = Gi({ entries: h.entries || [] }));
@@ -4263,7 +4263,7 @@ function Gb({ individualParticipantIds: e = [], groupingParticipant: t, tourname
4263
4263
  s.push(p);
4264
4264
  for (let g of r.events ?? []) for (let I of g.drawDefinitions ?? []) {
4265
4265
  let { extension: y } = De({ element: I, name: Yn }), U = y?.value[t.participantId];
4266
- y && U && (y.value[t.participantId] = U.filter((v) => v.participantId !== p), Le({ element: I, extension: y }), dl({ drawDefinition: I }));
4266
+ y && U && (y.value[t.participantId] = U.filter((v) => v.participantId !== p), Le({ element: I, extension: y }), pl({ drawDefinition: I }));
4267
4267
  let D = Ur({ drawDefinition: I, inContext: !1 }).matchUps ?? [];
4268
4268
  for (let v of D) {
4269
4269
  let w = v.sides ?? [];
@@ -4300,7 +4300,7 @@ function go(e) {
4300
4300
  if (u?.length || l.length) return { error: Ic };
4301
4301
  let d = {}, p = {};
4302
4302
  for (let f of i.events || []) {
4303
- let h = Al({ participantIds: n, event: f });
4303
+ let h = Cl({ participantIds: n, event: f });
4304
4304
  if (h.error) return h;
4305
4305
  d[f.eventId] = h.participantIdsRemoved;
4306
4306
  }
@@ -4336,7 +4336,7 @@ function Wb({ removeGroupParticipant: e, tournamentRecord: t, drawDefinition: r,
4336
4336
  if (!u.participantType || ![we, Pr].includes(u.participantType) || u.participantType === Pr && s.eventType !== Hr || u.participantType === we && s.eventType !== Hn) return { error: qi };
4337
4337
  let l = (s.entries ?? []).find((I) => I.participantId === i);
4338
4338
  if (!l) return { error: LD };
4339
- let { stageEntries: d } = $b({ selected: !1, drawDefinition: r, drawId: n, event: s, stage: a }), p = d.map(Pe), m = c.filter(({ participantId: I }) => p.includes(I)).map(({ individualParticipantIds: I }) => I).flat().filter(Boolean), f = u.individualParticipantIds?.filter((I) => Ji(I, m).length === 1), h = Al({ participantIds: [i], event: s });
4339
+ let { stageEntries: d } = $b({ selected: !1, drawDefinition: r, drawId: n, event: s, stage: a }), p = d.map(Pe), m = c.filter(({ participantId: I }) => p.includes(I)).map(({ individualParticipantIds: I }) => I).flat().filter(Boolean), f = u.individualParticipantIds?.filter((I) => Ji(I, m).length === 1), h = Cl({ participantIds: [i], event: s });
4340
4340
  if (h.error || f?.length && (h = en({ participantIds: f, entryStatus: Ii, entryStage: l.entryStage, tournamentRecord: t, drawDefinition: r, drawId: n, event: s }), h.error)) return h;
4341
4341
  let g;
4342
4342
  return e && go({ participantIds: [i], tournamentRecord: t }).success && (g = !0), { ...x, participantRemoved: g };
@@ -4353,8 +4353,8 @@ function qb(e) {
4353
4353
  }
4354
4354
  return i ? { destroyedCount: i, ...x } : { error: n };
4355
4355
  }
4356
- function Cu(e) {
4357
- let { tournamentRecord: t, replaceWithBye: r, drawDefinition: i, destroyPair: n, entryStatus: a, matchUpsMap: s, drawId: o } = e, c = "removeDrawPositionAssignment", u = Rl(e);
4356
+ function Ou(e) {
4357
+ let { tournamentRecord: t, replaceWithBye: r, drawDefinition: i, destroyPair: n, entryStatus: a, matchUpsMap: s, drawId: o } = e, c = "removeDrawPositionAssignment", u = Nl(e);
4358
4358
  if (u.error) return F({ result: u, stack: c });
4359
4359
  let { participantId: l } = u, { drawPosition: d, event: p, structureId: m } = e, f = xe({ tournamentRecord: t, drawDefinition: i, event: p }).appliedPolicies ?? {};
4360
4360
  if ([Ri, Cn].includes(a) && l) {
@@ -4373,7 +4373,7 @@ function Cu(e) {
4373
4373
  return OI({ structure: h, drawPositions: [d] }), cm({ appliedPolicies: f, drawDefinition: i, positionAction: { name: "removeDrawPositionAssignment", replaceWithBye: r, drawPosition: d, entryStatus: a, structureId: m } }), u;
4374
4374
  }
4375
4375
  function Hb(e) {
4376
- return Object.assign(e, { entryStatus: Cn }), Cu(e);
4376
+ return Object.assign(e, { entryStatus: Cn }), Ou(e);
4377
4377
  }
4378
4378
  var fa = ({ finishingPosition: e = io, hasExistingDrawDefinition: t, qualifyingRoundNumber: r, structureAbbreviation: i, seedAssignments: n = [], stageSequence: a = 1, qualifyingOnly: s, structureOrder: o, seedingProfile: c, matchUpFormat: u, structureType: l, structureName: d, matchUps: p = [], matchUpType: m, structureId: f, roundOffset: h, roundLimit: g, stageOrder: I, structures: y, tieFormat: U, stage: D }) => {
4379
4379
  let v = { structureId: f ?? Be(), structureAbbreviation: i, finishingPosition: e, seedAssignments: n, matchUpFormat: u, stageSequence: a, structureName: d };
@@ -4393,7 +4393,7 @@ function iy({ structureName: e = ar(zt), structureAbbreviation: t, drawDefinitio
4393
4393
  return r.structures || (r.structures = []), r.structures.push(a), Je({ drawDefinition: r, structureIds: [a.structureId] }), { ...x };
4394
4394
  }
4395
4395
  function ny({ drawPositions: e }) {
4396
- if (!e?.length) return { error: zu };
4396
+ if (!e?.length) return { error: Yu };
4397
4397
  let t = (n) => e.filter((a) => a !== n).map((a) => [n, a]), r = [].concat(...(e ?? []).map(t)), i = ye(r.map(wm)).map((n) => n.split("|").map((a) => +a));
4398
4398
  return { groupMatchUps: r, uniqueMatchUpGroupings: i };
4399
4399
  }
@@ -4422,7 +4422,7 @@ function dF({ rounds: e, hash: t }) {
4422
4422
  return e?.length ? e?.reduce((r, i, n) => i.includes(t) ? n + 1 : r, void 0) : { error: ce };
4423
4423
  }
4424
4424
  var pF = { getRoundRobinGroupMatchUps: ny, determineRoundNumber: dF, drawPositionsHash: wm, groupRounds: zb };
4425
- function Cl(e) {
4425
+ function Ol(e) {
4426
4426
  let { hasExistingDrawDefinition: t, groupNameBase: r = "Group", playoffAttributes: i, stageSequence: n = 1, structureOptions: a, appliedPolicies: s, qualifyingOnly: o, seedingProfile: c, stage: u = re, matchUpType: l, roundTarget: d, structureId: p, groupNames: m, tieFormat: f, drawSize: h, idPrefix: g, isMock: I, uuids: y } = e, U = e.structureName ?? i?.["0"]?.name ?? ar(re), { groupCount: D, groupSize: v } = mF({ structureOptions: a, appliedPolicies: s, drawSize: h }), w = Ya, S, T = te(1, D + 1).map((P) => {
4427
4427
  let M = fF({ groupSize: v, structureOrder: P, matchUpType: l, drawSize: h, idPrefix: g, isMock: I });
4428
4428
  S = Array.isArray(M) ? Math.max(...M.map(({ roundNumber: E }) => E ?? 0)) : 0;
@@ -4432,12 +4432,12 @@ function Cl(e) {
4432
4432
  return d && Le({ extension: { name: pn, value: d }, element: b }), { structures: [b], maxRoundNumber: S, groupCount: D, links: [], groupSize: v, ...x };
4433
4433
  }
4434
4434
  function mF({ appliedPolicies: e, structureOptions: t, drawSize: r }) {
4435
- let i = t?.groupSize, n = t?.groupSizeLimit || 8, { validGroupSizes: a } = Ol({ groupSizeLimit: n, drawSize: r }), s = a && Math.max(...a);
4435
+ let i = t?.groupSize, n = t?.groupSizeLimit || 8, { validGroupSizes: a } = kl({ groupSizeLimit: n, drawSize: r }), s = a && Math.max(...a);
4436
4436
  i && a?.includes(i) || (i && i > 4 || !a?.includes(4) ? i = s : i = 4);
4437
4437
  let o = Math.ceil(r / i);
4438
4438
  return { groupSize: i, groupCount: o };
4439
4439
  }
4440
- function Ol(e) {
4440
+ function kl(e) {
4441
4441
  let { groupSizeLimit: t = 10, drawSize: r = 0 } = e ?? {}, i = te(3, t + 1).filter((n) => {
4442
4442
  let a = Math.ceil(r / n), s = a * n - r, o = Math.ceil(r / a), c = Math.ceil(s / a);
4443
4443
  return (!s || s < n) && o === n && o >= 3 && c < 2;
@@ -4506,7 +4506,7 @@ function sy({ roundRobinGroupsCount: e, drawSize: t }) {
4506
4506
  }
4507
4507
  function oy({ roundRobinGroupsCount: e, participantsCount: t }) {
4508
4508
  if (e) {
4509
- let { validGroupSizes: n } = Ol({ drawSize: t });
4509
+ let { validGroupSizes: n } = kl({ drawSize: t });
4510
4510
  if (!n?.map((a) => Math.ceil(t / a))?.includes(e)) return F({ context: { roundRobinGroupsCount: e }, result: { error: z } });
4511
4511
  }
4512
4512
  let { seedGroups: r } = sy({ drawSize: t, roundRobinGroupsCount: e }), i = r?.map((n) => Math.min(...n)) || [];
@@ -4570,7 +4570,7 @@ function Io({ provisionalPositioning: e, returnAllProxies: t, appliedPolicies: r
4570
4570
  if (b) {
4571
4571
  let C = s?.matchUps ? s.matchUps.filter(({ roundNumber: O }) => O === s.roundLimit).length : 0, k = g.length / C;
4572
4572
  if (!T) {
4573
- let O = kl(i), L = $t(g, k), _ = 1, B = te(0, L[0].length).map(() => {
4573
+ let O = xl(i), L = $t(g, k), _ = 1, B = te(0, L[0].length).map(() => {
4574
4574
  let G = te(_, _ + L.length);
4575
4575
  return _ += L.length, G;
4576
4576
  });
@@ -4585,7 +4585,7 @@ function Io({ provisionalPositioning: e, returnAllProxies: t, appliedPolicies: r
4585
4585
  return !E && !T && !S && !N ? { error: uD, validSeedBlocks: [], isContainer: S, isFeedIn: T } : { isLuckyStructure: E, validSeedBlocks: o, isContainer: S, isFeedIn: T };
4586
4586
  }
4587
4587
  function UF({ seedingProfile: e, structure: t, nonRandom: r }) {
4588
- let i = t.structures || [], n = i.length, a = Ye({ structure: t })?.positionAssignments, s = kl(e), o = a?.length ?? 0, { seedGroups: c } = sy({ roundRobinGroupsCount: n, drawSize: o }), u = i.map((l) => Ye({ structure: l }).positionAssignments?.map((d) => d.drawPosition));
4588
+ let i = t.structures || [], n = i.length, a = Ye({ structure: t })?.positionAssignments, s = xl(e), o = a?.length ?? 0, { seedGroups: c } = sy({ roundRobinGroupsCount: n, drawSize: o }), u = i.map((l) => Ye({ structure: l }).positionAssignments?.map((d) => d.drawPosition));
4589
4589
  return Yb({ drawPositionBlocks: u, positioning: s, seedGroups: c, nonRandom: r });
4590
4590
  }
4591
4591
  function Yb({ drawPositionBlocks: e, positioning: t, seedGroups: r, nonRandom: i }) {
@@ -4601,7 +4601,7 @@ function Yb({ drawPositionBlocks: e, positioning: t, seedGroups: r, nonRandom: i
4601
4601
  }), { validSeedBlocks: n };
4602
4602
  }
4603
4603
  function SF(e) {
4604
- let { drawPositionOffset: t = 0, roundRobinGroupsCount: r, seedNumberOffset: i = 0, seedingProfile: n, seedCountGoal: a, baseDrawSize: s } = e, o = 1, c = [], { seedBlocks: u } = ay({ cluster: kl(n) === Wp, participantsCount: s, roundRobinGroupsCount: r });
4604
+ let { drawPositionOffset: t = 0, roundRobinGroupsCount: r, seedNumberOffset: i = 0, seedingProfile: n, seedCountGoal: a, baseDrawSize: s } = e, o = 1, c = [], { seedBlocks: u } = ay({ cluster: xl(n) === Wp, participantsCount: s, roundRobinGroupsCount: r });
4605
4605
  o = 0;
4606
4606
  for (let d of u) {
4607
4607
  if (o + 1 > a) break;
@@ -4630,7 +4630,7 @@ function Kb(e) {
4630
4630
  return Ir(C).pop();
4631
4631
  }
4632
4632
  }
4633
- function kl(e) {
4633
+ function xl(e) {
4634
4634
  if (typeof e == "string") return e;
4635
4635
  if (typeof e == "object") return e.positioning;
4636
4636
  }
@@ -4768,7 +4768,7 @@ function yo({ drawDefinition: e, participantId: t, tieFormat: r, lineUp: i }) {
4768
4768
  let n = Dm({ lineUp: i, tieFormat: r });
4769
4769
  if (!n.valid) return n;
4770
4770
  let { extension: a } = De({ element: e, name: Yn }), s = a?.value || {};
4771
- return s[t] = uy({ lineUp: i }), Le({ element: e, extension: { name: Yn, value: s } }), dl({ drawDefinition: e }), { ...x };
4771
+ return s[t] = uy({ lineUp: i }), Le({ element: e, extension: { name: Yn, value: s } }), pl({ drawDefinition: e }), { ...x };
4772
4772
  }
4773
4773
  function ly({ inContextDrawMatchUps: e, inheritance: t = !0, tournamentRecord: r, drawDefinition: i, matchUpsMap: n, assignments: a, structure: s, event: o }) {
4774
4774
  if (!i) return { error: ne };
@@ -4803,11 +4803,11 @@ function cn({ provisionalPositioning: e, inContextDrawMatchUps: t, isQualifierPo
4803
4803
  if (U?.map(Pe).includes(o)) return F({ result: { error: Ic }, context: { drawPosition: u }, stack: m });
4804
4804
  let { containsParticipant: v, containsBye: w } = b(D);
4805
4805
  if (w) {
4806
- let P = Rl({ inContextDrawMatchUps: t, tournamentRecord: n, drawDefinition: a, drawPosition: u, structureId: d, matchUpsMap: l, event: p });
4806
+ let P = Nl({ inContextDrawMatchUps: t, tournamentRecord: n, drawDefinition: a, drawPosition: u, structureId: d, matchUpsMap: l, event: p });
4807
4807
  if (P.error) return F({ result: P, stack: m });
4808
4808
  }
4809
4809
  if (v && D.participantId !== o) {
4810
- let { activeDrawPositions: P } = Ml({ drawDefinition: a, structureId: d });
4810
+ let { activeDrawPositions: P } = Rl({ drawDefinition: a, structureId: d });
4811
4811
  if (P.includes(u)) return F({ result: { error: Pp }, stack: m });
4812
4812
  ly({ assignments: [D], inContextDrawMatchUps: t, tournamentRecord: n, drawDefinition: a, matchUpsMap: l, structure: h });
4813
4813
  }
@@ -4852,7 +4852,7 @@ function dy(e) {
4852
4852
  let D = h.participantId, v = cn({ inContextDrawMatchUps: p, tournamentRecord: n, drawDefinition: a, participantId: s, drawPosition: o, structureId: c, matchUpsMap: m, event: u });
4853
4853
  return v.success ? U({ appliedPolicies: d, removedParticipantId: D }) : F({ result: v, stack: l });
4854
4854
  }
4855
- let g = Rl({ inContextDrawMatchUps: p, tournamentRecord: n, drawDefinition: a, drawPosition: o, structureId: c, matchUpsMap: m, event: u });
4855
+ let g = Nl({ inContextDrawMatchUps: p, tournamentRecord: n, drawDefinition: a, drawPosition: o, structureId: c, matchUpsMap: m, event: u });
4856
4856
  if (g.error) return F({ result: g, stack: l });
4857
4857
  let I = g.participantId, y = cn({ inContextDrawMatchUps: p, isQualifierPosition: r, tournamentRecord: n, drawDefinition: a, participantId: s, drawPosition: o, structureId: c, matchUpsMap: m, event: u });
4858
4858
  if (!y.success) return F({ result: y, stack: l });
@@ -5000,7 +5000,7 @@ function Lh({ significantCharacters: e, accessors: t = [], value: r }) {
5000
5000
  }
5001
5001
  function TF({ targetParticipantIds: e, policyAttributes: t, idCollections: r, participants: i }) {
5002
5002
  if (!Array.isArray(t)) return { error: Dg };
5003
- if (!Array.isArray(i)) return { error: Qu };
5003
+ if (!Array.isArray(i)) return { error: Ju };
5004
5004
  let n = {};
5005
5005
  return e.forEach((a) => {
5006
5006
  let s = i.find((c) => c.participantId === a), { values: o } = cM({ policyAttributes: t, idCollections: r, participants: i, participant: s });
@@ -5207,7 +5207,7 @@ function LF({ provisionalPositioning: e, inContextDrawMatchUps: t, unseededByePo
5207
5207
  l || ({ structure: l } = me({ drawDefinition: a, structureId: u })), u || ({ structureId: u } = l);
5208
5208
  let { positionAssignments: f } = Ft({ structure: l }), { seedAssignments: h } = mi({ provisionalPositioning: e, drawDefinition: a, structure: l }), g = h?.map((b) => b.participantId).filter(Boolean), { stage: I, stageSequence: y } = l, U = I === oe ? De({ element: l, name: pn })?.extension?.value : void 0, D = so({ provisionalPositioning: e, drawDefinition: a, stageSequence: y, entryStatuses: fs, structureId: u, roundTarget: U, stage: I }), v = D.filter((b) => !g?.includes(b.participantId)).map((b) => b.participantId), w = f?.filter((b) => !b.participantId && !b.bye && !b.qualifier).map((b) => b.drawPosition);
5209
5209
  if (!i && v.length > (w?.length || 0)) return F({ result: { error: Ng }, context: { unseededParticipantsCount: v.length, unfilledDrawPositionsCount: w?.length }, stack: m });
5210
- let { appliedPolicies: S } = xe({ tournamentRecord: n, drawDefinition: a, event: p }), T = S?.[bu];
5210
+ let { appliedPolicies: S } = xe({ tournamentRecord: n, drawDefinition: a, event: p }), T = S?.[Mu];
5211
5211
  if (l.stage === yt) {
5212
5212
  let b = D.reduce((P, M) => (P[M.groupingValue] || (P[M.groupingValue] = []), P[M.groupingValue].push(M.participantId), P), {});
5213
5213
  Object.keys(b).length && (T || (T = { policyName: "Playoff Avoidance" }), T.policyAttributes || (T.policyAttributes = []), T.policyAttributes.push({ groupings: b }));
@@ -5344,7 +5344,7 @@ function KF({ provisionalPositioning: e, seedOrderByePositions: t, isLuckyStruct
5344
5344
  return O;
5345
5345
  }, { validSeedBlocks: b } = Io({ provisionalPositioning: e, allPositions: !0, appliedPolicies: i, drawDefinition: n, structure: s }), P = b?.map((N) => N.drawPositions?.map((C) => C + y)), M;
5346
5346
  if (o) {
5347
- let N = I.length, { seedBlocks: C } = ay({ cluster: kl(c) === Wp, participantsCount: N });
5347
+ let N = I.length, { seedBlocks: C } = ay({ cluster: xl(c) === Wp, participantsCount: N });
5348
5348
  M = C.map((k) => k.map((O) => O + y)).map(T).filter((k) => k.length);
5349
5349
  } else u ? M = P?.map((N) => N.filter(S)) : M = P?.map(T).filter((N) => N.length);
5350
5350
  let R = g.map((N) => N.drawPositions).map((N) => N?.sort((C, k) => C - k)).filter((N) => N?.[0] + 1 === N?.[1]), E = (N) => R.reduce((C, k) => k.includes(N) ? k.reduce((O, L) => L !== N ? L : O, void 0) : C, void 0), A = M.map((N) => N.map(E)).flat(1 / 0).filter(S).filter(w).filter(Boolean);
@@ -5375,7 +5375,7 @@ function fv({ provisionalPositioning: e, tournamentRecord: t, appliedPolicies: r
5375
5375
  }
5376
5376
  return { ...x, unseededByePositions: S, byeDrawPositions: M };
5377
5377
  }
5378
- function xl(e) {
5378
+ function Fl(e) {
5379
5379
  let { drawDefinition: t } = e, { applyPositioning: r = !0, provisionalPositioning: i, multipleStructures: n, placeByes: a = !0, tournamentRecord: s, placementGroup: o, seedingProfile: c, structureId: u, seedLimit: l, seedsOnly: d, drawType: p, drawSize: m, event: f } = e, h = [];
5380
5380
  r || (cT(), t = ie(t, !1, !0));
5381
5381
  let g = (N) => (r || Ud(), F({ result: N, stack: "automatedPositioning" })), I = (N) => (r || Ud(), N), y = me({ drawDefinition: t, structureId: u });
@@ -5389,7 +5389,7 @@ function xl(e) {
5389
5389
  let { validSeedBlocks: M } = P;
5390
5390
  h.push({ validSeedBlocks: M });
5391
5391
  let R = e.participants || (s ? pt({ withIndividualParticipants: !0, convertExtensions: !0, tournamentRecord: s })?.participants : []);
5392
- if (kl(U.seedingProfile || c) === Ha) {
5392
+ if (xl(U.seedingProfile || c) === Ha) {
5393
5393
  let N = a ? fv({ provisionalPositioning: i, tournamentRecord: s, appliedPolicies: D, drawDefinition: t, seedBlockInfo: P, matchUpsMap: S, structure: U, seedLimit: l, seedsOnly: d, event: f }) : void 0;
5394
5394
  if (N?.error) return g(N);
5395
5395
  b = N.unseededByePositions, h.push({ action: "positionByes", unseededByePositions: b });
@@ -5421,7 +5421,7 @@ function Oc(e) {
5421
5421
  if (!kn({ drawDefinition: n, structureId: s }) && !r) return { error: pg };
5422
5422
  let u = oM({ drawDefinition: n, structureId: s }).playoffStructures?.sort((p, m) => zd(p) - zd(m)), l = [], d = [];
5423
5423
  if (u) for (let p of u) {
5424
- let { structureId: m } = p, f = xl({ structureId: m, provisionalPositioning: r, applyPositioning: t, tournamentRecord: i, drawDefinition: n, seedingProfile: a, placeByes: o, seedsOnly: c });
5424
+ let { structureId: m } = p, f = Fl({ structureId: m, provisionalPositioning: r, applyPositioning: t, tournamentRecord: i, drawDefinition: n, seedingProfile: a, placeByes: o, seedsOnly: c });
5425
5425
  if (f.error) return f;
5426
5426
  f.positionAssignments && l.push({ positionAssignments: f.positionAssignments, structureId: m }), f.positioningReport && d.push(f.positioningReport);
5427
5427
  }
@@ -5448,7 +5448,7 @@ function dM({ validation: e = !0, tournamentRecord: t, drawDefinition: r, partic
5448
5448
  function fy({ qualifyingParticipantId: e, tournamentRecord: t, drawDefinition: r, drawPosition: i, structureId: n }) {
5449
5449
  return dy({ positionActionName: "qualifierDrawPositionAssignment", participantId: e, isQualifierPosition: !0, tournamentRecord: t, drawDefinition: r, drawPosition: i, structureId: n });
5450
5450
  }
5451
- function Ou({ targetRoundNumber: e, finishingPosition: t, drawDefinition: r, structureId: i, linkType: n }) {
5451
+ function ku({ targetRoundNumber: e, finishingPosition: t, drawDefinition: r, structureId: i, linkType: n }) {
5452
5452
  let { links: a } = Rc({ drawDefinition: r, structureId: i }) || {}, s = (a?.target || []).filter(({ linkType: o }) => o === n).filter(({ target: o }) => !e || e === o.roundNumber).map((o) => {
5453
5453
  let c = o.source.structureId, { structure: u } = me({ structureId: c, drawDefinition: r });
5454
5454
  if (!(t && u?.finishingPosition !== t)) return o;
@@ -5478,7 +5478,7 @@ function pM({ targetRoundNumber: e = 1, tournamentRecord: t, drawDefinition: r,
5478
5478
  if (!l.length) return F({ result: { error: Rg } });
5479
5479
  let p = te(0, l.length);
5480
5480
  n && (p = QF(p, n));
5481
- let m = d.map((g) => g.participantId).filter(Boolean), { relevantLinks: f } = Ou({ structureId: c.structureId, targetRoundNumber: e, linkType: Mn, drawDefinition: r }) || {}, { relevantLinks: h } = Ou({ structureId: c.structureId, targetRoundNumber: e, linkType: bn, drawDefinition: r }) || {};
5481
+ let m = d.map((g) => g.participantId).filter(Boolean), { relevantLinks: f } = ku({ structureId: c.structureId, targetRoundNumber: e, linkType: Mn, drawDefinition: r }) || {}, { relevantLinks: h } = ku({ structureId: c.structureId, targetRoundNumber: e, linkType: bn, drawDefinition: r }) || {};
5482
5482
  for (let g of f) {
5483
5483
  let I = r.structures?.find((U) => U.structureId === g.source.structureId);
5484
5484
  if (I?.stage !== oe) continue;
@@ -5623,7 +5623,7 @@ function gy({ drawDefinition: e, timeItem: t }) {
5623
5623
  if (i.filter((a) => r.includes(a)).length !== i.length) return { error: Cg };
5624
5624
  e.timeItems || (e.timeItems = []);
5625
5625
  let n = (/* @__PURE__ */ new Date()).toISOString();
5626
- return Object.assign(t, { createdAt: n }), e.timeItems.push(t), dl({ drawDefinition: e }), { ...x };
5626
+ return Object.assign(t, { createdAt: n }), e.timeItems.push(t), pl({ drawDefinition: e }), { ...x };
5627
5627
  }
5628
5628
  function gM(e) {
5629
5629
  let { tournamentRecord: t, drawDefinition: r, structureId: i, event: n } = e, a = se(e, [{ drawDefinition: !0, structureId: !0 }]);
@@ -5649,7 +5649,7 @@ function ZF({ isQualifyingStructure: e, tournamentRecord: t, drawDefinition: r,
5649
5649
  }
5650
5650
  if (Rt({ matchUpFilters: { structureIds: o }, drawDefinition: r }).matchUps?.some(({ score: c }) => Lt({ score: c }))) {
5651
5651
  let c = xe({ tournamentRecord: t, drawDefinition: r, structure: n, event: a })?.appliedPolicies;
5652
- if (!(s ?? c?.[pi]?.allowDeletionWithScoresPresent?.structures)) return { error: Ju };
5652
+ if (!(s ?? c?.[pi]?.allowDeletionWithScoresPresent?.structures)) return { error: Zu };
5653
5653
  }
5654
5654
  return { ...x };
5655
5655
  }
@@ -5709,11 +5709,11 @@ function UM({ tournamentRecord: e, drawDefinition: t, event: r, structureId: i }
5709
5709
  if (!t) return { error: ne };
5710
5710
  let n = t.structures?.find((s) => s.stage === oe && s.structureId === i);
5711
5711
  if (!n) return { error: lt };
5712
- if (n.matchUps?.some(({ matchUpStatus: s, score: o }) => Lt({ score: o }) ?? xt.includes(s))) return { error: Ju };
5712
+ if (n.matchUps?.some(({ matchUpStatus: s, score: o }) => Lt({ score: o }) ?? xt.includes(s))) return { error: Zu };
5713
5713
  let a = n.matchUps?.map(({ matchUpId: s }) => s) || [];
5714
5714
  return n.positionAssignments = [], n.seedAssignments = [], n.matchUps = [], Fn({ tournamentId: e?.tournamentId, action: "resetVoluntaryConsolationStructure", matchUpIds: a, drawDefinition: t }), Je({ tournamentId: e?.tournamentId, eventId: r?.eventId, drawDefinition: t, structureIds: [n.structureId] }), { ...x };
5715
5715
  }
5716
- var oL = "qualifierDrawPositionAssignment", cL = "withdrawParticipantAtDrawPosition", uL = "alternateDrawPositionAssignment", lL = "luckyLoserDrawPositionAssignment", hv = "removeDrawPositionAssignment", SM = "swapDrawPositionAssignments", dL = "modifyPairAssignment", pL = "adHocPositionSwap", mL = "modifyParticipantOtherName", gv = "assignDrawPosition", fL = "removeSeededParticipant", hL = "assignDrawPositionBye", gL = "modifySeedAssignment", vM = "addPenalty", Iy = "MODIFY_PAIR", bm = "QUALIFIER", yy = "ALTERNATE", Uy = "WITHDRAW", Ws = "ASSIGN", Bh = "REMOVE", Sy = "LUCKY", su = "REMOVE_SEED", Mm = "SWAP", ku = "NICKNAME", As = "SEED_VALUE", qs = "PENALTY", IL = { MODIFY_PAIR_ASSIGNMENT: Iy, QUALIFYING_PARTICIPANT: bm, ALTERNATE_PARTICIPANT: yy, WITHDRAW_PARTICIPANT: Uy, ASSIGN_PARTICIPANT: Ws, LUCKY_PARTICIPANT: Sy, REMOVE_ASSIGNMENT: Bh, SWAP_PARTICIPANTS: Mm, ADD_NICKNAME: ku, REMOVE_SEED: su, ADD_PENALTY: qs, ASSIGN_BYE: "BYE", SEED_VALUE: As };
5716
+ var oL = "qualifierDrawPositionAssignment", cL = "withdrawParticipantAtDrawPosition", uL = "alternateDrawPositionAssignment", lL = "luckyLoserDrawPositionAssignment", hv = "removeDrawPositionAssignment", SM = "swapDrawPositionAssignments", dL = "modifyPairAssignment", pL = "adHocPositionSwap", mL = "modifyParticipantOtherName", gv = "assignDrawPosition", fL = "removeSeededParticipant", hL = "assignDrawPositionBye", gL = "modifySeedAssignment", vM = "addPenalty", Iy = "MODIFY_PAIR", bm = "QUALIFIER", yy = "ALTERNATE", Uy = "WITHDRAW", Ws = "ASSIGN", Bh = "REMOVE", Sy = "LUCKY", ou = "REMOVE_SEED", Mm = "SWAP", xu = "NICKNAME", As = "SEED_VALUE", qs = "PENALTY", IL = { MODIFY_PAIR_ASSIGNMENT: Iy, QUALIFYING_PARTICIPANT: bm, ALTERNATE_PARTICIPANT: yy, WITHDRAW_PARTICIPANT: Uy, ASSIGN_PARTICIPANT: Ws, LUCKY_PARTICIPANT: Sy, REMOVE_ASSIGNMENT: Bh, SWAP_PARTICIPANTS: Mm, ADD_NICKNAME: xu, REMOVE_SEED: ou, ADD_PENALTY: qs, ASSIGN_BYE: "BYE", SEED_VALUE: As };
5717
5717
  function wM({ tournamentRecord: e, drawDefinition: t, drawPositions: r, structureId: i, event: n }) {
5718
5718
  if (!t) return { error: ne };
5719
5719
  if (!i) return { error: ri };
@@ -5745,8 +5745,8 @@ function yL({ inContextDrawMatchUps: e, tournamentRecord: t, drawDefinition: r,
5745
5745
  return o.some(({ bye: u }) => u) && !c ? DM({ inContextDrawMatchUps: e, tournamentRecord: t, drawDefinition: r, assignments: o, matchUpsMap: n, structure: a, event: s }) : UL({ inContextDrawMatchUps: e, tournamentRecord: t, drawDefinition: r, assignments: o, matchUpsMap: n, structure: a, event: s });
5746
5746
  }
5747
5747
  function DM({ inContextDrawMatchUps: e, tournamentRecord: t, drawDefinition: r, assignments: i, matchUpsMap: n, structure: a, event: s }) {
5748
- let o = i.find(({ bye: f }) => f), c = i.find(({ participantId: f }) => f), u = o.drawPosition, { participantId: l, drawPosition: d } = c, { structureId: p } = a, m = Cu({ drawPosition: u, inContextDrawMatchUps: e, tournamentRecord: t, drawDefinition: r, structureId: p, matchUpsMap: n });
5749
- return m.error || (m = Cu({ drawPosition: d, inContextDrawMatchUps: e, tournamentRecord: t, drawDefinition: r, structureId: p, matchUpsMap: n }), m.error) || (ai({ drawPosition: d, tournamentRecord: t, drawDefinition: r, structureId: p, matchUpsMap: n, event: s }), m = cn({ drawPosition: u, inContextDrawMatchUps: e, tournamentRecord: t, drawDefinition: r, structureId: p, participantId: l, matchUpsMap: n, event: s }), m.error) ? m : { ...x };
5748
+ let o = i.find(({ bye: f }) => f), c = i.find(({ participantId: f }) => f), u = o.drawPosition, { participantId: l, drawPosition: d } = c, { structureId: p } = a, m = Ou({ drawPosition: u, inContextDrawMatchUps: e, tournamentRecord: t, drawDefinition: r, structureId: p, matchUpsMap: n });
5749
+ return m.error || (m = Ou({ drawPosition: d, inContextDrawMatchUps: e, tournamentRecord: t, drawDefinition: r, structureId: p, matchUpsMap: n }), m.error) || (ai({ drawPosition: d, tournamentRecord: t, drawDefinition: r, structureId: p, matchUpsMap: n, event: s }), m = cn({ drawPosition: u, inContextDrawMatchUps: e, tournamentRecord: t, drawDefinition: r, structureId: p, participantId: l, matchUpsMap: n, event: s }), m.error) ? m : { ...x };
5750
5750
  }
5751
5751
  function UL({ inContextDrawMatchUps: e, tournamentRecord: t, drawDefinition: r, assignments: i, matchUpsMap: n, structure: a, event: s }) {
5752
5752
  let o = Object.assign({}, ...i.map((c, u) => {
@@ -5781,14 +5781,14 @@ function TM({ tournamentRecord: e, drawDefinition: t, participantId: r, structur
5781
5781
  let a = (t.structures ?? []).find((s) => s.structureId === i);
5782
5782
  return a ? !a.stage || ![re, oe].includes(a.stage) || a.stage === re && a.stageSequence !== 1 ? F({ result: { error: as }, stack: n }) : a.seedAssignments?.find((s) => s.participantId === r) ? { ...x } : F({ info: "participant not seeded", result: { error: Kt }, context: { participantId: r } }) : F({ result: { error: lt }, stack: n });
5783
5783
  }
5784
- function Fl({ targetEntryRound: e = 1, finishingPositions: t, sourceRoundNumber: r, sourceStructureId: i, targetStructureId: n, linkType: a = Mn }) {
5784
+ function Ll({ targetEntryRound: e = 1, finishingPositions: t, sourceRoundNumber: r, sourceStructureId: i, targetStructureId: n, linkType: a = Mn }) {
5785
5785
  return !i || !n ? { error: ri } : { link: ae({ linkType: a, source: { roundNumber: r, structureId: i, finishingPositions: t }, target: { feedProfile: Di, roundNumber: e, structureId: n } }) };
5786
5786
  }
5787
5787
  function Uo({ matchUp: e, tieFormat: t, isMock: r, uuids: i }) {
5788
5788
  let { collectionDefinitions: n } = t ?? {};
5789
- return { tieMatchUps: (n ?? []).map((a) => Ll({ matchUp: e, collectionDefinition: a, uuids: i, isMock: r })).filter(Boolean).flat() };
5789
+ return { tieMatchUps: (n ?? []).map((a) => _l({ matchUp: e, collectionDefinition: a, uuids: i, isMock: r })).filter(Boolean).flat() };
5790
5790
  }
5791
- function Ll({ collectionPositionOffset: e = 0, collectionDefinition: t, matchUpsLimit: r, matchUp: i, isMock: n, uuids: a }) {
5791
+ function _l({ collectionPositionOffset: e = 0, collectionDefinition: t, matchUpsLimit: r, matchUp: i, isMock: n, uuids: a }) {
5792
5792
  let { matchUpCount: s, matchUpType: o, collectionId: c, processCodes: u } = t || {}, l = r ?? s ?? 0, d = (p) => {
5793
5793
  if (!n && !i?.isMock) return a?.pop() ?? Be();
5794
5794
  let m = t?.collectionId;
@@ -5826,23 +5826,23 @@ function un({ finishingPositionOffset: e, finishingPositionLimit: t, qualifyingR
5826
5826
  let d = te(1, o + 1).map((g) => ({ drawPosition: g })), p, m = [], f = 1;
5827
5827
  for ({ roundNodes: p, matchUps: m } = rp({ matchUpType: n, roundNumber: f, idPrefix: s, matchUps: m, isMock: c, nodes: d, uuids: u }), f++, a = a ?? r; p.length > 1; ) i && p.length === i && (a = f - 1), { roundNodes: p, matchUps: m } = rp({ nodes: p, matchUpType: n, roundNumber: f, idPrefix: s, matchUps: m, isMock: c, uuids: u }), f++;
5828
5828
  let h = f - 1;
5829
- return m = Pl({ finishingPositionOffset: e, finishingPositionLimit: t, roundsCount: h, roundLimit: a, matchUps: m }), a ? m = m.filter((g) => a && (g.roundNumber ?? 0) <= a) : a = f - 1, { drawSize: o, matchUps: m, roundsCount: h, roundLimit: a };
5829
+ return m = bl({ finishingPositionOffset: e, finishingPositionLimit: t, roundsCount: h, roundLimit: a, matchUps: m }), a ? m = m.filter((g) => a && (g.roundNumber ?? 0) <= a) : a = f - 1, { drawSize: o, matchUps: m, roundsCount: h, roundLimit: a };
5830
5830
  }
5831
5831
  function wy(e) {
5832
5832
  let t = "generateQualifyingStructure";
5833
5833
  if (!e.drawDefinition) return F({ result: { error: ne }, stack: t });
5834
5834
  if (e.drawSize && !Ie(e.drawSize) || e.participantsCount && !Ie(e.participantsCount) || e.qualifyingPositions && !Ie(e.qualifyingPositions)) return F({ result: { error: z }, stack: t });
5835
5835
  let r = e.drawSize ?? lg(e.participantsCount), { hasExistingDrawDefinition: i, qualifyingRoundNumber: n, qualifyingPositions: a, targetStructureId: s, structureOptions: o, appliedPolicies: c, qualifyingOnly: u, drawDefinition: l, matchUpFormat: d, structureName: p, structureId: m, roundTarget: f, tieFormat: h, drawType: g, idPrefix: I, isMock: y, uuids: U } = e;
5836
- if (!e.drawSize) return F({ result: { error: Yu }, context: { drawSize: r }, stack: t });
5836
+ if (!e.drawSize) return F({ result: { error: Ku }, context: { drawSize: r }, stack: t });
5837
5837
  if (a && a >= e.drawSize) return F({ result: { error: z }, context: { drawSize: r, qualifyingPositions: a }, stack: t });
5838
5838
  let D, v, w, S, T = 0, b, P = 1, { structureProfiles: M } = Pm({ drawDefinition: l }), R = M[s];
5839
5839
  if (!R) return F({ result: { error: lt }, context: { targetStructureId: s }, stack: t });
5840
5840
  let E = l.matchUpType, A = f ? `${f}-` : "", N = R.stage === oe, C = c?.[zn]?.namingConventions?.pre ?? ox[zn]?.namingConventions?.pre, k = N && C ? `${C}-` : "", O = p ?? (A ? `${k}${ar(oe)} ${A}` : `${k}${ar(oe)}`);
5841
5841
  if (g === Ei) {
5842
- let { maxRoundNumber: B, structures: G, groupCount: $ } = Cl({ structureName: p ?? O, structureId: m ?? U?.pop(), hasExistingDrawDefinition: i, stage: oe, structureOptions: o, appliedPolicies: c, qualifyingOnly: u, stageSequence: P, matchUpType: E, roundTarget: f, tieFormat: h, idPrefix: I, drawSize: r, isMock: y, uuids: U });
5842
+ let { maxRoundNumber: B, structures: G, groupCount: $ } = Ol({ structureName: p ?? O, structureId: m ?? U?.pop(), hasExistingDrawDefinition: i, stage: oe, structureOptions: o, appliedPolicies: c, qualifyingOnly: u, stageSequence: P, matchUpType: E, roundTarget: f, tieFormat: h, idPrefix: I, drawSize: r, isMock: y, uuids: U });
5843
5843
  T = $, D = B, w = G[0], b = [1];
5844
5844
  } else ({ drawSize: r, matchUps: S, roundLimit: D, roundsCount: v } = un({ qualifyingRoundNumber: n, qualifyingPositions: a, matchUpType: E, idPrefix: I, drawSize: r, isMock: y, uuids: U })), D || (D = v), w = ui({ structureName: p ?? O, structureId: m ?? U?.pop(), qualifyingRoundNumber: D, stage: oe, matchUpFormat: d, stageSequence: P, matchUpType: E, roundLimit: D, matchUps: S }), f && Le({ extension: { name: pn, value: f }, element: w }), T = S?.filter((B) => B.roundNumber === D)?.length;
5845
- let L = g === Ei ? bn : Mn, _ = w && D && Fl({ sourceStructureId: w.structureId, sourceRoundNumber: D, targetStructureId: s, finishingPositions: b, linkType: L })?.link;
5845
+ let L = g === Ei ? bn : Mn, _ = w && D && Ll({ sourceStructureId: w.structureId, sourceRoundNumber: D, targetStructureId: s, finishingPositions: b, linkType: L })?.link;
5846
5846
  return h && (S = _e({ structure: w })?.matchUps || [], S?.forEach((B) => {
5847
5847
  let { tieMatchUps: G } = Uo({ tieFormat: h, matchUp: B, isMock: y });
5848
5848
  Object.assign(B, { tieMatchUps: G, matchUpType: E });
@@ -5914,7 +5914,7 @@ function Da(e) {
5914
5914
  }
5915
5915
  D !== b - 1 && console.log("ERROR");
5916
5916
  let R = a - y;
5917
- S = Pl({ finishingPositionOffset: l ? R : o, positionsFed: y, roundsCount: D, matchUps: S, fmlc: h });
5917
+ S = bl({ finishingPositionOffset: l ? R : o, positionsFed: y, roundsCount: D, matchUps: S, fmlc: h });
5918
5918
  let E = T?.length ? T[0] : T;
5919
5919
  return E && (E.roundNumber = b - 1, E.matchUps = S), { draw: E, matchUps: S, roundsCount: D };
5920
5920
  function A(N) {
@@ -5999,7 +5999,7 @@ function bL({ playoffSourceRounds: e, roundProfile: t }) {
5999
5999
  return { finishingPositionRange: i.join("-"), finishingPositions: s, roundNumber: r };
6000
6000
  }) };
6001
6001
  }
6002
- function _l({ drawDefinition: e, structureId: t }) {
6002
+ function Bl({ drawDefinition: e, structureId: t }) {
6003
6003
  if (!e) return { error: ne };
6004
6004
  let { matchUps: r, matchUpsMap: i } = Ur({ inContext: !0, drawDefinition: e }), { positionsNotPlayedOff: n, positionsPlayedOff: a } = kc({ drawDefinition: e, matchUpsMap: i }), { structures: s } = Ci({ drawDefinition: e }), o = s.filter((u) => !t && u.stage !== zt || u.structureId === t), c = {};
6005
6005
  for (let u of o) {
@@ -6036,7 +6036,7 @@ function RL({ playoffGroups: e, drawDefinition: t, structureId: r }) {
6036
6036
  if (!t) return { error: ne };
6037
6037
  if (!ct(r) || !Array.isArray(e)) return { error: z };
6038
6038
  let i = e.map(({ finishingPositions: n }) => n).flat();
6039
- return { positionRangeMap: _l({ drawDefinition: t, structureId: r }).playoffFinishingPositionRanges?.filter((n) => i.includes(n.finishingPosition))?.reduce((n, a) => (n[a.finishingPosition] = a, n), {}) };
6039
+ return { positionRangeMap: Bl({ drawDefinition: t, structureId: r }).playoffFinishingPositionRanges?.filter((n) => i.includes(n.finishingPosition))?.reduce((n, a) => (n[a.finishingPosition] = a, n), {}) };
6040
6040
  }
6041
6041
  function NM(e) {
6042
6042
  let { finishingPositionOffset: t = 0, playoffAttributes: r, stageSequence: i = 1, staggeredEntry: n, structureName: a, stage: s = re, matchUpType: o, structureId: c, idPrefix: u, drawSize: l, isMock: d, uuids: p } = e, m = { finishingPositionOffset: t, matchUpType: o, drawSize: l, idPrefix: u, isMock: d, uuids: p }, { matchUps: f } = n ? Da(m) : un(m), h = ui({ structureName: a || r?.["0"]?.name || ar(re), structureId: c || p?.pop(), stageSequence: i, matchUpType: o, matchUps: f, stage: s }), g = [h], I = [];
@@ -6099,13 +6099,13 @@ function CM({ requireSequential: e = !0, playoffMatchUpFormat: t, playoffAttribu
6099
6099
  let w = v.finishingPositions, S = D && w.map((N) => D[N]?.finishingPositions).flat(), T = l * w.length, b = pc(T), P = b === 2 && Zi || v.drawType || Zi;
6100
6100
  S && (h = Math.min(...S) - 1);
6101
6101
  let M = S && `${Math.min(...S)}-${Math.max(...S)}`, R = v.structureName || M && v.playoffAttributes?.[M]?.name || v.playoffAttributes?.["0"]?.name, E = { addNameBaseToAttributeName: v.addNameBaseToAttributeName, playoffStructureNameBase: v.playoffStructureNameBase, finishingPositionNaming: v.finishingPositionNaming, finishingPositionLimit: v.finishingPositionLimit, structureId: v.structureId ?? m?.pop(), playoffAttributes: v.playoffAttributes, structureNameMap: v.structureNameMap, sequenceLimit: v.sequenceLimit, structureName: R, idPrefix: d && `${d}-po`, appliedPolicies: n, finishingPositionOffset: h, stage: yt, stageSequence: a, matchUpType: c, drawSize: b, isMock: p, uuids: m }, A = ({ playoffStructures: N, playoffLinks: C }) => {
6102
- let [k] = N, O = od({ playoffStructureId: k.structureId, finishingPositions: w, sourceStructureId: i });
6102
+ let [k] = N, O = cd({ playoffStructureId: k.structureId, finishingPositions: w, sourceStructureId: i });
6103
6103
  y.push(O), y.push(...C), I.push(...N), g.push({ structureId: k.structureId, finishingPositions: w }), h += T;
6104
6104
  };
6105
6105
  if (P === Zi) {
6106
6106
  let { matchUps: N } = un({ finishingPositionLimit: h + T, idPrefix: d && `${d}-po`, finishingPositionOffset: h, matchUpType: c, drawSize: b, isMock: p, uuids: m }), C = ui({ structureId: v.structureId ?? m?.pop(), matchUpFormat: t, stage: yt, structureName: R, stageSequence: a, matchUps: N });
6107
6107
  I.push(C);
6108
- let k = od({ playoffStructureId: C.structureId, finishingPositions: w, sourceStructureId: i });
6108
+ let k = cd({ playoffStructureId: C.structureId, finishingPositions: w, sourceStructureId: i });
6109
6109
  y.push(k), h += T, g.push({ structureId: C.structureId, finishingPositions: w });
6110
6110
  } else if ([Xo, Qo, yt].includes(P)) {
6111
6111
  let N = { playoffAttributes: v.playoffAttributes ?? r, playoffStructureNameBase: v.playoffStructureNameBase, structureId: v.structureId ?? m?.pop(), structureName: v.structureName, idPrefix: d && `${d}-po`, addNameBaseToAttributeName: !0, finishingPositionOffset: h, stage: yt, roundOffset: 0, stageSequence: a, drawSize: b, isMock: p, uuids: m };
@@ -6113,19 +6113,19 @@ function CM({ requireSequential: e = !0, playoffMatchUpFormat: t, playoffAttribu
6113
6113
  let C = Vo(N);
6114
6114
  if (C.error) return C;
6115
6115
  if (C.links?.length && y.push(...C.links), C.structures?.length && I.push(...C.structures), I.sort(ao), C.structureId) {
6116
- let k = od({ playoffStructureId: C.structureId, finishingPositions: w, sourceStructureId: i });
6116
+ let k = cd({ playoffStructureId: C.structureId, finishingPositions: w, sourceStructureId: i });
6117
6117
  y.push(k), g.push({ structureId: C.structureId, finishingPositions: w });
6118
6118
  }
6119
6119
  h += T;
6120
- } else if ([Jo, sl, Du, wu, vu, Tu].includes(P)) {
6121
- let N = [m?.pop(), m?.pop()], C = { playoffStructureNameBase: v.playoffStructureNameBase, structureId: v.structureId ?? m?.pop(), playoffAttributes: v.playoffAttributes, idPrefix: d && `${d}-po`, finishingPositionOffset: h, uuids: N, stage: yt, structureName: R, matchUpType: c, feedPolicy: u, drawSize: b, isMock: p }, k = { [Jo]: { fmlc: !0, feedRounds: 1 }, [Tu]: { feedRounds: 1 }, [Du]: { feedsFromFinal: 3 }, [wu]: { feedsFromFinal: 2 }, [vu]: { feedsFromFinal: 1 } };
6120
+ } else if ([Jo, ol, Tu, Du, wu, Pu].includes(P)) {
6121
+ let N = [m?.pop(), m?.pop()], C = { playoffStructureNameBase: v.playoffStructureNameBase, structureId: v.structureId ?? m?.pop(), playoffAttributes: v.playoffAttributes, idPrefix: d && `${d}-po`, finishingPositionOffset: h, uuids: N, stage: yt, structureName: R, matchUpType: c, feedPolicy: u, drawSize: b, isMock: p }, k = { [Jo]: { fmlc: !0, feedRounds: 1 }, [Pu]: { feedRounds: 1 }, [Tu]: { feedsFromFinal: 3 }, [Du]: { feedsFromFinal: 2 }, [wu]: { feedsFromFinal: 1 } };
6122
6122
  Object.assign(C, k[P] || {});
6123
- let { structures: O, links: L } = Ds(C), [_] = O, B = od({ playoffStructureId: _.structureId, finishingPositions: w, sourceStructureId: i });
6123
+ let { structures: O, links: L } = Ds(C), [_] = O, B = cd({ playoffStructureId: _.structureId, finishingPositions: w, sourceStructureId: i });
6124
6124
  y.push(B), y.push(...L), I.push(...O), g.push({ structureId: _.structureId, finishingPositions: w }), h += T;
6125
6125
  } else if ([Ei].includes(P)) {
6126
- let { structures: N, links: C } = Cl({ ...E, structureOptions: v.structureOptions || { groupSize: 4 } });
6126
+ let { structures: N, links: C } = Ol({ ...E, structureOptions: v.structureOptions || { groupSize: 4 } });
6127
6127
  A({ playoffStructures: N, playoffLinks: C });
6128
- } else if ([al].includes(P)) {
6128
+ } else if ([sl].includes(P)) {
6129
6129
  let { structures: N, links: C } = NM(E);
6130
6130
  A({ playoffStructures: N, playoffLinks: C });
6131
6131
  } else if ([rk].includes(P)) {
@@ -6138,7 +6138,7 @@ function CM({ requireSequential: e = !0, playoffMatchUpFormat: t, playoffAttribu
6138
6138
  }
6139
6139
  return { finishingPositionTargets: g, positionRangeMap: D, structures: I, links: y };
6140
6140
  }
6141
- function od({ playoffStructureId: e, finishingPositions: t, sourceStructureId: r }) {
6141
+ function cd({ playoffStructureId: e, finishingPositions: t, sourceStructureId: r }) {
6142
6142
  return { linkType: bn, source: { structureId: r, finishingPositions: t }, target: { structureId: e, feedProfile: Di, roundNumber: 1 } };
6143
6143
  }
6144
6144
  function EL(e) {
@@ -6269,7 +6269,7 @@ function LL({ participantResults: e, groupingTotal: t, matchUpFormat: r, tallyPo
6269
6269
  (N === 1 / 0 || isNaN(N)) && (N = 0), e[p].setsWon = m, e[p].setsLost = f, e[p].setsPct = g, e[p].tieMatchUpsWon = I, e[p].tieMatchUpsPct = D, e[p].matchUpsPct = T, e[p].gamesWon = b, e[p].gamesLost = P, e[p].gamesPct = E, e[p].pointsPct = N, e[p].result = `${e[p].matchUpsWon}/${e[p].matchUpsLost}`;
6270
6270
  });
6271
6271
  }
6272
- function Bl({ participantIds: e, pressureRating: t, groupingTotal: r, matchUpFormat: i, tallyPolicy: n, perPlayer: a, matchUps: s }) {
6272
+ function Vl({ participantIds: e, pressureRating: t, groupingTotal: r, matchUpFormat: i, tallyPolicy: n, perPlayer: a, matchUps: s }) {
6273
6273
  let o = {}, c = n?.excludeMatchUpStatuses || [], u = s?.filter((m) => (m.tieMatchUps || !c.includes(m.matchUpStatus)) && (!e?.length || St(e, [_o(m, 0), _o(m, 1)]).length === 2)), l = u?.flatMap(({ score: m, tieMatchUps: f }) => f ? f.filter(({ matchUpStatus: h }) => !c.includes(h)).flatMap(({ score: h }) => h?.sets?.length ?? 0) : m?.sets?.length ?? 0)?.reduce((m, f) => m + f, 0), d = (m) => m?.sets?.reduce((f, h) => f + (h?.side1Score ?? 0) + (h?.side2Score ?? 0), 0) ?? 0, p = u?.flatMap(({ score: m, tieMatchUps: f }) => f ? f.filter(({ matchUpStatus: h }) => !c.includes(h)).flatMap(({ score: h }) => d(h)) : d(m))?.reduce((m, f) => m + f, 0);
6274
6274
  for (let m of u ?? []) {
6275
6275
  let { matchUpStatus: f, tieMatchUps: h, tieFormat: g, score: I, winningSide: y, sides: U } = m, D = g && m._disableAutoCalc && g.collectionDefinitions.every(({ scoreValue: S }) => S), v = y && _L(m), w = y && BL(m);
@@ -6412,7 +6412,7 @@ function GL({ participantResults: e, participantsCount: t }) {
6412
6412
  return t === r.length;
6413
6413
  }
6414
6414
  function $L({ disableHeadToHead: e, participantIds: t, matchUpFormat: r, groupTotals: i, tallyPolicy: n, attribute: a, idsFilter: s, matchUps: o, reversed: c }) {
6415
- let { participantResults: u } = Bl({ participantIds: s && t, groupingTotal: i && a, matchUpFormat: r, tallyPolicy: n, matchUps: o }), l = _M({ participantResults: u, participantIds: t, attribute: a }), d = [{ attribute: a, reversed: c, groups: l, idsFilter: s, groupTotals: i }], p;
6415
+ let { participantResults: u } = Vl({ participantIds: s && t, groupingTotal: i && a, matchUpFormat: r, tallyPolicy: n, matchUps: o }), l = _M({ participantResults: u, participantIds: t, attribute: a }), d = [{ attribute: a, reversed: c, groups: l, idsFilter: s, groupTotals: i }], p;
6416
6416
  return Object.keys(l).length > 1 && t.length && (p = Object.keys(l).map((m) => parseFloat(m)).sort((m, f) => c ? m - f : f - m).map((m) => l[m]).map((m) => {
6417
6417
  let f = VM({ participantResults: u, disableHeadToHead: e, participantIds: m, matchUpFormat: r, tallyPolicy: n, matchUps: o });
6418
6418
  return d.push(...f.report ?? []), f.order;
@@ -6446,7 +6446,7 @@ function xc({ policyDefinitions: e, generateReport: t, pressureRating: r, matchU
6446
6446
  if (o.length !== 1) return F({ result: { error: z, info: "Maximum one structureId" }, stack: "tallyParticipantResults", context: { structureIds: o } });
6447
6447
  let c = n.filter((D) => D && D.matchUpStatus !== "BYE"), u = c.length && ye(c.map(({ drawPositions: D }) => D).flat()).length, l = c.filter((D) => Ga({ matchUp: D })).length === c.length;
6448
6448
  l || (s = 0);
6449
- let d = n.every(({ matchUpType: D, tieMatchUps: v }) => D === rt && v?.every((w) => Ga({ matchUp: w }))), p = e?.[dI], m = n.filter((D) => Ga({ matchUp: D }) ?? D.matchUpType === rt), { participantResults: f } = Bl({ matchUps: m, pressureRating: r, matchUpFormat: i, tallyPolicy: p, perPlayer: s }), h, g, { groupOrder: I, report: y } = wv({ matchUps: m, participantResults: f, participantsCount: u, matchUpFormat: i, subOrderMap: a, tallyPolicy: p });
6449
+ let d = n.every(({ matchUpType: D, tieMatchUps: v }) => D === rt && v?.every((w) => Ga({ matchUp: w }))), p = e?.[dI], m = n.filter((D) => Ga({ matchUp: D }) ?? D.matchUpType === rt), { participantResults: f } = Vl({ matchUps: m, pressureRating: r, matchUpFormat: i, tallyPolicy: p, perPlayer: s }), h, g, { groupOrder: I, report: y } = wv({ matchUps: m, participantResults: f, participantsCount: u, matchUpFormat: i, subOrderMap: a, tallyPolicy: p });
6450
6450
  if (r && qL({ participantResults: f }), l && I) h = y, g = I, I.forEach((D) => {
6451
6451
  let { participantId: v, groupOrder: w, rankOrder: S, subOrder: T, ties: b, GEMscore: P } = D, M = f[v];
6452
6452
  Object.assign(M, { groupOrder: w, rankOrder: S, GEMscore: P, subOrder: T, ties: b });
@@ -6550,7 +6550,7 @@ function tn(e) {
6550
6550
  return Ee({ eventId: p?.eventId, context: t, drawDefinition: o, tournamentId: U, matchUp: i }), { ...x };
6551
6551
  }
6552
6552
  function Ry(e) {
6553
- let { propagateExitStatus: t, matchUpStatusCodes: r, autoCalcDisabled: i, inContextMatchUp: n, matchUpStatus: a, dualMatchUp: s, structure: o, matchUp: c } = e, u = bl({ matchUpStatus: a }) || [mn, Fr].includes(a) && s || i, l = c?.sides?.map((h) => h.participantId).filter(Boolean).length || n?.sides?.map((h) => h.participantId).filter(Boolean).length, d = "attemptToModifyScore";
6553
+ let { propagateExitStatus: t, matchUpStatusCodes: r, autoCalcDisabled: i, inContextMatchUp: n, matchUpStatus: a, dualMatchUp: s, structure: o, matchUp: c } = e, u = Ml({ matchUpStatus: a }) || [mn, Fr].includes(a) && s || i, l = c?.sides?.map((h) => h.participantId).filter(Boolean).length || n?.sides?.map((h) => h.participantId).filter(Boolean).length, d = "attemptToModifyScore";
6554
6554
  if (!(Rr({ structure: o }) && l === 1 || a === Qe && l || HL({ structure: o, matchUp: c, inContextMatchUp: n }) || e.appliedPolicies?.[pi]?.requireParticipantsForScoring === !1 || lr(a) && l === 1 && t)) return F({ result: { error: Ug }, stack: d });
6555
6555
  let p = [st].includes(a), m = u ? a : e.winningSide && Ut || Yr, f = tn({ ...e, winningSide: e.winningSide, matchUpStatusCodes: u && r || [], matchUpStatus: m, removeScore: p });
6556
6556
  return F({ result: f, stack: d });
@@ -6598,7 +6598,7 @@ function zL({ collectionDefinition: e, groupValueNumbers: t, groupValueGroups: r
6598
6598
  function YL({ collectionDefinition: e, collectionPosition: t }) {
6599
6599
  return (e.collectionValueProfiles || [])?.find((r) => r.collectionPosition === t)?.matchUpValue;
6600
6600
  }
6601
- function Vl(e) {
6601
+ function jl(e) {
6602
6602
  let { sideAdjustments: t = [0, 0], separator: r = "-", drawDefinition: i, matchUpsMap: n, structure: a, matchUp: s, event: o } = e;
6603
6603
  if (!Array.isArray(t) || t.length !== 2 || isNaN(t.reduce((D, v) => D + v))) return { error: z };
6604
6604
  if (!s) return { error: br };
@@ -6634,7 +6634,7 @@ function Vl(e) {
6634
6634
  }
6635
6635
  return U && (g.winningSide = U), { scoreStringSide1: I, scoreStringSide2: y, winningSide: U, set: g };
6636
6636
  }
6637
- function jl({ inContextDualMatchUp: e, drawDefinition: t, tournamentId: r, dualMatchUp: i, eventId: n }) {
6637
+ function Gl({ inContextDualMatchUp: e, drawDefinition: t, tournamentId: r, dualMatchUp: i, eventId: n }) {
6638
6638
  if (i) {
6639
6639
  e || (e = at({ matchUpId: i.matchUpId, inContext: !0, drawDefinition: t })?.matchUp);
6640
6640
  let { extension: a } = De({ element: t, name: Yn }), s = ie(a?.value || {}, !1, !0), o = ({ displaySideNumber: c, drawPosition: u, sideNumber: l }) => ({ drawPosition: u, sideNumber: l, displaySideNumber: c });
@@ -6669,13 +6669,13 @@ function aa(e) {
6669
6669
  if (!d.matchUp) return { error: dr };
6670
6670
  let { matchUp: p, structure: m } = d;
6671
6671
  if (!p.tieMatchUps) return { error: xr };
6672
- jl({ tournamentId: l?.tournamentId, eventId: o?.eventId, dualMatchUp: p, drawDefinition: r });
6672
+ Gl({ tournamentId: l?.tournamentId, eventId: o?.eventId, dualMatchUp: p, drawDefinition: r });
6673
6673
  let { extension: f } = De({ name: js, element: p });
6674
6674
  if (f?.value) if (n) yr({ element: p, name: js });
6675
6675
  else return { ...x, score: p.score };
6676
6676
  let h = fr({ drawDefinition: r, structure: m, matchUp: p, event: o })?.tieFormat;
6677
6677
  p.tieFormat = tr(h);
6678
- let g = Vl({ drawDefinition: r, matchUpsMap: a, structure: m, matchUp: p, event: o }), { winningSide: I, set: y, scoreStringSide1: U, scoreStringSide2: D } = g, v = y?.side1Score || y?.side2Score;
6678
+ let g = jl({ drawDefinition: r, matchUpsMap: a, structure: m, matchUp: p, event: o }), { winningSide: I, set: y, scoreStringSide1: U, scoreStringSide2: D } = g, v = y?.side1Score || y?.side2Score;
6679
6679
  if (t && !p.score && !v) return { ...x };
6680
6680
  let w = { scoreStringSide1: U, scoreStringSide2: D, sets: y ? [y] : [] }, S = I && [1, 2].includes(I), T = S && Ut || zI({ matchUpStatus: i ?? p.matchUpStatus, tieMatchUps: p.tieMatchUps, winningSide: p.winningSide, score: w }) && xi || vt, b = !!(p.winningSide && !S), P = p.tieMatchUps.find(({ score: R, winningSide: E, matchUpStatus: A }) => R?.sets?.length && (R.sets[0].side1Score || R.sets[0].side2Score) || A && xt.includes(A) || E), M;
6681
6681
  if (p.tieFormat && !S && !P) {
@@ -6778,7 +6778,7 @@ function XL(e) {
6778
6778
  function qM(e) {
6779
6779
  let t = "directParticipants", r = Ry(e);
6780
6780
  if (r.error) return F({ result: r, stack: t });
6781
- let i = bl({ matchUpStatus: e.matchUpStatus }), { dualWinningSideChange: n, inContextDrawMatchUps: a, projectedWinningSide: s, propagateExitStatus: o, matchUpStatusCodes: c, tournamentRecord: u, drawDefinition: l, matchUpStatus: d, dualMatchUp: p, matchUpsMap: m, winningSide: f, targetData: h, matchUpId: g, structure: I, matchUp: y, event: U } = e, D = !!y.collectionId, v = Rr({ structure: I }), w = y.drawPositions, S;
6781
+ let i = Ml({ matchUpStatus: e.matchUpStatus }), { dualWinningSideChange: n, inContextDrawMatchUps: a, projectedWinningSide: s, propagateExitStatus: o, matchUpStatusCodes: c, tournamentRecord: u, drawDefinition: l, matchUpStatus: d, dualMatchUp: p, matchUpsMap: m, winningSide: f, targetData: h, matchUpId: g, structure: I, matchUp: y, event: U } = e, D = !!y.collectionId, v = Rr({ structure: I }), w = y.drawPositions, S;
6782
6782
  if (D) {
6783
6783
  let { matchUpTieId: T, matchUpsMap: b } = e, P = aa({ appliedPolicies: e.appliedPolicies, matchUpId: T, tournamentRecord: u, drawDefinition: l, matchUpsMap: b, event: U });
6784
6784
  if (S = P && { tieMatchUpResult: P }, w = a.find(({ matchUpId: M }) => M === T)?.drawPositions, !n) return F({ result: { ...x, ...S }, stack: t });
@@ -6799,12 +6799,12 @@ function qM(e) {
6799
6799
  if (j.error) return F({ result: j, stack: t });
6800
6800
  }
6801
6801
  return F({ result: { ...x, ...S }, stack: t, context: R });
6802
- } else return F({ result: { error: zu }, stack: t });
6802
+ } else return F({ result: { error: Yu }, stack: t });
6803
6803
  }
6804
6804
  function Ey(e) {
6805
6805
  let t = "genPlayoffStructure";
6806
6806
  if (!e.drawDefinition) return F({ result: { error: ne }, stack: t });
6807
- let r = _l(e);
6807
+ let r = Bl(e);
6808
6808
  if (r.error) return F({ result: r, stack: t });
6809
6809
  let { structureId: i, addNameBaseToAttributeName: n, playoffStructureNameBase: a, finishingPositionNaming: s, finishingPositionLimit: o, playoffAttributes: c, playoffPositions: u, roundOffsetLimit: l, tournamentRecord: d, exitProfileLimit: p, roundProfiles: m, roundNumbers: f, idPrefix: h, isMock: g, event: I, uuids: y } = e, U = ie(e.drawDefinition, !1, !0), { structure: D } = me({ structureId: i, drawDefinition: U });
6810
6810
  if (!D) return F({ result: { error: lt }, stack: t });
@@ -6900,7 +6900,7 @@ function Ay({ creationTime: e = !0, removePriorValues: t, tournamentRecord: r, d
6900
6900
  let s = Ea({ tournamentRecord: r, participantId: n });
6901
6901
  return s.error ? s : fn({ element: s.participant, removePriorValues: t, duplicateValues: i, creationTime: e, timeItem: a });
6902
6902
  }
6903
- function Gl(e) {
6903
+ function $l(e) {
6904
6904
  let { removePriorValues: t, tournamentRecord: r, duplicateValues: i, creationTime: n, timeItem: a } = e;
6905
6905
  if (!r) return { error: J };
6906
6906
  let s = fn({ element: r, removePriorValues: t, duplicateValues: i, creationTime: n, timeItem: a });
@@ -7003,7 +7003,7 @@ function Dv(e, t) {
7003
7003
  if (!c || !Object.keys(c).length || o && !ct(o)) return { error: z };
7004
7004
  r[a] = e.policyDefinitions[a], i.push(a);
7005
7005
  }
7006
- return i?.length ? { ...Le({ element: t, extension: { name: Mu, value: r } }), applied: i } : { applied: i, error: Tg };
7006
+ return i?.length ? { ...Le({ element: t, extension: { name: Ru, value: r } }), applied: i } : { applied: i, error: Tg };
7007
7007
  }
7008
7008
  function Oy({ tournamentRecord: e, drawDefinition: t, flightProfile: r, drawName: i, drawId: n, event: a }) {
7009
7009
  if (!i || typeof i != "string") return F({ result: { error: z }, context: { drawName: i } });
@@ -7050,7 +7050,7 @@ function KM({ tournamentRecord: e, removeScheduling: t, drawDefinition: r }) {
7050
7050
  let a = (r.structures || []).map(({ structureId: s }) => s);
7051
7051
  return Je({ drawDefinition: r, structureIds: a }), { ...x };
7052
7052
  }
7053
- function $l({ tournamentRecord: e }) {
7053
+ function Wl({ tournamentRecord: e }) {
7054
7054
  if (!e) return { error: J };
7055
7055
  let t = { positionsNoOutcomes: [], canBePruned: [], matchPlay: [], inactive: [], drawAnalysis: {} }, r = {};
7056
7056
  return (e.events?.map((i) => {
@@ -7058,7 +7058,7 @@ function $l({ tournamentRecord: e }) {
7058
7058
  return r[n] = i, (i?.drawDefinitions || []).map((a) => ({ drawDefinition: a, eventId: n }));
7059
7059
  }).flat().filter(Boolean)).forEach(({ drawDefinition: i, eventId: n }) => {
7060
7060
  let a = 0, s = 0, o = 0, { allStructuresLinked: c } = Pm({ drawDefinition: i }), u = r[n], l = (i?.structures || []).map((U) => {
7061
- let { stage: D, stageSequence: v, structureId: w } = U, S = Bs[D], { inContextStructureMatchUps: T } = Ml({ drawDefinition: i, structure: U, event: u }), b = T?.filter(({ winningSide: G }) => G), P = b.filter(Boolean).length || 0;
7061
+ let { stage: D, stageSequence: v, structureId: w } = U, S = Bs[D], { inContextStructureMatchUps: T } = Rl({ drawDefinition: i, structure: U, event: u }), b = T?.filter(({ winningSide: G }) => G), P = b.filter(Boolean).length || 0;
7062
7062
  s += P, o += T.length - s;
7063
7063
  let M = Math.max(b.filter(({ roundNumber: G }) => G === 1).map(({ roundPosition: G }) => G)), { positionAssignments: R } = Ye({ structure: U }), E = R?.filter(({ participantId: G }) => G);
7064
7064
  a += E?.length ?? 0;
@@ -7073,7 +7073,7 @@ function $l({ tournamentRecord: e }) {
7073
7073
  function XM({ matchPlayDrawPositions: e = !0, tournamentRecord: t, drawDefinition: r, drawId: i }) {
7074
7074
  if (!t) return { error: J };
7075
7075
  if (!r) return { error: ne };
7076
- let n = [], { drawsAnalysis: a } = $l({ tournamentRecord: t });
7076
+ let n = [], { drawsAnalysis: a } = Wl({ tournamentRecord: t });
7077
7077
  if (a.canBePruned.includes(i)) {
7078
7078
  let s = a.matchPlay.includes(i), o = a.drawAnalysis[i], { structures: [c] } = Ci({ stageSequence: 1, drawDefinition: r, stage: re }), u = o.structuresData.find(({ structureId: m }) => c.structureId === m), l = (c.matchUps ?? []).sort((m, f) => m.roundPosition - f.roundPosition);
7079
7079
  n = l.filter(({ roundNumber: m }) => !u.inactiveRounds.includes(m));
@@ -7121,7 +7121,7 @@ function JM(e) {
7121
7121
  return t = t.filter((c) => !o.includes(c)), e.roundNumbers && !t.length && (t = o), { existingMatchUps: a, matchUpIds: t, structureId: i, structure: n };
7122
7122
  }
7123
7123
  function ZM(e) {
7124
- let t = se(e, [{ [mr]: !0 }, { [Zo]: { [ol]: !1, roundNumbers: !1 }, [ti]: z, [Er]: cr }]);
7124
+ let t = se(e, [{ [mr]: !0 }, { [Zo]: { [cl]: !1, roundNumbers: !1 }, [ti]: z, [Er]: cr }]);
7125
7125
  if (t.error) return t;
7126
7126
  let { removeIncomplete: r = !1, removeUnAssigned: i = !0, removeCompleted: n = !1, tournamentRecord: a, drawDefinition: s, event: o } = e, c = JM(e);
7127
7127
  if (c.error) return c;
@@ -7151,7 +7151,7 @@ function ZM(e) {
7151
7151
  }
7152
7152
  Je({ structureIds: [l], eventId: o?.eventId, drawDefinition: s });
7153
7153
  }
7154
- return !h.length && p.length ? { error: Ju } : { ...x, deletedMatchUpsCount: [...h, ...g].length };
7154
+ return !h.length && p.length ? { error: Zu } : { ...x, deletedMatchUpsCount: [...h, ...g].length };
7155
7155
  }
7156
7156
  function eR({ removeCompletedMatchUps: e, tournamentRecord: t, drawDefinition: r, structureId: i, roundNumber: n, event: a }) {
7157
7157
  if (!t) return { error: J };
@@ -7208,7 +7208,7 @@ function tR({ tournamentRecord: e, drawDefinition: t, drawPosition: r, structure
7208
7208
  return by({ positionAssignments: c, tournamentRecord: e, drawDefinition: t, matchUpFormat: p, matchUps: d, event: a }), Je({ drawDefinition: t, structureIds: [i] }), { ...x };
7209
7209
  }
7210
7210
  var rR = {};
7211
- Te(rR, { addGoesTo: () => Ja, allPlayoffPositionsFilled: () => my, checkValidEntries: () => xm, findDrawDefinition: () => Ly, getAssignedParticipantIds: () => gs, getAvailableMatchUpsCount: () => Om, getAvailablePlayoffProfiles: () => _l, getDrawDefinitionTimeItem: () => kI, getDrawParticipantRepresentativeIds: () => xy, getDrawStructures: () => Ci, getDrawTypeCoercion: () => Wl, getEligibleVoluntaryConsolationParticipants: () => ky, getMatchUpsMap: () => er, getParticipantIdFinishingPositions: () => Fy, getPositionAssignments: () => xu, getPositionsPlayedOff: () => kc, getRandomQualifierList: () => Vy, getSeedingThresholds: () => oy, getSeedsCount: () => ql, getStructureSeedAssignments: () => mi, getTeamLineUp: () => Qa, getValidGroupSizes: () => Ol, isAdHoc: () => Rr, isCompletedStructure: () => kn, isValidForQualifying: () => jy, positionActions: () => By });
7211
+ Te(rR, { addGoesTo: () => Ja, allPlayoffPositionsFilled: () => my, checkValidEntries: () => xm, findDrawDefinition: () => Ly, getAssignedParticipantIds: () => gs, getAvailableMatchUpsCount: () => Om, getAvailablePlayoffProfiles: () => Bl, getDrawDefinitionTimeItem: () => kI, getDrawParticipantRepresentativeIds: () => xy, getDrawStructures: () => Ci, getDrawTypeCoercion: () => ql, getEligibleVoluntaryConsolationParticipants: () => ky, getMatchUpsMap: () => er, getParticipantIdFinishingPositions: () => Fy, getPositionAssignments: () => Fu, getPositionsPlayedOff: () => kc, getRandomQualifierList: () => Vy, getSeedingThresholds: () => oy, getSeedsCount: () => Hl, getStructureSeedAssignments: () => mi, getTeamLineUp: () => Qa, getValidGroupSizes: () => kl, isAdHoc: () => Rr, isCompletedStructure: () => kn, isValidForQualifying: () => jy, positionActions: () => By });
7212
7212
  function ky({ excludedMatchUpStatuses: e = [], includeEventParticipants: t, includeQualifyingStage: r, finishingRoundLimit: i, policyDefinitions: n, roundNumberLimit: a, tournamentRecord: s, drawDefinition: o, matchUpsLimit: c, requirePlay: u, requireLoss: l, allEntries: d, winsLimit: p, event: m }) {
7213
7213
  if (!o) return { error: ne };
7214
7214
  let f = [re, yt];
@@ -7303,7 +7303,7 @@ function ts(e) {
7303
7303
  let I = s && wr({ matchUpId: s.matchUpId, inContextDrawMatchUps: t, drawDefinition: i }), y = c && ts({ relevantLink: o?.loserTargetLink, targetData: c, inContextDrawMatchUps: t, drawDefinition: i });
7304
7304
  return !!(I && ts({ targetData: I, inContextDrawMatchUps: t, drawDefinition: i }) || y);
7305
7305
  }
7306
- var iR = { [An]: { policyName: "positionActionsDefault", enabledStructures: [{ stages: [oe, re], stageSequences: [1], enabledActions: [], disabledActions: [] }, { stages: [], stageSequences: [], enabledActions: [ku, qs, bm, As], disabledActions: [] }], disbledStructures: [], otherFlightEntries: !1, activePositionOverrides: [] } }, Md = "positionAction", Vh = "matchUpAction";
7306
+ var iR = { [An]: { policyName: "positionActionsDefault", enabledStructures: [{ stages: [oe, re], stageSequences: [1], enabledActions: [], disabledActions: [] }, { stages: [], stageSequences: [], enabledActions: [xu, qs, bm, As], disabledActions: [] }], disbledStructures: [], otherFlightEntries: !1, activePositionOverrides: [] } }, Md = "positionAction", Vh = "matchUpAction";
7307
7307
  function nR({ actionType: e = Md, appliedPolicies: t, drawDefinition: r, structure: i }) {
7308
7308
  let n = e === Md && An || e === Vh && Yt, a = e === Md && iR || e === Vh && Fb, s = n && (t?.[n] || a?.[n]), o = r.links?.filter((d) => d?.target?.structureId === i?.structureId)?.map(({ target: d }) => d.feedProfile) ?? [], { enabledStructures: c, disabledStructures: u } = s || {}, l = u?.find((d) => {
7309
7309
  let { stages: p, stageSequences: m, structureTypes: f, feedProfiles: h } = d;
@@ -7416,7 +7416,7 @@ function km(e) {
7416
7416
  let A = kn({ drawDefinition: t, structure: m }), N = T?.filter((q) => q.participantId).map((q) => q.drawPosition), C = T?.filter((q) => q.bye).map((q) => q.drawPosition), k = p.matchUpStatus === "BYE" || !E && p.drawPositions?.reduce((q, K) => C?.includes(K) || q, !1);
7417
7417
  if (k) return { validActions: M, isByeMatchUp: k };
7418
7418
  Ar({ policyActions: y, action: qh }) && M.push({ type: qh, payload: { matchUpId: c } });
7419
- let O = !bl({ matchUpStatus: p.matchUpStatus }), L = f?.scoring?.structures, _ = m?.stage && L?.stage && L?.stage[m.stage], B = m?.stageSequence && _?.stageSequence && _.stageSequence[m.stageSequence], G = !(f?.scoring?.requireAllPositionsAssigned || _?.requireAllPositionsAssigned || B?.requireAllPositionsAssigned) || b, $ = p.sides && p.sides.filter((q) => q?.participantId).length === 2, j = p.matchUpStatus && [dt, Ot].includes(p.matchUpStatus), V = wr({ inContextDrawMatchUps: D, drawDefinition: t, matchUpId: c }), H = ts({ inContextDrawMatchUps: D, drawDefinition: t, targetData: V }), W = (v?.drawPositions?.length === 2 && v.drawPositions.every((q) => N?.includes(q)) && v?.sides?.length === 2 && v.sides.every(({ participantId: q }) => q) || $) && !(j && H), Y = { method: vM, type: qs, payload: { drawId: d, matchUpId: c, penaltyCode: void 0, penaltyType: void 0, participantIds: [], notes: void 0 } };
7419
+ let O = !Ml({ matchUpStatus: p.matchUpStatus }), L = f?.scoring?.structures, _ = m?.stage && L?.stage && L?.stage[m.stage], B = m?.stageSequence && _?.stageSequence && _.stageSequence[m.stageSequence], G = !(f?.scoring?.requireAllPositionsAssigned || _?.requireAllPositionsAssigned || B?.requireAllPositionsAssigned) || b, $ = p.sides && p.sides.filter((q) => q?.participantId).length === 2, j = p.matchUpStatus && [dt, Ot].includes(p.matchUpStatus), V = wr({ inContextDrawMatchUps: D, drawDefinition: t, matchUpId: c }), H = ts({ inContextDrawMatchUps: D, drawDefinition: t, targetData: V }), W = (v?.drawPositions?.length === 2 && v.drawPositions.every((q) => N?.includes(q)) && v?.sides?.length === 2 && v.sides.every(({ participantId: q }) => q) || $) && !(j && H), Y = { method: vM, type: qs, payload: { drawId: d, matchUpId: c, penaltyCode: void 0, penaltyType: void 0, participantIds: [], notes: void 0 } };
7420
7420
  if (O && M.push({ payload: { drawId: d, matchUpId: c, schedule: {} }, method: $h, type: lR }), Ar({ policyActions: y, action: qs }) && (w?.participant || !o && S?.length) && M.push(Y), O && W && M.push({ type: dR }), G && W) {
7421
7421
  let { matchUpId: q, matchUpFormat: K } = p, X = { drawId: d, matchUpId: q, matchUpFormat: K, outcome: { scoreStringSide1: void 0, scoreStringSide2: void 0, sets: [] }, winningSide: void 0 };
7422
7422
  M.push({ info: "set outcome and winningSide", method: $h, type: pR, payload: X }), Ar({ policyActions: y, action: Hh }) && M.push({ type: Hh }), Ar({ policyActions: y, action: "END" }) && M.push({ type: "END" });
@@ -7474,9 +7474,9 @@ function l_(e, t) {
7474
7474
  return e.bye || nc(e.seedValue) < nc(t.seedValue) || e.seedValue && !t.seedValue ? -1 : (e.seedNumber || 0) - (t.seedNumber || 0);
7475
7475
  }
7476
7476
  function d_({ drawPositionInitialRounds: e, tournamentParticipants: t, positionAssignments: r, returnParticipants: i, appliedPolicies: n, drawDefinition: a, drawPosition: s, structureId: o, drawId: c }) {
7477
- let u = [], l = [], d = [], p = [], m = r.map((v) => v.participantId).filter(Boolean), f = n?.[An], h = !f?.disableRoundRestrictions && e[s], g = f?.requireCompletedStructures, { sourceStructureIds: I, relevantLinks: y } = Ou({ targetRoundNumber: h, linkType: Mn, drawDefinition: a, structureId: o }) || {};
7477
+ let u = [], l = [], d = [], p = [], m = r.map((v) => v.participantId).filter(Boolean), f = n?.[An], h = !f?.disableRoundRestrictions && e[s], g = f?.requireCompletedStructures, { sourceStructureIds: I, relevantLinks: y } = ku({ targetRoundNumber: h, linkType: Mn, drawDefinition: a, structureId: o }) || {};
7478
7478
  I?.length && p.push(...I);
7479
- let { sourceStructureIds: U, relevantLinks: D } = Ou({ targetRoundNumber: h, linkType: bn, drawDefinition: a, structureId: o }) || {};
7479
+ let { sourceStructureIds: U, relevantLinks: D } = ku({ targetRoundNumber: h, linkType: bn, drawDefinition: a, structureId: o }) || {};
7480
7480
  U?.length && p.push(...U);
7481
7481
  for (let v of y) {
7482
7482
  let w = a.structures?.find((T) => T.structureId === v.source.structureId);
@@ -7526,12 +7526,12 @@ function By(e) {
7526
7526
  let d = l.containingStructure || l.structure;
7527
7527
  if (!d) return { error: lt };
7528
7528
  let p = d.structureId;
7529
- if (l = Ml({ drawDefinition: s, structureId: p }), o === void 0 && !l.isAdHoc) return { error: fc };
7529
+ if (l = Rl({ drawDefinition: s, structureId: p }), o === void 0 && !l.isAdHoc) return { error: fc };
7530
7530
  if (l.isAdHoc) return km(e);
7531
7531
  if (l.error) return l;
7532
7532
  let { drawPositionInitialRounds: m, inactiveDrawPositions: f, activeDrawPositions: h, byeDrawPositions: g } = l, I = xe({ tournamentRecord: a, drawDefinition: s, structure: d, event: c }).appliedPolicies ?? {};
7533
7533
  Object.assign(I, r ?? {});
7534
- let { actionsPolicy: y, enabledStructures: U, actionsDisabled: D } = nR({ actionType: Md, appliedPolicies: I, drawDefinition: s, structure: d }), v = y?.activePositionOverrides || [], { sourceStructureIds: w } = Ou({ finishingPosition: Ya, targetRoundNumber: 1, linkType: bn, drawDefinition: s, structureId: p }) || {}, S;
7534
+ let { actionsPolicy: y, enabledStructures: U, actionsDisabled: D } = nR({ actionType: Md, appliedPolicies: I, drawDefinition: s, structure: d }), v = y?.activePositionOverrides || [], { sourceStructureIds: w } = ku({ finishingPosition: Ya, targetRoundNumber: 1, linkType: bn, drawDefinition: s, structureId: p }) || {}, S;
7535
7535
  w?.length && (S = w.every((Y) => kn({ structureId: Y, drawDefinition: s })));
7536
7536
  let T = w.length, b = w.length && !S, { policyActions: P } = aR({ enabledStructures: U, drawDefinition: s, structure: d }), M = ![oe, re].includes(d.stage) || d.stageSequence !== 1, { drawId: R } = s, E = [], { assignedPositions: A, positionAssignments: N } = Ft({ structure: d }), C = A?.find((Y) => Y.drawPosition === o), k = !!C;
7537
7537
  if (!N?.map((Y) => Y.drawPosition)?.includes(o)) return { error: mc };
@@ -7555,17 +7555,17 @@ function By(e) {
7555
7555
  let { seedAssignments: q } = mi({ returnAllProxies: !0, drawDefinition: s, structure: d }), { seedNumber: K, seedValue: X } = q?.find((Q) => Q.participantId === H) ?? {};
7556
7556
  E.push({ type: As, method: gL, participant: W, seedNumber: K, payload: { drawId: R, structureId: p, participantId: H, seedValue: X } });
7557
7557
  }
7558
- if (!j && Tv({ activePositionOverrides: v, activeDrawPositions: h, action: su }) && Ar({ policyActions: P, action: su }) && Zd({ drawDefinition: s, structureId: p, drawPosition: o }) && Y) {
7558
+ if (!j && Tv({ activePositionOverrides: v, activeDrawPositions: h, action: ou }) && Ar({ policyActions: P, action: ou }) && Zd({ drawDefinition: s, structureId: p, drawPosition: o }) && Y) {
7559
7559
  let { seedAssignments: q } = mi({ returnAllProxies: !0, drawDefinition: s, structure: d }), { seedNumber: K } = q?.find((X) => X.participantId === H) ?? {};
7560
- E.push({ method: fL, type: su, participant: W, seedNumber: K, payload: { participantId: H, structureId: p, drawId: R } });
7560
+ E.push({ method: fL, type: ou, participant: W, seedNumber: K, payload: { participantId: H, structureId: p, drawId: R } });
7561
7561
  }
7562
7562
  if (!j && H) {
7563
7563
  if (Ar({ policyActions: P, action: qs })) {
7564
7564
  let q = { type: qs, method: vM, participant: W, payload: { penaltyCode: void 0, penaltyType: void 0, participantIds: [], notes: void 0, drawId: R } };
7565
7565
  E.push(q);
7566
7566
  }
7567
- if (Ar({ policyActions: P, action: ku })) {
7568
- let q = { type: ku, method: mL, participant: W, payload: { participantId: H, otherName: void 0 } };
7567
+ if (Ar({ policyActions: P, action: xu })) {
7568
+ let q = { type: xu, method: mL, participant: W, payload: { participantId: H, otherName: void 0 } };
7569
7569
  E.push(q);
7570
7570
  }
7571
7571
  }
@@ -7588,7 +7588,7 @@ function By(e) {
7588
7588
  }
7589
7589
  return { isActiveDrawPosition: V, isDrawPosition: !0, hasPositionAssigned: k, isByePosition: j, validActions: E, ...x };
7590
7590
  }
7591
- function Wl({ policyDefinitions: e, appliedPolicies: t, drawType: r }) {
7591
+ function ql({ policyDefinitions: e, appliedPolicies: t, drawType: r }) {
7592
7592
  let i = e?.[Wd]?.drawTypeCoercion, n = t?.[Wd]?.drawTypeCoercion;
7593
7593
  return (typeof i == "boolean" ? i : void 0) ?? (r && i?.[r]) ?? (typeof n == "boolean" ? n : void 0) ?? (r && n?.[r]) ?? !0;
7594
7594
  }
@@ -7608,7 +7608,7 @@ function jy({ structureId: e, drawDefinition: t }) {
7608
7608
  let i = r.links.target.flatMap((a) => a.target.feedProfile).filter(Boolean), n = !St([za, Ti, Hp, Ha], i).length;
7609
7609
  return { ...x, valid: n };
7610
7610
  }
7611
- function xu({ tournamentRecord: e, drawDefinition: t, stage: r = re, structureId: i, structure: n }) {
7611
+ function Fu({ tournamentRecord: e, drawDefinition: t, stage: r = re, structureId: i, structure: n }) {
7612
7612
  if (!e) return { error: J };
7613
7613
  if (!n && !t) return { error: ne };
7614
7614
  if (!n && !i && t?.structures?.filter((o) => o.stage === r).length === 1 && (n = t.structures.find((o) => o.stage === r)), !n && !i) return { error: ri };
@@ -7620,7 +7620,7 @@ function fR({ participantsCount: e, participantCount: t }) {
7620
7620
  let r = pc(e);
7621
7621
  return r ? { drawSize: r } : F({ result: { error: z }, stack: "getEliminationDrawSize", context: { participantsCount: e } });
7622
7622
  }
7623
- function ql(e) {
7623
+ function Hl(e) {
7624
7624
  let { drawSizeProgression: t = !1, policyDefinitions: r, drawSize: i } = e || {}, { requireParticipantCount: n = !0, tournamentRecord: a, drawDefinition: s, event: o } = e || {}, c = "getSeedsCount", u = e?.participantsCount ?? e?.participantCount;
7625
7625
  if (!r) {
7626
7626
  let f = ia({ tournamentRecord: a, drawDefinition: s, event: o });
@@ -7631,7 +7631,7 @@ function ql(e) {
7631
7631
  if (u && !l) return F({ result: { error: z }, context: { participantsCount: u }, stack: c });
7632
7632
  if (n && !l) return F({ result: { error: kD }, stack: c });
7633
7633
  if (isNaN(i)) if (u) ({ drawSize: i } = fR({ participantsCount: u }));
7634
- else return F({ result: { error: Yu }, stack: c });
7634
+ else return F({ result: { error: Ku }, stack: c });
7635
7635
  let d = n && u || i;
7636
7636
  if (d && d > i) return { error: Mg };
7637
7637
  let p = r?.[wi];
@@ -7640,7 +7640,7 @@ function ql(e) {
7640
7640
  return m ? (p.drawSizeProgression !== void 0 && (t = p.drawSizeProgression), { seedsCount: m.filter((f) => t ? f.drawSize <= i : i === f.drawSize).reduce((f, h) => u && u >= h.minimumParticipantCount ? h.seedsCount : f, 0) }) : { error: aD };
7641
7641
  }
7642
7642
  function xm({ consideredEntries: e, policyDefinitions: t, tournamentRecord: r, appliedPolicies: i, participantMap: n, enforceGender: a, participants: s, event: o }) {
7643
- if ((!s || !n) && r && ({ participants: s, participantMap: n } = pt({ tournamentRecord: r })), !s) return { error: Qu };
7643
+ if ((!s || !n) && r && ({ participants: s, participantMap: n } = pt({ tournamentRecord: r })), !s) return { error: Ju };
7644
7644
  if (!Array.isArray(s)) return { error: z };
7645
7645
  if (!o) return { error: it };
7646
7646
  let c = t?.[Yt] ?? i?.[Yt] ?? Ac[Yt], u = (a ?? c?.participants?.enforceGender) !== !1, { eventType: l, gender: d } = o, p = l === Hn, m = l === Hr && Ge || p && we || be, f = Object.assign({}, ...(e ?? o.entries ?? []).map((I) => ({ [I.participantId]: I.entryStatus }))), h = Object.keys(f), g = s.filter((I) => h.includes(I.participantId)).filter((I) => {
@@ -7669,14 +7669,14 @@ function hR({ hasExistingDrawDefinition: e, qualifyingProfiles: t, appliedPolici
7669
7669
  let D = 1, v = 0, w, S, T;
7670
7670
  for (let b of (U || []).sort(p)) {
7671
7671
  let P = lg(b.drawSize || b.participantsCount), { qualifyingRoundNumber: M, structureOptions: R, matchUpFormat: E, structureName: A, structureId: N, drawType: C } = b, k = b.matchUpType, O = b.qualifyingPositions || h_({ drawSize: P, qualifyingRoundNumber: M }), L, _, B;
7672
- if (!Ie(P)) return F({ result: { error: Yu }, stack: c });
7672
+ if (!Ie(P)) return F({ result: { error: Ku }, stack: c });
7673
7673
  let G = t.length > 1 ? `${I}-` : "", $ = U.length > 1 || G ? D : "", j = A || (G || $ ? `${ar(oe)} ${G}${$}` : ar(oe));
7674
7674
  if (C === Ei) {
7675
- let { structures: V, groupCount: H, maxRoundNumber: W } = Cl({ structureName: b.structureName || j, structureId: N || o?.pop(), hasExistingDrawDefinition: e, stage: oe, structureOptions: R, appliedPolicies: r, qualifyingOnly: i, stageSequence: D, matchUpType: k, roundTarget: I, tieFormat: n, drawSize: P, idPrefix: a, isMock: s, uuids: o });
7675
+ let { structures: V, groupCount: H, maxRoundNumber: W } = Ol({ structureName: b.structureName || j, structureId: N || o?.pop(), hasExistingDrawDefinition: e, stage: oe, structureOptions: R, appliedPolicies: r, qualifyingOnly: i, stageSequence: D, matchUpType: k, roundTarget: I, tieFormat: n, drawSize: P, idPrefix: a, isMock: s, uuids: o });
7676
7676
  v = H, L = W, _ = V[0], g = [1];
7677
7677
  } else ({ drawSize: P, matchUps: B, roundLimit: L } = un({ qualifyingRoundNumber: M, qualifyingPositions: O, matchUpType: k, drawSize: P, idPrefix: a, isMock: s, uuids: o })), _ = ui({ structureName: b.structureName || j, structureId: N || o?.pop(), qualifyingRoundNumber: L, hasExistingDrawDefinition: e, stage: oe, qualifyingOnly: i, matchUpFormat: E, stageSequence: D, matchUpType: k, roundLimit: L, tieFormat: n, matchUps: B }), I && Le({ extension: { name: pn, value: I }, element: _ }), v = B?.filter((V) => V.roundNumber === L)?.length || 0;
7678
7678
  if (D > 1) {
7679
- let { link: V } = Fl({ sourceStructureId: S, sourceRoundNumber: w, targetStructureId: _.structureId, finishingPositions: T === bn ? [1] : void 0, linkType: T });
7679
+ let { link: V } = Ll({ sourceStructureId: S, sourceRoundNumber: w, targetStructureId: _.structureId, finishingPositions: T === bn ? [1] : void 0, linkType: T });
7680
7680
  d.push(V), f += (P || 0) - v;
7681
7681
  } else f += P || 0;
7682
7682
  T = C === Ei ? bn : Mn, S = _.structureId, w = L, n && (B = _e({ structure: _ })?.matchUps || [], B?.forEach((V) => {
@@ -7702,7 +7702,7 @@ function gR(e) {
7702
7702
  return { drawType: n };
7703
7703
  }
7704
7704
  function g_(e) {
7705
- let { drawDefinition: t, structureOptions: r, requireSequential: i } = e, n = { structureName: ar(re), ...e, stage: re }, { structures: a, groupCount: s } = Cl(n);
7705
+ let { drawDefinition: t, structureOptions: r, requireSequential: i } = e, n = { structureName: ar(re), ...e, stage: re }, { structures: a, groupCount: s } = Ol(n);
7706
7706
  if (s < 1) return { error: QD };
7707
7707
  let o = r?.playoffGroups || [{ finishingPositions: [1], structureName: ar(yt) }], [c] = a, { structures: u, links: l } = CM({ sourceStructureId: c.structureId, requireSequential: i, drawDefinition: t, playoffGroups: o, groupCount: s, ...e });
7708
7708
  return u && a.push(...u), { ...x, structures: a, links: l };
@@ -7741,7 +7741,7 @@ function U_(e) {
7741
7741
  p.push(...U), m++;
7742
7742
  }
7743
7743
  let h = m - 1;
7744
- return p = Pl({ finishingPositionOffset: r, lucky: !0, roundsCount: h, roundLimit: f, matchUps: p }), f && (p = p.filter((g) => g.roundNumber <= f)), { matchUps: p, roundsCount: h, roundLimit: f };
7744
+ return p = bl({ finishingPositionOffset: r, lucky: !0, roundsCount: h, roundLimit: f, matchUps: p }), f && (p = p.filter((g) => g.roundNumber <= f)), { matchUps: p, roundsCount: h, roundLimit: f };
7745
7745
  }
7746
7746
  function S_(e) {
7747
7747
  let t = pe(e), r = t % 2 ? t + 1 : t, i = !!(Math.ceil(r / 2) % 2), n = [{ participantsCount: r, preFeedRound: i }];
@@ -7763,13 +7763,13 @@ function IR(e) {
7763
7763
  return { generators: { [zr]: () => ({ structures: [ui({ finishingPosition: Ya, stageSequence: r, structureName: p, matchUps: [], matchUpType: a, structureId: u, stage: i })], links: [], ...x }), [cs]: () => {
7764
7764
  let { matchUps: f } = U_(e);
7765
7765
  return { structures: [ui({ stageSequence: r, structureName: p, matchUpType: a, structureId: u, matchUps: f, stage: i })], links: [], ...x };
7766
- }, [Zi]: () => m(), [nl]: () => y_(e), [Xo]: () => Vo({ ...e, roundOffsetLimit: 3, playoffAttributes: t ?? eI }), [Qo]: () => Vo({ ...e, roundOffsetLimit: 2, playoffAttributes: t ?? tI }), [yt]: () => Vo(e), [vc]: () => {
7766
+ }, [Zi]: () => m(), [al]: () => y_(e), [Xo]: () => Vo({ ...e, roundOffsetLimit: 3, playoffAttributes: t ?? eI }), [Qo]: () => Vo({ ...e, roundOffsetLimit: 2, playoffAttributes: t ?? tI }), [yt]: () => Vo(e), [vc]: () => {
7767
7767
  let { matchUps: f } = Da({ drawSize: s, uuids: o, matchUpType: a });
7768
7768
  return { structures: [ui({ stageSequence: r, structureName: p, matchUpType: a, structureId: u, stage: re, tieFormat: n, matchUps: f })], links: [], ...x };
7769
- }, [al]: () => NM(e), [Jo]: () => Ds({ ...e, feedRounds: 1, fmlc: !0 }), [lP]: () => Ds({ ...e, feedRounds: 1 }), [Qg]: () => Ds({ ...e, feedsFromFinal: 1 }), [Jg]: () => Ds({ ...e, feedsFromFinal: 2 }), [Zg]: () => Ds({ ...e, feedsFromFinal: 3 }), [sl]: () => Ds(e), [zp]: () => AM(e), [Ei]: () => Cl(e), [Nn]: () => g_(e) } };
7769
+ }, [sl]: () => NM(e), [Jo]: () => Ds({ ...e, feedRounds: 1, fmlc: !0 }), [lP]: () => Ds({ ...e, feedRounds: 1 }), [Qg]: () => Ds({ ...e, feedsFromFinal: 1 }), [Jg]: () => Ds({ ...e, feedsFromFinal: 2 }), [Zg]: () => Ds({ ...e, feedsFromFinal: 3 }), [ol]: () => Ds(e), [zp]: () => AM(e), [Ei]: () => Ol(e), [Nn]: () => g_(e) } };
7770
7770
  }
7771
7771
  function Gy(e) {
7772
- let { enforceMinimumDrawSize: t = !0, overwriteExisting: r, appliedPolicies: i, qualifyingOnly: n, staggeredEntry: a, drawDefinition: s, tieFormat: o, isMock: c, uuids: u } = e || {}, l = pe(e.drawSize), d = e.drawTypeCoercion ?? Wl({ appliedPolicies: i, drawType: e.drawType }), p = "generateDrawStructuresAndLinks", m = gR({ drawType: e.drawType, enforceMinimumDrawSize: t, drawTypeCoercion: d, drawSize: l });
7772
+ let { enforceMinimumDrawSize: t = !0, overwriteExisting: r, appliedPolicies: i, qualifyingOnly: n, staggeredEntry: a, drawDefinition: s, tieFormat: o, isMock: c, uuids: u } = e || {}, l = pe(e.drawSize), d = e.drawTypeCoercion ?? ql({ appliedPolicies: i, drawType: e.drawType }), p = "generateDrawStructuresAndLinks", m = gR({ drawType: e.drawType, enforceMinimumDrawSize: t, drawTypeCoercion: d, drawSize: l });
7773
7773
  if (m.error) return m;
7774
7774
  let f = m.drawType, h = [], g = [], I = e?.matchUpType ?? ze, y = s?.structures?.filter(({ stage: $ }) => $ === oe);
7775
7775
  y && h.push(...y);
@@ -7817,7 +7817,7 @@ function Gy(e) {
7817
7817
  h.sort(ao), B?.length && g.push(...B);
7818
7818
  let G = L.structures.find(({ stage: $, stageSequence: j }) => $ === re && j === 1);
7819
7819
  for (let $ of E || []) {
7820
- let { finalQualifyingRoundNumber: j, finalQualifyingStructureId: V, roundTarget: H, finishingPositions: W, linkType: Y } = $, q = G && Fl({ targetStructureId: G.structureId, sourceStructureId: V, sourceRoundNumber: j, finishingPositions: W, targetEntryRound: H, linkType: Y })?.link;
7820
+ let { finalQualifyingRoundNumber: j, finalQualifyingStructureId: V, roundTarget: H, finishingPositions: W, linkType: Y } = $, q = G && Ll({ targetStructureId: G.structureId, sourceStructureId: V, sourceRoundNumber: j, finishingPositions: W, targetEntryRound: H, linkType: Y })?.link;
7821
7821
  if (q?.error) return q;
7822
7822
  q && g.push(q);
7823
7823
  }
@@ -7859,7 +7859,7 @@ function $y(e) {
7859
7859
  let { inContextDrawMatchUps: y } = Ja({ drawDefinition: a, matchUpsMap: I });
7860
7860
  return Je({ tournamentId: e.tournamentRecord?.tournamentId, drawDefinition: a }), { inContextDrawMatchUps: y, drawDefinition: a, matchUpsMap: I, ...x, structures: d, matchUps: g, links: p };
7861
7861
  }
7862
- function Hl(e) {
7862
+ function zl(e) {
7863
7863
  let { removePriorValues: t, tournamentRecord: r, participantId: i, scaleItem: n } = e, a, s;
7864
7864
  if (!UR({ scaleItem: n })) return { error: Fs };
7865
7865
  if (i && Array.isArray(r.participants) && (s = r.participants.find((o) => o.participantId === i), s)) {
@@ -7875,7 +7875,7 @@ function Hl(e) {
7875
7875
  function yR(e) {
7876
7876
  let { scaleItemsWithParticipantIds: t = [], removePriorValues: r, tournamentRecord: i, auditData: n, context: a } = e;
7877
7877
  if (!i) return { error: J };
7878
- if (!i.participants) return { error: Qu };
7878
+ if (!i.participants) return { error: Ju };
7879
7879
  let s = 0, o = {}, c = [];
7880
7880
  for (let d of t) {
7881
7881
  let p = d?.participantId;
@@ -7897,7 +7897,7 @@ function yR(e) {
7897
7897
  if (f && (h.itemSubTypes = f), p || d) {
7898
7898
  let { drawDefinition: g, event: I } = Nr({ tournamentRecord: i, eventId: d, drawId: p });
7899
7899
  p && gy({ drawDefinition: g, timeItem: h }), d && So({ event: I, timeItem: h });
7900
- } else Gl({ tournamentRecord: i, timeItem: h });
7900
+ } else $l({ tournamentRecord: i, timeItem: h });
7901
7901
  }
7902
7902
  }
7903
7903
  return n && l.includes($n) && Ue({ topic: $n, payload: n }), ae({ ...x, modificationsApplied: s, info: u });
@@ -7923,7 +7923,7 @@ function Wy(e) {
7923
7923
  let { tournamentRecord: t, modifiedScaleValues: r, removePriorValues: i } = e, n = se(e, [{ [_t]: !0 }, { modifiedScaleValues: !0, [Er]: Cr }]);
7924
7924
  if (n.error) return n;
7925
7925
  for (let a in r) {
7926
- let s = Hl({ scaleItem: r[a], removePriorValues: i, tournamentRecord: t, participantId: a });
7926
+ let s = zl({ scaleItem: r[a], removePriorValues: i, tournamentRecord: t, participantId: a });
7927
7927
  if (s.error) return s;
7928
7928
  }
7929
7929
  return { ...x };
@@ -8155,7 +8155,7 @@ function k_({ encounters: e, tournamentParticipants: t, encounterValue: r, sameT
8155
8155
  function TR(e) {
8156
8156
  let { drawType: t = Zi, attachConsolation: r = !0, applyPositioning: i = !0, tournamentRecord: n, staggeredEntry: a, automated: s, placeByes: o, isMock: c, event: u } = e, l = e?.drawDefinition;
8157
8157
  if (!l) return { error: ne };
8158
- let d = zt, p = so({ stageSequence: 1, drawDefinition: l, stage: d }), m = [Ei, nl, Nn].includes(t) ? p.length : pc(p.length);
8158
+ let d = zt, p = so({ stageSequence: 1, drawDefinition: l, stage: d }), m = [Ei, al, Nn].includes(t) ? p.length : pc(p.length);
8159
8159
  if (!a && t === vc && p.length < 2 || t === Ei && p.length < 3) return { error: bp };
8160
8160
  let { tieFormat: f, matchUpType: h } = e;
8161
8161
  if (f) {
@@ -8184,12 +8184,12 @@ function TR(e) {
8184
8184
  let b = l.structures.map(({ structureId: M }) => M);
8185
8185
  l.structures = l.structures.map((M) => T.includes(M.structureId) ? v.find(({ structureId: R }) => R === M.structureId) : M);
8186
8186
  let P = v.filter(({ structureId: M }) => !b.includes(M));
8187
- return P.length && l.structures.push(...P), s && xl({ seedingProfile: e.seedingProfile, applyPositioning: i, tournamentRecord: n, drawDefinition: l, structureId: I, placeByes: o, drawSize: m, event: u }), r && Je({ drawDefinition: l }), { links: w, structures: v, ...x };
8187
+ return P.length && l.structures.push(...P), s && Fl({ seedingProfile: e.seedingProfile, applyPositioning: i, tournamentRecord: n, drawDefinition: l, structureId: I, placeByes: o, drawSize: m, event: u }), r && Je({ drawDefinition: l }), { links: w, structures: v, ...x };
8188
8188
  }
8189
8189
  var Hy = {};
8190
- Te(Hy, { addGame: () => CR, addPoint: () => AR, addSet: () => kR, addShot: () => OR, analyzeScore: () => Jy, analyzeSet: () => Lu, calculateHistoryScore: () => RR, checkScoreHasValue: () => Lt, checkSetIsComplete: () => Bm, clearHistory: () => ER, generate: () => PR, generateScoreString: () => wn, generateTieMatchUpScore: () => Vl, getSetComplement: () => eU, getTiebreakComplement: () => $m, helpers: () => _R, isValidMatchUpFormat: () => qr, keyValueScore: () => aN, mutate: () => MR, parseMatchUpFormat: () => Dr, parseScoreString: () => sp, query: () => lN, redo: () => xR, reverseScore: () => bR, setServingSide: () => NR, stringifyMatchUpFormat: () => Gp, tidyScore: () => uN, umo: () => LR, undo: () => FR, validateScore: () => Zy, validateTieFormat: () => Mr });
8190
+ Te(Hy, { addGame: () => CR, addPoint: () => AR, addSet: () => kR, addShot: () => OR, analyzeScore: () => Jy, analyzeSet: () => _u, calculateHistoryScore: () => RR, checkScoreHasValue: () => Lt, checkSetIsComplete: () => Bm, clearHistory: () => ER, generate: () => PR, generateScoreString: () => wn, generateTieMatchUpScore: () => jl, getSetComplement: () => eU, getTiebreakComplement: () => $m, helpers: () => _R, isValidMatchUpFormat: () => qr, keyValueScore: () => aN, mutate: () => MR, parseMatchUpFormat: () => Dr, parseScoreString: () => sp, query: () => lN, redo: () => xR, reverseScore: () => bR, setServingSide: () => NR, stringifyMatchUpFormat: () => Gp, tidyScore: () => uN, umo: () => LR, undo: () => FR, validateScore: () => Zy, validateTieFormat: () => Mr });
8191
8191
  var PR = {};
8192
- Te(PR, { generateScoreString: () => wn, generateTieMatchUpScore: () => Vl, reverseScore: () => bR });
8192
+ Te(PR, { generateScoreString: () => wn, generateTieMatchUpScore: () => jl, reverseScore: () => bR });
8193
8193
  function wn(e) {
8194
8194
  let { winnerFirst: t = !0, setTBlast: r = !0, addOutcomeString: i, reversed: n = !1, matchUpStatus: a, matchUpFormat: s, autoComplete: o, winningSide: c, sets: u } = e;
8195
8195
  if (!u) return { error: ce, info: "missing sets" };
@@ -8587,7 +8587,7 @@ function aN(e) {
8587
8587
  }
8588
8588
  return { updated: l, scoreString: i, sets: n, winningSide: a, matchUpStatus: s, info: d };
8589
8589
  }
8590
- var jm = "\\d+-\\d+", Fu = "\\d+-\\d+\\(\\d+\\)", Qy = "\\[\\d+-\\d+\\]", eB = "\\d+-\\d+\\(\\d+-\\d+\\)", tB = new RegExp(`(${jm}),`, "g"), rB = new RegExp(`(${Fu}),`, "g"), iB = [jm, Fu, Qy, eB], nB = ["0", "1", "2", "00", "01", "10", "11", "002", "012", "102", "112", "000", "001", "010", "100", "011", "101", "110", "111", "002", "012", "102", "112", "0002", "0012", "0102", "1002", "0112", "1012", "1102", "1112", "3", "03", "13", "013", "103"], aB = nB.map((e) => {
8590
+ var jm = "\\d+-\\d+", Lu = "\\d+-\\d+\\(\\d+\\)", Qy = "\\[\\d+-\\d+\\]", eB = "\\d+-\\d+\\(\\d+-\\d+\\)", tB = new RegExp(`(${jm}),`, "g"), rB = new RegExp(`(${Lu}),`, "g"), iB = [jm, Lu, Qy, eB], nB = ["0", "1", "2", "00", "01", "10", "11", "002", "012", "102", "112", "000", "001", "010", "100", "011", "101", "110", "111", "002", "012", "102", "112", "0002", "0012", "0102", "1002", "0112", "1012", "1102", "1112", "3", "03", "13", "013", "103"], aB = nB.map((e) => {
8591
8591
  let t = e.split("").map((r) => iB[r]).join(" ");
8592
8592
  return new RegExp(`^${t}$`);
8593
8593
  });
@@ -8816,7 +8816,7 @@ function dB({ score: e }) {
8816
8816
  !sc(p) && h && (e = e.replace(d, `${p} [${m}-${f}]`));
8817
8817
  }
8818
8818
  return u = [], e = e.split(" ").map((p) => {
8819
- let m = /^\((.*)\)$/, f = m.test(p), h = new RegExp(Qy).test(p) && "super" || new RegExp(Fu).test(p) && "tiebreak" || new RegExp(jm).test(p) && "standard" || "unknown";
8819
+ let m = /^\((.*)\)$/, f = m.test(p), h = new RegExp(Qy).test(p) && "super" || new RegExp(Lu).test(p) && "tiebreak" || new RegExp(jm).test(p) && "standard" || "unknown";
8820
8820
  return u.push(h), h === "standard" && f ? p.match(m)[1] : p;
8821
8821
  }).join(" "), { score: e };
8822
8822
  }
@@ -9144,7 +9144,7 @@ function cN(e) {
9144
9144
  function hB({ score: e, matchUpStatus: t, attributes: r }) {
9145
9145
  let i = [], n, a = e.split(" "), s = a.length;
9146
9146
  e = a.map((l, d) => {
9147
- if (new RegExp(Fu).test(l)) {
9147
+ if (new RegExp(Lu).test(l)) {
9148
9148
  let m = l.slice(3), f = l.slice(0, 3), h = f.split("-");
9149
9149
  if (!sc(f) && !t) {
9150
9150
  let g = Math.max(...h), I = f.indexOf(g), y = [g, g - 1];
@@ -9152,7 +9152,7 @@ function hB({ score: e, matchUpStatus: t, attributes: r }) {
9152
9152
  }
9153
9153
  } else if (l.length === 2 && ft(l)) return l.split("").join("-");
9154
9154
  l = Gm(l);
9155
- let p = new RegExp(`^${Qy}$`).test(l) && "super" || new RegExp(`^${Fu}$`).test(l) && "tiebreak" || new RegExp(`^${jm}$`).test(l) && "standard" || "unknown";
9155
+ let p = new RegExp(`^${Qy}$`).test(l) && "super" || new RegExp(`^${Lu}$`).test(l) && "tiebreak" || new RegExp(`^${jm}$`).test(l) && "standard" || "unknown";
9156
9156
  if (i.push(p), s > 1 && p === "standard" && d < 2) {
9157
9157
  let [m, f] = l.split("-"), h = Math.abs(parseInt(m) - parseInt(f)), g = Math.max(m, f), I = Math.min(m, f), y = [parseInt(m), parseInt(f)].indexOf(I);
9158
9158
  if (g > 9 && h > 2) {
@@ -9314,7 +9314,7 @@ function uN(e) {
9314
9314
  }), { matchUpStatus: u?.toUpperCase(), modifications: c, attributes: d, isValid: h, score: m };
9315
9315
  }
9316
9316
  var lN = {};
9317
- Te(lN, { analyzeScore: () => Jy, analyzeSet: () => Lu, checkScoreHasValue: () => Lt, checkSetIsComplete: () => Bm, getSetComplement: () => eU, getTiebreakComplement: () => $m, isValidMatchUpFormat: () => qr, parseScoreString: () => sp, validateScore: () => Zy, validateTieFormat: () => Mr });
9317
+ Te(lN, { analyzeScore: () => Jy, analyzeSet: () => _u, checkScoreHasValue: () => Lt, checkSetIsComplete: () => Bm, getSetComplement: () => eU, getTiebreakComplement: () => $m, isValidMatchUpFormat: () => qr, parseScoreString: () => sp, validateScore: () => Zy, validateTieFormat: () => Mr });
9318
9318
  function Jy({ existingMatchUpStatus: e, matchUpFormat: t, matchUpStatus: r, winningSide: i, score: n }) {
9319
9319
  let a = n?.sets ?? [], s = (a?.filter((v) => v?.winningSide) || []).reduce((v, w) => {
9320
9320
  let { winningSide: S } = w;
@@ -9382,7 +9382,7 @@ function OB({ matchUpScoringFormat: e, isDecidingSet: t, isTiebreakSet: r, isTim
9382
9382
  let a = Vm({ set: n });
9383
9383
  return Bm({ matchUpScoringFormat: e, set: n, isDecidingSet: t, isTiebreakSet: r, isTimedSet: i }) && a || void 0;
9384
9384
  }
9385
- function Lu(e) {
9385
+ function _u(e) {
9386
9386
  let { setObject: t, matchUpScoringFormat: r } = e;
9387
9387
  if (!t) return { error: Rp };
9388
9388
  let { setNumber: i } = t || {}, { bestOf: n, exactly: a } = r || {}, s = n || a, o = !!(i && s && i === s), c = o && r?.finalSetFormat || r?.setFormat, u = !!c?.tiebreakSet, l = !!c?.timed, d = !u && !l, p = !!(i && s && i <= s), m = [t?.side1Score, t?.side2Score], f = [t?.side1PointScore, t?.side2PointScore], h = [t?.side1TiebreakScore, t?.side2TiebreakScore], g = m.filter((O) => O !== void 0).length, I = f.filter((O) => O !== void 0).length, y = h.filter((O) => O !== void 0).length, U = m?.filter((O) => !isNaN(O)).length, D = h?.filter((O) => !isNaN(O)).length, { tiebreakAt: v } = c || {}, w = v && m.filter((O) => O >= v).length === 2, S = w && (m[0] > m[1] && 1 || m[1] > m[0] && 2 || void 0), T = !!(D && !U), b = !!t?.winningSide, { error: P, result: M } = kB({ sideTiebreakScores: h, sideGameScores: m, setFormat: c, setObject: t }), { error: R, result: E } = xB({ sideTiebreakScores: h, setObject: t, setFormat: c }), A = d && !T && M || u && T && E || l, N = p && !(u && !T) && !(d && T) && (!b || A), C = OB({ isTimedSet: l, matchUpScoringFormat: r, isDecidingSet: o, isTiebreakSet: T, setObject: t }), k = { expectTiebreakSet: u, expectTimedSet: l, hasTiebreakCondition: w, isCompletedSet: b, isDecidingSet: o, isTiebreakSet: T, isValidSet: N, isValidSetNumber: p, isValidSetOutcome: A, leadingSide: S, setFormat: c, sideGameScores: m, sideGameScoresCount: g, sidePointScores: f, sidePointScoresCount: I, sideTiebreakScores: h, sideTiebreakScoresCount: y, winningSide: C };
@@ -9465,7 +9465,7 @@ function _B({ drawDefinition: e, drawEntries: t, event: r }) {
9465
9465
  }
9466
9466
  function BB({ mainStructure: e, qualifyingDetails: t, drawDefinition: r }) {
9467
9467
  for (let i of t || []) {
9468
- let { finalQualifyingRoundNumber: n, finalQualifyingStructureId: a, roundTarget: s, finishingPositions: o, linkType: c } = i, u = e && Fl({ targetStructureId: e.structureId, sourceStructureId: a, sourceRoundNumber: n, finishingPositions: o, targetEntryRound: s, linkType: c })?.link;
9468
+ let { finalQualifyingRoundNumber: n, finalQualifyingStructureId: a, roundTarget: s, finishingPositions: o, linkType: c } = i, u = e && Ll({ targetStructureId: e.structureId, sourceStructureId: a, sourceRoundNumber: n, finishingPositions: o, targetEntryRound: s, linkType: c })?.link;
9469
9469
  if (u?.error) return u;
9470
9470
  u && (r.links || (r.links = []), r.links.push(u));
9471
9471
  }
@@ -9553,7 +9553,7 @@ function qB({ requireParticipantCount: e = !0, enforcePolicyLimits: t = !0, draw
9553
9553
  if (!d) return { error: lt };
9554
9554
  let { positionAssignments: p } = Ft({ structure: d }), m = p?.length || 0;
9555
9555
  if (u > m) return { error: nD };
9556
- let f = d.structures?.length, h = Ie(o?.groupSeedingThreshold) && o?.groupSeedingThreshold, g = sy({ roundRobinGroupsCount: f, drawSize: m })?.seedGroups, { seedsCount: I } = ql({ policyDefinitions: a, requireParticipantCount: e, drawSizeProgression: r, participantsCount: i, drawSize: m });
9556
+ let f = d.structures?.length, h = Ie(o?.groupSeedingThreshold) && o?.groupSeedingThreshold, g = sy({ roundRobinGroupsCount: f, drawSize: m })?.seedGroups, { seedsCount: I } = Hl({ policyDefinitions: a, requireParticipantCount: e, drawSizeProgression: r, participantsCount: i, drawSize: m });
9557
9557
  return I && a?.[wi] && u > I && t && (u = I), d.seedLimit = u, d.seedAssignments = te(1, u + 1).map((y) => {
9558
9558
  let U = g?.find((w) => w.includes(y)), D = U && Math.min(...U), v = h && y >= h ? D : y;
9559
9559
  return { participantId: void 0, seedNumber: y, seedValue: v };
@@ -9590,7 +9590,7 @@ function HB({ entries: e, stage: t, stageSequence: r, roundTarget: i }) {
9590
9590
  });
9591
9591
  }
9592
9592
  function zB(e) {
9593
- let t = typeof e.automated == "object" && e.automated.seedsOnly, r = xl({ ...e, seedsOnly: t });
9593
+ let t = typeof e.automated == "object" && e.automated.seedsOnly, r = Fl({ ...e, seedsOnly: t });
9594
9594
  if (r.error) return r;
9595
9595
  let i = r?.positionAssignments, n = r?.positioningReport;
9596
9596
  return { conflicts: r.conflicts, positionAssignments: i, positioningReport: n };
@@ -9659,7 +9659,7 @@ function nV(e) {
9659
9659
  function iU(e) {
9660
9660
  let t = e.structureIds, { tournamentRecord: r, drawDefinition: i, matchUpFormat: n, structureId: a, matchUpId: s, event: o } = e, c = se(e, [{ [mr]: !0, [nI]: !0 }]);
9661
9661
  if (c.error) return c;
9662
- if (!qr({ matchUpFormat: n })) return { error: Ku };
9662
+ if (!qr({ matchUpFormat: n })) return { error: Xu };
9663
9663
  let u = "setMatchUpFormat";
9664
9664
  if (s) {
9665
9665
  let l = at({ drawDefinition: i, matchUpId: s, event: o });
@@ -9721,18 +9721,18 @@ function hN(e) {
9721
9721
  r = !0;
9722
9722
  }
9723
9723
  } else return { error: J };
9724
- return r ? { ...x } : { error: Xu };
9724
+ return r ? { ...x } : { error: Qu };
9725
9725
  }
9726
9726
  function Av(e, t) {
9727
9727
  let r = xe(e).appliedPolicies ?? {};
9728
- return r[e.policyType] ? (delete r[e.policyType], Object.keys(r).length ? Le({ element: t, extension: { name: Mu, value: r } }) : yr({ element: t, name: Mu }), { ...x }) : { error: Xu };
9728
+ return r[e.policyType] ? (delete r[e.policyType], Object.keys(r).length ? Le({ element: t, extension: { name: Ru, value: r } }) : yr({ element: t, name: Ru }), { ...x }) : { error: Qu };
9729
9729
  }
9730
9730
  var gN = {};
9731
9731
  Te(gN, { findPolicy: () => ps, getAppliedPolicies: () => xe, getPolicyDefinitions: () => ia });
9732
9732
  var IN = { [wi]: { validSeedPositions: { ignore: !0 }, duplicateSeedNumbers: !0, drawSizeProgression: !0, seedingProfile: { drawTypes: { [Nn]: { positioning: Ha }, [Ei]: { positioning: Ha } }, positioning: ZO }, policyName: "USTA SEEDING", seedsCountThresholds: [{ drawSize: 4, minimumParticipantCount: 3, seedsCount: 2 }, { drawSize: 16, minimumParticipantCount: 12, seedsCount: 4 }, { drawSize: 32, minimumParticipantCount: 24, seedsCount: 8 }, { drawSize: 64, minimumParticipantCount: 48, seedsCount: 16 }, { drawSize: 128, minimumParticipantCount: 96, seedsCount: 32 }, { drawSize: 256, minimumParticipantCount: 192, seedsCount: 64 }] } }, Xh = IN;
9733
9733
  function oV({ appliedPolicies: e, policyDefinitions: t, drawDefinition: r, stack: i }) {
9734
9734
  if (t && typeof t != "object") return F({ info: "policyDefinitions must be an object", result: { error: z }, stack: i });
9735
- let n = { [bu]: e?.[bu] };
9735
+ let n = { [Mu]: e?.[Mu] };
9736
9736
  return t ? cV({ policyDefinitions: t, appliedPolicies: e, policiesToAttach: n, drawDefinition: r }) : n.avoidance && es({ drawDefinition: r, policyDefinitions: n }), !e?.[wi] && !t?.[wi] && (es({ policyDefinitions: Xh, drawDefinition: r }), e && Object.assign(e, Xh)), { error: void 0 };
9737
9737
  }
9738
9738
  function cV({ policyDefinitions: e, appliedPolicies: t, policiesToAttach: r, drawDefinition: i }) {
@@ -9770,13 +9770,13 @@ function dV(e) {
9770
9770
  U += 1;
9771
9771
  }
9772
9772
  } else if (l && f) {
9773
- let g = ui({ structureName: ar(oe), stage: oe, qualifyingOnly: s, tieFormat: d }), { link: I } = Fl({ sourceStructureId: g.structureId, targetStructureId: l, sourceRoundNumber: 0, linkType: bn });
9773
+ let g = ui({ structureName: ar(oe), stage: oe, qualifyingOnly: s, tieFormat: d }), { link: I } = Ll({ sourceStructureId: g.structureId, targetStructureId: l, sourceRoundNumber: 0, linkType: bn });
9774
9774
  o.structures || (o.structures = []), o.structures.push(g), o.links || (o.links = []), o.links.push(I);
9775
9775
  }
9776
9776
  return { qualifyingConflicts: h, error: void 0 };
9777
9777
  }
9778
9778
  var yN = {};
9779
- Te(yN, { addGoesTo: () => Ja, allCompetitionMatchUps: () => Hi, allDrawMatchUps: () => Ur, allEventMatchUps: () => _n, allPlayoffPositionsFilled: () => my, allTournamentMatchUps: () => Qt, analyzeDraws: () => $l, analyzeMatchUp: () => Bu, analyzeTournament: () => mU, bulkUpdatePublishedEventIds: () => hU, calculateWinCriteria: () => Do, categoryCanContain: () => rl, checkMatchUpIsComplete: () => Ga, checkValidEntries: () => xm, compareTieFormats: () => Zn, competitionScheduleMatchUps: () => Ql, courtGridRows: () => tf, credits: () => pV, drawMatchUps: () => NU, eventMatchUps: () => af, filterMatchUps: () => jn, filterParticipants: () => El, findDrawDefinition: () => Ly, findExtension: () => De, findVenue: () => Ln, getAggregateTeamResults: () => pU, getAllDrawMatchUps: () => Rt, getAllEventData: () => gU, getAllStructureMatchUps: () => _e, getAllowedDrawTypes: () => Wm, getAllowedMatchUpFormats: () => uU, getAppliedPolicies: () => xe, getAssignedParticipantIds: () => gs, getAvailableMatchUpsCount: () => Om, getAvailablePlayoffProfiles: () => _l, getCategoryAgeDetails: () => Ls, getCheckedInParticipantIds: () => lo, getCompetitionDateRange: () => Hm, getCompetitionMatchUps: () => _u, getCompetitionParticipants: () => nU, getCompetitionPenalties: () => lU, getCompetitionVenues: () => zl, getCourtInfo: () => gm, getCourts: () => EU, getDrawData: () => Km, getDrawDefinitionTimeItem: () => kI, getDrawParticipantRepresentativeIds: () => xy, getDrawStructures: () => Ci, getDrawTypeCoercion: () => Wl, getEligibleVoluntaryConsolationParticipants: () => ky, getEntriesAndSeedsCount: () => rf, getEvent: () => OU, getEventData: () => Xm, getEventMatchUpFormatTiming: () => SU, getEventProperties: () => AU, getEventPublishStatus: () => Ui, getEventStructures: () => Tm, getEventTimeItem: () => ml, getEvents: () => CU, getFlightProfile: () => wt, getHomeParticipantId: () => TU, getLinkedTournamentIds: () => ll, getMatchUpCompetitiveProfile: () => wl, getMatchUpContextIds: () => PU, getMatchUpDailyLimits: () => of, getMatchUpDailyLimitsUpdate: () => vU, getMatchUpDependencies: () => Li, getMatchUpFormat: () => bU, getMatchUpFormatTiming: () => Dl, getMatchUpFormatTimingUpdate: () => UU, getMatchUpScheduleDetails: () => Im, getMatchUpType: () => ym, getMatchUpsMap: () => er, getMatchUpsStats: () => MU, getMatchUpsToSchedule: () => Qm, getMaxEntryPosition: () => yU, getModifiedMatchUpFormatTiming: () => nf, getPairedParticipant: () => Oi, getParticipantEventDetails: () => aU, getParticipantIdFinishingPositions: () => Fy, getParticipantMembership: () => sU, getParticipantResults: () => Bl, getParticipantScaleItem: () => ac, getParticipantSchedules: () => oU, getParticipantSignInStatus: () => cU, getParticipantTimeItem: () => xI, getParticipants: () => pt, getPersonRequests: () => Us, getPolicyDefinitions: () => ia, getPositionAssignments: () => xu, getPositionsPlayedOff: () => kc, getPredictiveAccuracy: () => DU, getProfileRounds: () => ef, getPublishState: () => ho, getRandomQualifierList: () => Vy, getRoundMatchUps: () => vr, getRounds: () => RU, getScaleValues: () => Dc, getScaledEntries: () => vo, getScheduledRoundsDetails: () => Yl, getSchedulingProfile: () => oa, getSchedulingProfileIssues: () => IU, getSeedingThresholds: () => oy, getSeedsCount: () => ql, getStructureSeedAssignments: () => mi, getTeamLineUp: () => Qa, getTieFormat: () => Ym, getTimeItem: () => gi, getTournamentIds: () => cl, getTournamentInfo: () => wo, getTournamentPenalties: () => qm, getTournamentPersons: () => dU, getTournamentPoints: () => zm, getTournamentPublishStatus: () => Nl, getTournamentStructures: () => py, getTournamentTimeItem: () => dm, getValidGroupSizes: () => Ol, getVenueData: () => ic, getVenuesAndCourts: () => sa, isAdHoc: () => Rr, isCompletedStructure: () => kn, isValidForQualifying: () => jy, isValidMatchUpFormat: () => qr, matchUpActions: () => km, participantScaleItem: () => vn, participantScheduledMatchUps: () => wU, positionActions: () => By, publicFindCourt: () => HI, publicFindVenue: () => qI, tallyParticipantResults: () => xc, tieFormatGenderValidityCheck: () => jp, tournamentMatchUps: () => sf, validMatchUp: () => pm, validMatchUps: () => yi, validateCollectionDefinition: () => il, validateLineUp: () => Dm });
9779
+ Te(yN, { addGoesTo: () => Ja, allCompetitionMatchUps: () => Hi, allDrawMatchUps: () => Ur, allEventMatchUps: () => _n, allPlayoffPositionsFilled: () => my, allTournamentMatchUps: () => Qt, analyzeDraws: () => Wl, analyzeMatchUp: () => Vu, analyzeTournament: () => mU, bulkUpdatePublishedEventIds: () => hU, calculateWinCriteria: () => Do, categoryCanContain: () => il, checkMatchUpIsComplete: () => Ga, checkValidEntries: () => xm, compareTieFormats: () => Zn, competitionScheduleMatchUps: () => Jl, courtGridRows: () => tf, credits: () => pV, drawMatchUps: () => NU, eventMatchUps: () => af, filterMatchUps: () => jn, filterParticipants: () => Al, findDrawDefinition: () => Ly, findExtension: () => De, findVenue: () => Ln, getAggregateTeamResults: () => pU, getAllDrawMatchUps: () => Rt, getAllEventData: () => gU, getAllStructureMatchUps: () => _e, getAllowedDrawTypes: () => Wm, getAllowedMatchUpFormats: () => uU, getAppliedPolicies: () => xe, getAssignedParticipantIds: () => gs, getAvailableMatchUpsCount: () => Om, getAvailablePlayoffProfiles: () => Bl, getCategoryAgeDetails: () => Ls, getCheckedInParticipantIds: () => lo, getCompetitionDateRange: () => Hm, getCompetitionMatchUps: () => Bu, getCompetitionParticipants: () => nU, getCompetitionPenalties: () => lU, getCompetitionVenues: () => Yl, getCourtInfo: () => gm, getCourts: () => EU, getDrawData: () => Km, getDrawDefinitionTimeItem: () => kI, getDrawParticipantRepresentativeIds: () => xy, getDrawStructures: () => Ci, getDrawTypeCoercion: () => ql, getEligibleVoluntaryConsolationParticipants: () => ky, getEntriesAndSeedsCount: () => rf, getEvent: () => OU, getEventData: () => Xm, getEventMatchUpFormatTiming: () => SU, getEventProperties: () => AU, getEventPublishStatus: () => Ui, getEventStructures: () => Tm, getEventTimeItem: () => fl, getEvents: () => CU, getFlightProfile: () => wt, getHomeParticipantId: () => TU, getLinkedTournamentIds: () => dl, getMatchUpCompetitiveProfile: () => Dl, getMatchUpContextIds: () => PU, getMatchUpDailyLimits: () => of, getMatchUpDailyLimitsUpdate: () => vU, getMatchUpDependencies: () => Li, getMatchUpFormat: () => bU, getMatchUpFormatTiming: () => Tl, getMatchUpFormatTimingUpdate: () => UU, getMatchUpScheduleDetails: () => Im, getMatchUpType: () => ym, getMatchUpsMap: () => er, getMatchUpsStats: () => MU, getMatchUpsToSchedule: () => Qm, getMaxEntryPosition: () => yU, getModifiedMatchUpFormatTiming: () => nf, getPairedParticipant: () => Oi, getParticipantEventDetails: () => aU, getParticipantIdFinishingPositions: () => Fy, getParticipantMembership: () => sU, getParticipantResults: () => Vl, getParticipantScaleItem: () => ac, getParticipantSchedules: () => oU, getParticipantSignInStatus: () => cU, getParticipantTimeItem: () => xI, getParticipants: () => pt, getPersonRequests: () => Us, getPolicyDefinitions: () => ia, getPositionAssignments: () => Fu, getPositionsPlayedOff: () => kc, getPredictiveAccuracy: () => DU, getProfileRounds: () => ef, getPublishState: () => ho, getRandomQualifierList: () => Vy, getRoundMatchUps: () => vr, getRounds: () => RU, getScaleValues: () => Dc, getScaledEntries: () => vo, getScheduledRoundsDetails: () => Kl, getSchedulingProfile: () => oa, getSchedulingProfileIssues: () => IU, getSeedingThresholds: () => oy, getSeedsCount: () => Hl, getStructureSeedAssignments: () => mi, getTeamLineUp: () => Qa, getTieFormat: () => Ym, getTimeItem: () => gi, getTournamentIds: () => ul, getTournamentInfo: () => wo, getTournamentPenalties: () => qm, getTournamentPersons: () => dU, getTournamentPoints: () => zm, getTournamentPublishStatus: () => El, getTournamentStructures: () => py, getTournamentTimeItem: () => dm, getValidGroupSizes: () => kl, getVenueData: () => ic, getVenuesAndCourts: () => sa, isAdHoc: () => Rr, isCompletedStructure: () => kn, isValidForQualifying: () => jy, isValidMatchUpFormat: () => qr, matchUpActions: () => km, participantScaleItem: () => vn, participantScheduledMatchUps: () => wU, positionActions: () => By, publicFindCourt: () => HI, publicFindVenue: () => qI, tallyParticipantResults: () => xc, tieFormatGenderValidityCheck: () => jp, tournamentMatchUps: () => sf, validMatchUp: () => pm, validMatchUps: () => yi, validateCollectionDefinition: () => nl, validateLineUp: () => Dm });
9780
9780
  function pV() {
9781
9781
  return `
9782
9782
  This project would not have been possible without the generous input and patience
@@ -9800,7 +9800,7 @@ function pV() {
9800
9800
  `;
9801
9801
  }
9802
9802
  var UN = {};
9803
- Te(UN, { filterParticipants: () => El, getCompetitionParticipants: () => nU, getPairedParticipant: () => Oi, getParticipantEventDetails: () => aU, getParticipantMembership: () => sU, getParticipantScaleItem: () => ac, getParticipantSchedules: () => oU, getParticipantSignInStatus: () => cU, getParticipantTimeItem: () => xI, getParticipants: () => pt, getScaleValues: () => Dc, participantScaleItem: () => vn, validateLineUp: () => Dm });
9803
+ Te(UN, { filterParticipants: () => Al, getCompetitionParticipants: () => nU, getPairedParticipant: () => Oi, getParticipantEventDetails: () => aU, getParticipantMembership: () => sU, getParticipantScaleItem: () => ac, getParticipantSchedules: () => oU, getParticipantSignInStatus: () => cU, getParticipantTimeItem: () => xI, getParticipants: () => pt, getScaleValues: () => Dc, participantScaleItem: () => vn, validateLineUp: () => Dm });
9804
9804
  function nU(e) {
9805
9805
  let { tournamentRecords: t } = e || {};
9806
9806
  if (typeof t != "object" || !Object.keys(t).length) return { error: mt };
@@ -9857,11 +9857,11 @@ function cU({ tournamentRecord: e, participantId: t }) {
9857
9857
  if (!t) return { error: kt };
9858
9858
  let { participant: r } = Ea({ tournamentRecord: e, participantId: t });
9859
9859
  if (!r) return { error: Dt };
9860
- let { timeItem: i } = gi({ itemType: pl, element: r });
9861
- return i && i.itemValue === Nu && Nu;
9860
+ let { timeItem: i } = gi({ itemType: ml, element: r });
9861
+ return i && i.itemValue === Eu && Eu;
9862
9862
  }
9863
9863
  var SN = {};
9864
- Te(SN, { analyzeDraws: () => $l, analyzeTournament: () => mU, getAggregateTeamResults: () => pU, getAllowedDrawTypes: () => Wm, getAllowedMatchUpFormats: () => uU, getAppliedPolicies: () => xe, getCompetitionDateRange: () => Hm, getCompetitionPenalties: () => lU, getPolicyDefinitions: () => ia, getTournamentInfo: () => wo, getTournamentPenalties: () => qm, getTournamentPersons: () => dU, getTournamentPoints: () => zm, getTournamentStructures: () => py, getTournamentTimeItem: () => dm });
9864
+ Te(SN, { analyzeDraws: () => Wl, analyzeTournament: () => mU, getAggregateTeamResults: () => pU, getAllowedDrawTypes: () => Wm, getAllowedMatchUpFormats: () => uU, getAppliedPolicies: () => xe, getCompetitionDateRange: () => Hm, getCompetitionPenalties: () => lU, getPolicyDefinitions: () => ia, getTournamentInfo: () => wo, getTournamentPenalties: () => qm, getTournamentPersons: () => dU, getTournamentPoints: () => zm, getTournamentStructures: () => py, getTournamentTimeItem: () => dm });
9865
9865
  function uU({ tournamentRecord: e, categoryName: t, categoryType: r }) {
9866
9866
  if (!e) return { error: J };
9867
9867
  let { appliedPolicies: i } = xe({ tournamentRecord: e });
@@ -9921,7 +9921,7 @@ function Hm({ tournamentRecords: e }) {
9921
9921
  function dU({ tournamentRecord: e, participantFilters: t }) {
9922
9922
  if (!e) return { error: J };
9923
9923
  let r = e.participants || [];
9924
- t && (r = El({ participants: r, participantFilters: t, tournamentRecord: e }));
9924
+ t && (r = Al({ participants: r, participantFilters: t, tournamentRecord: e }));
9925
9925
  let i = {}, n = (a) => {
9926
9926
  if (a.person) {
9927
9927
  let { personId: s } = a.person;
@@ -9985,7 +9985,7 @@ function hV(e) {
9985
9985
  }
9986
9986
  function mU({ tournamentRecord: e }) {
9987
9987
  if (!e) return { error: J };
9988
- let { drawsAnalysis: t } = $l({ tournamentRecord: e }), r = { isDual: hV(e), drawsAnalysis: t }, i = pt({ tournamentRecord: e });
9988
+ let { drawsAnalysis: t } = Wl({ tournamentRecord: e }), r = { isDual: hV(e), drawsAnalysis: t }, i = pt({ tournamentRecord: e });
9989
9989
  return i.missingParticipantIds?.length && (r.missingParticipantIds = i.missingParticipantIds), { ...x, analysis: r };
9990
9990
  }
9991
9991
  function wN(e, t) {
@@ -10076,7 +10076,7 @@ function zm({ participantFilters: e, policyDefinitions: t, tournamentRecord: r,
10076
10076
  return { participantsWithOutcomes: m, personPoints: f, pairPoints: g, teamPoints: h, ...x };
10077
10077
  }
10078
10078
  var DN = {};
10079
- Te(DN, { compareTieFormats: () => Zn, getTieFormat: () => Ym, tieFormatGenderValidityCheck: () => jp, validateCollectionDefinition: () => il });
10079
+ Te(DN, { compareTieFormats: () => Zn, getTieFormat: () => Ym, tieFormatGenderValidityCheck: () => jp, validateCollectionDefinition: () => nl });
10080
10080
  function op(e) {
10081
10081
  if (!e) return {};
10082
10082
  let t = [], r = e.tieFormatName, i = e.collectionDefinitions?.map((n) => {
@@ -10151,7 +10151,7 @@ function Ym({ tournamentRecord: e, drawDefinition: t, structureId: r, matchUpId:
10151
10151
  return { ...x, matchUp: c?.matchUp, structureDefaultTieFormat: tr(u), eventDefaultTieFormat: tr(d), drawDefaultTieFormat: tr(l), tieFormat: tr(p), structure: n };
10152
10152
  }
10153
10153
  var PN = {};
10154
- Te(PN, { bulkUpdatePublishedEventIds: () => hU, getAllEventData: () => gU, getCourtInfo: () => gm, getDrawData: () => Km, getEventData: () => Xm, getEventPublishStatus: () => Ui, getPublishState: () => ho, getTournamentPublishStatus: () => Nl, getVenueData: () => ic });
10154
+ Te(PN, { bulkUpdatePublishedEventIds: () => hU, getAllEventData: () => gU, getCourtInfo: () => gm, getDrawData: () => Km, getEventData: () => Xm, getEventPublishStatus: () => Ui, getPublishState: () => ho, getTournamentPublishStatus: () => El, getVenueData: () => ic });
10155
10155
  function hU({ tournamentRecord: e, outcomes: t }) {
10156
10156
  if (!e) return { error: J };
10157
10157
  if (!t?.length) return { error: ce, info: "Missing outcomes" };
@@ -10225,7 +10225,7 @@ function IV({ convertExtensions: e, tournamentRecord: t, ignoreDisabled: r, date
10225
10225
  }, []);
10226
10226
  return { venues: n, courts: a };
10227
10227
  }
10228
- function zl({ tournamentRecords: e, requireCourts: t, dates: r }) {
10228
+ function Yl({ tournamentRecords: e, requireCourts: t, dates: r }) {
10229
10229
  return typeof e != "object" || !Object.keys(e).length ? { error: mt } : Object.keys(e).reduce((i, n) => {
10230
10230
  let a = e[n], { venues: s } = IV({ tournamentRecord: a, dates: r });
10231
10231
  return s?.forEach((o) => {
@@ -10237,7 +10237,7 @@ function zl({ tournamentRecords: e, requireCourts: t, dates: r }) {
10237
10237
  function gU({ tournamentRecord: e, policyDefinitions: t }) {
10238
10238
  if (!e) return { error: J };
10239
10239
  let r = e.events || [], i = e?.participants || [], { tournamentInfo: n } = wo({ tournamentRecord: e }), { venues: a } = sa({ tournamentRecord: e }), s = r.map((o) => {
10240
- let { eventId: c } = o, u = vN({ event: o }).eventInfo, l = fl({ tournamentRecord: e, event: o }).scheduleTiming, d = (o.drawDefinitions || []).map((m) => {
10240
+ let { eventId: c } = o, u = vN({ event: o }).eventInfo, l = hl({ tournamentRecord: e, event: o }).scheduleTiming, d = (o.drawDefinitions || []).map((m) => {
10241
10241
  let f = (({ drawId: U, drawName: D, matchUpFormat: v, updatedAt: w }) => ({ matchUpFormat: v, updatedAt: w, drawName: D, drawId: U }))(m), { abandonedMatchUps: h, completedMatchUps: g, upcomingMatchUps: I, pendingMatchUps: y } = Nc({ requireParticipants: !0, tournamentParticipants: i, context: { eventId: c }, policyDefinitions: t, tournamentRecord: e, inContext: !0, scheduleTiming: l, drawDefinition: m, event: o });
10242
10242
  return { drawInfo: f, matchUps: { abandonedMatchUps: h, completedMatchUps: g, upcomingMatchUps: I, pendingMatchUps: y } };
10243
10243
  }), p = Ui({ event: o });
@@ -10320,7 +10320,7 @@ function Xm(e) {
10320
10320
  return R.eventInfo.publishState = g, R.eventInfo.published = g?.status?.published, { ...x, eventData: R, participants: y };
10321
10321
  }
10322
10322
  var EN = {};
10323
- Te(EN, { courtGridRows: () => tf, findVenue: () => Ln, getMatchUpsToSchedule: () => Qm, getPersonRequests: () => Us, getProfileRounds: () => ef, getScheduledRoundsDetails: () => Yl, getSchedulingProfile: () => oa, getSchedulingProfileIssues: () => IU, publicFindCourt: () => HI });
10323
+ Te(EN, { courtGridRows: () => tf, findVenue: () => Ln, getMatchUpsToSchedule: () => Qm, getPersonRequests: () => Us, getProfileRounds: () => ef, getScheduledRoundsDetails: () => Kl, getSchedulingProfile: () => oa, getSchedulingProfileIssues: () => IU, publicFindCourt: () => HI });
10324
10324
  function oc({ matchUpPotentialParticipantIds: e, matchUpNotBeforeTimes: t, timeAfterRecovery: r, matchUp: i }) {
10325
10325
  let { individualParticipantIds: n } = um(i);
10326
10326
  r = r ?? i.schedule?.timeAfterRecovery;
@@ -10348,15 +10348,15 @@ function Qm(e) {
10348
10348
  return { matchUpsToSchedule: d, matchUpMap: p };
10349
10349
  }
10350
10350
  function Jm({ defaultRecoveryMinutes: e = 0, defaultAverageMinutes: t, tournamentRecords: r, matchUpFormat: i, categoryName: n, categoryType: a, tournamentId: s, eventType: o, eventId: c }) {
10351
- if (!qr({ matchUpFormat: i })) return { error: Ku };
10351
+ if (!qr({ matchUpFormat: i })) return { error: Xu };
10352
10352
  let u = Object.keys(r).filter((d) => !s || d === s), l;
10353
10353
  return u.forEach((d) => {
10354
10354
  if (l) return;
10355
10355
  let p = r[d], m = c ? Nr({ tournamentRecord: p, eventId: c })?.event : void 0;
10356
- return l = Dl({ tournamentRecord: p, matchUpFormat: i, categoryName: n, categoryType: a, eventType: o, event: m }), l?.averageMinutes || l?.recoveryMinutes;
10356
+ return l = Tl({ tournamentRecord: p, matchUpFormat: i, categoryName: n, categoryType: a, eventType: o, event: m }), l?.averageMinutes || l?.recoveryMinutes;
10357
10357
  }), { recoveryMinutes: l?.recoveryMinutes || e, averageMinutes: l?.averageMinutes || t, typeChangeRecoveryMinutes: l?.typeChangeRecoveryMinutes || l?.recoveryMinutes || e };
10358
10358
  }
10359
- function Yl(e) {
10359
+ function Kl(e) {
10360
10360
  let t = se(e, [{ [uI]: { tournamentRecords: !1, tournamentRecord: !1 } }, { rounds: !0, [Er]: cr }]);
10361
10361
  if (t.error) return t;
10362
10362
  let { scheduleCompletedMatchUps: r, periodLength: i = 30 } = e, n = e.tournamentRecords || e.tournamentRecord && { [e.tournamentRecord.tournamentId]: e.tournamentRecord } || {};
@@ -10463,7 +10463,7 @@ function oa({ tournamentRecords: e, tournamentRecord: t }) {
10463
10463
  if (typeof e != "object" || !Object.keys(e).length) return { error: mt };
10464
10464
  let { extension: r } = De({ element: t, name: Gs, tournamentRecords: e, discover: !0 }), i = r?.value || [];
10465
10465
  if (i.length) {
10466
- let { venueIds: n } = zl({ requireCourts: !0, tournamentRecords: e }), { eventIds: a, drawIds: s } = Ny({ tournamentRecords: e }), { updatedSchedulingProfile: o, modifications: c, issues: u } = AN({ schedulingProfile: i, venueIds: n, eventIds: a, drawIds: s });
10466
+ let { venueIds: n } = Yl({ requireCourts: !0, tournamentRecords: e }), { eventIds: a, drawIds: s } = Ny({ tournamentRecords: e }), { updatedSchedulingProfile: o, modifications: c, issues: u } = AN({ schedulingProfile: i, venueIds: n, eventIds: a, drawIds: s });
10467
10467
  if (c) {
10468
10468
  i = o;
10469
10469
  let l = Fc({ tournamentRecords: e, tournamentRecord: t, schedulingProfile: i });
@@ -10476,18 +10476,18 @@ function Fc({ tournamentRecords: e, tournamentRecord: t, schedulingProfile: r })
10476
10476
  let i = Zm({ tournamentRecords: e, schedulingProfile: r });
10477
10477
  return i.error ? i : r ? Le({ tournamentRecords: e, discover: !0, extension: { name: Gs, value: r } }) : yr({ element: t, name: Gs, tournamentRecords: e, discover: !0 });
10478
10478
  }
10479
- function Kl(e) {
10479
+ function Xl(e) {
10480
10480
  let { tournamentRecord: t } = e, r = e.tournamentRecords || t && { [t.tournamentId]: t } || {};
10481
10481
  if (!e.schedulingProfile) {
10482
10482
  let { modifications: u, issues: l } = oa({ tournamentRecords: r, tournamentRecord: t });
10483
10483
  return { success: !u, modifications: u, issues: l };
10484
10484
  }
10485
- let { venueIds: i } = zl({ tournamentRecords: r }), { eventIds: n, drawIds: a } = Ny({ tournamentRecords: r }), { updatedSchedulingProfile: s, modifications: o, issues: c } = AN({ schedulingProfile: e.schedulingProfile, venueIds: i, eventIds: n, drawIds: a });
10485
+ let { venueIds: i } = Yl({ tournamentRecords: r }), { eventIds: n, drawIds: a } = Ny({ tournamentRecords: r }), { updatedSchedulingProfile: s, modifications: o, issues: c } = AN({ schedulingProfile: e.schedulingProfile, venueIds: i, eventIds: n, drawIds: a });
10486
10486
  return o ? { ...Fc({ schedulingProfile: s, tournamentRecords: r }), modifications: o, issues: c } : { ...x, modifications: o, issues: c };
10487
10487
  }
10488
10488
  function IU(e) {
10489
10489
  let { scheduleDates: t = [], tournamentRecords: r, periodLength: i = 30 } = e ?? {};
10490
- if (typeof r != "object") return { error: Hu };
10490
+ if (typeof r != "object") return { error: zu };
10491
10491
  if (!Array.isArray(t)) return { error: z };
10492
10492
  if (!t.every(kr)) return { error: Ht };
10493
10493
  let n = [], a = 0, s = {}, { schedulingProfile: o } = oa({ tournamentRecords: r });
@@ -10497,7 +10497,7 @@ function IU(e) {
10497
10497
  let { scheduleDate: d, venues: p = [] } = l;
10498
10498
  if (!t?.length || t.includes(d)) {
10499
10499
  for (let m of p || []) if (m) {
10500
- let { rounds: f } = m, h = [], { orderedMatchUpIds: g, scheduledRoundsDetails: I } = Yl({ tournamentRecords: r, periodLength: i, matchUps: c, rounds: f }), { matchUpDependencies: y } = Li({ tournamentRecords: r, matchUps: c }), U = (D) => {
10500
+ let { rounds: f } = m, h = [], { orderedMatchUpIds: g, scheduledRoundsDetails: I } = Kl({ tournamentRecords: r, periodLength: i, matchUps: c, rounds: f }), { matchUpDependencies: y } = Li({ tournamentRecords: r, matchUps: c }), U = (D) => {
10501
10501
  let v;
10502
10502
  return I?.find((w, S) => {
10503
10503
  let T = w.matchUpIds.includes(D);
@@ -10565,7 +10565,7 @@ function xv(e) {
10565
10565
  }
10566
10566
  function ef({ tournamentRecords: e, schedulingProfile: t, tournamentRecord: r, withRoundId: i }) {
10567
10567
  if (r && !e) {
10568
- if (typeof r != "object") return { error: Hu };
10568
+ if (typeof r != "object") return { error: zu };
10569
10569
  e = { [r.tournamentId]: r };
10570
10570
  }
10571
10571
  if (t) {
@@ -10604,7 +10604,7 @@ var CN = {};
10604
10604
  Te(CN, { getEntriesAndSeedsCount: () => rf, getMaxEntryPosition: () => yU });
10605
10605
  function rf({ policyDefinitions: e, drawDefinition: t, drawSize: r, drawId: i, event: n, stage: a }) {
10606
10606
  if (!n) return { error: it };
10607
- let { entries: s, stageEntries: o } = $b({ drawDefinition: t, drawId: i, stage: a, event: n }), c = o.length, { drawSize: u } = fR({ participantsCount: c }), l = ql({ drawSize: r ?? u, participantsCount: c, policyDefinitions: e });
10607
+ let { entries: s, stageEntries: o } = $b({ drawDefinition: t, drawId: i, stage: a, event: n }), c = o.length, { drawSize: u } = fR({ participantsCount: c }), l = Hl({ drawSize: r ?? u, participantsCount: c, policyDefinitions: e });
10608
10608
  if (l.error) return F({ result: l, stack: "getEntriesAndSeedsCount" });
10609
10609
  let { seedsCount: d } = l;
10610
10610
  return { entries: s, seedsCount: d, stageEntries: o };
@@ -10614,7 +10614,7 @@ function yU(e) {
10614
10614
  return Math.max(...t.filter((n) => (!i || i === n.entryStage) && (!r || n.entryStatus === r) && !isNaN(n.entryPosition)).map(({ entryPosition: n }) => pe(n || 0)), 0);
10615
10615
  }
10616
10616
  var ON = {};
10617
- Te(ON, { allCompetitionMatchUps: () => Hi, allDrawMatchUps: () => Ur, allEventMatchUps: () => _n, allTournamentMatchUps: () => Qt, analyzeMatchUp: () => Bu, calculateWinCriteria: () => Do, checkMatchUpIsComplete: () => Ga, competitionScheduleMatchUps: () => Ql, drawMatchUps: () => NU, eventMatchUps: () => af, filterMatchUps: () => jn, getAllDrawMatchUps: () => Rt, getAllStructureMatchUps: () => _e, getCheckedInParticipantIds: () => lo, getCompetitionMatchUps: () => _u, getEventMatchUpFormatTiming: () => SU, getHomeParticipantId: () => TU, getMatchUpCompetitiveProfile: () => wl, getMatchUpContextIds: () => PU, getMatchUpDailyLimits: () => of, getMatchUpDailyLimitsUpdate: () => vU, getMatchUpDependencies: () => Li, getMatchUpFormat: () => bU, getMatchUpFormatTiming: () => Dl, getMatchUpFormatTimingUpdate: () => UU, getMatchUpScheduleDetails: () => Im, getMatchUpType: () => ym, getMatchUpsStats: () => MU, getModifiedMatchUpFormatTiming: () => nf, getParticipantResults: () => Bl, getPredictiveAccuracy: () => DU, getRoundMatchUps: () => vr, getRounds: () => RU, isValidMatchUpFormat: () => qr, matchUpActions: () => km, participantScheduledMatchUps: () => wU, tallyParticipantResults: () => xc, tournamentMatchUps: () => sf, validMatchUp: () => pm, validMatchUps: () => yi });
10617
+ Te(ON, { allCompetitionMatchUps: () => Hi, allDrawMatchUps: () => Ur, allEventMatchUps: () => _n, allTournamentMatchUps: () => Qt, analyzeMatchUp: () => Vu, calculateWinCriteria: () => Do, checkMatchUpIsComplete: () => Ga, competitionScheduleMatchUps: () => Jl, drawMatchUps: () => NU, eventMatchUps: () => af, filterMatchUps: () => jn, getAllDrawMatchUps: () => Rt, getAllStructureMatchUps: () => _e, getCheckedInParticipantIds: () => lo, getCompetitionMatchUps: () => Bu, getEventMatchUpFormatTiming: () => SU, getHomeParticipantId: () => TU, getMatchUpCompetitiveProfile: () => Dl, getMatchUpContextIds: () => PU, getMatchUpDailyLimits: () => of, getMatchUpDailyLimitsUpdate: () => vU, getMatchUpDependencies: () => Li, getMatchUpFormat: () => bU, getMatchUpFormatTiming: () => Tl, getMatchUpFormatTimingUpdate: () => UU, getMatchUpScheduleDetails: () => Im, getMatchUpType: () => ym, getMatchUpsStats: () => MU, getModifiedMatchUpFormatTiming: () => nf, getParticipantResults: () => Vl, getPredictiveAccuracy: () => DU, getRoundMatchUps: () => vr, getRounds: () => RU, isValidMatchUpFormat: () => qr, matchUpActions: () => km, participantScheduledMatchUps: () => wU, tallyParticipantResults: () => xc, tournamentMatchUps: () => sf, validMatchUp: () => pm, validMatchUps: () => yi });
10618
10618
  function kN({ tournamentRecords: e, extensionName: t }) {
10619
10619
  if (typeof e != "object" || !Object.keys(e).length) return { error: mt };
10620
10620
  let r = [], i;
@@ -10632,7 +10632,7 @@ function kN({ tournamentRecords: e, extensionName: t }) {
10632
10632
  function UU({ tournamentRecords: e }) {
10633
10633
  return kN({ extensionName: Kn, tournamentRecords: e });
10634
10634
  }
10635
- var Gf = "ADULT", $f = "JUNIOR", cd = "WHEELCHAIR", xN = { [Ma]: { allowModificationWhenMatchUpsScheduled: { courts: !1, venues: !1 }, defaultTimes: { averageTimes: [{ categoryNames: [], minutes: { default: 90 } }], recoveryTimes: [{ minutes: { [We]: 30, default: 60 } }] }, defaultDailyLimits: { [ze]: 2, [We]: 2, total: 3 }, matchUpAverageTimes: [{ matchUpFormatCodes: [bi], averageTimes: [{ categoryNames: [], minutes: { default: 90 } }, { categoryTypes: [cd], minutes: { default: 120 } }] }, { matchUpFormatCodes: ["SET3-S:6/TB7-F:TB10"], averageTimes: [{ categoryNames: [], minutes: { default: 85 } }] }, { matchUpFormatCodes: ["SET3-S:6/TB7-F:TB7"], averageTimes: [{ categoryNames: [], minutes: { default: 70 } }] }, { matchUpFormatCodes: ["SET3-S:4NOAD-F:TB7"], averageTimes: [{ categoryNames: [], minutes: { default: 55 } }] }, { matchUpFormatCodes: ["SET3-S:4/TB7"], averageTimes: [{ categoryNames: [], minutes: { default: 60 } }] }, { matchUpFormatCodes: ["SET3-S:4/TB7-F:TB7"], averageTimes: [{ categoryNames: [], minutes: { default: 50 } }] }, { matchUpFormatCodes: ["SET3-S:4/TB7-F:TB10"], averageTimes: [{ categoryNames: [], minutes: { default: 55 } }] }, { matchUpFormatCodes: ["SET3-S:4/TB5@3"], averageTimes: [{ categoryNames: [], minutes: { default: 45 } }] }, { matchUpFormatCodes: ["SET1-S:8/TB7", "SET1-S:8/TB7@7"], averageTimes: [{ categoryNames: [], minutes: { default: 40 } }] }, { matchUpFormatCodes: ["SET1-S:5/TB9@4"], averageTimes: [{ categoryNames: [], minutes: { default: 30 } }] }, { matchUpFormatCodes: ["SET1-S:6/TB7"], averageTimes: [{ categoryNames: [], minutes: { default: 30 } }] }, { matchUpFormatCodes: ["SET1-S:6NOAD"], averageTimes: [{ categoryNames: [], minutes: { default: 30 } }] }, { matchUpFormatCodes: ["SET1-S:4/TB7", "SET1-S:4/TB5@3", "SET3-S:TB10", "SET1-S:T20"], averageTimes: [{ categoryNames: [], minutes: { default: 20 } }] }, { matchUpFormatCodes: ["SET1-S:4NOAD"], averageTimes: [{ categoryNames: [], minutes: { default: 20 } }] }, { matchUpFormatCodes: ["SET1-S:TB10"], averageTimes: [{ categoryNames: [], minutes: { default: 10 } }] }], matchUpRecoveryTimes: [{ matchUpFormatCodes: ["SET3-S:6/TB7", "SET3-S:6/TB7-F:TB10", "SET3-S:6/TB7-F:TB7"], recoveryTimes: [{ categoryTypes: [Gf, cd], minutes: { default: 60, [We]: 30 } }, { categoryTypes: [$f], minutes: { default: 60, [We]: 60 } }] }, { matchUpFormatCodes: ["SET3-S:4/TB7-F:TB7", "SET3-S:4/TB7-F:TB10", "SET3-S:4NOAD-F:TB7", "SET3-S:4/TB7", "SET3-S:4/TB5@3"], recoveryTimes: [{ categoryTypes: [Gf, cd], minutes: { default: 30 } }, { categoryTypes: [$f], minutes: { default: 60 } }] }, { matchUpFormatCodes: ["SET1-S:8/TB7", "SET1-S:8/TB7@7", "SET1-S:5/TB9@4", "SET1-S:6/TB7", "SET1-S:6NOAD", "SET1-S:4/TB7", "SET1-S:4NOAD", "SET3-S:TB10", "SET1-S:T20"], recoveryTimes: [{ categoryNames: [], minutes: { default: 30 } }] }, { matchUpFormatCodes: ["SET1-S:4/TB5@3"], recoveryTimes: [{ categoryTypes: [Gf, $f], minutes: { default: 30 } }, { categoryTypes: [cd], minutes: { default: 15 } }] }, { matchUpFormatCodes: ["SET1-S:TB10"], recoveryTimes: [{ categoryNames: [], minutes: { default: 15 } }] }], matchUpDailyLimits: [] } }, DV = xN;
10635
+ var Gf = "ADULT", $f = "JUNIOR", ud = "WHEELCHAIR", xN = { [Ma]: { allowModificationWhenMatchUpsScheduled: { courts: !1, venues: !1 }, defaultTimes: { averageTimes: [{ categoryNames: [], minutes: { default: 90 } }], recoveryTimes: [{ minutes: { [We]: 30, default: 60 } }] }, defaultDailyLimits: { [ze]: 2, [We]: 2, total: 3 }, matchUpAverageTimes: [{ matchUpFormatCodes: [bi], averageTimes: [{ categoryNames: [], minutes: { default: 90 } }, { categoryTypes: [ud], minutes: { default: 120 } }] }, { matchUpFormatCodes: ["SET3-S:6/TB7-F:TB10"], averageTimes: [{ categoryNames: [], minutes: { default: 85 } }] }, { matchUpFormatCodes: ["SET3-S:6/TB7-F:TB7"], averageTimes: [{ categoryNames: [], minutes: { default: 70 } }] }, { matchUpFormatCodes: ["SET3-S:4NOAD-F:TB7"], averageTimes: [{ categoryNames: [], minutes: { default: 55 } }] }, { matchUpFormatCodes: ["SET3-S:4/TB7"], averageTimes: [{ categoryNames: [], minutes: { default: 60 } }] }, { matchUpFormatCodes: ["SET3-S:4/TB7-F:TB7"], averageTimes: [{ categoryNames: [], minutes: { default: 50 } }] }, { matchUpFormatCodes: ["SET3-S:4/TB7-F:TB10"], averageTimes: [{ categoryNames: [], minutes: { default: 55 } }] }, { matchUpFormatCodes: ["SET3-S:4/TB5@3"], averageTimes: [{ categoryNames: [], minutes: { default: 45 } }] }, { matchUpFormatCodes: ["SET1-S:8/TB7", "SET1-S:8/TB7@7"], averageTimes: [{ categoryNames: [], minutes: { default: 40 } }] }, { matchUpFormatCodes: ["SET1-S:5/TB9@4"], averageTimes: [{ categoryNames: [], minutes: { default: 30 } }] }, { matchUpFormatCodes: ["SET1-S:6/TB7"], averageTimes: [{ categoryNames: [], minutes: { default: 30 } }] }, { matchUpFormatCodes: ["SET1-S:6NOAD"], averageTimes: [{ categoryNames: [], minutes: { default: 30 } }] }, { matchUpFormatCodes: ["SET1-S:4/TB7", "SET1-S:4/TB5@3", "SET3-S:TB10", "SET1-S:T20"], averageTimes: [{ categoryNames: [], minutes: { default: 20 } }] }, { matchUpFormatCodes: ["SET1-S:4NOAD"], averageTimes: [{ categoryNames: [], minutes: { default: 20 } }] }, { matchUpFormatCodes: ["SET1-S:TB10"], averageTimes: [{ categoryNames: [], minutes: { default: 10 } }] }], matchUpRecoveryTimes: [{ matchUpFormatCodes: ["SET3-S:6/TB7", "SET3-S:6/TB7-F:TB10", "SET3-S:6/TB7-F:TB7"], recoveryTimes: [{ categoryTypes: [Gf, ud], minutes: { default: 60, [We]: 30 } }, { categoryTypes: [$f], minutes: { default: 60, [We]: 60 } }] }, { matchUpFormatCodes: ["SET3-S:4/TB7-F:TB7", "SET3-S:4/TB7-F:TB10", "SET3-S:4NOAD-F:TB7", "SET3-S:4/TB7", "SET3-S:4/TB5@3"], recoveryTimes: [{ categoryTypes: [Gf, ud], minutes: { default: 30 } }, { categoryTypes: [$f], minutes: { default: 60 } }] }, { matchUpFormatCodes: ["SET1-S:8/TB7", "SET1-S:8/TB7@7", "SET1-S:5/TB9@4", "SET1-S:6/TB7", "SET1-S:6NOAD", "SET1-S:4/TB7", "SET1-S:4NOAD", "SET3-S:TB10", "SET1-S:T20"], recoveryTimes: [{ categoryNames: [], minutes: { default: 30 } }] }, { matchUpFormatCodes: ["SET1-S:4/TB5@3"], recoveryTimes: [{ categoryTypes: [Gf, $f], minutes: { default: 30 } }, { categoryTypes: [ud], minutes: { default: 15 } }] }, { matchUpFormatCodes: ["SET1-S:TB10"], recoveryTimes: [{ categoryNames: [], minutes: { default: 15 } }] }], matchUpDailyLimits: [] } }, DV = xN;
10636
10636
  function SU({ tournamentRecord: e, matchUpFormats: t, categoryType: r, event: i }) {
10637
10637
  if (!i) return { error: it };
10638
10638
  let n = [], a;
@@ -10653,25 +10653,25 @@ function SU({ tournamentRecord: e, matchUpFormats: t, categoryType: r, event: i
10653
10653
  let { eventType: s, eventId: o, category: c } = i, u = c?.categoryName ?? c?.ageCategoryCode ?? o;
10654
10654
  if (!o) return { error: it };
10655
10655
  let l = n.map(({ matchUpFormat: d, description: p }) => {
10656
- let m = Dl({ tournamentRecord: e, matchUpFormat: d, categoryName: u, categoryType: r, eventType: s, event: i });
10656
+ let m = Tl({ tournamentRecord: e, matchUpFormat: d, categoryName: u, categoryType: r, eventType: s, event: i });
10657
10657
  return { matchUpFormat: d, description: p, ...m };
10658
10658
  });
10659
10659
  return ae({ eventMatchUpFormatTiming: l, info: a });
10660
10660
  }
10661
10661
  function nf(e) {
10662
- let t = se(e, [{ [_t]: !0 }, { [ir]: (h) => qr({ matchUpFormat: h }), [ti]: Ku, [nI]: !0 }]);
10662
+ let t = se(e, [{ [_t]: !0 }, { [ir]: (h) => qr({ matchUpFormat: h }), [ti]: Xu, [nI]: !0 }]);
10663
10663
  if (t.error) return t;
10664
- let { tournamentRecord: r, matchUpFormat: i, event: n } = e, { extension: a } = De({ name: Kn, element: n }), s = a?.value, { extension: o } = De({ element: r, name: Kn }), c = o?.value, u = s?.matchUpAverageTimes && nu({ ...s, matchUpFormat: i }), l = c?.matchUpAverageTimes && nu({ ...c, matchUpFormat: i }), d = [u, l].find((h) => h), p = s?.matchUpRecoveryTimes && au({ ...s, matchUpFormat: i }), m = c?.matchUpRecoveryTimes && au({ ...c, matchUpFormat: i }), f = [p, m].find((h) => h);
10664
+ let { tournamentRecord: r, matchUpFormat: i, event: n } = e, { extension: a } = De({ name: Kn, element: n }), s = a?.value, { extension: o } = De({ element: r, name: Kn }), c = o?.value, u = s?.matchUpAverageTimes && au({ ...s, matchUpFormat: i }), l = c?.matchUpAverageTimes && au({ ...c, matchUpFormat: i }), d = [u, l].find((h) => h), p = s?.matchUpRecoveryTimes && su({ ...s, matchUpFormat: i }), m = c?.matchUpRecoveryTimes && su({ ...c, matchUpFormat: i }), f = [p, m].find((h) => h);
10665
10665
  return { matchUpFormat: i, recoveryTimes: f, averageTimes: d };
10666
10666
  }
10667
10667
  function vU({ tournamentRecords: e }) {
10668
- return kN({ extensionName: ul, tournamentRecords: e });
10668
+ return kN({ extensionName: ll, tournamentRecords: e });
10669
10669
  }
10670
- var Xl = ({ scheduleAttributes: e = ["scheduledDate", "scheduledTime"], schedule: t = {} }) => !!Object.keys(t).filter((r) => e.includes(r)).filter((r) => t[r]).length;
10670
+ var Ql = ({ scheduleAttributes: e = ["scheduledDate", "scheduledTime"], schedule: t = {} }) => !!Object.keys(t).filter((r) => e.includes(r)).filter((r) => t[r]).length;
10671
10671
  function wU({ scheduleAttributes: e = ["scheduledDate", "scheduledTime"], matchUps: t = [] }) {
10672
10672
  if (!yi(t)) return { error: ea };
10673
10673
  if (!Array.isArray(e)) return { error: z };
10674
- let r = t.filter(Boolean).filter(({ schedule: i }) => Xl({ schedule: i, scheduleAttributes: e })).reduce((i, n) => {
10674
+ let r = t.filter(Boolean).filter(({ schedule: i }) => Ql({ schedule: i, scheduleAttributes: e })).reduce((i, n) => {
10675
10675
  let { schedule: a } = n, s = ve(a?.scheduledDate), o = nt(a?.scheduledTime);
10676
10676
  return s && o && (i[s] ? i[s].push(n) : i[s] = [n]), i;
10677
10677
  }, {});
@@ -10747,7 +10747,7 @@ function sf(e) {
10747
10747
  Array.isArray(w[S]) && (v[S] || (v[S] = []), v[S] = v[S].concat(w[S]), v.matchUpsCount !== void 0 ? v.matchUpsCount += w[S].length : v.matchUpsCount = w[S].length);
10748
10748
  }), v), { matchUpsCount: 0 }), groupInfo: y, participants: g };
10749
10749
  }
10750
- function _u({ scheduleVisibilityFilters: e, hydrateParticipants: t, participantsProfile: r, tournamentRecords: i, useParticipantMap: n, policyDefinitions: a, usePublishState: s, matchUpFilters: o, contextFilters: c, nextMatchUps: u, inContext: l }) {
10750
+ function Bu({ scheduleVisibilityFilters: e, hydrateParticipants: t, participantsProfile: r, tournamentRecords: i, useParticipantMap: n, policyDefinitions: a, usePublishState: s, matchUpFilters: o, contextFilters: c, nextMatchUps: u, inContext: l }) {
10751
10751
  if (typeof i != "object" || !Object.keys(i).length) return { error: mt };
10752
10752
  let d = Object.keys(i).map((f) => {
10753
10753
  let h = i[f];
@@ -10759,13 +10759,13 @@ function _u({ scheduleVisibilityFilters: e, hydrateParticipants: t, participants
10759
10759
  else Array.isArray(h[g]) && (f[g] || (f[g] = []), f[g] = f[g].concat(h[g]));
10760
10760
  }), f), {}), groupInfo: m, mappedParticipants: p };
10761
10761
  }
10762
- function Ql(e) {
10762
+ function Jl(e) {
10763
10763
  if (typeof e?.tournamentRecords != "object" || !Object.keys(e?.tournamentRecords).length) return { error: mt };
10764
- let { courts: t, venues: r } = sa(e), i = oa(e).schedulingProfile, { sortDateMatchUps: n = !0, courtCompletedMatchUps: a, alwaysReturnCompleted: s, activeTournamentId: o, tournamentRecords: c, withCourtGridRows: u, minCourtGridRows: l, usePublishState: d, status: p = ni, sortCourtsData: m } = e, f = o ?? Zs() ?? Object.keys(c)[0], h = d ? Nl({ tournamentRecord: c[f], status: p }) : void 0, g = s ? _u({ ...e, matchUpFilters: { ...e.matchUpFilters, matchUpStatuses: [Ut] }, contextFilters: e.contextFilters }).completedMatchUps : [];
10764
+ let { courts: t, venues: r } = sa(e), i = oa(e).schedulingProfile, { sortDateMatchUps: n = !0, courtCompletedMatchUps: a, alwaysReturnCompleted: s, activeTournamentId: o, tournamentRecords: c, withCourtGridRows: u, minCourtGridRows: l, usePublishState: d, status: p = ni, sortCourtsData: m } = e, f = o ?? Zs() ?? Object.keys(c)[0], h = d ? El({ tournamentRecord: c[f], status: p }) : void 0, g = s ? Bu({ ...e, matchUpFilters: { ...e.matchUpFilters, matchUpStatuses: [Ut] }, contextFilters: e.contextFilters }).completedMatchUps : [];
10765
10765
  if (d && !h?.orderOfPlay?.published) return { completedMatchUps: g, dateMatchUps: [], courtsData: [], venues: r };
10766
10766
  let I, y;
10767
10767
  d && ({ drawIds: I, detailsMap: y } = TV({ tournamentRecords: c })), I?.length && (e.contextFilters || (e.contextFilters = {}), e.contextFilters?.drawIds ? e.contextFilters.drawIds = e.contextFilters.drawIds.filter((E) => I.includes(E)) : e.contextFilters.drawIds = I), h?.eventIds?.length && (e.matchUpFilters || (e.matchUpFilters = {}), e.matchUpFilters?.eventIds && e.matchUpFilters.eventIds.length ? e.matchUpFilters.eventIds = e.matchUpFilters.eventIds.filter((E) => h.eventIds.includes(E)) : e.matchUpFilters.eventIds = h.eventIds), h?.scheduledDates?.length && (e.matchUpFilters || (e.matchUpFilters = {}), e.matchUpFilters.scheduledDates && e.matchUpFilters.scheduledDates.length ? e.matchUpFilters.scheduledDates = e.matchUpFilters.scheduledDates.filter((E) => h.scheduledDates.includes(E)) : e.matchUpFilters.scheduledDates = h.scheduledDates), s && (e.matchUpFilters || (e.matchUpFilters = {}), e.matchUpFilters?.excludeMatchUpStatuses?.length ? e.matchUpFilters.excludeMatchUpStatuses.includes(Ut) || e.matchUpFilters.excludeMatchUpStatuses.push(Ut) : e.matchUpFilters.excludeMatchUpStatuses = [Ut]);
10768
- let { completedMatchUps: U, upcomingMatchUps: D, pendingMatchUps: v, groupInfo: w, mappedParticipants: S } = _u({ ...e, matchUpFilters: e.matchUpFilters, contextFilters: e.contextFilters }), T = [...D ?? [], ...v ?? []];
10768
+ let { completedMatchUps: U, upcomingMatchUps: D, pendingMatchUps: v, groupInfo: w, mappedParticipants: S } = Bu({ ...e, matchUpFilters: e.matchUpFilters, contextFilters: e.contextFilters }), T = [...D ?? [], ...v ?? []];
10769
10769
  y && (!I?.length || Object.keys(y).length) && (T = T.filter((E) => {
10770
10770
  let { drawId: A, structureId: N, stage: C } = E;
10771
10771
  if (!y?.[A]?.publishingDetail?.published) return !1;
@@ -10806,7 +10806,7 @@ function of({ tournamentRecords: e, tournamentId: t }) {
10806
10806
  function PV(e) {
10807
10807
  let t = se(e, [{ [_t]: !0 }]);
10808
10808
  if (t.error) return t;
10809
- let { tournamentRecord: r } = e, { policy: i } = ps({ policyType: Ma, tournamentRecord: r }), { extension: n } = De({ element: r, name: ul }), a = n?.value?.dailyLimits, s = i?.defaultDailyLimits;
10809
+ let { tournamentRecord: r } = e, { policy: i } = ps({ policyType: Ma, tournamentRecord: r }), { extension: n } = De({ element: r, name: ll }), a = n?.value?.dailyLimits, s = i?.defaultDailyLimits;
10810
10810
  return { matchUpDailyLimits: a || s };
10811
10811
  }
10812
10812
  function DU(e) {
@@ -10823,7 +10823,7 @@ function DU(e) {
10823
10823
  return { ...x, relevantMatchUps: w, zoneDistribution: R, zoneData: b, accuracy: S, nonZone: E };
10824
10824
  }
10825
10825
  function bV({ zoneData: e }) {
10826
- let t = { [FI]: [], [Eu]: [], [Au]: [] };
10826
+ let t = { [FI]: [], [Au]: [], [Cu]: [] };
10827
10827
  for (let r of e) {
10828
10828
  let { competitiveness: i, score: n, valuesGap: a } = r;
10829
10829
  t[i] && t[i].push({ score: n, valuesGap: a });
@@ -10952,7 +10952,7 @@ function MU({ profileBands: e, tournamentRecord: t, matchUps: r }) {
10952
10952
  let i = !e && ps({ policyType: Vn, tournamentRecord: t }).policy, n = e || i?.profileBands || LI[Vn].profileBands, a = r.filter(({ winningSide: p }) => p), s = a.map(lb), o = (p, m) => {
10953
10953
  let f = ub(m, n);
10954
10954
  return p[f] += 1, p;
10955
- }, c = db(s).reduce((p, m) => o(p, m), { [FI]: 0, [Eu]: 0, [Au]: 0, [ib]: 0 }), u = Object.keys(c).reduce((p, m) => (c[m] || 0) + p, 0), l = Object.keys(c).map((p) => {
10955
+ }, c = db(s).reduce((p, m) => o(p, m), { [FI]: 0, [Au]: 0, [Cu]: 0, [ib]: 0 }), u = Object.keys(c).reduce((p, m) => (c[m] || 0) + p, 0), l = Object.keys(c).map((p) => {
10956
10956
  let m = parseFloat((c[p] / u).toFixed(4));
10957
10957
  return { [p]: m * 100 };
10958
10958
  }), d = a.filter(({ matchUpStatus: p }) => p === sv).length;
@@ -10965,7 +10965,7 @@ function NV(e, t) {
10965
10965
  function RU({ excludeScheduleDateProfileRounds: e, excludeScheduledRounds: t, excludeCompletedRounds: r, inContextMatchUps: i, tournamentRecords: n, schedulingProfile: a, tournamentRecord: s, withSplitRounds: o, matchUpFilters: c, scheduleDate: u, withRoundId: l, venueId: d, context: p }) {
10966
10966
  if (i && !Array.isArray(i || typeof i[0] != "object")) return { error: z, inContextMatchUps: i };
10967
10967
  if (s && !n) {
10968
- if (typeof s != "object") return { error: Hu };
10968
+ if (typeof s != "object") return { error: zu };
10969
10969
  n = { [s.tournamentId]: s };
10970
10970
  }
10971
10971
  let m = typeof n != "object" || !Object.keys(n).length;
@@ -10994,11 +10994,11 @@ function RU({ excludeScheduleDateProfileRounds: e, excludeScheduledRounds: t, ex
10994
10994
  }).sort(NV) || [];
10995
10995
  return { ...x, rounds: v, excludedRounds: D };
10996
10996
  }
10997
- function Bu(e) {
10997
+ function Vu(e) {
10998
10998
  let { matchUp: t, sideNumber: r, setNumber: i, isTiebreakValue: n, isPointValue: a } = e || {}, { matchUpFormat: s } = e || {};
10999
10999
  if (!t) return { error: br };
11000
11000
  s = s || t?.matchUpFormat;
11001
- let o = Dr(s), c = !!t?.winningSide, u = t.score?.sets, l = u?.length, d = i && i - 1, p = !!u?.find((V, H) => V.setNumber === i && H === d), m = u?.filter((V) => V?.winningSide) || [], f = m?.length || 0, h = i && u?.slice(i) || [], g = !!(l && i && h?.reduce((V, H) => (!H || !H.side1Score && !H.side2Score && !H.side1TiebreakScore && !H.side2TiebreakScore && !H.side1PointScore && !H.side2PointScore) && V, !0)), I = i <= l && u.find((V) => V.setNumber === i), y = I && Lu({ setObject: I, matchUpScoringFormat: o }), { isCompletedSet: U, sideGameScores: D, sideTiebreakScores: v } = y || {}, w = !!(I && !U && g || i && i === l + 1 && !c), S = [1, 2].includes(r), T = S ? r - 1 : 0, b = I && S && (!n && !a && D[T] !== void 0 && D[T] || n && v[T] !== void 0 && v[T]), P = !!b, M = m?.map((V) => Lu({ setObject: V, matchUpScoringFormat: o }).isValidSetOutcome).reduce((V, H) => V && H, !0), R = m.reduce((V, H) => {
11001
+ let o = Dr(s), c = !!t?.winningSide, u = t.score?.sets, l = u?.length, d = i && i - 1, p = !!u?.find((V, H) => V.setNumber === i && H === d), m = u?.filter((V) => V?.winningSide) || [], f = m?.length || 0, h = i && u?.slice(i) || [], g = !!(l && i && h?.reduce((V, H) => (!H || !H.side1Score && !H.side2Score && !H.side1TiebreakScore && !H.side2TiebreakScore && !H.side1PointScore && !H.side2PointScore) && V, !0)), I = i <= l && u.find((V) => V.setNumber === i), y = I && _u({ setObject: I, matchUpScoringFormat: o }), { isCompletedSet: U, sideGameScores: D, sideTiebreakScores: v } = y || {}, w = !!(I && !U && g || i && i === l + 1 && !c), S = [1, 2].includes(r), T = S ? r - 1 : 0, b = I && S && (!n && !a && D[T] !== void 0 && D[T] || n && v[T] !== void 0 && v[T]), P = !!b, M = m?.map((V) => _u({ setObject: V, matchUpScoringFormat: o }).isValidSetOutcome).reduce((V, H) => V && H, !0), R = m.reduce((V, H) => {
11002
11002
  let { winningSide: W } = H, Y = W - 1;
11003
11003
  return V[Y]++, V;
11004
11004
  }, [0, 0]), E = t?.winningSide, A = E && E - 1, N = 1 - A, C = R[A], k = R[N], O = Math.max(...R), L = Wr(R)[O], { bestOf: _, exactly: B } = o ?? {}, G = _ && Math.ceil(_ / 2) || B || 1, $ = O === G && L === 1 && R.indexOf(O) + 1 || void 0, j = C > k && E === $;
@@ -11009,7 +11009,7 @@ function NU({ participants: e, tournamentAppliedPolicies: t, scheduleVisibilityF
11009
11009
  return !e?.length && o && ({ participants: e, participantMap: p, groupInfo: R } = ds({ participantsProfile: i, useParticipantMap: s, tournamentRecord: o, contextProfile: f, inContext: y })), D && f && !l && (l = na({ policyDefinitions: a, tournamentRecord: o, contextProfile: f, drawDefinition: h, event: D })), { ...Nc({ context: M, tournamentAppliedPolicies: t, scheduleVisibilityFilters: r, tournamentParticipants: e, participantsProfile: i, afterRecoveryTimes: n, policyDefinitions: a, tournamentRecord: o, usePublishState: c, participantMap: p, contextContent: l, contextFilters: u, matchUpFilters: d, publishStatus: m, contextProfile: f, drawDefinition: h, nextMatchUps: g, inContext: y, event: D }), groupInfo: R };
11010
11010
  }
11011
11011
  var LN = {};
11012
- Te(LN, { getCompetitionVenues: () => zl, getCourts: () => EU, getVenuesAndCourts: () => sa, publicFindVenue: () => qI });
11012
+ Te(LN, { getCompetitionVenues: () => Yl, getCourts: () => EU, getVenuesAndCourts: () => sa, publicFindVenue: () => qI });
11013
11013
  function EU({ tournamentRecord: e, venueId: t, venueIds: r }) {
11014
11014
  return e ? { courts: (e.venues || []).filter((i) => t ? i.venueId === t : r ? r.includes(i.venueId) : !0).map((i) => {
11015
11015
  let { venueId: n } = i, a = ie(i.courts || []);
@@ -11017,7 +11017,7 @@ function EU({ tournamentRecord: e, venueId: t, venueIds: r }) {
11017
11017
  }).flat() } : { error: J };
11018
11018
  }
11019
11019
  var _N = {};
11020
- Te(_N, { categoryCanContain: () => rl, getCategoryAgeDetails: () => Ls, getEvent: () => OU, getEventProperties: () => AU, getEventStructures: () => Tm, getEventTimeItem: () => ml, getEvents: () => CU, getFlightProfile: () => wt, getScaledEntries: () => vo });
11020
+ Te(_N, { categoryCanContain: () => il, getCategoryAgeDetails: () => Ls, getEvent: () => OU, getEventProperties: () => AU, getEventStructures: () => Tm, getEventTimeItem: () => fl, getEvents: () => CU, getFlightProfile: () => wt, getScaledEntries: () => vo });
11021
11021
  function AU({ tournamentRecord: e, event: t }) {
11022
11022
  if (!e) return { error: J };
11023
11023
  if (!t) return { error: it };
@@ -11034,7 +11034,7 @@ function AU({ tournamentRecord: e, event: t }) {
11034
11034
  function CU({ tournamentRecord: e, withScaleValues: t, scaleEventType: r, inContext: i, eventIds: n, drawIds: a, context: s }) {
11035
11035
  if (!e) return { error: J };
11036
11036
  let { tournamentId: o } = e, c = (e.events ?? []).filter(({ eventId: l }) => !n || Array.isArray(n) && n.includes(l)).map((l) => {
11037
- let d = l.drawDefinitions?.map(Ru);
11037
+ let d = l.drawDefinitions?.map(Nu);
11038
11038
  if (a?.length && !St(a, d).length) return;
11039
11039
  let p = ie(l);
11040
11040
  return i && Object.assign(p, { tournamentId: o }), s && Object.assign(p, s), p;
@@ -11141,18 +11141,18 @@ function EV(e) {
11141
11141
  let o = FV({ ...e, consideredEntries: a }), c = AV({ ...e, appliedPolicies: r, policyDefinitions: i, drawSize: o });
11142
11142
  if (c.error) return F({ result: c, stack: t });
11143
11143
  let u = c.drawType;
11144
- if (isNaN(o) && u !== zr) return F({ result: { error: Yu }, stack: t });
11144
+ if (isNaN(o) && u !== zr) return F({ result: { error: Ku }, stack: t });
11145
11145
  let l = i?.[wi] ?? r?.[wi], d = e.seedingProfile ?? l?.seedingProfile?.drawTypes?.[u ?? ""] ?? l?.seedingProfile;
11146
11146
  e.seedingProfile && (i[wi] || (i[wi] = { ...Xh[wi] }), i[wi].seedingProfile = d);
11147
11147
  let p = LV({ ...e, drawType: u });
11148
11148
  return p?.error ? F({ result: p, stack: t }) : { drawSize: o, drawType: u, enforceGender: n, seedingProfile: d, appliedPolicies: r, policyDefinitions: i };
11149
11149
  }
11150
11150
  function AV(e) {
11151
- let { policyDefinitions: t, appliedPolicies: r, enforceMinimumDrawSize: i = !0, drawSize: n } = e, a = e.drawTypeCoercion ?? Wl({ drawType: e.drawType, policyDefinitions: t, appliedPolicies: r }), s = gR({ drawType: e.drawType, enforceMinimumDrawSize: i, drawTypeCoercion: a, drawSize: n });
11151
+ let { policyDefinitions: t, appliedPolicies: r, enforceMinimumDrawSize: i = !0, drawSize: n } = e, a = e.drawTypeCoercion ?? ql({ drawType: e.drawType, policyDefinitions: t, appliedPolicies: r }), s = gR({ drawType: e.drawType, enforceMinimumDrawSize: i, drawTypeCoercion: a, drawSize: n });
11152
11152
  return s.error ? s : { drawType: s.drawType };
11153
11153
  }
11154
11154
  function BN(e) {
11155
- return e?.filter((t) => t.entryStatus && [...Fi, Sl].includes(t.entryStatus));
11155
+ return e?.filter((t) => t.entryStatus && [...Fi, vl].includes(t.entryStatus));
11156
11156
  }
11157
11157
  function CV({ considerEventEntries: e = !0, drawEntries: t, eventEntries: r, qualifyingOnly: i }) {
11158
11158
  return (i && [] || BN(t) || (e ? r : [])).filter(({ entryStage: n }) => !n || n === re);
@@ -11169,7 +11169,7 @@ function xV(e) {
11169
11169
  return o && s && xm({ consideredEntries: t, policyDefinitions: i, appliedPolicies: r, participantMap: a, enforceGender: n, participants: s, event: o });
11170
11170
  }
11171
11171
  function FV(e) {
11172
- return !e.drawSize && e.consideredEntries.length && ![zr, nl, vc, Ei, Nn].includes(e.drawType ?? "") && pc(e.consideredEntries.length) || e.drawSize && pe(e.drawSize) || !1;
11172
+ return !e.drawSize && e.consideredEntries.length && ![zr, al, vc, Ei, Nn].includes(e.drawType ?? "") && pc(e.consideredEntries.length) || e.drawSize && pe(e.drawSize) || !1;
11173
11173
  }
11174
11174
  function LV(e) {
11175
11175
  let { tournamentRecord: t, event: r, ignoreAllowedDrawTypes: i, drawType: n } = e, a = !i && t && Wm({ tournamentRecord: t, categoryType: r?.category?.categoryType, categoryName: r?.category?.categoryName });
@@ -11190,7 +11190,7 @@ function VN(e) {
11190
11190
  });
11191
11191
  }), { drawDefinition: t };
11192
11192
  }
11193
- function Jl(e) {
11193
+ function Zl(e) {
11194
11194
  let { voluntaryConsolation: t, tournamentRecord: r, event: i } = e, n = "generateDrawDefinition", { participants: a, participantMap: s } = pt({ withIndividualParticipants: !0, convertExtensions: !0, internalUse: !0, tournamentRecord: r }), o = BN(i?.entries) ?? [], c = EV({ ...e, participantMap: s, participants: a, eventEntries: o });
11195
11195
  if (c.error) return F({ result: c, stack: n });
11196
11196
  let { appliedPolicies: u, policyDefinitions: l, drawSize: d, drawType: p, enforceGender: m, seedingProfile: f } = c, h = i?.eventType, g = e.matchUpType ?? h, I = FB({ ...e, enforceGender: m, eventType: h, matchUpType: g });
@@ -11222,9 +11222,9 @@ function _V({ tournamentRecord: e, drawDefinition: t, policyDefinitions: r, scal
11222
11222
  return { scaleItemsWithParticipantIds: g };
11223
11223
  }
11224
11224
  var GN = {};
11225
- Te(GN, { addDrawEntries: () => JI, addEventEntries: () => en, addEventEntryPairs: () => zN, destroyPairEntries: () => qb, destroyPairEntry: () => ry, getEntriesAndSeedsCount: () => rf, getMaxEntryPosition: () => yU, modifyEntriesStatus: () => Qd, modifyEventEntries: () => YN, mutate: () => $N, promoteAlternate: () => qN, promoteAlternates: () => xU, query: () => CN, removeDrawEntries: () => HN, removeEventEntries: () => Al, setEntryPosition: () => kU, setEntryPositions: () => WN });
11225
+ Te(GN, { addDrawEntries: () => JI, addEventEntries: () => en, addEventEntryPairs: () => zN, destroyPairEntries: () => qb, destroyPairEntry: () => ry, getEntriesAndSeedsCount: () => rf, getMaxEntryPosition: () => yU, modifyEntriesStatus: () => Qd, modifyEventEntries: () => YN, mutate: () => $N, promoteAlternate: () => qN, promoteAlternates: () => xU, query: () => CN, removeDrawEntries: () => HN, removeEventEntries: () => Cl, setEntryPosition: () => kU, setEntryPositions: () => WN });
11226
11226
  var $N = {};
11227
- Te($N, { addDrawEntries: () => JI, addEventEntries: () => en, addEventEntryPairs: () => zN, destroyPairEntries: () => qb, destroyPairEntry: () => ry, modifyEntriesStatus: () => Qd, modifyEventEntries: () => YN, promoteAlternate: () => qN, promoteAlternates: () => xU, removeDrawEntries: () => HN, removeEventEntries: () => Al, setEntryPosition: () => kU, setEntryPositions: () => WN });
11227
+ Te($N, { addDrawEntries: () => JI, addEventEntries: () => en, addEventEntryPairs: () => zN, destroyPairEntries: () => qb, destroyPairEntry: () => ry, modifyEntriesStatus: () => Qd, modifyEventEntries: () => YN, promoteAlternate: () => qN, promoteAlternates: () => xU, removeDrawEntries: () => HN, removeEventEntries: () => Cl, setEntryPosition: () => kU, setEntryPositions: () => WN });
11228
11228
  function kU({ tournamentRecord: e, drawDefinition: t, participantId: r, entryPosition: i, skipRefresh: n, event: a }) {
11229
11229
  let s = "setEntryPositions";
11230
11230
  if (!e) return { error: J };
@@ -11313,7 +11313,7 @@ function ln(e) {
11313
11313
  let { participantId: c, individualParticipantIds: u } = s;
11314
11314
  if (o.participants.reduce((h, g) => g.participantId === c || h, !1)) return { error: CD };
11315
11315
  let { participantType: l, participantRole: d } = s;
11316
- if (!l || !Object.keys(ru).includes(l)) return { error: qi, participantType: l };
11316
+ if (!l || !Object.keys(iu).includes(l)) return { error: qi, participantType: l };
11317
11317
  if (!d) return { error: ED };
11318
11318
  let p = o.participants || [], m = p.filter((h) => h.participantType === be).map((h) => h.participantId);
11319
11319
  if (l !== be && s.person) return { error: z, person: s.person };
@@ -11419,7 +11419,7 @@ function YN({ entryStatus: e = Lr, unpairedParticipantIds: t = [], participantId
11419
11419
  return a.entries = (a.entries ?? []).filter((h) => h.entryStage === i), a.entries = a.entries.concat(...m, ...f), { ...x };
11420
11420
  }
11421
11421
  var KN = {};
11422
- Te(KN, { addDrawDefinition: () => Zl, addEvent: () => _c, addFlight: () => df, assignSeedPositions: () => cE, attachFlightProfile: () => GU, categoryCanContain: () => rl, deleteDrawDefinitions: () => cf, deleteEvents: () => lE, deleteFlightAndFlightDraw: () => sE, deleteFlightProfileAndFlightDraws: () => tE, generate: () => XN, generateEventsFromTieFormat: () => JN, getCategoryAgeDetails: () => Ls, getEvent: () => OU, getEventProperties: () => AU, getEventStructures: () => Tm, getEventTimeItem: () => ml, getEvents: () => CU, getFlightProfile: () => wt, getScaledEntries: () => vo, modifyEvent: () => dE, modifyEventMatchUpFormatTiming: () => rE, modifyPairAssignment: () => oE, mutate: () => ZN, query: () => _N, refreshEventDrawOrder: () => jU, removeEventMatchUpFormatTiming: () => uf, removeScaleValues: () => $U, removeSeeding: () => uE, setEventDates: () => BU, setEventDisplay: () => lf, setEventEndDate: () => _U, setEventStartDate: () => LU, updateDrawIdsOrder: () => VU, validateCategory: () => Su });
11422
+ Te(KN, { addDrawDefinition: () => ed, addEvent: () => _c, addFlight: () => df, assignSeedPositions: () => cE, attachFlightProfile: () => GU, categoryCanContain: () => il, deleteDrawDefinitions: () => cf, deleteEvents: () => lE, deleteFlightAndFlightDraw: () => sE, deleteFlightProfileAndFlightDraws: () => tE, generate: () => XN, generateEventsFromTieFormat: () => JN, getCategoryAgeDetails: () => Ls, getEvent: () => OU, getEventProperties: () => AU, getEventStructures: () => Tm, getEventTimeItem: () => fl, getEvents: () => CU, getFlightProfile: () => wt, getScaledEntries: () => vo, modifyEvent: () => dE, modifyEventMatchUpFormatTiming: () => rE, modifyPairAssignment: () => oE, mutate: () => ZN, query: () => _N, refreshEventDrawOrder: () => jU, removeEventMatchUpFormatTiming: () => uf, removeScaleValues: () => $U, removeSeeding: () => uE, setEventDates: () => BU, setEventDisplay: () => lf, setEventEndDate: () => _U, setEventStartDate: () => LU, updateDrawIdsOrder: () => VU, validateCategory: () => vu });
11423
11423
  var XN = {};
11424
11424
  Te(XN, { generateEventsFromTieFormat: () => JN });
11425
11425
  function BV({ tournamentId: e, event: t }) {
@@ -11455,7 +11455,7 @@ function _c({ suppressNotifications: e, tournamentRecord: t, internalUse: r, eve
11455
11455
  Ua({ tournamentId: t?.tournamentId, eventId: i.eventId, matchUps: d });
11456
11456
  }
11457
11457
  let { drawDefinitions: u, ...l } = i;
11458
- for (let d of u || []) dl({ drawDefinition: d });
11458
+ for (let d of u || []) pl({ drawDefinition: d });
11459
11459
  BV({ tournamentId: t?.tournamentId, event: l });
11460
11460
  }
11461
11461
  return { ...x, event: s };
@@ -11493,7 +11493,7 @@ function JN(e) {
11493
11493
  return { ...x, events: a };
11494
11494
  }
11495
11495
  var ZN = {};
11496
- Te(ZN, { addDrawDefinition: () => Zl, addEvent: () => _c, addFlight: () => df, assignSeedPositions: () => cE, attachFlightProfile: () => GU, deleteDrawDefinitions: () => cf, deleteEvents: () => lE, deleteFlightAndFlightDraw: () => sE, deleteFlightProfileAndFlightDraws: () => tE, modifyEvent: () => dE, modifyEventMatchUpFormatTiming: () => rE, modifyPairAssignment: () => oE, refreshEventDrawOrder: () => jU, removeEventMatchUpFormatTiming: () => uf, removeScaleValues: () => $U, removeSeeding: () => uE, setEventDates: () => BU, setEventDisplay: () => lf, setEventEndDate: () => _U, setEventStartDate: () => LU, updateDrawIdsOrder: () => VU, validateCategory: () => Su });
11496
+ Te(ZN, { addDrawDefinition: () => ed, addEvent: () => _c, addFlight: () => df, assignSeedPositions: () => cE, attachFlightProfile: () => GU, deleteDrawDefinitions: () => cf, deleteEvents: () => lE, deleteFlightAndFlightDraw: () => sE, deleteFlightProfileAndFlightDraws: () => tE, modifyEvent: () => dE, modifyEventMatchUpFormatTiming: () => rE, modifyPairAssignment: () => oE, refreshEventDrawOrder: () => jU, removeEventMatchUpFormatTiming: () => uf, removeScaleValues: () => $U, removeSeeding: () => uE, setEventDates: () => BU, setEventDisplay: () => lf, setEventEndDate: () => _U, setEventStartDate: () => LU, updateDrawIdsOrder: () => VU, validateCategory: () => vu });
11497
11497
  function Bc({ removePriorValues: e = !0, status: t = ni, statusObject: r, event: i }) {
11498
11498
  if (!Ce(r)) return { error: z };
11499
11499
  let n = Ui({ event: i, status: t }), a = `${Aa}.${Ca}`, s = { itemValue: { [t]: { ...n, ...r } }, itemType: a };
@@ -11548,16 +11548,16 @@ function cf(e) {
11548
11548
  if (b.some(({ score: L }) => Lt({ score: L })) && !y) return w.push(T.drawId), !0;
11549
11549
  let { drawId: P, drawType: M, drawName: R } = T, E = g?.flights?.find((L) => L.drawId === T.drawId);
11550
11550
  E && (E.drawEntries = E.drawEntries?.filter((L) => Fi.includes(L.entryStatus))), D.includes(P) && (D = D.filter((L) => L !== P), v = !0);
11551
- let A = Ci({ stageSequence: 1, drawDefinition: T, stage: re })?.structures?.[0], N = (A ? xu({ structureId: A.structureId, tournamentRecord: a, drawDefinition: T }) : void 0)?.positionAssignments?.map(I), C = Ci({ stage: oe, drawDefinition: T })?.structures, k = C?.length ? C.map((L) => {
11551
+ let A = Ci({ stageSequence: 1, drawDefinition: T, stage: re })?.structures?.[0], N = (A ? Fu({ structureId: A.structureId, tournamentRecord: a, drawDefinition: T }) : void 0)?.positionAssignments?.map(I), C = Ci({ stage: oe, drawDefinition: T })?.structures, k = C?.length ? C.map((L) => {
11552
11552
  let _ = L.stageSequence;
11553
- return { positionAssignments: xu({ structureId: L.structureId, tournamentRecord: a, drawDefinition: T })?.positionAssignments.map(I), stageSequence: _ };
11553
+ return { positionAssignments: Fu({ structureId: L.structureId, tournamentRecord: a, drawDefinition: T })?.positionAssignments.map(I), stageSequence: _ };
11554
11554
  }) : void 0, O = { action: eE, payload: { drawDefinitions: [T], eventId: o ?? i?.eventId, auditData: s } };
11555
11555
  f.push(O), p.push(ae({ tournamentId: a.tournamentId, eventId: o ?? i?.eventId, qualifyingPositionAssignments: k, positionAssignments: N, auditData: s, drawType: M, drawName: R, drawId: P })), b?.forEach(({ matchUpId: L }) => m.push(L));
11556
11556
  }
11557
11557
  return !r.includes(T.drawId);
11558
11558
  });
11559
- if (w.length && !c) return F({ context: { drawIdsWithScoresPresent: w }, result: { error: Ju }, stack: t });
11560
- if (i.drawDefinitions = S, g && Ra({ event: i, extension: { name: Ai, value: g } }), Kl({ tournamentRecord: a }), v) {
11559
+ if (w.length && !c) return F({ context: { drawIdsWithScoresPresent: w }, result: { error: Zu }, stack: t });
11560
+ if (i.drawDefinitions = S, g && Ra({ event: i, extension: { name: Ai, value: g } }), Xl({ tournamentRecord: a }), v) {
11561
11561
  let T = {};
11562
11562
  for (let P of D) T[P] = U.drawDetails?.[P] ?? { published: !0 };
11563
11563
  let b = Bc({ statusObject: { drawDetails: T }, event: i });
@@ -11777,7 +11777,7 @@ function oE(e) {
11777
11777
  }
11778
11778
  return { ...x, participantOtherEntries: h, newPairParticipantId: m };
11779
11779
  }
11780
- function Zl(e) {
11780
+ function ed(e) {
11781
11781
  let { flight: t, suppressNotifications: r, modifyEventEntries: i, existingDrawCount: n, allowReplacement: a, checkEntryStatus: s, tournamentRecord: o, drawDefinition: c, event: u } = e;
11782
11782
  if (!c) return { error: ne };
11783
11783
  if (!u) return { error: it };
@@ -11819,7 +11819,7 @@ function Zl(e) {
11819
11819
  }
11820
11820
  } else if (u.drawDefinitions.push(c), !r) {
11821
11821
  let { matchUps: R } = Ur({ drawDefinition: c, event: u });
11822
- R && Ua({ tournamentId: o?.tournamentId, matchUps: R }), dl({ drawDefinition: c, tournamentId: P, eventId: M });
11822
+ R && Ua({ tournamentId: o?.tournamentId, matchUps: R }), pl({ drawDefinition: c, tournamentId: P, eventId: M });
11823
11823
  }
11824
11824
  return { ...x, modifiedEventEntryStatusCount: f };
11825
11825
  }
@@ -11911,10 +11911,10 @@ function lE(e) {
11911
11911
  let u = c.filter((l) => !o.includes(l));
11912
11912
  i.participants = i.participants.filter(({ participantId: l }) => !u.includes(l));
11913
11913
  }
11914
- if (Kl({ tournamentRecord: i }), a.length) if (_p($n)) {
11914
+ if (Xl({ tournamentRecord: i }), a.length) if (_p($n)) {
11915
11915
  let u = i.tournamentId;
11916
11916
  Ue({ topic: $n, payload: { type: Nd, tournamentId: u, detail: a } });
11917
- } else Gl({ tournamentRecord: i, timeItem: { itemValue: s, itemType: Nd } });
11917
+ } else $l({ tournamentRecord: i, timeItem: { itemValue: s, itemType: Nd } });
11918
11918
  return { ...x };
11919
11919
  }
11920
11920
  function dE(e) {
@@ -11932,11 +11932,11 @@ function dE(e) {
11932
11932
  function zV(e) {
11933
11933
  let t = e.eventUpdates?.category;
11934
11934
  if (!t) return { ...x };
11935
- let r = Su({ category: t });
11935
+ let r = vu({ category: t });
11936
11936
  if (r.error) return r;
11937
11937
  if (e.event.eventType === Ct) {
11938
11938
  let i = e.event?.drawDefinitions?.map((s) => Ki(s)) ?? [], n = Ki(e.event), a = (_n(e)?.matchUps ?? []).map((s) => Ki(s)) ?? [];
11939
- if (![n, ...i, ...a].filter(Boolean).every((s) => s.collectionDefinitions.every((o) => !o.category || rl({ category: e.eventUpdates.category, childCategory: o.category })))) return F({ result: { error: fu }, stack: e.stack });
11939
+ if (![n, ...i, ...a].filter(Boolean).every((s) => s.collectionDefinitions.every((o) => !o.category || il({ category: e.eventUpdates.category, childCategory: o.category })))) return F({ result: { error: hu }, stack: e.stack });
11940
11940
  }
11941
11941
  if (e.enteredParticipants?.length) {
11942
11942
  let i = e.eventUpdates.startDate || e.event.startDate || e.tournamentRecord.startDate, n = e.eventUpdates.endDate || e.event.endDate || e.tournamentRecord.endDate, a = e.enteredParticipants.map((c) => c.participantType === be ? c : c.individualParticpants ?? []).flat(), s = Ls({ category: t, consideredDate: i }), o = Ls({ category: t, consideredDate: n });
@@ -11980,7 +11980,7 @@ function XV({ enteredParticipants: e }) {
11980
11980
  }
11981
11981
  function QV({ noFlightsNoDraws: e, enteredParticipantGenders: t, eventUpdates: r, stack: i }) {
11982
11982
  let n = !t.length || !r.gender || yn(r.gender) || t.length === 1 && t[0] === r.gender || e && Qr(r.gender);
11983
- return r.gender && !n ? F({ context: { gender: r.gender, validGender: n }, result: { error: eu }, stack: i }) : { ...x };
11983
+ return r.gender && !n ? F({ context: { gender: r.gender, validGender: n }, result: { error: tu }, stack: i }) : { ...x };
11984
11984
  }
11985
11985
  function JV({ enteredParticipantTypes: e, eventUpdates: t, stack: r }) {
11986
11986
  let i = (e.includes(Ct) && [Ct] || e.includes(be) && [an] || e.includes(we) && [di] || [di, an, Ct]).includes(t.eventType ?? "");
@@ -12000,7 +12000,7 @@ function df({ qualifyingPositions: e, drawEntries: t = [], drawName: r, drawId:
12000
12000
  return Ra({ event: n, extension: p });
12001
12001
  }
12002
12002
  var pE = {};
12003
- Te(pE, { drawMatic: () => rU, garman: () => yE, generateAdHocMatchUps: () => Fm, generateAdHocRounds: () => tU, generateAndPopulatePlayoffStructures: () => Ey, generateCourts: () => WU, generateDrawDefinition: () => Jl, generateDrawMaticRound: () => qy, generateDrawStructuresAndLinks: () => Gy, generateDrawTypeAndModifyDrawDefinition: () => $y, generateFlightProfile: () => t2, generateLineUps: () => IE, generateQualifyingStructure: () => wy, generateSeedingScaleItems: () => jN, generateStatCrew: () => r2, generateVoluntaryConsolation: () => TR, roundRobinGroups: () => pF });
12003
+ Te(pE, { drawMatic: () => rU, garman: () => yE, generateAdHocMatchUps: () => Fm, generateAdHocRounds: () => tU, generateAndPopulatePlayoffStructures: () => Ey, generateCourts: () => WU, generateDrawDefinition: () => Zl, generateDrawMaticRound: () => qy, generateDrawStructuresAndLinks: () => Gy, generateDrawTypeAndModifyDrawDefinition: () => $y, generateFlightProfile: () => t2, generateLineUps: () => IE, generateQualifyingStructure: () => wy, generateSeedingScaleItems: () => jN, generateStatCrew: () => r2, generateVoluntaryConsolation: () => TR, roundRobinGroups: () => pF });
12004
12004
  var ZV = "splitLevelBased", mE = "splitWaterfall", fE = "splitShuttle", e2 = { SPLIT_LEVEL_BASED: ZV, SPLIT_WATERFALL: mE, SPLIT_SHUTTLE: fE };
12005
12005
  function t2(e) {
12006
12006
  let { drawNameRoot: t = "Flight", attachFlightProfile: r, tournamentRecord: i, scaleAttributes: n, scaleSortMethod: a, deleteExisting: s, sortDescending: o, drawNames: c = [], flightsCount: u, splitMethod: l, uuids: d = [], event: p, stage: m } = e;
@@ -12172,7 +12172,7 @@ function WU(e) {
12172
12172
  }
12173
12173
  var yE = {};
12174
12174
  Te(yE, { default: () => l2, garman: () => vE });
12175
- function ed({ court: e, date: t }) {
12175
+ function td({ court: e, date: t }) {
12176
12176
  let r = t && e.dateAvailability.find((n) => Pn(n.date, t)), i = e.dateAvailability.find((n) => !n.date);
12177
12177
  return r || i;
12178
12178
  }
@@ -12194,7 +12194,7 @@ function c2({ averageMatchUpMinutes: e, includeBookingTypes: t, periodStartTime:
12194
12194
  };
12195
12195
  function a(s) {
12196
12196
  let o = Mt(s.startTime), c = Mt(s.endTime);
12197
- return o > r || c < i ? !1 : tl(r, c) >= e;
12197
+ return o > r || c < i ? !1 : rl(r, c) >= e;
12198
12198
  }
12199
12199
  return { enoughTime: n };
12200
12200
  }
@@ -12204,7 +12204,7 @@ function UE(e) {
12204
12204
  let { averageMatchUpMinutes: r, includeBookingTypes: i, periodStart: n, date: a } = e, s = e.courts, o = Mt(n), c = Kg(o, r), { enoughTime: u } = c2({ averageMatchUpMinutes: r, includeBookingTypes: i, periodStartTime: o, periodEndTime: c });
12205
12205
  return { availableToScheduleCount: (s?.filter((l) => {
12206
12206
  if (!Array.isArray(l.dateAvailability)) return !1;
12207
- let d = ed({ date: a, court: l });
12207
+ let d = td({ date: a, court: l });
12208
12208
  return !!(d && u(d));
12209
12209
  }) || []).length, ...x };
12210
12210
  }
@@ -12218,7 +12218,7 @@ function pf(e) {
12218
12218
  let { courtId: f } = m;
12219
12219
  return f ? p.courtBookings[f] ? p.courtBookings[f].push(m) : p.courtBookings[f] = [m] : p.unassignedBookings.push(m), p;
12220
12220
  }, { courtBookings: {}, unassignedBookings: [] }), u = a.map((p, m) => {
12221
- let { courtId: f, courtName: h } = p, g = o[f] || [], I = ed({ date: n, court: p }) || {}, { bookings: y = [], startTime: U, endTime: D, date: v } = I, w = [t[m] && { startTime: U, endTime: t[m] }, ...ie(y, !1, !0), ...g].filter(Boolean);
12221
+ let { courtId: f, courtName: h } = p, g = o[f] || [], I = td({ date: n, court: p }) || {}, { bookings: y = [], startTime: U, endTime: D, date: v } = I, w = [t[m] && { startTime: U, endTime: t[m] }, ...ie(y, !1, !0), ...g].filter(Boolean);
12222
12222
  return { courtId: f, courtName: h, dateAvailability: { bookings: w, startTime: U, endTime: D, date: v } };
12223
12223
  });
12224
12224
  c.sort((p, m) => ke(p.startTime) - ke(m.startTime));
@@ -12253,7 +12253,7 @@ function SE(e) {
12253
12253
  function cc({ scheduleDate: e, startTime: t, endTime: r, courts: i }) {
12254
12254
  let n = t && "startTime" || r && "endTime" || void 0;
12255
12255
  return i.reduce((a, s) => {
12256
- let o = ed({ date: e, court: s }), c = n && (o?.[n] || s[n]);
12256
+ let o = td({ date: e, court: s }), c = n && (o?.[n] || s[n]);
12257
12257
  return c && (!a || t && ke(c) < ke(a) || r && ke(c) > ke(a)) ? c : a;
12258
12258
  }, void 0);
12259
12259
  }
@@ -12264,11 +12264,11 @@ function u2({ averageMinutes: e, startTime: t, endTime: r, courts: i, date: n })
12264
12264
  let s = Mt(t), o = Mt(r);
12265
12265
  for (let c of i || []) {
12266
12266
  if (!Array.isArray(c.dateAvailability)) continue;
12267
- let u = ed({ court: c, date: n }), { timeSlots: l } = jc({ courtDate: u });
12267
+ let u = td({ court: c, date: n }), { timeSlots: l } = jc({ courtDate: u });
12268
12268
  l?.forEach((d) => {
12269
12269
  let p = Mt(d.startTime), m = Mt(d.endTime);
12270
12270
  if (p > o || p < s || m < s) return !1;
12271
- if (tl(p, m) >= e) {
12271
+ if (rl(p, m) >= e) {
12272
12272
  let f = nt(p.toISOString());
12273
12273
  (!a || f < a) && (a = f);
12274
12274
  }
@@ -12304,9 +12304,9 @@ function qU(e) {
12304
12304
  var vE = { getCourtsAvailableAtPeriodStart: UE, generateTimeSlots: jc, getScheduleTimes: qU, courtGenerator: SE }, l2 = vE, up = {};
12305
12305
  Te(up, { isValid: () => qr, isValidMatchUpFormat: () => qr, parse: () => Dr, stringify: () => Gp });
12306
12306
  var wE = {};
12307
- Te(wE, { allCompetitionMatchUps: () => Hi, allDrawMatchUps: () => Ur, allEventMatchUps: () => _n, allTournamentMatchUps: () => Qt, analyzeMatchUp: () => Bu, applyLineUps: () => qE, assignMatchUpSideParticipant: () => TE, assignTieMatchUpParticipantId: () => lp, bulkMatchUpStatusUpdate: () => jE, calculateWinCriteria: () => Do, checkInParticipant: () => zU, checkMatchUpIsComplete: () => Ga, checkOutParticipant: () => HU, competitionScheduleMatchUps: () => Ql, disableTieAutoCalc: () => _E, drawMatchUps: () => NU, enableTieAutoCalc: () => xE, eventMatchUps: () => af, filterMatchUps: () => jn, findMatchUp: () => fU, getAllDrawMatchUps: () => Rt, getAllStructureMatchUps: () => _e, getCheckedInParticipantIds: () => lo, getCompetitionMatchUps: () => _u, getEventMatchUpFormatTiming: () => SU, getHomeParticipantId: () => TU, getMatchUpCompetitiveProfile: () => wl, getMatchUpContextIds: () => PU, getMatchUpDailyLimits: () => of, getMatchUpDailyLimitsUpdate: () => vU, getMatchUpDependencies: () => Li, getMatchUpFormat: () => bU, getMatchUpFormatTiming: () => Dl, getMatchUpFormatTimingUpdate: () => UU, getMatchUpScheduleDetails: () => Im, getMatchUpType: () => ym, getMatchUpsStats: () => MU, getModifiedMatchUpFormatTiming: () => nf, getParticipantResults: () => Bl, getPredictiveAccuracy: () => DU, getRoundMatchUps: () => vr, getRounds: () => RU, isValidMatchUpFormat: () => qr, matchUpActions: () => km, mutate: () => DE, participantScheduledMatchUps: () => wU, query: () => ON, removeDelegatedOutcome: () => FE, removeMatchUpSideParticipant: () => XU, removeTieMatchUpParticipantId: () => bE, replaceTieMatchUpParticipantId: () => KU, resetAdHocMatchUps: () => $E, resetMatchUpLineUps: () => iS, resetScorecard: () => aS, resetTieFormat: () => nS, setDelegatedOutcome: () => GE, setMatchUpFormat: () => BE, setMatchUpStatus: () => td, setOrderOfFinish: () => WE, substituteParticipant: () => LE, tallyParticipantResults: () => xc, toggleParticipantCheckInState: () => ff, tournamentMatchUps: () => sf, updateTieMatchUpScore: () => aa, validMatchUp: () => pm, validMatchUps: () => yi });
12307
+ Te(wE, { allCompetitionMatchUps: () => Hi, allDrawMatchUps: () => Ur, allEventMatchUps: () => _n, allTournamentMatchUps: () => Qt, analyzeMatchUp: () => Vu, applyLineUps: () => qE, assignMatchUpSideParticipant: () => TE, assignTieMatchUpParticipantId: () => lp, bulkMatchUpStatusUpdate: () => jE, calculateWinCriteria: () => Do, checkInParticipant: () => zU, checkMatchUpIsComplete: () => Ga, checkOutParticipant: () => HU, competitionScheduleMatchUps: () => Jl, disableTieAutoCalc: () => _E, drawMatchUps: () => NU, enableTieAutoCalc: () => xE, eventMatchUps: () => af, filterMatchUps: () => jn, findMatchUp: () => fU, getAllDrawMatchUps: () => Rt, getAllStructureMatchUps: () => _e, getCheckedInParticipantIds: () => lo, getCompetitionMatchUps: () => Bu, getEventMatchUpFormatTiming: () => SU, getHomeParticipantId: () => TU, getMatchUpCompetitiveProfile: () => Dl, getMatchUpContextIds: () => PU, getMatchUpDailyLimits: () => of, getMatchUpDailyLimitsUpdate: () => vU, getMatchUpDependencies: () => Li, getMatchUpFormat: () => bU, getMatchUpFormatTiming: () => Tl, getMatchUpFormatTimingUpdate: () => UU, getMatchUpScheduleDetails: () => Im, getMatchUpType: () => ym, getMatchUpsStats: () => MU, getModifiedMatchUpFormatTiming: () => nf, getParticipantResults: () => Vl, getPredictiveAccuracy: () => DU, getRoundMatchUps: () => vr, getRounds: () => RU, isValidMatchUpFormat: () => qr, matchUpActions: () => km, mutate: () => DE, participantScheduledMatchUps: () => wU, query: () => ON, removeDelegatedOutcome: () => FE, removeMatchUpSideParticipant: () => XU, removeTieMatchUpParticipantId: () => bE, replaceTieMatchUpParticipantId: () => KU, resetAdHocMatchUps: () => $E, resetMatchUpLineUps: () => iS, resetScorecard: () => aS, resetTieFormat: () => nS, setDelegatedOutcome: () => GE, setMatchUpFormat: () => BE, setMatchUpStatus: () => rd, setOrderOfFinish: () => WE, substituteParticipant: () => LE, tallyParticipantResults: () => xc, toggleParticipantCheckInState: () => ff, tournamentMatchUps: () => sf, updateTieMatchUpScore: () => aa, validMatchUp: () => pm, validMatchUps: () => yi });
12308
12308
  var DE = {};
12309
- Te(DE, { applyLineUps: () => qE, assignMatchUpSideParticipant: () => TE, assignTieMatchUpParticipantId: () => lp, bulkMatchUpStatusUpdate: () => jE, checkInParticipant: () => zU, checkOutParticipant: () => HU, disableTieAutoCalc: () => _E, enableTieAutoCalc: () => xE, findMatchUp: () => fU, removeDelegatedOutcome: () => FE, removeMatchUpSideParticipant: () => XU, removeTieMatchUpParticipantId: () => bE, replaceTieMatchUpParticipantId: () => KU, resetAdHocMatchUps: () => $E, resetMatchUpLineUps: () => iS, resetScorecard: () => aS, resetTieFormat: () => nS, setDelegatedOutcome: () => GE, setMatchUpFormat: () => BE, setMatchUpStatus: () => td, setOrderOfFinish: () => WE, substituteParticipant: () => LE, toggleParticipantCheckInState: () => ff, updateTieMatchUpScore: () => aa });
12309
+ Te(DE, { applyLineUps: () => qE, assignMatchUpSideParticipant: () => TE, assignTieMatchUpParticipantId: () => lp, bulkMatchUpStatusUpdate: () => jE, checkInParticipant: () => zU, checkOutParticipant: () => HU, disableTieAutoCalc: () => _E, enableTieAutoCalc: () => xE, findMatchUp: () => fU, removeDelegatedOutcome: () => FE, removeMatchUpSideParticipant: () => XU, removeTieMatchUpParticipantId: () => bE, replaceTieMatchUpParticipantId: () => KU, resetAdHocMatchUps: () => $E, resetMatchUpLineUps: () => iS, resetScorecard: () => aS, resetTieFormat: () => nS, setDelegatedOutcome: () => GE, setMatchUpFormat: () => BE, setMatchUpStatus: () => rd, setOrderOfFinish: () => WE, substituteParticipant: () => LE, toggleParticipantCheckInState: () => ff, updateTieMatchUpScore: () => aa });
12310
12310
  function TE({ tournamentRecord: e, drawDefinition: t, participantId: r, sideNumber: i, matchUpId: n, event: a }) {
12311
12311
  if (r && typeof r != "string") return { error: Wi };
12312
12312
  if (!t) return { error: ne };
@@ -12400,7 +12400,7 @@ function KU(e) {
12400
12400
  let { appliedPolicies: U } = xe({ tournamentRecord: n, drawDefinition: s, event: c }), D = e.policyDefinitions?.[Yt] ?? U?.[Yt] ?? Ac[Yt], v = y.find(({ participantId: O }) => O === a);
12401
12401
  if ((e.enforceGender ?? D?.participants?.enforceGender) !== !1 && rn(l?.gender) && ur(l?.gender) !== ur(v?.person?.sex)) return { error: Xs, info: "Gender mismatch" };
12402
12402
  let w = D?.processCodes?.substitution;
12403
- jl({ tournamentId: n.tournamentId, eventId: c.eventId, inContextDualMatchUp: u, drawDefinition: s, dualMatchUp: m });
12403
+ Gl({ tournamentId: n.tournamentId, eventId: c.eventId, inContextDualMatchUp: u, drawDefinition: s, dualMatchUp: m });
12404
12404
  let S = m?.sides?.find(({ sideNumber: O }) => O === I.sideNumber);
12405
12405
  if (!S) return F({ result: { sideNumber: I.sideNumber, existingParticipantId: i, error: Kt }, stack: r });
12406
12406
  if (l?.sides?.flatMap((O) => O.participant?.individualParticipantIds || O.participant?.participantId || [])?.includes(a)) return F({ result: { error: Cp }, stack: r });
@@ -12505,10 +12505,10 @@ function gf(e) {
12505
12505
  let { participants: y } = pt({ participantFilters: { participantTypes: [be] }, tournamentRecord: n }), U = y?.map(Pe);
12506
12506
  if (U) {
12507
12507
  let D = u.filter((v) => ct(v) && U.includes(v));
12508
- ([ii, rt].includes(m || o.participantType) || m === we && (D.length === 2 || a)) && (I.individualParticipantIds = D), o.participantType === ru.PAIR && t && (I.participantName = p2({ individualParticipants: y, newValues: I }));
12508
+ ([ii, rt].includes(m || o.participantType) || m === we && (D.length === 2 || a)) && (I.individualParticipantIds = D), o.participantType === iu.PAIR && t && (I.participantName = p2({ individualParticipants: y, newValues: I }));
12509
12509
  }
12510
12510
  }
12511
- return Object.keys(ey).includes(p) && (I.participantRole = p), Object.keys(ru).includes(m) && (I.participantType = m), Array.isArray(c) && (I.participantRoleResponsibilties = c), o.participantType === ru.INDIVIDUAL && g && m2({ updateParticipantName: t, existingParticipant: o, newValues: I, person: g }), Object.assign(o, ae(I)), r && hf({ individualParticipantIds: [o.participantId], groupingParticipantId: r, removeFromOtherTeams: i, tournamentRecord: n }), Ue({ topic: or, payload: { tournamentId: n.tournamentId, participants: [o] } }), { participant: ie(o), ...x };
12511
+ return Object.keys(ey).includes(p) && (I.participantRole = p), Object.keys(iu).includes(m) && (I.participantType = m), Array.isArray(c) && (I.participantRoleResponsibilties = c), o.participantType === iu.INDIVIDUAL && g && m2({ updateParticipantName: t, existingParticipant: o, newValues: I, person: g }), Object.assign(o, ae(I)), r && hf({ individualParticipantIds: [o.participantId], groupingParticipantId: r, removeFromOtherTeams: i, tournamentRecord: n }), Ue({ topic: or, payload: { tournamentId: n.tournamentId, participants: [o] } }), { participant: ie(o), ...x };
12512
12512
  }
12513
12513
  function p2({ individualParticipants: e, newValues: t }) {
12514
12514
  let r = t.individualParticipantIds, i = e.filter(({ participantId: n }) => r.includes(n)).map(({ person: n }) => n?.standardFamilyName).filter(Boolean).sort().join("/");
@@ -12548,7 +12548,7 @@ function lp(e) {
12548
12548
  let T = l?.find((_) => _.participantId === S?.participantId)?.drawPosition, b = h?.sides?.find((_) => _.participantId === i)?.sideNumber, P = u?.sides?.find((_) => T && _.drawPosition === T)?.sideNumber, M = b ?? P ?? e.sideNumber;
12549
12549
  if (!g) return { error: gc };
12550
12550
  if (!g.collectionDefinitions?.find((_) => _.collectionId === m)) return { error: UD };
12551
- jl({ tournamentId: n.tournamentId, eventId: o.eventId, inContextDualMatchUp: c, drawDefinition: a, dualMatchUp: h });
12551
+ Gl({ tournamentId: n.tournamentId, eventId: o.eventId, inContextDualMatchUp: c, drawDefinition: a, dualMatchUp: h });
12552
12552
  let R = h?.sides?.find((_) => _.sideNumber === M), E = u?.sides?.find((_) => _.sideNumber === M), A = (R?.lineUp ?? Qa({ participantId: i, drawDefinition: a })?.lineUp)?.filter((_) => _.collectionAssignments?.find((B) => B.collectionPosition === d && B.collectionId === m && !B.previousParticipantId))?.map((_) => _?.participantId), N = A?.length > 1 && A || (v === we ? I.individualParticipantIds : [s]), C = PE({ collectionPosition: d, teamParticipantId: i, dualMatchUpSide: R, drawDefinition: a, participantIds: N, collectionId: m });
12553
12553
  if (C.error) return F({ result: C, stack: r });
12554
12554
  let { modifiedLineUp: k } = C, O;
@@ -12615,7 +12615,7 @@ function bE(e) {
12615
12615
  if (!w) return F({ result: { error: Dt }, stack: a });
12616
12616
  if (h === ze && w.participantType === we) return F({ result: { error: Xs }, stack: a });
12617
12617
  let S = w.participantType === be ? [i] : w.individualParticipantIds;
12618
- jl({ tournamentId: t.tournamentId, eventId: n.eventId, inContextDualMatchUp: u, drawDefinition: r, dualMatchUp: g });
12618
+ Gl({ tournamentId: t.tournamentId, eventId: n.eventId, inContextDualMatchUp: u, drawDefinition: r, dualMatchUp: g });
12619
12619
  let T = g.sides?.find(({ sideNumber: M }) => M === U.sideNumber);
12620
12620
  if (!T && (g.sides?.filter(({ lineUp: M }) => !M).length || 0) < 2) {
12621
12621
  let M = m?.map(({ participantId: R }) => ({ drawPosition: d?.find((E) => E.participantId === R)?.drawPosition, teamParticipantId: R }));
@@ -12689,7 +12689,7 @@ function I2({ inContextDrawMatchUps: e, positionAssignments: t, sourceMatchUpSta
12689
12689
  }
12690
12690
  function Gc(e) {
12691
12691
  let { dualWinningSideChange: t, inContextDrawMatchUps: r, tournamentRecord: i, drawDefinition: n, matchUpStatus: a, matchUpsMap: s, dualMatchUp: o, targetData: c, matchUpId: u, structure: l, event: d } = e, p = !!e.matchUp.collectionId, m = Rr({ structure: l }), { drawPositions: f, winningSide: h } = c.matchUp || {};
12692
- if (!m && !f) return { error: zu };
12692
+ if (!m && !f) return { error: Yu };
12693
12693
  let { targetLinks: { loserTargetLink: g, winnerTargetLink: I, byeTargetLink: y }, targetMatchUps: { loserMatchUp: U, winnerMatchUp: D, byeMatchUp: v } } = c, w = tn({ ...e, matchUpStatus: a || vt, removeWinningSide: !0 });
12694
12694
  if (w.error) return w;
12695
12695
  let S;
@@ -12753,7 +12753,7 @@ function y2({ sourceMatchUpStatus: e, loserParticipantId: t, tournamentRecord: r
12753
12753
  function eg({ inContextDrawMatchUps: e, tournamentRecord: t, drawDefinition: r, drawPosition: i, matchUpsMap: n, targetLink: a, event: s }) {
12754
12754
  let o = a.target.structureId, c = "removeDirectedBye";
12755
12755
  $r({ color: "brightyellow", method: c, drawPosition: i });
12756
- let u = Rl({ inContextDrawMatchUps: e, tournamentRecord: t, drawDefinition: r, drawPosition: i, matchUpsMap: n, structureId: o, event: s });
12756
+ let u = Nl({ inContextDrawMatchUps: e, tournamentRecord: t, drawDefinition: r, drawPosition: i, matchUpsMap: n, structureId: o, event: s });
12757
12757
  return F({ result: u, stack: c });
12758
12758
  }
12759
12759
  function U2(e) {
@@ -12766,7 +12766,7 @@ function S2({ tournamentRecord: e, drawDefinition: t, structure: r, matchUp: i }
12766
12766
  let { positionAssignments: a } = Ft({ structure: r }), s = a?.filter((o) => o.bye).map((o) => o.drawPosition);
12767
12767
  return i.drawPositions?.some((o) => s?.includes(o)) ? (i.matchUpStatus = "BYE", i.matchUpStatusCodes = [], Ee({ tournamentId: e?.tournamentId, context: n, drawDefinition: t, matchUp: i }), { ...x }) : F({ result: { error: yD }, info: "matchUp does not include BYE", stack: n });
12768
12768
  }
12769
- function ou(e) {
12769
+ function cu(e) {
12770
12770
  let { tournamentRecord: t, appliedPolicies: r, drawDefinition: i, matchUpsMap: n, targetData: a, structure: s, event: o } = e, c = "doubleExitAdvancement";
12771
12771
  if (s.structureType === Tr) return F({ result: { ...x }, stack: c });
12772
12772
  let { matchUp: u, targetMatchUps: l, targetLinks: d } = a, { loserMatchUp: p, winnerMatchUp: m, loserTargetDrawPosition: f } = l, h = lr(p?.matchUpStatus) && !p.sides?.map((I) => I.participantId ?? I.participant).filter(Boolean).length, g = p?.matchUpStatus === dt;
@@ -12801,10 +12801,10 @@ function $v(e) {
12801
12801
  let S = d.drawPositions?.filter(Boolean) || [], T = S.length === 1, b = e.walkoverWinningSide || T && Pd({ drawPosition: S[0], matchUpId: a.matchUpId, inContextDrawMatchUps: t }) || void 0, P = lr(d.matchUpStatus) && !S.length, M = d.finishingRound === 1, R = P && !M ? c : u, E = t.find((V) => V.matchUpId === g.matchUpId), A = [], N;
12802
12802
  n && (n?.structureId === E?.structureId ? n.roundPosition < g?.roundPosition ? N = 1 : N = 2 : a.feedRound ? n.structureId === a.structureId ? N = 2 : N = 1 : b && (N = 3 - b));
12803
12803
  let C = e.matchUpStatus, k = g?.matchUpStatus;
12804
- N === 1 ? A = [{ matchUpStatus: ud(C), previousMatchUpStatus: C, sideNumber: 1 }, { matchUpStatus: ud(k), previousMatchUpStatus: k, sideNumber: 2 }] : N === 2 && (A = [{ matchUpStatus: ud(k), previousMatchUpStatus: k, sideNumber: 1 }, { matchUpStatus: ud(C), previousMatchUpStatus: C, sideNumber: 2 }]), A.length && (A = A.map((V) => ae(V)));
12804
+ N === 1 ? A = [{ matchUpStatus: ld(C), previousMatchUpStatus: C, sideNumber: 1 }, { matchUpStatus: ld(k), previousMatchUpStatus: k, sideNumber: 2 }] : N === 2 && (A = [{ matchUpStatus: ld(k), previousMatchUpStatus: k, sideNumber: 1 }, { matchUpStatus: ld(C), previousMatchUpStatus: C, sideNumber: 2 }]), A.length && (A = A.map((V) => ae(V)));
12805
12805
  let O = tn({ ...e, winningSide: b, matchUp: d, matchUpStatusCodes: A, matchUpStatus: R });
12806
12806
  if (O.error) return F({ result: O, stack: l });
12807
- if (P) return ou({ ...e, matchUpStatus: R, targetData: I });
12807
+ if (P) return cu({ ...e, matchUpStatus: R, targetData: I });
12808
12808
  if (!v) return F({ result: { ...x }, stack: l });
12809
12809
  let L = m.length === 2 ? m[b - 1] : m[0], { positionAssignments: _ } = Ye({ structure: o }), B = _?.find((V) => V.drawPosition === L), G = s.drawMatchUps.find((V) => V.matchUpId === v.matchUpId), $ = G?.drawPositions?.filter(Boolean), j = $.length === 1;
12810
12810
  if (L) {
@@ -12814,7 +12814,7 @@ function $v(e) {
12814
12814
  let H = $.filter(Boolean)[0], W = Pd({ drawPosition: H, matchUpId: G.matchUpId, inContextDrawMatchUps: t }), Y = tn({ appliedPolicies: e.appliedPolicies, matchUpId: G.matchUpId, matchUp: G, matchUpStatus: u, matchUpStatusCodes: [], removeScore: !0, drawDefinition: i, winningSide: W });
12815
12815
  return Y.error ? F({ result: Y, stack: l }) : KI({ drawPositionToAdvance: H, matchUpId: G.matchUpId, inContextDrawMatchUps: t, drawDefinition: i, matchUpsMap: s });
12816
12816
  } else if (lr(v.matchUpStatus)) {
12817
- let H = ou({ ...e, matchUpId: G.matchUpId, matchUpStatus: R, targetData: V });
12817
+ let H = cu({ ...e, matchUpId: G.matchUpId, matchUpStatus: R, targetData: V });
12818
12818
  if (H.error) return F({ result: H, stack: l });
12819
12819
  }
12820
12820
  return F({ result: { ...x }, stack: l });
@@ -12829,7 +12829,7 @@ function $v(e) {
12829
12829
  let V = lr(G.matchUpStatus) ? u : c, H = tn({ matchUpId: G.matchUpId, appliedPolicies: e.appliedPolicies, matchUp: G, matchUpStatusCodes: [], removeScore: !0, drawDefinition: i, matchUpStatus: V });
12830
12830
  if (H.error) return F({ result: H, stack: l });
12831
12831
  if (V === c) {
12832
- let W = ou({ ...e, matchUpId: a.matchUpId, matchUpStatus: V, targetData: I });
12832
+ let W = cu({ ...e, matchUpId: a.matchUpId, matchUpStatus: V, targetData: I });
12833
12833
  if (W.error) return W;
12834
12834
  }
12835
12835
  }
@@ -12839,20 +12839,20 @@ function RE(e) {
12839
12839
  let { loserTargetDrawPosition: t, tournamentRecord: r, loserTargetLink: i, drawDefinition: n, matchUpsMap: a, event: s, loserMatchUp: o } = e, c = i?.target?.structureId, { structure: u } = me({ drawDefinition: n, structureId: c });
12840
12840
  return u ? ai({ drawPosition: t, tournamentRecord: r, drawDefinition: n, structureId: c, matchUpsMap: a, loserMatchUp: o, event: s }) : { error: ss };
12841
12841
  }
12842
- function ud(e) {
12842
+ function ld(e) {
12843
12843
  return e === dt ? st : e === Ot ? Qe : e;
12844
12844
  }
12845
12845
  function v2(e) {
12846
- let { tournamentRecord: t, drawDefinition: r, matchUpStatus: i, structure: n, matchUp: a } = e, s = !!(a.tieMatchUps && !a.rondPosition && e.inContextDrawMatchUps.find((I) => I.matchUpId === a.matchUpId).containerStructureId), o = "attemptToSetMatchUpStatus", c = i === "BYE", u = a.winningSide, l = [dt, Ot].includes(i), d = bl({ matchUpStatus: i }), p = kh({ matchUpStatus: i }), m = !d && !p, f = e.matchUpTieId || u && d && !l, h = u && l, g = () => tn({ ...e, removeScore: [mn, st].includes(i), matchUpStatus: i || vt });
12846
+ let { tournamentRecord: t, drawDefinition: r, matchUpStatus: i, structure: n, matchUp: a } = e, s = !!(a.tieMatchUps && !a.rondPosition && e.inContextDrawMatchUps.find((I) => I.matchUpId === a.matchUpId).containerStructureId), o = "attemptToSetMatchUpStatus", c = i === "BYE", u = a.winningSide, l = [dt, Ot].includes(i), d = Ml({ matchUpStatus: i }), p = kh({ matchUpStatus: i }), m = !d && !p, f = e.matchUpTieId || u && d && !l, h = u && l, g = () => tn({ ...e, removeScore: [mn, st].includes(i), matchUpStatus: i || vt });
12847
12847
  return m && { error: fh } || f && Ed(e) || h && w2(e) || u && Gc(e) || p && g() || c && S2({ tournamentRecord: t, drawDefinition: r, structure: n, matchUp: a }) || !d && { error: fh } || l && D2(e) || s && Ed(e) || e.propagateExitStatus && Ed(e) || F({ result: { error: hc, info: "matchUpStatus: " + i }, stack: o });
12848
12848
  }
12849
12849
  function w2(e) {
12850
12850
  let t = Gc(e);
12851
- return t.error ? t : ou(e);
12851
+ return t.error ? t : cu(e);
12852
12852
  }
12853
12853
  function D2(e) {
12854
12854
  let t = Ed({ ...e, removeScore: !0 });
12855
- return t.error ? t : ou(e);
12855
+ return t.error ? t : cu(e);
12856
12856
  }
12857
12857
  function Ed(e) {
12858
12858
  let t = "scoreModification";
@@ -12940,7 +12940,7 @@ function M2(e) {
12940
12940
  let d = qM(e);
12941
12941
  if (d.context?.progressExitStatus && Object.assign(i, d.context), d.error) return F({ result: d, stack: t });
12942
12942
  let p, m;
12943
- return e.qualifierChanging && n?.[Pu]?.autoReplaceQualifiers && (p = P2(e).qualifierReplaced), e.qualifierAdvancing && n?.[Pu]?.autoPlaceQualifiers && (m = b2(e).qualifierPlaced), F({ result: ae({ ...x, ...d, connectedStructures: r, qualifierReplaced: p, qualifierPlaced: m, context: i }), stack: t });
12943
+ return e.qualifierChanging && n?.[bu]?.autoReplaceQualifiers && (p = P2(e).qualifierReplaced), e.qualifierAdvancing && n?.[bu]?.autoPlaceQualifiers && (m = b2(e).qualifierPlaced), F({ result: ae({ ...x, ...d, connectedStructures: r, qualifierReplaced: p, qualifierPlaced: m, context: i }), stack: t });
12944
12944
  }
12945
12945
  var Ad = { drawPositionToRemove: "green", iteration: "brightred", winner: "green", loser: "brightred" };
12946
12946
  function EE(e) {
@@ -13024,7 +13024,7 @@ function E2(e) {
13024
13024
  w.length && (console.log({ connectedStructureIds: w }), I = !0), Object.assign(e, { removeScore: g });
13025
13025
  let S = Gc(e);
13026
13026
  if (S.error) return S;
13027
- if (e.removingQualifier && e.appliedPolicies?.[Pu]?.autoRemoveQualifiers) {
13027
+ if (e.removingQualifier && e.appliedPolicies?.[bu]?.autoRemoveQualifiers) {
13028
13028
  let T = N2(e);
13029
13029
  return { ...x, connectedStructures: I, ...T };
13030
13030
  }
@@ -13291,7 +13291,7 @@ function C2({ drawDefinition: e, matchUpStatus: t, matchUpsMap: r, winningSide:
13291
13291
  let l = ie(n, void 0, !0);
13292
13292
  for (let p of l?.tieMatchUps || []) p.matchUpId === o.matchUpId && (p.winningSide = i, p.score = u, !Lt({ score: u }) && !t ? Object.assign(p, { ...Nm }) : t && (p.matchUpStatus = t));
13293
13293
  a = a ?? fr({ matchUp: o, structure: s, drawDefinition: e, event: c })?.tieFormat;
13294
- let { winningSide: d } = Vl({ matchUp: l, drawDefinition: e, matchUpsMap: r, structure: s, tieFormat: a, event: c });
13294
+ let { winningSide: d } = jl({ matchUp: l, drawDefinition: e, matchUpsMap: r, structure: s, tieFormat: a, event: c });
13295
13295
  return { projectedWinningSide: d };
13296
13296
  }
13297
13297
  function O2(e) {
@@ -13327,18 +13327,18 @@ function Wc(e) {
13327
13327
  if (v) {
13328
13328
  if (o) Le({ extension: { name: js, value: !0 }, element: I });
13329
13329
  else if (c) {
13330
- let $ = I.winningSide, { winningSide: j, scoreStringSide1: V, scoreStringSide2: H, set: W } = Vl({ drawDefinition: u, matchUpsMap: h, structure: D, matchUp: I, event: m }), Y = { scoreStringSide1: V, scoreStringSide2: H, sets: W ? [W] : [] };
13330
+ let $ = I.winningSide, { winningSide: j, scoreStringSide1: V, scoreStringSide2: H, set: W } = jl({ drawDefinition: u, matchUpsMap: h, structure: D, matchUp: I, event: m }), Y = { scoreStringSide1: V, scoreStringSide2: H, sets: W ? [W] : [] };
13331
13331
  if (M = j !== $, P && M) return F({ stack: "winningSideWithDownstreamDependencies", result: { error: Ap }, context: { winningSide: d, matchUp: I } });
13332
13332
  yr({ name: js, element: I }), Object.assign(e, { winningSide: j, dualWinningSideChange: M, projectedWinningSide: j, score: Y });
13333
13333
  }
13334
- jl({ tournamentId: s?.tournamentId, inContextDualMatchUp: y, eventId: m?.eventId, dualMatchUp: I, drawDefinition: u });
13334
+ Gl({ tournamentId: s?.tournamentId, inContextDualMatchUp: y, eventId: m?.eventId, dualMatchUp: I, drawDefinition: u });
13335
13335
  }
13336
13336
  if (v && l && [no].includes(l)) return { info: "Not supported for matchUpType: TEAM", error: z };
13337
13337
  if (f && !v && !i) {
13338
13338
  let $ = I.matchUpFormat ?? D?.matchUpFormat ?? u?.matchUpFormat ?? m?.matchUpFormat, j = Zy({ existingMatchUpStatus: I.matchUpStatus, matchUpFormat: $, matchUpStatus: l, winningSide: d, score: f });
13339
13339
  if (j.error) return j;
13340
13340
  }
13341
- let R = xe({ policyTypes: [Pu, pi], tournamentRecord: s, drawDefinition: u, event: m })?.appliedPolicies ?? {};
13341
+ let R = xe({ policyTypes: [bu, pi], tournamentRecord: s, drawDefinition: u, event: m })?.appliedPolicies ?? {};
13342
13342
  Ce(e.policyDefinitions) && Object.assign(R, e.policyDefinitions);
13343
13343
  let E = x2({ assignedDrawPositions: w, propagateExitStatus: n, inContextMatchUp: y, appliedPolicies: R, drawDefinition: u, matchUpStatus: l, structure: D, matchUp: I });
13344
13344
  if (E?.error) return E;
@@ -13352,7 +13352,7 @@ function Wc(e) {
13352
13352
  Object.assign(e, { isCollectionMatchUp: !0, dualWinningSideChange: M, projectedWinningSide: V, autoCalcDisabled: W, matchUpTieId: S, dualMatchUp: $, tieFormat: j });
13353
13353
  }
13354
13354
  }
13355
- let O = bl({ matchUpStatus: l });
13355
+ let O = Ml({ matchUpStatus: l });
13356
13356
  if (!S) {
13357
13357
  if (P && !d && (l && kh({ matchUpStatus: l }) || l && [dt, Ot].includes(l))) return { error: Id, activeDownstream: P, winningSide: d };
13358
13358
  if (d && d === I.winningSide && l && !O) return { context: "winningSide must include directing matchUpStatus", error: Id, directingMatchUpStatus: O, matchUpStatus: l };
@@ -13419,7 +13419,7 @@ function _E({ drawDefinition: e, matchUpId: t, event: r }) {
13419
13419
  return Le({ extension: { name: js, value: !0 }, element: i });
13420
13420
  }
13421
13421
  function BE(e) {
13422
- let t = "setMatchUpFormat", r = se(e, [{ tournamentRecord: !0 }, { [ir]: (v) => qr({ matchUpFormat: v }), [ti]: Ku, matchUpFormat: !0 }]);
13422
+ let t = "setMatchUpFormat", r = se(e, [{ tournamentRecord: !0 }, { [ir]: (v) => qr({ matchUpFormat: v }), [ti]: Xu, matchUpFormat: !0 }]);
13423
13423
  if (r.error) return F({ result: r, stack: t });
13424
13424
  let { tournamentRecord: i, drawDefinition: n, scheduledDates: a, stageSequences: s, matchUpFormat: o, structureId: c, eventType: u, matchUpId: l, eventId: d, stages: p, drawId: m, event: f, force: h } = e;
13425
13425
  if (a && !Array.isArray(a)) return F({ result: { error: z, scheduledDates: a }, stack: t });
@@ -13492,7 +13492,7 @@ function L2({ sourceMatchUpStatusCodes: e, propagateExitStatus: t, sourceMatchUp
13492
13492
  }
13493
13493
  return F({ result: { error: br }, stack: u });
13494
13494
  }
13495
- function td(e) {
13495
+ function rd(e) {
13496
13496
  let t = se(e, [{ [dn]: !0, [mr]: !0 }]);
13497
13497
  if (t.error) return t;
13498
13498
  let r = "setMatchUpStatus", i = hi(e);
@@ -13550,7 +13550,7 @@ function _2(e) {
13550
13550
  for (let c of a[s]) {
13551
13551
  let { drawId: u } = c, l = o?.drawDefinitions?.find((d) => d.drawId === u);
13552
13552
  if (l && u) {
13553
- let { matchUpFormat: d, matchUpId: p } = c, m = td({ schedule: c?.schedule, tournamentRecords: t, policyDefinitions: n, tournamentRecord: r, drawDefinition: l, matchUpFormat: d, matchUpId: p, outcome: c, drawId: u, event: o });
13553
+ let { matchUpFormat: d, matchUpId: p } = c, m = rd({ schedule: c?.schedule, tournamentRecords: t, policyDefinitions: n, tournamentRecord: r, drawDefinition: l, matchUpFormat: d, matchUpId: p, outcome: c, drawId: u, event: o });
13554
13554
  if (m.error) return m;
13555
13555
  }
13556
13556
  }
@@ -13588,7 +13588,7 @@ function nS(e) {
13588
13588
  let y = (c.tieMatchUps || []).filter((U) => U.collectionId === I);
13589
13589
  if (y.length > g) y.sort((U, D) => (U.matchUpStatus === vt ? 1 : 0) - (D.matchUpStatus === vt ? 1 : 0)), m.push(...y.slice(0, g)), d.push(...y.slice(3).map(Gt));
13590
13590
  else if (m.push(...y), y.length < g) {
13591
- let U = g - y.length, D = Ll({ collectionDefinition: h, matchUpsLimit: U, matchUp: c, uuids: n });
13591
+ let U = g - y.length, D = _l({ collectionDefinition: h, matchUpsLimit: U, matchUp: c, uuids: n });
13592
13592
  f.push(...D);
13593
13593
  }
13594
13594
  }
@@ -13624,7 +13624,7 @@ function aS(e) {
13624
13624
  return { ...x };
13625
13625
  }
13626
13626
  function $E(e) {
13627
- let t = se(e, [{ [mr]: !0, [ra]: !0 }, { [Zo]: { [ol]: !1, roundNumbers: !1 }, [wP]: "At least one must be provided", [Er]: cr }]);
13627
+ let t = se(e, [{ [mr]: !0, [ra]: !0 }, { [Zo]: { [cl]: !1, roundNumbers: !1 }, [wP]: "At least one must be provided", [Er]: cr }]);
13628
13628
  if (t.error) return t;
13629
13629
  let r = JM(e);
13630
13630
  if (r.error) return r;
@@ -13683,7 +13683,7 @@ function qE(e) {
13683
13683
  if (!u.matchUp) return { error: dr };
13684
13684
  let { matchUp: l, structure: d } = u, { drawPositions: p, matchUpType: m } = l;
13685
13685
  if (m !== rt) return { error: xr };
13686
- if (!p?.length) return { error: zu };
13686
+ if (!p?.length) return { error: Yu };
13687
13687
  let f = fr({ matchUp: l, drawDefinition: r, structure: d, event: a })?.tieFormat, h = {};
13688
13688
  for (let I of n) {
13689
13689
  if (!Array.isArray(I)) return { error: z, lineUp: I };
@@ -13746,16 +13746,16 @@ function cS({ matchUpScheduleTimes: e, matchUpDependencies: t, allDateMatchUpIds
13746
13746
  let n = (t?.[i.matchUpId]?.matchUpIds || []).filter((a) => r.includes(a)).filter((a) => !e[a]);
13747
13747
  return { dependenciesScheduled: !n?.length, remainingDependencies: n };
13748
13748
  }
13749
- function rd({ individualParticipantProfiles: e, participantId: t }) {
13749
+ function id({ individualParticipantProfiles: e, participantId: t }) {
13750
13750
  e[t] || (e[t] = { typeChangeTimeAfterRecovery: void 0, timeAfterRecovery: void 0, priorMatchUpType: void 0, potentialRecovery: {}, potentialCounted: {}, potentialBookings: {}, bookings: [], counters: {} });
13751
13751
  }
13752
13752
  function j2({ individualParticipantProfiles: e, recoveryValue: t, participantId: r, scheduleTime: i, drawId: n }) {
13753
13753
  e[r].potentialRecovery[n] || (e[r].potentialRecovery[n] = []), e[r].potentialRecovery[n].push(t), e[r].potentialBookings[n] || (e[r].potentialBookings[n] = []), e[r].potentialBookings[n].push({ timeAfterRecovery: t, scheduleTime: i });
13754
13754
  }
13755
- function Vu({ matchUpPotentialParticipantIds: e, individualParticipantProfiles: t, typeChangeRecoveryMinutes: r, averageMatchUpMinutes: i = 0, matchUpNotBeforeTimes: n, matchUpDependencies: a, recoveryMinutes: s = 0, scheduleTime: o, matchUp: c }) {
13755
+ function ju({ matchUpPotentialParticipantIds: e, individualParticipantProfiles: t, typeChangeRecoveryMinutes: r, averageMatchUpMinutes: i = 0, matchUpNotBeforeTimes: n, matchUpDependencies: a, recoveryMinutes: s = 0, scheduleTime: o, matchUp: c }) {
13756
13756
  let u = nt(c?.schedule?.endTime), l = u ? Or(u, pe(s)) : Or(o, pe(i) + pe(s)), d = r && (u ? Or(nt(u), r) : Or(o, pe(i) + pe(r))), p = a?.[c.matchUpId]?.participantIds || [], m = (c.roundPosition && e[c.matchUpId] || []).flat();
13757
13757
  p.forEach((f) => {
13758
- rd({ individualParticipantProfiles: t, participantId: f });
13758
+ id({ individualParticipantProfiles: t, participantId: f });
13759
13759
  let h = t[f].priorMatchUpType !== c.matchUpType && d || l;
13760
13760
  m.includes(f) ? j2({ individualParticipantProfiles: t, drawId: c.drawId, recoveryValue: h, participantId: f, scheduleTime: o }) : (t[f].timeAfterRecovery = h, t[f].bookings.push({ scheduleTime: o, timeAfterRecovery: h }));
13761
13761
  }), oc({ matchUpPotentialParticipantIds: e, matchUpNotBeforeTimes: n, timeAfterRecovery: l, matchUp: c });
@@ -13777,14 +13777,14 @@ function G2(e) {
13777
13777
  let { sides: t, matchUpType: r } = e || {};
13778
13778
  return (t || []).map((i) => r === We && (i?.participant?.individualParticipants || []) || i?.participant && [i.participant] || []).flat();
13779
13779
  }
13780
- var id = "DO_NOT_SCHEDULE", $2 = { DO_NOT_SCHEDULE: id };
13780
+ var nd = "DO_NOT_SCHEDULE", $2 = { DO_NOT_SCHEDULE: nd };
13781
13781
  function uS({ averageMatchUpMinutes: e = 90, requestConflicts: t = {}, potentials: r = !0, personRequests: i, scheduleTime: n, scheduleDate: a, matchUp: s }) {
13782
13782
  let o = G2(s).map(({ person: m }) => m?.personId);
13783
13783
  if (r) {
13784
13784
  let m = (s?.potentialParticipants || []).flat().map(({ person: f }) => f?.personId);
13785
13785
  o.push(...m);
13786
13786
  }
13787
- let c = o.map((m) => i[m]?.map((f) => ({ ...f, personId: m }))).filter(Boolean).flat().filter((m) => m.requestType === id && Pn(a, m.date)), u = [], l = s?.matchUpId, d = Mt(nt(n), ve(a)), p = nt(Kg(d, e).toISOString());
13787
+ let c = o.map((m) => i[m]?.map((f) => ({ ...f, personId: m }))).filter(Boolean).flat().filter((m) => m.requestType === nd && Pn(a, m.date)), u = [], l = s?.matchUpId, d = Mt(nt(n), ve(a)), p = nt(Kg(d, e).toISOString());
13788
13788
  for (let m of c) {
13789
13789
  let { requestId: f, startTime: h, endTime: g } = m;
13790
13790
  (n > h && n < g || p > h && p < g) && (u.push({ matchUpId: l, request: m, scheduleTime: n }), t[f] ? (t[f].scheduleTimes.includes(n) || t[f].scheduleTimes.push(n), t[f].matchUpIds.includes(l) || t[f].matchUpIds.push(l)) : t[f] = { request: m, scheduleTimes: [n], matchUpIds: [l] });
@@ -13794,7 +13794,7 @@ function uS({ averageMatchUpMinutes: e = 90, requestConflicts: t = {}, potential
13794
13794
  function tg({ matchUpPotentialParticipantIds: e, individualParticipantProfiles: t, matchUp: r, value: i }) {
13795
13795
  let { matchUpType: n } = r, { individualParticipantIds: a } = um(r), s = (e[r.matchUpId] || []).filter((o) => !Sr(o, a)).flat();
13796
13796
  [...a, ...s].forEach((o) => {
13797
- if (rd({ individualParticipantProfiles: t, participantId: o }), !t[o].potentialCounted[r.drawId]) {
13797
+ if (id({ individualParticipantProfiles: t, participantId: o }), !t[o].potentialCounted[r.drawId]) {
13798
13798
  let c = t[o].counters;
13799
13799
  c[n] ? c[n] += i : i > 0 && (c[n] = i), c[Ni] ? c[Ni] += i : i > 0 && (c[Ni] = i), s.includes(o) && (t[o].potentialCounted[r.drawId] = !0);
13800
13800
  }
@@ -13804,7 +13804,7 @@ function W2({ matchUpPotentialParticipantIds: e, individualParticipantProfiles:
13804
13804
  let p = [];
13805
13805
  r || (n = d?.filter((h) => {
13806
13806
  let g = h.schedule || {}, I = h.matchUpStatus === "BYE";
13807
- return I && p.push({ tournamentId: h.tournamentId, matchUpId: h.matchUpId }), !I && Xl({ schedule: g }) && (!u || h.schedule.scheduledDate === u);
13807
+ return I && p.push({ tournamentId: h.tournamentId, matchUpId: h.matchUpId }), !I && Ql({ schedule: g }) && (!u || h.schedule.scheduledDate === u);
13808
13808
  }), r = n.map(Gt));
13809
13809
  let m = Array.isArray(c) ? c.includes(u) : c, f = m ? [] : d.filter(({ matchUpId: h }) => r.includes(h));
13810
13810
  for (let h of f) {
@@ -13813,7 +13813,7 @@ function W2({ matchUpPotentialParticipantIds: e, individualParticipantProfiles:
13813
13813
  if (g) {
13814
13814
  s[h.matchUpId] = g;
13815
13815
  let I = l?.[h.matchUpId]?.recoveryMinutes;
13816
- Vu({ individualParticipantProfiles: t, matchUpPotentialParticipantIds: e, matchUpNotBeforeTimes: a, matchUpDependencies: o, averageMatchUpMinutes: i, recoveryMinutes: I, scheduleTime: g, matchUp: h });
13816
+ ju({ individualParticipantProfiles: t, matchUpPotentialParticipantIds: e, matchUpNotBeforeTimes: a, matchUpDependencies: o, averageMatchUpMinutes: i, recoveryMinutes: I, scheduleTime: g, matchUp: h });
13817
13817
  }
13818
13818
  }
13819
13819
  return { dateScheduledMatchUpIds: r, byeScheduledMatchUpDetails: p, dateScheduledMatchUps: n, clearDate: m };
@@ -13823,12 +13823,12 @@ function Sf({ defaultRecoveryMinutes: e = 0, averageMatchUpMinutes: t = 90, date
13823
13823
  if (!yi(o) && !Array.isArray(r)) return { error: ea };
13824
13824
  a = a ?? mf({ recoveryMinutes: e, averageMatchUpMinutes: t });
13825
13825
  let c = Object.assign({}, ...Object.values(i).map((d) => (d.events ?? []).map((p) => {
13826
- let { scheduleTiming: m } = fl({ tournamentRecord: d, event: p });
13826
+ let { scheduleTiming: m } = hl({ tournamentRecord: d, event: p });
13827
13827
  return { [p.eventId]: { event: p, scheduleTiming: m } };
13828
13828
  })).flat()), u = { averageTimes: [{ minutes: { default: t } }], recoveryTimes: [{ minutes: { default: e } }] };
13829
13829
  r || (r = o?.filter((d) => {
13830
13830
  let p = d.schedule;
13831
- return Xl({ schedule: p }) && (!s || d.schedule.scheduledDate === s);
13831
+ return Ql({ schedule: p }) && (!s || d.schedule.scheduledDate === s);
13832
13832
  }));
13833
13833
  let l = r?.filter((d) => (!n.length || n.includes(d.schedule.venueId)) && d.matchUpStatus !== "BYE");
13834
13834
  return { bookings: l?.map(({ eventId: d, schedule: p, matchUpFormat: m }) => {
@@ -13852,7 +13852,7 @@ function H2({ scheduledRoundsDetails: e, greatestAverageMinutes: t, garmanSingle
13852
13852
  function YE({ matchUpPotentialParticipantIds: e, individualParticipantProfiles: t, scheduleCompletedMatchUps: r, containedStructureIds: i, matchUpNotBeforeTimes: n, matchUpScheduleTimes: a, matchUpDependencies: s, clearScheduleDates: o, tournamentRecords: c, periodLength: u, scheduleDate: l, useGarman: d, matchUps: p, courts: m, venues: f }) {
13853
13853
  let h = {}, g = [], I = [], y = [];
13854
13854
  for (let U of f) {
13855
- let { rounds: D = [], venueId: v } = U, { scheduledRoundsDetails: w, greatestAverageMinutes: S, orderedMatchUpIds: T, minutesMap: b } = Yl({ scheduleCompletedMatchUps: r, containedStructureIds: i, tournamentRecords: c, periodLength: u, matchUps: p, rounds: D });
13855
+ let { rounds: D = [], venueId: v } = U, { scheduledRoundsDetails: w, greatestAverageMinutes: S, orderedMatchUpIds: T, minutesMap: b } = Kl({ scheduleCompletedMatchUps: r, containedStructureIds: i, tournamentRecords: c, periodLength: u, matchUps: p, rounds: D });
13856
13856
  y.push(...T ?? []);
13857
13857
  let { groupedRounds: P } = H2({ scheduledRoundsDetails: w, greatestAverageMinutes: S, garmanSinglePass: !0 }), M, R = [];
13858
13858
  d && ({ scheduleTimes: R, dateScheduledMatchUpIds: M } = q2({ averageMatchUpMinutes: P[0]?.averageMinutes, scheduleDate: ve(l), venueIds: [U.venueId], clearScheduleDates: o, tournamentRecords: c, periodLength: u, matchUps: p }));
@@ -13871,12 +13871,12 @@ function z2(e, t) {
13871
13871
  }
13872
13872
  function lS({ individualParticipantProfiles: e, matchUpNotBeforeTimes: t, matchUpDependencies: r, scheduleTime: i, matchUp: n, details: a }) {
13873
13873
  let s = (r?.[n.matchUpId]?.participantIds || []).flat(), o = a?.minutesMap?.[n.matchUpId]?.averageMinutes || 0, c = a?.minutesMap?.[n.matchUpId]?.recoveryMinutes || 0, u = s.every((p) => {
13874
- rd({ individualParticipantProfiles: e, participantId: p });
13874
+ id({ individualParticipantProfiles: e, participantId: p });
13875
13875
  let m = e[p];
13876
13876
  if (!m.timeAfterRecovery) return !0;
13877
13877
  let f = nt(n?.schedule?.endTime), h = f ? Or(f, pe(c)) : Or(i, pe(o) + pe(c));
13878
13878
  return ![...Object.keys(m.potentialBookings).filter((g) => g !== n.drawId).map((g) => m.potentialBookings[g]).flat(), ...m.bookings].find((g) => z2({ scheduleTime: i, timeAfterRecovery: h }, g).hasOverlap);
13879
- }), l = t[n.matchUpId], d = (l ? tl(Mt(l), Mt(i), !1) : 0) >= 0;
13879
+ }), l = t[n.matchUpId], d = (l ? rl(Mt(l), Mt(i), !1) : 0) >= 0;
13880
13880
  return { enoughTime: u && d };
13881
13881
  }
13882
13882
  function KE({ autoSchedulingAudit: e, tournamentRecords: t }) {
@@ -13884,13 +13884,13 @@ function KE({ autoSchedulingAudit: e, tournamentRecords: t }) {
13884
13884
  let r = (s) => s ? Object.values(s).reduce((o, c) => o + c.length || 0, 0) : 0, i = (e?.schedulingProfile || []).reduce((s, o) => s + o.venues.reduce((c, u) => c + u.rounds.length, 0), 0), n = { scheduledDatesCount: e.scheduledDates?.length, noTimeMatchUpIdsCount: r(e?.noTimeMatchUpIds), scheduledMatchUpIdsCount: r(e?.scheduledMatchUpIds), overLimitMatchUpIdsCount: r(e?.overLimitMatchUpIds), requestConflictsCount: r(e?.requestConflicts), profileRoundsCount: i }, a = { itemType: Jh, itemValue: n };
13885
13885
  for (let s of Object.values(t)) {
13886
13886
  let o = s.tournamentId;
13887
- _p($n) ? Ue({ payload: { type: Jh, tournamentId: o, detail: n }, topic: $n }) : Gl({ tournamentRecord: s, timeItem: a });
13887
+ _p($n) ? Ue({ payload: { type: Jh, tournamentId: o, detail: n }, topic: $n }) : $l({ tournamentRecord: s, timeItem: a });
13888
13888
  }
13889
13889
  }
13890
13890
  function dS({ matchUpPotentialParticipantIds: e, individualParticipantProfiles: t, matchUpDailyLimits: r = {}, matchUp: i }) {
13891
13891
  let { enteredIndividualParticipantIds: n } = um(i), { matchUpId: a, matchUpType: s } = i, o = (i.roundPosition && e[a] || []).flat(), c = ye(n.concat(...o));
13892
13892
  return c.forEach((u) => {
13893
- rd({ individualParticipantProfiles: t, participantId: u });
13893
+ id({ individualParticipantProfiles: t, participantId: u });
13894
13894
  }), { participantIdsAtLimit: c.filter((u) => {
13895
13895
  let l = t[u];
13896
13896
  if (l) return [s, Ni].find((d) => {
@@ -13899,7 +13899,7 @@ function dS({ matchUpPotentialParticipantIds: e, individualParticipantProfiles:
13899
13899
  });
13900
13900
  }), relevantParticipantIds: c };
13901
13901
  }
13902
- function ju({ scheduleCompletedMatchUps: e = !1, scheduleByeMatchUps: t = !1, errorOnAnachronism: r = !1, checkChronology: i = !0, matchUpDependencies: n, removePriorValues: a, tournamentRecords: s, tournamentRecord: o, matchUpDetails: c, matchUpIds: u, schedule: l }) {
13902
+ function Gu({ scheduleCompletedMatchUps: e = !1, scheduleByeMatchUps: t = !1, errorOnAnachronism: r = !1, checkChronology: i = !0, matchUpDependencies: n, removePriorValues: a, tournamentRecords: s, tournamentRecord: o, matchUpDetails: c, matchUpIds: u, schedule: l }) {
13903
13903
  if (!o) return { error: J };
13904
13904
  if (!c && (!u || !Array.isArray(u))) return { error: Ys };
13905
13905
  if (!c && (!l || typeof l != "object")) return { error: YD };
@@ -13924,9 +13924,9 @@ function ju({ scheduleCompletedMatchUps: e = !1, scheduleByeMatchUps: t = !1, er
13924
13924
  }
13925
13925
  return p.length ? { ...x, scheduled: m, warnings: p } : { ...x, scheduled: m };
13926
13926
  }
13927
- function nd(e) {
13927
+ function ad(e) {
13928
13928
  let { scheduleCompletedMatchUps: t = !1, scheduleByeMatchUps: r = !1, errorOnAnachronism: i, matchUpContextIds: n, removePriorValues: a, tournamentRecords: s, checkChronology: o, matchUpDetails: c, schedule: u } = e;
13929
- if (e.matchUpIds && !n) return ju(e);
13929
+ if (e.matchUpIds && !n) return Gu(e);
13930
13930
  let l = se(e, [{ [pr]: !0 }, { [Zo]: { matchUpContextIds: !1, matchUpDetails: !1 }, [ti]: z, [Er]: cr }]);
13931
13931
  if (l.error) return l;
13932
13932
  if ((!c || n) && !u) return { error: ce, info: "schedule is required" };
@@ -13934,7 +13934,7 @@ function nd(e) {
13934
13934
  for (let f of Object.values(s)) {
13935
13935
  let { tournamentId: h } = f, g = n?.filter((y) => y.tournamentId === h).map(Gt), I = c?.filter((y) => y?.tournamentId === h);
13936
13936
  if (g?.length || I?.length) {
13937
- let y = ju({ matchUpDetails: I, scheduleCompletedMatchUps: t, scheduleByeMatchUps: r, matchUpDependencies: m, errorOnAnachronism: i, removePriorValues: a, tournamentRecords: s, tournamentRecord: f, checkChronology: o, matchUpIds: g, schedule: u });
13937
+ let y = Gu({ matchUpDetails: I, scheduleCompletedMatchUps: t, scheduleByeMatchUps: r, matchUpDependencies: m, errorOnAnachronism: i, removePriorValues: a, tournamentRecords: s, tournamentRecord: f, checkChronology: o, matchUpIds: g, schedule: u });
13938
13938
  if (y.warnings?.length && d.push(...y.warnings), y.scheduled && (p += y.scheduled), y.error) return y;
13939
13939
  }
13940
13940
  }
@@ -13972,7 +13972,7 @@ function Y2({ schedulingProfileModifications: e, checkPotentialRequestConflicts:
13972
13972
  if (Pt?.length) return D[E] || (D[E] = []), D[E].push(...Pt), !1;
13973
13973
  k(he, ee);
13974
13974
  let de = Y.minutesMap?.[Z]?.recoveryMinutes;
13975
- return Vu({ matchUpPotentialParticipantIds: N, individualParticipantProfiles: C, matchUpNotBeforeTimes: O, averageMatchUpMinutes: Jt, matchUpDependencies: s, recoveryMinutes: de, scheduleTime: q, matchUp: Q }), v[Z] = q, !0;
13975
+ return ju({ matchUpPotentialParticipantIds: N, individualParticipantProfiles: C, matchUpNotBeforeTimes: O, averageMatchUpMinutes: Jt, matchUpDependencies: s, recoveryMinutes: de, scheduleTime: q, matchUp: Q }), v[Z] = q, !0;
13976
13976
  });
13977
13977
  Y.matchUpsToSchedule = Y.matchUpsToSchedule.filter(({ matchUpId: Q }) => Q !== X?.matchUpId), X ? W += 1 : (I[E][H] || (I[E][H] = []), I[E][H].push({ scheduleTime: q, attempts: K + 1 }));
13978
13978
  }
@@ -13999,7 +13999,7 @@ function Y2({ schedulingProfileModifications: e, checkPotentialRequestConflicts:
13999
13999
  });
14000
14000
  }), T[E] = _[H].matchUpsToSchedule.map(Gt), g[E][H] = _[H].scheduleTimes.sort((Y, q) => ke(Y.scheduleTime) - ke(q.scheduleTime));
14001
14001
  }
14002
- !h && L?.length && nd({ matchUpDetails: L, scheduleByeMatchUps: !0, removePriorValues: !0, tournamentRecords: u, schedule: { scheduledDate: "", scheduledTime: "", courtOrder: "", courtId: "", venueId: "" } });
14002
+ !h && L?.length && ad({ matchUpDetails: L, scheduleByeMatchUps: !0, removePriorValues: !0, tournamentRecords: u, schedule: { scheduledDate: "", scheduledTime: "", courtOrder: "", courtId: "", venueId: "" } });
14003
14003
  for (let H of R.venues) for (let W of H.rounds) {
14004
14004
  let Y = (W.matchUps?.map(({ matchUpId: K }) => K) || []).filter((K) => w[E].includes(K));
14005
14005
  W.canScheduledMatchUpIds = Y;
@@ -14014,12 +14014,12 @@ function Hv({ averageMinutes: e, startTime: t, endTime: r, court: i, date: n })
14014
14014
  if (!Array.isArray(i.dateAvailability)) return { error: ce, stack: "getEarliestCourtTime" };
14015
14015
  let a = cc({ scheduleDate: n, courts: [i], startTime: !0 }), s = cc({ scheduleDate: n, courts: [i], endTime: !0 });
14016
14016
  t = t || a, r = r || s;
14017
- let o = ed({ court: i, date: n }), { timeSlots: c } = jc({ courtDate: o }), u = Mt(t), l = Mt(r);
14017
+ let o = td({ court: i, date: n }), { timeSlots: c } = jc({ courtDate: o }), u = Mt(t), l = Mt(r);
14018
14018
  return { earliestCourtTime: c?.reduce((d, p) => {
14019
14019
  let m = Mt(p.startTime), f = Mt(p.endTime);
14020
14020
  if (m > l || f < u) return d;
14021
14021
  let h = u > m ? u : m;
14022
- if (tl(h, f) >= e) {
14022
+ if (rl(h, f) >= e) {
14023
14023
  let g = nt(h.toISOString());
14024
14024
  (!d || g < d) && (d = g);
14025
14025
  }
@@ -14075,7 +14075,7 @@ function K2({ schedulingProfileModifications: e, checkPotentialRequestConflicts:
14075
14075
  if (ht?.length) return le.push(...ht), !1;
14076
14076
  C(Pt, bt);
14077
14077
  let Se = Q.minutesMap?.[Ke]?.recoveryMinutes;
14078
- return Vu({ matchUpPotentialParticipantIds: A, individualParticipantProfiles: N, matchUpNotBeforeTimes: k, averageMatchUpMinutes: tt, matchUpDependencies: s, recoveryMinutes: Se, scheduleTime: Me, matchUp: Fe }), (!Re.scheduleTime || ke(Me) < ke(Re.scheduleTime)) && (Re.averageMatchUpMinutes = tt, Re.recoveryMinutes = Se, Re.scheduleTime = Me, Re.courtName = et.courtName, Re.courtId = et.courtId), Re;
14078
+ return ju({ matchUpPotentialParticipantIds: A, individualParticipantProfiles: N, matchUpNotBeforeTimes: k, averageMatchUpMinutes: tt, matchUpDependencies: s, recoveryMinutes: Se, scheduleTime: Me, matchUp: Fe }), (!Re.scheduleTime || ke(Me) < ke(Re.scheduleTime)) && (Re.averageMatchUpMinutes = tt, Re.recoveryMinutes = Se, Re.scheduleTime = Me, Re.courtName = et.courtName, Re.courtId = et.courtId), Re;
14079
14079
  }, {});
14080
14080
  if ($e.scheduleTime) {
14081
14081
  let { averageMatchUpMinutes: Re, recoveryMinutes: et, scheduleTime: Me, courtId: Ze } = $e;
@@ -14106,7 +14106,7 @@ function K2({ schedulingProfileModifications: e, checkPotentialRequestConflicts:
14106
14106
  });
14107
14107
  }), S[R] = _[X].matchUpsToSchedule.map(Gt);
14108
14108
  }
14109
- !h && O?.length && nd({ matchUpDetails: O, scheduleByeMatchUps: !0, removePriorValues: !0, tournamentRecords: u, schedule: { scheduledDate: "", scheduledTime: "", courtOrder: "", courtId: "", venueId: "" } });
14109
+ !h && O?.length && ad({ matchUpDetails: O, scheduleByeMatchUps: !0, removePriorValues: !0, tournamentRecords: u, schedule: { scheduledDate: "", scheduledTime: "", courtOrder: "", courtId: "", venueId: "" } });
14110
14110
  for (let X of M.venues) for (let Q of X.rounds) {
14111
14111
  let Z = (Q.matchUps ?? []).map(({ matchUpId: ue }) => ue)?.filter((ue) => v[R].includes(ue));
14112
14112
  Q.canScheduledMatchUpIds = Z;
@@ -14134,7 +14134,7 @@ function X2({ scheduleAttributes: e = ["scheduledDate", "scheduledTime", "courtO
14134
14134
  n.length && e.push("venueId");
14135
14135
  let a = Qt({ matchUpFilters: { scheduledDates: i }, tournamentRecord: r }).matchUps ?? [], s = {};
14136
14136
  a.forEach(({ matchUpStatus: u, schedule: l, drawId: d, matchUpId: p }) => {
14137
- (!u || !t.includes(u)) && Xl({ schedule: l, scheduleAttributes: e }) && (!n?.length || n.includes(l.venueId)) && (s[d] || (s[d] = []), s[d].push(p));
14137
+ (!u || !t.includes(u)) && Ql({ schedule: l, scheduleAttributes: e }) && (!n?.length || n.includes(l.venueId)) && (s[d] || (s[d] = []), s[d].push(p));
14138
14138
  });
14139
14139
  let o = r.tournamentId, c = 0;
14140
14140
  for (let u in s) {
@@ -14163,7 +14163,7 @@ function wf(e) {
14163
14163
  let b = Array.isArray(i) ? i : [];
14164
14164
  vf({ tournamentRecords: a, scheduledDates: b });
14165
14165
  }
14166
- let y = sa({ ignoreDisabled: !1, tournamentRecords: a }).courts, { matchUps: U } = Hi({ matchUpFilters: { matchUpTypes: [ze, We] }, afterRecoveryTimes: !0, nextMatchUps: !0, tournamentRecords: a }), { matchUpDependencies: D } = Li({ includeParticipantDependencies: !0, tournamentRecords: a, matchUps: U }), { matchUpDailyLimits: v } = of({ tournamentRecords: a }), { personRequests: w } = Us({ requestType: id, tournamentRecords: a }), S = f.filter((b) => {
14166
+ let y = sa({ ignoreDisabled: !1, tournamentRecords: a }).courts, { matchUps: U } = Hi({ matchUpFilters: { matchUpTypes: [ze, We] }, afterRecoveryTimes: !0, nextMatchUps: !0, tournamentRecords: a }), { matchUpDependencies: D } = Li({ includeParticipantDependencies: !0, tournamentRecords: a, matchUps: U }), { matchUpDailyLimits: v } = of({ tournamentRecords: a }), { personRequests: w } = Us({ requestType: nd, tournamentRecords: a }), S = f.filter((b) => {
14167
14167
  let P = ve(b?.scheduleDate);
14168
14168
  return I.includes(P);
14169
14169
  }).sort((b, P) => new Date(b.scheduleDate).getTime() - new Date(P.scheduleDate).getTime()), T = { schedulingProfileModifications: p, checkPotentialRequestConflicts: t, scheduleCompletedMatchUps: r, schedulingProfileIssues: m, dateSchedulingProfiles: S, containedStructureIds: h, matchUpDependencies: D, matchUpDailyLimits: v, clearScheduleDates: i, tournamentRecords: a, schedulingProfile: f, personRequests: w, periodLength: s, matchUps: U, dryRun: c, courts: y };
@@ -14316,14 +14316,14 @@ function qc(e) {
14316
14316
  }
14317
14317
  let It = (je) => {
14318
14318
  let Bt = je.categoryName || je.ratingType || je.ageCategoryCode, Yi = B[Bt]?.[de], Zt = _[Bt]?.[de];
14319
- ld({ scaleValue: Yi, eventType: _s, scaleType: ga, participant: gt, category: je }), ld({ scaleValue: Zt, eventType: Hn, scaleType: ga, participant: gt, category: je });
14319
+ dd({ scaleValue: Yi, eventType: _s, scaleType: ga, participant: gt, category: je }), dd({ scaleValue: Zt, eventType: Hn, scaleType: ga, participant: gt, category: je });
14320
14320
  let _i = G[Bt]?.[de], hn = $[Bt]?.[de];
14321
- ld({ scaleValue: _i, eventType: _s, scaleType: pa, participant: gt, category: je }), ld({ scaleValue: hn, eventType: Hn, scaleType: pa, participant: gt, category: je });
14321
+ dd({ scaleValue: _i, eventType: _s, scaleType: pa, participant: gt, category: je }), dd({ scaleValue: hn, eventType: Hn, scaleType: pa, participant: gt, category: je });
14322
14322
  };
14323
14323
  return Array.isArray(o) ? o.forEach((je) => It(je)) : c && It(c), gt;
14324
14324
  }
14325
14325
  }
14326
- function ld({ scaleValue: e, participant: t, eventType: r, scaleType: i, category: n }) {
14326
+ function dd({ scaleValue: e, participant: t, eventType: r, scaleType: i, category: n }) {
14327
14327
  let a = n.categoryName || n.ratingType || n.ageCategoryCode, s = [Ka, i, r, a].join("."), o = { itemValue: e, itemType: s };
14328
14328
  a && e && (t.timeItems || (t.timeItems = []), t.timeItems.push(o));
14329
14329
  }
@@ -14450,9 +14450,9 @@ function fS(e) {
14450
14450
  v = A;
14451
14451
  break;
14452
14452
  }
14453
- if (Bu({ matchUp: { score: { sets: I }, matchUpFormat: n } }).calculatedWinningSide) break;
14453
+ if (Vu({ matchUp: { score: { sets: I }, matchUpFormat: n } }).calculatedWinningSide) break;
14454
14454
  }
14455
- let S = Bu({ matchUp: { score: { sets: I }, matchUpFormat: n, winningSide: r } }), T = v ? r || v : S.calculatedWinningSide, { score: b } = VE({ winningSide: T, score: { sets: I }, matchUpStatus: l });
14455
+ let S = Vu({ matchUp: { score: { sets: I }, matchUpFormat: n, winningSide: r } }), T = v ? r || v : S.calculatedWinningSide, { score: b } = VE({ winningSide: T, score: { sets: I }, matchUpStatus: l });
14456
14456
  return { outcome: { winningSide: T, matchUpStatus: l, score: b } };
14457
14457
  }
14458
14458
  function ij({ weightedRange: e = [0, 1], pointsPerMinute: t, matchUpStatus: r, incomplete: i, setFormat: n, setNumber: a }) {
@@ -14477,7 +14477,7 @@ function ij({ weightedRange: e = [0, 1], pointsPerMinute: t, matchUpStatus: r, i
14477
14477
  let [S, T] = y;
14478
14478
  Object.assign(s, { side1Score: S, side2Score: T });
14479
14479
  }
14480
- let v = Lu({ matchUpScoringFormat: { setFormat: n }, setObject: s }), w;
14480
+ let v = _u({ matchUpScoringFormat: { setFormat: n }, setObject: s }), w;
14481
14481
  if (v.hasTiebreakCondition || U) {
14482
14482
  let { NoAD: S, tiebreakTo: T } = c || l || {}, b = te(1, T + 1).map((R) => te(0, T + 2 - R).map(() => R)).flat(), P = b[oi(0, b.length - 1)], M = $m({ isSide1: !0, tiebreakNoAd: S, tiebreakTo: T, lowValue: P });
14483
14483
  if (M) if (U) {
@@ -14558,13 +14558,13 @@ function nA(e) {
14558
14558
  let { matchUpStatusCodes: t, policyDefinitions: r, tournamentRecord: i, drawDefinition: n, targetMatchUp: a, matchUpStatus: s, matchUpFormat: o, scoreString: c, winningSide: u, event: l } = e;
14559
14559
  if (!a || a.matchUpStatus === "BYE") return;
14560
14560
  let { matchUpId: d } = a || {}, { outcome: p } = oS({ matchUpFormat: o, matchUpStatus: s, scoreString: c, winningSide: u });
14561
- return t && (p.matchUpStatusCodes = t), td({ tournamentRecord: i, policyDefinitions: r, drawDefinition: n, matchUpFormat: o, matchUpId: d, outcome: p, event: l });
14561
+ return t && (p.matchUpStatusCodes = t), rd({ tournamentRecord: i, policyDefinitions: r, drawDefinition: n, matchUpFormat: o, matchUpId: d, outcome: p, event: l });
14562
14562
  }
14563
14563
  function nj(e) {
14564
14564
  let { matchUpStatusProfile: t = {}, tournamentRecord: r, policyDefinitions: i, drawDefinition: n, matchUpStatus: a, matchUpFormat: s, targetMatchUp: o, scoreString: c, winningSide: u, event: l } = e;
14565
14565
  if (c || a) return nA(e);
14566
14566
  let { matchUpId: d } = o || {}, { outcome: p } = fS({ matchUpStatusProfile: t, matchUpFormat: s, winningSide: u });
14567
- return td({ policyDefinitions: i, tournamentRecord: r, drawDefinition: n, matchUpFormat: s, matchUpId: d, outcome: p, event: l });
14567
+ return rd({ policyDefinitions: i, tournamentRecord: r, drawDefinition: n, matchUpFormat: s, matchUpId: d, outcome: p, event: l });
14568
14568
  }
14569
14569
  function aA({ matchUpStatusProfile: e, completeAllMatchUps: t, randomWinningSide: r, tournamentRecord: i, drawProfiles: n, isMock: a, event: s }) {
14570
14570
  let o = wt({ event: s }).flightProfile, { eventName: c, eventType: u, category: l } = s, { startDate: d } = i, p = [], m = l?.categoryName || l?.ageCategoryCode || l?.ratingType, f = s.drawDefinitions?.map(({ drawId: h }) => h);
@@ -14576,14 +14576,14 @@ function aA({ matchUpStatusProfile: e, completeAllMatchUps: t, randomWinningSide
14576
14576
  let T = D.filter(Kr(En)).map(Kr(En)), b = m || c;
14577
14577
  if (i && w && w <= T.length && te(1, w + 1).forEach((A, N) => {
14578
14578
  let C = { scaleValue: A, scaleName: b, scaleType: Un, eventType: u, scaleDate: d }, k = T[N];
14579
- Hl({ tournamentRecord: i, participantId: k, scaleItem: C });
14579
+ zl({ tournamentRecord: i, participantId: k, scaleItem: C });
14580
14580
  }), f?.includes(I)) break;
14581
- let P = Jl({ ...v, matchUpType: u, seedingScaleName: b, tournamentRecord: i, drawEntries: D, drawName: U, drawId: I, isMock: a, event: s, stage: y });
14581
+ let P = Zl({ ...v, matchUpType: u, seedingScaleName: b, tournamentRecord: i, drawEntries: D, drawName: U, drawId: I, isMock: a, event: s, stage: y });
14582
14582
  if (P.error) return { error: P.error, drawIds: [] };
14583
14583
  let { drawDefinition: M } = P;
14584
14584
  if (!M) return { error: Zr };
14585
14585
  let R = n[h]?.drawExtensions;
14586
- if (Array.isArray(R) && R.filter(on).forEach((A) => Le({ element: M, extension: A })), P = Zl({ suppressNotifications: !0, tournamentRecord: i, drawDefinition: M, event: s }), P.error) return { error: P.error, drawIds: [] };
14586
+ if (Array.isArray(R) && R.filter(on).forEach((A) => Le({ element: M, extension: A })), P = ed({ suppressNotifications: !0, tournamentRecord: i, drawDefinition: M, event: s }), P.error) return { error: P.error, drawIds: [] };
14587
14587
  if (v?.withPlayoffs) {
14588
14588
  let A = M.structures?.[0].structureId, N = Am({ idPrefix: v.idPrefix, ...v.withPlayoffs, tournamentRecord: i, drawDefinition: M, structureId: A, isMock: a, event: s });
14589
14589
  if (N?.error) return N;
@@ -14772,14 +14772,14 @@ function Tf(e) {
14772
14772
  let Jt = W || Y;
14773
14773
  l && A && A <= Fe.length && te(1, A + 1).forEach((le, $e) => {
14774
14774
  let Re = { scaleName: Jt, scaleDate: m, scaleType: WI, scaleValue: le, eventType: j }, et = Fe[$e];
14775
- Hl({ tournamentRecord: l, participantId: et, scaleItem: Re });
14775
+ zl({ tournamentRecord: l, participantId: et, scaleItem: Re });
14776
14776
  });
14777
- let Pt = Jl({ ...ie(p, !1, !0), tournamentRecord: l, seedingScaleName: Jt, matchUpFormat: y, eventId: $, isMock: d, event: Q });
14777
+ let Pt = Zl({ ...ie(p, !1, !0), tournamentRecord: l, seedingScaleName: Jt, matchUpFormat: y, eventId: $, isMock: d, event: Q });
14778
14778
  if (Pt.error) return Pt;
14779
14779
  if (!Pt.drawDefinition) return { error: Zr };
14780
14780
  let { drawDefinition: de } = Pt, ot = de.drawId;
14781
14781
  if (Array.isArray(P) && P.filter(on).forEach((le) => Le({ element: de, extension: le })), T) {
14782
- if (Zl({ drawDefinition: de, event: Q, suppressNotifications: !0 }), p.withPlayoffs) {
14782
+ if (ed({ drawDefinition: de, event: Q, suppressNotifications: !0 }), p.withPlayoffs) {
14783
14783
  let $e = de.structures?.[0].structureId, Re = Am({ ...p.withPlayoffs, tournamentRecord: l, drawDefinition: de, structureId: $e, idPrefix: O, isMock: d, event: Q });
14784
14784
  if (Re?.error) return Re;
14785
14785
  }
@@ -14907,7 +14907,7 @@ function uj({ courtNameRoot: e = "Court", dateAvailability: t = [], venueAbbrevi
14907
14907
  function IS({ tournamentRecord: e, ignoreExistingVenues: t, venueProfiles: r, uuids: i }) {
14908
14908
  let { startDate: n, endDate: a } = e, s = [];
14909
14909
  for (let [o, c] of r.entries()) {
14910
- let { venueAbbreviation: u, venueId: l = i?.pop() ?? Be(), dateAvailability: d, startTime: p = "07:00", endTime: m = "19:00", courtTimings: f, courtsCount: h, courtNames: g, venueName: I, idPrefix: y, courtIds: U } = c, D = { venueName: I || `Venue ${o + 1}`, venueAbbreviation: u, venueId: l }, v = Tl({ tournamentRecord: e, venue: D });
14910
+ let { venueAbbreviation: u, venueId: l = i?.pop() ?? Be(), dateAvailability: d, startTime: p = "07:00", endTime: m = "19:00", courtTimings: f, courtsCount: h, courtNames: g, venueName: I, idPrefix: y, courtIds: U } = c, D = { venueName: I || `Venue ${o + 1}`, venueAbbreviation: u, venueId: l }, v = Pl({ tournamentRecord: e, venue: D });
14911
14911
  if (v.error) {
14912
14912
  if (t) continue;
14913
14913
  return v;
@@ -14940,12 +14940,12 @@ function lj(e) {
14940
14940
  }
14941
14941
  let P = { eventName: y, entries: d, eventType: Ge, tieFormat: D, category: h, eventId: U, gender: I };
14942
14942
  if (t.events || (t.events = []), t.events.push(P), d.length) {
14943
- let M = (ft(l.roundsCount) && l.roundsCount) ?? l.roundsCount === ik ? (v - 1) * 2 : v - 1, R = Jl({ automated: l.automated, tournamentRecord: t, drawType: zr, roundsCount: M, drawSize: v, event: P });
14943
+ let M = (ft(l.roundsCount) && l.roundsCount) ?? l.roundsCount === ik ? (v - 1) * 2 : v - 1, R = Zl({ automated: l.automated, tournamentRecord: t, drawType: zr, roundsCount: M, drawSize: v, event: P });
14944
14944
  if (R.error) return R;
14945
14945
  let { drawDefinition: E } = R;
14946
14946
  if (E) {
14947
14947
  let A = E?.drawId;
14948
- Zl({ drawDefinition: E, event: P, suppressNotifications: !0 }), a.push(A);
14948
+ ed({ drawDefinition: E, event: P, suppressNotifications: !0 }), a.push(A);
14949
14949
  }
14950
14950
  }
14951
14951
  c++;
@@ -15175,9 +15175,9 @@ function fA(e) {
15175
15175
  return { totalParticipantsCount: u.participants.length, scheduledRounds: S, schedulerResult: T, ...x, eventIds: y, venueIds: w, drawIds: U };
15176
15176
  }
15177
15177
  var hA = {};
15178
- Te(hA, { addDynamicRatings: () => Wy, addIndividualParticipantIds: () => hf, addParticipant: () => ln, addParticipants: () => ki, addPenalty: () => FA, addPersonRequests: () => vA, addPersons: () => LA, createGroupParticipant: () => MA, createTeamsFromParticipantAttributes: () => pS, deleteParticipants: () => go, filterParticipants: () => El, findParticipant: () => bA, getCompetitionParticipants: () => nU, getPairedParticipant: () => Oi, getParticipantEventDetails: () => aU, getParticipantMembership: () => sU, getParticipantScaleItem: () => ac, getParticipantSchedules: () => oU, getParticipantSignInStatus: () => cU, getParticipantTimeItem: () => xI, getParticipants: () => pt, getScaleValues: () => Dc, mergeParticipants: () => xA, modifyIndividualParticipantIds: () => wA, modifyParticipant: () => gf, modifyParticipantName: () => RA, modifyParticipantOtherName: () => TA, modifyParticipantsSignInStatus: () => DA, modifyPenalty: () => OA, modifyPersonRequests: () => UA, mutate: () => gA, participantScaleItem: () => vn, query: () => UN, regenerateParticipantNames: () => PA, removeIndividualParticipantIds: () => ty, removeParticipantIdsFromAllTeams: () => vm, removePenalty: () => AA, removePersonRequests: () => SA, removeRatings: () => EA, scaledTeamAssignment: () => NA, setParticipantScaleItem: () => Hl, setParticipantScaleItems: () => yR, validateLineUp: () => Dm });
15178
+ Te(hA, { addDynamicRatings: () => Wy, addIndividualParticipantIds: () => hf, addParticipant: () => ln, addParticipants: () => ki, addPenalty: () => FA, addPersonRequests: () => vA, addPersons: () => LA, createGroupParticipant: () => MA, createTeamsFromParticipantAttributes: () => pS, deleteParticipants: () => go, filterParticipants: () => Al, findParticipant: () => bA, getCompetitionParticipants: () => nU, getPairedParticipant: () => Oi, getParticipantEventDetails: () => aU, getParticipantMembership: () => sU, getParticipantScaleItem: () => ac, getParticipantSchedules: () => oU, getParticipantSignInStatus: () => cU, getParticipantTimeItem: () => xI, getParticipants: () => pt, getScaleValues: () => Dc, mergeParticipants: () => xA, modifyIndividualParticipantIds: () => wA, modifyParticipant: () => gf, modifyParticipantName: () => RA, modifyParticipantOtherName: () => TA, modifyParticipantsSignInStatus: () => DA, modifyPenalty: () => OA, modifyPersonRequests: () => UA, mutate: () => gA, participantScaleItem: () => vn, query: () => UN, regenerateParticipantNames: () => PA, removeIndividualParticipantIds: () => ty, removeParticipantIdsFromAllTeams: () => vm, removePenalty: () => AA, removePersonRequests: () => SA, removeRatings: () => EA, scaledTeamAssignment: () => NA, setParticipantScaleItem: () => zl, setParticipantScaleItems: () => yR, validateLineUp: () => Dm });
15179
15179
  var gA = {};
15180
- Te(gA, { addDynamicRatings: () => Wy, addIndividualParticipantIds: () => hf, addParticipant: () => ln, addParticipants: () => ki, addPenalty: () => FA, addPersonRequests: () => vA, addPersons: () => LA, createGroupParticipant: () => MA, createTeamsFromParticipantAttributes: () => pS, deleteParticipants: () => go, findParticipant: () => bA, mergeParticipants: () => xA, modifyIndividualParticipantIds: () => wA, modifyParticipant: () => gf, modifyParticipantName: () => RA, modifyParticipantOtherName: () => TA, modifyParticipantsSignInStatus: () => DA, modifyPenalty: () => OA, modifyPersonRequests: () => UA, regenerateParticipantNames: () => PA, removeIndividualParticipantIds: () => ty, removeParticipantIdsFromAllTeams: () => vm, removePenalty: () => AA, removePersonRequests: () => SA, removeRatings: () => EA, scaledTeamAssignment: () => NA, setParticipantScaleItem: () => Hl, setParticipantScaleItems: () => yR });
15180
+ Te(gA, { addDynamicRatings: () => Wy, addIndividualParticipantIds: () => hf, addParticipant: () => ln, addParticipants: () => ki, addPenalty: () => FA, addPersonRequests: () => vA, addPersons: () => LA, createGroupParticipant: () => MA, createTeamsFromParticipantAttributes: () => pS, deleteParticipants: () => go, findParticipant: () => bA, mergeParticipants: () => xA, modifyIndividualParticipantIds: () => wA, modifyParticipant: () => gf, modifyParticipantName: () => RA, modifyParticipantOtherName: () => TA, modifyParticipantsSignInStatus: () => DA, modifyPenalty: () => OA, modifyPersonRequests: () => UA, regenerateParticipantNames: () => PA, removeIndividualParticipantIds: () => ty, removeParticipantIdsFromAllTeams: () => vm, removePenalty: () => AA, removePersonRequests: () => SA, removeRatings: () => EA, scaledTeamAssignment: () => NA, setParticipantScaleItem: () => zl, setParticipantScaleItems: () => yR });
15181
15181
  function IA(e = 0) {
15182
15182
  (typeof e != "number" || isNaN(e)) && (e = 0);
15183
15183
  let t = /* @__PURE__ */ new Date();
@@ -15187,7 +15187,7 @@ function yA({ personRequests: e, personId: t, requests: r }) {
15187
15187
  e[t] || (e[t] = []);
15188
15188
  let i = r.filter(({ requestType: n }) => n).map((n) => {
15189
15189
  let { date: a, startTime: s, endTime: o } = n;
15190
- return n.requestType === id && (a = ve(a), s = nt(s), o = nt(o), a && s && o) ? { date: a, startTime: s, endTime: o, requestType: n.requestType } : n;
15190
+ return n.requestType === nd && (a = ve(a), s = nt(s), o = nt(o), a && s && o) ? { date: a, startTime: s, endTime: o, requestType: n.requestType } : n;
15191
15191
  }).filter(Boolean);
15192
15192
  for (let n of i) n.requestId = IA(), e[t].push(n);
15193
15193
  return { mergeCount: i.length };
@@ -15263,16 +15263,16 @@ function wA({ individualParticipantIds: e, groupingParticipantId: t, tournamentR
15263
15263
  function DA({ tournamentRecord: e, participantIds: t, signInState: r }) {
15264
15264
  if (!e) return { error: J };
15265
15265
  if (!Array.isArray(t)) return { error: ce };
15266
- if (![Nu, JP].includes(r)) return { error: z, signInState: r };
15266
+ if (![Eu, JP].includes(r)) return { error: z, signInState: r };
15267
15267
  let i = e.participants || [];
15268
- if (!i.length) return { error: Qu };
15268
+ if (!i.length) return { error: Ju };
15269
15269
  let n = i.map(Pe), a = t.filter((u) => !n.includes(u));
15270
15270
  if (a.length) return { error: z, context: { invalidParticipantIds: a } };
15271
15271
  let s = [], o = (/* @__PURE__ */ new Date()).toISOString();
15272
15272
  for (let u of i) {
15273
15273
  let { participantId: l } = u;
15274
15274
  if (t.includes(l)) {
15275
- let d = Ay({ duplicateValues: !1, tournamentRecord: e, participantId: l, timeItem: { itemType: pl, itemValue: r, createdAt: o } });
15275
+ let d = Ay({ duplicateValues: !1, tournamentRecord: e, participantId: l, timeItem: { itemType: ml, itemValue: r, createdAt: o } });
15276
15276
  if (d.error) return d;
15277
15277
  s.push(u);
15278
15278
  }
@@ -15532,7 +15532,7 @@ function LA({ participantRole: e = nr, tournamentRecord: t, persons: r }) {
15532
15532
  return { ...x, addedCount: m, newPersonIds: n };
15533
15533
  }
15534
15534
  var _A = {};
15535
- Te(_A, { bulkUpdatePublishedEventIds: () => hU, getAllEventData: () => gU, getCourtInfo: () => gm, getDrawData: () => Km, getEventData: () => Xm, getEventPublishStatus: () => Ui, getPublishState: () => ho, getTournamentPublishStatus: () => Nl, getVenueData: () => ic, mutate: () => BA, publishEvent: () => Vc, publishEventSeeding: () => VA, publishOrderOfPlay: () => qA, publishParticipants: () => WA, query: () => PN, setEventDisplay: () => lf, unPublishEvent: () => HA, unPublishEventSeeding: () => jA, unPublishOrderOfPlay: () => $A, unPublishParticipants: () => GA });
15535
+ Te(_A, { bulkUpdatePublishedEventIds: () => hU, getAllEventData: () => gU, getCourtInfo: () => gm, getDrawData: () => Km, getEventData: () => Xm, getEventPublishStatus: () => Ui, getPublishState: () => ho, getTournamentPublishStatus: () => El, getVenueData: () => ic, mutate: () => BA, publishEvent: () => Vc, publishEventSeeding: () => VA, publishOrderOfPlay: () => qA, publishParticipants: () => WA, query: () => PN, setEventDisplay: () => lf, unPublishEvent: () => HA, unPublishEventSeeding: () => jA, unPublishOrderOfPlay: () => $A, unPublishParticipants: () => GA });
15536
15536
  var BA = {};
15537
15537
  Te(BA, { publishEvent: () => Vc, publishEventSeeding: () => VA, publishOrderOfPlay: () => qA, publishParticipants: () => WA, setEventDisplay: () => lf, unPublishEvent: () => HA, unPublishEventSeeding: () => jA, unPublishOrderOfPlay: () => $A, unPublishParticipants: () => GA });
15538
15538
  function VA({ removePriorValues: e = !0, stageSeedingScaleNames: t, seedingScaleNames: r, tournamentRecord: i, status: n = ni, drawIds: a = [], event: s }) {
@@ -15611,7 +15611,7 @@ function Tj({ scheduledDates: e = [], removePriorValues: t, tournamentRecord: r,
15611
15611
  function HA({ removePriorValues: e = !0, tournamentRecord: t, status: r = ni, event: i }) {
15612
15612
  if (!t) return { error: J };
15613
15613
  if (!i) return { error: it };
15614
- let n = `${Aa}.${Ca}`, { timeItem: a } = ml({ itemType: n, event: i }), s = a?.itemValue || { [r]: {} };
15614
+ let n = `${Aa}.${Ca}`, { timeItem: a } = fl({ itemType: n, event: i }), s = a?.itemValue || { [r]: {} };
15615
15615
  return delete s[r].structureIds, delete s[r].drawDetails, delete s[r].drawIds, So({ event: i, timeItem: { itemValue: s, itemType: n }, removePriorValues: e }), Bc({ statusObject: { structureIds: void 0, drawIds: void 0, seeding: void 0 }, removePriorValues: e, status: r, event: i }), Ue({ topic: EI, payload: { tournamentId: t.tournamentId, eventId: i.eventId } }), { eventId: i.eventId, ...x };
15616
15616
  }
15617
15617
  var zA = {};
@@ -15673,7 +15673,7 @@ function Pj({ withCompetitiveProfiles: e, opponentParticipantId: t, withIndividu
15673
15673
  if (!E || !R || P === Jr || T === "BYE") continue;
15674
15674
  let A = I(E);
15675
15675
  if (!A.filter(Boolean).length) continue;
15676
- let N = e && M && wl({ matchUp: S })?.competitiveness;
15676
+ let N = e && M && Dl({ matchUp: S })?.competitiveness;
15677
15677
  g.push(S);
15678
15678
  let C = Ty({ matchUpStatus: T, matchUpFormat: b, tallyPolicy: s, winningSide: M, score: R }), k = kM({ matchUpStatus: T, matchUpFormat: b, tallyPolicy: s, winningSide: M, score: R }), { pointsTally: O, tiebreaksTally: L } = xM({ matchUpFormat: b, score: R });
15679
15679
  A.forEach((_, B) => {
@@ -15853,9 +15853,9 @@ function Aj(e, t, r) {
15853
15853
  }), { venueId: i, venueName: a, venueReport: s };
15854
15854
  }
15855
15855
  var YA = {};
15856
- Te(YA, { addMatchUpCourtOrder: () => JU, addMatchUpEndTime: () => eS, addMatchUpOfficial: () => OE, addMatchUpResumeTime: () => rS, addMatchUpScheduleItems: () => Uf, addMatchUpScheduledDate: () => If, addMatchUpScheduledTime: () => ka, addMatchUpStartTime: () => ZU, addMatchUpStopTime: () => tS, addSchedulingProfileRound: () => hS, allocateTeamMatchUpCourts: () => yf, assignMatchUpCourt: () => To, assignMatchUpVenue: () => $c, bulkRescheduleMatchUps: () => rC, bulkScheduleMatchUps: () => nd, bulkScheduleTournamentMatchUps: () => ju, bulkUpdateCourtAssignments: () => JA, calculateScheduleTimes: () => US, clearMatchUpSchedule: () => nC, clearScheduledMatchUps: () => vf, courtGridRows: () => tf, findMatchUpFormatTiming: () => Jm, findVenue: () => Ln, generateBookings: () => Sf, generateVirtualCourts: () => pf, getMatchUpsToSchedule: () => Qm, getPersonRequests: () => Us, getProfileRounds: () => ef, getScheduledRoundsDetails: () => Yl, getSchedulingProfile: () => oa, getSchedulingProfileIssues: () => IU, matchUpScheduleChange: () => iC, modifyMatchUpFormatTiming: () => FU, mutate: () => KA, proAutoSchedule: () => QA, proConflicts: () => eC, publicFindCourt: () => HI, query: () => EN, removeEventMatchUpFormatTiming: () => uf, removeMatchUpCourtAssignment: () => XA, reorderUpcomingMatchUps: () => tC, scheduleMatchUps: () => ZA, scheduleProfileRounds: () => wf, setMatchUpDailyLimits: () => aC, setMatchUpHomeParticipantId: () => QU, setSchedulingProfile: () => Fc, toggleParticipantCheckInState: () => ff, validateSchedulingProfile: () => Zm });
15856
+ Te(YA, { addMatchUpCourtOrder: () => JU, addMatchUpEndTime: () => eS, addMatchUpOfficial: () => OE, addMatchUpResumeTime: () => rS, addMatchUpScheduleItems: () => Uf, addMatchUpScheduledDate: () => If, addMatchUpScheduledTime: () => ka, addMatchUpStartTime: () => ZU, addMatchUpStopTime: () => tS, addSchedulingProfileRound: () => hS, allocateTeamMatchUpCourts: () => yf, assignMatchUpCourt: () => To, assignMatchUpVenue: () => $c, bulkRescheduleMatchUps: () => rC, bulkScheduleMatchUps: () => ad, bulkScheduleTournamentMatchUps: () => Gu, bulkUpdateCourtAssignments: () => JA, calculateScheduleTimes: () => US, clearMatchUpSchedule: () => nC, clearScheduledMatchUps: () => vf, courtGridRows: () => tf, findMatchUpFormatTiming: () => Jm, findVenue: () => Ln, generateBookings: () => Sf, generateVirtualCourts: () => pf, getMatchUpsToSchedule: () => Qm, getPersonRequests: () => Us, getProfileRounds: () => ef, getScheduledRoundsDetails: () => Kl, getSchedulingProfile: () => oa, getSchedulingProfileIssues: () => IU, matchUpScheduleChange: () => iC, modifyMatchUpFormatTiming: () => FU, mutate: () => KA, proAutoSchedule: () => QA, proConflicts: () => eC, publicFindCourt: () => HI, query: () => EN, removeEventMatchUpFormatTiming: () => uf, removeMatchUpCourtAssignment: () => XA, reorderUpcomingMatchUps: () => tC, scheduleMatchUps: () => ZA, scheduleProfileRounds: () => wf, setMatchUpDailyLimits: () => aC, setMatchUpHomeParticipantId: () => QU, setSchedulingProfile: () => Fc, toggleParticipantCheckInState: () => ff, validateSchedulingProfile: () => Zm });
15857
15857
  var KA = {};
15858
- Te(KA, { addMatchUpCourtOrder: () => JU, addMatchUpEndTime: () => eS, addMatchUpOfficial: () => OE, addMatchUpResumeTime: () => rS, addMatchUpScheduleItems: () => Uf, addMatchUpScheduledDate: () => If, addMatchUpScheduledTime: () => ka, addMatchUpStartTime: () => ZU, addMatchUpStopTime: () => tS, addSchedulingProfileRound: () => hS, allocateTeamMatchUpCourts: () => yf, assignMatchUpCourt: () => To, assignMatchUpVenue: () => $c, bulkRescheduleMatchUps: () => rC, bulkScheduleMatchUps: () => nd, bulkScheduleTournamentMatchUps: () => ju, bulkUpdateCourtAssignments: () => JA, calculateScheduleTimes: () => US, clearMatchUpSchedule: () => nC, clearScheduledMatchUps: () => vf, findMatchUpFormatTiming: () => Jm, generateBookings: () => Sf, generateVirtualCourts: () => pf, matchUpScheduleChange: () => iC, modifyMatchUpFormatTiming: () => FU, proAutoSchedule: () => QA, proConflicts: () => eC, removeEventMatchUpFormatTiming: () => uf, removeMatchUpCourtAssignment: () => XA, reorderUpcomingMatchUps: () => tC, scheduleMatchUps: () => ZA, scheduleProfileRounds: () => wf, setMatchUpDailyLimits: () => aC, setMatchUpHomeParticipantId: () => QU, setSchedulingProfile: () => Fc, toggleParticipantCheckInState: () => ff, validateSchedulingProfile: () => Zm });
15858
+ Te(KA, { addMatchUpCourtOrder: () => JU, addMatchUpEndTime: () => eS, addMatchUpOfficial: () => OE, addMatchUpResumeTime: () => rS, addMatchUpScheduleItems: () => Uf, addMatchUpScheduledDate: () => If, addMatchUpScheduledTime: () => ka, addMatchUpStartTime: () => ZU, addMatchUpStopTime: () => tS, addSchedulingProfileRound: () => hS, allocateTeamMatchUpCourts: () => yf, assignMatchUpCourt: () => To, assignMatchUpVenue: () => $c, bulkRescheduleMatchUps: () => rC, bulkScheduleMatchUps: () => ad, bulkScheduleTournamentMatchUps: () => Gu, bulkUpdateCourtAssignments: () => JA, calculateScheduleTimes: () => US, clearMatchUpSchedule: () => nC, clearScheduledMatchUps: () => vf, findMatchUpFormatTiming: () => Jm, generateBookings: () => Sf, generateVirtualCourts: () => pf, matchUpScheduleChange: () => iC, modifyMatchUpFormatTiming: () => FU, proAutoSchedule: () => QA, proConflicts: () => eC, removeEventMatchUpFormatTiming: () => uf, removeMatchUpCourtAssignment: () => XA, reorderUpcomingMatchUps: () => tC, scheduleMatchUps: () => ZA, scheduleProfileRounds: () => wf, setMatchUpDailyLimits: () => aC, setMatchUpHomeParticipantId: () => QU, setSchedulingProfile: () => Fc, toggleParticipantCheckInState: () => ff, validateSchedulingProfile: () => Zm });
15859
15859
  function US({ calculateStartTimeFromCourts: e = !0, defaultRecoveryMinutes: t = 0, averageMatchUpMinutes: r = 90, remainingScheduleTimes: i, clearScheduleDates: n, tournamentRecords: a, periodLength: s, scheduleDate: o, startTime: c, venueIds: u, endTime: l }) {
15860
15860
  if (typeof a != "object" || !Object.keys(a).length) return { error: mt };
15861
15861
  s = s ?? mf({ recoveryMinutes: t, averageMatchUpMinutes: r });
@@ -15868,9 +15868,9 @@ function US({ calculateStartTimeFromCourts: e = !0, defaultRecoveryMinutes: t =
15868
15868
  return R && (!P || ke(R) > ke(P)) ? R : P;
15869
15869
  }, void 0));
15870
15870
  let f = Object.values(a), h = Object.assign({}, ...f.map((P) => (P.events ?? []).map((M) => {
15871
- let { scheduleTiming: R } = fl({ tournamentRecord: P, event: M });
15871
+ let { scheduleTiming: R } = hl({ tournamentRecord: P, event: M });
15872
15872
  return { [M.eventId]: { event: M, scheduleTiming: R } };
15873
- })).flat()), g = Ql({ sortDateMatchUps: !1, tournamentRecords: a, matchUpFilters: { scheduledDate: o, venueIds: u } }), I = g?.dateMatchUps ?? [], y = g?.completedMatchUps ?? [], U = [];
15873
+ })).flat()), g = Jl({ sortDateMatchUps: !1, tournamentRecords: a, matchUpFilters: { scheduledDate: o, venueIds: u } }), I = g?.dateMatchUps ?? [], y = g?.completedMatchUps ?? [], U = [];
15874
15874
  U.push(...I), U.push(...y);
15875
15875
  let D = { averageTimes: [{ minutes: { default: r } }], recoveryTimes: [{ minutes: { default: t } }] }, v = U?.map(({ eventId: P, schedule: M, matchUpFormat: R }) => {
15876
15876
  let { event: E, scheduleTiming: A } = h[P], N = E?.eventType, C = { ...A, defaultTiming: D, matchUpFormat: R }, { averageMinutes: k, recoveryMinutes: O } = hm({ eventType: N, timingDetails: C }), { courtId: L, venueId: _ } = M, B = nt(M.scheduledTime), G = Or(B, k);
@@ -15895,7 +15895,7 @@ function XA(e) {
15895
15895
  function QA({ scheduleCompletedMatchUps: e, tournamentRecords: t, scheduledDate: r, matchUps: i }) {
15896
15896
  if (!yi(i)) return { error: z };
15897
15897
  if (i.some(({ hasContext: m }) => !m)) return { info: "matchUps must have { inContext: true, nextMatchUps: true }", error: Op };
15898
- let n = Ql({ courtCompletedMatchUps: !0, withCourtGridRows: !0, minCourtGridRows: 10, tournamentRecords: t, matchUpFilters: { localPerspective: !0, scheduledDate: r } });
15898
+ let n = Jl({ courtCompletedMatchUps: !0, withCourtGridRows: !0, minCourtGridRows: 10, tournamentRecords: t, matchUpFilters: { localPerspective: !0, scheduledDate: r } });
15899
15899
  if (n.error) return n;
15900
15900
  let { rows: a } = n, s = [], o = (m) => [(m.sides || []).map((f) => [f.participantId, f.participant?.individualParticipantIds]), (m.potentialParticipants || []).flat().map((f) => [f.participantId, f.individualParticipantIds])].flat(1 / 0).filter(Boolean), c = a?.reduce((m, f) => {
15901
15901
  let h = [], g = [];
@@ -15922,7 +15922,7 @@ function QA({ scheduleCompletedMatchUps: e, tournamentRecords: t, scheduledDate:
15922
15922
  i.push(...f), d.push(...m.matchUpIds);
15923
15923
  }
15924
15924
  let p = l.map(({ matchUpId: m, tournamentId: f, schedule: h, drawId: g }) => ({ tournamentId: f, matchUpId: m, drawId: g, schedule: { ...h, scheduledDate: r } }));
15925
- return n = nd({ tournamentRecords: t, matchUpDetails: p }), { ...n, scheduled: l, notScheduled: i };
15925
+ return n = ad({ tournamentRecords: t, matchUpDetails: p }), { ...n, scheduled: l, notScheduled: i };
15926
15926
  }
15927
15927
  function JA(e) {
15928
15928
  let { courtDayDate: t } = e, r = se(e, [{ courtAssignments: !0, [Er]: cr, [ti]: ce }, { [pr]: !0 }]);
@@ -15949,7 +15949,7 @@ function JA(e) {
15949
15949
  }), n || x;
15950
15950
  }
15951
15951
  function ZA(e) {
15952
- let { tournamentRecords: t, allDateMatchUpIds: r = [], averageMatchUpMinutes: i = 90, recoveryMinutes: n = 0, recoveryMinutesMap: a, matchUpPotentialParticipantIds: s = {}, individualParticipantProfiles: o = {}, matchUpNotBeforeTimes: c = {}, matchUpDailyLimits: u = {}, checkPotentialRequestConflicts: l = !0, remainingScheduleTimes: d, clearScheduleDates: p, periodLength: m = 30, scheduleDate: f, matchUpIds: h, venueIds: g, startTime: I, endTime: y, dryRun: U } = e, D = se(e, [{ [pr]: !0, [ol]: !0 }, { [ir]: kr, [ti]: Ht, [ok]: !0 }, { [ir]: (V) => !V || !isNaN(V), [dk]: !1, [ti]: z, [pk]: !1, [mk]: !1 }]);
15952
+ let { tournamentRecords: t, allDateMatchUpIds: r = [], averageMatchUpMinutes: i = 90, recoveryMinutes: n = 0, recoveryMinutesMap: a, matchUpPotentialParticipantIds: s = {}, individualParticipantProfiles: o = {}, matchUpNotBeforeTimes: c = {}, matchUpDailyLimits: u = {}, checkPotentialRequestConflicts: l = !0, remainingScheduleTimes: d, clearScheduleDates: p, periodLength: m = 30, scheduleDate: f, matchUpIds: h, venueIds: g, startTime: I, endTime: y, dryRun: U } = e, D = se(e, [{ [pr]: !0, [cl]: !0 }, { [ir]: kr, [ti]: Ht, [ok]: !0 }, { [ir]: (V) => !V || !isNaN(V), [dk]: !1, [ti]: z, [pk]: !1, [mk]: !1 }]);
15953
15953
  if (D.error) return D;
15954
15954
  let v = e.competitionMatchUps ?? Hi({ nextMatchUps: !0, tournamentRecords: t }).matchUps ?? [], w = e.matchUpDependencies ?? Li({ includeParticipantDependencies: !0, matchUps: v, tournamentRecords: t }).matchUpDependencies;
15955
15955
  v.forEach((V) => {
@@ -15962,7 +15962,7 @@ function ZA(e) {
15962
15962
  if (H) {
15963
15963
  E[V.matchUpId] = H;
15964
15964
  let W = a?.[V.matchUpId];
15965
- Vu({ recoveryMinutes: W || n, matchUpPotentialParticipantIds: s, individualParticipantProfiles: o, matchUpNotBeforeTimes: c, averageMatchUpMinutes: i, matchUpDependencies: w, scheduleTime: H, matchUp: V });
15965
+ ju({ recoveryMinutes: W || n, matchUpPotentialParticipantIds: s, individualParticipantProfiles: o, matchUpNotBeforeTimes: c, averageMatchUpMinutes: i, matchUpDependencies: w, scheduleTime: H, matchUp: V });
15966
15966
  }
15967
15967
  });
15968
15968
  let C = S.filter((V) => {
@@ -15971,13 +15971,13 @@ function ZA(e) {
15971
15971
  }), { matchUpMap: k, overLimitMatchUpIds: O, participantIdsAtLimit: L } = C.reduce((V, H) => {
15972
15972
  let { drawId: W, tournamentId: Y, matchUpType: q } = H, { participantIdsAtLimit: K, relevantParticipantIds: X } = dS({ individualParticipantProfiles: o, matchUpPotentialParticipantIds: s, matchUpDailyLimits: u, matchUp: H });
15973
15973
  return K?.length ? (V.overLimitMatchUpIds.push(H.matchUpId), V.participantIdsAtLimit.push(...K), V) : (X.forEach((Q) => {
15974
- rd({ individualParticipantProfiles: o, participantId: Q });
15974
+ id({ individualParticipantProfiles: o, participantId: Q });
15975
15975
  let Z = o[Q].counters;
15976
15976
  Z[q] ? Z[q] += 1 : Z[q] = 1, Z[Ni] ? Z[Ni] += 1 : Z[Ni] = 1;
15977
15977
  }), V.matchUpMap[Y] || (V.matchUpMap[Y] = {}), V.matchUpMap[Y][W] ? V.matchUpMap[Y][W].push(H) : V.matchUpMap[Y][W] = [H], oc({ matchUpPotentialParticipantIds: s, matchUpNotBeforeTimes: c, matchUp: H }), V);
15978
15978
  }, { matchUpMap: {}, overLimitMatchUpIds: [], participantIdsAtLimit: [] });
15979
15979
  C = C.filter(({ matchUpId: V }) => !O.includes(V));
15980
- let _ = 0, B = b?.length ?? 0, { personRequests: G } = Us({ tournamentRecords: t, requestType: id });
15980
+ let _ = 0, B = b?.length ?? 0, { personRequests: G } = Us({ tournamentRecords: t, requestType: nd });
15981
15981
  for (; b?.length && C.length && _ <= B; ) {
15982
15982
  _++;
15983
15983
  let { scheduleTime: V } = b.shift(), H = C.find((W) => {
@@ -15988,7 +15988,7 @@ function ZA(e) {
15988
15988
  let { conflicts: Q } = uS({ potentials: l, averageMatchUpMinutes: i, requestConflicts: M, personRequests: G, scheduleTime: V, scheduleDate: f, matchUp: W });
15989
15989
  if (Q?.length) return !1;
15990
15990
  let Z = a?.[W.matchUpId];
15991
- return Vu({ recoveryMinutes: Z || n, matchUpPotentialParticipantIds: s, individualParticipantProfiles: o, matchUpNotBeforeTimes: c, averageMatchUpMinutes: i, matchUpDependencies: w, scheduleTime: V, matchUp: W }), E[W.matchUpId] = V, !0;
15991
+ return ju({ recoveryMinutes: Z || n, matchUpPotentialParticipantIds: s, individualParticipantProfiles: o, matchUpNotBeforeTimes: c, averageMatchUpMinutes: i, matchUpDependencies: w, scheduleTime: V, matchUp: W }), E[W.matchUpId] = V, !0;
15992
15992
  });
15993
15993
  C = C.filter(({ matchUpId: W }) => W !== H?.matchUpId), H || R.push(V);
15994
15994
  }
@@ -16107,7 +16107,7 @@ function Cj({ tournamentRecord: e, scheduleChange: t, matchUpIds: r, dryRun: i }
16107
16107
  if (!s && !o) return { ...x };
16108
16108
  if (s && isNaN(s)) return { error: z };
16109
16109
  if (o && isNaN(o)) return { error: z };
16110
- let { matchUps: c } = Qt({ matchUpFilters: { matchUpIds: r }, tournamentRecord: e }), u = ({ matchUpStatus: D }) => !xt.includes(D), l = c?.filter((D) => Xl({ schedule: D.schedule })).filter((D) => u({ matchUpStatus: D.matchUpStatus }));
16110
+ let { matchUps: c } = Qt({ matchUpFilters: { matchUpIds: r }, tournamentRecord: e }), u = ({ matchUpStatus: D }) => !xt.includes(D), l = c?.filter((D) => Ql({ schedule: D.schedule })).filter((D) => u({ matchUpStatus: D.matchUpStatus }));
16111
16111
  if (!l?.length) return { ...x };
16112
16112
  let { tournamentInfo: d } = wo({ tournamentRecord: e }), { startDate: p, endDate: m } = d, f = l?.reduce((D, v) => {
16113
16113
  let { matchUpId: w, drawId: S } = v;
@@ -16121,7 +16121,7 @@ function Cj({ tournamentRecord: e, scheduleChange: t, matchUpIds: r, dryRun: i }
16121
16121
  let b = l.find((N) => N.matchUpId === T)?.schedule, { scheduledTime: P, scheduledDate: M } = b, R, E, A;
16122
16122
  if (!R && o && M) {
16123
16123
  let N = ve(M);
16124
- A = Qc(N, o), R = new Date(A) < new Date(p) || new Date(A) > new Date(m);
16124
+ A = Jc(N, o), R = new Date(A) < new Date(p) || new Date(A) > new Date(m);
16125
16125
  }
16126
16126
  if (s && P) {
16127
16127
  let N = ve(P), C = ke(nt(P)) + s;
@@ -16187,13 +16187,13 @@ function aC(e) {
16187
16187
  let a = Object.keys(n).filter((s) => !r || r === s);
16188
16188
  if (r && !a.includes(r)) return { error: z };
16189
16189
  for (let s of a) {
16190
- let o = n[s], c = Le({ extension: { name: ul, value: { dailyLimits: i } }, element: o });
16190
+ let o = n[s], c = Le({ extension: { name: ll, value: { dailyLimits: i } }, element: o });
16191
16191
  if (c.error) return c;
16192
16192
  }
16193
16193
  return { ...x };
16194
16194
  }
16195
16195
  var sC = {};
16196
- Te(sC, { addCollectionDefinition: () => wS, addCollectionGroup: () => pC, aggregateTieFormats: () => fC, compareTieFormats: () => Zn, getTieFormat: () => Ym, modifyCollectionDefinition: () => SS, modifyTieFormat: () => mC, mutate: () => oC, orderCollectionDefinitions: () => lC, query: () => DN, removeCollectionDefinition: () => vS, removeCollectionGroup: () => uC, tieFormatGenderValidityCheck: () => jp, validateCollectionDefinition: () => il });
16196
+ Te(sC, { addCollectionDefinition: () => wS, addCollectionGroup: () => pC, aggregateTieFormats: () => fC, compareTieFormats: () => Zn, getTieFormat: () => Ym, modifyCollectionDefinition: () => SS, modifyTieFormat: () => mC, mutate: () => oC, orderCollectionDefinitions: () => lC, query: () => DN, removeCollectionDefinition: () => vS, removeCollectionGroup: () => uC, tieFormatGenderValidityCheck: () => jp, validateCollectionDefinition: () => nl });
16197
16197
  var oC = {};
16198
16198
  Te(oC, { addCollectionDefinition: () => wS, addCollectionGroup: () => pC, aggregateTieFormats: () => fC, modifyCollectionDefinition: () => SS, modifyTieFormat: () => mC, orderCollectionDefinitions: () => lC, removeCollectionDefinition: () => vS, removeCollectionGroup: () => uC });
16199
16199
  function is({ drawDefinition: e, structureId: t, matchUpId: r, structure: i, matchUp: n, eventId: a, event: s }) {
@@ -16207,14 +16207,14 @@ function is({ drawDefinition: e, structureId: t, matchUpId: r, structure: i, mat
16207
16207
  if (u.matchUp?.matchUpType !== Jr) return F({ result: { error: xr }, stack: o });
16208
16208
  i || (i = u.structure), n || (n = u.matchUp);
16209
16209
  }
16210
- c = iu({ item: n, drawDefinition: e, structure: i, event: s }) || iu({ item: i, drawDefinition: e, structure: i, event: s }) || Ki(e) || Ki(s);
16210
+ c = nu({ item: n, drawDefinition: e, structure: i, event: s }) || nu({ item: i, drawDefinition: e, structure: i, event: s }) || Ki(e) || Ki(s);
16211
16211
  } else if (e && t) {
16212
16212
  if (!i) {
16213
16213
  let u = me({ drawDefinition: e, structureId: t });
16214
16214
  if (u.error) return u;
16215
16215
  i = u?.structure;
16216
16216
  }
16217
- c = iu({ item: i, drawDefinition: e, structure: i, event: s }) || Ki(e) || Ki(s);
16217
+ c = nu({ item: i, drawDefinition: e, structure: i, event: s }) || Ki(e) || Ki(s);
16218
16218
  } else c = Ki(e) || Ki(s);
16219
16219
  return c ? { ...x, structure: i, tieFormat: c, matchUp: n } : F({ result: { error: gc }, stack: o });
16220
16220
  }
@@ -16282,7 +16282,7 @@ function Oj({ updateInProgressMatchUps: e, tournamentRecord: t, drawDefinition:
16282
16282
  let P = [], M = [];
16283
16283
  return b.forEach((R) => {
16284
16284
  if (R.countChange > 0) {
16285
- let E = Math.max(0, ...S.tieMatchUps.filter((C) => C.collectionId === R.collectionId).map(Kr("collectionPosition"))), A = T.collectionDefinitions.find((C) => C.collectionId === R.collectionId), N = Ll({ matchUpsLimit: R.countChange, collectionPositionOffset: E, collectionDefinition: A, matchUp: S, uuids: w });
16285
+ let E = Math.max(0, ...S.tieMatchUps.filter((C) => C.collectionId === R.collectionId).map(Kr("collectionPosition"))), A = T.collectionDefinitions.find((C) => C.collectionId === R.collectionId), N = _l({ matchUpsLimit: R.countChange, collectionPositionOffset: E, collectionDefinition: A, matchUp: S, uuids: w });
16286
16286
  M.push(...ie(N, !1, !0)), m += M.length, S.tieMatchUps.push(...N);
16287
16287
  } else {
16288
16288
  let E = R.toBePlayedTieMatchUpIds.slice(0, Math.abs(R.countChange));
@@ -16299,8 +16299,8 @@ function Xv({ check: e, matchUp: t }) {
16299
16299
  }), changes: i, cannotChangeReaon: r };
16300
16300
  }
16301
16301
  function bf({ appliedPolicies: e, drawDefinition: t, auditData: r }) {
16302
- if (!e?.audit?.[tu]) return;
16303
- let { extension: i } = De({ name: tu, element: t }), n = { value: Array.isArray(i?.value) ? i?.value.concat(r) : [r], name: tu };
16302
+ if (!e?.audit?.[ru]) return;
16303
+ let { extension: i } = De({ name: ru, element: t }), n = { value: Array.isArray(i?.value) ? i?.value.concat(r) : [r], name: ru };
16304
16304
  Le({ element: t, extension: n });
16305
16305
  }
16306
16306
  function SS({ updateInProgressMatchUps: e = !1, tournamentRecord: t, collectionOrder: r, collectionName: i, tieFormatName: n, drawDefinition: a, matchUpFormat: s, matchUpCount: o, collectionId: c, matchUpType: u, structureId: l, matchUpId: d, category: p, eventId: m, gender: f, event: h, collectionValueProfiles: g, collectionValue: I, matchUpValue: y, scoreValue: U, setValue: D }) {
@@ -16511,7 +16511,7 @@ function pC({ updateInProgressMatchUps: e = !0, tournamentRecord: t, groupDefini
16511
16511
  function wS({ updateInProgressMatchUps: e = !0, collectionDefinition: t, referenceCategory: r, tournamentRecord: i, policyDefinitions: n, enforceCategory: a, referenceGender: s, drawDefinition: o, tieFormatName: c, enforceGender: u, structureId: l, matchUpId: d, matchUp: p, eventId: m, uuids: f, event: h }) {
16512
16512
  let g = "addCollectionDefinition", I = xe({ tournamentRecord: i, drawDefinition: o, event: h }).appliedPolicies ?? {}, y = n?.[Yt] ?? I?.[Yt];
16513
16513
  a = a ?? y?.participants?.enforceCategory;
16514
- let U = (u ?? y?.participants?.enforceGender) !== !1, D = !!((r ?? h?.category) && a !== !1), v = !!((s ?? h?.gender) && U), w = il({ referenceCategory: r ?? h?.category, collectionDefinition: t, referenceGender: s, checkCategory: D, checkGender: v, event: h });
16514
+ let U = (u ?? y?.participants?.enforceGender) !== !1, D = !!((r ?? h?.category) && a !== !1), v = !!((s ?? h?.gender) && U), w = nl({ referenceCategory: r ?? h?.category, collectionDefinition: t, referenceGender: s, checkCategory: D, checkGender: v, event: h });
16515
16515
  if (w.error) return F({ result: w, stack: g });
16516
16516
  let S = p?.tieFormat ? void 0 : is({ drawDefinition: o, structureId: l, matchUpId: d, eventId: m, event: h });
16517
16517
  if (S?.error) return F({ result: { error: S.error }, stack: g });
@@ -16535,23 +16535,23 @@ function wS({ updateInProgressMatchUps: e = !0, collectionDefinition: t, referen
16535
16535
  let G = zf({ updateInProgressMatchUps: e, collectionDefinition: t, structure: B, uuids: f });
16536
16536
  C.push(...G.newMatchUps), k.push(...G.targetMatchUps), N.push(B.structureId);
16537
16537
  }
16538
- dd({ modifiedMatchUps: k, eventId: h?.eventId, modifiedStructureIds: N, tournamentRecord: i, drawDefinition: o, addedMatchUps: C, stack: g });
16538
+ pd({ modifiedMatchUps: k, eventId: h?.eventId, modifiedStructureIds: N, tournamentRecord: i, drawDefinition: o, addedMatchUps: C, stack: g });
16539
16539
  } else if (l && T) {
16540
16540
  T.tieFormat = O;
16541
16541
  let _ = zf({ updateInProgressMatchUps: e, collectionDefinition: t, structure: T, uuids: f });
16542
- C.push(..._.newMatchUps), k = _.targetMatchUps, dd({ modifiedMatchUps: k, eventId: h?.eventId, modifiedStructureIds: N, tournamentRecord: i, drawDefinition: o, addedMatchUps: C, stack: g });
16542
+ C.push(..._.newMatchUps), k = _.targetMatchUps, pd({ modifiedMatchUps: k, eventId: h?.eventId, modifiedStructureIds: N, tournamentRecord: i, drawDefinition: o, addedMatchUps: C, stack: g });
16543
16543
  } else if (d && p) {
16544
16544
  if (!gp({ matchUp: p, updateInProgressMatchUps: e })) return F({ result: { error: bg }, stack: g });
16545
16545
  p.tieFormat = O;
16546
- let _ = Ll({ collectionDefinition: t, matchUp: p, uuids: f });
16547
- Array.isArray(p.tieMatchUps) || (p.tieMatchUps = []), p.tieMatchUps.push(..._), C.push(..._), dd({ modifiedMatchUps: [p], eventId: h?.eventId, modifiedStructureIds: N, tournamentRecord: i, drawDefinition: o, addedMatchUps: C, stack: g });
16546
+ let _ = _l({ collectionDefinition: t, matchUp: p, uuids: f });
16547
+ Array.isArray(p.tieMatchUps) || (p.tieMatchUps = []), p.tieMatchUps.push(..._), C.push(..._), pd({ modifiedMatchUps: [p], eventId: h?.eventId, modifiedStructureIds: N, tournamentRecord: i, drawDefinition: o, addedMatchUps: C, stack: g });
16548
16548
  } else if (o) {
16549
16549
  o.tieFormat = O;
16550
16550
  for (let _ of o.structures ?? []) {
16551
16551
  let B = zf({ updateInProgressMatchUps: e, collectionDefinition: t, structure: _, uuids: f });
16552
16552
  N.push(_.structureId), C.push(...B.newMatchUps), k.push(...B.targetMatchUps);
16553
16553
  }
16554
- dd({ modifiedMatchUps: k, eventId: h?.eventId, tournamentRecord: i, drawDefinition: o, addedMatchUps: C, stack: g });
16554
+ pd({ modifiedMatchUps: k, eventId: h?.eventId, tournamentRecord: i, drawDefinition: o, addedMatchUps: C, stack: g });
16555
16555
  } else return { error: ne };
16556
16556
  let L = ae({ drawId: o?.drawId, collectionDefinition: t, action: g, structureId: l, matchUpId: d, eventId: m });
16557
16557
  return bf({ appliedPolicies: I, drawDefinition: o, auditData: L }), { tieFormat: O, targetMatchUps: k, addedMatchUps: C, ...x };
@@ -16559,12 +16559,12 @@ function wS({ updateInProgressMatchUps: e = !0, collectionDefinition: t, referen
16559
16559
  function zf({ updateInProgressMatchUps: e, collectionDefinition: t, structure: r, uuids: i }) {
16560
16560
  let n = [], a = (_e({ matchUpFilters: { matchUpTypes: [rt] }, structure: r })?.matchUps).filter((s) => gp({ matchUp: s, updateInProgressMatchUps: e }) && !s.tieFormat);
16561
16561
  for (let s of a) {
16562
- let o = Ll({ collectionDefinition: t, matchUp: s, uuids: i });
16562
+ let o = _l({ collectionDefinition: t, matchUp: s, uuids: i });
16563
16563
  Array.isArray(s.tieMatchUps) || (s.tieMatchUps = []), s.tieMatchUps.push(...o), n.push(...o);
16564
16564
  }
16565
16565
  return { newMatchUps: n, targetMatchUps: a };
16566
16566
  }
16567
- function dd({ modifiedStructureIds: e, tournamentRecord: t, modifiedMatchUps: r, drawDefinition: i, addedMatchUps: n, eventId: a, stack: s }) {
16567
+ function pd({ modifiedStructureIds: e, tournamentRecord: t, modifiedMatchUps: r, drawDefinition: i, addedMatchUps: n, eventId: a, stack: s }) {
16568
16568
  Ua({ tournamentId: t?.tournamentId, matchUps: n, drawDefinition: i, eventId: a }), r?.forEach((o) => {
16569
16569
  Ee({ tournamentId: t?.tournamentId, drawDefinition: i, context: s, matchUp: o, eventId: a });
16570
16570
  }), Je({ structureIds: e, drawDefinition: i, eventId: a });
@@ -16632,7 +16632,7 @@ function fC({ tournamentRecord: e }) {
16632
16632
  return { ...x, addedCount: t };
16633
16633
  }
16634
16634
  var hC = {};
16635
- Te(hC, { addDrawDefinitionExtension: () => em, addEventExtension: () => Ra, addEventTimeItem: () => So, addExtension: () => Le, addNotes: () => Rm, addOnlineResource: () => DC, addParticipantExtension: () => TP, addParticipantTimeItem: () => Ay, addTimeItem: () => fn, addTournamentExtension: () => pI, addTournamentTimeItem: () => Gl, analyzeDraws: () => $l, analyzeTournament: () => mU, copyTournamentRecord: () => IC, createTournamentRecord: () => Df, generate: () => gC, getAggregateTeamResults: () => pU, getAllowedDrawTypes: () => Wm, getAllowedMatchUpFormats: () => uU, getAppliedPolicies: () => xe, getCompetitionDateRange: () => Hm, getCompetitionPenalties: () => lU, getPolicyDefinitions: () => ia, getTournamentInfo: () => wo, getTournamentPenalties: () => qm, getTournamentPersons: () => dU, getTournamentPoints: () => zm, getTournamentStructures: () => py, getTournamentTimeItem: () => dm, hydrateTournamentRecord: () => UC, mutate: () => yC, query: () => SN, removeDrawDefinitionExtension: () => PP, removeEventExtension: () => tm, removeExtension: () => yr, removeNotes: () => My, removeOnlineResource: () => wC, removeParticipantExtension: () => bP, removeTournamentExtension: () => mI, setTournamentCategories: () => bC, setTournamentDates: () => Mf, setTournamentEndDate: () => RC, setTournamentName: () => TC, setTournamentNotes: () => PC, setTournamentStartDate: () => MC, setTournamentStatus: () => vC });
16635
+ Te(hC, { addDrawDefinitionExtension: () => em, addEventExtension: () => Ra, addEventTimeItem: () => So, addExtension: () => Le, addNotes: () => Rm, addOnlineResource: () => DC, addParticipantExtension: () => TP, addParticipantTimeItem: () => Ay, addTimeItem: () => fn, addTournamentExtension: () => pI, addTournamentTimeItem: () => $l, analyzeDraws: () => Wl, analyzeTournament: () => mU, copyTournamentRecord: () => IC, createTournamentRecord: () => Df, generate: () => gC, getAggregateTeamResults: () => pU, getAllowedDrawTypes: () => Wm, getAllowedMatchUpFormats: () => uU, getAppliedPolicies: () => xe, getCompetitionDateRange: () => Hm, getCompetitionPenalties: () => lU, getPolicyDefinitions: () => ia, getTournamentInfo: () => wo, getTournamentPenalties: () => qm, getTournamentPersons: () => dU, getTournamentPoints: () => zm, getTournamentStructures: () => py, getTournamentTimeItem: () => dm, hydrateTournamentRecord: () => UC, mutate: () => yC, query: () => SN, removeDrawDefinitionExtension: () => PP, removeEventExtension: () => tm, removeExtension: () => yr, removeNotes: () => My, removeOnlineResource: () => wC, removeParticipantExtension: () => bP, removeTournamentExtension: () => mI, setTournamentCategories: () => bC, setTournamentDates: () => Mf, setTournamentEndDate: () => RC, setTournamentName: () => TC, setTournamentNotes: () => PC, setTournamentStartDate: () => MC, setTournamentStatus: () => vC });
16636
16636
  var gC = {};
16637
16637
  Te(gC, { copyTournamentRecord: () => IC, createTournamentRecord: () => Df });
16638
16638
  function IC(e) {
@@ -16648,7 +16648,7 @@ function IC(e) {
16648
16648
  return { ...x, tournamentRecord: d };
16649
16649
  }
16650
16650
  var yC = {};
16651
- Te(yC, { addDrawDefinitionExtension: () => em, addEventExtension: () => Ra, addEventTimeItem: () => So, addExtension: () => Le, addNotes: () => Rm, addOnlineResource: () => DC, addParticipantExtension: () => TP, addParticipantTimeItem: () => Ay, addTimeItem: () => fn, addTournamentExtension: () => pI, addTournamentTimeItem: () => Gl, hydrateTournamentRecord: () => UC, removeDrawDefinitionExtension: () => PP, removeEventExtension: () => tm, removeExtension: () => yr, removeNotes: () => My, removeOnlineResource: () => wC, removeParticipantExtension: () => bP, removeTournamentExtension: () => mI, setTournamentCategories: () => bC, setTournamentDates: () => Mf, setTournamentEndDate: () => RC, setTournamentName: () => TC, setTournamentNotes: () => PC, setTournamentStartDate: () => MC, setTournamentStatus: () => vC });
16651
+ Te(yC, { addDrawDefinitionExtension: () => em, addEventExtension: () => Ra, addEventTimeItem: () => So, addExtension: () => Le, addNotes: () => Rm, addOnlineResource: () => DC, addParticipantExtension: () => TP, addParticipantTimeItem: () => Ay, addTimeItem: () => fn, addTournamentExtension: () => pI, addTournamentTimeItem: () => $l, hydrateTournamentRecord: () => UC, removeDrawDefinitionExtension: () => PP, removeEventExtension: () => tm, removeExtension: () => yr, removeNotes: () => My, removeOnlineResource: () => wC, removeParticipantExtension: () => bP, removeTournamentExtension: () => mI, setTournamentCategories: () => bC, setTournamentDates: () => Mf, setTournamentEndDate: () => RC, setTournamentName: () => TC, setTournamentNotes: () => PC, setTournamentStartDate: () => MC, setTournamentStatus: () => vC });
16652
16652
  function UC(e) {
16653
16653
  let { tournamentRecord: t, eventProfiles: r = [], directives: i, policyDefinitions: n } = e;
16654
16654
  return t ? ((t.events || []).forEach((a) => {
@@ -16783,11 +16783,11 @@ function Gj({ tournamentRecord: e }) {
16783
16783
  return n.length && !vf({ scheduledDates: n, tournamentRecord: e }).clearedScheduleCount ? { error: Zw } : { unscheduledMatchUpIds: a };
16784
16784
  }
16785
16785
  var NC = {};
16786
- Te(NC, { addCourt: () => Pf, addCourts: () => gS, addVenue: () => Tl, deleteCourt: () => _C, deleteVenue: () => bS, deleteVenues: () => OC, disableCourts: () => kC, disableVenues: () => xC, enableCourts: () => FC, enableVenues: () => LC, generate: () => EC, generateCourts: () => WU, getCompetitionVenues: () => zl, getCourts: () => EU, getVenuesAndCourts: () => sa, modifyCourt: () => MS, modifyCourtAvailability: () => TS, modifyVenue: () => BC, mutate: () => AC, publicFindVenue: () => qI, query: () => LN });
16786
+ Te(NC, { addCourt: () => Pf, addCourts: () => gS, addVenue: () => Pl, deleteCourt: () => _C, deleteVenue: () => bS, deleteVenues: () => OC, disableCourts: () => kC, disableVenues: () => xC, enableCourts: () => FC, enableVenues: () => LC, generate: () => EC, generateCourts: () => WU, getCompetitionVenues: () => Yl, getCourts: () => EU, getVenuesAndCourts: () => sa, modifyCourt: () => MS, modifyCourtAvailability: () => TS, modifyVenue: () => BC, mutate: () => AC, publicFindVenue: () => qI, query: () => LN });
16787
16787
  var EC = {};
16788
16788
  Te(EC, { generateCourts: () => WU });
16789
16789
  var AC = {};
16790
- Te(AC, { addCourt: () => Pf, addCourts: () => gS, addVenue: () => Tl, deleteCourt: () => _C, deleteVenue: () => bS, deleteVenues: () => OC, disableCourts: () => kC, disableVenues: () => xC, enableCourts: () => FC, enableVenues: () => LC, modifyCourt: () => MS, modifyCourtAvailability: () => TS, modifyVenue: () => BC });
16790
+ Te(AC, { addCourt: () => Pf, addCourts: () => gS, addVenue: () => Pl, deleteCourt: () => _C, deleteVenue: () => bS, deleteVenues: () => OC, disableCourts: () => kC, disableVenues: () => xC, enableCourts: () => FC, enableVenues: () => LC, modifyCourt: () => MS, modifyCourtAvailability: () => TS, modifyVenue: () => BC });
16791
16791
  function DS(e) {
16792
16792
  if (!e?.tournamentRecord && !Array.isArray(e?.venueMatchUps)) return { error: J };
16793
16793
  if (!e?.courtId) return { error: Ks };
@@ -16848,7 +16848,7 @@ function qj(e) {
16848
16848
  for (; e.length && n; ) {
16849
16849
  let c = e.shift(), { startTime: u, endTime: l, bookings: d } = c;
16850
16850
  if (n -= 1, !t) t = u, i = d, r = l;
16851
- else if (tl(Mt(r), Mt(u), !1) > 0) {
16851
+ else if (rl(Mt(r), Mt(u), !1) > 0) {
16852
16852
  let p = { startTime: t, endTime: r };
16853
16853
  i?.length && (p.bookings = i), s.push(p), t = u, i = d, r = l;
16854
16854
  } else d && (i ? i.push(d) : i = d), r = l, a += 1;
@@ -16891,7 +16891,7 @@ function bS(e) {
16891
16891
  c.venues = (c.venues ?? []).filter((l) => l?.venueId !== r ? !0 : (u = !0, !1)), u && Ue({ payload: { venueId: r, tournamentId: c.tournamentId }, topic: DI, key: r });
16892
16892
  }
16893
16893
  else return PS({ matchUpsCount: a.length });
16894
- return Kl({ tournamentRecords: n }), { ...x };
16894
+ return Xl({ tournamentRecords: n }), { ...x };
16895
16895
  }
16896
16896
  function OC({ tournamentRecord: e, venueIds: t, force: r }) {
16897
16897
  if (!e) return { error: J };
@@ -17023,7 +17023,7 @@ function BC(e) {
17023
17023
  let c = Zj({ tournamentRecord: o, modifications: t, venueId: r, force: i });
17024
17024
  if (c.success && (s = !0), c.error && (a = c.error), c.error && c.error !== Js) return c;
17025
17025
  }
17026
- return Kl({ tournamentRecords: n }), s ? { ...x } : { error: a };
17026
+ return Xl({ tournamentRecords: n }), s ? { ...x } : { error: a };
17027
17027
  }
17028
17028
  function Zj({ tournamentRecord: e, modifications: t, venueId: r, force: i }) {
17029
17029
  if (!e) return { error: J };
@@ -17042,14 +17042,14 @@ function Zj({ tournamentRecord: e, modifications: t, venueId: r, force: i }) {
17042
17042
  for (let U of y.matchUps ?? []) h.push({ matchUpId: U.matchUpId, drawId: U.drawId });
17043
17043
  return y.matchUps?.length ?? 0;
17044
17044
  }).reduce((I, y) => I + y);
17045
- if (c && (!g || a)) c.courts = c.courts?.filter((I) => m.includes(I.courtId)), ju({ schedule: { courtId: "", scheduledDate: "" }, matchUpDetails: h, removePriorValues: !0, tournamentRecord: e });
17045
+ if (c && (!g || a)) c.courts = c.courts?.filter((I) => m.includes(I.courtId)), Gu({ schedule: { courtId: "", scheduledDate: "" }, matchUpDetails: h, removePriorValues: !0, tournamentRecord: e });
17046
17046
  else return PS({ matchUpsCount: g });
17047
17047
  }
17048
17048
  if (t.courts) for (let g of t.courts) {
17049
17049
  let { courtId: I } = g || {}, y = MS({ modifications: g, disableNotice: !0, tournamentRecord: e, venueMatchUps: s, courtId: I, force: i });
17050
17050
  if (y.error === yc && (y = Pf({ disableNotice: !0, tournamentRecord: e, venueId: r, court: g })), y.error) return y;
17051
17051
  }
17052
- return Kl({ tournamentRecord: e }), c && Ue({ payload: { venue: c, tournamentId: e.tournamentId }, topic: ls, key: c?.venueId }), { ...x, venue: ie(c) };
17052
+ return Xl({ tournamentRecord: e }), c && Ue({ payload: { venue: c, tournamentId: e.tournamentId }, topic: ls, key: c?.venueId }), { ...x, venue: ie(c) };
17053
17053
  }
17054
17054
  var RS = {};
17055
17055
  Te(RS, { JSON2CSV: () => sG, UUID: () => Be, UUIDS: () => TT, allNumeric: () => Hw, attributeFilter: () => Vs, chunkArray: () => $t, chunkByNth: () => ch, chunkSizeProfile: () => qw, constantToString: () => ar, countValues: () => S1, createMap: () => Yw, dateTime: () => DT, definedAttributes: () => ae, dehydrateMatchUps: () => rG, extractAttributes: () => Rb, flattenJSON: () => NS, generateDateRange: () => Ho, generateHashCode: () => R1, generateRange: () => te, generateTimeCode: () => IA, groupValues: () => $w, hasAttributeValues: () => M1, instanceCount: () => Wr, intersection: () => St, isConvertableInteger: () => Ie, isNumeric: () => ft, isOdd: () => jw, isPowerOf2: () => $i, makeDeepCopy: () => ie, matchUpScheduleSort: () => tG, matchUpSort: () => fo, nearestPowerOf2: () => dg, nextPowerOf2: () => pc, noNulls: () => U1, noNumeric: () => zw, numericSort: () => At, occurrences: () => w1, overlap: () => Sr, randomMember: () => Br, randomPop: () => jr, shuffleArray: () => Ir, structureSort: () => ao, subSort: () => D1, undefinedToNull: () => uh, unique: () => ye, visualizeScheduledMatchUps: () => eG });
@@ -17239,12 +17239,12 @@ function mG() {
17239
17239
  function rw(e, t = !0) {
17240
17240
  return typeof e != "object" || Array.isArray(e) ? { error: ta } : e?.tournamentId ? mT(t ? ie(e) : e) : { error: z };
17241
17241
  }
17242
- function Gu(e, t = !0) {
17242
+ function $u(e, t = !0) {
17243
17243
  if (typeof e != "object") return { error: ta };
17244
- if (Iu(), Array.isArray(e)) {
17244
+ if (yu(), Array.isArray(e)) {
17245
17245
  if (e.filter((r) => r?.tournamentId).length !== e.length) return { error: ph };
17246
17246
  e = Object.assign({}, ...e.map((r) => ({ [r.tournamentId]: r })));
17247
- } else if (e?.tournamentId) e = { [e.tournamentId]: e }, Iu(e.tournamentId);
17247
+ } else if (e?.tournamentId) e = { [e.tournamentId]: e }, yu(e.tournamentId);
17248
17248
  else if (!Object.keys(e).every((r) => e[r].tournamentId === r)) return { error: ph };
17249
17249
  return Bp(t ? ie(e) : e);
17250
17250
  }
@@ -17268,15 +17268,15 @@ function Ao(e, t) {
17268
17268
  return t?.error ? (e.error = t.error, e.success = !1) : (e.error = void 0, e.success = !0), e;
17269
17269
  }
17270
17270
  function GC(e, t) {
17271
- e.importMethods = (r, i, n, a) => fG(e, t, r, i, n, a), e.getTournament = (r) => pG(r), e.getState = (r) => dG({ convertExtensions: r?.convertExtensions, removeExtensions: r?.removeExtensions }), e.version = () => Dp(), e.reset = () => (Bp({}), Ao(e)), e.devContext = (r) => (hu(r), Ao(e)), e.getDevContext = (r) => ei(r), e.newTournamentRecord = (r = {}) => {
17271
+ e.importMethods = (r, i, n, a) => fG(e, t, r, i, n, a), e.getTournament = (r) => pG(r), e.getState = (r) => dG({ convertExtensions: r?.convertExtensions, removeExtensions: r?.removeExtensions }), e.version = () => Dp(), e.reset = () => (Bp({}), Ao(e)), e.devContext = (r) => (gu(r), Ao(e)), e.getDevContext = (r) => ei(r), e.newTournamentRecord = (r = {}) => {
17272
17272
  let i = Df(r), n = i.tournamentId;
17273
- return i.error ? i : (rw(i), Iu(n), { ...x, tournamentId: n });
17273
+ return i.error ? i : (rw(i), yu(n), { ...x, tournamentId: n });
17274
17274
  }, e.setState = (r, i, n) => {
17275
- gu(i, n);
17276
- let a = Gu(r, i);
17275
+ Iu(i, n);
17276
+ let a = $u(r, i);
17277
17277
  return Ao(e, a);
17278
- }, e.setTournamentId = (r) => Iu(r), e.getTournamentId = () => Zs(), e.setTournamentRecord = (r, i, n) => {
17279
- gu(i, n);
17278
+ }, e.setTournamentId = (r) => yu(r), e.getTournamentId = () => Zs(), e.setTournamentRecord = (r, i, n) => {
17279
+ Iu(i, n);
17280
17280
  let a = rw(r, i);
17281
17281
  return Ao(e, a);
17282
17282
  }, e.removeTournamentRecord = (r) => {
@@ -17300,11 +17300,11 @@ function hG(e, t, r) {
17300
17300
  for (let g of h) f[g] && (p[g] = f[g]);
17301
17301
  }
17302
17302
  let m = AS(e, i[l], p, l, "sync");
17303
- if (m?.error) return a && Gu(a), { ...m, rolledBack: !!a };
17303
+ if (m?.error) return a && $u(a), { ...m, rolledBack: !!a };
17304
17304
  s.push({ ...m, methodName: l });
17305
17305
  }
17306
17306
  let o = Date.now(), c = VC({ timeStamp: o });
17307
- return Rf({ directives: t, mutationStatus: c, timeStamp: o }), Zu(), { success: s.every((u) => u.success), results: s };
17307
+ return Rf({ directives: t, mutationStatus: c, timeStamp: o }), el(), { success: s.every((u) => u.success), results: s };
17308
17308
  }
17309
17309
  function iw(e, t) {
17310
17310
  if (!Ce(t)) return { error: z, message: "args must be an object" };
@@ -17315,9 +17315,9 @@ function iw(e, t) {
17315
17315
  let { [i]: n, ...a } = t, s = t?.params ? { ...t.params } : { ...a }, o = s.rollbackOnError && ie(eo(), !1, !0), c = n || e[i] || Bg()[i];
17316
17316
  if (!c) return ES({ methodName: i, params: s });
17317
17317
  let u = AS(e, c, s, i, "sync") ?? {};
17318
- u?.error && o && Gu(o);
17318
+ u?.error && o && $u(o);
17319
17319
  let l = Date.now(), d = VC({ timeStamp: l }), p = u?.success && s?.delayNotify !== !0 && s?.doNotNotify !== !0;
17320
- return p && Rf({ directives: [{ method: c, params: s }], mutationStatus: d, timeStamp: l }), (p || !u?.success || s?.doNotNotify) && Zu(), u;
17320
+ return p && Rf({ directives: [{ method: c, params: s }], mutationStatus: d, timeStamp: l }), (p || !u?.success || s?.doNotNotify) && el(), u;
17321
17321
  }
17322
17322
  var gG = (() => {
17323
17323
  let e = { executionQueue: (t, r) => hG(e, t, r), execute: (t) => iw(e, t) };
@@ -17358,8 +17358,8 @@ function SG(e) {
17358
17358
  return ie(ks[da], e?.convertExtensions, !1, e?.removeExtensions);
17359
17359
  }
17360
17360
  (() => {
17361
- let e = { getState: (r) => SG(r), version: () => Dp(), reset: () => (UG(), { ...x }), drawId: void 0, error: void 0, success: !1, devContext: (r) => (hu(r), e), setState: (r, i, n) => {
17362
- gu(i, n);
17361
+ let e = { getState: (r) => SG(r), version: () => Dp(), reset: () => (UG(), { ...x }), drawId: void 0, error: void 0, success: !1, devContext: (r) => (gu(r), e), setState: (r, i, n) => {
17362
+ Iu(i, n);
17363
17363
  let a = $C(r);
17364
17364
  return t(a);
17365
17365
  } };
@@ -17389,15 +17389,15 @@ function aw(e, { params: t, governor: r, methodName: i }) {
17389
17389
  let o = r[i](t);
17390
17390
  if (o?.error) return s && $C(s), { ...o, rolledBack: !!s };
17391
17391
  let c = o?.success && t?.delayNotify !== !0 && t?.doNotNotify !== !0;
17392
- return c && Rf(), (c || !o?.success || t?.doNotNotify) && Zu(), o;
17392
+ return c && Rf(), (c || !o?.success || t?.doNotNotify) && el(), o;
17393
17393
  }
17394
17394
  var Yf = !1;
17395
17395
  (() => {
17396
- let e = { version: () => Dp(), setDeepCopy: (i, n) => (gu(i, n), e), devContext: (i) => (hu(i), Yf = !0, e) };
17396
+ let e = { version: () => Dp(), setDeepCopy: (i, n) => (Iu(i, n), e), devContext: (i) => (gu(i), Yf = !0, e) };
17397
17397
  return r([sS]), e;
17398
17398
  function t(i, n) {
17399
17399
  let a = i({ ...n });
17400
- return a?.error || Rf(), Zu(), Yf && (hu(!1), Yf = !1), a;
17400
+ return a?.error || Rf(), el(), Yf && (gu(!1), Yf = !1), a;
17401
17401
  }
17402
17402
  function r(i) {
17403
17403
  i.forEach((n) => {
@@ -17405,10 +17405,10 @@ var Yf = !1;
17405
17405
  e[a] = (s) => {
17406
17406
  if (ei()) {
17407
17407
  let o = t(n[a], s);
17408
- return !o?.error && s?.setState && o?.tournamentRecord && Gu(o.tournamentRecord), o;
17408
+ return !o?.error && s?.setState && o?.tournamentRecord && $u(o.tournamentRecord), o;
17409
17409
  } else try {
17410
17410
  let o = t(n[a], s);
17411
- return !o?.error && s?.setState && o?.tournamentRecord && Gu(o.tournamentRecord), o;
17411
+ return !o?.error && s?.setState && o?.tournamentRecord && $u(o.tournamentRecord), o;
17412
17412
  } catch (o) {
17413
17413
  let c;
17414
17414
  typeof o == "string" ? c = o.toUpperCase() : o instanceof Error && (c = o.message), console.log("ERROR", { params: JSON.stringify(s), method: a, error: c });
@@ -17421,8 +17421,8 @@ var Yf = !1;
17421
17421
  CS.importMethods(ug, !0, 1);
17422
17422
  var WC = CS, wG = { getTournamentPoints: zm }, DG = wG, TG = { calculateNewRatings: vR, generateDynamicRatings: wR }, PG = TG, bG = { ...DG, ...PG };
17423
17423
  CS.importMethods(bG);
17424
- var MG = { [bu]: { roundsToSeparate: void 0, policyName: "Nationality Code", policyAttributes: [{ key: "person.nationalityCode" }, { key: "individualParticipants.person.nationalityCode" }] } }, RG = { [An]: { policyName: "positionActionsUnrestricted", enabledStructures: [], otherFlightEntries: !0, disableRoundRestrictions: !0, activePositionOverrides: [As, su] } }, NG = { [An]: { policyName: "positionActionsNoMovement", enabledStructures: [{ stages: [], stageSequences: [], enabledActions: [As, ku, qs], disabledActions: [] }] } }, EG = { [An]: { policyName: "positionActionsDisabled", enabledStructures: !1 } }, AG = { [Tc]: { policyName: "Participant Privacy Policy", participant: { contacts: !1, individualParticipants: { onlineResources: !1, participantName: !0, participantOtherName: !0, participantId: !0, participantRole: !0, participantStatus: !0, penalties: !1, rankings: !0, ratings: !0, representing: !0, participantRoleResponsibilities: !1, participantType: !0, person: { addresses: !1, biographicalInformation: !1, birthDate: !1, contacts: !1, nationalityCode: !0, nativeFamilyName: !1, nativeGivenName: !1, onlineResources: !1, otherNames: !0, parentOrganisationId: !1, passportFamilyName: !1, passportGivenName: !1, personId: !1, personOtherIds: !1, previousNames: !1, sex: !1, standardFamilyName: !0, standardGivenName: !0, status: !1, tennisId: !1, wheelchair: !0 } }, individualParticipantIds: !0, onlineResources: !1, participantName: !0, participantOtherName: !0, participantId: !0, participantRole: !0, participantStatus: !0, penalties: !1, rankings: !0, ratings: !0, representing: !0, participantRoleResponsibilities: !1, participantType: !0, person: { addresses: !1, biographicalInformation: !1, birthDate: !1, contacts: !1, nationalityCode: !0, nativeFamilyName: !1, nativeGivenName: !1, onlineResources: !1, otherNames: !0, parentOrganisationId: !1, passportFamilyName: !1, passportGivenName: !1, personId: !1, personOtherIds: !1, previousNames: !1, sex: !1, standardFamilyName: !0, standardGivenName: !0, status: !1, tennisId: !1, wheelchair: !0 } } } }, CG = { [pi]: { processCodes: { incompleteAssignmentsOnDefault: ["RANKING.IGNORE"] }, defaultMatchUpFormat: bi, allowDeletionWithScoresPresent: { drawDefinitions: !1, structures: !1 }, requireParticipantsForScoring: !1, requireAllPositionsAssigned: void 0, allowChangePropagation: !1, stage: { [re]: { stageSequence: { 1: { requireAllPositionsAssigned: !0 } } } }, matchUpFormats: [], matchUpStatusCodes: { [Fr]: [], [mn]: [], [Qe]: [], [Yr]: [], [Wt]: [], [st]: [] } } }, Kf = "Personal circumstance", OG = { [pi]: { requireAllPositionsAssigned: !1, stage: { [re]: { stageSequence: { 1: { requireAllPositionsAssigned: !0 } } } }, defaultMatchUpFormat: bi, matchUpFormats: [{ description: "Best of 3 tiebreak sets", matchUpFormat: bi, categoryNames: [], categoryTypes: [] }, { description: "Two tiebreak sets, 7-point match tiebreak at one set all", matchUpFormat: "SET3-S:6/TB7-F:TB7" }, { description: "Two tiebreak sets, 10-point match tiebreak at one set all", matchUpFormat: "SET3-S:6/TB7-F:TB10" }, { description: "One standard tiebreak set to 6, 7-point tiebreak at 6 games all", matchUpFormat: "SET1-S:6/TB7" }, { description: "Best of 3 sets to 4", matchUpFormat: "SET3-S:4/TB7" }, { description: "Two out of three short sets to 4 with 5-point tiebreak at 3 games all", matchUpFormat: "SET3-S:4/TB5@3" }, { description: "One short set to 4, 7-point tiebreak at 4 games all", matchUpFormat: "SET1-S:4/TB7" }, { description: "One short set to 4, 5-point tiebreak at 3 games all", matchUpFormat: "SET1-S:4/TB5@3" }, { description: "Two short sets to 4, 10-point match tiebreak at one set all", matchUpFormat: "SET3-S:4/TB7-F:TB10" }, { description: "Two short sets to 4, 7-point match tiebreak at one set all", matchUpFormat: "SET3-S:4/TB7-F:TB7" }, { description: "One no advantage set to 5, tiebreak to 9 at 4-4", matchUpFormat: "SET1-S:5/TB9@4" }, { description: "One set to 6 with deciding game at 5 games all", matchUpFormat: "SET1-S:6NOAD" }, { description: "One short set to 4, deciding game is played at 3 games all", matchUpFormat: "SET1-S:4NOAD" }, { description: "Two short sets to 4 with deciding game at 3-3, 7-point match tiebreak at one set all", matchUpFormat: "SET3-S:4NOAD-F:TB7" }, { description: "8 game pro-set with 7 point tiebreak at 8 games all", matchUpFormat: "SET1-S:8/TB7" }, { description: "8 game pro-set with 7 point tiebreak at 7 games all", matchUpFormat: "SET1-S:8/TB7@7" }, { description: "Best of 3 10-point tiebreak games", matchUpFormat: "SET3-S:TB10" }, { description: "One 10-point tiebreak game", matchUpFormat: "SET1-S:TB10" }, { description: "Timed 20 minute game - game based", matchUpFormat: "SET1-S:T20" }], matchUpStatusCodes: { [Fr]: [{ matchUpStatusCodeDisplay: "Abandoned", label: "Abandoned match", matchUpStatusCode: "OA" }], [mn]: [{ matchUpStatusCodeDisplay: "Unplayed or Cancelled", label: "Cancelled match", matchUpStatusCode: "OC" }], [Yr]: [{ matchUpStatusCodeDisplay: "Incomplete", label: "Incomplete match", matchUpStatusCode: "OI" }], [Qe]: [{ description: "Disqualification for cause or ineligibility", label: "Disqualification (ineligibility)", matchUpStatusCodeDisplay: "Def [dq]", matchUpStatusCode: "DQ" }, { description: "Misconduct before or between matches", label: "Misconduct", matchUpStatusCodeDisplay: "Def [cond]", matchUpStatusCode: "DM" }, { description: "Failure to start match because of adult discipline", label: "Fail. (adult discipline)", matchUpStatusCodeDisplay: "Def [ad]", matchUpStatusCode: "D5" }, { description: "Refusal to start match for reason other than adult discipline, injury, illness, or personal circumstance. (After the Referee has conclusively confirmed that a player refuses to play a match, the Referee need not wait until the scheduled time of the match to records the result.)", label: "Refusal to start match", matchUpStatusCodeDisplay: "Def [refsl]", matchUpStatusCode: "D4" }, { label: "Not showing up", matchUpStatusCodeDisplay: "Def [ns]", matchUpStatusCode: "D6" }, { description: "Lateness for match including, but not limited to, intending to play but mistakenly arriving at the wrong time, location, or without proper equipment", label: "Lateness for match", matchUpStatusCodeDisplay: "Score + Def [late]", matchUpStatusCode: "D7" }, { label: "Double default", matchUpStatusCodeDisplay: "Def/Def", matchUpStatusCode: "DD" }, { description: "Refusal to continue playing a match for reason other than injury, illness, personal circumstance, or adult discipline", label: "Refusal to continue match", matchUpStatusCodeDisplay: "Def [refsl]", matchUpStatusCode: "D9" }, { description: "Default for receiving an injection, IV, or supplemental oxygen", label: "Default (PEDs)", matchUpStatusCodeDisplay: "Def [med]", matchUpStatusCode: "DI" }, { description: "Default under Point Penalty System", label: "Default (Point Penalty System)", matchUpStatusCodeDisplay: "Def [pps]", matchUpStatusCode: "DP" }], [st]: [{ matchUpStatusCodeDisplay: "Wo [inj]", matchUpStatusCode: "W1", label: "Injury" }, { matchUpStatusCodeDisplay: "Wo [ill]", matchUpStatusCode: "W2", label: "Illness" }, { matchUpStatusCodeDisplay: "Wo [pc]", label: Kf, matchUpStatusCode: "W3" }, { matchUpStatusCodeDisplay: "Wo/Wo", matchUpStatusCode: "WOWO", label: "Double walkover" }, { matchUpStatusCodeDisplay: "Wo [Tae]", label: "Tournament Administrative Error", matchUpStatusCode: "W4" }, { matchUpStatusCodeDisplay: "Wo/Withdrawn", matchUpStatusCode: "W5", label: "Withdrawn" }], [Wt]: [{ matchUpStatusCodeDisplay: "Ret [inj]", matchUpStatusCode: "RJ", label: "Injury" }, { matchUpStatusCodeDisplay: "Ret [ill]", matchUpStatusCode: "RI", label: "Illness" }, { matchUpStatusCodeDisplay: "Ret [pc]", label: Kf, matchUpStatusCode: "RC" }, { description: "Retirement because of adult discipline", label: "Ret. (adult discipline)", matchUpStatusCodeDisplay: "Ret [ad]", matchUpStatusCode: "RD" }, { description: "A player who retires from a match remains eligible for consolations, place playoffs, doubles and subsequent round robin matches", matchUpStatusCodeDisplay: "Ret [elg]", label: "Ret. (eligible)", matchUpStatusCode: "RU" }], [Cn]: [{ matchUpStatusCodeDisplay: "Wd [inj]", matchUpStatusCode: "WD.INJ", label: "Injury" }, { matchUpStatusCodeDisplay: "Wd [ill]", matchUpStatusCode: "WD.ILL", label: "Illness" }, { matchUpStatusCodeDisplay: "Wd [pc]", label: Kf, matchUpStatusCode: "WD.PC" }, { matchUpStatusCodeDisplay: "Wd/Wd", matchUpStatusCode: "WD.WD", label: "Double withdrawal" }, { label: "Tournament Administrative Error", matchUpStatusCodeDisplay: "Wd [Tae]", matchUpStatusCode: "WD.TAE" }] } } }, kG = { [wi]: { seedingProfile: { positioning: Wp }, validSeedPositions: { ignore: !0 }, duplicateSeedNumbers: !0, drawSizeProgression: !0, policyName: "ITF SEEDING", seedsCountThresholds: [{ drawSize: 4, minimumParticipantCount: 3, seedsCount: 2 }, { drawSize: 16, minimumParticipantCount: 12, seedsCount: 4 }, { drawSize: 32, minimumParticipantCount: 24, seedsCount: 8 }, { drawSize: 64, minimumParticipantCount: 48, seedsCount: 16 }, { drawSize: 128, minimumParticipantCount: 97, seedsCount: 32 }, { drawSize: 256, minimumParticipantCount: 192, seedsCount: 64 }] } }, xG = { POLICY_AVOIDANCE_COUNTRY: MG, POLICY_POSITION_ACTIONS_DEFAULT: iR, POLICY_POSITION_ACTIONS_DISABLED: EG, POLICY_POSITION_ACTIONS_NO_MOVEMENT: NG, POLICY_POSITION_ACTIONS_UNRESTRICTED: RG, POLICY_PRIVACY_DEFAULT: AG, POLICY_ROUND_NAMING_DEFAULT: jI, POLICY_SCHEDULING_DEFAULT: xN, POLICY_SCORING_DEFAULT: CG, POLICY_SCORING_USTA: OG, POLICY_SEEDING_ITF: kG, POLICY_SEEDING_DEFAULT: IN }, FG = { ratingsParameters: jt, matchUpFormats: HO, countryToFlag: ZP, tieFormats: QN, countries: ma, policies: xG, flagIOC: Wk }, LG = {};
17425
- Te(LG, { activeMatchUpStatuses: () => yI, auditConstants: () => $V, completedMatchUpStatuses: () => xt, directingMatchUpStatuses: () => _P, displayConstants: () => UV, drawDefinitionConstants: () => fP, entryStatusConstants: () => Zk, errorConditionConstants: () => H1, eventConstants: () => QO, extensionConstants: () => RP, flightConstants: () => e2, genderConstants: () => Wg, keyValueConstants: () => q_, matchUpActionConstants: () => i_, matchUpStatusConstants: () => jP, matchUpTypes: () => h1, nonDirectingMatchUpStatuses: () => BP, particicipantsRequiredMatchUpStatuses: () => FP, participantConstants: () => $k, participantRoles: () => ey, participantTypes: () => ru, penaltyConstants: () => t$, policyConstants: () => bk, positionActionConstants: () => IL, ratingConstants: () => AL, recoveryTimeRequiredMatchUpStatuses: () => _k, requestConstants: () => $2, resourceContants: () => BO, resultConstants: () => N1, scaleConstants: () => wk, scheduleConstants: () => Tx, sortingConstants: () => o2, surfaceConstants: () => o$, tieFormatConstants: () => zO, timeItemConstants: () => vx, topicConstants: () => Vk, tournamentConstants: () => SC, upcomingMatchUpStatuses: () => VP, validMatchUpStatuses: () => LP, venueConstants: () => l$, weekdayConstants: () => iE });
17424
+ var MG = { [Mu]: { roundsToSeparate: void 0, policyName: "Nationality Code", policyAttributes: [{ key: "person.nationalityCode" }, { key: "individualParticipants.person.nationalityCode" }] } }, RG = { [An]: { policyName: "positionActionsUnrestricted", enabledStructures: [], otherFlightEntries: !0, disableRoundRestrictions: !0, activePositionOverrides: [As, ou] } }, NG = { [An]: { policyName: "positionActionsNoMovement", enabledStructures: [{ stages: [], stageSequences: [], enabledActions: [As, xu, qs], disabledActions: [] }] } }, EG = { [An]: { policyName: "positionActionsDisabled", enabledStructures: !1 } }, AG = { [Tc]: { policyName: "Participant Privacy Policy", participant: { contacts: !1, individualParticipants: { onlineResources: !1, participantName: !0, participantOtherName: !0, participantId: !0, participantRole: !0, participantStatus: !0, penalties: !1, rankings: !0, ratings: !0, representing: !0, participantRoleResponsibilities: !1, participantType: !0, person: { addresses: !1, biographicalInformation: !1, birthDate: !1, contacts: !1, nationalityCode: !0, nativeFamilyName: !1, nativeGivenName: !1, onlineResources: !1, otherNames: !0, parentOrganisationId: !1, passportFamilyName: !1, passportGivenName: !1, personId: !1, personOtherIds: !1, previousNames: !1, sex: !1, standardFamilyName: !0, standardGivenName: !0, status: !1, tennisId: !1, wheelchair: !0 } }, individualParticipantIds: !0, onlineResources: !1, participantName: !0, participantOtherName: !0, participantId: !0, participantRole: !0, participantStatus: !0, penalties: !1, rankings: !0, ratings: !0, representing: !0, participantRoleResponsibilities: !1, participantType: !0, person: { addresses: !1, biographicalInformation: !1, birthDate: !1, contacts: !1, nationalityCode: !0, nativeFamilyName: !1, nativeGivenName: !1, onlineResources: !1, otherNames: !0, parentOrganisationId: !1, passportFamilyName: !1, passportGivenName: !1, personId: !1, personOtherIds: !1, previousNames: !1, sex: !1, standardFamilyName: !0, standardGivenName: !0, status: !1, tennisId: !1, wheelchair: !0 } } } }, CG = { [pi]: { processCodes: { incompleteAssignmentsOnDefault: ["RANKING.IGNORE"] }, defaultMatchUpFormat: bi, allowDeletionWithScoresPresent: { drawDefinitions: !1, structures: !1 }, requireParticipantsForScoring: !1, requireAllPositionsAssigned: void 0, allowChangePropagation: !1, stage: { [re]: { stageSequence: { 1: { requireAllPositionsAssigned: !0 } } } }, matchUpFormats: [], matchUpStatusCodes: { [Fr]: [], [mn]: [], [Qe]: [], [Yr]: [], [Wt]: [], [st]: [] } } }, Kf = "Personal circumstance", OG = { [pi]: { requireAllPositionsAssigned: !1, stage: { [re]: { stageSequence: { 1: { requireAllPositionsAssigned: !0 } } } }, defaultMatchUpFormat: bi, matchUpFormats: [{ description: "Best of 3 tiebreak sets", matchUpFormat: bi, categoryNames: [], categoryTypes: [] }, { description: "Two tiebreak sets, 7-point match tiebreak at one set all", matchUpFormat: "SET3-S:6/TB7-F:TB7" }, { description: "Two tiebreak sets, 10-point match tiebreak at one set all", matchUpFormat: "SET3-S:6/TB7-F:TB10" }, { description: "One standard tiebreak set to 6, 7-point tiebreak at 6 games all", matchUpFormat: "SET1-S:6/TB7" }, { description: "Best of 3 sets to 4", matchUpFormat: "SET3-S:4/TB7" }, { description: "Two out of three short sets to 4 with 5-point tiebreak at 3 games all", matchUpFormat: "SET3-S:4/TB5@3" }, { description: "One short set to 4, 7-point tiebreak at 4 games all", matchUpFormat: "SET1-S:4/TB7" }, { description: "One short set to 4, 5-point tiebreak at 3 games all", matchUpFormat: "SET1-S:4/TB5@3" }, { description: "Two short sets to 4, 10-point match tiebreak at one set all", matchUpFormat: "SET3-S:4/TB7-F:TB10" }, { description: "Two short sets to 4, 7-point match tiebreak at one set all", matchUpFormat: "SET3-S:4/TB7-F:TB7" }, { description: "One no advantage set to 5, tiebreak to 9 at 4-4", matchUpFormat: "SET1-S:5/TB9@4" }, { description: "One set to 6 with deciding game at 5 games all", matchUpFormat: "SET1-S:6NOAD" }, { description: "One short set to 4, deciding game is played at 3 games all", matchUpFormat: "SET1-S:4NOAD" }, { description: "Two short sets to 4 with deciding game at 3-3, 7-point match tiebreak at one set all", matchUpFormat: "SET3-S:4NOAD-F:TB7" }, { description: "8 game pro-set with 7 point tiebreak at 8 games all", matchUpFormat: "SET1-S:8/TB7" }, { description: "8 game pro-set with 7 point tiebreak at 7 games all", matchUpFormat: "SET1-S:8/TB7@7" }, { description: "Best of 3 10-point tiebreak games", matchUpFormat: "SET3-S:TB10" }, { description: "One 10-point tiebreak game", matchUpFormat: "SET1-S:TB10" }, { description: "Timed 20 minute game - game based", matchUpFormat: "SET1-S:T20" }], matchUpStatusCodes: { [Fr]: [{ matchUpStatusCodeDisplay: "Abandoned", label: "Abandoned match", matchUpStatusCode: "OA" }], [mn]: [{ matchUpStatusCodeDisplay: "Unplayed or Cancelled", label: "Cancelled match", matchUpStatusCode: "OC" }], [Yr]: [{ matchUpStatusCodeDisplay: "Incomplete", label: "Incomplete match", matchUpStatusCode: "OI" }], [Qe]: [{ description: "Disqualification for cause or ineligibility", label: "Disqualification (ineligibility)", matchUpStatusCodeDisplay: "Def [dq]", matchUpStatusCode: "DQ" }, { description: "Misconduct before or between matches", label: "Misconduct", matchUpStatusCodeDisplay: "Def [cond]", matchUpStatusCode: "DM" }, { description: "Failure to start match because of adult discipline", label: "Fail. (adult discipline)", matchUpStatusCodeDisplay: "Def [ad]", matchUpStatusCode: "D5" }, { description: "Refusal to start match for reason other than adult discipline, injury, illness, or personal circumstance. (After the Referee has conclusively confirmed that a player refuses to play a match, the Referee need not wait until the scheduled time of the match to records the result.)", label: "Refusal to start match", matchUpStatusCodeDisplay: "Def [refsl]", matchUpStatusCode: "D4" }, { label: "Not showing up", matchUpStatusCodeDisplay: "Def [ns]", matchUpStatusCode: "D6" }, { description: "Lateness for match including, but not limited to, intending to play but mistakenly arriving at the wrong time, location, or without proper equipment", label: "Lateness for match", matchUpStatusCodeDisplay: "Score + Def [late]", matchUpStatusCode: "D7" }, { label: "Double default", matchUpStatusCodeDisplay: "Def/Def", matchUpStatusCode: "DD" }, { description: "Refusal to continue playing a match for reason other than injury, illness, personal circumstance, or adult discipline", label: "Refusal to continue match", matchUpStatusCodeDisplay: "Def [refsl]", matchUpStatusCode: "D9" }, { description: "Default for receiving an injection, IV, or supplemental oxygen", label: "Default (PEDs)", matchUpStatusCodeDisplay: "Def [med]", matchUpStatusCode: "DI" }, { description: "Default under Point Penalty System", label: "Default (Point Penalty System)", matchUpStatusCodeDisplay: "Def [pps]", matchUpStatusCode: "DP" }], [st]: [{ matchUpStatusCodeDisplay: "Wo [inj]", matchUpStatusCode: "W1", label: "Injury" }, { matchUpStatusCodeDisplay: "Wo [ill]", matchUpStatusCode: "W2", label: "Illness" }, { matchUpStatusCodeDisplay: "Wo [pc]", label: Kf, matchUpStatusCode: "W3" }, { matchUpStatusCodeDisplay: "Wo/Wo", matchUpStatusCode: "WOWO", label: "Double walkover" }, { matchUpStatusCodeDisplay: "Wo [Tae]", label: "Tournament Administrative Error", matchUpStatusCode: "W4" }, { matchUpStatusCodeDisplay: "Wo/Withdrawn", matchUpStatusCode: "W5", label: "Withdrawn" }], [Wt]: [{ matchUpStatusCodeDisplay: "Ret [inj]", matchUpStatusCode: "RJ", label: "Injury" }, { matchUpStatusCodeDisplay: "Ret [ill]", matchUpStatusCode: "RI", label: "Illness" }, { matchUpStatusCodeDisplay: "Ret [pc]", label: Kf, matchUpStatusCode: "RC" }, { description: "Retirement because of adult discipline", label: "Ret. (adult discipline)", matchUpStatusCodeDisplay: "Ret [ad]", matchUpStatusCode: "RD" }, { description: "A player who retires from a match remains eligible for consolations, place playoffs, doubles and subsequent round robin matches", matchUpStatusCodeDisplay: "Ret [elg]", label: "Ret. (eligible)", matchUpStatusCode: "RU" }], [Cn]: [{ matchUpStatusCodeDisplay: "Wd [inj]", matchUpStatusCode: "WD.INJ", label: "Injury" }, { matchUpStatusCodeDisplay: "Wd [ill]", matchUpStatusCode: "WD.ILL", label: "Illness" }, { matchUpStatusCodeDisplay: "Wd [pc]", label: Kf, matchUpStatusCode: "WD.PC" }, { matchUpStatusCodeDisplay: "Wd/Wd", matchUpStatusCode: "WD.WD", label: "Double withdrawal" }, { label: "Tournament Administrative Error", matchUpStatusCodeDisplay: "Wd [Tae]", matchUpStatusCode: "WD.TAE" }] } } }, kG = { [wi]: { seedingProfile: { positioning: Wp }, validSeedPositions: { ignore: !0 }, duplicateSeedNumbers: !0, drawSizeProgression: !0, policyName: "ITF SEEDING", seedsCountThresholds: [{ drawSize: 4, minimumParticipantCount: 3, seedsCount: 2 }, { drawSize: 16, minimumParticipantCount: 12, seedsCount: 4 }, { drawSize: 32, minimumParticipantCount: 24, seedsCount: 8 }, { drawSize: 64, minimumParticipantCount: 48, seedsCount: 16 }, { drawSize: 128, minimumParticipantCount: 97, seedsCount: 32 }, { drawSize: 256, minimumParticipantCount: 192, seedsCount: 64 }] } }, xG = { POLICY_AVOIDANCE_COUNTRY: MG, POLICY_POSITION_ACTIONS_DEFAULT: iR, POLICY_POSITION_ACTIONS_DISABLED: EG, POLICY_POSITION_ACTIONS_NO_MOVEMENT: NG, POLICY_POSITION_ACTIONS_UNRESTRICTED: RG, POLICY_PRIVACY_DEFAULT: AG, POLICY_ROUND_NAMING_DEFAULT: jI, POLICY_SCHEDULING_DEFAULT: xN, POLICY_SCORING_DEFAULT: CG, POLICY_SCORING_USTA: OG, POLICY_SEEDING_ITF: kG, POLICY_SEEDING_DEFAULT: IN }, FG = { ratingsParameters: jt, matchUpFormats: HO, countryToFlag: ZP, tieFormats: QN, countries: ma, policies: xG, flagIOC: Wk }, LG = {};
17425
+ Te(LG, { activeMatchUpStatuses: () => yI, auditConstants: () => $V, completedMatchUpStatuses: () => xt, directingMatchUpStatuses: () => _P, displayConstants: () => UV, drawDefinitionConstants: () => fP, entryStatusConstants: () => Zk, errorConditionConstants: () => H1, eventConstants: () => QO, extensionConstants: () => RP, flightConstants: () => e2, genderConstants: () => Wg, keyValueConstants: () => q_, matchUpActionConstants: () => i_, matchUpStatusConstants: () => jP, matchUpTypes: () => h1, nonDirectingMatchUpStatuses: () => BP, particicipantsRequiredMatchUpStatuses: () => FP, participantConstants: () => $k, participantRoles: () => ey, participantTypes: () => iu, penaltyConstants: () => t$, policyConstants: () => bk, positionActionConstants: () => IL, ratingConstants: () => AL, recoveryTimeRequiredMatchUpStatuses: () => _k, requestConstants: () => $2, resourceContants: () => BO, resultConstants: () => N1, scaleConstants: () => wk, scheduleConstants: () => Tx, sortingConstants: () => o2, surfaceConstants: () => o$, tieFormatConstants: () => zO, timeItemConstants: () => vx, topicConstants: () => Vk, tournamentConstants: () => SC, upcomingMatchUpStatuses: () => VP, validMatchUpStatuses: () => LP, venueConstants: () => l$, weekdayConstants: () => iE });
17426
17426
  var _G = "Coaching", BG = "Ball Abuse", VG = "Racket Abuse", jG = "Verbal Abuse", GG = "INELIGIBILITY", $G = "Physical Abuse", WG = "Unsportmanlike Conduct", qG = "Dress Code Violation", HG = "Equipment Violation", zG = "Leaving the court", YG = "Failure to complete", KG = "No Show", XG = "Other", QG = "REFUSAL_TO_PLAY", JG = "PROHIBITED_SUBSTANCE", ZG = "Puncuality", e$ = "Failure to sign in", t$ = { COACHING: _G, BALL_ABUSE: BG, RACKET_ABUSE: VG, VERBAL_ABUSE: jG, PHYSICAL_ABUSE: $G, INELIGIBILITY: GG, UNSPORTSMANLIKE_CONDUCT: WG, PROHIBITED_SUBSTANCE: JG, DRESS_CODE_VIOLATION: qG, EQUIMENT_VIOLATION: HG, LEAVING_THE_COURT: zG, REFUSAL_TO_PLAY: QG, FAILURE_TO_COMPLETE: YG, NO_SHOW: KG, OTHER: XG, PUNCTUALITY: ZG, FAILUIRE_TO_SIGN_IN: e$ }, r$ = "CLAY", i$ = "HARD", n$ = "GRASS", a$ = "CARPET", s$ = "ARTIFICIAL", o$ = { CLAY: r$, HARD: i$, GRASS: n$, CARPET: a$, ARTIFICIAL: s$ }, c$ = "INDOOR", u$ = "OUTDOOR", l$ = { INDOOR: c$, OUTDOOR: u$ };
17427
17427
  const d$ = Ve({
17428
17428
  WebkitBoxSizing: "border-box",
@@ -17854,7 +17854,7 @@ function _$({
17854
17854
  const u = document.createElement("div");
17855
17855
  return u.className = cw(), u.innerHTML = t || "", o.appendChild(u), s.appendChild(o), a.appendChild(s), { element: a };
17856
17856
  }
17857
- const cu = {
17857
+ const uu = {
17858
17858
  scheduleInfo: 1.8,
17859
17859
  centerInfo: 1.5,
17860
17860
  gameScore: 2
@@ -17864,7 +17864,7 @@ function B$({
17864
17864
  isDoubles: t,
17865
17865
  roundFactor: r = 1
17866
17866
  }) {
17867
- const i = parseInt(window.getComputedStyle(document.body).getPropertyValue("font-size")), n = e?.configuration || {}, a = n?.connectorWidth || 16, s = n.centerInfo ? cu.centerInfo * i : 0, o = n.scheduleInfo ? cu.scheduleInfo * i : 0, u = (60 + (n.showAddress ? i : 0)) * (t ? 1.3 : 1) + s, l = u * r, d = (u + o) * r;
17867
+ const i = parseInt(window.getComputedStyle(document.body).getPropertyValue("font-size")), n = e?.configuration || {}, a = n?.connectorWidth || 16, s = n.centerInfo ? uu.centerInfo * i : 0, o = n.scheduleInfo ? uu.scheduleInfo * i : 0, u = (60 + (n.showAddress ? i : 0)) * (t ? 1.3 : 1) + s, l = u * r, d = (u + o) * r;
17868
17868
  return Ve({
17869
17869
  "&::before": {
17870
17870
  borderBlockStart: "$borderWidths$matchUp solid #999",
@@ -18581,9 +18581,9 @@ function KW({ content: e, theme: t }) {
18581
18581
  const { createTheme: Po } = Lw({
18582
18582
  theme: {
18583
18583
  lineHeights: {
18584
- scheduleInfo: `${cu.scheduleInfo}rem`,
18585
- centerInfo: `${cu.centerInfo}rem`,
18586
- gameScore: `${cu.gameScore}rem`
18584
+ scheduleInfo: `${uu.scheduleInfo}rem`,
18585
+ centerInfo: `${uu.centerInfo}rem`,
18586
+ gameScore: `${uu.gameScore}rem`
18587
18587
  },
18588
18588
  borderWidths: {
18589
18589
  matchUpInline: "1px 1px",
@@ -18866,11 +18866,11 @@ function Od(e) {
18866
18866
  return typeof e == "function";
18867
18867
  }
18868
18868
  let vs, Vt;
18869
- const kd = "Timed set", Jc = "Tiebreak", ig = "No-Ad", vi = "Set", uu = "Ad", gr = {
18869
+ const kd = "Timed set", Zc = "Tiebreak", ig = "No-Ad", vi = "Set", lu = "Ad", gr = {
18870
18870
  setFormat: {
18871
18871
  descriptor: "Best of",
18872
18872
  bestOf: 3,
18873
- advantage: uu,
18873
+ advantage: lu,
18874
18874
  what: vi,
18875
18875
  setTo: 6,
18876
18876
  tiebreakAt: 6,
@@ -18880,7 +18880,7 @@ const kd = "Timed set", Jc = "Tiebreak", ig = "No-Ad", vi = "Set", uu = "Ad", gr
18880
18880
  },
18881
18881
  finalSetFormat: {
18882
18882
  descriptor: "Final set",
18883
- advantage: uu,
18883
+ advantage: lu,
18884
18884
  what: vi,
18885
18885
  setTo: 6,
18886
18886
  tiebreakAt: 6,
@@ -18895,7 +18895,7 @@ function fw(e) {
18895
18895
  };
18896
18896
  return r === vi && gr[t].advantage === ig && (i.NoAD = !0), r === vi && document.getElementById(e ? "finalSetTiebreak" : "setTiebreak")?.checked && (i.tiebreakAt = gr[t].tiebreakAt, i.tiebreakFormat = {
18897
18897
  tiebreakTo: gr[t].tiebreakTo
18898
- }, r === vi && gr[t].winBy === 1 && (i.tiebreakFormat.NoAD = !0)), r === kd && (i.minutes = gr[t].minutes, i.timed = !0), r === Jc && (i.tiebreakSet = {
18898
+ }, r === vi && gr[t].winBy === 1 && (i.tiebreakFormat.NoAD = !0)), r === kd && (i.minutes = gr[t].minutes, i.timed = !0), r === Zc && (i.tiebreakSet = {
18899
18899
  tiebreakTo: gr[t].tiebreakTo
18900
18900
  }, gr[t].winBy === 1 && (i.tiebreakSet.NoAD = !0)), i;
18901
18901
  }
@@ -18930,20 +18930,20 @@ const ws = (e, t) => t && e.finalSetFormat || e.setFormat, ko = [
18930
18930
  { getValue: (e) => e.bestOf, finalSet: !1, id: "bestOf", options: [1, 3, 5], onChange: "pluralize", onChangeCallback: "updateFinalSetVisibility", value: 3 },
18931
18931
  {
18932
18932
  getValue: (e, t) => {
18933
- const r = ws(e, t), i = r?.NoAD ? ig : uu;
18933
+ const r = ws(e, t), i = r?.NoAD ? ig : lu;
18934
18934
  return r?.timed || r?.tiebreakSet ? void 0 : i;
18935
18935
  },
18936
- options: [uu, ig],
18937
- defaultValue: uu,
18936
+ options: [lu, ig],
18937
+ defaultValue: lu,
18938
18938
  id: "advantage",
18939
18939
  whats: [vi]
18940
18940
  },
18941
18941
  {
18942
18942
  getValue: (e, t) => {
18943
18943
  const r = ws(e, t);
18944
- return r || console.log({ pmf: e }), r?.timed ? kd : r?.tiebreakSet ? Jc : vi;
18944
+ return r || console.log({ pmf: e }), r?.timed ? kd : r?.tiebreakSet ? Zc : vi;
18945
18945
  },
18946
- options: [vi, Jc, kd],
18946
+ options: [vi, Zc, kd],
18947
18947
  finalSetLabel: `${vi}${Gn}`,
18948
18948
  onChange: "changeWhat",
18949
18949
  pluralize: !0,
@@ -18964,7 +18964,7 @@ const ws = (e, t) => t && e.finalSetFormat || e.setFormat, ko = [
18964
18964
  return r.tiebreakFormat?.tiebreakTo || r.tiebreakSet?.tiebreakTo;
18965
18965
  },
18966
18966
  options: [5, 7, 9, 10, 12],
18967
- whats: [vi, Jc],
18967
+ whats: [vi, Zc],
18968
18968
  id: "tiebreakTo",
18969
18969
  defaultValue: 7,
18970
18970
  prefix: "TB to ",
@@ -18991,7 +18991,7 @@ const ws = (e, t) => t && e.finalSetFormat || e.setFormat, ko = [
18991
18991
  if (r.tiebreakFormat)
18992
18992
  return r.tiebreakFormat?.NoAD ? 1 : 2;
18993
18993
  },
18994
- whats: [vi, Jc],
18994
+ whats: [vi, Zc],
18995
18995
  prefix: "Win by ",
18996
18996
  options: [1, 2],
18997
18997
  defaultValue: 2,
@@ -19011,7 +19011,7 @@ const ws = (e, t) => t && e.finalSetFormat || e.setFormat, ko = [
19011
19011
  id: "minutes",
19012
19012
  timed: !0
19013
19013
  }
19014
- ], pd = {
19014
+ ], Yc = {
19015
19015
  changeWhat: (e, t, r) => {
19016
19016
  const i = r === vi, n = t ? "finalSetTiebreakToggle" : "setTiebreakToggle", a = document.getElementById(n);
19017
19017
  a.style.display = i ? "" : _r, ko.forEach((s) => {
@@ -19036,8 +19036,9 @@ const ws = (e, t) => t && e.finalSetFormat || e.setFormat, ko = [
19036
19036
  a.innerHTML = `${i}${s}${Gn}`, Va();
19037
19037
  },
19038
19038
  updateFinalSetVisibility: (e, t, r) => {
19039
+ console.log("[updateFinalSetVisibility] Called with opt:", r);
19039
19040
  const i = r > 1, n = document.getElementById("finalSetOption"), a = document.querySelector('label[for="finalSetOption"]');
19040
- n && a && (i ? (n.style.display = "", a.style.display = "") : (n.checked && (n.checked = !1, n.dispatchEvent(new Event("change"))), n.style.display = "none", a.style.display = "none"));
19041
+ console.log("[updateFinalSetVisibility] finalSetOption found:", !!n, "checked:", n?.checked), console.log("[updateFinalSetVisibility] finalSetLabel found:", !!a), console.log("[updateFinalSetVisibility] showFinalSet:", i), n && a ? i ? (console.log("[updateFinalSetVisibility] Showing toggle and label"), n.style.display = "", a.style.display = "") : (n.checked && (console.log("[updateFinalSetVisibility] Unchecking and hiding..."), n.checked = !1, n.dispatchEvent(new Event("change"))), n.style.display = "none", a.style.display = "none", console.log("[updateFinalSetVisibility] Hidden toggle and label")) : console.error("[updateFinalSetVisibility] Elements not found!");
19041
19042
  }
19042
19043
  };
19043
19044
  function QW({
@@ -19189,17 +19190,19 @@ function hw(e) {
19189
19190
  return a.className = "mfcButton", a.id = i ? `${t}-${i}` : t, a.innerHTML = aW(e), a.onclick = (s) => sW({ e: s, button: a, ...e }), a.style.display = n || e.label ? "" : _r, r && (a.style.display = _r), a.style.transition = "all .2s ease-in-out", a.style.backgroundColor = "inherit", a.style.border = "none", a.style.color = "inherit", a.style.padding = ".3em", a.style.textAlign = "center", a.style.textDecoration = "none", a.style.fontSize = "1em", a.style.cursor = "pointer", a;
19190
19191
  }
19191
19192
  function sW(e) {
19192
- const { e: t, id: r, button: i, pluralize: n, options: a, onChange: s, onChangeCallback: o, index: c, prefix: u = "", suffix: l = "" } = e, d = gr.setFormat.bestOf || 1, p = !c && n && d > 1 ? "s" : "", f = (Od(a) ? a(c) : a).map((h) => ({
19193
+ const { e: t, id: r, button: i, pluralize: n, options: a, onChange: s, onChangeCallback: o, index: c, prefix: u = "", suffix: l = "" } = e, d = gr.setFormat.bestOf || 1, p = !c && n && d > 1 ? "s" : "";
19194
+ console.log("[getButtonClick] id:", r, "onChangeCallback:", o);
19195
+ const f = (Od(a) ? a(c) : a).map((h) => ({
19193
19196
  text: `${h}${p}`,
19194
19197
  onClick: () => {
19195
- i.innerHTML = `${u}${h}${p}${l}${Gn}`, s && Od(pd[s]) && pd[s](t, c, h), o && Od(pd[o]) && pd[o](t, c, h), gr[c ? "finalSetFormat" : "setFormat"][r] = h, Va();
19198
+ console.log("[getButtonClick.onClick] id:", r, "opt:", h, "onChangeCallback:", o), i.innerHTML = `${u}${h}${p}${l}${Gn}`, s && Od(Yc[s]) && (console.log("[getButtonClick] Calling onChange:", s), Yc[s](t, c, h)), o && Od(Yc[o]) ? (console.log("[getButtonClick] Calling onChangeCallback:", o), Yc[o](t, c, h)) : console.log("[getButtonClick] No onChangeCallback or not a function. onChangeCallback:", o, "exists in onClicks:", o in Yc), gr[c ? "finalSetFormat" : "setFormat"][r] = h, Va();
19196
19199
  }
19197
19200
  }));
19198
19201
  oW(t, f);
19199
19202
  }
19200
- let Zc = null, lu = null;
19203
+ let eu = null, du = null;
19201
19204
  function gw() {
19202
- Zc && document.body.contains(Zc) && Zc.remove(), lu && (document.removeEventListener("click", lu), lu = null), Zc = null;
19205
+ eu && document.body.contains(eu) && eu.remove(), du && (document.removeEventListener("click", du), du = null), eu = null;
19203
19206
  }
19204
19207
  function oW(e, t) {
19205
19208
  gw();
@@ -19223,10 +19226,10 @@ function oW(e, t) {
19223
19226
  }, i.appendChild(o);
19224
19227
  }), r.appendChild(i);
19225
19228
  const a = e.target.getBoundingClientRect();
19226
- r.style.left = `${a.left}px`, r.style.top = `${a.bottom}px`, document.body.appendChild(r), Zc = r, setTimeout(() => {
19227
- lu = (s) => {
19229
+ r.style.left = `${a.left}px`, r.style.top = `${a.bottom}px`, document.body.appendChild(r), eu = r, setTimeout(() => {
19230
+ du = (s) => {
19228
19231
  r.contains(s.target) || n();
19229
- }, document.addEventListener("click", lu);
19232
+ }, document.addEventListener("click", du);
19230
19233
  }, 100);
19231
19234
  }
19232
19235
  function Xi(e) {
@@ -19517,7 +19520,7 @@ function dW({
19517
19520
  function OS(e) {
19518
19521
  return e[e.length - 1];
19519
19522
  }
19520
- function ad(e, ...t) {
19523
+ function sd(e, ...t) {
19521
19524
  return t.forEach((r) => {
19522
19525
  e.includes(r) || e.push(r);
19523
19526
  }), e;
@@ -19560,12 +19563,12 @@ function dc(...e) {
19560
19563
  const t = /* @__PURE__ */ new Date(0);
19561
19564
  return t.setFullYear(...e), t.setHours(0, 0, 0, 0);
19562
19565
  }
19563
- function $u(e, t) {
19566
+ function Wu(e, t) {
19564
19567
  const r = new Date(e);
19565
19568
  return r.setDate(r.getDate() + t);
19566
19569
  }
19567
19570
  function pW(e, t) {
19568
- return $u(e, t * 7);
19571
+ return Wu(e, t * 7);
19569
19572
  }
19570
19573
  function Ip(e, t) {
19571
19574
  const r = new Date(e), i = r.getMonth() + t;
@@ -19574,7 +19577,7 @@ function Ip(e, t) {
19574
19577
  const a = r.setMonth(i);
19575
19578
  return r.getMonth() !== n ? r.setDate(0) : a;
19576
19579
  }
19577
- function Wu(e, t) {
19580
+ function qu(e, t) {
19578
19581
  const r = new Date(e), i = r.getMonth(), n = r.setFullYear(r.getFullYear() + t);
19579
19582
  return i === 1 && r.getMonth() === 2 ? r.setDate(0) : n;
19580
19583
  }
@@ -19583,7 +19586,7 @@ function Uw(e, t) {
19583
19586
  }
19584
19587
  function xs(e, t, r = 0) {
19585
19588
  const i = new Date(e).getDay();
19586
- return $u(e, Uw(t, r) - Uw(i, r));
19589
+ return Wu(e, Uw(t, r) - Uw(i, r));
19587
19590
  }
19588
19591
  function JC(e, t) {
19589
19592
  return Math.round((e - t) / 6048e5) + 1;
@@ -19721,7 +19724,7 @@ function zs(e, t, r) {
19721
19724
  return t0(t).parser(e, r);
19722
19725
  }
19723
19726
  }
19724
- function sd(e, t, r) {
19727
+ function od(e, t, r) {
19725
19728
  if (isNaN(e) || !e && e !== 0)
19726
19729
  return "";
19727
19730
  const i = typeof e == "number" ? new Date(e) : e;
@@ -19737,10 +19740,10 @@ function r0(e) {
19737
19740
  function Nf(e) {
19738
19741
  return e.getRootNode().activeElement === e;
19739
19742
  }
19740
- function du(e) {
19743
+ function pu(e) {
19741
19744
  e.style.display !== "none" && (e.style.display && (e.dataset.styleDisplay = e.style.display), e.style.display = "none");
19742
19745
  }
19743
- function pu(e) {
19746
+ function mu(e) {
19744
19747
  e.style.display === "none" && (e.dataset.styleDisplay ? (e.style.display = e.dataset.styleDisplay, delete e.dataset.styleDisplay) : e.style.display = "");
19745
19748
  }
19746
19749
  function yp(e) {
@@ -19785,7 +19788,7 @@ function a0(e, t) {
19785
19788
  const r = typeof t == "function" ? t : (i) => i instanceof Element && i.matches(t);
19786
19789
  return n0(e.composedPath(), r, e.currentTarget);
19787
19790
  }
19788
- const Yc = {
19791
+ const Kc = {
19789
19792
  en: {
19790
19793
  days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
19791
19794
  daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
@@ -19838,7 +19841,7 @@ const Yc = {
19838
19841
  weekStart: DW
19839
19842
  } = FS;
19840
19843
  function vw(e, t) {
19841
- return e.length < 6 && t >= 0 && t < 7 ? ad(e, t) : e;
19844
+ return e.length < 6 && t >= 0 && t < 7 ? sd(e, t) : e;
19842
19845
  }
19843
19846
  function s0(e, t) {
19844
19847
  switch (e === 4 ? t === 6 ? 3 : !t + 1 : e) {
@@ -19912,7 +19915,7 @@ function th(e, t) {
19912
19915
  else {
19913
19916
  const S = i.datesDisabled = w.reduce((T, b) => {
19914
19917
  const P = zs(b, o, u);
19915
- return P !== void 0 ? ad(T, $a(P, m, a)) : T;
19918
+ return P !== void 0 ? sd(T, $a(P, m, a)) : T;
19916
19919
  }, []);
19917
19920
  i.checkDisabled = (T) => S.includes(T);
19918
19921
  }
@@ -20040,7 +20043,7 @@ class LS {
20040
20043
  n.setViewSwitchLabel(t), n.setPrevButtonDisabled(r), n.setNextButtonDisabled(i);
20041
20044
  }
20042
20045
  setDisabled(t, r) {
20043
- r.add("disabled"), ad(this.disabled, t);
20046
+ r.add("disabled"), sd(this.disabled, t);
20044
20047
  }
20045
20048
  // Execute beforeShow() callback and apply the result to the element
20046
20049
  // args:
@@ -20111,7 +20114,7 @@ class RW extends LS {
20111
20114
  weeks: i.lastChild
20112
20115
  }, this.element.insertBefore(i, this.element.firstChild);
20113
20116
  } else this.weekNumbers && !t.weekNumbers && (this.element.removeChild(this.weekNumbers.element), this.weekNumbers = null);
20114
- "getWeekNumber" in t && (this.getWeekNumber = t.getWeekNumber), "showDaysOfWeek" in t && (t.showDaysOfWeek ? (pu(this.dow), this.weekNumbers && pu(this.weekNumbers.dow)) : (du(this.dow), this.weekNumbers && du(this.weekNumbers.dow))), r && Array.from(this.dow.children).forEach((i, n) => {
20117
+ "getWeekNumber" in t && (this.getWeekNumber = t.getWeekNumber), "showDaysOfWeek" in t && (t.showDaysOfWeek ? (mu(this.dow), this.weekNumbers && mu(this.weekNumbers.dow)) : (pu(this.dow), this.weekNumbers && pu(this.weekNumbers.dow))), r && Array.from(this.dow.children).forEach((i, n) => {
20115
20118
  const a = (this.weekStart + n) % 7;
20116
20119
  i.textContent = this.dayNames[a], i.className = this.daysOfWeekDisabled.includes(a) ? "dow disabled" : "dow";
20117
20120
  });
@@ -20129,7 +20132,7 @@ class RW extends LS {
20129
20132
  // Update the entire view UI
20130
20133
  render() {
20131
20134
  if (this.today = this.todayHighlight ? bo() : void 0, this.prepareForRender(
20132
- sd(this.focused, this.switchLabelFormat, this.locale),
20135
+ od(this.focused, this.switchLabelFormat, this.locale),
20133
20136
  this.first <= this.minDate,
20134
20137
  this.last >= this.maxDate
20135
20138
  ), this.weekNumbers) {
@@ -20140,7 +20143,7 @@ class RW extends LS {
20140
20143
  });
20141
20144
  }
20142
20145
  Array.from(this.grid.children).forEach((t, r) => {
20143
- const i = $u(this.start, r), n = new Date(i), a = n.getDay(), s = [];
20146
+ const i = Wu(this.start, r), n = new Date(i), a = n.getDay(), s = [];
20144
20147
  this.today === i && s.push("today"), this.daysOfWeekHighlighted.includes(a) && s.push("highlighted"), this.renderCell(
20145
20148
  t,
20146
20149
  n.getDate(),
@@ -20212,7 +20215,7 @@ class NW extends LS {
20212
20215
  const { dates: t, rangepicker: r } = this.picker.datepicker;
20213
20216
  this.selected = t.reduce((i, n) => {
20214
20217
  const a = new Date(n), s = a.getFullYear(), o = a.getMonth();
20215
- return i[s] === void 0 ? i[s] = [o] : ad(i[s], o), i;
20218
+ return i[s] === void 0 ? i[s] = [o] : sd(i[s], o), i;
20216
20219
  }, {}), r && r.dates && (this.range = r.dates.map((i) => {
20217
20220
  const n = new Date(i);
20218
20221
  return isNaN(n) ? void 0 : [n.getFullYear(), n.getMonth()];
@@ -20274,7 +20277,7 @@ class Mw extends LS {
20274
20277
  // Update view's settings to reflect the selected dates
20275
20278
  updateSelection() {
20276
20279
  const { dates: t, rangepicker: r } = this.picker.datepicker;
20277
- this.selected = t.reduce((i, n) => ad(i, Co(n, this.step)), []), r && r.dates && (this.range = r.dates.map((i) => {
20280
+ this.selected = t.reduce((i, n) => sd(i, Co(n, this.step)), []), r && r.dates && (this.range = r.dates.map((i) => {
20278
20281
  if (i !== void 0)
20279
20282
  return Co(i, this.step);
20280
20283
  }));
@@ -20330,10 +20333,10 @@ function vp(e, t) {
20330
20333
  s = Ip(a, t);
20331
20334
  break;
20332
20335
  case 1:
20333
- s = Wu(a, t);
20336
+ s = qu(a, t);
20334
20337
  break;
20335
20338
  default:
20336
- s = Wu(a, t * n.navStep);
20339
+ s = qu(a, t * n.navStep);
20337
20340
  }
20338
20341
  s = QC(s, r.minDate, r.maxDate), i.changeFocus(s).render();
20339
20342
  }
@@ -20355,7 +20358,7 @@ function l0(e) {
20355
20358
  Nf(r) ? r.addEventListener("blur", t, { once: !0 }) : t();
20356
20359
  }
20357
20360
  function Rw(e, t) {
20358
- const r = e.picker, i = new Date(r.viewDate), n = r.currentView.id, a = n === 1 ? Ip(i, t - i.getMonth()) : Wu(i, t - i.getFullYear());
20361
+ const r = e.picker, i = new Date(r.viewDate), n = r.currentView.id, a = n === 1 ? Ip(i, t - i.getMonth()) : qu(i, t - i.getFullYear());
20359
20362
  r.changeFocus(a).changeView(n - 1).render();
20360
20363
  }
20361
20364
  function AW(e) {
@@ -20379,7 +20382,7 @@ function xW(e) {
20379
20382
  }
20380
20383
  const rh = ["left", "top", "right", "bottom"].reduce((e, t) => (e[t] = `datepicker-orient-${t}`, e), {}), Nw = (e) => e && `${e}px`;
20381
20384
  function Ew(e, t) {
20382
- if ("title" in t && (t.title ? (e.controls.title.textContent = t.title, pu(e.controls.title)) : (e.controls.title.textContent = "", du(e.controls.title))), t.prevArrow) {
20385
+ if ("title" in t && (t.title ? (e.controls.title.textContent = t.title, mu(e.controls.title)) : (e.controls.title.textContent = "", pu(e.controls.title))), t.prevArrow) {
20383
20386
  const r = e.controls.prevButton;
20384
20387
  yp(r), t.prevArrow.forEach((i) => {
20385
20388
  r.appendChild(i.cloneNode(!0));
@@ -20391,11 +20394,11 @@ function Ew(e, t) {
20391
20394
  r.appendChild(i.cloneNode(!0));
20392
20395
  });
20393
20396
  }
20394
- if (t.locale && (e.controls.todayButton.textContent = t.locale.today, e.controls.clearButton.textContent = t.locale.clear), "todayButton" in t && (t.todayButton ? pu(e.controls.todayButton) : du(e.controls.todayButton)), "minDate" in t || "maxDate" in t) {
20397
+ if (t.locale && (e.controls.todayButton.textContent = t.locale.today, e.controls.clearButton.textContent = t.locale.clear), "todayButton" in t && (t.todayButton ? mu(e.controls.todayButton) : pu(e.controls.todayButton)), "minDate" in t || "maxDate" in t) {
20395
20398
  const { minDate: r, maxDate: i } = e.datepicker.config;
20396
20399
  e.controls.todayButton.disabled = !kS(bo(), r, i);
20397
20400
  }
20398
- "clearButton" in t && (t.clearButton ? pu(e.controls.clearButton) : du(e.controls.clearButton));
20401
+ "clearButton" in t && (t.clearButton ? mu(e.controls.clearButton) : pu(e.controls.clearButton));
20399
20402
  }
20400
20403
  function Aw(e) {
20401
20404
  const { dates: t, config: r, rangeSideIndex: i } = e, n = t.length > 0 ? OS(t) : $a(r.defaultViewDate, r.pickLevel, i);
@@ -20554,13 +20557,13 @@ function LW(e, t, r) {
20554
20557
  let s = i.viewDate, o;
20555
20558
  switch (n.id) {
20556
20559
  case 0:
20557
- s = $u(s, r ? t * 7 : t), o = $u;
20560
+ s = Wu(s, r ? t * 7 : t), o = Wu;
20558
20561
  break;
20559
20562
  case 1:
20560
20563
  s = Ip(s, r ? t * 4 : t), o = Ip;
20561
20564
  break;
20562
20565
  default:
20563
- s = Wu(s, t * (r ? 4 : 1) * a), o = Wu;
20566
+ s = qu(s, t * (r ? 4 : 1) * a), o = qu;
20564
20567
  }
20565
20568
  s = p0(
20566
20569
  s,
@@ -20632,7 +20635,7 @@ function $W(e, t) {
20632
20635
  a0(t, (a) => a === r || a === n) || l0(e);
20633
20636
  }
20634
20637
  function m0(e, t) {
20635
- return e.map((r) => sd(r, t.format, t.locale)).join(t.dateDelimiter);
20638
+ return e.map((r) => od(r, t.format, t.locale)).join(t.dateDelimiter);
20636
20639
  }
20637
20640
  function f0(e, t, r = !1) {
20638
20641
  if (t.length === 0)
@@ -20661,7 +20664,7 @@ function Ow(e, t, r) {
20661
20664
  !l && !o || (l && l.toString() !== e.dates.toString() ? (e.dates = l, wp(e, a ? 3 : 1, !0, u), xo(e, "changeDate")) : wp(e, c ? 3 : 1, !0, u), s && e.hide());
20662
20665
  }
20663
20666
  function kw(e, t) {
20664
- return t ? (r) => sd(r, t, e.config.locale) : (r) => new Date(r);
20667
+ return t ? (r) => od(r, t, e.config.locale) : (r) => new Date(r);
20665
20668
  }
20666
20669
  class h0 {
20667
20670
  /**
@@ -20728,7 +20731,7 @@ class h0 {
20728
20731
  * @return {String} formatted date
20729
20732
  */
20730
20733
  static formatDate(t, r, i) {
20731
- return sd(t, r, i && Yc[i] || Yc.en);
20734
+ return od(t, r, i && Kc[i] || Kc.en);
20732
20735
  }
20733
20736
  /**
20734
20737
  * Parse date string
@@ -20746,14 +20749,14 @@ class h0 {
20746
20749
  * @return {Number} time value of parsed date
20747
20750
  */
20748
20751
  static parseDate(t, r, i) {
20749
- return zs(t, r, i && Yc[i] || Yc.en);
20752
+ return zs(t, r, i && Kc[i] || Kc.en);
20750
20753
  }
20751
20754
  /**
20752
20755
  * @type {Object} - Installed locales in `[languageCode]: localeObject` format
20753
20756
  * en`:_English (US)_ is pre-installed.
20754
20757
  */
20755
20758
  static get locales() {
20756
- return Yc;
20759
+ return Kc;
20757
20760
  }
20758
20761
  /**
20759
20762
  * @type {Boolean} - Whether the picker element is shown. `true` whne shown
@@ -20997,7 +21000,7 @@ function WW(e, t, r, i) {
20997
21000
  [r, "changeDate", t]
20998
21001
  ]), new h0(r, i, e);
20999
21002
  }
21000
- function Kc(e, t) {
21003
+ function Xc(e, t) {
21001
21004
  if (e._updating)
21002
21005
  return;
21003
21006
  e._updating = !0;
@@ -21020,14 +21023,14 @@ class qW {
21020
21023
  if (i.length < 2)
21021
21024
  return;
21022
21025
  t.rangepicker = this, this.element = t, this.inputs = i = i.slice(0, 2), Object.freeze(i), this.allowOneSidedRange = !!r.allowOneSidedRange;
21023
- const n = Kc.bind(null, this), a = xw(r), s = this.datepickers = [];
21026
+ const n = Xc.bind(null, this), a = xw(r), s = this.datepickers = [];
21024
21027
  i.forEach((o) => {
21025
21028
  WW(this, n, o, a);
21026
21029
  }), Object.freeze(s), Object.defineProperty(this, "dates", {
21027
21030
  get() {
21028
21031
  return s.map((o) => o.dates[0]);
21029
21032
  }
21030
- }), s[0].dates.length > 0 ? Kc(this, { target: i[0] }) : s[1].dates.length > 0 && Kc(this, { target: i[1] });
21033
+ }), s[0].dates.length > 0 ? Xc(this, { target: i[0] }) : s[1].dates.length > 0 && Xc(this, { target: i[1] });
21031
21034
  }
21032
21035
  /**
21033
21036
  * Set new values to the config options
@@ -21064,7 +21067,7 @@ class qW {
21064
21067
  * @return {Array} - Start and end dates
21065
21068
  */
21066
21069
  getDates(t = void 0) {
21067
- const r = t ? (i) => sd(i, t, this.datepickers[0].config.locale) : (i) => new Date(i);
21070
+ const r = t ? (i) => od(i, t, this.datepickers[0].config.locale) : (i) => new Date(i);
21068
21071
  return this.dates.map((i) => i === void 0 ? i : r(i));
21069
21072
  }
21070
21073
  /**
@@ -21099,7 +21102,7 @@ class qW {
21099
21102
  inputs: [a, s],
21100
21103
  dates: [o, c]
21101
21104
  } = this;
21102
- this._updating = !0, i.setDate(t), n.setDate(r), delete this._updating, n.dates[0] !== c ? Kc(this, { target: s }) : i.dates[0] !== o && Kc(this, { target: a });
21105
+ this._updating = !0, i.setDate(t), n.setDate(r), delete this._updating, n.dates[0] !== c ? Xc(this, { target: s }) : i.dates[0] !== o && Xc(this, { target: a });
21103
21106
  }
21104
21107
  }
21105
21108
  function HW(e, t, r, i, n) {