@wral/hsot-data 0.1.12 → 0.1.13

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.
@@ -8,39 +8,39 @@ function de(a = {}) {
8
8
  }
9
9
  function he({ baseUrl: a, token: e = "", fetchFn: t } = {}) {
10
10
  if (!a) throw new Error("createClient requires a baseUrl");
11
- const s = a.replace(/\/+$/, ""), o = t || ((...l) => fetch(...l));
12
- async function r(l) {
11
+ const s = a.replace(/\/+$/, ""), o = t || ((...n) => fetch(...n));
12
+ async function r(n) {
13
13
  const h = { Accept: "application/json" };
14
14
  e && (h.Authorization = `Bearer ${e}`);
15
- const n = await o(`${s}${l}`, { headers: h });
16
- if (!n.ok) {
17
- const c = new Error(`api-hsot ${n.status} on ${l}`);
18
- throw c.status = n.status, c;
15
+ const l = await o(`${s}${n}`, { headers: h });
16
+ if (!l.ok) {
17
+ const c = new Error(`api-hsot ${l.status} on ${n}`);
18
+ throw c.status = l.status, c;
19
19
  }
20
- return n.json();
20
+ return l.json();
21
21
  }
22
- async function d(l, h = {}) {
23
- const n = [];
22
+ async function d(n, h = {}) {
23
+ const l = [];
24
24
  let c = null;
25
25
  for (let m = 0; m < ce; m += 1) {
26
- const f = de(c ? { ...h, cursor: c } : h), g = await r(`${l}${f}`);
27
- if (n.push(...g.items || []), c = g.nextCursor || null, !c) break;
26
+ const f = de(c ? { ...h, cursor: c } : h), g = await r(`${n}${f}`);
27
+ if (l.push(...g.items || []), c = g.nextCursor || null, !c) break;
28
28
  }
29
- return { items: n, total: n.length, nextCursor: null };
29
+ return { items: l, total: l.length, nextCursor: null };
30
30
  }
31
31
  return {
32
- listSchools: (l) => d("/schools", l),
33
- getSchool: (l) => r(`/schools/${l}`),
34
- listTeams: (l) => d("/teams", l),
35
- getTeam: (l) => r(`/teams/${l}`),
36
- listConferences: (l) => d("/conferences", l),
37
- listPlayers: (l) => d("/players", l),
38
- listRosters: (l) => d("/rosters", l),
39
- listGames: (l) => d("/games", l),
40
- getGame: (l) => r(`/games/${l}`),
41
- listTournaments: (l) => d("/tournaments", l),
42
- listSeedings: (l, h) => d(`/tournaments/${l}/seedings`, h),
43
- listRankings: (l) => d("/rankings", l),
32
+ listSchools: (n) => d("/schools", n),
33
+ getSchool: (n) => r(`/schools/${n}`),
34
+ listTeams: (n) => d("/teams", n),
35
+ getTeam: (n) => r(`/teams/${n}`),
36
+ listConferences: (n) => d("/conferences", n),
37
+ listPlayers: (n) => d("/players", n),
38
+ listRosters: (n) => d("/rosters", n),
39
+ listGames: (n) => d("/games", n),
40
+ getGame: (n) => r(`/games/${n}`),
41
+ listTournaments: (n) => d("/tournaments", n),
42
+ listSeedings: (n, h) => d(`/tournaments/${n}/seedings`, h),
43
+ listRankings: (n) => d("/rankings", n),
44
44
  listSports: () => r("/sports")
45
45
  };
46
46
  }
@@ -59,7 +59,7 @@ function D(a) {
59
59
  section: a.getAttribute("section-href") || H.section
60
60
  };
61
61
  }
62
- const I = (a) => a ? a.charAt(0).toUpperCase() + a.slice(1) : "";
62
+ const S = (a) => a ? a.charAt(0).toUpperCase() + a.slice(1) : "";
63
63
  function y(a, e) {
64
64
  if (!a) return "TBD";
65
65
  const [t, s, o] = String(a).split("-").map(Number);
@@ -75,6 +75,9 @@ function U(a) {
75
75
  function me(a) {
76
76
  return a ? `${Math.floor(a / 12)}-${a % 12}` : "·";
77
77
  }
78
+ function pe(a) {
79
+ return (Array.isArray(a?.positions) ? a.positions : String(a?.position ?? "").split(/[/,]/)).map((t) => String(t ?? "").trim()).filter(Boolean).join("/");
80
+ }
78
81
  function N(a = /* @__PURE__ */ new Date()) {
79
82
  const e = a.getFullYear();
80
83
  return a.getMonth() >= 6 ? `${e}-${e + 1}` : `${e - 1}-${e}`;
@@ -83,7 +86,7 @@ function M(a = /* @__PURE__ */ new Date()) {
83
86
  const e = (t) => String(t).padStart(2, "0");
84
87
  return `${a.getFullYear()}-${e(a.getMonth() + 1)}-${e(a.getDate())}`;
85
88
  }
86
- function pe(a, e = M()) {
89
+ function fe(a, e = M()) {
87
90
  const t = [...new Set((a || []).filter(Boolean))].sort();
88
91
  if (!t.length || t.includes(e)) return e;
89
92
  const s = t.filter((o) => o < e);
@@ -97,7 +100,7 @@ function E(a) {
97
100
  const e = parseInt(a.slice(1), 16), t = e >> 16 & 255, s = e >> 8 & 255, o = e & 255;
98
101
  return 0.299 * t + 0.587 * s + 0.114 * o > 150 ? "#0F1B33" : "#FFFFFF";
99
102
  }
100
- const fe = (a) => {
103
+ const ue = (a) => {
101
104
  const e = ["th", "st", "nd", "rd"], t = a % 100;
102
105
  return a + (e[(t - 20) % 10] || e[t] || e[0]);
103
106
  };
@@ -108,7 +111,7 @@ function X(a, e) {
108
111
  }, s = t(a), o = t(e);
109
112
  return s !== null && o !== null && s !== o ? o - s : s !== null && o === null ? -1 : s === null && o !== null ? 1 : String(a ?? "").localeCompare(String(e ?? ""), "en", { sensitivity: "base" });
110
113
  }
111
- function ue(a, e) {
114
+ function ge(a, e) {
112
115
  const t = (s) => String(s?.name ?? s ?? "");
113
116
  return t(a).localeCompare(t(e), "en", { numeric: !0, sensitivity: "base" });
114
117
  }
@@ -120,7 +123,7 @@ function se(a) {
120
123
  }
121
124
  return a.state === "postponed" ? { kind: "warn", label: "Postponed" } : a.state === "canceled" ? { kind: "warn", label: "Canceled" } : { kind: "sched", label: `${y(a.date, { month: "short", day: "numeric" })} · ${U(a.time)}`.replace(/ · $/, "") };
122
125
  }
123
- const ge = /* @__PURE__ */ new Set(["game", "story", "page", "forum", "video", "gallery"]);
126
+ const ve = /* @__PURE__ */ new Set(["game", "story", "page", "forum", "video", "gallery"]);
124
127
  function x(a) {
125
128
  let e = String(a || "").replace(/^[a-z][a-z0-9+.-]*:\/\/[^/#?]*/i, "");
126
129
  const t = e.indexOf("#");
@@ -135,7 +138,7 @@ function ae() {
135
138
  const e = (a.hash || "").startsWith("#/") ? a.hash : "";
136
139
  return x((a.pathname || "") + e);
137
140
  }
138
- function ve(a, e, t) {
141
+ function be(a, e, t) {
139
142
  if (!t) return null;
140
143
  const s = x(a);
141
144
  if (!s) return null;
@@ -144,23 +147,23 @@ function ve(a, e, t) {
144
147
  const d = x(u(e.section, { sport: t, view: "" }));
145
148
  if (s === d) return "";
146
149
  if (!s.startsWith(`${d}/`)) return null;
147
- const l = s.slice(d.length + 1), h = l.split("/");
148
- return h.length > 2 || h.some((n) => !/^[a-z][a-z-]*$/.test(n)) || ge.has(h[0]) ? null : l;
150
+ const n = s.slice(d.length + 1), h = n.split("/");
151
+ return h.length > 2 || h.some((l) => !/^[a-z][a-z-]*$/.test(l)) || ve.has(h[0]) ? null : n;
149
152
  }
150
- function be(a, e, t) {
153
+ function ye(a, e, t) {
151
154
  const s = (d) => u(t.section, { sport: a, view: d }).replace(/([^:])\/{2,}/g, "$1/"), r = new Set((e || []).map((d) => d && d.gender).filter((d) => d === "boys" || d === "girls")).size === 2 ? [
152
155
  { label: "Boys Standings", href: s("boys/standings") },
153
156
  { label: "Girls Standings", href: s("girls/standings") }
154
157
  ] : [{ label: "Standings", href: s("standings") }];
155
158
  return [
156
- { label: `${I(a)} Home`, href: s("") },
159
+ { label: `${S(a)} Home`, href: s("") },
157
160
  { label: "Scores/Schedule", href: s("scores") },
158
161
  { label: "Playoff Brackets", href: s("brackets") },
159
162
  ...r,
160
163
  { label: "Polls & Rankings", href: s("rankings") }
161
164
  ];
162
165
  }
163
- function ye(a, e = ae()) {
166
+ function $e(a, e = ae()) {
164
167
  const t = x(e);
165
168
  for (const s of a.querySelectorAll(':scope > a[slot="nav"]'))
166
169
  t && x(s.getAttribute("href")) === t ? s.setAttribute("aria-current", "page") : s.removeAttribute("aria-current");
@@ -196,7 +199,7 @@ class $ extends te {
196
199
  this.load();
197
200
  }
198
201
  updated(e) {
199
- e.has("api") && e.get("api") !== void 0 && e.get("api") !== this.api && this.load(), e.has("refreshInterval") && this._setupInterval(), ye(this);
202
+ e.has("api") && e.get("api") !== void 0 && e.get("api") !== this.api && this.load(), e.has("refreshInterval") && this._setupInterval(), $e(this);
200
203
  }
201
204
  async load() {
202
205
  const e = this.client;
@@ -231,7 +234,7 @@ class $ extends te {
231
234
  return i``;
232
235
  }
233
236
  }
234
- const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), $e = b`
237
+ const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), we = b`
235
238
  :host {
236
239
  --hsot-red: var(--color-red, #D1232A);
237
240
  --hsot-red-deep: var(--color-red-dark, #951C21);
@@ -269,7 +272,7 @@ const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), $e = b`
269
272
  outline-offset: 1px;
270
273
  }
271
274
  .mut { color: var(--hsot-gray-5); }
272
- `, we = b`
275
+ `, xe = b`
273
276
  .band { background: var(--hsot-white); color: var(--hsot-black); }
274
277
  .band .inner { max-width: 1366px; margin: 0 auto; padding: 1.1rem 1.25rem 0; }
275
278
  .band h1, .band h2.bandtitle {
@@ -318,7 +321,7 @@ const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), $e = b`
318
321
  @media (max-width: 720px) {
319
322
  .band h1, .band h2.bandtitle, .band.section h1, .band.section h2.bandtitle { font-size: 1.8rem; }
320
323
  }
321
- `, xe = b`
324
+ `, ke = b`
322
325
  .view { max-width: 1366px; margin: 0 auto; padding: 1.25rem; box-sizing: border-box; }
323
326
  /* Optional right rail (slot="rail" light-DOM children): a divided 300px
324
327
  column on desktop, stacked under the view content on smaller screens. */
@@ -382,7 +385,7 @@ const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), $e = b`
382
385
  .error { padding: 1.2rem 1rem; color: var(--hsot-red-deep); font-size: 0.9rem; }
383
386
  .note { font-size: 0.8125rem; color: var(--hsot-gray-5); margin: 0.6rem 0 0; }
384
387
  .loading { padding: 1.2rem; color: var(--hsot-gray-5); font-family: var(--hsot-heading-font); }
385
- `, ke = b`
388
+ `, Te = b`
386
389
  .pill {
387
390
  display: inline-block; font-family: var(--hsot-heading-font); font-weight: 700;
388
391
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em;
@@ -397,7 +400,7 @@ const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), $e = b`
397
400
  .pill.champ { background: var(--hsot-straw); color: #6b5900; }
398
401
  @keyframes hsot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
399
402
  @media (prefers-reduced-motion: reduce) { .pill.live { animation: none; } }
400
- `, Te = b`
403
+ `, Se = b`
401
404
  .tablewrap { overflow-x: auto; }
402
405
  table.data { font-family: var(--hsot-heading-font); font-size: 14px; border-collapse: collapse; width: 100%; }
403
406
  table.data th {
@@ -439,7 +442,7 @@ const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), $e = b`
439
442
  .dot.W { background: var(--hsot-win); }
440
443
  .dot.L { background: var(--hsot-loss); }
441
444
  .dot.T { background: var(--hsot-tie); }
442
- `, Se = b`
445
+ `, Ce = b`
443
446
  ul.gamelist { list-style: none; margin: 0; padding: 0; }
444
447
  .gamelist li {
445
448
  display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 1rem;
@@ -489,24 +492,24 @@ const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), $e = b`
489
492
  .gamelist .ff { color: var(--hsot-gray-5); font-size: 0.78rem; font-style: italic; }
490
493
  .gamelist .where { color: var(--hsot-gray-5); font-size: 0.78rem; }
491
494
  .gamelist a.box { font-size: 0.78rem; }
492
- `, F = [$e, we, xe, ke, Te, Ie, Se];
495
+ `, F = [we, xe, ke, Te, Se, Ie, Ce];
493
496
  function G(a) {
494
497
  return a.state !== "final" ? null : a.forfeit === "home" ? "away" : a.forfeit === "away" || a.homeScore > a.awayScore ? "home" : a.awayScore > a.homeScore ? "away" : a.tiebreakWinner && a.tiebreakWinner !== "none" ? a.tiebreakWinner : "tie";
495
498
  }
496
- function Ce(a) {
499
+ function De(a) {
497
500
  return a && (a.forfeit === "home" || a.forfeit === "away") ? a.forfeit : null;
498
501
  }
499
502
  function z(a, e) {
500
503
  const t = {}, s = (r) => (t[r] = t[r] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, t[r]), o = a.filter((r) => r.state === "final" && r.gameType !== "scrimmage" && (!e || r.date <= e)).sort((r, d) => String(r.date).localeCompare(String(d.date)));
501
504
  for (const r of o) {
502
- const d = G(r), l = r.gameType === "conference";
505
+ const d = G(r), n = r.gameType === "conference";
503
506
  for (const h of ["home", "away"]) {
504
- const n = h === "home" ? r.homeTeamId : r.awayTeamId;
505
- if (!n) continue;
506
- const c = s(n), m = h === "home" ? r.homeScore : r.awayScore, f = h === "home" ? r.awayScore : r.homeScore;
507
+ const l = h === "home" ? r.homeTeamId : r.awayTeamId;
508
+ if (!l) continue;
509
+ const c = s(l), m = h === "home" ? r.homeScore : r.awayScore, f = h === "home" ? r.awayScore : r.homeScore;
507
510
  c.pf += m, c.pa += f;
508
511
  let g = "T";
509
- d === "tie" ? (c.t += 1, l && (c.ct += 1)) : d === h ? (c.w += 1, l && (c.cw += 1), g = "W") : (c.l += 1, l && (c.cl += 1), g = "L"), c.results.push({ gameId: r.id, date: r.date, mark: g, my: m, their: f, opp: h === "home" ? r.awayTeamId : r.homeTeamId, conf: l });
512
+ d === "tie" ? (c.t += 1, n && (c.ct += 1)) : d === h ? (c.w += 1, n && (c.cw += 1), g = "W") : (c.l += 1, n && (c.cl += 1), g = "L"), c.results.push({ gameId: r.id, date: r.date, mark: g, my: m, their: f, opp: h === "home" ? r.awayTeamId : r.homeTeamId, conf: n });
510
513
  }
511
514
  }
512
515
  return t;
@@ -540,7 +543,7 @@ function ee(a, e) {
540
543
  const t = a[e];
541
544
  return t && t.results.length ? t.results[t.results.length - 1] : null;
542
545
  }
543
- function Ve(a, e, t, s = "") {
546
+ function Ye(a, e, t, s = "") {
544
547
  let o = null;
545
548
  for (const r of a || [])
546
549
  r.sport === e && (t && r.effectiveDate > t || s && r.gender && r.gender !== s || (!o || r.effectiveDate > o.effectiveDate) && (o = r));
@@ -552,17 +555,17 @@ function W(a, e, t, s, o) {
552
555
  const d = /* @__PURE__ */ new Map();
553
556
  for (const h of a || []) {
554
557
  if (h.sport !== s || o && h.effectiveDate > o || h.gender && r.gender !== h.gender && r.gender !== "coed") continue;
555
- const n = h.gender || "", c = d.get(n);
556
- (!c || h.effectiveDate > c.effectiveDate) && d.set(n, h);
558
+ const l = h.gender || "", c = d.get(l);
559
+ (!c || h.effectiveDate > c.effectiveDate) && d.set(l, h);
557
560
  }
558
- let l = null;
561
+ let n = null;
559
562
  for (const h of d.values()) {
560
- const n = (h.teamIds || []).indexOf(t);
561
- n !== -1 && (!l || h.effectiveDate > l.effectiveDate) && (l = { poll: h, rank: n + 1 });
563
+ const l = (h.teamIds || []).indexOf(t);
564
+ l !== -1 && (!n || h.effectiveDate > n.effectiveDate) && (n = { poll: h, rank: l + 1 });
562
565
  }
563
- return l ? l.rank : null;
566
+ return n ? n.rank : null;
564
567
  }
565
- function De(a, e, t) {
568
+ function Fe(a, e, t) {
566
569
  if (!a) return { kind: "none", delta: 0 };
567
570
  const s = (a.teamIds || []).indexOf(t) + 1;
568
571
  if (!s) return { kind: "none", delta: 0 };
@@ -572,11 +575,11 @@ function De(a, e, t) {
572
575
  const r = o - s;
573
576
  return r > 0 ? { kind: "up", delta: r } : r < 0 ? { kind: "down", delta: -r } : { kind: "same", delta: 0 };
574
577
  }
575
- function Fe(a) {
578
+ function ze(a) {
576
579
  return /^https?:\/\//i.test(String(a || ""));
577
580
  }
578
581
  function re(a, { w: e, h: t } = {}) {
579
- if (!Fe(a)) return "";
582
+ if (!ze(a)) return "";
580
583
  const s = [];
581
584
  e && s.push(`w=${Math.max(1, Math.round(e))}`), t && s.push(`h=${Math.max(1, Math.round(t))}`), s.push("f=webp");
582
585
  const o = a.includes("?") ? "&" : "?";
@@ -586,22 +589,22 @@ function A(a, e) {
586
589
  const t = e * 2;
587
590
  return re(a?.logoAssetId, { w: t, h: t });
588
591
  }
589
- function ze(a, e) {
592
+ function Be(a, e) {
590
593
  return re(a?.photoAssetId, { w: e * 2 });
591
594
  }
592
595
  function V(a, e, { title: t, sub: s, teams: o }) {
593
- const r = ae(), l = !!a.querySelector(':scope > a[slot="nav"]') || ve(r, e.hrefs, e.sport) !== null;
596
+ const r = ae(), n = !!a.querySelector(':scope > a[slot="nav"]') || be(r, e.hrefs, e.sport) !== null;
594
597
  return i`
595
598
  <div class="band section">
596
599
  <div class="inner">
597
600
  <h1>${t}</h1>
598
601
  ${s ? i`<p class="sub">${s}</p>` : p}
599
602
  </div>
600
- ${l ? i`
601
- <nav class="sectionnav" aria-label="${I(e.sport)} section">
603
+ ${n ? i`
604
+ <nav class="sectionnav" aria-label="${S(e.sport)} section">
602
605
  <div class="navrow">
603
606
  <slot name="nav">
604
- ${be(e.sport, o, e.hrefs).map((h) => i`<a href=${h.href}
607
+ ${ye(e.sport, o, e.hrefs).map((h) => i`<a href=${h.href}
605
608
  aria-current=${r && x(h.href) === r ? "page" : p}>${h.label}</a>`)}
606
609
  </slot>
607
610
  </div>
@@ -609,10 +612,10 @@ function V(a, e, { title: t, sub: s, teams: o }) {
609
612
  </div>
610
613
  `;
611
614
  }
612
- const S = (a, e) => {
615
+ const I = (a, e) => {
613
616
  const t = a.teamsById[e];
614
617
  return t ? a.schoolsById[t.schoolId] : null;
615
- }, T = (a, e) => S(a, e)?.name || "TBD", _ = (a, e) => S(a, e)?.abbr || "TBD";
618
+ }, T = (a, e) => I(a, e)?.name || "TBD", _ = (a, e) => I(a, e)?.abbr || "TBD";
616
619
  function C(a, e = 26) {
617
620
  if (!a) return p;
618
621
  const t = A(a, e);
@@ -629,7 +632,7 @@ function Y(a, e, t) {
629
632
  return s ? i`<span class="rankbadge">#${s}</span>` : p;
630
633
  }
631
634
  function ie(a, e, t) {
632
- const s = S(a, e);
635
+ const s = I(a, e);
633
636
  return s ? i`${Y(a, e, t)}<a href=${u(a.hrefs.school, { id: s.id })}>${s.name}</a>` : i`<span class="mut">TBD</span>`;
634
637
  }
635
638
  function K(a, e, t = 5) {
@@ -662,7 +665,7 @@ function ne(a, e, t) {
662
665
  const s = e.homeTeamId === t ? e.awayTeamId : e.homeTeamId, o = e.homeTeamId === t ? "vs" : "at";
663
666
  return i`${e.state === "live" ? i`<span class="pill live">Live</span> ` : i`${y(e.date, { month: "numeric", day: "numeric" })} `}${o} ${_(a, s)}`;
664
667
  }
665
- class Be extends $ {
668
+ class Pe extends $ {
666
669
  static styles = F;
667
670
  static properties = {
668
671
  ...$.properties,
@@ -681,20 +684,20 @@ class Be extends $ {
681
684
  this._datePinned = !!this.date;
682
685
  }
683
686
  async fetchData(e) {
684
- const t = this.season || N(), [s, o, r, d, l] = await Promise.all([
687
+ const t = this.season || N(), [s, o, r, d, n] = await Promise.all([
685
688
  e.listSchools(),
686
689
  e.listTeams({ sport: this.sport }),
687
690
  e.listConferences(),
688
691
  e.listGames({ sport: this.sport, season: t }),
689
692
  e.listRankings({ sport: this.sport })
690
693
  ]);
691
- return this._datePinned || (this.date = pe(d.items.map((h) => h.date)), this._datePinned = !0), {
694
+ return this._datePinned || (this.date = fe(d.items.map((h) => h.date)), this._datePinned = !0), {
692
695
  season: t,
693
696
  schools: s.items,
694
697
  teams: o.items,
695
698
  conferences: r.items,
696
699
  games: d.items,
697
- rankings: l.items
700
+ rankings: n.items
698
701
  };
699
702
  }
700
703
  get ctx() {
@@ -708,18 +711,18 @@ class Be extends $ {
708
711
  }, this._ctxData = this.data), this._ctx;
709
712
  }
710
713
  renderView() {
711
- const e = this.ctx, t = v(this.data.conferences), s = [...new Set(this.data.games.map((n) => n.date).filter(Boolean))].sort(), o = Number.MAX_SAFE_INTEGER, r = (n) => {
712
- const c = [n.awayTeamId, n.homeTeamId].map((m) => W(e.rankings, e.teamsById, m, this.sport, n.date)).filter(Boolean);
714
+ const e = this.ctx, t = v(this.data.conferences), s = [...new Set(this.data.games.map((l) => l.date).filter(Boolean))].sort(), o = Number.MAX_SAFE_INTEGER, r = (l) => {
715
+ const c = [l.awayTeamId, l.homeTeamId].map((m) => W(e.rankings, e.teamsById, m, this.sport, l.date)).filter(Boolean);
713
716
  return c.length ? Math.min(...c) : o;
714
- }, d = this.data.games.filter((n) => n.date === this.date), l = new Map(d.map((n) => [n, r(n)]));
715
- d.sort((n, c) => (n.state === "live" ? 0 : 1) - (c.state === "live" ? 0 : 1) || l.get(n) - l.get(c));
717
+ }, d = this.data.games.filter((l) => l.date === this.date), n = new Map(d.map((l) => [l, r(l)]));
718
+ d.sort((l, c) => (l.state === "live" ? 0 : 1) - (c.state === "live" ? 0 : 1) || n.get(l) - n.get(c));
716
719
  const h = /* @__PURE__ */ new Map();
717
- return d.forEach((n) => {
718
- const c = n.gameType === "conference" && n.conferenceId ? t[n.conferenceId]?.name || "Conference" : n.gameType === "playoff" ? "Playoffs" : n.gameType === "scrimmage" ? "Scrimmages" : "Nonconference";
719
- h.has(c) || h.set(c, []), h.get(c).push(n);
720
+ return d.forEach((l) => {
721
+ const c = l.gameType === "conference" && l.conferenceId ? t[l.conferenceId]?.name || "Conference" : l.gameType === "playoff" ? "Playoffs" : l.gameType === "scrimmage" ? "Scrimmages" : "Nonconference";
722
+ h.has(c) || h.set(c, []), h.get(c).push(l);
720
723
  }), i`
721
724
  ${V(this, e, {
722
- title: i`${I(this.sport)} scores &amp; schedules`,
725
+ title: i`${S(this.sport)} scores &amp; schedules`,
723
726
  sub: i`${y(this.date, { weekday: "long", month: "long", day: "numeric", year: "numeric" })} · ${d.length} games`,
724
727
  teams: this.data.teams
725
728
  })}
@@ -727,11 +730,11 @@ class Be extends $ {
727
730
  ${P(this)}
728
731
  <div class="toolbar">
729
732
  <label class="asof" for="datesel">Date</label>
730
- <select id="datesel" @change=${(n) => {
731
- this.date = n.target.value;
733
+ <select id="datesel" @change=${(l) => {
734
+ this.date = l.target.value;
732
735
  }}>
733
- ${(s.includes(this.date) ? s : [...s, this.date].sort()).map((n) => i`<option value=${n} ?selected=${n === this.date}>
734
- ${y(n, { weekday: "short", month: "short", day: "numeric" })}${n === M() ? " · today" : ""}
736
+ ${(s.includes(this.date) ? s : [...s, this.date].sort()).map((l) => i`<option value=${l} ?selected=${l === this.date}>
737
+ ${y(l, { weekday: "short", month: "short", day: "numeric" })}${l === M() ? " · today" : ""}
735
738
  </option>`)}
736
739
  </select>
737
740
  <button class="chip" ?disabled=${s.indexOf(this.date) <= 0}
@@ -746,8 +749,8 @@ class Be extends $ {
746
749
  <span class="asof">Live games first · report a score to see it update here</span>
747
750
  </div>
748
751
  ${d.length ? p : i`<p class="empty">No ${this.sport} games on this date.</p>`}
749
- ${[...h.entries()].map(([n, c]) => i`
750
- <div class="section-title">${n}</div>
752
+ ${[...h.entries()].map(([l, c]) => i`
753
+ <div class="section-title">${l}</div>
751
754
  <div class="card"><ul class="gamelist">
752
755
  ${c.map((m) => this.renderGame(e, m))}
753
756
  </ul></div>
@@ -759,7 +762,7 @@ class Be extends $ {
759
762
  // a lone score column on the far right read as detached from the teams).
760
763
  // Scheduled games carry their start time on the status pill alone.
761
764
  renderGame(e, t) {
762
- const s = t.state === "final" || t.state === "live", o = (d, l, h = p) => i`<span class="side">${ie(e, d, t.date)}${s ? i`<span class="score">${l}</span>` : p}${h}</span>`, r = Ce(t);
765
+ const s = t.state === "final" || t.state === "live", o = (d, n, h = p) => i`<span class="side">${ie(e, d, t.date)}${s ? i`<span class="score">${n}</span>` : p}${h}</span>`, r = De(t);
763
766
  return i`
764
767
  <li>
765
768
  ${R(t)}
@@ -772,8 +775,8 @@ class Be extends $ {
772
775
  `;
773
776
  }
774
777
  }
775
- globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores", Be);
776
- class Pe extends $ {
778
+ globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores", Pe);
779
+ class Ee extends $ {
777
780
  static styles = F;
778
781
  static properties = {
779
782
  ...$.properties,
@@ -786,7 +789,7 @@ class Pe extends $ {
786
789
  super(), this.sport = "football", this.season = "", this.classFilter = "All", this.query = "";
787
790
  }
788
791
  async fetchData(e) {
789
- const t = this.season || N(), [s, o, r, d, l] = await Promise.all([
792
+ const t = this.season || N(), [s, o, r, d, n] = await Promise.all([
790
793
  e.listConferences({ active: !0 }),
791
794
  e.listSchools(),
792
795
  e.listTeams({ sport: this.sport }),
@@ -799,7 +802,7 @@ class Pe extends $ {
799
802
  schools: o.items,
800
803
  teams: r.items,
801
804
  games: d.items,
802
- rankings: l.items
805
+ rankings: n.items
803
806
  };
804
807
  }
805
808
  get ctx() {
@@ -813,10 +816,10 @@ class Pe extends $ {
813
816
  }, this._ctxData = this.data), this._ctx;
814
817
  }
815
818
  renderView() {
816
- const e = this.ctx, t = ["All", ...[...new Set(this.data.conferences.flatMap((o) => o.classifications || []))].sort(X)].slice(0, 9), s = this.data.conferences.filter((o) => o.active !== !1).filter((o) => this.classFilter === "All" || (o.classifications || []).includes(this.classFilter)).sort(ue);
819
+ const e = this.ctx, t = ["All", ...[...new Set(this.data.conferences.flatMap((o) => o.classifications || []))].sort(X)].slice(0, 9), s = this.data.conferences.filter((o) => o.active !== !1).filter((o) => this.classFilter === "All" || (o.classifications || []).includes(this.classFilter)).sort(ge);
817
820
  return i`
818
821
  ${V(this, e, {
819
- title: i`${I(this.sport)} standings`,
822
+ title: i`${S(this.sport)} standings`,
820
823
  sub: i`${this.data.season} season · every conference, computed live from reported results`,
821
824
  teams: this.data.teams
822
825
  })}
@@ -858,7 +861,7 @@ class Pe extends $ {
858
861
  <th>Streak</th><th>Last 5</th><th>Next</th>
859
862
  </tr></thead>
860
863
  <tbody>
861
- ${r.map((d, l) => this.renderRow(e, d, l, o))}
864
+ ${r.map((d, n) => this.renderRow(e, d, n, o))}
862
865
  </tbody>
863
866
  </table></div>
864
867
  </div>
@@ -867,12 +870,12 @@ class Pe extends $ {
867
870
  renderRow(e, t, s, o) {
868
871
  const r = e.schoolsById[t.team.schoolId], d = r?.name || t.team.name || "TBD";
869
872
  if (o && !d.toLowerCase().includes(o)) return p;
870
- const l = t.rec.pf - t.rec.pa, h = q(this.data.games, t.team.id), n = () => {
873
+ const n = t.rec.pf - t.rec.pa, h = q(this.data.games, t.team.id), l = () => {
871
874
  location.href = u(e.hrefs.school, { id: t.team.schoolId });
872
875
  };
873
876
  return i`
874
877
  <tr class="rowlink" @click=${(c) => {
875
- c.target.closest("a") || n();
878
+ c.target.closest("a") || l();
876
879
  }}>
877
880
  <td class="mut">${s + 1}</td>
878
881
  <td class="teamcell">
@@ -885,7 +888,7 @@ class Pe extends $ {
885
888
  <td class="num">${J(t.overallPct)}</td>
886
889
  <td class="num">${t.rec.pf}</td>
887
890
  <td class="num">${t.rec.pa}</td>
888
- <td class="num" style="color:${l >= 0 ? "var(--hsot-win)" : "var(--hsot-loss)"}">${l > 0 ? "+" : ""}${l}</td>
891
+ <td class="num" style="color:${n >= 0 ? "var(--hsot-win)" : "var(--hsot-loss)"}">${n > 0 ? "+" : ""}${n}</td>
889
892
  <td>${L(t.rec.results) || "·"}</td>
890
893
  <td>${K(e, t.team.id)}</td>
891
894
  <td>${ne(e, h, t.team.id)}</td>
@@ -893,8 +896,8 @@ class Pe extends $ {
893
896
  `;
894
897
  }
895
898
  }
896
- globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings", Pe);
897
- const Ee = b`
899
+ globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings", Ee);
900
+ const Ae = b`
898
901
  .hero1 {
899
902
  border-radius: var(--hsot-radius-md); color: var(--hsot-white);
900
903
  padding: 1.3rem 1.4rem; display: flex; align-items: center; gap: 1.2rem;
@@ -911,8 +914,8 @@ const Ee = b`
911
914
  .delta.new { background: var(--hsot-straw); color: #6b5900; border-radius: var(--hsot-radius-xs); padding: 0.1rem 0.3rem; font-size: 0.7rem; }
912
915
  .sparkline { vertical-align: middle; }
913
916
  `;
914
- class Ae extends $ {
915
- static styles = [...F, Ee];
917
+ class _e extends $ {
918
+ static styles = [...F, Ae];
916
919
  static properties = {
917
920
  ...$.properties,
918
921
  sport: { type: String },
@@ -929,20 +932,20 @@ class Ae extends $ {
929
932
  e && (this.pollDate = e);
930
933
  }
931
934
  async fetchData(e) {
932
- const t = this.season || N(), [s, o, r, d, l] = await Promise.all([
935
+ const t = this.season || N(), [s, o, r, d, n] = await Promise.all([
933
936
  e.listRankings({ sport: this.sport, ...this.gender ? { gender: this.gender } : {} }),
934
937
  e.listSchools(),
935
938
  e.listTeams({ sport: this.sport }),
936
939
  e.listConferences(),
937
940
  e.listGames({ sport: this.sport, season: t })
938
- ]), h = s.items.filter((n) => !this.gender || !n.gender || n.gender === this.gender).sort((n, c) => c.effectiveDate.localeCompare(n.effectiveDate));
941
+ ]), h = s.items.filter((l) => !this.gender || !l.gender || l.gender === this.gender).sort((l, c) => c.effectiveDate.localeCompare(l.effectiveDate));
939
942
  return {
940
943
  season: t,
941
944
  polls: h,
942
945
  schools: o.items,
943
946
  teams: r.items,
944
947
  conferences: d.items,
945
- games: l.items
948
+ games: n.items
946
949
  };
947
950
  }
948
951
  get ctx() {
@@ -956,17 +959,17 @@ class Ae extends $ {
956
959
  }, this._ctxData = this.data), this._ctx;
957
960
  }
958
961
  sparkline(e, t, s) {
959
- const l = t.map((m, f) => {
962
+ const n = t.map((m, f) => {
960
963
  const g = (m.teamIds || []).indexOf(e);
961
964
  if (g === -1) return null;
962
965
  const k = t.length === 1 ? 96 / 2 : f / (t.length - 1) * 90 + 3, O = 3 + g / 24 * 20;
963
966
  return { x: k, y: O };
964
967
  }), h = [];
965
- let n = [];
966
- if (l.forEach((m) => {
967
- m ? n.push(m) : n.length && (h.push(n), n = []);
968
- }), n.length && h.push(n), !h.length) return p;
969
- const c = l[s];
968
+ let l = [];
969
+ if (n.forEach((m) => {
970
+ m ? l.push(m) : l.length && (h.push(l), l = []);
971
+ }), l.length && h.push(l), !h.length) return p;
972
+ const c = n[s];
970
973
  return i`<svg class="sparkline" width=${96} height=${26} viewBox="0 0 ${96} ${26}" role="img" aria-label="rank history">
971
974
  ${h.map((m) => Q`<polyline fill="none" stroke="var(--hsot-red)" stroke-width="2"
972
975
  points=${m.map((f) => `${f.x.toFixed(1)},${f.y.toFixed(1)}`).join(" ")}></polyline>`)}
@@ -974,16 +977,16 @@ class Ae extends $ {
974
977
  </svg>`;
975
978
  }
976
979
  movement(e, t, s) {
977
- const o = De(e, t, s);
980
+ const o = Fe(e, t, s);
978
981
  return o.kind === "up" ? i`<span class="delta up">▲ ${o.delta}</span>` : o.kind === "down" ? i`<span class="delta down">▼ ${o.delta}</span>` : o.kind === "new" ? i`<span class="delta new">NEW</span>` : o.kind === "same" ? i`<span class="delta same">—</span>` : i`<span class="delta same">·</span>`;
979
982
  }
980
983
  renderView() {
981
984
  const e = this.ctx, t = this.data.polls;
982
985
  if (!t.length) return i`<div class="view"><p class="empty">No ${this.sport} polls published yet this season.</p></div>`;
983
- const s = Math.max(0, t.findIndex((m) => m.effectiveDate === this.pollDate)), o = t[s] || t[0], r = t[s + 1] || null, d = t.slice().reverse(), l = d.indexOf(o), h = v(this.data.conferences), n = (o.teamIds || [])[0], c = n ? S(e, n) : null;
986
+ const s = Math.max(0, t.findIndex((m) => m.effectiveDate === this.pollDate)), o = t[s] || t[0], r = t[s + 1] || null, d = t.slice().reverse(), n = d.indexOf(o), h = v(this.data.conferences), l = (o.teamIds || [])[0], c = l ? I(e, l) : null;
984
987
  return i`
985
988
  ${V(this, e, {
986
- title: i`${I(this.sport)} Top 25`,
989
+ title: i`${S(this.sport)} Top 25`,
987
990
  sub: i`The HighSchoolOT poll · updated weekly · ${t.length} polls this season`,
988
991
  teams: this.data.teams
989
992
  })}
@@ -1009,14 +1012,14 @@ class Ae extends $ {
1009
1012
  <span class="spacer"></span>
1010
1013
  <span class="asof">Movement vs. the previous poll · sparkline = season rank history</span>
1011
1014
  </div>
1012
- ${c ? this.renderHero(e, o, r, n, c, h) : p}
1015
+ ${c ? this.renderHero(e, o, r, l, c, h) : p}
1013
1016
  <div class="card"><div class="tablewrap"><table class="data">
1014
1017
  <thead><tr>
1015
1018
  <th class="num">Rk</th><th>Mvmt</th><th>Team</th><th class="num">Record</th>
1016
1019
  <th>Conference</th><th>Last result</th><th>Next</th><th>Season</th>
1017
1020
  </tr></thead>
1018
1021
  <tbody>
1019
- ${(o.teamIds || []).map((m, f) => f === 0 || !m ? p : this.renderRow(e, o, r, d, l, h, m, f + 1))}
1022
+ ${(o.teamIds || []).map((m, f) => f === 0 || !m ? p : this.renderRow(e, o, r, d, n, h, m, f + 1))}
1020
1023
  </tbody>
1021
1024
  </table></div></div>
1022
1025
  <p class="note">Ranks elsewhere on the site resolve the poll in effect on the game date, so past box scores keep the ranks they were played under.</p>
@@ -1024,7 +1027,7 @@ class Ae extends $ {
1024
1027
  `;
1025
1028
  }
1026
1029
  renderHero(e, t, s, o, r, d) {
1027
- const l = e.records[o], h = ee(e.records, o), n = d[e.teamsById[o]?.conferenceId], c = `linear-gradient(120deg, ${r.colorPrimary || "#030711"} 0%, var(--hsot-black) 85%)`;
1030
+ const n = e.records[o], h = ee(e.records, o), l = d[e.teamsById[o]?.conferenceId], c = `linear-gradient(120deg, ${r.colorPrimary || "#030711"} 0%, var(--hsot-black) 85%)`;
1028
1031
  return i`
1029
1032
  <div class="hero1" style="background:${c}">
1030
1033
  <div class="bigrank">#1</div>
@@ -1032,8 +1035,8 @@ class Ae extends $ {
1032
1035
  <div>
1033
1036
  <h2><a href=${u(e.hrefs.school, { id: r.id })}>${r.name} ${r.mascot || ""}</a></h2>
1034
1037
  <div class="facts">
1035
- ${w(l)} overall${n ? i` · ${w(l, !0)} ${n.name}` : p}
1036
- · streak ${L(l?.results) || "·"}
1038
+ ${w(n)} overall${l ? i` · ${w(n, !0)} ${l.name}` : p}
1039
+ · streak ${L(n?.results) || "·"}
1037
1040
  ${h ? i` · last: ${h.mark} ${h.my}-${h.their} vs ${_(e, h.opp)}` : p}
1038
1041
  &nbsp;${this.movement(t, s, o)}
1039
1042
  </div>
@@ -1041,33 +1044,33 @@ class Ae extends $ {
1041
1044
  </div>
1042
1045
  `;
1043
1046
  }
1044
- renderRow(e, t, s, o, r, d, l, h) {
1045
- const n = S(e, l);
1046
- if (!n) return p;
1047
- const c = e.records[l], m = ee(e.records, l), f = q(this.data.games, l), g = d[e.teamsById[l]?.conferenceId], k = () => {
1048
- location.href = u(e.hrefs.school, { id: n.id });
1047
+ renderRow(e, t, s, o, r, d, n, h) {
1048
+ const l = I(e, n);
1049
+ if (!l) return p;
1050
+ const c = e.records[n], m = ee(e.records, n), f = q(this.data.games, n), g = d[e.teamsById[n]?.conferenceId], k = () => {
1051
+ location.href = u(e.hrefs.school, { id: l.id });
1049
1052
  };
1050
1053
  return i`
1051
1054
  <tr class="rowlink" @click=${(O) => {
1052
1055
  O.target.closest("a") || k();
1053
1056
  }}>
1054
1057
  <td class="num" style="font-weight:700">${h}</td>
1055
- <td>${this.movement(t, s, l)}</td>
1056
- <td class="teamcell">${C(n)}<a href=${u(e.hrefs.school, { id: n.id })}>${n.name}</a>
1057
- <span class="mut" style="font-size:0.78rem">${n.mascot || ""}</span></td>
1058
+ <td>${this.movement(t, s, n)}</td>
1059
+ <td class="teamcell">${C(l)}<a href=${u(e.hrefs.school, { id: l.id })}>${l.name}</a>
1060
+ <span class="mut" style="font-size:0.78rem">${l.mascot || ""}</span></td>
1058
1061
  <td class="num">${w(c)}</td>
1059
1062
  <td class="mut">${g?.name || "Independent"}</td>
1060
1063
  <td>${m ? i`<a class="box" style="text-decoration:none" href=${u(e.hrefs.game, { sport: this.sport, id: m.gameId })}>
1061
1064
  <b style="color:${m.mark === "W" ? "var(--hsot-win)" : m.mark === "L" ? "var(--hsot-loss)" : "var(--hsot-tie)"}">${m.mark}</b>
1062
1065
  ${m.my}-${m.their} vs ${_(e, m.opp)}</a>` : i`<span class="mut">·</span>`}</td>
1063
- <td>${ne(e, f, l)}</td>
1064
- <td>${this.sparkline(l, o, r)}</td>
1066
+ <td>${ne(e, f, n)}</td>
1067
+ <td>${this.sparkline(n, o, r)}</td>
1065
1068
  </tr>
1066
1069
  `;
1067
1070
  }
1068
1071
  }
1069
- globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings", Ae);
1070
- const _e = b`
1072
+ globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings", _e);
1073
+ const Re = b`
1071
1074
  .schoolhero { color: var(--hsot-white); padding: 1.6rem 1.25rem 1.3rem; }
1072
1075
  .schoolhero .inner { max-width: 1366px; margin: 0 auto; display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
1073
1076
  .schoolhero .crest {
@@ -1121,8 +1124,8 @@ const _e = b`
1121
1124
  table.data.roster .sub { display: block; font-weight: 400; font-size: 0.78rem; color: var(--hsot-gray-5); }
1122
1125
  }
1123
1126
  `;
1124
- class Re extends $ {
1125
- static styles = [...F, _e];
1127
+ class Ne extends $ {
1128
+ static styles = [...F, Re];
1126
1129
  static properties = {
1127
1130
  ...$.properties,
1128
1131
  schoolId: { type: String, attribute: "school-id" },
@@ -1139,7 +1142,7 @@ class Re extends $ {
1139
1142
  e && !this.sport && (this.sport = e);
1140
1143
  }
1141
1144
  async fetchData(e) {
1142
- const t = this.season || N(), s = await e.getSchool(this.schoolId), r = (await e.listTeams({ schoolId: this.schoolId })).items, d = r.find((k) => k.sport === (this.sport || "football")) || r[0] || null, [l, h, n, c, m, f, g] = await Promise.all([
1145
+ const t = this.season || N(), s = await e.getSchool(this.schoolId), r = (await e.listTeams({ schoolId: this.schoolId })).items, d = r.find((k) => k.sport === (this.sport || "football")) || r[0] || null, [n, h, l, c, m, f, g] = await Promise.all([
1143
1146
  d ? e.listGames({ sport: d.sport, season: t }) : Promise.resolve({ items: [] }),
1144
1147
  d ? e.listTeams({ sport: d.sport }) : Promise.resolve({ items: [] }),
1145
1148
  e.listSchools(),
@@ -1155,9 +1158,9 @@ class Re extends $ {
1155
1158
  school: s,
1156
1159
  teams: r,
1157
1160
  active: d,
1158
- games: l.items,
1161
+ games: n.items,
1159
1162
  allTeams: h.items,
1160
- schools: n.items,
1163
+ schools: l.items,
1161
1164
  conferences: c.items,
1162
1165
  rankings: m.items,
1163
1166
  roster: f.items.find((k) => k.season === t) || null,
@@ -1180,7 +1183,7 @@ class Re extends $ {
1180
1183
  renderView() {
1181
1184
  const { school: e, teams: t, active: s, season: o } = this.data;
1182
1185
  if (!e) return i`<div class="view"><p class="empty">School not found.</p></div>`;
1183
- const r = this.ctx, d = E(e.colorPrimary || "#030711"), l = (e.adm || [])[0], h = v(this.data.conferences), n = s ? h[s.conferenceId] : null;
1186
+ const r = this.ctx, d = E(e.colorPrimary || "#030711"), n = (e.adm || [])[0], h = v(this.data.conferences), l = s ? h[s.conferenceId] : null;
1184
1187
  return i`
1185
1188
  <div class="schoolhero" style="background:linear-gradient(115deg, ${e.colorPrimary || "#030711"} 0%, ${e.colorPrimary || "#030711"} 55%, var(--hsot-black) 100%);color:${d}">
1186
1189
  <div class="inner">
@@ -1190,8 +1193,8 @@ class Re extends $ {
1190
1193
  <div class="facts">
1191
1194
  ${e.location ? i`<span><b>Location</b>${e.location}${e.county ? i` · ${e.county} County` : p}</span>` : p}
1192
1195
  ${e.association ? i`<span><b>League</b>${e.association}${e.classification ? i` · ${e.classification}` : p}</span>` : p}
1193
- ${n ? i`<span><b>Conference</b>${n.name}</span>` : p}
1194
- ${l ? i`<span><b>Enrollment</b>${l.value.toLocaleString()} (${l.season} ADM)</span>` : p}
1196
+ ${l ? i`<span><b>Conference</b>${l.name}</span>` : p}
1197
+ ${n ? i`<span><b>Enrollment</b>${n.value.toLocaleString()} (${n.season} ADM)</span>` : p}
1195
1198
  ${e.openingYear ? i`<span><b>Opened</b>${e.openingYear}</span>` : p}
1196
1199
  ${e.areaCode ? i`<span><b>Area</b>${e.areaCode}</span>` : p}
1197
1200
  </div>
@@ -1207,22 +1210,22 @@ class Re extends $ {
1207
1210
  </div>
1208
1211
  ${B(this, i`
1209
1212
  ${P(this)}
1210
- ${s ? this.renderTeam(r, s, n, o) : i`<p class="empty">No teams recorded for this school yet.</p>`}
1213
+ ${s ? this.renderTeam(r, s, l, o) : i`<p class="empty">No teams recorded for this school yet.</p>`}
1211
1214
  `)}
1212
1215
  `;
1213
1216
  }
1214
1217
  renderTeam(e, t, s, o) {
1215
- const r = e.records[t.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, d = r.w + r.l + r.t, l = s ? this.data.allTeams.filter((m) => m.conferenceId === s.id) : [], h = s ? oe(l, e.records).findIndex((m) => m.team.id === t.id) + 1 : 0, n = W(e.rankings, e.teamsById, t.id, t.sport, null), c = this.data.games.filter((m) => m.homeTeamId === t.id || m.awayTeamId === t.id).sort((m, f) => String(m.date).localeCompare(String(f.date)));
1218
+ const r = e.records[t.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, d = r.w + r.l + r.t, n = s ? this.data.allTeams.filter((m) => m.conferenceId === s.id) : [], h = s ? oe(n, e.records).findIndex((m) => m.team.id === t.id) + 1 : 0, l = W(e.rankings, e.teamsById, t.id, t.sport, null), c = this.data.games.filter((m) => m.homeTeamId === t.id || m.awayTeamId === t.id).sort((m, f) => String(m.date).localeCompare(String(f.date)));
1216
1219
  return i`
1217
1220
  <div class="tiles">
1218
1221
  <div class="tile"><div class="k">Overall</div><div class="v">${w(r)}</div><div class="s">${d} games played</div></div>
1219
1222
  <div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${w(r, !0)}</div>
1220
- <div class="s">${h ? `${fe(h)} of ${l.length}` : "·"}</div></div>
1223
+ <div class="s">${h ? `${ue(h)} of ${n.length}` : "·"}</div></div>
1221
1224
  <div class="tile"><div class="k">Points</div><div class="v">${d ? (r.pf / d).toFixed(1) : "0.0"}</div>
1222
1225
  <div class="s">scored per game · ${d ? (r.pa / d).toFixed(1) : "0.0"} allowed</div></div>
1223
1226
  <div class="tile"><div class="k">Streak</div><div class="v">${L(r.results) || "·"}</div>
1224
1227
  <div class="s">last 5: ${K(e, t.id)}</div></div>
1225
- <div class="tile"><div class="k">HSOT Top 25</div><div class="v">${n ? `#${n}` : "NR"}</div>
1228
+ <div class="tile"><div class="k">HSOT Top 25</div><div class="v">${l ? `#${l}` : "NR"}</div>
1226
1229
  <div class="s"><a href=${u(e.hrefs.section, { sport: t.sport, view: "rankings" })}>full poll</a></div></div>
1227
1230
  </div>
1228
1231
  ${(t.championships || []).length ? i`
@@ -1244,20 +1247,20 @@ class Re extends $ {
1244
1247
  `;
1245
1248
  }
1246
1249
  renderGameRow(e, t, s) {
1247
- const o = s.homeTeamId === t.id, r = o ? s.awayTeamId : s.homeTeamId, d = o ? s.homeScore : s.awayScore, l = o ? s.awayScore : s.homeScore;
1250
+ const o = s.homeTeamId === t.id, r = o ? s.awayTeamId : s.homeTeamId, d = o ? s.homeScore : s.awayScore, n = o ? s.awayScore : s.homeScore;
1248
1251
  let h = i`<span class="mut">${U(s.time)}</span>`;
1249
1252
  if (s.state === "final") {
1250
1253
  const c = G(s), m = c === "tie" ? "T" : c === (o ? "home" : "away") ? "W" : "L";
1251
- h = i`<span class=${m}>${m}</span> ${d}-${l}${s.finish === "overtime" ? i` <span class="mut">OT</span>` : p}${s.forfeit && s.forfeit !== "none" ? i` <span class="mut">FF</span>` : p}`;
1252
- } else s.state === "live" && (h = i`<span style="color:var(--hsot-red)">${d}-${l}</span>`);
1253
- const n = s.gameType === "conference" ? "Conf" : s.gameType === "nonconference" ? "Non-conf" : s.gameType === "playoff" ? `Playoff${s.label ? ` · ${s.label}` : ""}` : "Scrimmage";
1254
+ h = i`<span class=${m}>${m}</span> ${d}-${n}${s.finish === "overtime" ? i` <span class="mut">OT</span>` : p}${s.forfeit && s.forfeit !== "none" ? i` <span class="mut">FF</span>` : p}`;
1255
+ } else s.state === "live" && (h = i`<span style="color:var(--hsot-red)">${d}-${n}</span>`);
1256
+ const l = s.gameType === "conference" ? "Conf" : s.gameType === "nonconference" ? "Non-conf" : s.gameType === "playoff" ? `Playoff${s.label ? ` · ${s.label}` : ""}` : "Scrimmage";
1254
1257
  return i`
1255
1258
  <li>
1256
1259
  <span class="d">${y(s.date)}</span>
1257
1260
  ${se(s).kind === "sched" ? p : R(s)}
1258
1261
  <span class="res">${h}</span>
1259
1262
  <span class="opp">${o ? "vs" : "at"} ${ie(e, r, s.date)}
1260
- <span class="pill type">${n}</span>
1263
+ <span class="pill type">${l}</span>
1261
1264
  ${s.broadcast ? i`<span class="pill class">${s.broadcast}</span>` : p}
1262
1265
  </span>
1263
1266
  <span class="where">${s.venue || ""}</span>
@@ -1269,21 +1272,21 @@ class Re extends $ {
1269
1272
  const s = this.data.roster;
1270
1273
  if (!s)
1271
1274
  return i`<p class="empty">Roster not published for ${t}.</p>`;
1272
- const o = ze(s, 560), r = this.data.school?.name || "", d = v(this.data.players), l = s.entries.slice().sort((n, c) => (n.number || 0) - (c.number || 0)), h = l.some((n) => d[n.playerId]?.college);
1275
+ const o = Be(s, 560), r = this.data.school?.name || "", d = v(this.data.players), n = s.entries.slice().sort((l, c) => (l.number || 0) - (c.number || 0)), h = n.some((l) => d[l.playerId]?.college);
1273
1276
  return i`
1274
1277
  ${o ? i`<img class="rosterphoto" src=${o} loading="lazy" decoding="async"
1275
1278
  alt="${r} ${e.name} ${t} team photo" />` : p}
1276
1279
  <div class="tablewrap"><table class="data roster">
1277
1280
  <thead><tr><th class="num">No.</th><th>Player</th><th class="pos">Pos</th><th class="cls">Class</th><th class="num">Ht</th><th class="num">Wt</th>${h ? i`<th>College</th>` : p}</tr></thead>
1278
1281
  <tbody>
1279
- ${l.map((n) => {
1280
- const c = d[n.playerId];
1282
+ ${n.map((l) => {
1283
+ const c = d[l.playerId];
1281
1284
  if (!c) return p;
1282
- const m = [n.position, c.classOf].filter(Boolean).join(" · ") || "·";
1285
+ const m = pe(l), f = [m, c.classOf].filter(Boolean).join(" · ") || "·";
1283
1286
  return i`<tr>
1284
- <td class="num mut">${n.number ?? "·"}</td>
1285
- <td class="player" style="font-weight:500">${c.firstName} ${c.lastName}<span class="sub">${m}</span></td>
1286
- <td class="pos">${n.position || "·"}</td>
1287
+ <td class="num mut">${l.number ?? "·"}</td>
1288
+ <td class="player" style="font-weight:500">${c.firstName} ${c.lastName}<span class="sub">${f}</span></td>
1289
+ <td class="pos">${m || "·"}</td>
1287
1290
  <td class="cls mut">${c.classOf || "·"}</td>
1288
1291
  <td class="num">${me(c.heightIn)}</td>
1289
1292
  <td class="num">${c.weightLb || "·"}</td>
@@ -1295,13 +1298,13 @@ class Re extends $ {
1295
1298
  `;
1296
1299
  }
1297
1300
  }
1298
- globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school", Re);
1299
- const Ne = "https://api.wral.com/search";
1300
- function Le(a) {
1301
+ globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school", Ne);
1302
+ const Le = "https://api.wral.com/search";
1303
+ function Oe(a) {
1301
1304
  return a.map((e) => `uri:"${e}"`).join(" OR ");
1302
1305
  }
1303
- function Oe(a, e) {
1304
- const t = String(a || Ne).replace(/\/+$/, ""), s = new URLSearchParams({ query: Le(e), sort: "score", lang: "en" });
1306
+ function He(a, e) {
1307
+ const t = String(a || Le).replace(/\/+$/, ""), s = new URLSearchParams({ query: Oe(e), sort: "score", lang: "en" });
1305
1308
  return `${t}/v1/query?${s}`;
1306
1309
  }
1307
1310
  function le(a) {
@@ -1319,13 +1322,13 @@ function le(a) {
1319
1322
  }
1320
1323
  return { uri: a, title: a };
1321
1324
  }
1322
- async function He(a, e, t) {
1323
- const o = await ((...l) => fetch(...l))(Oe(a, e));
1325
+ async function Ue(a, e, t) {
1326
+ const o = await ((...n) => fetch(...n))(He(a, e));
1324
1327
  if (!o.ok) throw new Error(`search answered ${o.status}`);
1325
- const r = await o.json(), d = new Map((r.items || []).map((l) => [l.uri, l]));
1326
- return e.map((l) => d.get(l) || le(l));
1328
+ const r = await o.json(), d = new Map((r.items || []).map((n) => [n.uri, n]));
1329
+ return e.map((n) => d.get(n) || le(n));
1327
1330
  }
1328
- const Ue = b`
1331
+ const Me = b`
1329
1332
  .breadcrumbs { font-size: 0.8125rem; margin: 0.9rem 0 0; color: var(--hsot-gray-5); }
1330
1333
  .breadcrumbs a { text-decoration: none; }
1331
1334
  .scorehead { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; padding: 1.4rem 1rem; }
@@ -1364,8 +1367,8 @@ const Ue = b`
1364
1367
  .cols { grid-template-columns: 1fr; }
1365
1368
  }
1366
1369
  `;
1367
- class Me extends $ {
1368
- static styles = [...F, Ue];
1370
+ class je extends $ {
1371
+ static styles = [...F, Me];
1369
1372
  static properties = {
1370
1373
  ...$.properties,
1371
1374
  gameId: { type: String, attribute: "game-id" },
@@ -1379,7 +1382,7 @@ class Me extends $ {
1379
1382
  super(), this.gameId = "", this.searchApi = "";
1380
1383
  }
1381
1384
  async fetchData(e) {
1382
- const t = await e.getGame(this.gameId), s = Array.isArray(t.coverageUrls) ? t.coverageUrls : [], [o, r, d, l, h, n] = await Promise.all([
1385
+ const t = await e.getGame(this.gameId), s = Array.isArray(t.coverageUrls) ? t.coverageUrls : [], [o, r, d, n, h, l] = await Promise.all([
1383
1386
  e.listSchools(),
1384
1387
  e.listTeams({ sport: t.sport }),
1385
1388
  e.listConferences(),
@@ -1387,16 +1390,16 @@ class Me extends $ {
1387
1390
  e.listGames({ sport: t.sport, season: t.season }),
1388
1391
  // A search outage must not blank the box score — degrade to bare
1389
1392
  // links (fetchCoverage already degrades per-URL index misses).
1390
- s.length ? He(this.searchApi, s).catch(() => s.map(le)) : Promise.resolve([])
1393
+ s.length ? Ue(this.searchApi, s).catch(() => s.map(le)) : Promise.resolve([])
1391
1394
  ]);
1392
1395
  return {
1393
1396
  game: t,
1394
1397
  schools: o.items,
1395
1398
  teams: r.items,
1396
1399
  conferences: d.items,
1397
- rankings: l.items,
1400
+ rankings: n.items,
1398
1401
  games: h.items,
1399
- coverage: n
1402
+ coverage: l
1400
1403
  };
1401
1404
  }
1402
1405
  get ctx() {
@@ -1412,12 +1415,12 @@ class Me extends $ {
1412
1415
  renderView() {
1413
1416
  const e = this.data.game;
1414
1417
  if (!e) return i`<div class="view"><p class="empty">Game not found.</p></div>`;
1415
- const t = this.ctx, s = v(this.data.conferences), o = t.teamsById[e.awayTeamId] ? t.schoolsById[t.teamsById[e.awayTeamId].schoolId] : null, r = t.teamsById[e.homeTeamId] ? t.schoolsById[t.teamsById[e.homeTeamId].schoolId] : null, d = G(e), l = (c) => e.state === "final" && d !== c && d !== "tie" ? "opacity:0.45" : "", h = e.conferenceId ? s[e.conferenceId] : null, n = this.data.games.filter((c) => c.id !== e.id && c.state === "final" && c.gameType !== "scrimmage" && (c.homeTeamId === e.homeTeamId && c.awayTeamId === e.awayTeamId || c.homeTeamId === e.awayTeamId && c.awayTeamId === e.homeTeamId));
1418
+ const t = this.ctx, s = v(this.data.conferences), o = t.teamsById[e.awayTeamId] ? t.schoolsById[t.teamsById[e.awayTeamId].schoolId] : null, r = t.teamsById[e.homeTeamId] ? t.schoolsById[t.teamsById[e.homeTeamId].schoolId] : null, d = G(e), n = (c) => e.state === "final" && d !== c && d !== "tie" ? "opacity:0.45" : "", h = e.conferenceId ? s[e.conferenceId] : null, l = this.data.games.filter((c) => c.id !== e.id && c.state === "final" && c.gameType !== "scrimmage" && (c.homeTeamId === e.homeTeamId && c.awayTeamId === e.awayTeamId || c.homeTeamId === e.awayTeamId && c.awayTeamId === e.homeTeamId));
1416
1419
  return i`
1417
1420
  ${B(this, i`
1418
1421
  ${P(this)}
1419
1422
  <p class="breadcrumbs">
1420
- <a href=${u(t.hrefs.section, { sport: e.sport, view: "scores" })}>${I(e.sport)}</a> /
1423
+ <a href=${u(t.hrefs.section, { sport: e.sport, view: "scores" })}>${S(e.sport)}</a> /
1421
1424
  <a href=${u(t.hrefs.section, { sport: e.sport, view: "scores" })}>Scores/Schedules</a> /
1422
1425
  ${T(t, e.awayTeamId)} at ${T(t, e.homeTeamId)}
1423
1426
  </p>
@@ -1426,9 +1429,9 @@ class Me extends $ {
1426
1429
  ${this.teamBlock(t, e, e.awayTeamId, o, !1)}
1427
1430
  <div class="mid">
1428
1431
  <div class="bigscore">
1429
- <span style=${l("away")}>${e.awayScore}</span>
1432
+ <span style=${n("away")}>${e.awayScore}</span>
1430
1433
  <span class="mut" style="font-size:1.6rem">–</span>
1431
- <span style=${l("home")}>${e.homeScore}</span>
1434
+ <span style=${n("home")}>${e.homeScore}</span>
1432
1435
  </div>
1433
1436
  <div class="status">${R(e)}</div>
1434
1437
  <div class="status">${y(e.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${e.state === "scheduled" && e.time ? i` · ${U(e.time)}` : p} · ${e.venue || "Venue TBD"}
@@ -1464,10 +1467,10 @@ class Me extends $ {
1464
1467
  <div class="cols">
1465
1468
  ${[[e.awayTeamId, o], [e.homeTeamId, r]].map(([c, m]) => this.renderContext(t, c, m))}
1466
1469
  </div>
1467
- ${n.length ? i`
1470
+ ${l.length ? i`
1468
1471
  <div class="section-title">Head to head this season</div>
1469
1472
  <div class="card"><ul class="gamelist">
1470
- ${n.map((c) => i`<li>
1473
+ ${l.map((c) => i`<li>
1471
1474
  <span class="d">${y(c.date)}</span>${R(c)}
1472
1475
  <span class="opp">${T(t, c.awayTeamId)} ${c.awayScore}, ${T(t, c.homeTeamId)} ${c.homeScore}</span>
1473
1476
  <a class="box" href=${u(t.hrefs.game, { sport: e.sport, id: c.id })}>Box score →</a>
@@ -1478,13 +1481,13 @@ class Me extends $ {
1478
1481
  }
1479
1482
  teamBlock(e, t, s, o, r) {
1480
1483
  if (!o) return i`<div class="teamblock ${r ? "right" : ""}"><div class="tname">TBD</div></div>`;
1481
- const d = e.teamsById[s], l = e.records[s], h = A(o, 58);
1484
+ const d = e.teamsById[s], n = e.records[s], h = A(o, 58);
1482
1485
  return i`
1483
1486
  <div class="teamblock ${r ? "right" : ""}">
1484
1487
  ${h ? i`<img class="crest logo" alt="" loading="lazy" src=${h} />` : i`<span class="crest" style="background:${o.colorPrimary || "#030711"};color:${E(o.colorPrimary || "#030711")}">${j(o)}</span>`}
1485
1488
  <div>
1486
1489
  <div class="tname">${Y(e, s, t.date)}<a href=${u(e.hrefs.school, { id: o.id })}>${o.name}</a></div>
1487
- <div class="trec">${o.mascot || ""} · ${w(l)}${d?.conferenceId ? i` · ${w(l, !0)} conf` : p}</div>
1490
+ <div class="trec">${o.mascot || ""} · ${w(n)}${d?.conferenceId ? i` · ${w(n, !0)} conf` : p}</div>
1488
1491
  </div>
1489
1492
  </div>
1490
1493
  `;
@@ -1493,19 +1496,19 @@ class Me extends $ {
1493
1496
  const o = e.periodScores || [];
1494
1497
  if (!o.length)
1495
1498
  return i`<p class="empty" style="text-align:center">Period scoring will appear once the game starts.</p>`;
1496
- const r = Math.max(4, ...o.map((n) => n.period)), d = (n) => n <= 4 ? String(n) : `OT${n > 5 ? n - 4 : ""}`, l = (n, c) => {
1499
+ const r = Math.max(4, ...o.map((l) => l.period)), d = (l) => l <= 4 ? String(l) : `OT${l > 5 ? l - 4 : ""}`, n = (l, c) => {
1497
1500
  const m = o.find((f) => f.period === c);
1498
- return m ? m[n] : e.state === "final" ? 0 : "·";
1499
- }, h = (n, c, m) => i`
1501
+ return m ? m[l] : e.state === "final" ? 0 : "·";
1502
+ }, h = (l, c, m) => i`
1500
1503
  <tr>
1501
- <td class="teamcell">${C(n, 20)}${n?.abbr || "TBD"}</td>
1502
- ${Array.from({ length: r }, (f, g) => i`<td class="num">${l(c, g + 1)}</td>`)}
1504
+ <td class="teamcell">${C(l, 20)}${l?.abbr || "TBD"}</td>
1505
+ ${Array.from({ length: r }, (f, g) => i`<td class="num">${n(c, g + 1)}</td>`)}
1503
1506
  <td class="num" style="font-weight:700">${m}</td>
1504
1507
  </tr>`;
1505
1508
  return i`
1506
1509
  <div class="tablewrap" style="border-top:1px solid var(--hsot-gray-2)">
1507
1510
  <table class="data" style="max-width:560px;margin:0.6rem auto 0.9rem">
1508
- <thead><tr><th>Team</th>${Array.from({ length: r }, (n, c) => i`<th class="num">${d(c + 1)}</th>`)}<th class="num">T</th></tr></thead>
1511
+ <thead><tr><th>Team</th>${Array.from({ length: r }, (l, c) => i`<th class="num">${d(c + 1)}</th>`)}<th class="num">T</th></tr></thead>
1509
1512
  <tbody>
1510
1513
  ${h(t, "away", e.awayScore)}
1511
1514
  ${h(s, "home", e.homeScore)}
@@ -1531,9 +1534,9 @@ class Me extends $ {
1531
1534
  `;
1532
1535
  }
1533
1536
  }
1534
- globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore", Me);
1535
- const je = 250, Ge = 2;
1536
- class qe extends te {
1537
+ globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore", je);
1538
+ const Ge = 250, qe = 2;
1539
+ class We extends te {
1537
1540
  static properties = {
1538
1541
  api: { type: String },
1539
1542
  schoolHref: { type: String, attribute: "school-href" },
@@ -1613,11 +1616,11 @@ class qe extends te {
1613
1616
  }
1614
1617
  onInput(e) {
1615
1618
  const t = e.target.value.trim();
1616
- if (clearTimeout(this.debounceTimer), t.length < Ge) {
1619
+ if (clearTimeout(this.debounceTimer), t.length < qe) {
1617
1620
  this.abortController?.abort(), this.results = [], this.open = !1, this.searched = !1;
1618
1621
  return;
1619
1622
  }
1620
- this.debounceTimer = setTimeout(() => this.search(t), je);
1623
+ this.debounceTimer = setTimeout(() => this.search(t), Ge);
1621
1624
  }
1622
1625
  async search(e) {
1623
1626
  this.abortController?.abort(), this.abortController = new AbortController();
@@ -1710,22 +1713,22 @@ class qe extends te {
1710
1713
  `;
1711
1714
  }
1712
1715
  }
1713
- globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search", qe);
1716
+ globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search", We);
1714
1717
  export {
1715
1718
  H as D,
1716
- Me as H,
1717
- Ae as a,
1718
- Re as b,
1719
- qe as c,
1720
- Be as d,
1721
- Pe as e,
1719
+ je as H,
1720
+ _e as a,
1721
+ Ne as b,
1722
+ We as c,
1723
+ Pe as d,
1724
+ Ee as e,
1722
1725
  z as f,
1723
1726
  he as g,
1724
1727
  u as h,
1725
1728
  G as i,
1726
- Ve as j,
1729
+ Ye as j,
1727
1730
  L as k,
1728
- De as p,
1731
+ Fe as p,
1729
1732
  w as r,
1730
1733
  oe as s,
1731
1734
  W as t