@wral/hsot-data 0.1.10 → 0.1.11
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,18 +1,18 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
1
|
+
import { LitElement as te, html as i, css as b, nothing as p, svg as Q } from "lit";
|
|
2
|
+
const ce = 50;
|
|
3
|
+
function de(a = {}) {
|
|
4
4
|
const e = Object.entries(a).filter(([, s]) => s != null && s !== "");
|
|
5
5
|
if (!e.length) return "";
|
|
6
6
|
const t = new URLSearchParams();
|
|
7
|
-
return e.forEach(([s,
|
|
7
|
+
return e.forEach(([s, r]) => t.set(s, String(r))), `?${t.toString()}`;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
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(/\/+$/, ""),
|
|
12
|
-
async function
|
|
11
|
+
const s = a.replace(/\/+$/, ""), r = t || ((...n) => fetch(...n));
|
|
12
|
+
async function o(n) {
|
|
13
13
|
const h = { Accept: "application/json" };
|
|
14
14
|
e && (h.Authorization = `Bearer ${e}`);
|
|
15
|
-
const l = await
|
|
15
|
+
const l = await r(`${s}${n}`, { headers: h });
|
|
16
16
|
if (!l.ok) {
|
|
17
17
|
const c = new Error(`api-hsot ${l.status} on ${n}`);
|
|
18
18
|
throw c.status = l.status, c;
|
|
@@ -22,26 +22,26 @@ function de({ baseUrl: a, token: e = "", fetchFn: t } = {}) {
|
|
|
22
22
|
async function d(n, h = {}) {
|
|
23
23
|
const l = [];
|
|
24
24
|
let c = null;
|
|
25
|
-
for (let m = 0; m <
|
|
26
|
-
const f =
|
|
25
|
+
for (let m = 0; m < ce; m += 1) {
|
|
26
|
+
const f = de(c ? { ...h, cursor: c } : h), g = await o(`${n}${f}`);
|
|
27
27
|
if (l.push(...g.items || []), c = g.nextCursor || null, !c) break;
|
|
28
28
|
}
|
|
29
29
|
return { items: l, total: l.length, nextCursor: null };
|
|
30
30
|
}
|
|
31
31
|
return {
|
|
32
32
|
listSchools: (n) => d("/schools", n),
|
|
33
|
-
getSchool: (n) =>
|
|
33
|
+
getSchool: (n) => o(`/schools/${n}`),
|
|
34
34
|
listTeams: (n) => d("/teams", n),
|
|
35
|
-
getTeam: (n) =>
|
|
35
|
+
getTeam: (n) => o(`/teams/${n}`),
|
|
36
36
|
listConferences: (n) => d("/conferences", n),
|
|
37
37
|
listPlayers: (n) => d("/players", n),
|
|
38
38
|
listRosters: (n) => d("/rosters", n),
|
|
39
39
|
listGames: (n) => d("/games", n),
|
|
40
|
-
getGame: (n) =>
|
|
40
|
+
getGame: (n) => o(`/games/${n}`),
|
|
41
41
|
listTournaments: (n) => d("/tournaments", n),
|
|
42
42
|
listSeedings: (n, h) => d(`/tournaments/${n}/seedings`, h),
|
|
43
43
|
listRankings: (n) => d("/rankings", n),
|
|
44
|
-
listSports: () =>
|
|
44
|
+
listSports: () => o("/sports")
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
const H = {
|
|
@@ -62,8 +62,8 @@ function D(a) {
|
|
|
62
62
|
const I = (a) => a ? a.charAt(0).toUpperCase() + a.slice(1) : "";
|
|
63
63
|
function y(a, e) {
|
|
64
64
|
if (!a) return "TBD";
|
|
65
|
-
const [t, s,
|
|
66
|
-
return !t || !s || !
|
|
65
|
+
const [t, s, r] = String(a).split("-").map(Number);
|
|
66
|
+
return !t || !s || !r ? "TBD" : new Date(t, s - 1, r).toLocaleDateString("en-US", e || { weekday: "short", month: "short", day: "numeric" });
|
|
67
67
|
}
|
|
68
68
|
function U(a) {
|
|
69
69
|
if (!a) return "";
|
|
@@ -72,7 +72,7 @@ function U(a) {
|
|
|
72
72
|
const s = e >= 12 ? "PM" : "AM";
|
|
73
73
|
return `${(e + 11) % 12 + 1}:${String(t || 0).padStart(2, "0")} ${s}`;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function me(a) {
|
|
76
76
|
return a ? `${Math.floor(a / 12)}-${a % 12}` : "·";
|
|
77
77
|
}
|
|
78
78
|
function N(a = /* @__PURE__ */ new Date()) {
|
|
@@ -83,10 +83,10 @@ function M(a = /* @__PURE__ */ new Date()) {
|
|
|
83
83
|
const e = (t) => String(t).padStart(2, "0");
|
|
84
84
|
return `${a.getFullYear()}-${e(a.getMonth() + 1)}-${e(a.getDate())}`;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function pe(a, e = M()) {
|
|
87
87
|
const t = [...new Set((a || []).filter(Boolean))].sort();
|
|
88
88
|
if (!t.length || t.includes(e)) return e;
|
|
89
|
-
const s = t.filter((
|
|
89
|
+
const s = t.filter((r) => r < e);
|
|
90
90
|
return s.length ? s[s.length - 1] : t[0];
|
|
91
91
|
}
|
|
92
92
|
function j(a) {
|
|
@@ -94,14 +94,25 @@ function j(a) {
|
|
|
94
94
|
}
|
|
95
95
|
function E(a) {
|
|
96
96
|
if (!a || !/^#[0-9a-fA-F]{6}$/.test(a)) return "#FFFFFF";
|
|
97
|
-
const e = parseInt(a.slice(1), 16), t = e >> 16 & 255, s = e >> 8 & 255,
|
|
98
|
-
return 0.299 * t + 0.587 * s + 0.114 *
|
|
97
|
+
const e = parseInt(a.slice(1), 16), t = e >> 16 & 255, s = e >> 8 & 255, r = e & 255;
|
|
98
|
+
return 0.299 * t + 0.587 * s + 0.114 * r > 150 ? "#0F1B33" : "#FFFFFF";
|
|
99
99
|
}
|
|
100
|
-
const
|
|
100
|
+
const fe = (a) => {
|
|
101
101
|
const e = ["th", "st", "nd", "rd"], t = a % 100;
|
|
102
102
|
return a + (e[(t - 20) % 10] || e[t] || e[0]);
|
|
103
103
|
};
|
|
104
|
-
function
|
|
104
|
+
function X(a, e) {
|
|
105
|
+
const t = (o) => {
|
|
106
|
+
const d = /^\d+/.exec(String(o ?? ""));
|
|
107
|
+
return d ? Number(d[0]) : null;
|
|
108
|
+
}, s = t(a), r = t(e);
|
|
109
|
+
return s !== null && r !== null && s !== r ? r - s : s !== null && r === null ? -1 : s === null && r !== null ? 1 : String(a ?? "").localeCompare(String(e ?? ""), "en", { sensitivity: "base" });
|
|
110
|
+
}
|
|
111
|
+
function ue(a, e) {
|
|
112
|
+
const t = (s) => String(s?.name ?? s ?? "");
|
|
113
|
+
return t(a).localeCompare(t(e), "en", { numeric: !0, sensitivity: "base" });
|
|
114
|
+
}
|
|
115
|
+
function se(a) {
|
|
105
116
|
if (a.state === "live") return { kind: "live", label: `Live · ${a.period || ""}`.replace(/ · $/, "") };
|
|
106
117
|
if (a.state === "final") {
|
|
107
118
|
const e = [];
|
|
@@ -109,35 +120,35 @@ function te(a) {
|
|
|
109
120
|
}
|
|
110
121
|
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(/ · $/, "") };
|
|
111
122
|
}
|
|
112
|
-
const
|
|
123
|
+
const ge = /* @__PURE__ */ new Set(["game", "story", "page", "forum", "video", "gallery"]);
|
|
113
124
|
function x(a) {
|
|
114
125
|
let e = String(a || "").replace(/^[a-z][a-z0-9+.-]*:\/\/[^/#?]*/i, "");
|
|
115
126
|
const t = e.indexOf("#");
|
|
116
127
|
let s = "";
|
|
117
128
|
t !== -1 && (s = e.slice(t).split("?")[0], e = e.slice(0, t));
|
|
118
|
-
let
|
|
119
|
-
return
|
|
129
|
+
let r = e.split("?")[0] + s;
|
|
130
|
+
return r = r.replace(/([^:])\/{2,}/g, "$1/").replace(/^\/{2,}/, "/"), r = r.replace(/^\/(?=#)/, ""), r.length > 1 && (r = r.replace(/\/+$/, "")), r.toLowerCase();
|
|
120
131
|
}
|
|
121
|
-
function
|
|
132
|
+
function ae() {
|
|
122
133
|
const a = globalThis.location;
|
|
123
134
|
if (!a) return "";
|
|
124
135
|
const e = (a.hash || "").startsWith("#/") ? a.hash : "";
|
|
125
136
|
return x((a.pathname || "") + e);
|
|
126
137
|
}
|
|
127
|
-
function
|
|
138
|
+
function ve(a, e, t) {
|
|
128
139
|
if (!t) return null;
|
|
129
140
|
const s = x(a);
|
|
130
141
|
if (!s) return null;
|
|
131
|
-
const
|
|
132
|
-
if (s ===
|
|
142
|
+
const r = x(u(e.game, { sport: t, id: "" })), o = x(u(e.school, { id: "" }));
|
|
143
|
+
if (s === r || s.startsWith(`${r}/`) || s === o || s.startsWith(`${o}/`)) return null;
|
|
133
144
|
const d = x(u(e.section, { sport: t, view: "" }));
|
|
134
145
|
if (s === d) return "";
|
|
135
146
|
if (!s.startsWith(`${d}/`)) return null;
|
|
136
147
|
const n = s.slice(d.length + 1), h = n.split("/");
|
|
137
|
-
return h.length > 2 || h.some((l) => !/^[a-z][a-z-]*$/.test(l)) ||
|
|
148
|
+
return h.length > 2 || h.some((l) => !/^[a-z][a-z-]*$/.test(l)) || ge.has(h[0]) ? null : n;
|
|
138
149
|
}
|
|
139
|
-
function
|
|
140
|
-
const s = (d) => u(t.section, { sport: a, view: d }).replace(/([^:])\/{2,}/g, "$1/"),
|
|
150
|
+
function be(a, e, t) {
|
|
151
|
+
const s = (d) => u(t.section, { sport: a, view: d }).replace(/([^:])\/{2,}/g, "$1/"), o = new Set((e || []).map((d) => d && d.gender).filter((d) => d === "boys" || d === "girls")).size === 2 ? [
|
|
141
152
|
{ label: "Boys Standings", href: s("boys/standings") },
|
|
142
153
|
{ label: "Girls Standings", href: s("girls/standings") }
|
|
143
154
|
] : [{ label: "Standings", href: s("standings") }];
|
|
@@ -145,16 +156,16 @@ function ge(a, e, t) {
|
|
|
145
156
|
{ label: `${I(a)} Home`, href: s("") },
|
|
146
157
|
{ label: "Scores/Schedule", href: s("scores") },
|
|
147
158
|
{ label: "Playoff Brackets", href: s("brackets") },
|
|
148
|
-
...
|
|
159
|
+
...o,
|
|
149
160
|
{ label: "Polls & Rankings", href: s("rankings") }
|
|
150
161
|
];
|
|
151
162
|
}
|
|
152
|
-
function
|
|
163
|
+
function ye(a, e = ae()) {
|
|
153
164
|
const t = x(e);
|
|
154
165
|
for (const s of a.querySelectorAll(':scope > a[slot="nav"]'))
|
|
155
166
|
t && x(s.getAttribute("href")) === t ? s.setAttribute("aria-current", "page") : s.removeAttribute("aria-current");
|
|
156
167
|
}
|
|
157
|
-
class $ extends
|
|
168
|
+
class $ extends te {
|
|
158
169
|
static properties = {
|
|
159
170
|
api: { type: String },
|
|
160
171
|
refreshInterval: { type: Number, attribute: "refresh-interval" },
|
|
@@ -173,7 +184,7 @@ class $ extends ee {
|
|
|
173
184
|
this._client = e, this.isConnected && this.load();
|
|
174
185
|
}
|
|
175
186
|
get client() {
|
|
176
|
-
return this._client ? this._client : this.api ?
|
|
187
|
+
return this._client ? this._client : this.api ? he({ baseUrl: this.api }) : null;
|
|
177
188
|
}
|
|
178
189
|
connectedCallback() {
|
|
179
190
|
super.connectedCallback(), this._setupInterval();
|
|
@@ -185,7 +196,7 @@ class $ extends ee {
|
|
|
185
196
|
this.load();
|
|
186
197
|
}
|
|
187
198
|
updated(e) {
|
|
188
|
-
e.has("api") && e.get("api") !== void 0 && e.get("api") !== this.api && this.load(), e.has("refreshInterval") && this._setupInterval(),
|
|
199
|
+
e.has("api") && e.get("api") !== void 0 && e.get("api") !== this.api && this.load(), e.has("refreshInterval") && this._setupInterval(), ye(this);
|
|
189
200
|
}
|
|
190
201
|
async load() {
|
|
191
202
|
const e = this.client;
|
|
@@ -214,13 +225,13 @@ class $ extends ee {
|
|
|
214
225
|
this._refreshId && (clearInterval(this._refreshId), this._refreshId = null);
|
|
215
226
|
}
|
|
216
227
|
render() {
|
|
217
|
-
return this.error === "not-configured" ?
|
|
228
|
+
return this.error === "not-configured" ? i`<div class="error">This component needs an <code>api</code> attribute (the api-hsot public read-surface base URL) or an injected client.</div>` : this.error ? i`<div class="error">Unable to load right now. <button class="chip" @click=${() => this.load()}>Retry</button></div>` : this.data ? this.renderView() : i`<div class="loading" role="status">Loading…</div>`;
|
|
218
229
|
}
|
|
219
230
|
renderView() {
|
|
220
|
-
return
|
|
231
|
+
return i``;
|
|
221
232
|
}
|
|
222
233
|
}
|
|
223
|
-
const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])),
|
|
234
|
+
const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), $e = b`
|
|
224
235
|
:host {
|
|
225
236
|
--hsot-red: var(--color-red, #D1232A);
|
|
226
237
|
--hsot-red-deep: var(--color-red-dark, #951C21);
|
|
@@ -258,7 +269,7 @@ const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), be = b`
|
|
|
258
269
|
outline-offset: 1px;
|
|
259
270
|
}
|
|
260
271
|
.mut { color: var(--hsot-gray-5); }
|
|
261
|
-
`,
|
|
272
|
+
`, we = b`
|
|
262
273
|
.band { background: var(--hsot-white); color: var(--hsot-black); }
|
|
263
274
|
.band .inner { max-width: 1366px; margin: 0 auto; padding: 1.1rem 1.25rem 0; }
|
|
264
275
|
.band h1, .band h2.bandtitle {
|
|
@@ -307,7 +318,7 @@ const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), be = b`
|
|
|
307
318
|
@media (max-width: 720px) {
|
|
308
319
|
.band h1, .band h2.bandtitle, .band.section h1, .band.section h2.bandtitle { font-size: 1.8rem; }
|
|
309
320
|
}
|
|
310
|
-
`,
|
|
321
|
+
`, xe = b`
|
|
311
322
|
.view { max-width: 1366px; margin: 0 auto; padding: 1.25rem; box-sizing: border-box; }
|
|
312
323
|
/* Optional right rail (slot="rail" light-DOM children): a divided 300px
|
|
313
324
|
column on desktop, stacked under the view content on smaller screens. */
|
|
@@ -371,7 +382,7 @@ const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), be = b`
|
|
|
371
382
|
.error { padding: 1.2rem 1rem; color: var(--hsot-red-deep); font-size: 0.9rem; }
|
|
372
383
|
.note { font-size: 0.8125rem; color: var(--hsot-gray-5); margin: 0.6rem 0 0; }
|
|
373
384
|
.loading { padding: 1.2rem; color: var(--hsot-gray-5); font-family: var(--hsot-heading-font); }
|
|
374
|
-
`,
|
|
385
|
+
`, ke = b`
|
|
375
386
|
.pill {
|
|
376
387
|
display: inline-block; font-family: var(--hsot-heading-font); font-weight: 700;
|
|
377
388
|
font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em;
|
|
@@ -386,7 +397,7 @@ const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), be = b`
|
|
|
386
397
|
.pill.champ { background: var(--hsot-straw); color: #6b5900; }
|
|
387
398
|
@keyframes hsot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
|
|
388
399
|
@media (prefers-reduced-motion: reduce) { .pill.live { animation: none; } }
|
|
389
|
-
`,
|
|
400
|
+
`, Te = b`
|
|
390
401
|
.tablewrap { overflow-x: auto; }
|
|
391
402
|
table.data { font-family: var(--hsot-heading-font); font-size: 14px; border-collapse: collapse; width: 100%; }
|
|
392
403
|
table.data th {
|
|
@@ -404,7 +415,7 @@ const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), be = b`
|
|
|
404
415
|
table.data tbody tr.rowlink:hover { background: var(--hsot-gray-1); }
|
|
405
416
|
table.data td.teamcell a { color: inherit; text-decoration: none; font-weight: 500; }
|
|
406
417
|
table.data td.teamcell a:hover { text-decoration: underline; }
|
|
407
|
-
`,
|
|
418
|
+
`, Ie = b`
|
|
408
419
|
.swatch {
|
|
409
420
|
display: inline-flex; align-items: center; justify-content: center;
|
|
410
421
|
width: 26px; height: 26px; border-radius: 50%;
|
|
@@ -428,7 +439,7 @@ const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), be = b`
|
|
|
428
439
|
.dot.W { background: var(--hsot-win); }
|
|
429
440
|
.dot.L { background: var(--hsot-loss); }
|
|
430
441
|
.dot.T { background: var(--hsot-tie); }
|
|
431
|
-
`,
|
|
442
|
+
`, Se = b`
|
|
432
443
|
ul.gamelist { list-style: none; margin: 0; padding: 0; }
|
|
433
444
|
.gamelist li {
|
|
434
445
|
display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 1rem;
|
|
@@ -478,24 +489,24 @@ const v = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), be = b`
|
|
|
478
489
|
.gamelist .ff { color: var(--hsot-gray-5); font-size: 0.78rem; font-style: italic; }
|
|
479
490
|
.gamelist .where { color: var(--hsot-gray-5); font-size: 0.78rem; }
|
|
480
491
|
.gamelist a.box { font-size: 0.78rem; }
|
|
481
|
-
`, F = [
|
|
492
|
+
`, F = [$e, we, xe, ke, Te, Ie, Se];
|
|
482
493
|
function G(a) {
|
|
483
494
|
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";
|
|
484
495
|
}
|
|
485
|
-
function
|
|
496
|
+
function Ce(a) {
|
|
486
497
|
return a && (a.forfeit === "home" || a.forfeit === "away") ? a.forfeit : null;
|
|
487
498
|
}
|
|
488
499
|
function z(a, e) {
|
|
489
|
-
const t = {}, s = (
|
|
490
|
-
for (const
|
|
491
|
-
const d = G(
|
|
500
|
+
const t = {}, s = (o) => (t[o] = t[o] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, t[o]), r = a.filter((o) => o.state === "final" && o.gameType !== "scrimmage" && (!e || o.date <= e)).sort((o, d) => String(o.date).localeCompare(String(d.date)));
|
|
501
|
+
for (const o of r) {
|
|
502
|
+
const d = G(o), n = o.gameType === "conference";
|
|
492
503
|
for (const h of ["home", "away"]) {
|
|
493
|
-
const l = h === "home" ?
|
|
504
|
+
const l = h === "home" ? o.homeTeamId : o.awayTeamId;
|
|
494
505
|
if (!l) continue;
|
|
495
|
-
const c = s(l), m = h === "home" ?
|
|
506
|
+
const c = s(l), m = h === "home" ? o.homeScore : o.awayScore, f = h === "home" ? o.awayScore : o.homeScore;
|
|
496
507
|
c.pf += m, c.pa += f;
|
|
497
508
|
let g = "T";
|
|
498
|
-
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:
|
|
509
|
+
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: o.id, date: o.date, mark: g, my: m, their: f, opp: h === "home" ? o.awayTeamId : o.homeTeamId, conf: n });
|
|
499
510
|
}
|
|
500
511
|
}
|
|
501
512
|
return t;
|
|
@@ -507,40 +518,40 @@ function L(a) {
|
|
|
507
518
|
for (let s = a.length - 1; s >= 0 && a[s].mark === e; s -= 1) t += 1;
|
|
508
519
|
return e + t;
|
|
509
520
|
}
|
|
510
|
-
const
|
|
521
|
+
const Z = (a, e, t) => {
|
|
511
522
|
const s = a + e + t;
|
|
512
523
|
return s ? (a + t / 2) / s : 0;
|
|
513
|
-
},
|
|
524
|
+
}, J = (a) => a.toFixed(3).replace("0.", ".");
|
|
514
525
|
function w(a, e = !1) {
|
|
515
526
|
if (!a) return "0-0";
|
|
516
|
-
const t = e ? a.cw : a.w, s = e ? a.cl : a.l,
|
|
517
|
-
return `${t}-${s}${
|
|
527
|
+
const t = e ? a.cw : a.w, s = e ? a.cl : a.l, r = e ? a.ct : a.t;
|
|
528
|
+
return `${t}-${s}${r ? `-${r}` : ""}`;
|
|
518
529
|
}
|
|
519
|
-
function
|
|
530
|
+
function re(a, e) {
|
|
520
531
|
return a.map((t) => {
|
|
521
532
|
const s = e[t.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] };
|
|
522
|
-
return { team: t, rec: s, confPct:
|
|
533
|
+
return { team: t, rec: s, confPct: Z(s.cw, s.cl, s.ct), overallPct: Z(s.w, s.l, s.t) };
|
|
523
534
|
}).sort((t, s) => s.confPct - t.confPct || s.overallPct - t.overallPct || s.rec.pf - s.rec.pa - (t.rec.pf - t.rec.pa));
|
|
524
535
|
}
|
|
525
536
|
function q(a, e) {
|
|
526
537
|
return a.filter((t) => (t.homeTeamId === e || t.awayTeamId === e) && (t.state === "scheduled" || t.state === "live") && t.gameType !== "scrimmage").sort((t, s) => String(t.date).localeCompare(String(s.date)))[0] || null;
|
|
527
538
|
}
|
|
528
|
-
function
|
|
539
|
+
function ee(a, e) {
|
|
529
540
|
const t = a[e];
|
|
530
541
|
return t && t.results.length ? t.results[t.results.length - 1] : null;
|
|
531
542
|
}
|
|
532
|
-
function
|
|
533
|
-
let
|
|
534
|
-
for (const
|
|
535
|
-
|
|
536
|
-
return
|
|
543
|
+
function Ve(a, e, t, s = "") {
|
|
544
|
+
let r = null;
|
|
545
|
+
for (const o of a || [])
|
|
546
|
+
o.sport === e && (t && o.effectiveDate > t || s && o.gender && o.gender !== s || (!r || o.effectiveDate > r.effectiveDate) && (r = o));
|
|
547
|
+
return r;
|
|
537
548
|
}
|
|
538
|
-
function W(a, e, t, s,
|
|
539
|
-
const
|
|
540
|
-
if (!
|
|
549
|
+
function W(a, e, t, s, r) {
|
|
550
|
+
const o = e[t];
|
|
551
|
+
if (!o) return null;
|
|
541
552
|
const d = /* @__PURE__ */ new Map();
|
|
542
553
|
for (const h of a || []) {
|
|
543
|
-
if (h.sport !== s ||
|
|
554
|
+
if (h.sport !== s || r && h.effectiveDate > r || h.gender && o.gender !== h.gender && o.gender !== "coed") continue;
|
|
544
555
|
const l = h.gender || "", c = d.get(l);
|
|
545
556
|
(!c || h.effectiveDate > c.effectiveDate) && d.set(l, h);
|
|
546
557
|
}
|
|
@@ -551,47 +562,47 @@ function W(a, e, t, s, o) {
|
|
|
551
562
|
}
|
|
552
563
|
return n ? n.rank : null;
|
|
553
564
|
}
|
|
554
|
-
function
|
|
565
|
+
function De(a, e, t) {
|
|
555
566
|
if (!a) return { kind: "none", delta: 0 };
|
|
556
567
|
const s = (a.teamIds || []).indexOf(t) + 1;
|
|
557
568
|
if (!s) return { kind: "none", delta: 0 };
|
|
558
569
|
if (!e) return { kind: "same", delta: 0 };
|
|
559
|
-
const
|
|
560
|
-
if (!
|
|
561
|
-
const
|
|
562
|
-
return
|
|
570
|
+
const r = (e.teamIds || []).indexOf(t) + 1;
|
|
571
|
+
if (!r) return { kind: "new", delta: 0 };
|
|
572
|
+
const o = r - s;
|
|
573
|
+
return o > 0 ? { kind: "up", delta: o } : o < 0 ? { kind: "down", delta: -o } : { kind: "same", delta: 0 };
|
|
563
574
|
}
|
|
564
|
-
function
|
|
575
|
+
function Fe(a) {
|
|
565
576
|
return /^https?:\/\//i.test(String(a || ""));
|
|
566
577
|
}
|
|
567
578
|
function oe(a, { w: e, h: t } = {}) {
|
|
568
|
-
if (!
|
|
579
|
+
if (!Fe(a)) return "";
|
|
569
580
|
const s = [];
|
|
570
581
|
e && s.push(`w=${Math.max(1, Math.round(e))}`), t && s.push(`h=${Math.max(1, Math.round(t))}`), s.push("f=webp");
|
|
571
|
-
const
|
|
572
|
-
return `${a}${
|
|
582
|
+
const r = a.includes("?") ? "&" : "?";
|
|
583
|
+
return `${a}${r}${s.join("&")}`;
|
|
573
584
|
}
|
|
574
585
|
function A(a, e) {
|
|
575
586
|
const t = e * 2;
|
|
576
587
|
return oe(a?.logoAssetId, { w: t, h: t });
|
|
577
588
|
}
|
|
578
|
-
function
|
|
589
|
+
function ze(a, e) {
|
|
579
590
|
return oe(a?.photoAssetId, { w: e * 2 });
|
|
580
591
|
}
|
|
581
|
-
function V(a, e, { title: t, sub: s, teams:
|
|
582
|
-
const
|
|
583
|
-
return
|
|
592
|
+
function V(a, e, { title: t, sub: s, teams: r }) {
|
|
593
|
+
const o = ae(), n = !!a.querySelector(':scope > a[slot="nav"]') || ve(o, e.hrefs, e.sport) !== null;
|
|
594
|
+
return i`
|
|
584
595
|
<div class="band section">
|
|
585
596
|
<div class="inner">
|
|
586
597
|
<h1>${t}</h1>
|
|
587
|
-
${s ?
|
|
598
|
+
${s ? i`<p class="sub">${s}</p>` : p}
|
|
588
599
|
</div>
|
|
589
|
-
${n ?
|
|
600
|
+
${n ? i`
|
|
590
601
|
<nav class="sectionnav" aria-label="${I(e.sport)} section">
|
|
591
602
|
<div class="navrow">
|
|
592
603
|
<slot name="nav">
|
|
593
|
-
${
|
|
594
|
-
aria-current=${
|
|
604
|
+
${be(e.sport, r, e.hrefs).map((h) => i`<a href=${h.href}
|
|
605
|
+
aria-current=${o && x(h.href) === o ? "page" : p}>${h.label}</a>`)}
|
|
595
606
|
</slot>
|
|
596
607
|
</div>
|
|
597
608
|
</nav>` : p}
|
|
@@ -606,52 +617,52 @@ function C(a, e = 26) {
|
|
|
606
617
|
if (!a) return p;
|
|
607
618
|
const t = A(a, e);
|
|
608
619
|
if (t)
|
|
609
|
-
return
|
|
620
|
+
return i`<img class="swatch logo" aria-hidden="true" alt="" loading="lazy"
|
|
610
621
|
src=${t} style="width:${e}px;height:${e}px" />`;
|
|
611
|
-
const s = a.colorPrimary || "#030711",
|
|
612
|
-
return
|
|
613
|
-
style="width:${e}px;height:${e}px;background:${s};color:${
|
|
622
|
+
const s = a.colorPrimary || "#030711", r = E(s);
|
|
623
|
+
return i`<span class="swatch" aria-hidden="true"
|
|
624
|
+
style="width:${e}px;height:${e}px;background:${s};color:${r};font-size:${Math.max(8, e * 0.28)}px"
|
|
614
625
|
>${j(a)}</span>`;
|
|
615
626
|
}
|
|
616
627
|
function Y(a, e, t) {
|
|
617
628
|
const s = W(a.rankings, a.teamsById, e, a.sport, t);
|
|
618
|
-
return s ?
|
|
629
|
+
return s ? i`<span class="rankbadge">#${s}</span>` : p;
|
|
619
630
|
}
|
|
620
|
-
function
|
|
631
|
+
function ie(a, e, t) {
|
|
621
632
|
const s = S(a, e);
|
|
622
|
-
return s ?
|
|
633
|
+
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>`;
|
|
623
634
|
}
|
|
624
635
|
function K(a, e, t = 5) {
|
|
625
636
|
const s = a.records[e];
|
|
626
|
-
if (!s || !s.results.length) return
|
|
627
|
-
const
|
|
628
|
-
return
|
|
629
|
-
${
|
|
630
|
-
title="${
|
|
631
|
-
href=${u(a.hrefs.game, { sport: a.sport, id:
|
|
637
|
+
if (!s || !s.results.length) return i`<span class="mut">·</span>`;
|
|
638
|
+
const r = s.results.slice(-1 * t);
|
|
639
|
+
return i`<span class="dots" role="img" aria-label="last ${r.length} results">
|
|
640
|
+
${r.map((o) => i`<a class="dot ${o.mark}"
|
|
641
|
+
title="${o.mark} ${o.my}-${o.their} vs ${T(a, o.opp)}"
|
|
642
|
+
href=${u(a.hrefs.game, { sport: a.sport, id: o.gameId })}>${o.mark}</a>`)}
|
|
632
643
|
</span>`;
|
|
633
644
|
}
|
|
634
645
|
function B(a, e) {
|
|
635
|
-
return a.querySelector(':scope > [slot="rail"]') ?
|
|
646
|
+
return a.querySelector(':scope > [slot="rail"]') ? i`<div class="view withrail">
|
|
636
647
|
<div class="viewmain">${e}</div>
|
|
637
648
|
<aside class="viewrail"><slot name="rail"></slot></aside>
|
|
638
|
-
</div>` :
|
|
649
|
+
</div>` : i`<div class="view">${e}</div>`;
|
|
639
650
|
}
|
|
640
651
|
function P(a) {
|
|
641
652
|
if (!a.promoImage) return p;
|
|
642
|
-
const e =
|
|
643
|
-
return
|
|
653
|
+
const e = i`<img src=${a.promoImage} alt=${a.promoAlt || "Sponsor"}>`;
|
|
654
|
+
return i`<div class="promo">${a.promoHref ? i`<a href=${a.promoHref} target="_blank" rel="sponsored noopener">${e}</a>` : e}</div>`;
|
|
644
655
|
}
|
|
645
656
|
function R(a) {
|
|
646
|
-
const e =
|
|
647
|
-
return
|
|
657
|
+
const e = se(a);
|
|
658
|
+
return i`<span class="pill ${e.kind}">${e.label}</span>`;
|
|
648
659
|
}
|
|
649
|
-
function
|
|
650
|
-
if (!e) return
|
|
651
|
-
const s = e.homeTeamId === t ? e.awayTeamId : e.homeTeamId,
|
|
652
|
-
return
|
|
660
|
+
function ne(a, e, t) {
|
|
661
|
+
if (!e) return i`<span class="mut">·</span>`;
|
|
662
|
+
const s = e.homeTeamId === t ? e.awayTeamId : e.homeTeamId, r = e.homeTeamId === t ? "vs" : "at";
|
|
663
|
+
return i`${e.state === "live" ? i`<span class="pill live">Live</span> ` : i`${y(e.date, { month: "numeric", day: "numeric" })} `}${r} ${_(a, s)}`;
|
|
653
664
|
}
|
|
654
|
-
class
|
|
665
|
+
class Be extends $ {
|
|
655
666
|
static styles = F;
|
|
656
667
|
static properties = {
|
|
657
668
|
...$.properties,
|
|
@@ -670,18 +681,18 @@ class Fe extends $ {
|
|
|
670
681
|
this._datePinned = !!this.date;
|
|
671
682
|
}
|
|
672
683
|
async fetchData(e) {
|
|
673
|
-
const t = this.season || N(), [s,
|
|
684
|
+
const t = this.season || N(), [s, r, o, d, n] = await Promise.all([
|
|
674
685
|
e.listSchools(),
|
|
675
686
|
e.listTeams({ sport: this.sport }),
|
|
676
687
|
e.listConferences(),
|
|
677
688
|
e.listGames({ sport: this.sport, season: t }),
|
|
678
689
|
e.listRankings({ sport: this.sport })
|
|
679
690
|
]);
|
|
680
|
-
return this._datePinned || (this.date =
|
|
691
|
+
return this._datePinned || (this.date = pe(d.items.map((h) => h.date)), this._datePinned = !0), {
|
|
681
692
|
season: t,
|
|
682
693
|
schools: s.items,
|
|
683
|
-
teams:
|
|
684
|
-
conferences:
|
|
694
|
+
teams: r.items,
|
|
695
|
+
conferences: o.items,
|
|
685
696
|
games: d.items,
|
|
686
697
|
rankings: n.items
|
|
687
698
|
};
|
|
@@ -697,29 +708,29 @@ class Fe extends $ {
|
|
|
697
708
|
}, this._ctxData = this.data), this._ctx;
|
|
698
709
|
}
|
|
699
710
|
renderView() {
|
|
700
|
-
const e = this.ctx, t = v(this.data.conferences), s = [...new Set(this.data.games.map((l) => l.date).filter(Boolean))].sort(),
|
|
711
|
+
const e = this.ctx, t = v(this.data.conferences), s = [...new Set(this.data.games.map((l) => l.date).filter(Boolean))].sort(), r = Number.MAX_SAFE_INTEGER, o = (l) => {
|
|
701
712
|
const c = [l.awayTeamId, l.homeTeamId].map((m) => W(e.rankings, e.teamsById, m, this.sport, l.date)).filter(Boolean);
|
|
702
|
-
return c.length ? Math.min(...c) :
|
|
703
|
-
}, d = this.data.games.filter((l) => l.date === this.date), n = new Map(d.map((l) => [l,
|
|
713
|
+
return c.length ? Math.min(...c) : r;
|
|
714
|
+
}, d = this.data.games.filter((l) => l.date === this.date), n = new Map(d.map((l) => [l, o(l)]));
|
|
704
715
|
d.sort((l, c) => (l.state === "live" ? 0 : 1) - (c.state === "live" ? 0 : 1) || n.get(l) - n.get(c));
|
|
705
716
|
const h = /* @__PURE__ */ new Map();
|
|
706
717
|
return d.forEach((l) => {
|
|
707
718
|
const c = l.gameType === "conference" && l.conferenceId ? t[l.conferenceId]?.name || "Conference" : l.gameType === "playoff" ? "Playoffs" : l.gameType === "scrimmage" ? "Scrimmages" : "Nonconference";
|
|
708
719
|
h.has(c) || h.set(c, []), h.get(c).push(l);
|
|
709
|
-
}),
|
|
720
|
+
}), i`
|
|
710
721
|
${V(this, e, {
|
|
711
|
-
title:
|
|
712
|
-
sub:
|
|
722
|
+
title: i`${I(this.sport)} scores & schedules`,
|
|
723
|
+
sub: i`${y(this.date, { weekday: "long", month: "long", day: "numeric", year: "numeric" })} · ${d.length} games`,
|
|
713
724
|
teams: this.data.teams
|
|
714
725
|
})}
|
|
715
|
-
${B(this,
|
|
726
|
+
${B(this, i`
|
|
716
727
|
${P(this)}
|
|
717
728
|
<div class="toolbar">
|
|
718
729
|
<label class="asof" for="datesel">Date</label>
|
|
719
730
|
<select id="datesel" @change=${(l) => {
|
|
720
731
|
this.date = l.target.value;
|
|
721
732
|
}}>
|
|
722
|
-
${(s.includes(this.date) ? s : [...s, this.date].sort()).map((l) =>
|
|
733
|
+
${(s.includes(this.date) ? s : [...s, this.date].sort()).map((l) => i`<option value=${l} ?selected=${l === this.date}>
|
|
723
734
|
${y(l, { weekday: "short", month: "short", day: "numeric" })}${l === M() ? " · today" : ""}
|
|
724
735
|
</option>`)}
|
|
725
736
|
</select>
|
|
@@ -734,8 +745,8 @@ class Fe extends $ {
|
|
|
734
745
|
<span class="spacer"></span>
|
|
735
746
|
<span class="asof">Live games first · report a score to see it update here</span>
|
|
736
747
|
</div>
|
|
737
|
-
${d.length ? p :
|
|
738
|
-
${[...h.entries()].map(([l, c]) =>
|
|
748
|
+
${d.length ? p : i`<p class="empty">No ${this.sport} games on this date.</p>`}
|
|
749
|
+
${[...h.entries()].map(([l, c]) => i`
|
|
739
750
|
<div class="section-title">${l}</div>
|
|
740
751
|
<div class="card"><ul class="gamelist">
|
|
741
752
|
${c.map((m) => this.renderGame(e, m))}
|
|
@@ -748,21 +759,21 @@ class Fe extends $ {
|
|
|
748
759
|
// a lone score column on the far right read as detached from the teams).
|
|
749
760
|
// Scheduled games carry their start time on the status pill alone.
|
|
750
761
|
renderGame(e, t) {
|
|
751
|
-
const s = t.state === "final" || t.state === "live",
|
|
752
|
-
return
|
|
762
|
+
const s = t.state === "final" || t.state === "live", r = (d, n, h = p) => i`<span class="side">${ie(e, d, t.date)}${s ? i`<span class="score">${n}</span>` : p}${h}</span>`, o = Ce(t);
|
|
763
|
+
return i`
|
|
753
764
|
<li>
|
|
754
765
|
${R(t)}
|
|
755
|
-
<span class="opp matchup">${
|
|
756
|
-
${
|
|
766
|
+
<span class="opp matchup">${r(t.awayTeamId, t.awayScore, i`<span class="at">at</span>`)}${r(t.homeTeamId, t.homeScore)}</span>
|
|
767
|
+
${o ? i`<span class="ff">${T(e, o === "home" ? t.homeTeamId : t.awayTeamId)} forfeited</span>` : p}
|
|
757
768
|
<span class="where">${t.venue || ""}</span>
|
|
758
|
-
${t.broadcast ?
|
|
769
|
+
${t.broadcast ? i`<span class="pill class">${t.broadcast}</span>` : p}
|
|
759
770
|
<a class="box" href=${u(e.hrefs.game, { sport: this.sport, id: t.id })}>Box score →</a>
|
|
760
771
|
</li>
|
|
761
772
|
`;
|
|
762
773
|
}
|
|
763
774
|
}
|
|
764
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores",
|
|
765
|
-
class
|
|
775
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores", Be);
|
|
776
|
+
class Pe extends $ {
|
|
766
777
|
static styles = F;
|
|
767
778
|
static properties = {
|
|
768
779
|
...$.properties,
|
|
@@ -775,7 +786,7 @@ class ze extends $ {
|
|
|
775
786
|
super(), this.sport = "football", this.season = "", this.classFilter = "All", this.query = "";
|
|
776
787
|
}
|
|
777
788
|
async fetchData(e) {
|
|
778
|
-
const t = this.season || N(), [s,
|
|
789
|
+
const t = this.season || N(), [s, r, o, d, n] = await Promise.all([
|
|
779
790
|
e.listConferences({ active: !0 }),
|
|
780
791
|
e.listSchools(),
|
|
781
792
|
e.listTeams({ sport: this.sport }),
|
|
@@ -785,8 +796,8 @@ class ze extends $ {
|
|
|
785
796
|
return {
|
|
786
797
|
season: t,
|
|
787
798
|
conferences: s.items,
|
|
788
|
-
schools:
|
|
789
|
-
teams:
|
|
799
|
+
schools: r.items,
|
|
800
|
+
teams: o.items,
|
|
790
801
|
games: d.items,
|
|
791
802
|
rankings: n.items
|
|
792
803
|
};
|
|
@@ -802,43 +813,43 @@ class ze extends $ {
|
|
|
802
813
|
}, this._ctxData = this.data), this._ctx;
|
|
803
814
|
}
|
|
804
815
|
renderView() {
|
|
805
|
-
const e = this.ctx, t = ["All", ...new Set(this.data.conferences.flatMap((
|
|
806
|
-
return
|
|
816
|
+
const e = this.ctx, t = ["All", ...[...new Set(this.data.conferences.flatMap((r) => r.classifications || []))].sort(X)].slice(0, 9), s = this.data.conferences.filter((r) => r.active !== !1).filter((r) => this.classFilter === "All" || (r.classifications || []).includes(this.classFilter)).sort(ue);
|
|
817
|
+
return i`
|
|
807
818
|
${V(this, e, {
|
|
808
|
-
title:
|
|
809
|
-
sub:
|
|
819
|
+
title: i`${I(this.sport)} standings`,
|
|
820
|
+
sub: i`${this.data.season} season · every conference, computed live from reported results`,
|
|
810
821
|
teams: this.data.teams
|
|
811
822
|
})}
|
|
812
|
-
${B(this,
|
|
823
|
+
${B(this, i`
|
|
813
824
|
${P(this)}
|
|
814
825
|
<div class="toolbar">
|
|
815
826
|
<div role="group" aria-label="Classification filter">
|
|
816
|
-
${t.map((
|
|
827
|
+
${t.map((r) => i`<button class="chip ${this.classFilter === r ? "on" : ""}"
|
|
817
828
|
@click=${() => {
|
|
818
|
-
this.classFilter =
|
|
819
|
-
}}>${
|
|
829
|
+
this.classFilter = r;
|
|
830
|
+
}}>${r}</button>`)}
|
|
820
831
|
</div>
|
|
821
832
|
<input type="search" placeholder="Find a school…" aria-label="Find a school"
|
|
822
|
-
.value=${this.query} @input=${(
|
|
823
|
-
this.query =
|
|
833
|
+
.value=${this.query} @input=${(r) => {
|
|
834
|
+
this.query = r.target.value;
|
|
824
835
|
}}>
|
|
825
836
|
<span class="spacer"></span>
|
|
826
837
|
<span class="asof">Records through ${y(M(), { month: "long", day: "numeric" })} · conference games count toward both records · scrimmages toward neither</span>
|
|
827
838
|
</div>
|
|
828
|
-
${s.map((
|
|
839
|
+
${s.map((r) => this.renderConference(e, r))}
|
|
829
840
|
`)}
|
|
830
841
|
`;
|
|
831
842
|
}
|
|
832
843
|
renderConference(e, t) {
|
|
833
844
|
const s = this.data.teams.filter((d) => d.conferenceId === t.id);
|
|
834
845
|
if (!s.length) return p;
|
|
835
|
-
const
|
|
836
|
-
return
|
|
846
|
+
const r = this.query.trim().toLowerCase(), o = re(s, e.records);
|
|
847
|
+
return i`
|
|
837
848
|
<div class="card">
|
|
838
849
|
<div class="card-head">
|
|
839
850
|
<h2>${t.name}</h2>
|
|
840
|
-
${
|
|
841
|
-
<span class="meta">${
|
|
851
|
+
${[...t.classifications || []].sort(X).map((d) => i`<span class="pill class">${d}</span>`)}
|
|
852
|
+
<span class="meta">${o.length} teams · membership derives from teams</span>
|
|
842
853
|
</div>
|
|
843
854
|
<div class="tablewrap"><table class="data">
|
|
844
855
|
<thead><tr>
|
|
@@ -847,43 +858,43 @@ class ze extends $ {
|
|
|
847
858
|
<th>Streak</th><th>Last 5</th><th>Next</th>
|
|
848
859
|
</tr></thead>
|
|
849
860
|
<tbody>
|
|
850
|
-
${
|
|
861
|
+
${o.map((d, n) => this.renderRow(e, d, n, r))}
|
|
851
862
|
</tbody>
|
|
852
863
|
</table></div>
|
|
853
864
|
</div>
|
|
854
865
|
`;
|
|
855
866
|
}
|
|
856
|
-
renderRow(e, t, s,
|
|
857
|
-
const
|
|
858
|
-
if (
|
|
867
|
+
renderRow(e, t, s, r) {
|
|
868
|
+
const o = e.schoolsById[t.team.schoolId], d = o?.name || t.team.name || "TBD";
|
|
869
|
+
if (r && !d.toLowerCase().includes(r)) return p;
|
|
859
870
|
const n = t.rec.pf - t.rec.pa, h = q(this.data.games, t.team.id), l = () => {
|
|
860
871
|
location.href = u(e.hrefs.school, { id: t.team.schoolId });
|
|
861
872
|
};
|
|
862
|
-
return
|
|
873
|
+
return i`
|
|
863
874
|
<tr class="rowlink" @click=${(c) => {
|
|
864
875
|
c.target.closest("a") || l();
|
|
865
876
|
}}>
|
|
866
877
|
<td class="mut">${s + 1}</td>
|
|
867
878
|
<td class="teamcell">
|
|
868
|
-
${C(
|
|
879
|
+
${C(o)}${Y(e, t.team.id, null)}
|
|
869
880
|
<a href=${u(e.hrefs.school, { id: t.team.schoolId })}>${d}</a>
|
|
870
881
|
</td>
|
|
871
882
|
<td class="num">${w(t.rec, !0)}</td>
|
|
872
|
-
<td class="num">${
|
|
883
|
+
<td class="num">${J(t.confPct)}</td>
|
|
873
884
|
<td class="num">${w(t.rec)}</td>
|
|
874
|
-
<td class="num">${
|
|
885
|
+
<td class="num">${J(t.overallPct)}</td>
|
|
875
886
|
<td class="num">${t.rec.pf}</td>
|
|
876
887
|
<td class="num">${t.rec.pa}</td>
|
|
877
888
|
<td class="num" style="color:${n >= 0 ? "var(--hsot-win)" : "var(--hsot-loss)"}">${n > 0 ? "+" : ""}${n}</td>
|
|
878
889
|
<td>${L(t.rec.results) || "·"}</td>
|
|
879
890
|
<td>${K(e, t.team.id)}</td>
|
|
880
|
-
<td>${
|
|
891
|
+
<td>${ne(e, h, t.team.id)}</td>
|
|
881
892
|
</tr>
|
|
882
893
|
`;
|
|
883
894
|
}
|
|
884
895
|
}
|
|
885
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings",
|
|
886
|
-
const
|
|
896
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings", Pe);
|
|
897
|
+
const Ee = b`
|
|
887
898
|
.hero1 {
|
|
888
899
|
border-radius: var(--hsot-radius-md); color: var(--hsot-white);
|
|
889
900
|
padding: 1.3rem 1.4rem; display: flex; align-items: center; gap: 1.2rem;
|
|
@@ -900,8 +911,8 @@ const Be = b`
|
|
|
900
911
|
.delta.new { background: var(--hsot-straw); color: #6b5900; border-radius: var(--hsot-radius-xs); padding: 0.1rem 0.3rem; font-size: 0.7rem; }
|
|
901
912
|
.sparkline { vertical-align: middle; }
|
|
902
913
|
`;
|
|
903
|
-
class
|
|
904
|
-
static styles = [...F,
|
|
914
|
+
class Ae extends $ {
|
|
915
|
+
static styles = [...F, Ee];
|
|
905
916
|
static properties = {
|
|
906
917
|
...$.properties,
|
|
907
918
|
sport: { type: String },
|
|
@@ -918,7 +929,7 @@ class Pe extends $ {
|
|
|
918
929
|
e && (this.pollDate = e);
|
|
919
930
|
}
|
|
920
931
|
async fetchData(e) {
|
|
921
|
-
const t = this.season || N(), [s,
|
|
932
|
+
const t = this.season || N(), [s, r, o, d, n] = await Promise.all([
|
|
922
933
|
e.listRankings({ sport: this.sport, ...this.gender ? { gender: this.gender } : {} }),
|
|
923
934
|
e.listSchools(),
|
|
924
935
|
e.listTeams({ sport: this.sport }),
|
|
@@ -928,8 +939,8 @@ class Pe extends $ {
|
|
|
928
939
|
return {
|
|
929
940
|
season: t,
|
|
930
941
|
polls: h,
|
|
931
|
-
schools:
|
|
932
|
-
teams:
|
|
942
|
+
schools: r.items,
|
|
943
|
+
teams: o.items,
|
|
933
944
|
conferences: d.items,
|
|
934
945
|
games: n.items
|
|
935
946
|
};
|
|
@@ -956,34 +967,34 @@ class Pe extends $ {
|
|
|
956
967
|
m ? l.push(m) : l.length && (h.push(l), l = []);
|
|
957
968
|
}), l.length && h.push(l), !h.length) return p;
|
|
958
969
|
const c = n[s];
|
|
959
|
-
return
|
|
970
|
+
return i`<svg class="sparkline" width=${96} height=${26} viewBox="0 0 ${96} ${26}" role="img" aria-label="rank history">
|
|
960
971
|
${h.map((m) => Q`<polyline fill="none" stroke="var(--hsot-red)" stroke-width="2"
|
|
961
972
|
points=${m.map((f) => `${f.x.toFixed(1)},${f.y.toFixed(1)}`).join(" ")}></polyline>`)}
|
|
962
973
|
${c ? Q`<circle cx=${c.x.toFixed(1)} cy=${c.y.toFixed(1)} r="3" fill="var(--hsot-black)"></circle>` : p}
|
|
963
974
|
</svg>`;
|
|
964
975
|
}
|
|
965
976
|
movement(e, t, s) {
|
|
966
|
-
const
|
|
967
|
-
return
|
|
977
|
+
const r = De(e, t, s);
|
|
978
|
+
return r.kind === "up" ? i`<span class="delta up">▲ ${r.delta}</span>` : r.kind === "down" ? i`<span class="delta down">▼ ${r.delta}</span>` : r.kind === "new" ? i`<span class="delta new">NEW</span>` : r.kind === "same" ? i`<span class="delta same">—</span>` : i`<span class="delta same">·</span>`;
|
|
968
979
|
}
|
|
969
980
|
renderView() {
|
|
970
981
|
const e = this.ctx, t = this.data.polls;
|
|
971
|
-
if (!t.length) return
|
|
972
|
-
const s = Math.max(0, t.findIndex((m) => m.effectiveDate === this.pollDate)),
|
|
973
|
-
return
|
|
982
|
+
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)), r = t[s] || t[0], o = t[s + 1] || null, d = t.slice().reverse(), n = d.indexOf(r), h = v(this.data.conferences), l = (r.teamIds || [])[0], c = l ? S(e, l) : null;
|
|
984
|
+
return i`
|
|
974
985
|
${V(this, e, {
|
|
975
|
-
title:
|
|
976
|
-
sub:
|
|
986
|
+
title: i`${I(this.sport)} Top 25`,
|
|
987
|
+
sub: i`The HighSchoolOT poll · updated weekly · ${t.length} polls this season`,
|
|
977
988
|
teams: this.data.teams
|
|
978
989
|
})}
|
|
979
|
-
${B(this,
|
|
990
|
+
${B(this, i`
|
|
980
991
|
${P(this)}
|
|
981
992
|
<div class="toolbar">
|
|
982
993
|
<label class="asof" for="pollsel">Poll of</label>
|
|
983
994
|
<select id="pollsel" @change=${(m) => {
|
|
984
995
|
this.pollDate = m.target.value;
|
|
985
996
|
}}>
|
|
986
|
-
${t.map((m, f) =>
|
|
997
|
+
${t.map((m, f) => i`<option value=${m.effectiveDate} ?selected=${m === r}>
|
|
987
998
|
${y(m.effectiveDate, { month: "long", day: "numeric", year: "numeric" })}${f === 0 ? " · current" : ""}
|
|
988
999
|
</option>`)}
|
|
989
1000
|
</select>
|
|
@@ -998,45 +1009,45 @@ class Pe extends $ {
|
|
|
998
1009
|
<span class="spacer"></span>
|
|
999
1010
|
<span class="asof">Movement vs. the previous poll · sparkline = season rank history</span>
|
|
1000
1011
|
</div>
|
|
1001
|
-
${c ? this.renderHero(e,
|
|
1012
|
+
${c ? this.renderHero(e, r, o, l, c, h) : p}
|
|
1002
1013
|
<div class="card"><div class="tablewrap"><table class="data">
|
|
1003
1014
|
<thead><tr>
|
|
1004
1015
|
<th class="num">Rk</th><th>Mvmt</th><th>Team</th><th class="num">Record</th>
|
|
1005
1016
|
<th>Conference</th><th>Last result</th><th>Next</th><th>Season</th>
|
|
1006
1017
|
</tr></thead>
|
|
1007
1018
|
<tbody>
|
|
1008
|
-
${(
|
|
1019
|
+
${(r.teamIds || []).map((m, f) => f === 0 || !m ? p : this.renderRow(e, r, o, d, n, h, m, f + 1))}
|
|
1009
1020
|
</tbody>
|
|
1010
1021
|
</table></div></div>
|
|
1011
1022
|
<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>
|
|
1012
1023
|
`)}
|
|
1013
1024
|
`;
|
|
1014
1025
|
}
|
|
1015
|
-
renderHero(e, t, s,
|
|
1016
|
-
const n = e.records[
|
|
1017
|
-
return
|
|
1026
|
+
renderHero(e, t, s, r, o, d) {
|
|
1027
|
+
const n = e.records[r], h = ee(e.records, r), l = d[e.teamsById[r]?.conferenceId], c = `linear-gradient(120deg, ${o.colorPrimary || "#030711"} 0%, var(--hsot-black) 85%)`;
|
|
1028
|
+
return i`
|
|
1018
1029
|
<div class="hero1" style="background:${c}">
|
|
1019
1030
|
<div class="bigrank">#1</div>
|
|
1020
|
-
${C(
|
|
1031
|
+
${C(o, 64)}
|
|
1021
1032
|
<div>
|
|
1022
|
-
<h2><a href=${u(e.hrefs.school, { id:
|
|
1033
|
+
<h2><a href=${u(e.hrefs.school, { id: o.id })}>${o.name} ${o.mascot || ""}</a></h2>
|
|
1023
1034
|
<div class="facts">
|
|
1024
|
-
${w(n)} overall${l ?
|
|
1035
|
+
${w(n)} overall${l ? i` · ${w(n, !0)} ${l.name}` : p}
|
|
1025
1036
|
· streak ${L(n?.results) || "·"}
|
|
1026
|
-
${h ?
|
|
1027
|
-
${this.movement(t, s,
|
|
1037
|
+
${h ? i` · last: ${h.mark} ${h.my}-${h.their} vs ${_(e, h.opp)}` : p}
|
|
1038
|
+
${this.movement(t, s, r)}
|
|
1028
1039
|
</div>
|
|
1029
1040
|
</div>
|
|
1030
1041
|
</div>
|
|
1031
1042
|
`;
|
|
1032
1043
|
}
|
|
1033
|
-
renderRow(e, t, s,
|
|
1044
|
+
renderRow(e, t, s, r, o, d, n, h) {
|
|
1034
1045
|
const l = S(e, n);
|
|
1035
1046
|
if (!l) return p;
|
|
1036
|
-
const c = e.records[n], m =
|
|
1047
|
+
const c = e.records[n], m = ee(e.records, n), f = q(this.data.games, n), g = d[e.teamsById[n]?.conferenceId], k = () => {
|
|
1037
1048
|
location.href = u(e.hrefs.school, { id: l.id });
|
|
1038
1049
|
};
|
|
1039
|
-
return
|
|
1050
|
+
return i`
|
|
1040
1051
|
<tr class="rowlink" @click=${(O) => {
|
|
1041
1052
|
O.target.closest("a") || k();
|
|
1042
1053
|
}}>
|
|
@@ -1046,17 +1057,17 @@ class Pe extends $ {
|
|
|
1046
1057
|
<span class="mut" style="font-size:0.78rem">${l.mascot || ""}</span></td>
|
|
1047
1058
|
<td class="num">${w(c)}</td>
|
|
1048
1059
|
<td class="mut">${g?.name || "Independent"}</td>
|
|
1049
|
-
<td>${m ?
|
|
1060
|
+
<td>${m ? i`<a class="box" style="text-decoration:none" href=${u(e.hrefs.game, { sport: this.sport, id: m.gameId })}>
|
|
1050
1061
|
<b style="color:${m.mark === "W" ? "var(--hsot-win)" : m.mark === "L" ? "var(--hsot-loss)" : "var(--hsot-tie)"}">${m.mark}</b>
|
|
1051
|
-
${m.my}-${m.their} vs ${_(e, m.opp)}</a>` :
|
|
1052
|
-
<td>${
|
|
1053
|
-
<td>${this.sparkline(n,
|
|
1062
|
+
${m.my}-${m.their} vs ${_(e, m.opp)}</a>` : i`<span class="mut">·</span>`}</td>
|
|
1063
|
+
<td>${ne(e, f, n)}</td>
|
|
1064
|
+
<td>${this.sparkline(n, r, o)}</td>
|
|
1054
1065
|
</tr>
|
|
1055
1066
|
`;
|
|
1056
1067
|
}
|
|
1057
1068
|
}
|
|
1058
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings",
|
|
1059
|
-
const
|
|
1069
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings", Ae);
|
|
1070
|
+
const _e = b`
|
|
1060
1071
|
.schoolhero { color: var(--hsot-white); padding: 1.6rem 1.25rem 1.3rem; }
|
|
1061
1072
|
.schoolhero .inner { max-width: 1366px; margin: 0 auto; display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
|
|
1062
1073
|
.schoolhero .crest {
|
|
@@ -1085,8 +1096,8 @@ const Ee = b`
|
|
|
1085
1096
|
.rosterphoto { display: block; width: 100%; height: auto; background: var(--hsot-gray-1); border-bottom: 1px solid var(--hsot-gray-2); }
|
|
1086
1097
|
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } .schoolhero h1 { font-size: 1.9rem; } }
|
|
1087
1098
|
`;
|
|
1088
|
-
class
|
|
1089
|
-
static styles = [...F,
|
|
1099
|
+
class Re extends $ {
|
|
1100
|
+
static styles = [...F, _e];
|
|
1090
1101
|
static properties = {
|
|
1091
1102
|
...$.properties,
|
|
1092
1103
|
schoolId: { type: String, attribute: "school-id" },
|
|
@@ -1103,7 +1114,7 @@ class Ae extends $ {
|
|
|
1103
1114
|
e && !this.sport && (this.sport = e);
|
|
1104
1115
|
}
|
|
1105
1116
|
async fetchData(e) {
|
|
1106
|
-
const t = this.season || N(), s = await e.getSchool(this.schoolId),
|
|
1117
|
+
const t = this.season || N(), s = await e.getSchool(this.schoolId), o = (await e.listTeams({ schoolId: this.schoolId })).items, d = o.find((k) => k.sport === (this.sport || "football")) || o[0] || null, [n, h, l, c, m, f, g] = await Promise.all([
|
|
1107
1118
|
d ? e.listGames({ sport: d.sport, season: t }) : Promise.resolve({ items: [] }),
|
|
1108
1119
|
d ? e.listTeams({ sport: d.sport }) : Promise.resolve({ items: [] }),
|
|
1109
1120
|
e.listSchools(),
|
|
@@ -1117,7 +1128,7 @@ class Ae extends $ {
|
|
|
1117
1128
|
return {
|
|
1118
1129
|
season: t,
|
|
1119
1130
|
school: s,
|
|
1120
|
-
teams:
|
|
1131
|
+
teams: o,
|
|
1121
1132
|
active: d,
|
|
1122
1133
|
games: n.items,
|
|
1123
1134
|
allTeams: h.items,
|
|
@@ -1142,87 +1153,87 @@ class Ae extends $ {
|
|
|
1142
1153
|
this.sport = e, this.load();
|
|
1143
1154
|
}
|
|
1144
1155
|
renderView() {
|
|
1145
|
-
const { school: e, teams: t, active: s, season:
|
|
1146
|
-
if (!e) return
|
|
1147
|
-
const
|
|
1148
|
-
return
|
|
1156
|
+
const { school: e, teams: t, active: s, season: r } = this.data;
|
|
1157
|
+
if (!e) return i`<div class="view"><p class="empty">School not found.</p></div>`;
|
|
1158
|
+
const o = this.ctx, d = E(e.colorPrimary || "#030711"), n = (e.adm || [])[0], h = v(this.data.conferences), l = s ? h[s.conferenceId] : null;
|
|
1159
|
+
return i`
|
|
1149
1160
|
<div class="schoolhero" style="background:linear-gradient(115deg, ${e.colorPrimary || "#030711"} 0%, ${e.colorPrimary || "#030711"} 55%, var(--hsot-black) 100%);color:${d}">
|
|
1150
1161
|
<div class="inner">
|
|
1151
|
-
${A(e, 84) ?
|
|
1162
|
+
${A(e, 84) ? i`<img class="crest logo" alt="" loading="lazy" src=${A(e, 84)} />` : i`<div class="crest" style="background:${e.colorSecondary || "#7C7C7C"};color:${E(e.colorSecondary || "#7C7C7C")}">${j(e)}</div>`}
|
|
1152
1163
|
<div style="min-width:260px">
|
|
1153
1164
|
<h1>${e.name} <span class="mascot">${e.mascot || ""}</span></h1>
|
|
1154
1165
|
<div class="facts">
|
|
1155
|
-
${e.location ?
|
|
1156
|
-
${e.association ?
|
|
1157
|
-
${l ?
|
|
1158
|
-
${n ?
|
|
1159
|
-
${e.openingYear ?
|
|
1160
|
-
${e.areaCode ?
|
|
1166
|
+
${e.location ? i`<span><b>Location</b>${e.location}${e.county ? i` · ${e.county} County` : p}</span>` : p}
|
|
1167
|
+
${e.association ? i`<span><b>League</b>${e.association}${e.classification ? i` · ${e.classification}` : p}</span>` : p}
|
|
1168
|
+
${l ? i`<span><b>Conference</b>${l.name}</span>` : p}
|
|
1169
|
+
${n ? i`<span><b>Enrollment</b>${n.value.toLocaleString()} (${n.season} ADM)</span>` : p}
|
|
1170
|
+
${e.openingYear ? i`<span><b>Opened</b>${e.openingYear}</span>` : p}
|
|
1171
|
+
${e.areaCode ? i`<span><b>Area</b>${e.areaCode}</span>` : p}
|
|
1161
1172
|
</div>
|
|
1162
1173
|
</div>
|
|
1163
1174
|
</div>
|
|
1164
1175
|
</div>
|
|
1165
1176
|
<div class="band">
|
|
1166
1177
|
<nav class="tabs" aria-label="Teams">
|
|
1167
|
-
${t.map((c) => c.id === s?.id ?
|
|
1178
|
+
${t.map((c) => c.id === s?.id ? i`<a class="on" href="#" @click=${(m) => m.preventDefault()}>${c.name}</a>` : i`<a href="#" @click=${(m) => {
|
|
1168
1179
|
m.preventDefault(), this.switchSport(c.sport);
|
|
1169
1180
|
}}>${c.name}</a>`)}
|
|
1170
1181
|
</nav>
|
|
1171
1182
|
</div>
|
|
1172
|
-
${B(this,
|
|
1183
|
+
${B(this, i`
|
|
1173
1184
|
${P(this)}
|
|
1174
|
-
${s ? this.renderTeam(
|
|
1185
|
+
${s ? this.renderTeam(o, s, l, r) : i`<p class="empty">No teams recorded for this school yet.</p>`}
|
|
1175
1186
|
`)}
|
|
1176
1187
|
`;
|
|
1177
1188
|
}
|
|
1178
|
-
renderTeam(e, t, s,
|
|
1179
|
-
const
|
|
1180
|
-
return
|
|
1189
|
+
renderTeam(e, t, s, r) {
|
|
1190
|
+
const o = e.records[t.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, d = o.w + o.l + o.t, n = s ? this.data.allTeams.filter((m) => m.conferenceId === s.id) : [], h = s ? re(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)));
|
|
1191
|
+
return i`
|
|
1181
1192
|
<div class="tiles">
|
|
1182
|
-
<div class="tile"><div class="k">Overall</div><div class="v">${w(
|
|
1183
|
-
<div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${w(
|
|
1184
|
-
<div class="s">${h ? `${
|
|
1185
|
-
<div class="tile"><div class="k">Points</div><div class="v">${d ? (
|
|
1186
|
-
<div class="s">scored per game · ${d ? (
|
|
1187
|
-
<div class="tile"><div class="k">Streak</div><div class="v">${L(
|
|
1193
|
+
<div class="tile"><div class="k">Overall</div><div class="v">${w(o)}</div><div class="s">${d} games played</div></div>
|
|
1194
|
+
<div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${w(o, !0)}</div>
|
|
1195
|
+
<div class="s">${h ? `${fe(h)} of ${n.length}` : "·"}</div></div>
|
|
1196
|
+
<div class="tile"><div class="k">Points</div><div class="v">${d ? (o.pf / d).toFixed(1) : "0.0"}</div>
|
|
1197
|
+
<div class="s">scored per game · ${d ? (o.pa / d).toFixed(1) : "0.0"} allowed</div></div>
|
|
1198
|
+
<div class="tile"><div class="k">Streak</div><div class="v">${L(o.results) || "·"}</div>
|
|
1188
1199
|
<div class="s">last 5: ${K(e, t.id)}</div></div>
|
|
1189
1200
|
<div class="tile"><div class="k">HSOT Top 25</div><div class="v">${l ? `#${l}` : "NR"}</div>
|
|
1190
1201
|
<div class="s"><a href=${u(e.hrefs.section, { sport: t.sport, view: "rankings" })}>full poll</a></div></div>
|
|
1191
1202
|
</div>
|
|
1192
|
-
${(t.championships || []).length ?
|
|
1203
|
+
${(t.championships || []).length ? i`
|
|
1193
1204
|
<div style="margin:-0.2rem 0 1rem;display:flex;gap:0.4rem;flex-wrap:wrap">
|
|
1194
|
-
${t.championships.map((m) =>
|
|
1205
|
+
${t.championships.map((m) => i`<span class="pill champ">★ ${m.season} ${m.title} champion${m.classification ? ` · ${m.classification}` : ""}${m.region ? ` · ${m.region}` : ""}</span>`)}
|
|
1195
1206
|
</div>` : p}
|
|
1196
1207
|
<div class="cols">
|
|
1197
1208
|
<div>
|
|
1198
1209
|
<div class="section-title">Schedule & results</div>
|
|
1199
1210
|
<div class="card">
|
|
1200
|
-
${c.length ?
|
|
1211
|
+
${c.length ? i`<ul class="gamelist">${c.map((m) => this.renderGameRow(e, t, m))}</ul>` : i`<p class="empty">No ${t.sport} games recorded for ${r}.</p>`}
|
|
1201
1212
|
</div>
|
|
1202
1213
|
</div>
|
|
1203
1214
|
<div>
|
|
1204
|
-
<div class="section-title">Roster · ${
|
|
1205
|
-
<div class="card">${this.renderRoster(t,
|
|
1215
|
+
<div class="section-title">Roster · ${r}</div>
|
|
1216
|
+
<div class="card">${this.renderRoster(t, r)}</div>
|
|
1206
1217
|
</div>
|
|
1207
1218
|
</div>
|
|
1208
1219
|
`;
|
|
1209
1220
|
}
|
|
1210
1221
|
renderGameRow(e, t, s) {
|
|
1211
|
-
const
|
|
1212
|
-
let h =
|
|
1222
|
+
const r = s.homeTeamId === t.id, o = r ? s.awayTeamId : s.homeTeamId, d = r ? s.homeScore : s.awayScore, n = r ? s.awayScore : s.homeScore;
|
|
1223
|
+
let h = i`<span class="mut">${U(s.time)}</span>`;
|
|
1213
1224
|
if (s.state === "final") {
|
|
1214
|
-
const c = G(s), m = c === "tie" ? "T" : c === (
|
|
1215
|
-
h =
|
|
1216
|
-
} else s.state === "live" && (h =
|
|
1225
|
+
const c = G(s), m = c === "tie" ? "T" : c === (r ? "home" : "away") ? "W" : "L";
|
|
1226
|
+
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}`;
|
|
1227
|
+
} else s.state === "live" && (h = i`<span style="color:var(--hsot-red)">${d}-${n}</span>`);
|
|
1217
1228
|
const l = s.gameType === "conference" ? "Conf" : s.gameType === "nonconference" ? "Non-conf" : s.gameType === "playoff" ? `Playoff${s.label ? ` · ${s.label}` : ""}` : "Scrimmage";
|
|
1218
|
-
return
|
|
1229
|
+
return i`
|
|
1219
1230
|
<li>
|
|
1220
1231
|
<span class="d">${y(s.date)}</span>
|
|
1221
|
-
${
|
|
1232
|
+
${se(s).kind === "sched" ? p : R(s)}
|
|
1222
1233
|
<span class="res">${h}</span>
|
|
1223
|
-
<span class="opp">${
|
|
1234
|
+
<span class="opp">${r ? "vs" : "at"} ${ie(e, o, s.date)}
|
|
1224
1235
|
<span class="pill type">${l}</span>
|
|
1225
|
-
${s.broadcast ?
|
|
1236
|
+
${s.broadcast ? i`<span class="pill class">${s.broadcast}</span>` : p}
|
|
1226
1237
|
</span>
|
|
1227
1238
|
<span class="where">${s.venue || ""}</span>
|
|
1228
1239
|
<a class="box" href=${u(e.hrefs.game, { sport: t.sport, id: s.id })}>Box score →</a>
|
|
@@ -1232,24 +1243,24 @@ class Ae extends $ {
|
|
|
1232
1243
|
renderRoster(e, t) {
|
|
1233
1244
|
const s = this.data.roster;
|
|
1234
1245
|
if (!s)
|
|
1235
|
-
return
|
|
1236
|
-
const
|
|
1237
|
-
return
|
|
1238
|
-
${
|
|
1239
|
-
alt="${
|
|
1246
|
+
return i`<p class="empty">Roster not published for ${t}.</p>`;
|
|
1247
|
+
const r = ze(s, 560), o = 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);
|
|
1248
|
+
return i`
|
|
1249
|
+
${r ? i`<img class="rosterphoto" src=${r} loading="lazy" decoding="async"
|
|
1250
|
+
alt="${o} ${e.name} ${t} team photo" />` : p}
|
|
1240
1251
|
<div class="tablewrap"><table class="data">
|
|
1241
|
-
<thead><tr><th class="num">No.</th><th>Player</th><th>Pos</th><th>Class</th><th class="num">Ht</th><th class="num">Wt</th>${h ?
|
|
1252
|
+
<thead><tr><th class="num">No.</th><th>Player</th><th>Pos</th><th>Class</th><th class="num">Ht</th><th class="num">Wt</th>${h ? i`<th>College</th>` : p}</tr></thead>
|
|
1242
1253
|
<tbody>
|
|
1243
1254
|
${n.map((l) => {
|
|
1244
1255
|
const c = d[l.playerId];
|
|
1245
|
-
return c ?
|
|
1256
|
+
return c ? i`<tr>
|
|
1246
1257
|
<td class="num mut">${l.number ?? "·"}</td>
|
|
1247
1258
|
<td style="font-weight:500">${c.firstName} ${c.lastName}</td>
|
|
1248
1259
|
<td>${l.position || "·"}</td>
|
|
1249
1260
|
<td class="mut">${c.classOf || "·"}</td>
|
|
1250
|
-
<td class="num">${
|
|
1261
|
+
<td class="num">${me(c.heightIn)}</td>
|
|
1251
1262
|
<td class="num">${c.weightLb || "·"}</td>
|
|
1252
|
-
${h ?
|
|
1263
|
+
${h ? i`<td>${c.college || "·"}</td>` : p}
|
|
1253
1264
|
</tr>` : p;
|
|
1254
1265
|
})}
|
|
1255
1266
|
</tbody>
|
|
@@ -1257,16 +1268,16 @@ class Ae extends $ {
|
|
|
1257
1268
|
`;
|
|
1258
1269
|
}
|
|
1259
1270
|
}
|
|
1260
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school",
|
|
1261
|
-
const
|
|
1262
|
-
function
|
|
1271
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school", Re);
|
|
1272
|
+
const Ne = "https://api.wral.com/search";
|
|
1273
|
+
function Le(a) {
|
|
1263
1274
|
return a.map((e) => `uri:"${e}"`).join(" OR ");
|
|
1264
1275
|
}
|
|
1265
|
-
function
|
|
1266
|
-
const t = String(a ||
|
|
1276
|
+
function Oe(a, e) {
|
|
1277
|
+
const t = String(a || Ne).replace(/\/+$/, ""), s = new URLSearchParams({ query: Le(e), sort: "score", lang: "en" });
|
|
1267
1278
|
return `${t}/v1/query?${s}`;
|
|
1268
1279
|
}
|
|
1269
|
-
function
|
|
1280
|
+
function le(a) {
|
|
1270
1281
|
try {
|
|
1271
1282
|
const e = new URL(a);
|
|
1272
1283
|
if (/(^|\.)smugmug\.com$/i.test(e.hostname)) {
|
|
@@ -1281,13 +1292,13 @@ function ne(a) {
|
|
|
1281
1292
|
}
|
|
1282
1293
|
return { uri: a, title: a };
|
|
1283
1294
|
}
|
|
1284
|
-
async function
|
|
1285
|
-
const
|
|
1286
|
-
if (!
|
|
1287
|
-
const
|
|
1288
|
-
return e.map((n) => d.get(n) ||
|
|
1295
|
+
async function He(a, e, t) {
|
|
1296
|
+
const r = await ((...n) => fetch(...n))(Oe(a, e));
|
|
1297
|
+
if (!r.ok) throw new Error(`search answered ${r.status}`);
|
|
1298
|
+
const o = await r.json(), d = new Map((o.items || []).map((n) => [n.uri, n]));
|
|
1299
|
+
return e.map((n) => d.get(n) || le(n));
|
|
1289
1300
|
}
|
|
1290
|
-
const
|
|
1301
|
+
const Ue = b`
|
|
1291
1302
|
.breadcrumbs { font-size: 0.8125rem; margin: 0.9rem 0 0; color: var(--hsot-gray-5); }
|
|
1292
1303
|
.breadcrumbs a { text-decoration: none; }
|
|
1293
1304
|
.scorehead { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; padding: 1.4rem 1rem; }
|
|
@@ -1326,8 +1337,8 @@ const Oe = b`
|
|
|
1326
1337
|
.cols { grid-template-columns: 1fr; }
|
|
1327
1338
|
}
|
|
1328
1339
|
`;
|
|
1329
|
-
class
|
|
1330
|
-
static styles = [...F,
|
|
1340
|
+
class Me extends $ {
|
|
1341
|
+
static styles = [...F, Ue];
|
|
1331
1342
|
static properties = {
|
|
1332
1343
|
...$.properties,
|
|
1333
1344
|
gameId: { type: String, attribute: "game-id" },
|
|
@@ -1341,7 +1352,7 @@ class He extends $ {
|
|
|
1341
1352
|
super(), this.gameId = "", this.searchApi = "";
|
|
1342
1353
|
}
|
|
1343
1354
|
async fetchData(e) {
|
|
1344
|
-
const t = await e.getGame(this.gameId), s = Array.isArray(t.coverageUrls) ? t.coverageUrls : [], [
|
|
1355
|
+
const t = await e.getGame(this.gameId), s = Array.isArray(t.coverageUrls) ? t.coverageUrls : [], [r, o, d, n, h, l] = await Promise.all([
|
|
1345
1356
|
e.listSchools(),
|
|
1346
1357
|
e.listTeams({ sport: t.sport }),
|
|
1347
1358
|
e.listConferences(),
|
|
@@ -1349,12 +1360,12 @@ class He extends $ {
|
|
|
1349
1360
|
e.listGames({ sport: t.sport, season: t.season }),
|
|
1350
1361
|
// A search outage must not blank the box score — degrade to bare
|
|
1351
1362
|
// links (fetchCoverage already degrades per-URL index misses).
|
|
1352
|
-
s.length ?
|
|
1363
|
+
s.length ? He(this.searchApi, s).catch(() => s.map(le)) : Promise.resolve([])
|
|
1353
1364
|
]);
|
|
1354
1365
|
return {
|
|
1355
1366
|
game: t,
|
|
1356
|
-
schools:
|
|
1357
|
-
teams:
|
|
1367
|
+
schools: r.items,
|
|
1368
|
+
teams: o.items,
|
|
1358
1369
|
conferences: d.items,
|
|
1359
1370
|
rankings: n.items,
|
|
1360
1371
|
games: h.items,
|
|
@@ -1373,10 +1384,10 @@ class He extends $ {
|
|
|
1373
1384
|
}
|
|
1374
1385
|
renderView() {
|
|
1375
1386
|
const e = this.data.game;
|
|
1376
|
-
if (!e) return
|
|
1377
|
-
const t = this.ctx, s = v(this.data.conferences),
|
|
1378
|
-
return
|
|
1379
|
-
${B(this,
|
|
1387
|
+
if (!e) return i`<div class="view"><p class="empty">Game not found.</p></div>`;
|
|
1388
|
+
const t = this.ctx, s = v(this.data.conferences), r = t.teamsById[e.awayTeamId] ? t.schoolsById[t.teamsById[e.awayTeamId].schoolId] : null, o = 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));
|
|
1389
|
+
return i`
|
|
1390
|
+
${B(this, i`
|
|
1380
1391
|
${P(this)}
|
|
1381
1392
|
<p class="breadcrumbs">
|
|
1382
1393
|
<a href=${u(t.hrefs.section, { sport: e.sport, view: "scores" })}>${I(e.sport)}</a> /
|
|
@@ -1385,7 +1396,7 @@ class He extends $ {
|
|
|
1385
1396
|
</p>
|
|
1386
1397
|
<div class="card">
|
|
1387
1398
|
<div class="scorehead">
|
|
1388
|
-
${this.teamBlock(t, e, e.awayTeamId,
|
|
1399
|
+
${this.teamBlock(t, e, e.awayTeamId, r, !1)}
|
|
1389
1400
|
<div class="mid">
|
|
1390
1401
|
<div class="bigscore">
|
|
1391
1402
|
<span style=${n("away")}>${e.awayScore}</span>
|
|
@@ -1393,29 +1404,29 @@ class He extends $ {
|
|
|
1393
1404
|
<span style=${n("home")}>${e.homeScore}</span>
|
|
1394
1405
|
</div>
|
|
1395
1406
|
<div class="status">${R(e)}</div>
|
|
1396
|
-
<div class="status">${y(e.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${e.state === "scheduled" && e.time ?
|
|
1397
|
-
${e.broadcast ?
|
|
1407
|
+
<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"}
|
|
1408
|
+
${e.broadcast ? i` · <span class="pill class">${e.broadcast}</span>` : p}</div>
|
|
1398
1409
|
<div class="status">
|
|
1399
1410
|
<span class="pill type">${e.gameType === "conference" ? `${h?.name || "Conference"} game` : e.gameType}</span>
|
|
1400
|
-
${e.label ?
|
|
1401
|
-
${(e.tags || []).map((c) =>
|
|
1411
|
+
${e.label ? i`<span class="pill type">Bracket ${e.label}</span>` : p}
|
|
1412
|
+
${(e.tags || []).map((c) => i`<span class="pill type">${c}</span>`)}
|
|
1402
1413
|
</div>
|
|
1403
1414
|
</div>
|
|
1404
|
-
${this.teamBlock(t, e, e.homeTeamId,
|
|
1415
|
+
${this.teamBlock(t, e, e.homeTeamId, o, !0)}
|
|
1405
1416
|
</div>
|
|
1406
|
-
${this.renderLineScore(e,
|
|
1407
|
-
${e.notes ?
|
|
1417
|
+
${this.renderLineScore(e, r, o)}
|
|
1418
|
+
${e.notes ? i`<p class="note" style="padding:0 1rem 0.9rem;text-align:center">${e.notes}</p>` : p}
|
|
1408
1419
|
</div>
|
|
1409
|
-
${(this.data.coverage || []).length ?
|
|
1420
|
+
${(this.data.coverage || []).length ? i`
|
|
1410
1421
|
<div class="section-title">Coverage</div>
|
|
1411
1422
|
<div class="covgrid">
|
|
1412
|
-
${this.data.coverage.map((c) =>
|
|
1423
|
+
${this.data.coverage.map((c) => i`
|
|
1413
1424
|
<a class="card covcard" href=${c.uri}>
|
|
1414
|
-
${c.image ?
|
|
1425
|
+
${c.image ? i`<img class="covimg" src=${c.image} alt="" loading="lazy" />` : p}
|
|
1415
1426
|
<div class="covbody">
|
|
1416
|
-
<div class="covtitle">${c.videoDuration ?
|
|
1417
|
-
${c.description ?
|
|
1418
|
-
${c.author || c.publishedTime ?
|
|
1427
|
+
<div class="covtitle">${c.videoDuration ? i`<span class="pill live" style="animation:none">Video</span> ` : p}${c.photos ? i`<span class="pill live" style="animation:none">Photos</span> ` : p}${c.title || c.uri}</div>
|
|
1428
|
+
${c.description ? i`<p class="covdesc">${c.description}</p>` : p}
|
|
1429
|
+
${c.author || c.publishedTime ? i`
|
|
1419
1430
|
<div class="covmeta">${[c.author, c.publishedTime ? new Date(c.publishedTime).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : ""].filter(Boolean).join(" · ")}</div>
|
|
1420
1431
|
` : p}
|
|
1421
1432
|
</div>
|
|
@@ -1424,12 +1435,12 @@ class He extends $ {
|
|
|
1424
1435
|
</div>` : p}
|
|
1425
1436
|
<div class="section-title">Season context</div>
|
|
1426
1437
|
<div class="cols">
|
|
1427
|
-
${[[e.awayTeamId,
|
|
1438
|
+
${[[e.awayTeamId, r], [e.homeTeamId, o]].map(([c, m]) => this.renderContext(t, c, m))}
|
|
1428
1439
|
</div>
|
|
1429
|
-
${l.length ?
|
|
1440
|
+
${l.length ? i`
|
|
1430
1441
|
<div class="section-title">Head to head this season</div>
|
|
1431
1442
|
<div class="card"><ul class="gamelist">
|
|
1432
|
-
${l.map((c) =>
|
|
1443
|
+
${l.map((c) => i`<li>
|
|
1433
1444
|
<span class="d">${y(c.date)}</span>${R(c)}
|
|
1434
1445
|
<span class="opp">${T(t, c.awayTeamId)} ${c.awayScore}, ${T(t, c.homeTeamId)} ${c.homeScore}</span>
|
|
1435
1446
|
<a class="box" href=${u(t.hrefs.game, { sport: e.sport, id: c.id })}>Box score →</a>
|
|
@@ -1438,36 +1449,36 @@ class He extends $ {
|
|
|
1438
1449
|
`)}
|
|
1439
1450
|
`;
|
|
1440
1451
|
}
|
|
1441
|
-
teamBlock(e, t, s,
|
|
1442
|
-
if (!
|
|
1443
|
-
const d = e.teamsById[s], n = e.records[s], h = A(
|
|
1444
|
-
return
|
|
1445
|
-
<div class="teamblock ${
|
|
1446
|
-
${h ?
|
|
1452
|
+
teamBlock(e, t, s, r, o) {
|
|
1453
|
+
if (!r) return i`<div class="teamblock ${o ? "right" : ""}"><div class="tname">TBD</div></div>`;
|
|
1454
|
+
const d = e.teamsById[s], n = e.records[s], h = A(r, 58);
|
|
1455
|
+
return i`
|
|
1456
|
+
<div class="teamblock ${o ? "right" : ""}">
|
|
1457
|
+
${h ? i`<img class="crest logo" alt="" loading="lazy" src=${h} />` : i`<span class="crest" style="background:${r.colorPrimary || "#030711"};color:${E(r.colorPrimary || "#030711")}">${j(r)}</span>`}
|
|
1447
1458
|
<div>
|
|
1448
|
-
<div class="tname">${Y(e, s, t.date)}<a href=${u(e.hrefs.school, { id:
|
|
1449
|
-
<div class="trec">${
|
|
1459
|
+
<div class="tname">${Y(e, s, t.date)}<a href=${u(e.hrefs.school, { id: r.id })}>${r.name}</a></div>
|
|
1460
|
+
<div class="trec">${r.mascot || ""} · ${w(n)}${d?.conferenceId ? i` · ${w(n, !0)} conf` : p}</div>
|
|
1450
1461
|
</div>
|
|
1451
1462
|
</div>
|
|
1452
1463
|
`;
|
|
1453
1464
|
}
|
|
1454
1465
|
renderLineScore(e, t, s) {
|
|
1455
|
-
const
|
|
1456
|
-
if (!
|
|
1457
|
-
return
|
|
1458
|
-
const
|
|
1459
|
-
const m =
|
|
1466
|
+
const r = e.periodScores || [];
|
|
1467
|
+
if (!r.length)
|
|
1468
|
+
return i`<p class="empty" style="text-align:center">Period scoring will appear once the game starts.</p>`;
|
|
1469
|
+
const o = Math.max(4, ...r.map((l) => l.period)), d = (l) => l <= 4 ? String(l) : `OT${l > 5 ? l - 4 : ""}`, n = (l, c) => {
|
|
1470
|
+
const m = r.find((f) => f.period === c);
|
|
1460
1471
|
return m ? m[l] : e.state === "final" ? 0 : "·";
|
|
1461
|
-
}, h = (l, c, m) =>
|
|
1472
|
+
}, h = (l, c, m) => i`
|
|
1462
1473
|
<tr>
|
|
1463
1474
|
<td class="teamcell">${C(l, 20)}${l?.abbr || "TBD"}</td>
|
|
1464
|
-
${Array.from({ length:
|
|
1475
|
+
${Array.from({ length: o }, (f, g) => i`<td class="num">${n(c, g + 1)}</td>`)}
|
|
1465
1476
|
<td class="num" style="font-weight:700">${m}</td>
|
|
1466
1477
|
</tr>`;
|
|
1467
|
-
return
|
|
1478
|
+
return i`
|
|
1468
1479
|
<div class="tablewrap" style="border-top:1px solid var(--hsot-gray-2)">
|
|
1469
1480
|
<table class="data" style="max-width:560px;margin:0.6rem auto 0.9rem">
|
|
1470
|
-
<thead><tr><th>Team</th>${Array.from({ length:
|
|
1481
|
+
<thead><tr><th>Team</th>${Array.from({ length: o }, (l, c) => i`<th class="num">${d(c + 1)}</th>`)}<th class="num">T</th></tr></thead>
|
|
1471
1482
|
<tbody>
|
|
1472
1483
|
${h(t, "away", e.awayScore)}
|
|
1473
1484
|
${h(s, "home", e.homeScore)}
|
|
@@ -1478,24 +1489,24 @@ class He extends $ {
|
|
|
1478
1489
|
}
|
|
1479
1490
|
renderContext(e, t, s) {
|
|
1480
1491
|
if (!s) return p;
|
|
1481
|
-
const
|
|
1482
|
-
return
|
|
1492
|
+
const r = e.records[t], o = q(this.data.games, t);
|
|
1493
|
+
return i`
|
|
1483
1494
|
<div class="card ctxcard">
|
|
1484
1495
|
<div class="who">${C(s)}${s.name}</div>
|
|
1485
1496
|
<div class="row">
|
|
1486
1497
|
<span>Last 5: ${K(e, t)}</span>
|
|
1487
|
-
<span>Streak: <b>${
|
|
1488
|
-
<span>PF/PA: <b>${
|
|
1489
|
-
<span>Next: ${
|
|
1490
|
-
${
|
|
1498
|
+
<span>Streak: <b>${r ? L(r.results) : "·"}</b></span>
|
|
1499
|
+
<span>PF/PA: <b>${r ? `${r.pf} / ${r.pa}` : "·"}</b></span>
|
|
1500
|
+
<span>Next: ${o ? i`${y(o.date, { month: "numeric", day: "numeric" })}
|
|
1501
|
+
${o.homeTeamId === t ? "vs" : "at"} ${_(e, o.homeTeamId === t ? o.awayTeamId : o.homeTeamId)}` : "·"}</span>
|
|
1491
1502
|
</div>
|
|
1492
1503
|
</div>
|
|
1493
1504
|
`;
|
|
1494
1505
|
}
|
|
1495
1506
|
}
|
|
1496
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore",
|
|
1497
|
-
const
|
|
1498
|
-
class
|
|
1507
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore", Me);
|
|
1508
|
+
const je = 250, Ge = 2;
|
|
1509
|
+
class qe extends te {
|
|
1499
1510
|
static properties = {
|
|
1500
1511
|
api: { type: String },
|
|
1501
1512
|
schoolHref: { type: String, attribute: "school-href" },
|
|
@@ -1575,11 +1586,11 @@ class je extends ee {
|
|
|
1575
1586
|
}
|
|
1576
1587
|
onInput(e) {
|
|
1577
1588
|
const t = e.target.value.trim();
|
|
1578
|
-
if (clearTimeout(this.debounceTimer), t.length <
|
|
1589
|
+
if (clearTimeout(this.debounceTimer), t.length < Ge) {
|
|
1579
1590
|
this.abortController?.abort(), this.results = [], this.open = !1, this.searched = !1;
|
|
1580
1591
|
return;
|
|
1581
1592
|
}
|
|
1582
|
-
this.debounceTimer = setTimeout(() => this.search(t),
|
|
1593
|
+
this.debounceTimer = setTimeout(() => this.search(t), je);
|
|
1583
1594
|
}
|
|
1584
1595
|
async search(e) {
|
|
1585
1596
|
this.abortController?.abort(), this.abortController = new AbortController();
|
|
@@ -1589,8 +1600,8 @@ class je extends ee {
|
|
|
1589
1600
|
});
|
|
1590
1601
|
if (!s.ok)
|
|
1591
1602
|
return;
|
|
1592
|
-
const
|
|
1593
|
-
this.results =
|
|
1603
|
+
const r = await s.json();
|
|
1604
|
+
this.results = r.items || [], this.activeIndex = -1, this.searched = !0, this.open = !0;
|
|
1594
1605
|
} catch (t) {
|
|
1595
1606
|
t.name !== "AbortError" && console.warn("school search failed", t);
|
|
1596
1607
|
}
|
|
@@ -1624,36 +1635,36 @@ class je extends ee {
|
|
|
1624
1635
|
return [e.location, e.county && `${e.county} County`].filter(Boolean).join(" — ");
|
|
1625
1636
|
}
|
|
1626
1637
|
renderOption(e, t) {
|
|
1627
|
-
const s = this.where(e),
|
|
1628
|
-
|
|
1638
|
+
const s = this.where(e), r = (o) => {
|
|
1639
|
+
o.preventDefault(), this.go(e);
|
|
1629
1640
|
};
|
|
1630
|
-
return
|
|
1641
|
+
return i`
|
|
1631
1642
|
<li
|
|
1632
1643
|
id="school-option-${t}"
|
|
1633
1644
|
role="option"
|
|
1634
1645
|
aria-selected="${t === this.activeIndex ? "true" : "false"}"
|
|
1635
|
-
@pointerdown="${
|
|
1646
|
+
@pointerdown="${r}"
|
|
1636
1647
|
@mousemove="${() => {
|
|
1637
1648
|
this.activeIndex = t;
|
|
1638
1649
|
}}"
|
|
1639
1650
|
>
|
|
1640
1651
|
<span class="name">${e.name}</span>
|
|
1641
|
-
${s ?
|
|
1652
|
+
${s ? i`<span class="where">${s}</span>` : p}
|
|
1642
1653
|
</li>
|
|
1643
1654
|
`;
|
|
1644
1655
|
}
|
|
1645
1656
|
renderListbox() {
|
|
1646
|
-
const e = this.searched && !this.results.length, t =
|
|
1647
|
-
return
|
|
1657
|
+
const e = this.searched && !this.results.length, t = i`<li class="empty">No schools found</li>`;
|
|
1658
|
+
return i`
|
|
1648
1659
|
<ul id="school-search-listbox" role="listbox" aria-label="Schools">
|
|
1649
|
-
${this.results.map((s,
|
|
1660
|
+
${this.results.map((s, r) => this.renderOption(s, r))}
|
|
1650
1661
|
${e ? t : p}
|
|
1651
1662
|
</ul>
|
|
1652
1663
|
`;
|
|
1653
1664
|
}
|
|
1654
1665
|
render() {
|
|
1655
1666
|
const e = this.activeIndex >= 0 ? `school-option-${this.activeIndex}` : "";
|
|
1656
|
-
return
|
|
1667
|
+
return i`
|
|
1657
1668
|
<input
|
|
1658
1669
|
type="text"
|
|
1659
1670
|
role="combobox"
|
|
@@ -1672,23 +1683,23 @@ class je extends ee {
|
|
|
1672
1683
|
`;
|
|
1673
1684
|
}
|
|
1674
1685
|
}
|
|
1675
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search",
|
|
1686
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search", qe);
|
|
1676
1687
|
export {
|
|
1677
1688
|
H as D,
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1689
|
+
Me as H,
|
|
1690
|
+
Ae as a,
|
|
1691
|
+
Re as b,
|
|
1692
|
+
qe as c,
|
|
1693
|
+
Be as d,
|
|
1694
|
+
Pe as e,
|
|
1684
1695
|
z as f,
|
|
1685
|
-
|
|
1696
|
+
he as g,
|
|
1686
1697
|
u as h,
|
|
1687
1698
|
G as i,
|
|
1688
|
-
|
|
1699
|
+
Ve as j,
|
|
1689
1700
|
L as k,
|
|
1690
|
-
|
|
1701
|
+
De as p,
|
|
1691
1702
|
w as r,
|
|
1692
|
-
|
|
1703
|
+
re as s,
|
|
1693
1704
|
W as t
|
|
1694
1705
|
};
|