@wral/hsot-data 0.1.13 → 0.1.14
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.
|
@@ -35,7 +35,7 @@ const ae = (a) => new Nt(typeof a == "string" ? a : a + "", void 0, lt), b = (a,
|
|
|
35
35
|
for (const s of t.cssRules) e += s.cssText;
|
|
36
36
|
return ae(e);
|
|
37
37
|
})(a) : a;
|
|
38
|
-
const { is: oe, defineProperty: ie, getOwnPropertyDescriptor: ne, getOwnPropertyNames: le, getOwnPropertySymbols: ce, getPrototypeOf: he } = Object, X = globalThis, kt = X.trustedTypes, de = kt ? kt.emptyScript : "", pe = X.reactiveElementPolyfillSupport,
|
|
38
|
+
const { is: oe, defineProperty: ie, getOwnPropertyDescriptor: ne, getOwnPropertyNames: le, getOwnPropertySymbols: ce, getPrototypeOf: he } = Object, X = globalThis, kt = X.trustedTypes, de = kt ? kt.emptyScript : "", pe = X.reactiveElementPolyfillSupport, R = (a, t) => a, it = { toAttribute(a, t) {
|
|
39
39
|
switch (t) {
|
|
40
40
|
case Boolean:
|
|
41
41
|
a = a ? de : null;
|
|
@@ -85,21 +85,21 @@ let I = class extends HTMLElement {
|
|
|
85
85
|
this[e] = i;
|
|
86
86
|
} };
|
|
87
87
|
return { get: r, set(i) {
|
|
88
|
-
const
|
|
89
|
-
o?.call(this, i), this.requestUpdate(t,
|
|
88
|
+
const l = r?.call(this);
|
|
89
|
+
o?.call(this, i), this.requestUpdate(t, l, s);
|
|
90
90
|
}, configurable: !0, enumerable: !0 };
|
|
91
91
|
}
|
|
92
92
|
static getPropertyOptions(t) {
|
|
93
93
|
return this.elementProperties.get(t) ?? _t;
|
|
94
94
|
}
|
|
95
95
|
static _$Ei() {
|
|
96
|
-
if (this.hasOwnProperty(
|
|
96
|
+
if (this.hasOwnProperty(R("elementProperties"))) return;
|
|
97
97
|
const t = he(this);
|
|
98
98
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
99
99
|
}
|
|
100
100
|
static finalize() {
|
|
101
|
-
if (this.hasOwnProperty(
|
|
102
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
101
|
+
if (this.hasOwnProperty(R("finalized"))) return;
|
|
102
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(R("properties"))) {
|
|
103
103
|
const e = this.properties, s = [...le(e), ...ce(e)];
|
|
104
104
|
for (const r of s) this.createProperty(r, e[r]);
|
|
105
105
|
}
|
|
@@ -171,8 +171,8 @@ let I = class extends HTMLElement {
|
|
|
171
171
|
if (r !== void 0 && this._$Em !== r) {
|
|
172
172
|
const o = s.getPropertyOptions(r), i = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : it;
|
|
173
173
|
this._$Em = r;
|
|
174
|
-
const
|
|
175
|
-
this[r] =
|
|
174
|
+
const l = i.fromAttribute(e, o.type);
|
|
175
|
+
this[r] = l ?? this._$Ej?.get(r) ?? l, this._$Em = null;
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
requestUpdate(t, e, s, r = !1, o) {
|
|
@@ -208,8 +208,8 @@ let I = class extends HTMLElement {
|
|
|
208
208
|
}
|
|
209
209
|
const s = this.constructor.elementProperties;
|
|
210
210
|
if (s.size > 0) for (const [r, o] of s) {
|
|
211
|
-
const { wrapped: i } = o,
|
|
212
|
-
i !== !0 || this._$AL.has(r) ||
|
|
211
|
+
const { wrapped: i } = o, l = this[r];
|
|
212
|
+
i !== !0 || this._$AL.has(r) || l === void 0 || this.C(r, void 0, o, l);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
let t = !1;
|
|
@@ -246,23 +246,23 @@ let I = class extends HTMLElement {
|
|
|
246
246
|
firstUpdated(t) {
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
I.elementStyles = [], I.shadowRootOptions = { mode: "open" }, I[
|
|
249
|
+
I.elementStyles = [], I.shadowRootOptions = { mode: "open" }, I[R("elementProperties")] = /* @__PURE__ */ new Map(), I[R("finalized")] = /* @__PURE__ */ new Map(), pe?.({ ReactiveElement: I }), (X.reactiveElementVersions ??= []).push("2.1.2");
|
|
250
250
|
const ct = globalThis, St = (a) => a, Y = ct.trustedTypes, At = Y ? Y.createPolicy("lit-html", { createHTML: (a) => a }) : void 0, Ot = "$lit$", k = `lit$${Math.random().toFixed(9).slice(2)}$`, Ht = "?" + k, me = `<${Ht}>`, T = document, F = () => T.createComment(""), N = (a) => a === null || typeof a != "object" && typeof a != "function", ht = Array.isArray, fe = (a) => ht(a) || typeof a?.[Symbol.iterator] == "function", rt = `[
|
|
251
|
-
\f\r]`,
|
|
252
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), Ct = /'/g, Et = /"/g, Mt = /^(?:script|style|textarea|title)$/i, Lt = (a) => (t, ...e) => ({ _$litType$: a, strings: t, values: e }),
|
|
251
|
+
\f\r]`, B = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Tt = /-->/g, It = />/g, S = RegExp(`>|${rt}(?:([^\\s"'>=/]+)(${rt}*=${rt}*(?:[^
|
|
252
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Ct = /'/g, Et = /"/g, Mt = /^(?:script|style|textarea|title)$/i, Lt = (a) => (t, ...e) => ({ _$litType$: a, strings: t, values: e }), n = Lt(1), Pt = Lt(2), P = /* @__PURE__ */ Symbol.for("lit-noChange"), m = /* @__PURE__ */ Symbol.for("lit-nothing"), Dt = /* @__PURE__ */ new WeakMap(), A = T.createTreeWalker(T, 129);
|
|
253
253
|
function jt(a, t) {
|
|
254
254
|
if (!ht(a) || !a.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
255
|
return At !== void 0 ? At.createHTML(t) : t;
|
|
256
256
|
}
|
|
257
257
|
const ue = (a, t) => {
|
|
258
258
|
const e = a.length - 1, s = [];
|
|
259
|
-
let r, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", i =
|
|
260
|
-
for (let
|
|
261
|
-
const d = a[
|
|
262
|
-
let
|
|
263
|
-
for (; f < d.length && (i.lastIndex = f, h = i.exec(d), h !== null); ) f = i.lastIndex, i ===
|
|
264
|
-
const u = i === S && a[
|
|
265
|
-
o += i ===
|
|
259
|
+
let r, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", i = B;
|
|
260
|
+
for (let l = 0; l < e; l++) {
|
|
261
|
+
const d = a[l];
|
|
262
|
+
let c, h, p = -1, f = 0;
|
|
263
|
+
for (; f < d.length && (i.lastIndex = f, h = i.exec(d), h !== null); ) f = i.lastIndex, i === B ? h[1] === "!--" ? i = Tt : h[1] !== void 0 ? i = It : h[2] !== void 0 ? (Mt.test(h[2]) && (r = RegExp("</" + h[2], "g")), i = S) : h[3] !== void 0 && (i = S) : i === S ? h[0] === ">" ? (i = r ?? B, p = -1) : h[1] === void 0 ? p = -2 : (p = i.lastIndex - h[2].length, c = h[1], i = h[3] === void 0 ? S : h[3] === '"' ? Et : Ct) : i === Et || i === Ct ? i = S : i === Tt || i === It ? i = B : (i = S, r = void 0);
|
|
264
|
+
const u = i === S && a[l + 1].startsWith("/>") ? " " : "";
|
|
265
|
+
o += i === B ? d + me : p >= 0 ? (s.push(c), d.slice(0, p) + Ot + d.slice(p) + k + u) : d + k + (p === -2 ? l : u);
|
|
266
266
|
}
|
|
267
267
|
return [jt(a, o + (a[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
268
268
|
};
|
|
@@ -271,12 +271,12 @@ class U {
|
|
|
271
271
|
let r;
|
|
272
272
|
this.parts = [];
|
|
273
273
|
let o = 0, i = 0;
|
|
274
|
-
const
|
|
275
|
-
if (this.el = U.createElement(
|
|
274
|
+
const l = t.length - 1, d = this.parts, [c, h] = ue(t, e);
|
|
275
|
+
if (this.el = U.createElement(c, s), A.currentNode = this.el.content, e === 2 || e === 3) {
|
|
276
276
|
const p = this.el.content.firstChild;
|
|
277
277
|
p.replaceWith(...p.childNodes);
|
|
278
278
|
}
|
|
279
|
-
for (; (r = A.nextNode()) !== null && d.length <
|
|
279
|
+
for (; (r = A.nextNode()) !== null && d.length < l; ) {
|
|
280
280
|
if (r.nodeType === 1) {
|
|
281
281
|
if (r.hasAttributes()) for (const p of r.getAttributeNames()) if (p.endsWith(Ot)) {
|
|
282
282
|
const f = h[i++], u = r.getAttribute(p).split(k), $ = /([.?@])?(.*)/.exec(f);
|
|
@@ -322,11 +322,11 @@ class ge {
|
|
|
322
322
|
u(t) {
|
|
323
323
|
const { el: { content: e }, parts: s } = this._$AD, r = (t?.creationScope ?? T).importNode(e, !0);
|
|
324
324
|
A.currentNode = r;
|
|
325
|
-
let o = A.nextNode(), i = 0,
|
|
325
|
+
let o = A.nextNode(), i = 0, l = 0, d = s[0];
|
|
326
326
|
for (; d !== void 0; ) {
|
|
327
327
|
if (i === d.index) {
|
|
328
|
-
let
|
|
329
|
-
d.type === 2 ?
|
|
328
|
+
let c;
|
|
329
|
+
d.type === 2 ? c = new M(o, o.nextSibling, this, t) : d.type === 1 ? c = new d.ctor(o, d.name, d.strings, this, t) : d.type === 6 && (c = new ye(o, this, t)), this._$AV.push(c), d = s[++l];
|
|
330
330
|
}
|
|
331
331
|
i !== d?.index && (o = A.nextNode(), i++);
|
|
332
332
|
}
|
|
@@ -411,9 +411,9 @@ class tt {
|
|
|
411
411
|
let i = !1;
|
|
412
412
|
if (o === void 0) t = D(this, t, e, 0), i = !N(t) || t !== this._$AH && t !== P, i && (this._$AH = t);
|
|
413
413
|
else {
|
|
414
|
-
const
|
|
415
|
-
let d,
|
|
416
|
-
for (t = o[0], d = 0; d < o.length - 1; d++)
|
|
414
|
+
const l = t;
|
|
415
|
+
let d, c;
|
|
416
|
+
for (t = o[0], d = 0; d < o.length - 1; d++) c = D(this, l[s + d], e, d), c === P && (c = this._$AH[d]), i ||= !N(c) || c !== this._$AH[d], c === m ? t = m : t !== m && (t += (c ?? "") + o[d + 1]), this._$AH[d] = c;
|
|
417
417
|
}
|
|
418
418
|
i && !r && this.j(t);
|
|
419
419
|
}
|
|
@@ -508,39 +508,39 @@ function Se(a = {}) {
|
|
|
508
508
|
}
|
|
509
509
|
function Ae({ baseUrl: a, token: t = "", fetchFn: e } = {}) {
|
|
510
510
|
if (!a) throw new Error("createClient requires a baseUrl");
|
|
511
|
-
const s = a.replace(/\/+$/, ""), r = e || ((...
|
|
512
|
-
async function o(
|
|
511
|
+
const s = a.replace(/\/+$/, ""), r = e || ((...l) => fetch(...l));
|
|
512
|
+
async function o(l) {
|
|
513
513
|
const d = { Accept: "application/json" };
|
|
514
514
|
t && (d.Authorization = `Bearer ${t}`);
|
|
515
|
-
const
|
|
516
|
-
if (!
|
|
517
|
-
const h = new Error(`api-hsot ${
|
|
518
|
-
throw h.status =
|
|
515
|
+
const c = await r(`${s}${l}`, { headers: d });
|
|
516
|
+
if (!c.ok) {
|
|
517
|
+
const h = new Error(`api-hsot ${c.status} on ${l}`);
|
|
518
|
+
throw h.status = c.status, h;
|
|
519
519
|
}
|
|
520
|
-
return
|
|
520
|
+
return c.json();
|
|
521
521
|
}
|
|
522
|
-
async function i(
|
|
523
|
-
const
|
|
522
|
+
async function i(l, d = {}) {
|
|
523
|
+
const c = [];
|
|
524
524
|
let h = null;
|
|
525
525
|
for (let p = 0; p < _e; p += 1) {
|
|
526
|
-
const f = Se(h ? { ...d, cursor: h } : d), u = await o(`${
|
|
527
|
-
if (
|
|
526
|
+
const f = Se(h ? { ...d, cursor: h } : d), u = await o(`${l}${f}`);
|
|
527
|
+
if (c.push(...u.items || []), h = u.nextCursor || null, !h) break;
|
|
528
528
|
}
|
|
529
|
-
return { items:
|
|
529
|
+
return { items: c, total: c.length, nextCursor: null };
|
|
530
530
|
}
|
|
531
531
|
return {
|
|
532
|
-
listSchools: (
|
|
533
|
-
getSchool: (
|
|
534
|
-
listTeams: (
|
|
535
|
-
getTeam: (
|
|
536
|
-
listConferences: (
|
|
537
|
-
listPlayers: (
|
|
538
|
-
listRosters: (
|
|
539
|
-
listGames: (
|
|
540
|
-
getGame: (
|
|
541
|
-
listTournaments: (
|
|
542
|
-
listSeedings: (
|
|
543
|
-
listRankings: (
|
|
532
|
+
listSchools: (l) => i("/schools", l),
|
|
533
|
+
getSchool: (l) => o(`/schools/${l}`),
|
|
534
|
+
listTeams: (l) => i("/teams", l),
|
|
535
|
+
getTeam: (l) => o(`/teams/${l}`),
|
|
536
|
+
listConferences: (l) => i("/conferences", l),
|
|
537
|
+
listPlayers: (l) => i("/players", l),
|
|
538
|
+
listRosters: (l) => i("/rosters", l),
|
|
539
|
+
listGames: (l) => i("/games", l),
|
|
540
|
+
getGame: (l) => o(`/games/${l}`),
|
|
541
|
+
listTournaments: (l) => i("/tournaments", l),
|
|
542
|
+
listSeedings: (l, d) => i(`/tournaments/${l}/seedings`, d),
|
|
543
|
+
listRankings: (l) => i("/rankings", l),
|
|
544
544
|
listSports: () => o("/sports")
|
|
545
545
|
};
|
|
546
546
|
}
|
|
@@ -616,7 +616,10 @@ function Pe(a, t) {
|
|
|
616
616
|
return e(a).localeCompare(e(t), "en", { numeric: !0, sensitivity: "base" });
|
|
617
617
|
}
|
|
618
618
|
function Wt(a) {
|
|
619
|
-
if (a.state === "live")
|
|
619
|
+
if (a.state === "live") {
|
|
620
|
+
const t = [a.period, a.clock].filter(Boolean).join(" ");
|
|
621
|
+
return { kind: "live", label: t ? `Live · ${t}` : "Live" };
|
|
622
|
+
}
|
|
620
623
|
if (a.state === "final") {
|
|
621
624
|
const t = [];
|
|
622
625
|
return a.finish === "overtime" && t.push("OT"), a.finish === "shootout" && t.push("PK-SO"), a.forfeit && a.forfeit !== "none" && t.push("Forfeit"), { kind: "final", label: `Final${t.length ? ` · ${t.join(" · ")}` : ""}` };
|
|
@@ -632,7 +635,7 @@ function _(a) {
|
|
|
632
635
|
let r = t.split("?")[0] + s;
|
|
633
636
|
return r = r.replace(/([^:])\/{2,}/g, "$1/").replace(/^\/{2,}/, "/"), r = r.replace(/^\/(?=#)/, ""), r.length > 1 && (r = r.replace(/\/+$/, "")), r.toLowerCase();
|
|
634
637
|
}
|
|
635
|
-
function
|
|
638
|
+
function Gt() {
|
|
636
639
|
const a = globalThis.location;
|
|
637
640
|
if (!a) return "";
|
|
638
641
|
const t = (a.hash || "").startsWith("#/") ? a.hash : "";
|
|
@@ -647,10 +650,10 @@ function ze(a, t, e) {
|
|
|
647
650
|
const i = _(g(t.section, { sport: e, view: "" }));
|
|
648
651
|
if (s === i) return "";
|
|
649
652
|
if (!s.startsWith(`${i}/`)) return null;
|
|
650
|
-
const
|
|
651
|
-
return d.length > 2 || d.some((
|
|
653
|
+
const l = s.slice(i.length + 1), d = l.split("/");
|
|
654
|
+
return d.length > 2 || d.some((c) => !/^[a-z][a-z-]*$/.test(c)) || De.has(d[0]) ? null : l;
|
|
652
655
|
}
|
|
653
|
-
function
|
|
656
|
+
function Be(a, t, e) {
|
|
654
657
|
const s = (i) => g(e.section, { sport: a, view: i }).replace(/([^:])\/{2,}/g, "$1/"), o = new Set((t || []).map((i) => i && i.gender).filter((i) => i === "boys" || i === "girls")).size === 2 ? [
|
|
655
658
|
{ label: "Boys Standings", href: s("boys/standings") },
|
|
656
659
|
{ label: "Girls Standings", href: s("girls/standings") }
|
|
@@ -663,7 +666,7 @@ function Re(a, t, e) {
|
|
|
663
666
|
{ label: "Polls & Rankings", href: s("rankings") }
|
|
664
667
|
];
|
|
665
668
|
}
|
|
666
|
-
function
|
|
669
|
+
function Re(a, t = Gt()) {
|
|
667
670
|
const e = _(t);
|
|
668
671
|
for (const s of a.querySelectorAll(':scope > a[slot="nav"]'))
|
|
669
672
|
e && _(s.getAttribute("href")) === e ? s.setAttribute("aria-current", "page") : s.removeAttribute("aria-current");
|
|
@@ -699,7 +702,7 @@ class w extends E {
|
|
|
699
702
|
this.load();
|
|
700
703
|
}
|
|
701
704
|
updated(t) {
|
|
702
|
-
t.has("api") && t.get("api") !== void 0 && t.get("api") !== this.api && this.load(), t.has("refreshInterval") && this._setupInterval(),
|
|
705
|
+
t.has("api") && t.get("api") !== void 0 && t.get("api") !== this.api && this.load(), t.has("refreshInterval") && this._setupInterval(), Re(this);
|
|
703
706
|
}
|
|
704
707
|
async load() {
|
|
705
708
|
const t = this.client;
|
|
@@ -728,10 +731,10 @@ class w extends E {
|
|
|
728
731
|
this._refreshId && (clearInterval(this._refreshId), this._refreshId = null);
|
|
729
732
|
}
|
|
730
733
|
render() {
|
|
731
|
-
return this.error === "not-configured" ?
|
|
734
|
+
return this.error === "not-configured" ? n`<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 ? n`<div class="error">Unable to load right now. <button class="chip" @click=${() => this.load()}>Retry</button></div>` : this.data ? this.renderView() : n`<div class="loading" role="status">Loading…</div>`;
|
|
732
735
|
}
|
|
733
736
|
renderView() {
|
|
734
|
-
return
|
|
737
|
+
return n``;
|
|
735
738
|
}
|
|
736
739
|
}
|
|
737
740
|
const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Fe = b`
|
|
@@ -1002,14 +1005,14 @@ function je(a) {
|
|
|
1002
1005
|
function W(a, t) {
|
|
1003
1006
|
const e = {}, s = (o) => (e[o] = e[o] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, e[o]), r = a.filter((o) => o.state === "final" && o.gameType !== "scrimmage" && !0).sort((o, i) => String(o.date).localeCompare(String(i.date)));
|
|
1004
1007
|
for (const o of r) {
|
|
1005
|
-
const i = ut(o),
|
|
1008
|
+
const i = ut(o), l = o.gameType === "conference";
|
|
1006
1009
|
for (const d of ["home", "away"]) {
|
|
1007
|
-
const
|
|
1008
|
-
if (!
|
|
1009
|
-
const h = s(
|
|
1010
|
+
const c = d === "home" ? o.homeTeamId : o.awayTeamId;
|
|
1011
|
+
if (!c) continue;
|
|
1012
|
+
const h = s(c), p = d === "home" ? o.homeScore : o.awayScore, f = d === "home" ? o.awayScore : o.homeScore;
|
|
1010
1013
|
h.pf += p, h.pa += f;
|
|
1011
1014
|
let u = "T";
|
|
1012
|
-
i === "tie" ? (h.t += 1,
|
|
1015
|
+
i === "tie" ? (h.t += 1, l && (h.ct += 1)) : i === d ? (h.w += 1, l && (h.cw += 1), u = "W") : (h.l += 1, l && (h.cl += 1), u = "L"), h.results.push({ gameId: o.id, date: o.date, mark: u, my: p, their: f, opp: d === "home" ? o.awayTeamId : o.homeTeamId, conf: l });
|
|
1013
1016
|
}
|
|
1014
1017
|
}
|
|
1015
1018
|
return e;
|
|
@@ -1021,19 +1024,19 @@ function st(a) {
|
|
|
1021
1024
|
for (let s = a.length - 1; s >= 0 && a[s].mark === t; s -= 1) e += 1;
|
|
1022
1025
|
return t + e;
|
|
1023
1026
|
}
|
|
1024
|
-
const
|
|
1027
|
+
const Bt = (a, t, e) => {
|
|
1025
1028
|
const s = a + t + e;
|
|
1026
1029
|
return s ? (a + e / 2) / s : 0;
|
|
1027
|
-
},
|
|
1030
|
+
}, Rt = (a) => a.toFixed(3).replace("0.", ".");
|
|
1028
1031
|
function x(a, t = !1) {
|
|
1029
1032
|
if (!a) return "0-0";
|
|
1030
1033
|
const e = t ? a.cw : a.w, s = t ? a.cl : a.l, r = t ? a.ct : a.t;
|
|
1031
1034
|
return `${e}-${s}${r ? `-${r}` : ""}`;
|
|
1032
1035
|
}
|
|
1033
|
-
function
|
|
1036
|
+
function qt(a, t) {
|
|
1034
1037
|
return a.map((e) => {
|
|
1035
1038
|
const s = t[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] };
|
|
1036
|
-
return { team: e, rec: s, confPct:
|
|
1039
|
+
return { team: e, rec: s, confPct: Bt(s.cw, s.cl, s.ct), overallPct: Bt(s.w, s.l, s.t) };
|
|
1037
1040
|
}).sort((e, s) => s.confPct - e.confPct || s.overallPct - e.overallPct || s.rec.pf - s.rec.pa - (e.rec.pf - e.rec.pa));
|
|
1038
1041
|
}
|
|
1039
1042
|
function gt(a, t) {
|
|
@@ -1049,15 +1052,15 @@ function vt(a, t, e, s, r) {
|
|
|
1049
1052
|
const i = /* @__PURE__ */ new Map();
|
|
1050
1053
|
for (const d of a || []) {
|
|
1051
1054
|
if (d.sport !== s || r && d.effectiveDate > r || d.gender && o.gender !== d.gender && o.gender !== "coed") continue;
|
|
1052
|
-
const
|
|
1053
|
-
(!h || d.effectiveDate > h.effectiveDate) && i.set(
|
|
1055
|
+
const c = d.gender || "", h = i.get(c);
|
|
1056
|
+
(!h || d.effectiveDate > h.effectiveDate) && i.set(c, d);
|
|
1054
1057
|
}
|
|
1055
|
-
let
|
|
1058
|
+
let l = null;
|
|
1056
1059
|
for (const d of i.values()) {
|
|
1057
|
-
const
|
|
1058
|
-
|
|
1060
|
+
const c = (d.teamIds || []).indexOf(e);
|
|
1061
|
+
c !== -1 && (!l || d.effectiveDate > l.effectiveDate) && (l = { poll: d, rank: c + 1 });
|
|
1059
1062
|
}
|
|
1060
|
-
return
|
|
1063
|
+
return l ? l.rank : null;
|
|
1061
1064
|
}
|
|
1062
1065
|
function We(a, t, e) {
|
|
1063
1066
|
if (!a) return { kind: "none", delta: 0 };
|
|
@@ -1069,11 +1072,11 @@ function We(a, t, e) {
|
|
|
1069
1072
|
const o = r - s;
|
|
1070
1073
|
return o > 0 ? { kind: "up", delta: o } : o < 0 ? { kind: "down", delta: -o } : { kind: "same", delta: 0 };
|
|
1071
1074
|
}
|
|
1072
|
-
function
|
|
1075
|
+
function Ge(a) {
|
|
1073
1076
|
return /^https?:\/\//i.test(String(a || ""));
|
|
1074
1077
|
}
|
|
1075
1078
|
function Vt(a, { w: t, h: e } = {}) {
|
|
1076
|
-
if (!
|
|
1079
|
+
if (!Ge(a)) return "";
|
|
1077
1080
|
const s = [];
|
|
1078
1081
|
t && s.push(`w=${Math.max(1, Math.round(t))}`), e && s.push(`h=${Math.max(1, Math.round(e))}`), s.push("f=webp");
|
|
1079
1082
|
const r = a.includes("?") ? "&" : "?";
|
|
@@ -1083,22 +1086,22 @@ function Q(a, t) {
|
|
|
1083
1086
|
const e = t * 2;
|
|
1084
1087
|
return Vt(a?.logoAssetId, { w: e, h: e });
|
|
1085
1088
|
}
|
|
1086
|
-
function
|
|
1089
|
+
function qe(a, t) {
|
|
1087
1090
|
return Vt(a?.photoAssetId, { w: t * 2 });
|
|
1088
1091
|
}
|
|
1089
1092
|
function $t(a, t, { title: e, sub: s, teams: r }) {
|
|
1090
|
-
const o =
|
|
1091
|
-
return
|
|
1093
|
+
const o = Gt(), l = !!a.querySelector(':scope > a[slot="nav"]') || ze(o, t.hrefs, t.sport) !== null;
|
|
1094
|
+
return n`
|
|
1092
1095
|
<div class="band section">
|
|
1093
1096
|
<div class="inner">
|
|
1094
1097
|
<h1>${e}</h1>
|
|
1095
|
-
${s ?
|
|
1098
|
+
${s ? n`<p class="sub">${s}</p>` : m}
|
|
1096
1099
|
</div>
|
|
1097
|
-
${
|
|
1100
|
+
${l ? n`
|
|
1098
1101
|
<nav class="sectionnav" aria-label="${z(t.sport)} section">
|
|
1099
1102
|
<div class="navrow">
|
|
1100
1103
|
<slot name="nav">
|
|
1101
|
-
${
|
|
1104
|
+
${Be(t.sport, r, t.hrefs).map((d) => n`<a href=${d.href}
|
|
1102
1105
|
aria-current=${o && _(d.href) === o ? "page" : m}>${d.label}</a>`)}
|
|
1103
1106
|
</slot>
|
|
1104
1107
|
</div>
|
|
@@ -1114,50 +1117,50 @@ function H(a, t = 26) {
|
|
|
1114
1117
|
if (!a) return m;
|
|
1115
1118
|
const e = Q(a, t);
|
|
1116
1119
|
if (e)
|
|
1117
|
-
return
|
|
1120
|
+
return n`<img class="swatch logo" aria-hidden="true" alt="" loading="lazy"
|
|
1118
1121
|
src=${e} style="width:${t}px;height:${t}px" />`;
|
|
1119
1122
|
const s = a.colorPrimary || "#030711", r = K(s);
|
|
1120
|
-
return
|
|
1123
|
+
return n`<span class="swatch" aria-hidden="true"
|
|
1121
1124
|
style="width:${t}px;height:${t}px;background:${s};color:${r};font-size:${Math.max(8, t * 0.28)}px"
|
|
1122
1125
|
>${ft(a)}</span>`;
|
|
1123
1126
|
}
|
|
1124
1127
|
function bt(a, t, e) {
|
|
1125
1128
|
const s = vt(a.rankings, a.teamsById, t, a.sport, e);
|
|
1126
|
-
return s ?
|
|
1129
|
+
return s ? n`<span class="rankbadge">#${s}</span>` : m;
|
|
1127
1130
|
}
|
|
1128
1131
|
function Yt(a, t, e) {
|
|
1129
1132
|
const s = O(a, t);
|
|
1130
|
-
return s ?
|
|
1133
|
+
return s ? n`${bt(a, t, e)}<a href=${g(a.hrefs.school, { id: s.id })}>${s.name}</a>` : n`<span class="mut">TBD</span>`;
|
|
1131
1134
|
}
|
|
1132
1135
|
function yt(a, t, e = 5) {
|
|
1133
1136
|
const s = a.records[t];
|
|
1134
|
-
if (!s || !s.results.length) return
|
|
1137
|
+
if (!s || !s.results.length) return n`<span class="mut">·</span>`;
|
|
1135
1138
|
const r = s.results.slice(-1 * e);
|
|
1136
|
-
return
|
|
1137
|
-
${r.map((o) =>
|
|
1139
|
+
return n`<span class="dots" role="img" aria-label="last ${r.length} results">
|
|
1140
|
+
${r.map((o) => n`<a class="dot ${o.mark}"
|
|
1138
1141
|
title="${o.mark} ${o.my}-${o.their} vs ${C(a, o.opp)}"
|
|
1139
1142
|
href=${g(a.hrefs.game, { sport: a.sport, id: o.gameId })}>${o.mark}</a>`)}
|
|
1140
1143
|
</span>`;
|
|
1141
1144
|
}
|
|
1142
|
-
function
|
|
1143
|
-
return a.querySelector(':scope > [slot="rail"]') ?
|
|
1145
|
+
function G(a, t) {
|
|
1146
|
+
return a.querySelector(':scope > [slot="rail"]') ? n`<div class="view withrail">
|
|
1144
1147
|
<div class="viewmain">${t}</div>
|
|
1145
1148
|
<aside class="viewrail"><slot name="rail"></slot></aside>
|
|
1146
|
-
</div>` :
|
|
1149
|
+
</div>` : n`<div class="view">${t}</div>`;
|
|
1147
1150
|
}
|
|
1148
|
-
function
|
|
1151
|
+
function q(a) {
|
|
1149
1152
|
if (!a.promoImage) return m;
|
|
1150
|
-
const t =
|
|
1151
|
-
return
|
|
1153
|
+
const t = n`<img src=${a.promoImage} alt=${a.promoAlt || "Sponsor"}>`;
|
|
1154
|
+
return n`<div class="promo">${a.promoHref ? n`<a href=${a.promoHref} target="_blank" rel="sponsored noopener">${t}</a>` : t}</div>`;
|
|
1152
1155
|
}
|
|
1153
1156
|
function J(a) {
|
|
1154
1157
|
const t = Wt(a);
|
|
1155
|
-
return
|
|
1158
|
+
return n`<span class="pill ${t.kind}">${t.label}</span>`;
|
|
1156
1159
|
}
|
|
1157
1160
|
function Kt(a, t, e) {
|
|
1158
|
-
if (!t) return
|
|
1161
|
+
if (!t) return n`<span class="mut">·</span>`;
|
|
1159
1162
|
const s = t.homeTeamId === e ? t.awayTeamId : t.homeTeamId, r = t.homeTeamId === e ? "vs" : "at";
|
|
1160
|
-
return
|
|
1163
|
+
return n`${t.state === "live" ? n`<span class="pill live">Live</span> ` : n`${y(t.date, { month: "numeric", day: "numeric" })} `}${r} ${Z(a, s)}`;
|
|
1161
1164
|
}
|
|
1162
1165
|
class Qt extends w {
|
|
1163
1166
|
static styles = j;
|
|
@@ -1178,7 +1181,7 @@ class Qt extends w {
|
|
|
1178
1181
|
this._datePinned = !!this.date;
|
|
1179
1182
|
}
|
|
1180
1183
|
async fetchData(t) {
|
|
1181
|
-
const e = this.season || et(), [s, r, o, i,
|
|
1184
|
+
const e = this.season || et(), [s, r, o, i, l] = await Promise.all([
|
|
1182
1185
|
t.listSchools(),
|
|
1183
1186
|
t.listTeams({ sport: this.sport }),
|
|
1184
1187
|
t.listConferences(),
|
|
@@ -1191,7 +1194,7 @@ class Qt extends w {
|
|
|
1191
1194
|
teams: r.items,
|
|
1192
1195
|
conferences: o.items,
|
|
1193
1196
|
games: i.items,
|
|
1194
|
-
rankings:
|
|
1197
|
+
rankings: l.items
|
|
1195
1198
|
};
|
|
1196
1199
|
}
|
|
1197
1200
|
get ctx() {
|
|
@@ -1205,30 +1208,30 @@ class Qt extends w {
|
|
|
1205
1208
|
}, this._ctxData = this.data), this._ctx;
|
|
1206
1209
|
}
|
|
1207
1210
|
renderView() {
|
|
1208
|
-
const t = this.ctx, e = v(this.data.conferences), s = [...new Set(this.data.games.map((
|
|
1209
|
-
const h = [
|
|
1211
|
+
const t = this.ctx, e = v(this.data.conferences), s = [...new Set(this.data.games.map((c) => c.date).filter(Boolean))].sort(), r = Number.MAX_SAFE_INTEGER, o = (c) => {
|
|
1212
|
+
const h = [c.awayTeamId, c.homeTeamId].map((p) => vt(t.rankings, t.teamsById, p, this.sport, c.date)).filter(Boolean);
|
|
1210
1213
|
return h.length ? Math.min(...h) : r;
|
|
1211
|
-
}, i = this.data.games.filter((
|
|
1212
|
-
i.sort((
|
|
1214
|
+
}, i = this.data.games.filter((c) => c.date === this.date), l = new Map(i.map((c) => [c, o(c)]));
|
|
1215
|
+
i.sort((c, h) => (c.state === "live" ? 0 : 1) - (h.state === "live" ? 0 : 1) || l.get(c) - l.get(h));
|
|
1213
1216
|
const d = /* @__PURE__ */ new Map();
|
|
1214
|
-
return i.forEach((
|
|
1215
|
-
const h =
|
|
1216
|
-
d.has(h) || d.set(h, []), d.get(h).push(
|
|
1217
|
-
}),
|
|
1217
|
+
return i.forEach((c) => {
|
|
1218
|
+
const h = c.gameType === "conference" && c.conferenceId ? e[c.conferenceId]?.name || "Conference" : c.gameType === "playoff" ? "Playoffs" : c.gameType === "scrimmage" ? "Scrimmages" : "Nonconference";
|
|
1219
|
+
d.has(h) || d.set(h, []), d.get(h).push(c);
|
|
1220
|
+
}), n`
|
|
1218
1221
|
${$t(this, t, {
|
|
1219
|
-
title:
|
|
1220
|
-
sub:
|
|
1222
|
+
title: n`${z(this.sport)} scores & schedules`,
|
|
1223
|
+
sub: n`${y(this.date, { weekday: "long", month: "long", day: "numeric", year: "numeric" })} · ${i.length} games`,
|
|
1221
1224
|
teams: this.data.teams
|
|
1222
1225
|
})}
|
|
1223
|
-
${
|
|
1224
|
-
${
|
|
1226
|
+
${G(this, n`
|
|
1227
|
+
${q(this)}
|
|
1225
1228
|
<div class="toolbar">
|
|
1226
1229
|
<label class="asof" for="datesel">Date</label>
|
|
1227
|
-
<select id="datesel" @change=${(
|
|
1228
|
-
this.date =
|
|
1230
|
+
<select id="datesel" @change=${(c) => {
|
|
1231
|
+
this.date = c.target.value;
|
|
1229
1232
|
}}>
|
|
1230
|
-
${(s.includes(this.date) ? s : [...s, this.date].sort()).map((
|
|
1231
|
-
${y(
|
|
1233
|
+
${(s.includes(this.date) ? s : [...s, this.date].sort()).map((c) => n`<option value=${c} ?selected=${c === this.date}>
|
|
1234
|
+
${y(c, { weekday: "short", month: "short", day: "numeric" })}${c === mt() ? " · today" : ""}
|
|
1232
1235
|
</option>`)}
|
|
1233
1236
|
</select>
|
|
1234
1237
|
<button class="chip" ?disabled=${s.indexOf(this.date) <= 0}
|
|
@@ -1242,9 +1245,9 @@ class Qt extends w {
|
|
|
1242
1245
|
<span class="spacer"></span>
|
|
1243
1246
|
<span class="asof">Live games first · report a score to see it update here</span>
|
|
1244
1247
|
</div>
|
|
1245
|
-
${i.length ? m :
|
|
1246
|
-
${[...d.entries()].map(([
|
|
1247
|
-
<div class="section-title">${
|
|
1248
|
+
${i.length ? m : n`<p class="empty">No ${this.sport} games on this date.</p>`}
|
|
1249
|
+
${[...d.entries()].map(([c, h]) => n`
|
|
1250
|
+
<div class="section-title">${c}</div>
|
|
1248
1251
|
<div class="card"><ul class="gamelist">
|
|
1249
1252
|
${h.map((p) => this.renderGame(t, p))}
|
|
1250
1253
|
</ul></div>
|
|
@@ -1256,14 +1259,14 @@ class Qt extends w {
|
|
|
1256
1259
|
// a lone score column on the far right read as detached from the teams).
|
|
1257
1260
|
// Scheduled games carry their start time on the status pill alone.
|
|
1258
1261
|
renderGame(t, e) {
|
|
1259
|
-
const s = e.state === "final" || e.state === "live", r = (i,
|
|
1260
|
-
return
|
|
1262
|
+
const s = e.state === "final" || e.state === "live", r = (i, l, d = m) => n`<span class="side">${Yt(t, i, e.date)}${s ? n`<span class="score">${l}</span>` : m}${d}</span>`, o = je(e);
|
|
1263
|
+
return n`
|
|
1261
1264
|
<li>
|
|
1262
1265
|
${J(e)}
|
|
1263
|
-
<span class="opp matchup">${r(e.awayTeamId, e.awayScore,
|
|
1264
|
-
${o ?
|
|
1266
|
+
<span class="opp matchup">${r(e.awayTeamId, e.awayScore, n`<span class="at">at</span>`)}${r(e.homeTeamId, e.homeScore)}</span>
|
|
1267
|
+
${o ? n`<span class="ff">${C(t, o === "home" ? e.homeTeamId : e.awayTeamId)} forfeited</span>` : m}
|
|
1265
1268
|
<span class="where">${e.venue || ""}</span>
|
|
1266
|
-
${e.broadcast ?
|
|
1269
|
+
${e.broadcast ? n`<span class="pill class">${e.broadcast}</span>` : m}
|
|
1267
1270
|
<a class="box" href=${g(t.hrefs.game, { sport: this.sport, id: e.id })}>Box score →</a>
|
|
1268
1271
|
</li>
|
|
1269
1272
|
`;
|
|
@@ -1283,7 +1286,7 @@ class Zt extends w {
|
|
|
1283
1286
|
super(), this.sport = "football", this.season = "", this.classFilter = "All", this.query = "";
|
|
1284
1287
|
}
|
|
1285
1288
|
async fetchData(t) {
|
|
1286
|
-
const e = this.season || et(), [s, r, o, i,
|
|
1289
|
+
const e = this.season || et(), [s, r, o, i, l] = await Promise.all([
|
|
1287
1290
|
t.listConferences({ active: !0 }),
|
|
1288
1291
|
t.listSchools(),
|
|
1289
1292
|
t.listTeams({ sport: this.sport }),
|
|
@@ -1296,7 +1299,7 @@ class Zt extends w {
|
|
|
1296
1299
|
schools: r.items,
|
|
1297
1300
|
teams: o.items,
|
|
1298
1301
|
games: i.items,
|
|
1299
|
-
rankings:
|
|
1302
|
+
rankings: l.items
|
|
1300
1303
|
};
|
|
1301
1304
|
}
|
|
1302
1305
|
get ctx() {
|
|
@@ -1311,17 +1314,17 @@ class Zt extends w {
|
|
|
1311
1314
|
}
|
|
1312
1315
|
renderView() {
|
|
1313
1316
|
const t = this.ctx, e = ["All", ...[...new Set(this.data.conferences.flatMap((r) => r.classifications || []))].sort(zt)].slice(0, 9), s = this.data.conferences.filter((r) => r.active !== !1).filter((r) => this.classFilter === "All" || (r.classifications || []).includes(this.classFilter)).sort(Pe);
|
|
1314
|
-
return
|
|
1317
|
+
return n`
|
|
1315
1318
|
${$t(this, t, {
|
|
1316
|
-
title:
|
|
1317
|
-
sub:
|
|
1319
|
+
title: n`${z(this.sport)} standings`,
|
|
1320
|
+
sub: n`${this.data.season} season · every conference, computed live from reported results`,
|
|
1318
1321
|
teams: this.data.teams
|
|
1319
1322
|
})}
|
|
1320
|
-
${
|
|
1321
|
-
${
|
|
1323
|
+
${G(this, n`
|
|
1324
|
+
${q(this)}
|
|
1322
1325
|
<div class="toolbar">
|
|
1323
1326
|
<div role="group" aria-label="Classification filter">
|
|
1324
|
-
${e.map((r) =>
|
|
1327
|
+
${e.map((r) => n`<button class="chip ${this.classFilter === r ? "on" : ""}"
|
|
1325
1328
|
@click=${() => {
|
|
1326
1329
|
this.classFilter = r;
|
|
1327
1330
|
}}>${r}</button>`)}
|
|
@@ -1340,12 +1343,12 @@ class Zt extends w {
|
|
|
1340
1343
|
renderConference(t, e) {
|
|
1341
1344
|
const s = this.data.teams.filter((i) => i.conferenceId === e.id);
|
|
1342
1345
|
if (!s.length) return m;
|
|
1343
|
-
const r = this.query.trim().toLowerCase(), o =
|
|
1344
|
-
return
|
|
1346
|
+
const r = this.query.trim().toLowerCase(), o = qt(s, t.records);
|
|
1347
|
+
return n`
|
|
1345
1348
|
<div class="card">
|
|
1346
1349
|
<div class="card-head">
|
|
1347
1350
|
<h2>${e.name}</h2>
|
|
1348
|
-
${[...e.classifications || []].sort(zt).map((i) =>
|
|
1351
|
+
${[...e.classifications || []].sort(zt).map((i) => n`<span class="pill class">${i}</span>`)}
|
|
1349
1352
|
<span class="meta">${o.length} teams · membership derives from teams</span>
|
|
1350
1353
|
</div>
|
|
1351
1354
|
<div class="tablewrap"><table class="data">
|
|
@@ -1355,7 +1358,7 @@ class Zt extends w {
|
|
|
1355
1358
|
<th>Streak</th><th>Last 5</th><th>Next</th>
|
|
1356
1359
|
</tr></thead>
|
|
1357
1360
|
<tbody>
|
|
1358
|
-
${o.map((i,
|
|
1361
|
+
${o.map((i, l) => this.renderRow(t, i, l, r))}
|
|
1359
1362
|
</tbody>
|
|
1360
1363
|
</table></div>
|
|
1361
1364
|
</div>
|
|
@@ -1364,12 +1367,12 @@ class Zt extends w {
|
|
|
1364
1367
|
renderRow(t, e, s, r) {
|
|
1365
1368
|
const o = t.schoolsById[e.team.schoolId], i = o?.name || e.team.name || "TBD";
|
|
1366
1369
|
if (r && !i.toLowerCase().includes(r)) return m;
|
|
1367
|
-
const
|
|
1370
|
+
const l = e.rec.pf - e.rec.pa, d = gt(this.data.games, e.team.id), c = () => {
|
|
1368
1371
|
location.href = g(t.hrefs.school, { id: e.team.schoolId });
|
|
1369
1372
|
};
|
|
1370
|
-
return
|
|
1373
|
+
return n`
|
|
1371
1374
|
<tr class="rowlink" @click=${(h) => {
|
|
1372
|
-
h.target.closest("a") ||
|
|
1375
|
+
h.target.closest("a") || c();
|
|
1373
1376
|
}}>
|
|
1374
1377
|
<td class="mut">${s + 1}</td>
|
|
1375
1378
|
<td class="teamcell">
|
|
@@ -1377,12 +1380,12 @@ class Zt extends w {
|
|
|
1377
1380
|
<a href=${g(t.hrefs.school, { id: e.team.schoolId })}>${i}</a>
|
|
1378
1381
|
</td>
|
|
1379
1382
|
<td class="num">${x(e.rec, !0)}</td>
|
|
1380
|
-
<td class="num">${
|
|
1383
|
+
<td class="num">${Rt(e.confPct)}</td>
|
|
1381
1384
|
<td class="num">${x(e.rec)}</td>
|
|
1382
|
-
<td class="num">${
|
|
1385
|
+
<td class="num">${Rt(e.overallPct)}</td>
|
|
1383
1386
|
<td class="num">${e.rec.pf}</td>
|
|
1384
1387
|
<td class="num">${e.rec.pa}</td>
|
|
1385
|
-
<td class="num" style="color:${
|
|
1388
|
+
<td class="num" style="color:${l >= 0 ? "var(--hsot-win)" : "var(--hsot-loss)"}">${l > 0 ? "+" : ""}${l}</td>
|
|
1386
1389
|
<td>${st(e.rec.results) || "·"}</td>
|
|
1387
1390
|
<td>${yt(t, e.team.id)}</td>
|
|
1388
1391
|
<td>${Kt(t, d, e.team.id)}</td>
|
|
@@ -1426,20 +1429,20 @@ class Jt extends w {
|
|
|
1426
1429
|
t && (this.pollDate = t);
|
|
1427
1430
|
}
|
|
1428
1431
|
async fetchData(t) {
|
|
1429
|
-
const e = this.season || et(), [s, r, o, i,
|
|
1432
|
+
const e = this.season || et(), [s, r, o, i, l] = await Promise.all([
|
|
1430
1433
|
t.listRankings({ sport: this.sport, ...this.gender ? { gender: this.gender } : {} }),
|
|
1431
1434
|
t.listSchools(),
|
|
1432
1435
|
t.listTeams({ sport: this.sport }),
|
|
1433
1436
|
t.listConferences(),
|
|
1434
1437
|
t.listGames({ sport: this.sport, season: e })
|
|
1435
|
-
]), d = s.items.filter((
|
|
1438
|
+
]), d = s.items.filter((c) => !this.gender || !c.gender || c.gender === this.gender).sort((c, h) => h.effectiveDate.localeCompare(c.effectiveDate));
|
|
1436
1439
|
return {
|
|
1437
1440
|
season: e,
|
|
1438
1441
|
polls: d,
|
|
1439
1442
|
schools: r.items,
|
|
1440
1443
|
teams: o.items,
|
|
1441
1444
|
conferences: i.items,
|
|
1442
|
-
games:
|
|
1445
|
+
games: l.items
|
|
1443
1446
|
};
|
|
1444
1447
|
}
|
|
1445
1448
|
get ctx() {
|
|
@@ -1453,18 +1456,18 @@ class Jt extends w {
|
|
|
1453
1456
|
}, this._ctxData = this.data), this._ctx;
|
|
1454
1457
|
}
|
|
1455
1458
|
sparkline(t, e, s) {
|
|
1456
|
-
const
|
|
1459
|
+
const l = e.map((p, f) => {
|
|
1457
1460
|
const u = (p.teamIds || []).indexOf(t);
|
|
1458
1461
|
if (u === -1) return null;
|
|
1459
1462
|
const $ = e.length === 1 ? 96 / 2 : f / (e.length - 1) * 90 + 3, at = 3 + u / 24 * 20;
|
|
1460
1463
|
return { x: $, y: at };
|
|
1461
1464
|
}), d = [];
|
|
1462
|
-
let
|
|
1463
|
-
if (
|
|
1464
|
-
p ?
|
|
1465
|
-
}),
|
|
1466
|
-
const h =
|
|
1467
|
-
return
|
|
1465
|
+
let c = [];
|
|
1466
|
+
if (l.forEach((p) => {
|
|
1467
|
+
p ? c.push(p) : c.length && (d.push(c), c = []);
|
|
1468
|
+
}), c.length && d.push(c), !d.length) return m;
|
|
1469
|
+
const h = l[s];
|
|
1470
|
+
return n`<svg class="sparkline" width=${96} height=${26} viewBox="0 0 ${96} ${26}" role="img" aria-label="rank history">
|
|
1468
1471
|
${d.map((p) => Pt`<polyline fill="none" stroke="var(--hsot-red)" stroke-width="2"
|
|
1469
1472
|
points=${p.map((f) => `${f.x.toFixed(1)},${f.y.toFixed(1)}`).join(" ")}></polyline>`)}
|
|
1470
1473
|
${h ? Pt`<circle cx=${h.x.toFixed(1)} cy=${h.y.toFixed(1)} r="3" fill="var(--hsot-black)"></circle>` : m}
|
|
@@ -1472,26 +1475,26 @@ class Jt extends w {
|
|
|
1472
1475
|
}
|
|
1473
1476
|
movement(t, e, s) {
|
|
1474
1477
|
const r = We(t, e, s);
|
|
1475
|
-
return r.kind === "up" ?
|
|
1478
|
+
return r.kind === "up" ? n`<span class="delta up">▲ ${r.delta}</span>` : r.kind === "down" ? n`<span class="delta down">▼ ${r.delta}</span>` : r.kind === "new" ? n`<span class="delta new">NEW</span>` : r.kind === "same" ? n`<span class="delta same">—</span>` : n`<span class="delta same">·</span>`;
|
|
1476
1479
|
}
|
|
1477
1480
|
renderView() {
|
|
1478
1481
|
const t = this.ctx, e = this.data.polls;
|
|
1479
|
-
if (!e.length) return
|
|
1480
|
-
const s = Math.max(0, e.findIndex((p) => p.effectiveDate === this.pollDate)), r = e[s] || e[0], o = e[s + 1] || null, i = e.slice().reverse(),
|
|
1481
|
-
return
|
|
1482
|
+
if (!e.length) return n`<div class="view"><p class="empty">No ${this.sport} polls published yet this season.</p></div>`;
|
|
1483
|
+
const s = Math.max(0, e.findIndex((p) => p.effectiveDate === this.pollDate)), r = e[s] || e[0], o = e[s + 1] || null, i = e.slice().reverse(), l = i.indexOf(r), d = v(this.data.conferences), c = (r.teamIds || [])[0], h = c ? O(t, c) : null;
|
|
1484
|
+
return n`
|
|
1482
1485
|
${$t(this, t, {
|
|
1483
|
-
title:
|
|
1484
|
-
sub:
|
|
1486
|
+
title: n`${z(this.sport)} Top 25`,
|
|
1487
|
+
sub: n`The HighSchoolOT poll · updated weekly · ${e.length} polls this season`,
|
|
1485
1488
|
teams: this.data.teams
|
|
1486
1489
|
})}
|
|
1487
|
-
${
|
|
1488
|
-
${
|
|
1490
|
+
${G(this, n`
|
|
1491
|
+
${q(this)}
|
|
1489
1492
|
<div class="toolbar">
|
|
1490
1493
|
<label class="asof" for="pollsel">Poll of</label>
|
|
1491
1494
|
<select id="pollsel" @change=${(p) => {
|
|
1492
1495
|
this.pollDate = p.target.value;
|
|
1493
1496
|
}}>
|
|
1494
|
-
${e.map((p, f) =>
|
|
1497
|
+
${e.map((p, f) => n`<option value=${p.effectiveDate} ?selected=${p === r}>
|
|
1495
1498
|
${y(p.effectiveDate, { month: "long", day: "numeric", year: "numeric" })}${f === 0 ? " · current" : ""}
|
|
1496
1499
|
</option>`)}
|
|
1497
1500
|
</select>
|
|
@@ -1506,14 +1509,14 @@ class Jt extends w {
|
|
|
1506
1509
|
<span class="spacer"></span>
|
|
1507
1510
|
<span class="asof">Movement vs. the previous poll · sparkline = season rank history</span>
|
|
1508
1511
|
</div>
|
|
1509
|
-
${h ? this.renderHero(t, r, o,
|
|
1512
|
+
${h ? this.renderHero(t, r, o, c, h, d) : m}
|
|
1510
1513
|
<div class="card"><div class="tablewrap"><table class="data">
|
|
1511
1514
|
<thead><tr>
|
|
1512
1515
|
<th class="num">Rk</th><th>Mvmt</th><th>Team</th><th class="num">Record</th>
|
|
1513
1516
|
<th>Conference</th><th>Last result</th><th>Next</th><th>Season</th>
|
|
1514
1517
|
</tr></thead>
|
|
1515
1518
|
<tbody>
|
|
1516
|
-
${(r.teamIds || []).map((p, f) => f === 0 || !p ? m : this.renderRow(t, r, o, i,
|
|
1519
|
+
${(r.teamIds || []).map((p, f) => f === 0 || !p ? m : this.renderRow(t, r, o, i, l, d, p, f + 1))}
|
|
1517
1520
|
</tbody>
|
|
1518
1521
|
</table></div></div>
|
|
1519
1522
|
<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>
|
|
@@ -1521,44 +1524,44 @@ class Jt extends w {
|
|
|
1521
1524
|
`;
|
|
1522
1525
|
}
|
|
1523
1526
|
renderHero(t, e, s, r, o, i) {
|
|
1524
|
-
const
|
|
1525
|
-
return
|
|
1527
|
+
const l = t.records[r], d = Ft(t.records, r), c = i[t.teamsById[r]?.conferenceId], h = `linear-gradient(120deg, ${o.colorPrimary || "#030711"} 0%, var(--hsot-black) 85%)`;
|
|
1528
|
+
return n`
|
|
1526
1529
|
<div class="hero1" style="background:${h}">
|
|
1527
1530
|
<div class="bigrank">#1</div>
|
|
1528
1531
|
${H(o, 64)}
|
|
1529
1532
|
<div>
|
|
1530
1533
|
<h2><a href=${g(t.hrefs.school, { id: o.id })}>${o.name} ${o.mascot || ""}</a></h2>
|
|
1531
1534
|
<div class="facts">
|
|
1532
|
-
${x(
|
|
1533
|
-
· streak ${st(
|
|
1534
|
-
${d ?
|
|
1535
|
+
${x(l)} overall${c ? n` · ${x(l, !0)} ${c.name}` : m}
|
|
1536
|
+
· streak ${st(l?.results) || "·"}
|
|
1537
|
+
${d ? n` · last: ${d.mark} ${d.my}-${d.their} vs ${Z(t, d.opp)}` : m}
|
|
1535
1538
|
${this.movement(e, s, r)}
|
|
1536
1539
|
</div>
|
|
1537
1540
|
</div>
|
|
1538
1541
|
</div>
|
|
1539
1542
|
`;
|
|
1540
1543
|
}
|
|
1541
|
-
renderRow(t, e, s, r, o, i,
|
|
1542
|
-
const
|
|
1543
|
-
if (!
|
|
1544
|
-
const h = t.records[
|
|
1545
|
-
location.href = g(t.hrefs.school, { id:
|
|
1544
|
+
renderRow(t, e, s, r, o, i, l, d) {
|
|
1545
|
+
const c = O(t, l);
|
|
1546
|
+
if (!c) return m;
|
|
1547
|
+
const h = t.records[l], p = Ft(t.records, l), f = gt(this.data.games, l), u = i[t.teamsById[l]?.conferenceId], $ = () => {
|
|
1548
|
+
location.href = g(t.hrefs.school, { id: c.id });
|
|
1546
1549
|
};
|
|
1547
|
-
return
|
|
1550
|
+
return n`
|
|
1548
1551
|
<tr class="rowlink" @click=${(at) => {
|
|
1549
1552
|
at.target.closest("a") || $();
|
|
1550
1553
|
}}>
|
|
1551
1554
|
<td class="num" style="font-weight:700">${d}</td>
|
|
1552
|
-
<td>${this.movement(e, s,
|
|
1553
|
-
<td class="teamcell">${H(
|
|
1554
|
-
<span class="mut" style="font-size:0.78rem">${
|
|
1555
|
+
<td>${this.movement(e, s, l)}</td>
|
|
1556
|
+
<td class="teamcell">${H(c)}<a href=${g(t.hrefs.school, { id: c.id })}>${c.name}</a>
|
|
1557
|
+
<span class="mut" style="font-size:0.78rem">${c.mascot || ""}</span></td>
|
|
1555
1558
|
<td class="num">${x(h)}</td>
|
|
1556
1559
|
<td class="mut">${u?.name || "Independent"}</td>
|
|
1557
|
-
<td>${p ?
|
|
1560
|
+
<td>${p ? n`<a class="box" style="text-decoration:none" href=${g(t.hrefs.game, { sport: this.sport, id: p.gameId })}>
|
|
1558
1561
|
<b style="color:${p.mark === "W" ? "var(--hsot-win)" : p.mark === "L" ? "var(--hsot-loss)" : "var(--hsot-tie)"}">${p.mark}</b>
|
|
1559
|
-
${p.my}-${p.their} vs ${Z(t, p.opp)}</a>` :
|
|
1560
|
-
<td>${Kt(t, f,
|
|
1561
|
-
<td>${this.sparkline(
|
|
1562
|
+
${p.my}-${p.their} vs ${Z(t, p.opp)}</a>` : n`<span class="mut">·</span>`}</td>
|
|
1563
|
+
<td>${Kt(t, f, l)}</td>
|
|
1564
|
+
<td>${this.sparkline(l, r, o)}</td>
|
|
1562
1565
|
</tr>
|
|
1563
1566
|
`;
|
|
1564
1567
|
}
|
|
@@ -1636,7 +1639,7 @@ class Xt extends w {
|
|
|
1636
1639
|
t && !this.sport && (this.sport = t);
|
|
1637
1640
|
}
|
|
1638
1641
|
async fetchData(t) {
|
|
1639
|
-
const e = this.season || et(), s = await t.getSchool(this.schoolId), o = (await t.listTeams({ schoolId: this.schoolId })).items, i = o.find(($) => $.sport === (this.sport || "football")) || o[0] || null, [
|
|
1642
|
+
const e = this.season || et(), s = await t.getSchool(this.schoolId), o = (await t.listTeams({ schoolId: this.schoolId })).items, i = o.find(($) => $.sport === (this.sport || "football")) || o[0] || null, [l, d, c, h, p, f, u] = await Promise.all([
|
|
1640
1643
|
i ? t.listGames({ sport: i.sport, season: e }) : Promise.resolve({ items: [] }),
|
|
1641
1644
|
i ? t.listTeams({ sport: i.sport }) : Promise.resolve({ items: [] }),
|
|
1642
1645
|
t.listSchools(),
|
|
@@ -1652,9 +1655,9 @@ class Xt extends w {
|
|
|
1652
1655
|
school: s,
|
|
1653
1656
|
teams: o,
|
|
1654
1657
|
active: i,
|
|
1655
|
-
games:
|
|
1658
|
+
games: l.items,
|
|
1656
1659
|
allTeams: d.items,
|
|
1657
|
-
schools:
|
|
1660
|
+
schools: c.items,
|
|
1658
1661
|
conferences: h.items,
|
|
1659
1662
|
rankings: p.items,
|
|
1660
1663
|
roster: f.items.find(($) => $.season === e) || null,
|
|
@@ -1676,61 +1679,61 @@ class Xt extends w {
|
|
|
1676
1679
|
}
|
|
1677
1680
|
renderView() {
|
|
1678
1681
|
const { school: t, teams: e, active: s, season: r } = this.data;
|
|
1679
|
-
if (!t) return
|
|
1680
|
-
const o = this.ctx, i = K(t.colorPrimary || "#030711"),
|
|
1681
|
-
return
|
|
1682
|
+
if (!t) return n`<div class="view"><p class="empty">School not found.</p></div>`;
|
|
1683
|
+
const o = this.ctx, i = K(t.colorPrimary || "#030711"), l = (t.adm || [])[0], d = v(this.data.conferences), c = s ? d[s.conferenceId] : null;
|
|
1684
|
+
return n`
|
|
1682
1685
|
<div class="schoolhero" style="background:linear-gradient(115deg, ${t.colorPrimary || "#030711"} 0%, ${t.colorPrimary || "#030711"} 55%, var(--hsot-black) 100%);color:${i}">
|
|
1683
1686
|
<div class="inner">
|
|
1684
|
-
${Q(t, 84) ?
|
|
1687
|
+
${Q(t, 84) ? n`<img class="crest logo" alt="" loading="lazy" src=${Q(t, 84)} />` : n`<div class="crest" style="background:${t.colorSecondary || "#7C7C7C"};color:${K(t.colorSecondary || "#7C7C7C")}">${ft(t)}</div>`}
|
|
1685
1688
|
<div style="min-width:260px">
|
|
1686
1689
|
<h1>${t.name} <span class="mascot">${t.mascot || ""}</span></h1>
|
|
1687
1690
|
<div class="facts">
|
|
1688
|
-
${t.location ?
|
|
1689
|
-
${t.association ?
|
|
1690
|
-
${
|
|
1691
|
-
${
|
|
1692
|
-
${t.openingYear ?
|
|
1693
|
-
${t.areaCode ?
|
|
1691
|
+
${t.location ? n`<span><b>Location</b>${t.location}${t.county ? n` · ${t.county} County` : m}</span>` : m}
|
|
1692
|
+
${t.association ? n`<span><b>League</b>${t.association}${t.classification ? n` · ${t.classification}` : m}</span>` : m}
|
|
1693
|
+
${c ? n`<span><b>Conference</b>${c.name}</span>` : m}
|
|
1694
|
+
${l ? n`<span><b>Enrollment</b>${l.value.toLocaleString()} (${l.season} ADM)</span>` : m}
|
|
1695
|
+
${t.openingYear ? n`<span><b>Opened</b>${t.openingYear}</span>` : m}
|
|
1696
|
+
${t.areaCode ? n`<span><b>Area</b>${t.areaCode}</span>` : m}
|
|
1694
1697
|
</div>
|
|
1695
1698
|
</div>
|
|
1696
1699
|
</div>
|
|
1697
1700
|
</div>
|
|
1698
1701
|
<div class="band">
|
|
1699
1702
|
<nav class="tabs" aria-label="Teams">
|
|
1700
|
-
${e.map((h) => h.id === s?.id ?
|
|
1703
|
+
${e.map((h) => h.id === s?.id ? n`<a class="on" href="#" @click=${(p) => p.preventDefault()}>${h.name}</a>` : n`<a href="#" @click=${(p) => {
|
|
1701
1704
|
p.preventDefault(), this.switchSport(h.sport);
|
|
1702
1705
|
}}>${h.name}</a>`)}
|
|
1703
1706
|
</nav>
|
|
1704
1707
|
</div>
|
|
1705
|
-
${
|
|
1706
|
-
${
|
|
1707
|
-
${s ? this.renderTeam(o, s,
|
|
1708
|
+
${G(this, n`
|
|
1709
|
+
${q(this)}
|
|
1710
|
+
${s ? this.renderTeam(o, s, c, r) : n`<p class="empty">No teams recorded for this school yet.</p>`}
|
|
1708
1711
|
`)}
|
|
1709
1712
|
`;
|
|
1710
1713
|
}
|
|
1711
1714
|
renderTeam(t, e, s, r) {
|
|
1712
|
-
const o = t.records[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, i = o.w + o.l + o.t,
|
|
1713
|
-
return
|
|
1715
|
+
const o = t.records[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, i = o.w + o.l + o.t, l = s ? this.data.allTeams.filter((p) => p.conferenceId === s.id) : [], d = s ? qt(l, t.records).findIndex((p) => p.team.id === e.id) + 1 : 0, c = vt(t.rankings, t.teamsById, e.id, e.sport, null), h = this.data.games.filter((p) => p.homeTeamId === e.id || p.awayTeamId === e.id).sort((p, f) => String(p.date).localeCompare(String(f.date)));
|
|
1716
|
+
return n`
|
|
1714
1717
|
<div class="tiles">
|
|
1715
1718
|
<div class="tile"><div class="k">Overall</div><div class="v">${x(o)}</div><div class="s">${i} games played</div></div>
|
|
1716
1719
|
<div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${x(o, !0)}</div>
|
|
1717
|
-
<div class="s">${d ? `${Ee(d)} of ${
|
|
1720
|
+
<div class="s">${d ? `${Ee(d)} of ${l.length}` : "·"}</div></div>
|
|
1718
1721
|
<div class="tile"><div class="k">Points</div><div class="v">${i ? (o.pf / i).toFixed(1) : "0.0"}</div>
|
|
1719
1722
|
<div class="s">scored per game · ${i ? (o.pa / i).toFixed(1) : "0.0"} allowed</div></div>
|
|
1720
1723
|
<div class="tile"><div class="k">Streak</div><div class="v">${st(o.results) || "·"}</div>
|
|
1721
1724
|
<div class="s">last 5: ${yt(t, e.id)}</div></div>
|
|
1722
|
-
<div class="tile"><div class="k">HSOT Top 25</div><div class="v">${
|
|
1725
|
+
<div class="tile"><div class="k">HSOT Top 25</div><div class="v">${c ? `#${c}` : "NR"}</div>
|
|
1723
1726
|
<div class="s"><a href=${g(t.hrefs.section, { sport: e.sport, view: "rankings" })}>full poll</a></div></div>
|
|
1724
1727
|
</div>
|
|
1725
|
-
${(e.championships || []).length ?
|
|
1728
|
+
${(e.championships || []).length ? n`
|
|
1726
1729
|
<div style="margin:-0.2rem 0 1rem;display:flex;gap:0.4rem;flex-wrap:wrap">
|
|
1727
|
-
${e.championships.map((p) =>
|
|
1730
|
+
${e.championships.map((p) => n`<span class="pill champ">★ ${p.season} ${p.title} champion${p.classification ? ` · ${p.classification}` : ""}${p.region ? ` · ${p.region}` : ""}</span>`)}
|
|
1728
1731
|
</div>` : m}
|
|
1729
1732
|
<div class="cols">
|
|
1730
1733
|
<div>
|
|
1731
1734
|
<div class="section-title">Schedule & results</div>
|
|
1732
1735
|
<div class="card">
|
|
1733
|
-
${h.length ?
|
|
1736
|
+
${h.length ? n`<ul class="gamelist">${h.map((p) => this.renderGameRow(t, e, p))}</ul>` : n`<p class="empty">No ${e.sport} games recorded for ${r}.</p>`}
|
|
1734
1737
|
</div>
|
|
1735
1738
|
</div>
|
|
1736
1739
|
<div>
|
|
@@ -1741,21 +1744,21 @@ class Xt extends w {
|
|
|
1741
1744
|
`;
|
|
1742
1745
|
}
|
|
1743
1746
|
renderGameRow(t, e, s) {
|
|
1744
|
-
const r = s.homeTeamId === e.id, o = r ? s.awayTeamId : s.homeTeamId, i = r ? s.homeScore : s.awayScore,
|
|
1745
|
-
let d =
|
|
1747
|
+
const r = s.homeTeamId === e.id, o = r ? s.awayTeamId : s.homeTeamId, i = r ? s.homeScore : s.awayScore, l = r ? s.awayScore : s.homeScore;
|
|
1748
|
+
let d = n`<span class="mut">${pt(s.time)}</span>`;
|
|
1746
1749
|
if (s.state === "final") {
|
|
1747
1750
|
const h = ut(s), p = h === "tie" ? "T" : h === (r ? "home" : "away") ? "W" : "L";
|
|
1748
|
-
d =
|
|
1749
|
-
} else s.state === "live" && (d =
|
|
1750
|
-
const
|
|
1751
|
-
return
|
|
1751
|
+
d = n`<span class=${p}>${p}</span> ${i}-${l}${s.finish === "overtime" ? n` <span class="mut">OT</span>` : m}${s.forfeit && s.forfeit !== "none" ? n` <span class="mut">FF</span>` : m}`;
|
|
1752
|
+
} else s.state === "live" && (d = n`<span style="color:var(--hsot-red)">${i}-${l}</span>`);
|
|
1753
|
+
const c = s.gameType === "conference" ? "Conf" : s.gameType === "nonconference" ? "Non-conf" : s.gameType === "playoff" ? `Playoff${s.label ? ` · ${s.label}` : ""}` : "Scrimmage";
|
|
1754
|
+
return n`
|
|
1752
1755
|
<li>
|
|
1753
1756
|
<span class="d">${y(s.date)}</span>
|
|
1754
1757
|
${Wt(s).kind === "sched" ? m : J(s)}
|
|
1755
1758
|
<span class="res">${d}</span>
|
|
1756
1759
|
<span class="opp">${r ? "vs" : "at"} ${Yt(t, o, s.date)}
|
|
1757
|
-
<span class="pill type">${
|
|
1758
|
-
${s.broadcast ?
|
|
1760
|
+
<span class="pill type">${c}</span>
|
|
1761
|
+
${s.broadcast ? n`<span class="pill class">${s.broadcast}</span>` : m}
|
|
1759
1762
|
</span>
|
|
1760
1763
|
<span class="where">${s.venue || ""}</span>
|
|
1761
1764
|
<a class="box" href=${g(t.hrefs.game, { sport: e.sport, id: s.id })}>Box score →</a>
|
|
@@ -1765,26 +1768,26 @@ class Xt extends w {
|
|
|
1765
1768
|
renderRoster(t, e) {
|
|
1766
1769
|
const s = this.data.roster;
|
|
1767
1770
|
if (!s)
|
|
1768
|
-
return
|
|
1769
|
-
const r =
|
|
1770
|
-
return
|
|
1771
|
-
${r ?
|
|
1771
|
+
return n`<p class="empty">Roster not published for ${e}.</p>`;
|
|
1772
|
+
const r = qe(s, 560), o = this.data.school?.name || "", i = v(this.data.players), l = s.entries.slice().sort((c, h) => (c.number || 0) - (h.number || 0)), d = l.some((c) => i[c.playerId]?.college);
|
|
1773
|
+
return n`
|
|
1774
|
+
${r ? n`<img class="rosterphoto" src=${r} loading="lazy" decoding="async"
|
|
1772
1775
|
alt="${o} ${t.name} ${e} team photo" />` : m}
|
|
1773
1776
|
<div class="tablewrap"><table class="data roster">
|
|
1774
|
-
<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>${d ?
|
|
1777
|
+
<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>${d ? n`<th>College</th>` : m}</tr></thead>
|
|
1775
1778
|
<tbody>
|
|
1776
|
-
${
|
|
1777
|
-
const h = i[
|
|
1779
|
+
${l.map((c) => {
|
|
1780
|
+
const h = i[c.playerId];
|
|
1778
1781
|
if (!h) return m;
|
|
1779
|
-
const p = Ie(
|
|
1780
|
-
return
|
|
1781
|
-
<td class="num mut">${
|
|
1782
|
+
const p = Ie(c), f = [p, h.classOf].filter(Boolean).join(" · ") || "·";
|
|
1783
|
+
return n`<tr>
|
|
1784
|
+
<td class="num mut">${c.number ?? "·"}</td>
|
|
1782
1785
|
<td class="player" style="font-weight:500">${h.firstName} ${h.lastName}<span class="sub">${f}</span></td>
|
|
1783
1786
|
<td class="pos">${p || "·"}</td>
|
|
1784
1787
|
<td class="cls mut">${h.classOf || "·"}</td>
|
|
1785
1788
|
<td class="num">${Te(h.heightIn)}</td>
|
|
1786
1789
|
<td class="num">${h.weightLb || "·"}</td>
|
|
1787
|
-
${d ?
|
|
1790
|
+
${d ? n`<td class="college">${h.college || "·"}</td>` : m}
|
|
1788
1791
|
</tr>`;
|
|
1789
1792
|
})}
|
|
1790
1793
|
</tbody>
|
|
@@ -1817,10 +1820,10 @@ function te(a) {
|
|
|
1817
1820
|
return { uri: a, title: a };
|
|
1818
1821
|
}
|
|
1819
1822
|
async function Je(a, t, e) {
|
|
1820
|
-
const r = await ((...
|
|
1823
|
+
const r = await ((...l) => fetch(...l))(Ze(a, t));
|
|
1821
1824
|
if (!r.ok) throw new Error(`search answered ${r.status}`);
|
|
1822
|
-
const o = await r.json(), i = new Map((o.items || []).map((
|
|
1823
|
-
return t.map((
|
|
1825
|
+
const o = await r.json(), i = new Map((o.items || []).map((l) => [l.uri, l]));
|
|
1826
|
+
return t.map((l) => i.get(l) || te(l));
|
|
1824
1827
|
}
|
|
1825
1828
|
const Xe = b`
|
|
1826
1829
|
.breadcrumbs { font-size: 0.8125rem; margin: 0.9rem 0 0; color: var(--hsot-gray-5); }
|
|
@@ -1851,6 +1854,20 @@ const Xe = b`
|
|
|
1851
1854
|
.covtitle { font-family: var(--hsot-heading-font); font-weight: 700; font-size: 1.05rem; line-height: 1.25; overflow-wrap: anywhere; }
|
|
1852
1855
|
.covdesc { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--hsot-gray-5); line-height: 1.4; }
|
|
1853
1856
|
.covmeta { margin-top: 0.45rem; font-size: 0.78rem; color: var(--hsot-gray-5); }
|
|
1857
|
+
/* Scoring plays: a compact log under the line score. The play cell is the
|
|
1858
|
+
one table.data cell allowed to wrap — a 60-yard touchdown description
|
|
1859
|
+
must fit a phone. */
|
|
1860
|
+
.plays { border-top: 1px solid var(--hsot-gray-2); padding: 0.7rem 1rem 0.9rem; }
|
|
1861
|
+
.plays-title {
|
|
1862
|
+
font-family: var(--hsot-heading-font); font-weight: 700; font-size: 0.9rem;
|
|
1863
|
+
text-transform: uppercase; letter-spacing: 0.03em; color: var(--hsot-gray-6);
|
|
1864
|
+
text-align: center; margin: 0 0 0.4rem;
|
|
1865
|
+
}
|
|
1866
|
+
table.plays-table { max-width: 720px; margin: 0 auto; }
|
|
1867
|
+
table.plays-table td.when { color: var(--hsot-gray-5); font-variant-numeric: tabular-nums; }
|
|
1868
|
+
table.plays-table td.play { white-space: normal; min-width: 12rem; }
|
|
1869
|
+
/* Game notes are typed with line breaks the desk means to keep. */
|
|
1870
|
+
.gamenote { padding: 0 1rem 0.9rem; text-align: center; white-space: pre-line; }
|
|
1854
1871
|
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
|
|
1855
1872
|
.ctxcard { padding: 0.85rem 1rem; }
|
|
1856
1873
|
.ctxcard .who { font-family: var(--hsot-heading-font); font-weight: 700; margin-bottom: 0.4rem; }
|
|
@@ -1876,7 +1893,7 @@ class ee extends w {
|
|
|
1876
1893
|
super(), this.gameId = "", this.searchApi = "";
|
|
1877
1894
|
}
|
|
1878
1895
|
async fetchData(t) {
|
|
1879
|
-
const e = await t.getGame(this.gameId), s = Array.isArray(e.coverageUrls) ? e.coverageUrls : [], [r, o, i,
|
|
1896
|
+
const e = await t.getGame(this.gameId), s = Array.isArray(e.coverageUrls) ? e.coverageUrls : [], [r, o, i, l, d, c] = await Promise.all([
|
|
1880
1897
|
t.listSchools(),
|
|
1881
1898
|
t.listTeams({ sport: e.sport }),
|
|
1882
1899
|
t.listConferences(),
|
|
@@ -1891,9 +1908,9 @@ class ee extends w {
|
|
|
1891
1908
|
schools: r.items,
|
|
1892
1909
|
teams: o.items,
|
|
1893
1910
|
conferences: i.items,
|
|
1894
|
-
rankings:
|
|
1911
|
+
rankings: l.items,
|
|
1895
1912
|
games: d.items,
|
|
1896
|
-
coverage:
|
|
1913
|
+
coverage: c
|
|
1897
1914
|
};
|
|
1898
1915
|
}
|
|
1899
1916
|
get ctx() {
|
|
@@ -1908,11 +1925,11 @@ class ee extends w {
|
|
|
1908
1925
|
}
|
|
1909
1926
|
renderView() {
|
|
1910
1927
|
const t = this.data.game;
|
|
1911
|
-
if (!t) return
|
|
1912
|
-
const e = this.ctx, s = v(this.data.conferences), r = e.teamsById[t.awayTeamId] ? e.schoolsById[e.teamsById[t.awayTeamId].schoolId] : null, o = e.teamsById[t.homeTeamId] ? e.schoolsById[e.teamsById[t.homeTeamId].schoolId] : null, i = ut(t),
|
|
1913
|
-
return
|
|
1914
|
-
${
|
|
1915
|
-
${
|
|
1928
|
+
if (!t) return n`<div class="view"><p class="empty">Game not found.</p></div>`;
|
|
1929
|
+
const e = this.ctx, s = v(this.data.conferences), r = e.teamsById[t.awayTeamId] ? e.schoolsById[e.teamsById[t.awayTeamId].schoolId] : null, o = e.teamsById[t.homeTeamId] ? e.schoolsById[e.teamsById[t.homeTeamId].schoolId] : null, i = ut(t), l = (h) => t.state === "final" && i !== h && i !== "tie" ? "opacity:0.45" : "", d = t.conferenceId ? s[t.conferenceId] : null, c = this.data.games.filter((h) => h.id !== t.id && h.state === "final" && h.gameType !== "scrimmage" && (h.homeTeamId === t.homeTeamId && h.awayTeamId === t.awayTeamId || h.homeTeamId === t.awayTeamId && h.awayTeamId === t.homeTeamId));
|
|
1930
|
+
return n`
|
|
1931
|
+
${G(this, n`
|
|
1932
|
+
${q(this)}
|
|
1916
1933
|
<p class="breadcrumbs">
|
|
1917
1934
|
<a href=${g(e.hrefs.section, { sport: t.sport, view: "scores" })}>${z(t.sport)}</a> /
|
|
1918
1935
|
<a href=${g(e.hrefs.section, { sport: t.sport, view: "scores" })}>Scores/Schedules</a> /
|
|
@@ -1923,34 +1940,35 @@ class ee extends w {
|
|
|
1923
1940
|
${this.teamBlock(e, t, t.awayTeamId, r, !1)}
|
|
1924
1941
|
<div class="mid">
|
|
1925
1942
|
<div class="bigscore">
|
|
1926
|
-
<span style=${
|
|
1943
|
+
<span style=${l("away")}>${t.awayScore}</span>
|
|
1927
1944
|
<span class="mut" style="font-size:1.6rem">–</span>
|
|
1928
|
-
<span style=${
|
|
1945
|
+
<span style=${l("home")}>${t.homeScore}</span>
|
|
1929
1946
|
</div>
|
|
1930
1947
|
<div class="status">${J(t)}</div>
|
|
1931
|
-
<div class="status">${y(t.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${t.state === "scheduled" && t.time ?
|
|
1932
|
-
${t.broadcast ?
|
|
1948
|
+
<div class="status">${y(t.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${t.state === "scheduled" && t.time ? n` · ${pt(t.time)}` : m} · ${t.venue || "Venue TBD"}
|
|
1949
|
+
${t.broadcast ? n` · <span class="pill class">${t.broadcast}</span>` : m}</div>
|
|
1933
1950
|
<div class="status">
|
|
1934
1951
|
<span class="pill type">${t.gameType === "conference" ? `${d?.name || "Conference"} game` : t.gameType}</span>
|
|
1935
|
-
${t.label ?
|
|
1936
|
-
${(t.tags || []).map((h) =>
|
|
1952
|
+
${t.label ? n`<span class="pill type">Bracket ${t.label}</span>` : m}
|
|
1953
|
+
${(t.tags || []).map((h) => n`<span class="pill type">${h}</span>`)}
|
|
1937
1954
|
</div>
|
|
1938
1955
|
</div>
|
|
1939
1956
|
${this.teamBlock(e, t, t.homeTeamId, o, !0)}
|
|
1940
1957
|
</div>
|
|
1941
1958
|
${this.renderLineScore(t, r, o)}
|
|
1942
|
-
${
|
|
1959
|
+
${this.renderScoringPlays(t, r, o)}
|
|
1960
|
+
${t.notes ? n`<p class="note gamenote">${t.notes}</p>` : m}
|
|
1943
1961
|
</div>
|
|
1944
|
-
${(this.data.coverage || []).length ?
|
|
1962
|
+
${(this.data.coverage || []).length ? n`
|
|
1945
1963
|
<div class="section-title">Coverage</div>
|
|
1946
1964
|
<div class="covgrid">
|
|
1947
|
-
${this.data.coverage.map((h) =>
|
|
1965
|
+
${this.data.coverage.map((h) => n`
|
|
1948
1966
|
<a class="card covcard" href=${h.uri}>
|
|
1949
|
-
${h.image ?
|
|
1967
|
+
${h.image ? n`<img class="covimg" src=${h.image} alt="" loading="lazy" />` : m}
|
|
1950
1968
|
<div class="covbody">
|
|
1951
|
-
<div class="covtitle">${h.videoDuration ?
|
|
1952
|
-
${h.description ?
|
|
1953
|
-
${h.author || h.publishedTime ?
|
|
1969
|
+
<div class="covtitle">${h.videoDuration ? n`<span class="pill live" style="animation:none">Video</span> ` : m}${h.photos ? n`<span class="pill live" style="animation:none">Photos</span> ` : m}${h.title || h.uri}</div>
|
|
1970
|
+
${h.description ? n`<p class="covdesc">${h.description}</p>` : m}
|
|
1971
|
+
${h.author || h.publishedTime ? n`
|
|
1954
1972
|
<div class="covmeta">${[h.author, h.publishedTime ? new Date(h.publishedTime).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : ""].filter(Boolean).join(" · ")}</div>
|
|
1955
1973
|
` : m}
|
|
1956
1974
|
</div>
|
|
@@ -1961,10 +1979,10 @@ class ee extends w {
|
|
|
1961
1979
|
<div class="cols">
|
|
1962
1980
|
${[[t.awayTeamId, r], [t.homeTeamId, o]].map(([h, p]) => this.renderContext(e, h, p))}
|
|
1963
1981
|
</div>
|
|
1964
|
-
${
|
|
1982
|
+
${c.length ? n`
|
|
1965
1983
|
<div class="section-title">Head to head this season</div>
|
|
1966
1984
|
<div class="card"><ul class="gamelist">
|
|
1967
|
-
${
|
|
1985
|
+
${c.map((h) => n`<li>
|
|
1968
1986
|
<span class="d">${y(h.date)}</span>${J(h)}
|
|
1969
1987
|
<span class="opp">${C(e, h.awayTeamId)} ${h.awayScore}, ${C(e, h.homeTeamId)} ${h.homeScore}</span>
|
|
1970
1988
|
<a class="box" href=${g(e.hrefs.game, { sport: t.sport, id: h.id })}>Box score →</a>
|
|
@@ -1974,14 +1992,14 @@ class ee extends w {
|
|
|
1974
1992
|
`;
|
|
1975
1993
|
}
|
|
1976
1994
|
teamBlock(t, e, s, r, o) {
|
|
1977
|
-
if (!r) return
|
|
1978
|
-
const i = t.teamsById[s],
|
|
1979
|
-
return
|
|
1995
|
+
if (!r) return n`<div class="teamblock ${o ? "right" : ""}"><div class="tname">TBD</div></div>`;
|
|
1996
|
+
const i = t.teamsById[s], l = t.records[s], d = Q(r, 58);
|
|
1997
|
+
return n`
|
|
1980
1998
|
<div class="teamblock ${o ? "right" : ""}">
|
|
1981
|
-
${d ?
|
|
1999
|
+
${d ? n`<img class="crest logo" alt="" loading="lazy" src=${d} />` : n`<span class="crest" style="background:${r.colorPrimary || "#030711"};color:${K(r.colorPrimary || "#030711")}">${ft(r)}</span>`}
|
|
1982
2000
|
<div>
|
|
1983
2001
|
<div class="tname">${bt(t, s, e.date)}<a href=${g(t.hrefs.school, { id: r.id })}>${r.name}</a></div>
|
|
1984
|
-
<div class="trec">${r.mascot || ""} · ${x(
|
|
2002
|
+
<div class="trec">${r.mascot || ""} · ${x(l)}${i?.conferenceId ? n` · ${x(l, !0)} conf` : m}</div>
|
|
1985
2003
|
</div>
|
|
1986
2004
|
</div>
|
|
1987
2005
|
`;
|
|
@@ -1989,20 +2007,20 @@ class ee extends w {
|
|
|
1989
2007
|
renderLineScore(t, e, s) {
|
|
1990
2008
|
const r = t.periodScores || [];
|
|
1991
2009
|
if (!r.length)
|
|
1992
|
-
return
|
|
1993
|
-
const o = Math.max(4, ...r.map((
|
|
2010
|
+
return n`<p class="empty" style="text-align:center">Period scoring will appear once the game starts.</p>`;
|
|
2011
|
+
const o = Math.max(4, ...r.map((c) => c.period)), i = (c) => c <= 4 ? String(c) : `OT${c > 5 ? c - 4 : ""}`, l = (c, h) => {
|
|
1994
2012
|
const p = r.find((f) => f.period === h);
|
|
1995
|
-
return p ? p[
|
|
1996
|
-
}, d = (
|
|
2013
|
+
return p ? p[c] : t.state === "final" ? 0 : "·";
|
|
2014
|
+
}, d = (c, h, p) => n`
|
|
1997
2015
|
<tr>
|
|
1998
|
-
<td class="teamcell">${H(
|
|
1999
|
-
${Array.from({ length: o }, (f, u) =>
|
|
2016
|
+
<td class="teamcell">${H(c, 20)}${c?.abbr || "TBD"}</td>
|
|
2017
|
+
${Array.from({ length: o }, (f, u) => n`<td class="num">${l(h, u + 1)}</td>`)}
|
|
2000
2018
|
<td class="num" style="font-weight:700">${p}</td>
|
|
2001
2019
|
</tr>`;
|
|
2002
|
-
return
|
|
2020
|
+
return n`
|
|
2003
2021
|
<div class="tablewrap" style="border-top:1px solid var(--hsot-gray-2)">
|
|
2004
2022
|
<table class="data" style="max-width:560px;margin:0.6rem auto 0.9rem">
|
|
2005
|
-
<thead><tr><th>Team</th>${Array.from({ length: o }, (
|
|
2023
|
+
<thead><tr><th>Team</th>${Array.from({ length: o }, (c, h) => n`<th class="num">${i(h + 1)}</th>`)}<th class="num">T</th></tr></thead>
|
|
2006
2024
|
<tbody>
|
|
2007
2025
|
${d(e, "away", t.awayScore)}
|
|
2008
2026
|
${d(s, "home", t.homeScore)}
|
|
@@ -2011,17 +2029,43 @@ class ee extends w {
|
|
|
2011
2029
|
</div>
|
|
2012
2030
|
`;
|
|
2013
2031
|
}
|
|
2032
|
+
renderScoringPlays(t, e, s) {
|
|
2033
|
+
const r = Array.isArray(t.scoringPlays) ? t.scoringPlays : [];
|
|
2034
|
+
if (!r.length) return m;
|
|
2035
|
+
const o = (i) => [i.period, i.clock].filter(Boolean).join(" ");
|
|
2036
|
+
return n`
|
|
2037
|
+
<div class="plays">
|
|
2038
|
+
<div class="plays-title">Scoring plays</div>
|
|
2039
|
+
<div class="tablewrap">
|
|
2040
|
+
<table class="data plays-table">
|
|
2041
|
+
<thead><tr>
|
|
2042
|
+
<th>When</th><th>Play</th>
|
|
2043
|
+
<th class="num">${e?.abbr || "Away"}</th><th class="num">${s?.abbr || "Home"}</th>
|
|
2044
|
+
</tr></thead>
|
|
2045
|
+
<tbody>
|
|
2046
|
+
${r.map((i) => n`<tr>
|
|
2047
|
+
<td class="when">${o(i) || "·"}</td>
|
|
2048
|
+
<td class="play">${i.description || "·"}</td>
|
|
2049
|
+
<td class="num">${i.awayScore}</td>
|
|
2050
|
+
<td class="num">${i.homeScore}</td>
|
|
2051
|
+
</tr>`)}
|
|
2052
|
+
</tbody>
|
|
2053
|
+
</table>
|
|
2054
|
+
</div>
|
|
2055
|
+
</div>
|
|
2056
|
+
`;
|
|
2057
|
+
}
|
|
2014
2058
|
renderContext(t, e, s) {
|
|
2015
2059
|
if (!s) return m;
|
|
2016
2060
|
const r = t.records[e], o = gt(this.data.games, e);
|
|
2017
|
-
return
|
|
2061
|
+
return n`
|
|
2018
2062
|
<div class="card ctxcard">
|
|
2019
2063
|
<div class="who">${H(s)}${s.name}</div>
|
|
2020
2064
|
<div class="row">
|
|
2021
2065
|
<span>Last 5: ${yt(t, e)}</span>
|
|
2022
2066
|
<span>Streak: <b>${r ? st(r.results) : "·"}</b></span>
|
|
2023
2067
|
<span>PF/PA: <b>${r ? `${r.pf} / ${r.pa}` : "·"}</b></span>
|
|
2024
|
-
<span>Next: ${o ?
|
|
2068
|
+
<span>Next: ${o ? n`${y(o.date, { month: "numeric", day: "numeric" })}
|
|
2025
2069
|
${o.homeTeamId === e ? "vs" : "at"} ${Z(t, o.homeTeamId === e ? o.awayTeamId : o.homeTeamId)}` : "·"}</span>
|
|
2026
2070
|
</div>
|
|
2027
2071
|
</div>
|
|
@@ -2162,7 +2206,7 @@ class se extends E {
|
|
|
2162
2206
|
const s = this.where(t), r = (o) => {
|
|
2163
2207
|
o.preventDefault(), this.go(t);
|
|
2164
2208
|
};
|
|
2165
|
-
return
|
|
2209
|
+
return n`
|
|
2166
2210
|
<li
|
|
2167
2211
|
id="school-option-${e}"
|
|
2168
2212
|
role="option"
|
|
@@ -2173,13 +2217,13 @@ class se extends E {
|
|
|
2173
2217
|
}}"
|
|
2174
2218
|
>
|
|
2175
2219
|
<span class="name">${t.name}</span>
|
|
2176
|
-
${s ?
|
|
2220
|
+
${s ? n`<span class="where">${s}</span>` : m}
|
|
2177
2221
|
</li>
|
|
2178
2222
|
`;
|
|
2179
2223
|
}
|
|
2180
2224
|
renderListbox() {
|
|
2181
|
-
const t = this.searched && !this.results.length, e =
|
|
2182
|
-
return
|
|
2225
|
+
const t = this.searched && !this.results.length, e = n`<li class="empty">No schools found</li>`;
|
|
2226
|
+
return n`
|
|
2183
2227
|
<ul id="school-search-listbox" role="listbox" aria-label="Schools">
|
|
2184
2228
|
${this.results.map((s, r) => this.renderOption(s, r))}
|
|
2185
2229
|
${t ? e : m}
|
|
@@ -2188,7 +2232,7 @@ class se extends E {
|
|
|
2188
2232
|
}
|
|
2189
2233
|
render() {
|
|
2190
2234
|
const t = this.activeIndex >= 0 ? `school-option-${this.activeIndex}` : "";
|
|
2191
|
-
return
|
|
2235
|
+
return n`
|
|
2192
2236
|
<input
|
|
2193
2237
|
type="text"
|
|
2194
2238
|
role="combobox"
|