courthive-components 4.2.0 → 4.4.0

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.
@@ -15274,7 +15274,7 @@ function OC(e) {
15274
15274
  var kC = {
15275
15275
  name: "courthive-components",
15276
15276
  packageManager: "pnpm@12.3.4",
15277
- version: "4.2.0",
15277
+ version: "4.4.0",
15278
15278
  engines: { node: ">=22" },
15279
15279
  description: "Components for competitions projects",
15280
15280
  files: ["dist"],
@@ -28978,27 +28978,32 @@ function Bq(e, t, n, r) {
28978
28978
  return i && n.has(i) ? Lq : i && t.has(i) || e.hasScore && e.winningSide === void 0 && (!i || !r.has(i)) ? Iq : i && r.has(i) || e.winningSide !== void 0 ? zq : Rq;
28979
28979
  }
28980
28980
  function Vq(e, t) {
28981
- let n = t?.inProgressStatuses ?? Nq, r = t?.suspendedStatuses ?? Pq, i = t?.completedStatuses ?? Fq, a = e.cells, o = -1;
28982
- for (let t = 0; t < a.length; t++) {
28983
- let s = a[t];
28984
- if (!s) continue;
28985
- let c = Bq(s, n, r, i);
28986
- if (c === Iq || c === Lq) return {
28981
+ let n = t?.inProgressStatuses ?? Nq, r = t?.suspendedStatuses ?? Pq, i = t?.completedStatuses ?? Fq, a = t?.dueMatchUpIds, o = e.cells, s = -1, c = -1;
28982
+ for (let t = 0; t < o.length; t++) {
28983
+ let l = o[t];
28984
+ if (!l) continue;
28985
+ let u = Bq(l, n, r, i);
28986
+ if (u === Iq || u === Lq) return {
28987
28987
  courtId: e.courtId,
28988
- state: c,
28989
- matchUp: s,
28988
+ state: u,
28989
+ matchUp: l,
28990
28990
  rowIndex: t
28991
28991
  };
28992
- c === Rq && s.calledAt && o === -1 && (o = t);
28992
+ u === Rq && l.calledAt && s === -1 && (s = t), u === Rq && !l.calledAt && c === -1 && a?.has(l.matchUpId) && (c = t);
28993
28993
  }
28994
- return o === -1 ? {
28994
+ return s === -1 ? c === -1 ? {
28995
28995
  courtId: e.courtId,
28996
28996
  state: "free"
28997
+ } : {
28998
+ courtId: e.courtId,
28999
+ state: "due",
29000
+ matchUp: o[c],
29001
+ rowIndex: c
28997
29002
  } : {
28998
29003
  courtId: e.courtId,
28999
29004
  state: "next",
29000
- matchUp: a[o],
29001
- rowIndex: o
29005
+ matchUp: o[s],
29006
+ rowIndex: s
29002
29007
  };
29003
29008
  }
29004
29009
  function Hq(e, t) {
@@ -29116,11 +29121,11 @@ function Zq(e, t, n, r, i) {
29116
29121
  });
29117
29122
  }
29118
29123
  function Qq(e) {
29119
- return e === "in-progress" ? "LIVE" : e === "suspended" ? "SUSP" : e === "next" ? "NEXT" : null;
29124
+ return e === "in-progress" ? "LIVE" : e === "suspended" ? "SUSP" : e === "next" ? "NEXT" : e === "due" ? "DUE" : null;
29120
29125
  }
29121
- function $q(e, t, n, r, i) {
29122
- let a = document.createElement("div");
29123
- if (a.className = `spl-active-strip-cell state-${e.state}`, i && (a.classList.add("has-availability-block"), e.state !== "free" && e.matchUp && a.classList.add("has-block-conflict")), a.dataset.courtId = e.courtId, e.rowIndex !== void 0 && (a.dataset.rowIndex = String(e.rowIndex)), r.cellHeight && (a.style.minHeight = r.cellHeight), i) {
29126
+ function $q(e, t, n, r, i, a) {
29127
+ let o = document.createElement("div");
29128
+ if (o.className = `spl-active-strip-cell state-${e.state}`, i && (o.classList.add("has-availability-block"), e.state !== "free" && e.matchUp && o.classList.add("has-block-conflict")), o.dataset.courtId = e.courtId, e.rowIndex !== void 0 && (o.dataset.rowIndex = String(e.rowIndex)), r.cellHeight && (o.style.minHeight = r.cellHeight), i) {
29124
29129
  let e = document.createElement("div");
29125
29130
  e.className = `spl-active-strip-block-banner block-${i.type.toLowerCase()}`;
29126
29131
  let t = document.createElement("span");
@@ -29128,22 +29133,28 @@ function $q(e, t, n, r, i) {
29128
29133
  let t = document.createElement("span");
29129
29134
  t.className = "spl-active-strip-block-detail", t.textContent = i.detail, e.appendChild(t);
29130
29135
  }
29131
- a.appendChild(e);
29136
+ o.appendChild(e);
29132
29137
  }
29133
29138
  if (e.state !== "free" && e.matchUp) {
29134
29139
  let t = r.renderCell?.(e.matchUp);
29135
- if (t) a.appendChild(t);
29140
+ if (t) o.appendChild(t);
29136
29141
  else {
29137
29142
  let t = document.createElement("div");
29138
- t.className = "spl-active-strip-body", t.textContent = e.matchUp.participantIds.join(" – ") || e.matchUp.matchUpId, a.appendChild(t);
29143
+ t.className = "spl-active-strip-body", t.textContent = e.matchUp.participantIds.join(" – ") || e.matchUp.matchUpId, o.appendChild(t);
29139
29144
  }
29140
29145
  }
29141
- let o = Qq(e.state);
29142
- if (o) {
29146
+ let s = e.state !== "free" && !!e.matchUp;
29147
+ if (!s && !i && a?.upcoming) {
29148
+ let e = document.createElement("div");
29149
+ e.className = `spl-active-strip-runway block-${a.upcoming.type.toLowerCase()}`, e.textContent = a.upcoming.label, a.upcoming.title && (e.title = a.upcoming.title), o.appendChild(e);
29150
+ }
29151
+ s && a?.edge && (o.classList.add("has-block-edge", `edge-${a.edge.type.toLowerCase()}`), a.edge.title && (o.title = a.edge.title));
29152
+ let c = Qq(e.state);
29153
+ if (c) {
29143
29154
  let t = document.createElement("span");
29144
- t.className = "spl-active-strip-state-pill", t.textContent = o, e.state === "suspended" && (t.title = "Suspended"), a.appendChild(t);
29155
+ t.className = "spl-active-strip-state-pill", t.textContent = c, e.state === "suspended" && (t.title = "Suspended"), e.state === "due" && (t.title = "Should have started — not called to court"), o.appendChild(t);
29145
29156
  }
29146
- return Zq(a, e, t, n, r.statusOptions), a;
29157
+ return Zq(o, e, t, n, r.statusOptions), o;
29147
29158
  }
29148
29159
  function eJ(e) {
29149
29160
  let t = document.createElement("div");
@@ -29165,10 +29176,16 @@ function tJ(e = {}, t = {}) {
29165
29176
  }
29166
29177
  function a() {
29167
29178
  n.innerHTML = "", r.gridTemplateColumns ? (n.style.display = "grid", n.style.gridTemplateColumns = r.gridTemplateColumns) : (n.style.display = "", n.style.gridTemplateColumns = ""), n.style.minWidth = r.minWidth ?? "", n.appendChild(eJ(t));
29168
- let a = Hq(r.grid, t.statusOptions);
29169
- for (let o of a) {
29170
- let a = r.courtBlocks?.[o.courtId];
29171
- n.appendChild($q(o, e, i, t, a));
29179
+ let a = r.dueMatchUpIds ? {
29180
+ ...t.statusOptions,
29181
+ dueMatchUpIds: new Set(r.dueMatchUpIds)
29182
+ } : t.statusOptions, o = Hq(r.grid, a);
29183
+ for (let a of o) {
29184
+ let o = r.courtBlocks?.[a.courtId], s = {
29185
+ upcoming: r.courtUpcomingBlocks?.[a.courtId],
29186
+ edge: r.courtBlockEdges?.[a.courtId]
29187
+ };
29188
+ n.appendChild($q(a, e, i, t, o, s));
29172
29189
  }
29173
29190
  }
29174
29191
  function o(e) {