@wral/hsot-data 0.1.2 → 0.1.4
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.
- package/dist/define.mjs +1 -1
- package/dist/define.standalone.js +552 -497
- package/dist/{hsot-boxscore-DiJN2Ik6.js → hsot-boxscore-HfW4EnqW.js} +242 -187
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -17,54 +17,54 @@ let Dt = class {
|
|
|
17
17
|
return this.cssText;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const
|
|
21
|
-
const e =
|
|
20
|
+
const Yt = (a) => new Dt(typeof a == "string" ? a : a + "", void 0, lt), w = (a, ...t) => {
|
|
21
|
+
const e = a.length === 1 ? a[0] : t.reduce((s, r, o) => s + ((i) => {
|
|
22
22
|
if (i._$cssResult$ === !0) return i.cssText;
|
|
23
23
|
if (typeof i == "number") return i;
|
|
24
24
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + i + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
25
|
-
})(
|
|
26
|
-
return new Dt(e,
|
|
27
|
-
},
|
|
28
|
-
if (nt)
|
|
25
|
+
})(r) + a[o + 1], a[0]);
|
|
26
|
+
return new Dt(e, a, lt);
|
|
27
|
+
}, Zt = (a, t) => {
|
|
28
|
+
if (nt) a.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
29
29
|
else for (const e of t) {
|
|
30
|
-
const s = document.createElement("style"),
|
|
31
|
-
|
|
30
|
+
const s = document.createElement("style"), r = j.litNonce;
|
|
31
|
+
r !== void 0 && s.setAttribute("nonce", r), s.textContent = e.cssText, a.appendChild(s);
|
|
32
32
|
}
|
|
33
|
-
}, vt = nt ? (
|
|
33
|
+
}, vt = nt ? (a) => a : (a) => a instanceof CSSStyleSheet ? ((t) => {
|
|
34
34
|
let e = "";
|
|
35
35
|
for (const s of t.cssRules) e += s.cssText;
|
|
36
|
-
return
|
|
37
|
-
})(
|
|
38
|
-
const { is: Kt, defineProperty:
|
|
36
|
+
return Yt(e);
|
|
37
|
+
})(a) : a;
|
|
38
|
+
const { is: Kt, defineProperty: Qt, getOwnPropertyDescriptor: Jt, getOwnPropertyNames: Xt, getOwnPropertySymbols: te, getPrototypeOf: ee } = Object, Z = globalThis, yt = Z.trustedTypes, se = yt ? yt.emptyScript : "", ae = Z.reactiveElementPolyfillSupport, D = (a, t) => a, rt = { toAttribute(a, t) {
|
|
39
39
|
switch (t) {
|
|
40
40
|
case Boolean:
|
|
41
|
-
|
|
41
|
+
a = a ? se : null;
|
|
42
42
|
break;
|
|
43
43
|
case Object:
|
|
44
44
|
case Array:
|
|
45
|
-
|
|
45
|
+
a = a == null ? a : JSON.stringify(a);
|
|
46
46
|
}
|
|
47
|
-
return
|
|
48
|
-
}, fromAttribute(
|
|
49
|
-
let e =
|
|
47
|
+
return a;
|
|
48
|
+
}, fromAttribute(a, t) {
|
|
49
|
+
let e = a;
|
|
50
50
|
switch (t) {
|
|
51
51
|
case Boolean:
|
|
52
|
-
e =
|
|
52
|
+
e = a !== null;
|
|
53
53
|
break;
|
|
54
54
|
case Number:
|
|
55
|
-
e =
|
|
55
|
+
e = a === null ? null : Number(a);
|
|
56
56
|
break;
|
|
57
57
|
case Object:
|
|
58
58
|
case Array:
|
|
59
59
|
try {
|
|
60
|
-
e = JSON.parse(
|
|
60
|
+
e = JSON.parse(a);
|
|
61
61
|
} catch {
|
|
62
62
|
e = null;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
return e;
|
|
66
|
-
} }, Rt = (
|
|
67
|
-
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"),
|
|
66
|
+
} }, Rt = (a, t) => !Kt(a, t), bt = { attribute: !0, type: String, converter: rt, reflect: !1, useDefault: !1, hasChanged: Rt };
|
|
67
|
+
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), Z.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
68
|
let T = class extends HTMLElement {
|
|
69
69
|
static addInitializer(t) {
|
|
70
70
|
this._$Ei(), (this.l ??= []).push(t);
|
|
@@ -74,18 +74,18 @@ let T = class extends HTMLElement {
|
|
|
74
74
|
}
|
|
75
75
|
static createProperty(t, e = bt) {
|
|
76
76
|
if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
77
|
-
const s = /* @__PURE__ */ Symbol(),
|
|
78
|
-
|
|
77
|
+
const s = /* @__PURE__ */ Symbol(), r = this.getPropertyDescriptor(t, s, e);
|
|
78
|
+
r !== void 0 && Qt(this.prototype, t, r);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
static getPropertyDescriptor(t, e, s) {
|
|
82
|
-
const { get:
|
|
82
|
+
const { get: r, set: o } = Jt(this.prototype, t) ?? { get() {
|
|
83
83
|
return this[e];
|
|
84
84
|
}, set(i) {
|
|
85
85
|
this[e] = i;
|
|
86
86
|
} };
|
|
87
|
-
return { get:
|
|
88
|
-
const n =
|
|
87
|
+
return { get: r, set(i) {
|
|
88
|
+
const n = r?.call(this);
|
|
89
89
|
o?.call(this, i), this.requestUpdate(t, n, s);
|
|
90
90
|
}, configurable: !0, enumerable: !0 };
|
|
91
91
|
}
|
|
@@ -94,24 +94,24 @@ let T = class extends HTMLElement {
|
|
|
94
94
|
}
|
|
95
95
|
static _$Ei() {
|
|
96
96
|
if (this.hasOwnProperty(D("elementProperties"))) return;
|
|
97
|
-
const t =
|
|
97
|
+
const t = ee(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
101
|
if (this.hasOwnProperty(D("finalized"))) return;
|
|
102
102
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(D("properties"))) {
|
|
103
|
-
const e = this.properties, s = [...
|
|
104
|
-
for (const
|
|
103
|
+
const e = this.properties, s = [...Xt(e), ...te(e)];
|
|
104
|
+
for (const r of s) this.createProperty(r, e[r]);
|
|
105
105
|
}
|
|
106
106
|
const t = this[Symbol.metadata];
|
|
107
107
|
if (t !== null) {
|
|
108
108
|
const e = litPropertyMetadata.get(t);
|
|
109
|
-
if (e !== void 0) for (const [s,
|
|
109
|
+
if (e !== void 0) for (const [s, r] of e) this.elementProperties.set(s, r);
|
|
110
110
|
}
|
|
111
111
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
112
112
|
for (const [e, s] of this.elementProperties) {
|
|
113
|
-
const
|
|
114
|
-
|
|
113
|
+
const r = this._$Eu(e, s);
|
|
114
|
+
r !== void 0 && this._$Eh.set(r, e);
|
|
115
115
|
}
|
|
116
116
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
117
117
|
}
|
|
@@ -119,7 +119,7 @@ let T = class extends HTMLElement {
|
|
|
119
119
|
const e = [];
|
|
120
120
|
if (Array.isArray(t)) {
|
|
121
121
|
const s = new Set(t.flat(1 / 0).reverse());
|
|
122
|
-
for (const
|
|
122
|
+
for (const r of s) e.unshift(vt(r));
|
|
123
123
|
} else t !== void 0 && e.push(vt(t));
|
|
124
124
|
return e;
|
|
125
125
|
}
|
|
@@ -146,7 +146,7 @@ let T = class extends HTMLElement {
|
|
|
146
146
|
}
|
|
147
147
|
createRenderRoot() {
|
|
148
148
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
149
|
-
return
|
|
149
|
+
return Zt(t, this.constructor.elementStyles), t;
|
|
150
150
|
}
|
|
151
151
|
connectedCallback() {
|
|
152
152
|
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((t) => t.hostConnected?.());
|
|
@@ -160,31 +160,31 @@ let T = class extends HTMLElement {
|
|
|
160
160
|
this._$AK(t, s);
|
|
161
161
|
}
|
|
162
162
|
_$ET(t, e) {
|
|
163
|
-
const s = this.constructor.elementProperties.get(t),
|
|
164
|
-
if (
|
|
163
|
+
const s = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, s);
|
|
164
|
+
if (r !== void 0 && s.reflect === !0) {
|
|
165
165
|
const o = (s.converter?.toAttribute !== void 0 ? s.converter : rt).toAttribute(e, s.type);
|
|
166
|
-
this._$Em = t, o == null ? this.removeAttribute(
|
|
166
|
+
this._$Em = t, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
_$AK(t, e) {
|
|
170
|
-
const s = this.constructor,
|
|
171
|
-
if (
|
|
172
|
-
const o = s.getPropertyOptions(
|
|
173
|
-
this._$Em =
|
|
170
|
+
const s = this.constructor, r = s._$Eh.get(t);
|
|
171
|
+
if (r !== void 0 && this._$Em !== r) {
|
|
172
|
+
const o = s.getPropertyOptions(r), i = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : rt;
|
|
173
|
+
this._$Em = r;
|
|
174
174
|
const n = i.fromAttribute(e, o.type);
|
|
175
|
-
this[
|
|
175
|
+
this[r] = n ?? this._$Ej?.get(r) ?? n, this._$Em = null;
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
requestUpdate(t, e, s,
|
|
178
|
+
requestUpdate(t, e, s, r = !1, o) {
|
|
179
179
|
if (t !== void 0) {
|
|
180
180
|
const i = this.constructor;
|
|
181
|
-
if (
|
|
181
|
+
if (r === !1 && (o = this[t]), s ??= i.getPropertyOptions(t), !((s.hasChanged ?? Rt)(o, e) || s.useDefault && s.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(i._$Eu(t, s)))) return;
|
|
182
182
|
this.C(t, e, s);
|
|
183
183
|
}
|
|
184
184
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
185
185
|
}
|
|
186
|
-
C(t, e, { useDefault: s, reflect:
|
|
187
|
-
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, i ?? e ?? this[t]), o !== !0 || i !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)),
|
|
186
|
+
C(t, e, { useDefault: s, reflect: r, wrapped: o }, i) {
|
|
187
|
+
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, i ?? e ?? this[t]), o !== !0 || i !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), r === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
|
|
188
188
|
}
|
|
189
189
|
async _$EP() {
|
|
190
190
|
this.isUpdatePending = !0;
|
|
@@ -203,13 +203,13 @@ let T = class extends HTMLElement {
|
|
|
203
203
|
if (!this.isUpdatePending) return;
|
|
204
204
|
if (!this.hasUpdated) {
|
|
205
205
|
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
206
|
-
for (const [
|
|
206
|
+
for (const [r, o] of this._$Ep) this[r] = o;
|
|
207
207
|
this._$Ep = void 0;
|
|
208
208
|
}
|
|
209
209
|
const s = this.constructor.elementProperties;
|
|
210
|
-
if (s.size > 0) for (const [
|
|
211
|
-
const { wrapped: i } = o, n = this[
|
|
212
|
-
i !== !0 || this._$AL.has(
|
|
210
|
+
if (s.size > 0) for (const [r, o] of s) {
|
|
211
|
+
const { wrapped: i } = o, n = this[r];
|
|
212
|
+
i !== !0 || this._$AL.has(r) || n === void 0 || this.C(r, void 0, o, n);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
let t = !1;
|
|
@@ -246,54 +246,54 @@ let T = class extends HTMLElement {
|
|
|
246
246
|
firstUpdated(t) {
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
T.elementStyles = [], T.shadowRootOptions = { mode: "open" }, T[D("elementProperties")] = /* @__PURE__ */ new Map(), T[D("finalized")] = /* @__PURE__ */ new Map(),
|
|
250
|
-
const ct = globalThis, wt = (
|
|
249
|
+
T.elementStyles = [], T.shadowRootOptions = { mode: "open" }, T[D("elementProperties")] = /* @__PURE__ */ new Map(), T[D("finalized")] = /* @__PURE__ */ new Map(), ae?.({ ReactiveElement: T }), (Z.reactiveElementVersions ??= []).push("2.1.2");
|
|
250
|
+
const ct = globalThis, wt = (a) => a, W = ct.trustedTypes, xt = W ? W.createPolicy("lit-html", { createHTML: (a) => a }) : void 0, zt = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`, Bt = "?" + _, re = `<${Bt}>`, A = document, z = () => A.createComment(""), B = (a) => a === null || typeof a != "object" && typeof a != "function", dt = Array.isArray, oe = (a) => dt(a) || typeof a?.[Symbol.iterator] == "function", st = `[
|
|
251
251
|
\f\r]`, E = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, _t = /-->/g, kt = />/g, k = RegExp(`>|${st}(?:([^\\s"'>=/]+)(${st}*=${st}*(?:[^
|
|
252
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), St = /'/g, At = /"/g,
|
|
253
|
-
function
|
|
254
|
-
if (!dt(
|
|
252
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), St = /'/g, At = /"/g, Ut = /^(?:script|style|textarea|title)$/i, Ot = (a) => (t, ...e) => ({ _$litType$: a, strings: t, values: e }), d = Ot(1), Tt = Ot(2), C = /* @__PURE__ */ Symbol.for("lit-noChange"), m = /* @__PURE__ */ Symbol.for("lit-nothing"), Ct = /* @__PURE__ */ new WeakMap(), S = A.createTreeWalker(A, 129);
|
|
253
|
+
function Ft(a, t) {
|
|
254
|
+
if (!dt(a) || !a.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
255
|
return xt !== void 0 ? xt.createHTML(t) : t;
|
|
256
256
|
}
|
|
257
|
-
const
|
|
258
|
-
const e =
|
|
259
|
-
let
|
|
257
|
+
const ie = (a, t) => {
|
|
258
|
+
const e = a.length - 1, s = [];
|
|
259
|
+
let r, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", i = E;
|
|
260
260
|
for (let n = 0; n < e; n++) {
|
|
261
|
-
const
|
|
262
|
-
let p,
|
|
263
|
-
for (; f <
|
|
264
|
-
const u = i === k &&
|
|
265
|
-
o += i === E ?
|
|
261
|
+
const c = a[n];
|
|
262
|
+
let p, l, h = -1, f = 0;
|
|
263
|
+
for (; f < c.length && (i.lastIndex = f, l = i.exec(c), l !== null); ) f = i.lastIndex, i === E ? l[1] === "!--" ? i = _t : l[1] !== void 0 ? i = kt : l[2] !== void 0 ? (Ut.test(l[2]) && (r = RegExp("</" + l[2], "g")), i = k) : l[3] !== void 0 && (i = k) : i === k ? l[0] === ">" ? (i = r ?? E, h = -1) : l[1] === void 0 ? h = -2 : (h = i.lastIndex - l[2].length, p = l[1], i = l[3] === void 0 ? k : l[3] === '"' ? At : St) : i === At || i === St ? i = k : i === _t || i === kt ? i = E : (i = k, r = void 0);
|
|
264
|
+
const u = i === k && a[n + 1].startsWith("/>") ? " " : "";
|
|
265
|
+
o += i === E ? c + re : h >= 0 ? (s.push(p), c.slice(0, h) + zt + c.slice(h) + _ + u) : c + _ + (h === -2 ? n : u);
|
|
266
266
|
}
|
|
267
|
-
return [
|
|
267
|
+
return [Ft(a, o + (a[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
268
268
|
};
|
|
269
|
-
class
|
|
269
|
+
class U {
|
|
270
270
|
constructor({ strings: t, _$litType$: e }, s) {
|
|
271
|
-
let
|
|
271
|
+
let r;
|
|
272
272
|
this.parts = [];
|
|
273
273
|
let o = 0, i = 0;
|
|
274
|
-
const n = t.length - 1,
|
|
275
|
-
if (this.el =
|
|
276
|
-
const
|
|
277
|
-
|
|
274
|
+
const n = t.length - 1, c = this.parts, [p, l] = ie(t, e);
|
|
275
|
+
if (this.el = U.createElement(p, s), S.currentNode = this.el.content, e === 2 || e === 3) {
|
|
276
|
+
const h = this.el.content.firstChild;
|
|
277
|
+
h.replaceWith(...h.childNodes);
|
|
278
278
|
}
|
|
279
|
-
for (; (
|
|
280
|
-
if (
|
|
281
|
-
if (
|
|
282
|
-
const f =
|
|
283
|
-
|
|
284
|
-
} else
|
|
285
|
-
if (
|
|
286
|
-
const
|
|
279
|
+
for (; (r = S.nextNode()) !== null && c.length < n; ) {
|
|
280
|
+
if (r.nodeType === 1) {
|
|
281
|
+
if (r.hasAttributes()) for (const h of r.getAttributeNames()) if (h.endsWith(zt)) {
|
|
282
|
+
const f = l[i++], u = r.getAttribute(h).split(_), v = /([.?@])?(.*)/.exec(f);
|
|
283
|
+
c.push({ type: 1, index: o, name: v[2], strings: u, ctor: v[1] === "." ? le : v[1] === "?" ? ce : v[1] === "@" ? de : K }), r.removeAttribute(h);
|
|
284
|
+
} else h.startsWith(_) && (c.push({ type: 6, index: o }), r.removeAttribute(h));
|
|
285
|
+
if (Ut.test(r.tagName)) {
|
|
286
|
+
const h = r.textContent.split(_), f = h.length - 1;
|
|
287
287
|
if (f > 0) {
|
|
288
|
-
|
|
289
|
-
for (let u = 0; u < f; u++)
|
|
290
|
-
|
|
288
|
+
r.textContent = W ? W.emptyScript : "";
|
|
289
|
+
for (let u = 0; u < f; u++) r.append(h[u], z()), S.nextNode(), c.push({ type: 2, index: ++o });
|
|
290
|
+
r.append(h[f], z());
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
} else if (
|
|
293
|
+
} else if (r.nodeType === 8) if (r.data === Bt) c.push({ type: 2, index: o });
|
|
294
294
|
else {
|
|
295
|
-
let
|
|
296
|
-
for (; (
|
|
295
|
+
let h = -1;
|
|
296
|
+
for (; (h = r.data.indexOf(_, h + 1)) !== -1; ) c.push({ type: 7, index: o }), h += _.length - 1;
|
|
297
297
|
}
|
|
298
298
|
o++;
|
|
299
299
|
}
|
|
@@ -303,13 +303,13 @@ class O {
|
|
|
303
303
|
return s.innerHTML = t, s;
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
if (t ===
|
|
308
|
-
let
|
|
306
|
+
function I(a, t, e = a, s) {
|
|
307
|
+
if (t === C) return t;
|
|
308
|
+
let r = s !== void 0 ? e._$Co?.[s] : e._$Cl;
|
|
309
309
|
const o = B(t) ? void 0 : t._$litDirective$;
|
|
310
|
-
return
|
|
310
|
+
return r?.constructor !== o && (r?._$AO?.(!1), o === void 0 ? r = void 0 : (r = new o(a), r._$AT(a, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = r : e._$Cl = r), r !== void 0 && (t = I(a, r._$AS(a, t.values), r, s)), t;
|
|
311
311
|
}
|
|
312
|
-
class
|
|
312
|
+
class ne {
|
|
313
313
|
constructor(t, e) {
|
|
314
314
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
315
315
|
}
|
|
@@ -320,29 +320,29 @@ class ie {
|
|
|
320
320
|
return this._$AM._$AU;
|
|
321
321
|
}
|
|
322
322
|
u(t) {
|
|
323
|
-
const { el: { content: e }, parts: s } = this._$AD,
|
|
324
|
-
S.currentNode =
|
|
325
|
-
let o = S.nextNode(), i = 0, n = 0,
|
|
326
|
-
for (;
|
|
327
|
-
if (i ===
|
|
323
|
+
const { el: { content: e }, parts: s } = this._$AD, r = (t?.creationScope ?? A).importNode(e, !0);
|
|
324
|
+
S.currentNode = r;
|
|
325
|
+
let o = S.nextNode(), i = 0, n = 0, c = s[0];
|
|
326
|
+
for (; c !== void 0; ) {
|
|
327
|
+
if (i === c.index) {
|
|
328
328
|
let p;
|
|
329
|
-
|
|
329
|
+
c.type === 2 ? p = new N(o, o.nextSibling, this, t) : c.type === 1 ? p = new c.ctor(o, c.name, c.strings, this, t) : c.type === 6 && (p = new he(o, this, t)), this._$AV.push(p), c = s[++n];
|
|
330
330
|
}
|
|
331
|
-
i !==
|
|
331
|
+
i !== c?.index && (o = S.nextNode(), i++);
|
|
332
332
|
}
|
|
333
|
-
return S.currentNode = A,
|
|
333
|
+
return S.currentNode = A, r;
|
|
334
334
|
}
|
|
335
335
|
p(t) {
|
|
336
336
|
let e = 0;
|
|
337
337
|
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
class
|
|
340
|
+
class N {
|
|
341
341
|
get _$AU() {
|
|
342
342
|
return this._$AM?._$AU ?? this._$Cv;
|
|
343
343
|
}
|
|
344
|
-
constructor(t, e, s,
|
|
345
|
-
this.type = 2, this._$AH = m, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options =
|
|
344
|
+
constructor(t, e, s, r) {
|
|
345
|
+
this.type = 2, this._$AH = m, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = r, this._$Cv = r?.isConnected ?? !0;
|
|
346
346
|
}
|
|
347
347
|
get parentNode() {
|
|
348
348
|
let t = this._$AA.parentNode;
|
|
@@ -356,7 +356,7 @@ class F {
|
|
|
356
356
|
return this._$AB;
|
|
357
357
|
}
|
|
358
358
|
_$AI(t, e = this) {
|
|
359
|
-
t =
|
|
359
|
+
t = I(this, t, e), B(t) ? t === m || t == null || t === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : t !== this._$AH && t !== C && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : oe(t) ? this.k(t) : this._(t);
|
|
360
360
|
}
|
|
361
361
|
O(t) {
|
|
362
362
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -368,23 +368,23 @@ class F {
|
|
|
368
368
|
this._$AH !== m && B(this._$AH) ? this._$AA.nextSibling.data = t : this.T(A.createTextNode(t)), this._$AH = t;
|
|
369
369
|
}
|
|
370
370
|
$(t) {
|
|
371
|
-
const { values: e, _$litType$: s } = t,
|
|
372
|
-
if (this._$AH?._$AD ===
|
|
371
|
+
const { values: e, _$litType$: s } = t, r = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = U.createElement(Ft(s.h, s.h[0]), this.options)), s);
|
|
372
|
+
if (this._$AH?._$AD === r) this._$AH.p(e);
|
|
373
373
|
else {
|
|
374
|
-
const o = new
|
|
374
|
+
const o = new ne(r, this), i = o.u(this.options);
|
|
375
375
|
o.p(e), this.T(i), this._$AH = o;
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
_$AC(t) {
|
|
379
|
-
let e =
|
|
380
|
-
return e === void 0 &&
|
|
379
|
+
let e = Ct.get(t.strings);
|
|
380
|
+
return e === void 0 && Ct.set(t.strings, e = new U(t)), e;
|
|
381
381
|
}
|
|
382
382
|
k(t) {
|
|
383
383
|
dt(this._$AH) || (this._$AH = [], this._$AR());
|
|
384
384
|
const e = this._$AH;
|
|
385
|
-
let s,
|
|
386
|
-
for (const o of t)
|
|
387
|
-
|
|
385
|
+
let s, r = 0;
|
|
386
|
+
for (const o of t) r === e.length ? e.push(s = new N(this.O(z()), this.O(z()), this, this.options)) : s = e[r], s._$AI(o), r++;
|
|
387
|
+
r < e.length && (this._$AR(s && s._$AB.nextSibling, r), e.length = r);
|
|
388
388
|
}
|
|
389
389
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
390
390
|
for (this._$AP?.(!1, !0, e); t !== this._$AB; ) {
|
|
@@ -396,32 +396,32 @@ class F {
|
|
|
396
396
|
this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
|
-
class
|
|
399
|
+
class K {
|
|
400
400
|
get tagName() {
|
|
401
401
|
return this.element.tagName;
|
|
402
402
|
}
|
|
403
403
|
get _$AU() {
|
|
404
404
|
return this._$AM._$AU;
|
|
405
405
|
}
|
|
406
|
-
constructor(t, e, s,
|
|
407
|
-
this.type = 1, this._$AH = m, this._$AN = void 0, this.element = t, this.name = e, this._$AM =
|
|
406
|
+
constructor(t, e, s, r, o) {
|
|
407
|
+
this.type = 1, this._$AH = m, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = o, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = m;
|
|
408
408
|
}
|
|
409
|
-
_$AI(t, e = this, s,
|
|
409
|
+
_$AI(t, e = this, s, r) {
|
|
410
410
|
const o = this.strings;
|
|
411
411
|
let i = !1;
|
|
412
|
-
if (o === void 0) t =
|
|
412
|
+
if (o === void 0) t = I(this, t, e, 0), i = !B(t) || t !== this._$AH && t !== C, i && (this._$AH = t);
|
|
413
413
|
else {
|
|
414
414
|
const n = t;
|
|
415
|
-
let
|
|
416
|
-
for (t = o[0],
|
|
415
|
+
let c, p;
|
|
416
|
+
for (t = o[0], c = 0; c < o.length - 1; c++) p = I(this, n[s + c], e, c), p === C && (p = this._$AH[c]), i ||= !B(p) || p !== this._$AH[c], p === m ? t = m : t !== m && (t += (p ?? "") + o[c + 1]), this._$AH[c] = p;
|
|
417
417
|
}
|
|
418
|
-
i && !
|
|
418
|
+
i && !r && this.j(t);
|
|
419
419
|
}
|
|
420
420
|
j(t) {
|
|
421
421
|
t === m ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
|
-
class
|
|
424
|
+
class le extends K {
|
|
425
425
|
constructor() {
|
|
426
426
|
super(...arguments), this.type = 3;
|
|
427
427
|
}
|
|
@@ -429,7 +429,7 @@ class ne extends Z {
|
|
|
429
429
|
this.element[this.name] = t === m ? void 0 : t;
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
|
-
class
|
|
432
|
+
class ce extends K {
|
|
433
433
|
constructor() {
|
|
434
434
|
super(...arguments), this.type = 4;
|
|
435
435
|
}
|
|
@@ -437,20 +437,20 @@ class le extends Z {
|
|
|
437
437
|
this.element.toggleAttribute(this.name, !!t && t !== m);
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
class
|
|
441
|
-
constructor(t, e, s,
|
|
442
|
-
super(t, e, s,
|
|
440
|
+
class de extends K {
|
|
441
|
+
constructor(t, e, s, r, o) {
|
|
442
|
+
super(t, e, s, r, o), this.type = 5;
|
|
443
443
|
}
|
|
444
444
|
_$AI(t, e = this) {
|
|
445
|
-
if ((t =
|
|
446
|
-
const s = this._$AH,
|
|
447
|
-
|
|
445
|
+
if ((t = I(this, t, e, 0) ?? m) === C) return;
|
|
446
|
+
const s = this._$AH, r = t === m && s !== m || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== m && (s === m || r);
|
|
447
|
+
r && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
448
448
|
}
|
|
449
449
|
handleEvent(t) {
|
|
450
450
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
|
-
class
|
|
453
|
+
class he {
|
|
454
454
|
constructor(t, e, s) {
|
|
455
455
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
|
|
456
456
|
}
|
|
@@ -458,19 +458,19 @@ class de {
|
|
|
458
458
|
return this._$AM._$AU;
|
|
459
459
|
}
|
|
460
460
|
_$AI(t) {
|
|
461
|
-
|
|
461
|
+
I(this, t);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
const
|
|
464
|
+
const pe = ct.litHtmlPolyfillSupport;
|
|
465
|
+
pe?.(U, N), (ct.litHtmlVersions ??= []).push("3.3.3");
|
|
466
|
+
const me = (a, t, e) => {
|
|
467
467
|
const s = e?.renderBefore ?? t;
|
|
468
|
-
let
|
|
469
|
-
if (
|
|
468
|
+
let r = s._$litPart$;
|
|
469
|
+
if (r === void 0) {
|
|
470
470
|
const o = e?.renderBefore ?? null;
|
|
471
|
-
s._$litPart$ =
|
|
471
|
+
s._$litPart$ = r = new N(t.insertBefore(z(), o), o, void 0, e ?? {});
|
|
472
472
|
}
|
|
473
|
-
return
|
|
473
|
+
return r._$AI(a), r;
|
|
474
474
|
};
|
|
475
475
|
const ht = globalThis;
|
|
476
476
|
class R extends T {
|
|
@@ -483,7 +483,7 @@ class R extends T {
|
|
|
483
483
|
}
|
|
484
484
|
update(t) {
|
|
485
485
|
const e = this.render();
|
|
486
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do =
|
|
486
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = me(e, this.renderRoot, this.renderOptions);
|
|
487
487
|
}
|
|
488
488
|
connectedCallback() {
|
|
489
489
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -492,39 +492,39 @@ class R extends T {
|
|
|
492
492
|
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
493
493
|
}
|
|
494
494
|
render() {
|
|
495
|
-
return
|
|
495
|
+
return C;
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
498
|
R._$litElement$ = !0, R.finalized = !0, ht.litElementHydrateSupport?.({ LitElement: R });
|
|
499
|
-
const
|
|
500
|
-
|
|
499
|
+
const fe = ht.litElementPolyfillSupport;
|
|
500
|
+
fe?.({ LitElement: R });
|
|
501
501
|
(ht.litElementVersions ??= []).push("4.2.2");
|
|
502
|
-
const
|
|
503
|
-
function
|
|
504
|
-
const t = Object.entries(
|
|
502
|
+
const ue = 50;
|
|
503
|
+
function ge(a = {}) {
|
|
504
|
+
const t = Object.entries(a).filter(([, s]) => s != null && s !== "");
|
|
505
505
|
if (!t.length) return "";
|
|
506
506
|
const e = new URLSearchParams();
|
|
507
|
-
return t.forEach(([s,
|
|
507
|
+
return t.forEach(([s, r]) => e.set(s, String(r))), `?${e.toString()}`;
|
|
508
508
|
}
|
|
509
|
-
function
|
|
510
|
-
if (!
|
|
511
|
-
const s =
|
|
509
|
+
function $e({ baseUrl: a, token: t = "", fetchFn: e } = {}) {
|
|
510
|
+
if (!a) throw new Error("createClient requires a baseUrl");
|
|
511
|
+
const s = a.replace(/\/+$/, ""), r = e || ((...n) => fetch(...n));
|
|
512
512
|
async function o(n) {
|
|
513
|
-
const
|
|
514
|
-
t && (
|
|
515
|
-
const p = await
|
|
513
|
+
const c = { Accept: "application/json" };
|
|
514
|
+
t && (c.Authorization = `Bearer ${t}`);
|
|
515
|
+
const p = await r(`${s}${n}`, { headers: c });
|
|
516
516
|
if (!p.ok) {
|
|
517
|
-
const
|
|
518
|
-
throw
|
|
517
|
+
const l = new Error(`api-hsot ${p.status} on ${n}`);
|
|
518
|
+
throw l.status = p.status, l;
|
|
519
519
|
}
|
|
520
520
|
return p.json();
|
|
521
521
|
}
|
|
522
|
-
async function i(n,
|
|
522
|
+
async function i(n, c = {}) {
|
|
523
523
|
const p = [];
|
|
524
|
-
let
|
|
525
|
-
for (let
|
|
526
|
-
const f =
|
|
527
|
-
if (p.push(...u.items || []),
|
|
524
|
+
let l = null;
|
|
525
|
+
for (let h = 0; h < ue; h += 1) {
|
|
526
|
+
const f = ge(l ? { ...c, cursor: l } : c), u = await o(`${n}${f}`);
|
|
527
|
+
if (p.push(...u.items || []), l = u.nextCursor || null, !l) break;
|
|
528
528
|
}
|
|
529
529
|
return { items: p, total: p.length, nextCursor: null };
|
|
530
530
|
}
|
|
@@ -539,7 +539,7 @@ function ge({ baseUrl: r, token: t = "", fetchFn: e } = {}) {
|
|
|
539
539
|
listGames: (n) => i("/games", n),
|
|
540
540
|
getGame: (n) => o(`/games/${n}`),
|
|
541
541
|
listTournaments: (n) => i("/tournaments", n),
|
|
542
|
-
listSeedings: (n,
|
|
542
|
+
listSeedings: (n, c) => i(`/tournaments/${n}/seedings`, c),
|
|
543
543
|
listRankings: (n) => i("/rankings", n),
|
|
544
544
|
listSports: () => o("/sports")
|
|
545
545
|
};
|
|
@@ -560,7 +560,7 @@ class b extends R {
|
|
|
560
560
|
this._client = t, this.isConnected && this.load();
|
|
561
561
|
}
|
|
562
562
|
get client() {
|
|
563
|
-
return this._client ? this._client : this.api ?
|
|
563
|
+
return this._client ? this._client : this.api ? $e({ baseUrl: this.api }) : null;
|
|
564
564
|
}
|
|
565
565
|
connectedCallback() {
|
|
566
566
|
super.connectedCallback(), this._setupInterval();
|
|
@@ -601,13 +601,13 @@ class b extends R {
|
|
|
601
601
|
this._refreshId && (clearInterval(this._refreshId), this._refreshId = null);
|
|
602
602
|
}
|
|
603
603
|
render() {
|
|
604
|
-
return this.error === "not-configured" ?
|
|
604
|
+
return this.error === "not-configured" ? d`<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 ? d`<div class="error">Unable to load right now. <button class="chip" @click=${() => this.load()}>Retry</button></div>` : this.data ? this.renderView() : d`<div class="loading" role="status">Loading…</div>`;
|
|
605
605
|
}
|
|
606
606
|
renderView() {
|
|
607
|
-
return
|
|
607
|
+
return d``;
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
|
-
const g = (
|
|
610
|
+
const g = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), ve = w`
|
|
611
611
|
:host {
|
|
612
612
|
--hsot-red: var(--color-red, #D1232A);
|
|
613
613
|
--hsot-red-deep: var(--color-red-dark, #951C21);
|
|
@@ -641,7 +641,7 @@ const g = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), $e = w`
|
|
|
641
641
|
outline-offset: 1px;
|
|
642
642
|
}
|
|
643
643
|
.mut { color: var(--hsot-gray-5); }
|
|
644
|
-
`,
|
|
644
|
+
`, ye = w`
|
|
645
645
|
.band { background: var(--hsot-white); color: var(--hsot-black); }
|
|
646
646
|
.band .inner { max-width: 1366px; margin: 0 auto; padding: 1.1rem 1.25rem 0; }
|
|
647
647
|
.band h1, .band h2.bandtitle {
|
|
@@ -661,7 +661,7 @@ const g = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), $e = w`
|
|
|
661
661
|
.band nav.tabs a.on { border-bottom-color: var(--hsot-red); }
|
|
662
662
|
.band nav.tabs span.off { color: var(--hsot-gray-4); cursor: not-allowed; }
|
|
663
663
|
@media (max-width: 720px) { .band h1, .band h2.bandtitle { font-size: 1.8rem; } }
|
|
664
|
-
`,
|
|
664
|
+
`, be = w`
|
|
665
665
|
.view { max-width: 1366px; margin: 0 auto; padding: 1.25rem; box-sizing: border-box; }
|
|
666
666
|
.toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0 0 1.1rem; }
|
|
667
667
|
.toolbar .spacer { flex: 1; }
|
|
@@ -704,7 +704,7 @@ const g = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), $e = w`
|
|
|
704
704
|
.error { padding: 1.2rem 1rem; color: var(--hsot-red-deep); font-size: 0.9rem; }
|
|
705
705
|
.note { font-size: 0.8125rem; color: var(--hsot-gray-5); margin: 0.6rem 0 0; }
|
|
706
706
|
.loading { padding: 1.2rem; color: var(--hsot-gray-5); font-family: var(--hsot-heading-font); }
|
|
707
|
-
`,
|
|
707
|
+
`, we = w`
|
|
708
708
|
.pill {
|
|
709
709
|
display: inline-block; font-family: var(--hsot-heading-font); font-weight: 700;
|
|
710
710
|
font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em;
|
|
@@ -719,7 +719,7 @@ const g = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), $e = w`
|
|
|
719
719
|
.pill.champ { background: var(--hsot-straw); color: #6b5900; }
|
|
720
720
|
@keyframes hsot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
|
|
721
721
|
@media (prefers-reduced-motion: reduce) { .pill.live { animation: none; } }
|
|
722
|
-
`,
|
|
722
|
+
`, xe = w`
|
|
723
723
|
.tablewrap { overflow-x: auto; }
|
|
724
724
|
table.data { font-family: var(--hsot-heading-font); font-size: 14px; border-collapse: collapse; width: 100%; }
|
|
725
725
|
table.data th {
|
|
@@ -737,7 +737,7 @@ const g = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), $e = w`
|
|
|
737
737
|
table.data tbody tr.rowlink:hover { background: var(--hsot-gray-1); }
|
|
738
738
|
table.data td.teamcell a { color: inherit; text-decoration: none; font-weight: 500; }
|
|
739
739
|
table.data td.teamcell a:hover { text-decoration: underline; }
|
|
740
|
-
`,
|
|
740
|
+
`, _e = w`
|
|
741
741
|
.swatch {
|
|
742
742
|
display: inline-flex; align-items: center; justify-content: center;
|
|
743
743
|
width: 26px; height: 26px; border-radius: 50%;
|
|
@@ -761,7 +761,7 @@ const g = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), $e = w`
|
|
|
761
761
|
.dot.W { background: var(--hsot-win); }
|
|
762
762
|
.dot.L { background: var(--hsot-loss); }
|
|
763
763
|
.dot.T { background: var(--hsot-tie); }
|
|
764
|
-
`,
|
|
764
|
+
`, ke = w`
|
|
765
765
|
ul.gamelist { list-style: none; margin: 0; padding: 0; }
|
|
766
766
|
.gamelist li {
|
|
767
767
|
display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 1rem;
|
|
@@ -778,52 +778,52 @@ const g = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), $e = w`
|
|
|
778
778
|
.gamelist .opp a:hover { text-decoration: underline; }
|
|
779
779
|
.gamelist .where { color: var(--hsot-gray-5); font-size: 0.78rem; }
|
|
780
780
|
.gamelist a.box { font-size: 0.78rem; }
|
|
781
|
-
`, H = [
|
|
782
|
-
function pt(
|
|
783
|
-
return
|
|
781
|
+
`, H = [ve, ye, be, we, xe, _e, ke];
|
|
782
|
+
function pt(a) {
|
|
783
|
+
return a.state !== "final" ? null : a.forfeit && a.forfeit !== "none" ? a.forfeit : a.homeScore > a.awayScore ? "home" : a.awayScore > a.homeScore ? "away" : a.tiebreakWinner && a.tiebreakWinner !== "none" ? a.tiebreakWinner : "tie";
|
|
784
784
|
}
|
|
785
|
-
function M(
|
|
786
|
-
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]),
|
|
787
|
-
for (const o of
|
|
785
|
+
function M(a, t) {
|
|
786
|
+
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)));
|
|
787
|
+
for (const o of r) {
|
|
788
788
|
const i = pt(o), n = o.gameType === "conference";
|
|
789
|
-
for (const
|
|
790
|
-
const p =
|
|
789
|
+
for (const c of ["home", "away"]) {
|
|
790
|
+
const p = c === "home" ? o.homeTeamId : o.awayTeamId;
|
|
791
791
|
if (!p) continue;
|
|
792
|
-
const
|
|
793
|
-
|
|
792
|
+
const l = s(p), h = c === "home" ? o.homeScore : o.awayScore, f = c === "home" ? o.awayScore : o.homeScore;
|
|
793
|
+
l.pf += h, l.pa += f;
|
|
794
794
|
let u = "T";
|
|
795
|
-
i === "tie" ? (
|
|
795
|
+
i === "tie" ? (l.t += 1, n && (l.ct += 1)) : i === c ? (l.w += 1, n && (l.cw += 1), u = "W") : (l.l += 1, n && (l.cl += 1), u = "L"), l.results.push({ gameId: o.id, date: o.date, mark: u, my: h, their: f, opp: c === "home" ? o.awayTeamId : o.homeTeamId, conf: n });
|
|
796
796
|
}
|
|
797
797
|
}
|
|
798
798
|
return e;
|
|
799
799
|
}
|
|
800
|
-
function
|
|
801
|
-
if (!
|
|
802
|
-
const t =
|
|
800
|
+
function Q(a) {
|
|
801
|
+
if (!a || !a.length) return "";
|
|
802
|
+
const t = a[a.length - 1].mark;
|
|
803
803
|
let e = 0;
|
|
804
|
-
for (let s =
|
|
804
|
+
for (let s = a.length - 1; s >= 0 && a[s].mark === t; s -= 1) e += 1;
|
|
805
805
|
return t + e;
|
|
806
806
|
}
|
|
807
|
-
const
|
|
808
|
-
const s =
|
|
809
|
-
return s ? (
|
|
810
|
-
}, Et = (
|
|
811
|
-
function x(
|
|
812
|
-
if (!
|
|
813
|
-
const e = t ?
|
|
814
|
-
return `${e}-${s}${
|
|
807
|
+
const It = (a, t, e) => {
|
|
808
|
+
const s = a + t + e;
|
|
809
|
+
return s ? (a + e / 2) / s : 0;
|
|
810
|
+
}, Et = (a) => a.toFixed(3).replace("0.", ".");
|
|
811
|
+
function x(a, t = !1) {
|
|
812
|
+
if (!a) return "0-0";
|
|
813
|
+
const e = t ? a.cw : a.w, s = t ? a.cl : a.l, r = t ? a.ct : a.t;
|
|
814
|
+
return `${e}-${s}${r ? `-${r}` : ""}`;
|
|
815
815
|
}
|
|
816
|
-
function
|
|
817
|
-
return
|
|
816
|
+
function Nt(a, t) {
|
|
817
|
+
return a.map((e) => {
|
|
818
818
|
const s = t[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] };
|
|
819
|
-
return { team: e, rec: s, confPct:
|
|
819
|
+
return { team: e, rec: s, confPct: It(s.cw, s.cl, s.ct), overallPct: It(s.w, s.l, s.t) };
|
|
820
820
|
}).sort((e, s) => s.confPct - e.confPct || s.overallPct - e.overallPct || s.rec.pf - s.rec.pa - (e.rec.pf - e.rec.pa));
|
|
821
821
|
}
|
|
822
|
-
function mt(
|
|
823
|
-
return
|
|
822
|
+
function mt(a, t) {
|
|
823
|
+
return a.filter((e) => (e.homeTeamId === t || e.awayTeamId === t) && (e.state === "scheduled" || e.state === "live") && e.gameType !== "scrimmage").sort((e, s) => String(e.date).localeCompare(String(s.date)))[0] || null;
|
|
824
824
|
}
|
|
825
|
-
function Pt(
|
|
826
|
-
const e =
|
|
825
|
+
function Pt(a, t) {
|
|
826
|
+
const e = a[t];
|
|
827
827
|
return e && e.results.length ? e.results[e.results.length - 1] : null;
|
|
828
828
|
}
|
|
829
829
|
const at = {
|
|
@@ -831,136 +831,136 @@ const at = {
|
|
|
831
831
|
school: "/school/{id}/",
|
|
832
832
|
section: "/{sport}/{view}/"
|
|
833
833
|
};
|
|
834
|
-
function $(
|
|
835
|
-
return String(
|
|
834
|
+
function $(a, t) {
|
|
835
|
+
return String(a).replace(/\{(\w+)\}/g, (e, s) => t[s] !== void 0 && t[s] !== null ? String(t[s]) : e);
|
|
836
836
|
}
|
|
837
|
-
function L(
|
|
837
|
+
function L(a) {
|
|
838
838
|
return {
|
|
839
|
-
game:
|
|
840
|
-
school:
|
|
841
|
-
section:
|
|
839
|
+
game: a.getAttribute("game-href") || at.game,
|
|
840
|
+
school: a.getAttribute("school-href") || at.school,
|
|
841
|
+
section: a.getAttribute("section-href") || at.section
|
|
842
842
|
};
|
|
843
843
|
}
|
|
844
|
-
const
|
|
845
|
-
function y(
|
|
846
|
-
if (!
|
|
847
|
-
const [e, s,
|
|
848
|
-
return !e || !s || !
|
|
844
|
+
const J = (a) => a ? a.charAt(0).toUpperCase() + a.slice(1) : "";
|
|
845
|
+
function y(a, t) {
|
|
846
|
+
if (!a) return "TBD";
|
|
847
|
+
const [e, s, r] = String(a).split("-").map(Number);
|
|
848
|
+
return !e || !s || !r ? "TBD" : new Date(e, s - 1, r).toLocaleDateString("en-US", t || { weekday: "short", month: "short", day: "numeric" });
|
|
849
849
|
}
|
|
850
|
-
function X(
|
|
851
|
-
if (!
|
|
852
|
-
const [t, e] = String(
|
|
850
|
+
function X(a) {
|
|
851
|
+
if (!a) return "";
|
|
852
|
+
const [t, e] = String(a).split(":").map(Number);
|
|
853
853
|
if (Number.isNaN(t)) return "";
|
|
854
854
|
const s = t >= 12 ? "PM" : "AM";
|
|
855
855
|
return `${(t + 11) % 12 + 1}:${String(e || 0).padStart(2, "0")} ${s}`;
|
|
856
856
|
}
|
|
857
|
-
function
|
|
858
|
-
return
|
|
857
|
+
function Se(a) {
|
|
858
|
+
return a ? `${Math.floor(a / 12)}-${a % 12}` : "·";
|
|
859
859
|
}
|
|
860
|
-
function tt(
|
|
861
|
-
const t =
|
|
862
|
-
return
|
|
860
|
+
function tt(a = /* @__PURE__ */ new Date()) {
|
|
861
|
+
const t = a.getFullYear();
|
|
862
|
+
return a.getMonth() >= 6 ? `${t}-${t + 1}` : `${t - 1}-${t}`;
|
|
863
863
|
}
|
|
864
|
-
function ot(
|
|
864
|
+
function ot(a = /* @__PURE__ */ new Date()) {
|
|
865
865
|
const t = (e) => String(e).padStart(2, "0");
|
|
866
|
-
return `${
|
|
866
|
+
return `${a.getFullYear()}-${t(a.getMonth() + 1)}-${t(a.getDate())}`;
|
|
867
867
|
}
|
|
868
|
-
function ft(
|
|
869
|
-
return
|
|
868
|
+
function ft(a) {
|
|
869
|
+
return a ? (a.abbr || a.name || "?").slice(0, 4).toUpperCase() : "?";
|
|
870
870
|
}
|
|
871
|
-
function
|
|
872
|
-
if (!
|
|
873
|
-
const t = parseInt(
|
|
874
|
-
return 0.299 * e + 0.587 * s + 0.114 *
|
|
871
|
+
function V(a) {
|
|
872
|
+
if (!a || !/^#[0-9a-fA-F]{6}$/.test(a)) return "#FFFFFF";
|
|
873
|
+
const t = parseInt(a.slice(1), 16), e = t >> 16 & 255, s = t >> 8 & 255, r = t & 255;
|
|
874
|
+
return 0.299 * e + 0.587 * s + 0.114 * r > 150 ? "#0F1B33" : "#FFFFFF";
|
|
875
875
|
}
|
|
876
|
-
const
|
|
877
|
-
const t = ["th", "st", "nd", "rd"], e =
|
|
878
|
-
return
|
|
876
|
+
const Ae = (a) => {
|
|
877
|
+
const t = ["th", "st", "nd", "rd"], e = a % 100;
|
|
878
|
+
return a + (t[(e - 20) % 10] || t[e] || t[0]);
|
|
879
879
|
};
|
|
880
|
-
function
|
|
881
|
-
if (
|
|
882
|
-
if (
|
|
880
|
+
function Te(a) {
|
|
881
|
+
if (a.state === "live") return { kind: "live", label: `Live · ${a.period || ""}`.replace(/ · $/, "") };
|
|
882
|
+
if (a.state === "final") {
|
|
883
883
|
const t = [];
|
|
884
|
-
return
|
|
884
|
+
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(" · ")}` : ""}` };
|
|
885
885
|
}
|
|
886
|
-
return
|
|
886
|
+
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" })} · ${X(a.time)}`.replace(/ · $/, "") };
|
|
887
887
|
}
|
|
888
|
-
function Ht(
|
|
888
|
+
function Ht(a, t, e, s, r) {
|
|
889
889
|
const o = t[e];
|
|
890
890
|
if (!o) return null;
|
|
891
891
|
const i = /* @__PURE__ */ new Map();
|
|
892
|
-
for (const
|
|
893
|
-
if (
|
|
894
|
-
const p =
|
|
895
|
-
(!
|
|
892
|
+
for (const c of a || []) {
|
|
893
|
+
if (c.sport !== s || r && c.effectiveDate > r || c.gender && o.gender !== c.gender && o.gender !== "coed") continue;
|
|
894
|
+
const p = c.gender || "", l = i.get(p);
|
|
895
|
+
(!l || c.effectiveDate > l.effectiveDate) && i.set(p, c);
|
|
896
896
|
}
|
|
897
897
|
let n = null;
|
|
898
|
-
for (const
|
|
899
|
-
const p = (
|
|
900
|
-
p !== -1 && (!n ||
|
|
898
|
+
for (const c of i.values()) {
|
|
899
|
+
const p = (c.teamIds || []).indexOf(e);
|
|
900
|
+
p !== -1 && (!n || c.effectiveDate > n.effectiveDate) && (n = { poll: c, rank: p + 1 });
|
|
901
901
|
}
|
|
902
902
|
return n ? n.rank : null;
|
|
903
903
|
}
|
|
904
|
-
function
|
|
905
|
-
if (!
|
|
906
|
-
const s = (
|
|
904
|
+
function Ce(a, t, e) {
|
|
905
|
+
if (!a) return { kind: "none", delta: 0 };
|
|
906
|
+
const s = (a.teamIds || []).indexOf(e) + 1;
|
|
907
907
|
if (!s) return { kind: "none", delta: 0 };
|
|
908
908
|
if (!t) return { kind: "same", delta: 0 };
|
|
909
|
-
const
|
|
910
|
-
if (!
|
|
911
|
-
const o =
|
|
909
|
+
const r = (t.teamIds || []).indexOf(e) + 1;
|
|
910
|
+
if (!r) return { kind: "new", delta: 0 };
|
|
911
|
+
const o = r - s;
|
|
912
912
|
return o > 0 ? { kind: "up", delta: o } : o < 0 ? { kind: "down", delta: -o } : { kind: "same", delta: 0 };
|
|
913
913
|
}
|
|
914
|
-
function Ie(
|
|
915
|
-
return /^https?:\/\//i.test(String(
|
|
914
|
+
function Ie(a) {
|
|
915
|
+
return /^https?:\/\//i.test(String(a || ""));
|
|
916
916
|
}
|
|
917
|
-
function
|
|
918
|
-
const e =
|
|
917
|
+
function G(a, t) {
|
|
918
|
+
const e = a?.logoAssetId;
|
|
919
919
|
if (!Ie(e)) return "";
|
|
920
|
-
const s = Math.max(1, Math.round(t * 2)),
|
|
921
|
-
return `${e}${
|
|
920
|
+
const s = Math.max(1, Math.round(t * 2)), r = e.includes("?") ? "&" : "?";
|
|
921
|
+
return `${e}${r}w=${s}&h=${s}&f=webp`;
|
|
922
922
|
}
|
|
923
|
-
const
|
|
924
|
-
const e =
|
|
925
|
-
return e ?
|
|
926
|
-
}, P = (
|
|
927
|
-
function
|
|
928
|
-
if (!
|
|
929
|
-
const e =
|
|
923
|
+
const O = (a, t) => {
|
|
924
|
+
const e = a.teamsById[t];
|
|
925
|
+
return e ? a.schoolsById[e.schoolId] : null;
|
|
926
|
+
}, P = (a, t) => O(a, t)?.name || "TBD", q = (a, t) => O(a, t)?.abbr || "TBD";
|
|
927
|
+
function F(a, t = 26) {
|
|
928
|
+
if (!a) return m;
|
|
929
|
+
const e = G(a, t);
|
|
930
930
|
if (e)
|
|
931
|
-
return
|
|
931
|
+
return d`<img class="swatch logo" aria-hidden="true" alt="" loading="lazy"
|
|
932
932
|
src=${e} style="width:${t}px;height:${t}px" />`;
|
|
933
|
-
const s =
|
|
934
|
-
return
|
|
935
|
-
style="width:${t}px;height:${t}px;background:${s};color:${
|
|
936
|
-
>${ft(
|
|
933
|
+
const s = a.colorPrimary || "#030711", r = V(s);
|
|
934
|
+
return d`<span class="swatch" aria-hidden="true"
|
|
935
|
+
style="width:${t}px;height:${t}px;background:${s};color:${r};font-size:${Math.max(8, t * 0.28)}px"
|
|
936
|
+
>${ft(a)}</span>`;
|
|
937
937
|
}
|
|
938
|
-
function ut(
|
|
939
|
-
const s = Ht(
|
|
940
|
-
return s ?
|
|
938
|
+
function ut(a, t, e) {
|
|
939
|
+
const s = Ht(a.rankings, a.teamsById, t, a.sport, e);
|
|
940
|
+
return s ? d`<span class="rankbadge">#${s}</span>` : m;
|
|
941
941
|
}
|
|
942
|
-
function it(
|
|
943
|
-
const s =
|
|
944
|
-
return s ?
|
|
942
|
+
function it(a, t, e) {
|
|
943
|
+
const s = O(a, t);
|
|
944
|
+
return s ? d`${ut(a, t, e)}<a href=${$(a.hrefs.school, { id: s.id })}>${s.name}</a>` : d`<span class="mut">TBD</span>`;
|
|
945
945
|
}
|
|
946
|
-
function gt(
|
|
947
|
-
const s =
|
|
948
|
-
if (!s || !s.results.length) return
|
|
949
|
-
const
|
|
950
|
-
return
|
|
951
|
-
${
|
|
952
|
-
title="${o.mark} ${o.my}-${o.their} vs ${P(
|
|
953
|
-
href=${$(
|
|
946
|
+
function gt(a, t, e = 5) {
|
|
947
|
+
const s = a.records[t];
|
|
948
|
+
if (!s || !s.results.length) return d`<span class="mut">·</span>`;
|
|
949
|
+
const r = s.results.slice(-1 * e);
|
|
950
|
+
return d`<span class="dots" role="img" aria-label="last ${r.length} results">
|
|
951
|
+
${r.map((o) => d`<a class="dot ${o.mark}"
|
|
952
|
+
title="${o.mark} ${o.my}-${o.their} vs ${P(a, o.opp)}"
|
|
953
|
+
href=${$(a.hrefs.game, { sport: a.sport, id: o.gameId })}>${o.mark}</a>`)}
|
|
954
954
|
</span>`;
|
|
955
955
|
}
|
|
956
|
-
function Y(
|
|
957
|
-
const t =
|
|
958
|
-
return
|
|
956
|
+
function Y(a) {
|
|
957
|
+
const t = Te(a);
|
|
958
|
+
return d`<span class="pill ${t.kind}">${t.label}</span>`;
|
|
959
959
|
}
|
|
960
|
-
function Mt(
|
|
961
|
-
if (!t) return
|
|
962
|
-
const s = t.homeTeamId === e ? t.awayTeamId : t.homeTeamId,
|
|
963
|
-
return
|
|
960
|
+
function Mt(a, t, e) {
|
|
961
|
+
if (!t) return d`<span class="mut">·</span>`;
|
|
962
|
+
const s = t.homeTeamId === e ? t.awayTeamId : t.homeTeamId, r = t.homeTeamId === e ? "vs" : "at";
|
|
963
|
+
return d`${t.state === "live" ? d`<span class="pill live">Live</span> ` : d`${y(t.date, { month: "numeric", day: "numeric" })} `}${r} ${q(a, s)}`;
|
|
964
964
|
}
|
|
965
965
|
class Lt extends b {
|
|
966
966
|
static styles = H;
|
|
@@ -980,7 +980,7 @@ class Lt extends b {
|
|
|
980
980
|
}
|
|
981
981
|
}
|
|
982
982
|
async fetchData(t) {
|
|
983
|
-
const e = this.season || tt(), [s,
|
|
983
|
+
const e = this.season || tt(), [s, r, o, i, n] = await Promise.all([
|
|
984
984
|
t.listSchools(),
|
|
985
985
|
t.listTeams({ sport: this.sport }),
|
|
986
986
|
t.listConferences(),
|
|
@@ -990,7 +990,7 @@ class Lt extends b {
|
|
|
990
990
|
return {
|
|
991
991
|
season: e,
|
|
992
992
|
schools: s.items,
|
|
993
|
-
teams:
|
|
993
|
+
teams: r.items,
|
|
994
994
|
conferences: o.items,
|
|
995
995
|
games: i.items,
|
|
996
996
|
rankings: n.items
|
|
@@ -1007,15 +1007,15 @@ class Lt extends b {
|
|
|
1007
1007
|
}, this._ctxData = this.data), this._ctx;
|
|
1008
1008
|
}
|
|
1009
1009
|
renderView() {
|
|
1010
|
-
const t = this.ctx, e = g(this.data.conferences), s = [...new Set(this.data.games.map((i) => i.date).filter(Boolean))].sort(),
|
|
1011
|
-
return
|
|
1010
|
+
const t = this.ctx, e = g(this.data.conferences), s = [...new Set(this.data.games.map((i) => i.date).filter(Boolean))].sort(), r = this.data.games.filter((i) => i.date === this.date).sort((i, n) => (i.state === "live" ? -1 : 1) - (n.state === "live" ? -1 : 1)), o = /* @__PURE__ */ new Map();
|
|
1011
|
+
return r.forEach((i) => {
|
|
1012
1012
|
const n = i.gameType === "conference" && i.conferenceId ? e[i.conferenceId]?.name || "Conference" : i.gameType === "playoff" ? "Playoffs" : i.gameType === "scrimmage" ? "Scrimmages" : "Nonconference";
|
|
1013
1013
|
o.has(n) || o.set(n, []), o.get(n).push(i);
|
|
1014
|
-
}),
|
|
1014
|
+
}), d`
|
|
1015
1015
|
<div class="band">
|
|
1016
1016
|
<div class="inner">
|
|
1017
|
-
<h1>${
|
|
1018
|
-
<p class="sub">${y(this.date, { weekday: "long", month: "long", day: "numeric", year: "numeric" })} · ${
|
|
1017
|
+
<h1>${J(this.sport)} scores & schedules</h1>
|
|
1018
|
+
<p class="sub">${y(this.date, { weekday: "long", month: "long", day: "numeric", year: "numeric" })} · ${r.length} games</p>
|
|
1019
1019
|
</div>
|
|
1020
1020
|
</div>
|
|
1021
1021
|
<div class="view">
|
|
@@ -1024,7 +1024,7 @@ class Lt extends b {
|
|
|
1024
1024
|
<select id="datesel" @change=${(i) => {
|
|
1025
1025
|
this.date = i.target.value;
|
|
1026
1026
|
}}>
|
|
1027
|
-
${s.map((i) =>
|
|
1027
|
+
${s.map((i) => d`<option value=${i} ?selected=${i === this.date}>
|
|
1028
1028
|
${y(i, { weekday: "short", month: "short", day: "numeric" })}${i === ot() ? " · today" : ""}
|
|
1029
1029
|
</option>`)}
|
|
1030
1030
|
</select>
|
|
@@ -1039,11 +1039,11 @@ class Lt extends b {
|
|
|
1039
1039
|
<span class="spacer"></span>
|
|
1040
1040
|
<span class="asof">Live games first · report a score to see it update here</span>
|
|
1041
1041
|
</div>
|
|
1042
|
-
${
|
|
1043
|
-
${[...o.entries()].map(([i, n]) =>
|
|
1042
|
+
${r.length ? m : d`<p class="empty">No ${this.sport} games on this date.</p>`}
|
|
1043
|
+
${[...o.entries()].map(([i, n]) => d`
|
|
1044
1044
|
<div class="section-title">${i}</div>
|
|
1045
1045
|
<div class="card"><ul class="gamelist">
|
|
1046
|
-
${n.map((
|
|
1046
|
+
${n.map((c) => this.renderGame(t, c))}
|
|
1047
1047
|
</ul></div>
|
|
1048
1048
|
`)}
|
|
1049
1049
|
</div>
|
|
@@ -1051,13 +1051,13 @@ class Lt extends b {
|
|
|
1051
1051
|
}
|
|
1052
1052
|
renderGame(t, e) {
|
|
1053
1053
|
const s = e.state === "final" || e.state === "live" ? `${e.awayScore}-${e.homeScore}` : X(e.time);
|
|
1054
|
-
return
|
|
1054
|
+
return d`
|
|
1055
1055
|
<li>
|
|
1056
1056
|
${Y(e)}
|
|
1057
1057
|
<span class="opp">${it(t, e.awayTeamId, e.date)} at ${it(t, e.homeTeamId, e.date)}</span>
|
|
1058
1058
|
<span class="res" style="width:auto">${s}</span>
|
|
1059
1059
|
<span class="where">${e.venue || ""}</span>
|
|
1060
|
-
${e.broadcast ?
|
|
1060
|
+
${e.broadcast ? d`<span class="pill class">${e.broadcast}</span>` : m}
|
|
1061
1061
|
<a class="box" href=${$(t.hrefs.game, { sport: this.sport, id: e.id })}>Box score →</a>
|
|
1062
1062
|
</li>
|
|
1063
1063
|
`;
|
|
@@ -1077,7 +1077,7 @@ class jt extends b {
|
|
|
1077
1077
|
super(), this.sport = "football", this.season = "", this.classFilter = "All", this.query = "";
|
|
1078
1078
|
}
|
|
1079
1079
|
async fetchData(t) {
|
|
1080
|
-
const e = this.season || tt(), [s,
|
|
1080
|
+
const e = this.season || tt(), [s, r, o, i, n] = await Promise.all([
|
|
1081
1081
|
t.listConferences({ active: !0 }),
|
|
1082
1082
|
t.listSchools(),
|
|
1083
1083
|
t.listTeams({ sport: this.sport }),
|
|
@@ -1087,7 +1087,7 @@ class jt extends b {
|
|
|
1087
1087
|
return {
|
|
1088
1088
|
season: e,
|
|
1089
1089
|
conferences: s.items,
|
|
1090
|
-
schools:
|
|
1090
|
+
schools: r.items,
|
|
1091
1091
|
teams: o.items,
|
|
1092
1092
|
games: i.items,
|
|
1093
1093
|
rankings: n.items
|
|
@@ -1104,42 +1104,42 @@ class jt extends b {
|
|
|
1104
1104
|
}, this._ctxData = this.data), this._ctx;
|
|
1105
1105
|
}
|
|
1106
1106
|
renderView() {
|
|
1107
|
-
const t = this.ctx, e = ["All", ...new Set(this.data.conferences.flatMap((
|
|
1108
|
-
return
|
|
1107
|
+
const t = this.ctx, e = ["All", ...new Set(this.data.conferences.flatMap((r) => r.classifications || []))].slice(0, 9), s = this.data.conferences.filter((r) => r.active !== !1).filter((r) => this.classFilter === "All" || (r.classifications || []).includes(this.classFilter));
|
|
1108
|
+
return d`
|
|
1109
1109
|
<div class="band">
|
|
1110
1110
|
<div class="inner">
|
|
1111
|
-
<h1>${
|
|
1111
|
+
<h1>${J(this.sport)} standings</h1>
|
|
1112
1112
|
<p class="sub">${this.data.season} season · every conference, computed live from reported results</p>
|
|
1113
1113
|
</div>
|
|
1114
1114
|
</div>
|
|
1115
1115
|
<div class="view">
|
|
1116
1116
|
<div class="toolbar">
|
|
1117
1117
|
<div role="group" aria-label="Classification filter">
|
|
1118
|
-
${e.map((
|
|
1118
|
+
${e.map((r) => d`<button class="chip ${this.classFilter === r ? "on" : ""}"
|
|
1119
1119
|
@click=${() => {
|
|
1120
|
-
this.classFilter =
|
|
1121
|
-
}}>${
|
|
1120
|
+
this.classFilter = r;
|
|
1121
|
+
}}>${r}</button>`)}
|
|
1122
1122
|
</div>
|
|
1123
1123
|
<input type="search" placeholder="Find a school…" aria-label="Find a school"
|
|
1124
|
-
.value=${this.query} @input=${(
|
|
1125
|
-
this.query =
|
|
1124
|
+
.value=${this.query} @input=${(r) => {
|
|
1125
|
+
this.query = r.target.value;
|
|
1126
1126
|
}}>
|
|
1127
1127
|
<span class="spacer"></span>
|
|
1128
1128
|
<span class="asof">Records through ${y(ot(), { month: "long", day: "numeric" })} · conference games count toward both records · scrimmages toward neither</span>
|
|
1129
1129
|
</div>
|
|
1130
|
-
${s.map((
|
|
1130
|
+
${s.map((r) => this.renderConference(t, r))}
|
|
1131
1131
|
</div>
|
|
1132
1132
|
`;
|
|
1133
1133
|
}
|
|
1134
1134
|
renderConference(t, e) {
|
|
1135
1135
|
const s = this.data.teams.filter((i) => i.conferenceId === e.id);
|
|
1136
1136
|
if (!s.length) return m;
|
|
1137
|
-
const
|
|
1138
|
-
return
|
|
1137
|
+
const r = this.query.trim().toLowerCase(), o = Nt(s, t.records);
|
|
1138
|
+
return d`
|
|
1139
1139
|
<div class="card">
|
|
1140
1140
|
<div class="card-head">
|
|
1141
1141
|
<h2>${e.name}</h2>
|
|
1142
|
-
${(e.classifications || []).map((i) =>
|
|
1142
|
+
${(e.classifications || []).map((i) => d`<span class="pill class">${i}</span>`)}
|
|
1143
1143
|
<span class="meta">${o.length} teams · membership derives from teams</span>
|
|
1144
1144
|
</div>
|
|
1145
1145
|
<div class="tablewrap"><table class="data">
|
|
@@ -1149,26 +1149,26 @@ class jt extends b {
|
|
|
1149
1149
|
<th>Streak</th><th>Last 5</th><th>Next</th>
|
|
1150
1150
|
</tr></thead>
|
|
1151
1151
|
<tbody>
|
|
1152
|
-
${o.map((i, n) => this.renderRow(t, i, n,
|
|
1152
|
+
${o.map((i, n) => this.renderRow(t, i, n, r))}
|
|
1153
1153
|
</tbody>
|
|
1154
1154
|
</table></div>
|
|
1155
1155
|
</div>
|
|
1156
1156
|
`;
|
|
1157
1157
|
}
|
|
1158
|
-
renderRow(t, e, s,
|
|
1158
|
+
renderRow(t, e, s, r) {
|
|
1159
1159
|
const o = t.schoolsById[e.team.schoolId], i = o?.name || e.team.name || "TBD";
|
|
1160
|
-
if (
|
|
1161
|
-
const n = e.rec.pf - e.rec.pa,
|
|
1162
|
-
<span class="pill champ" title="${
|
|
1160
|
+
if (r && !i.toLowerCase().includes(r)) return m;
|
|
1161
|
+
const n = e.rec.pf - e.rec.pa, c = mt(this.data.games, e.team.id), p = (e.team.championships || []).map((h) => d`
|
|
1162
|
+
<span class="pill champ" title="${h.season} ${h.title} champion">★ ${h.season} ${h.title}</span>`), l = () => {
|
|
1163
1163
|
location.href = $(t.hrefs.school, { id: e.team.schoolId });
|
|
1164
1164
|
};
|
|
1165
|
-
return
|
|
1166
|
-
<tr class="rowlink" @click=${(
|
|
1167
|
-
|
|
1165
|
+
return d`
|
|
1166
|
+
<tr class="rowlink" @click=${(h) => {
|
|
1167
|
+
h.target.closest("a") || l();
|
|
1168
1168
|
}}>
|
|
1169
1169
|
<td class="mut">${s + 1}</td>
|
|
1170
1170
|
<td class="teamcell">
|
|
1171
|
-
${
|
|
1171
|
+
${F(o)}${ut(t, e.team.id, null)}
|
|
1172
1172
|
<a href=${$(t.hrefs.school, { id: e.team.schoolId })}>${i}</a> ${p}
|
|
1173
1173
|
</td>
|
|
1174
1174
|
<td class="num">${x(e.rec, !0)}</td>
|
|
@@ -1178,15 +1178,15 @@ class jt extends b {
|
|
|
1178
1178
|
<td class="num">${e.rec.pf}</td>
|
|
1179
1179
|
<td class="num">${e.rec.pa}</td>
|
|
1180
1180
|
<td class="num" style="color:${n >= 0 ? "var(--hsot-win)" : "var(--hsot-loss)"}">${n > 0 ? "+" : ""}${n}</td>
|
|
1181
|
-
<td>${
|
|
1181
|
+
<td>${Q(e.rec.results) || "·"}</td>
|
|
1182
1182
|
<td>${gt(t, e.team.id)}</td>
|
|
1183
|
-
<td>${Mt(t,
|
|
1183
|
+
<td>${Mt(t, c, e.team.id)}</td>
|
|
1184
1184
|
</tr>
|
|
1185
1185
|
`;
|
|
1186
1186
|
}
|
|
1187
1187
|
}
|
|
1188
1188
|
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings", jt);
|
|
1189
|
-
const
|
|
1189
|
+
const Ee = w`
|
|
1190
1190
|
.hero1 {
|
|
1191
1191
|
border-radius: var(--hsot-radius-md); color: var(--hsot-white);
|
|
1192
1192
|
padding: 1.3rem 1.4rem; display: flex; align-items: center; gap: 1.2rem;
|
|
@@ -1203,8 +1203,8 @@ const Ce = w`
|
|
|
1203
1203
|
.delta.new { background: var(--hsot-straw); color: #6b5900; border-radius: var(--hsot-radius-xs); padding: 0.1rem 0.3rem; font-size: 0.7rem; }
|
|
1204
1204
|
.sparkline { vertical-align: middle; }
|
|
1205
1205
|
`;
|
|
1206
|
-
class
|
|
1207
|
-
static styles = [...H,
|
|
1206
|
+
class Wt extends b {
|
|
1207
|
+
static styles = [...H, Ee];
|
|
1208
1208
|
static properties = {
|
|
1209
1209
|
...b.properties,
|
|
1210
1210
|
sport: { type: String },
|
|
@@ -1221,17 +1221,17 @@ class Gt extends b {
|
|
|
1221
1221
|
t && (this.pollDate = t);
|
|
1222
1222
|
}
|
|
1223
1223
|
async fetchData(t) {
|
|
1224
|
-
const e = this.season || tt(), [s,
|
|
1224
|
+
const e = this.season || tt(), [s, r, o, i, n] = await Promise.all([
|
|
1225
1225
|
t.listRankings({ sport: this.sport, ...this.gender ? { gender: this.gender } : {} }),
|
|
1226
1226
|
t.listSchools(),
|
|
1227
1227
|
t.listTeams({ sport: this.sport }),
|
|
1228
1228
|
t.listConferences(),
|
|
1229
1229
|
t.listGames({ sport: this.sport, season: e })
|
|
1230
|
-
]),
|
|
1230
|
+
]), c = s.items.filter((p) => !this.gender || !p.gender || p.gender === this.gender).sort((p, l) => l.effectiveDate.localeCompare(p.effectiveDate));
|
|
1231
1231
|
return {
|
|
1232
1232
|
season: e,
|
|
1233
|
-
polls:
|
|
1234
|
-
schools:
|
|
1233
|
+
polls: c,
|
|
1234
|
+
schools: r.items,
|
|
1235
1235
|
teams: o.items,
|
|
1236
1236
|
conferences: i.items,
|
|
1237
1237
|
games: n.items
|
|
@@ -1248,46 +1248,46 @@ class Gt extends b {
|
|
|
1248
1248
|
}, this._ctxData = this.data), this._ctx;
|
|
1249
1249
|
}
|
|
1250
1250
|
sparkline(t, e, s) {
|
|
1251
|
-
const n = e.map((
|
|
1252
|
-
const u = (
|
|
1251
|
+
const n = e.map((h, f) => {
|
|
1252
|
+
const u = (h.teamIds || []).indexOf(t);
|
|
1253
1253
|
if (u === -1) return null;
|
|
1254
1254
|
const v = e.length === 1 ? 96 / 2 : f / (e.length - 1) * 90 + 3, et = 3 + u / 24 * 20;
|
|
1255
1255
|
return { x: v, y: et };
|
|
1256
|
-
}),
|
|
1256
|
+
}), c = [];
|
|
1257
1257
|
let p = [];
|
|
1258
|
-
if (n.forEach((
|
|
1259
|
-
|
|
1260
|
-
}), p.length &&
|
|
1261
|
-
const
|
|
1262
|
-
return
|
|
1263
|
-
${
|
|
1264
|
-
points=${
|
|
1265
|
-
${
|
|
1258
|
+
if (n.forEach((h) => {
|
|
1259
|
+
h ? p.push(h) : p.length && (c.push(p), p = []);
|
|
1260
|
+
}), p.length && c.push(p), !c.length) return m;
|
|
1261
|
+
const l = n[s];
|
|
1262
|
+
return d`<svg class="sparkline" width=${96} height=${26} viewBox="0 0 ${96} ${26}" role="img" aria-label="rank history">
|
|
1263
|
+
${c.map((h) => Tt`<polyline fill="none" stroke="var(--hsot-red)" stroke-width="2"
|
|
1264
|
+
points=${h.map((f) => `${f.x.toFixed(1)},${f.y.toFixed(1)}`).join(" ")}></polyline>`)}
|
|
1265
|
+
${l ? Tt`<circle cx=${l.x.toFixed(1)} cy=${l.y.toFixed(1)} r="3" fill="var(--hsot-black)"></circle>` : m}
|
|
1266
1266
|
</svg>`;
|
|
1267
1267
|
}
|
|
1268
1268
|
movement(t, e, s) {
|
|
1269
|
-
const
|
|
1270
|
-
return
|
|
1269
|
+
const r = Ce(t, e, s);
|
|
1270
|
+
return r.kind === "up" ? d`<span class="delta up">▲ ${r.delta}</span>` : r.kind === "down" ? d`<span class="delta down">▼ ${r.delta}</span>` : r.kind === "new" ? d`<span class="delta new">NEW</span>` : r.kind === "same" ? d`<span class="delta same">—</span>` : d`<span class="delta same">·</span>`;
|
|
1271
1271
|
}
|
|
1272
1272
|
renderView() {
|
|
1273
1273
|
const t = this.ctx, e = this.data.polls;
|
|
1274
|
-
if (!e.length) return
|
|
1275
|
-
const s = Math.max(0, e.findIndex((
|
|
1276
|
-
return
|
|
1274
|
+
if (!e.length) return d`<div class="view"><p class="empty">No ${this.sport} polls published yet this season.</p></div>`;
|
|
1275
|
+
const s = Math.max(0, e.findIndex((h) => h.effectiveDate === this.pollDate)), r = e[s] || e[0], o = e[s + 1] || null, i = e.slice().reverse(), n = i.indexOf(r), c = g(this.data.conferences), p = (r.teamIds || [])[0], l = p ? O(t, p) : null;
|
|
1276
|
+
return d`
|
|
1277
1277
|
<div class="band">
|
|
1278
1278
|
<div class="inner">
|
|
1279
|
-
<h1>${
|
|
1279
|
+
<h1>${J(this.sport)} Top 25</h1>
|
|
1280
1280
|
<p class="sub">The HighSchoolOT poll · updated weekly · ${e.length} polls this season</p>
|
|
1281
1281
|
</div>
|
|
1282
1282
|
</div>
|
|
1283
1283
|
<div class="view">
|
|
1284
1284
|
<div class="toolbar">
|
|
1285
1285
|
<label class="asof" for="pollsel">Poll of</label>
|
|
1286
|
-
<select id="pollsel" @change=${(
|
|
1287
|
-
this.pollDate =
|
|
1286
|
+
<select id="pollsel" @change=${(h) => {
|
|
1287
|
+
this.pollDate = h.target.value;
|
|
1288
1288
|
}}>
|
|
1289
|
-
${e.map((
|
|
1290
|
-
${y(
|
|
1289
|
+
${e.map((h, f) => d`<option value=${h.effectiveDate} ?selected=${h === r}>
|
|
1290
|
+
${y(h.effectiveDate, { month: "long", day: "numeric", year: "numeric" })}${f === 0 ? " · current" : ""}
|
|
1291
1291
|
</option>`)}
|
|
1292
1292
|
</select>
|
|
1293
1293
|
<button class="chip" ?disabled=${s >= e.length - 1}
|
|
@@ -1301,65 +1301,65 @@ class Gt extends b {
|
|
|
1301
1301
|
<span class="spacer"></span>
|
|
1302
1302
|
<span class="asof">Movement vs. the previous poll · sparkline = season rank history</span>
|
|
1303
1303
|
</div>
|
|
1304
|
-
${
|
|
1304
|
+
${l ? this.renderHero(t, r, o, p, l, c) : m}
|
|
1305
1305
|
<div class="card"><div class="tablewrap"><table class="data">
|
|
1306
1306
|
<thead><tr>
|
|
1307
1307
|
<th class="num">Rk</th><th>Mvmt</th><th>Team</th><th class="num">Record</th>
|
|
1308
1308
|
<th>Conference</th><th>Last result</th><th>Next</th><th>Season</th>
|
|
1309
1309
|
</tr></thead>
|
|
1310
1310
|
<tbody>
|
|
1311
|
-
${(
|
|
1311
|
+
${(r.teamIds || []).map((h, f) => f === 0 || !h ? m : this.renderRow(t, r, o, i, n, c, h, f + 1))}
|
|
1312
1312
|
</tbody>
|
|
1313
1313
|
</table></div></div>
|
|
1314
1314
|
<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>
|
|
1315
1315
|
</div>
|
|
1316
1316
|
`;
|
|
1317
1317
|
}
|
|
1318
|
-
renderHero(t, e, s,
|
|
1319
|
-
const n = t.records[
|
|
1320
|
-
return
|
|
1321
|
-
<div class="hero1" style="background:${
|
|
1318
|
+
renderHero(t, e, s, r, o, i) {
|
|
1319
|
+
const n = t.records[r], c = Pt(t.records, r), p = i[t.teamsById[r]?.conferenceId], l = `linear-gradient(120deg, ${o.colorPrimary || "#030711"} 0%, var(--hsot-black) 85%)`;
|
|
1320
|
+
return d`
|
|
1321
|
+
<div class="hero1" style="background:${l}">
|
|
1322
1322
|
<div class="bigrank">#1</div>
|
|
1323
|
-
${
|
|
1323
|
+
${F(o, 64)}
|
|
1324
1324
|
<div>
|
|
1325
1325
|
<h2><a href=${$(t.hrefs.school, { id: o.id })}>${o.name} ${o.mascot || ""}</a></h2>
|
|
1326
1326
|
<div class="facts">
|
|
1327
|
-
${x(n)} overall${p ?
|
|
1328
|
-
· streak ${
|
|
1329
|
-
${
|
|
1330
|
-
${this.movement(e, s,
|
|
1327
|
+
${x(n)} overall${p ? d` · ${x(n, !0)} ${p.name}` : m}
|
|
1328
|
+
· streak ${Q(n?.results) || "·"}
|
|
1329
|
+
${c ? d` · last: ${c.mark} ${c.my}-${c.their} vs ${q(t, c.opp)}` : m}
|
|
1330
|
+
${this.movement(e, s, r)}
|
|
1331
1331
|
</div>
|
|
1332
1332
|
</div>
|
|
1333
1333
|
</div>
|
|
1334
1334
|
`;
|
|
1335
1335
|
}
|
|
1336
|
-
renderRow(t, e, s,
|
|
1337
|
-
const p =
|
|
1336
|
+
renderRow(t, e, s, r, o, i, n, c) {
|
|
1337
|
+
const p = O(t, n);
|
|
1338
1338
|
if (!p) return m;
|
|
1339
|
-
const
|
|
1339
|
+
const l = t.records[n], h = Pt(t.records, n), f = mt(this.data.games, n), u = i[t.teamsById[n]?.conferenceId], v = () => {
|
|
1340
1340
|
location.href = $(t.hrefs.school, { id: p.id });
|
|
1341
1341
|
};
|
|
1342
|
-
return
|
|
1342
|
+
return d`
|
|
1343
1343
|
<tr class="rowlink" @click=${(et) => {
|
|
1344
1344
|
et.target.closest("a") || v();
|
|
1345
1345
|
}}>
|
|
1346
|
-
<td class="num" style="font-weight:700">${
|
|
1346
|
+
<td class="num" style="font-weight:700">${c}</td>
|
|
1347
1347
|
<td>${this.movement(e, s, n)}</td>
|
|
1348
|
-
<td class="teamcell">${
|
|
1348
|
+
<td class="teamcell">${F(p)}<a href=${$(t.hrefs.school, { id: p.id })}>${p.name}</a>
|
|
1349
1349
|
<span class="mut" style="font-size:0.78rem">${p.mascot || ""}</span></td>
|
|
1350
|
-
<td class="num">${x(
|
|
1350
|
+
<td class="num">${x(l)}</td>
|
|
1351
1351
|
<td class="mut">${u?.name || "Independent"}</td>
|
|
1352
|
-
<td>${
|
|
1353
|
-
<b style="color:${
|
|
1354
|
-
${
|
|
1352
|
+
<td>${h ? d`<a class="box" style="text-decoration:none" href=${$(t.hrefs.game, { sport: this.sport, id: h.gameId })}>
|
|
1353
|
+
<b style="color:${h.mark === "W" ? "var(--hsot-win)" : h.mark === "L" ? "var(--hsot-loss)" : "var(--hsot-tie)"}">${h.mark}</b>
|
|
1354
|
+
${h.my}-${h.their} vs ${q(t, h.opp)}</a>` : d`<span class="mut">·</span>`}</td>
|
|
1355
1355
|
<td>${Mt(t, f, n)}</td>
|
|
1356
|
-
<td>${this.sparkline(n,
|
|
1356
|
+
<td>${this.sparkline(n, r, o)}</td>
|
|
1357
1357
|
</tr>
|
|
1358
1358
|
`;
|
|
1359
1359
|
}
|
|
1360
1360
|
}
|
|
1361
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings",
|
|
1362
|
-
const
|
|
1361
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings", Wt);
|
|
1362
|
+
const Pe = w`
|
|
1363
1363
|
.schoolhero { color: var(--hsot-white); padding: 1.6rem 1.25rem 1.3rem; }
|
|
1364
1364
|
.schoolhero .inner { max-width: 1366px; margin: 0 auto; display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
|
|
1365
1365
|
.schoolhero .crest {
|
|
@@ -1384,8 +1384,8 @@ const Ee = w`
|
|
|
1384
1384
|
.cols { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 1.25rem; }
|
|
1385
1385
|
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } .schoolhero h1 { font-size: 1.9rem; } }
|
|
1386
1386
|
`;
|
|
1387
|
-
class
|
|
1388
|
-
static styles = [...H,
|
|
1387
|
+
class Vt extends b {
|
|
1388
|
+
static styles = [...H, Pe];
|
|
1389
1389
|
static properties = {
|
|
1390
1390
|
...b.properties,
|
|
1391
1391
|
schoolId: { type: String, attribute: "school-id" },
|
|
@@ -1402,7 +1402,7 @@ class Wt extends b {
|
|
|
1402
1402
|
t && !this.sport && (this.sport = t);
|
|
1403
1403
|
}
|
|
1404
1404
|
async fetchData(t) {
|
|
1405
|
-
const e = this.season || tt(), s = await t.getSchool(this.schoolId), o = (await t.listTeams({ schoolId: this.schoolId })).items, i = o.find((v) => v.sport === (this.sport || "football")) || o[0] || null, [n,
|
|
1405
|
+
const e = this.season || tt(), s = await t.getSchool(this.schoolId), o = (await t.listTeams({ schoolId: this.schoolId })).items, i = o.find((v) => v.sport === (this.sport || "football")) || o[0] || null, [n, c, p, l, h, f, u] = await Promise.all([
|
|
1406
1406
|
i ? t.listGames({ sport: i.sport, season: e }) : Promise.resolve({ items: [] }),
|
|
1407
1407
|
i ? t.listTeams({ sport: i.sport }) : Promise.resolve({ items: [] }),
|
|
1408
1408
|
t.listSchools(),
|
|
@@ -1419,10 +1419,10 @@ class Wt extends b {
|
|
|
1419
1419
|
teams: o,
|
|
1420
1420
|
active: i,
|
|
1421
1421
|
games: n.items,
|
|
1422
|
-
allTeams:
|
|
1422
|
+
allTeams: c.items,
|
|
1423
1423
|
schools: p.items,
|
|
1424
|
-
conferences:
|
|
1425
|
-
rankings:
|
|
1424
|
+
conferences: l.items,
|
|
1425
|
+
rankings: h.items,
|
|
1426
1426
|
roster: f.items.find((v) => v.season === e) || null,
|
|
1427
1427
|
players: u.items
|
|
1428
1428
|
};
|
|
@@ -1441,87 +1441,87 @@ class Wt extends b {
|
|
|
1441
1441
|
this.sport = t, this.load();
|
|
1442
1442
|
}
|
|
1443
1443
|
renderView() {
|
|
1444
|
-
const { school: t, teams: e, active: s, season:
|
|
1445
|
-
if (!t) return
|
|
1446
|
-
const o = this.ctx, i =
|
|
1447
|
-
return
|
|
1444
|
+
const { school: t, teams: e, active: s, season: r } = this.data;
|
|
1445
|
+
if (!t) return d`<div class="view"><p class="empty">School not found.</p></div>`;
|
|
1446
|
+
const o = this.ctx, i = V(t.colorPrimary || "#030711"), n = (t.adm || [])[0], c = g(this.data.conferences), p = s ? c[s.conferenceId] : null;
|
|
1447
|
+
return d`
|
|
1448
1448
|
<div class="schoolhero" style="background:linear-gradient(115deg, ${t.colorPrimary || "#030711"} 0%, ${t.colorPrimary || "#030711"} 55%, var(--hsot-black) 100%);color:${i}">
|
|
1449
1449
|
<div class="inner">
|
|
1450
|
-
${
|
|
1450
|
+
${G(t, 84) ? d`<img class="crest logo" alt="" loading="lazy" src=${G(t, 84)} />` : d`<div class="crest" style="background:${t.colorSecondary || "#7C7C7C"};color:${V(t.colorSecondary || "#7C7C7C")}">${ft(t)}</div>`}
|
|
1451
1451
|
<div style="min-width:260px">
|
|
1452
1452
|
<h1>${t.name} <span class="mascot">${t.mascot || ""}</span></h1>
|
|
1453
1453
|
<div class="facts">
|
|
1454
|
-
${t.location ?
|
|
1455
|
-
${t.association ?
|
|
1456
|
-
${p ?
|
|
1457
|
-
${n ?
|
|
1458
|
-
${t.openingYear ?
|
|
1459
|
-
${t.areaCode ?
|
|
1460
|
-
${t.tagSlug ?
|
|
1454
|
+
${t.location ? d`<span><b>Location</b>${t.location}${t.county ? d` · ${t.county} County` : m}</span>` : m}
|
|
1455
|
+
${t.association ? d`<span><b>League</b>${t.association}${t.classification ? d` · ${t.classification}` : m}</span>` : m}
|
|
1456
|
+
${p ? d`<span><b>Conference</b>${p.name}</span>` : m}
|
|
1457
|
+
${n ? d`<span><b>Enrollment</b>${n.value.toLocaleString()} (${n.season} ADM)</span>` : m}
|
|
1458
|
+
${t.openingYear ? d`<span><b>Opened</b>${t.openingYear}</span>` : m}
|
|
1459
|
+
${t.areaCode ? d`<span><b>Area</b>${t.areaCode}</span>` : m}
|
|
1460
|
+
${t.tagSlug ? d`<span><b>Tag</b>#${t.tagSlug}</span>` : m}
|
|
1461
1461
|
</div>
|
|
1462
1462
|
</div>
|
|
1463
1463
|
</div>
|
|
1464
1464
|
</div>
|
|
1465
1465
|
<div class="band">
|
|
1466
1466
|
<nav class="tabs" aria-label="Teams">
|
|
1467
|
-
${e.map((
|
|
1468
|
-
|
|
1469
|
-
}}>${
|
|
1467
|
+
${e.map((l) => l.id === s?.id ? d`<a class="on" href="#" @click=${(h) => h.preventDefault()}>${l.name}</a>` : d`<a href="#" @click=${(h) => {
|
|
1468
|
+
h.preventDefault(), this.switchSport(l.sport);
|
|
1469
|
+
}}>${l.name}</a>`)}
|
|
1470
1470
|
</nav>
|
|
1471
1471
|
</div>
|
|
1472
1472
|
<div class="view">
|
|
1473
|
-
${s ? this.renderTeam(o, s, p,
|
|
1473
|
+
${s ? this.renderTeam(o, s, p, r) : d`<p class="empty">No teams recorded for this school yet.</p>`}
|
|
1474
1474
|
</div>
|
|
1475
1475
|
`;
|
|
1476
1476
|
}
|
|
1477
|
-
renderTeam(t, e, s,
|
|
1478
|
-
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, n = s ? this.data.allTeams.filter((
|
|
1479
|
-
return
|
|
1477
|
+
renderTeam(t, e, s, r) {
|
|
1478
|
+
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, n = s ? this.data.allTeams.filter((h) => h.conferenceId === s.id) : [], c = s ? Nt(n, t.records).findIndex((h) => h.team.id === e.id) + 1 : 0, p = Ht(t.rankings, t.teamsById, e.id, e.sport, null), l = this.data.games.filter((h) => h.homeTeamId === e.id || h.awayTeamId === e.id).sort((h, f) => String(h.date).localeCompare(String(f.date)));
|
|
1479
|
+
return d`
|
|
1480
1480
|
<div class="tiles">
|
|
1481
1481
|
<div class="tile"><div class="k">Overall</div><div class="v">${x(o)}</div><div class="s">${i} games played</div></div>
|
|
1482
1482
|
<div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${x(o, !0)}</div>
|
|
1483
|
-
<div class="s">${
|
|
1483
|
+
<div class="s">${c ? `${Ae(c)} of ${n.length}` : "·"}</div></div>
|
|
1484
1484
|
<div class="tile"><div class="k">Points</div><div class="v">${i ? (o.pf / i).toFixed(1) : "0.0"}</div>
|
|
1485
1485
|
<div class="s">scored per game · ${i ? (o.pa / i).toFixed(1) : "0.0"} allowed</div></div>
|
|
1486
|
-
<div class="tile"><div class="k">Streak</div><div class="v">${
|
|
1486
|
+
<div class="tile"><div class="k">Streak</div><div class="v">${Q(o.results) || "·"}</div>
|
|
1487
1487
|
<div class="s">last 5: ${gt(t, e.id)}</div></div>
|
|
1488
1488
|
<div class="tile"><div class="k">HSOT Top 25</div><div class="v">${p ? `#${p}` : "NR"}</div>
|
|
1489
1489
|
<div class="s"><a href=${$(t.hrefs.section, { sport: e.sport, view: "rankings" })}>full poll</a></div></div>
|
|
1490
1490
|
</div>
|
|
1491
|
-
${(e.championships || []).length ?
|
|
1491
|
+
${(e.championships || []).length ? d`
|
|
1492
1492
|
<div style="margin:-0.2rem 0 1rem;display:flex;gap:0.4rem;flex-wrap:wrap">
|
|
1493
|
-
${e.championships.map((
|
|
1493
|
+
${e.championships.map((h) => d`<span class="pill champ">★ ${h.season} ${h.title} champion${h.classification ? ` · ${h.classification}` : ""}${h.region ? ` · ${h.region}` : ""}</span>`)}
|
|
1494
1494
|
</div>` : m}
|
|
1495
1495
|
<div class="cols">
|
|
1496
1496
|
<div>
|
|
1497
1497
|
<div class="section-title">Schedule & results</div>
|
|
1498
1498
|
<div class="card">
|
|
1499
|
-
${
|
|
1499
|
+
${l.length ? d`<ul class="gamelist">${l.map((h) => this.renderGameRow(t, e, h))}</ul>` : d`<p class="empty">No ${e.sport} games recorded for ${r}.</p>`}
|
|
1500
1500
|
</div>
|
|
1501
1501
|
</div>
|
|
1502
1502
|
<div>
|
|
1503
|
-
<div class="section-title">Roster · ${
|
|
1504
|
-
<div class="card">${this.renderRoster(
|
|
1503
|
+
<div class="section-title">Roster · ${r}</div>
|
|
1504
|
+
<div class="card">${this.renderRoster(r)}</div>
|
|
1505
1505
|
</div>
|
|
1506
1506
|
</div>
|
|
1507
1507
|
`;
|
|
1508
1508
|
}
|
|
1509
1509
|
renderGameRow(t, e, s) {
|
|
1510
|
-
const
|
|
1511
|
-
let
|
|
1510
|
+
const r = s.homeTeamId === e.id, o = r ? s.awayTeamId : s.homeTeamId, i = r ? s.homeScore : s.awayScore, n = r ? s.awayScore : s.homeScore;
|
|
1511
|
+
let c = d`<span class="mut">${X(s.time)}</span>`;
|
|
1512
1512
|
if (s.state === "final") {
|
|
1513
|
-
const
|
|
1514
|
-
|
|
1515
|
-
} else s.state === "live" && (
|
|
1513
|
+
const l = pt(s), h = l === "tie" ? "T" : l === (r ? "home" : "away") ? "W" : "L";
|
|
1514
|
+
c = d`<span class=${h}>${h}</span> ${i}-${n}${s.finish === "overtime" ? d` <span class="mut">OT</span>` : m}${s.forfeit && s.forfeit !== "none" ? d` <span class="mut">FF</span>` : m}`;
|
|
1515
|
+
} else s.state === "live" && (c = d`<span style="color:var(--hsot-red)">${i}-${n}</span>`);
|
|
1516
1516
|
const p = s.gameType === "conference" ? "Conf" : s.gameType === "nonconference" ? "Non-conf" : s.gameType === "playoff" ? `Playoff${s.label ? ` · ${s.label}` : ""}` : "Scrimmage";
|
|
1517
|
-
return
|
|
1517
|
+
return d`
|
|
1518
1518
|
<li>
|
|
1519
1519
|
<span class="d">${y(s.date)}</span>
|
|
1520
1520
|
${Y(s)}
|
|
1521
|
-
<span class="res">${
|
|
1522
|
-
<span class="opp">${
|
|
1521
|
+
<span class="res">${c}</span>
|
|
1522
|
+
<span class="opp">${r ? "vs" : "at"} ${it(t, o, s.date)}
|
|
1523
1523
|
<span class="pill type">${p}</span>
|
|
1524
|
-
${s.broadcast ?
|
|
1524
|
+
${s.broadcast ? d`<span class="pill class">${s.broadcast}</span>` : m}
|
|
1525
1525
|
</span>
|
|
1526
1526
|
<span class="where">${s.venue || ""}</span>
|
|
1527
1527
|
<a class="box" href=${$(t.hrefs.game, { sport: e.sport, id: s.id })}>Box score →</a>
|
|
@@ -1531,20 +1531,20 @@ class Wt extends b {
|
|
|
1531
1531
|
renderRoster(t) {
|
|
1532
1532
|
const e = this.data.roster;
|
|
1533
1533
|
if (!e)
|
|
1534
|
-
return
|
|
1535
|
-
const s = g(this.data.players),
|
|
1536
|
-
return
|
|
1534
|
+
return d`<p class="empty">Roster not published for ${t}.</p>`;
|
|
1535
|
+
const s = g(this.data.players), r = e.entries.slice().sort((o, i) => (o.number || 0) - (i.number || 0));
|
|
1536
|
+
return d`
|
|
1537
1537
|
<div class="tablewrap"><table class="data">
|
|
1538
1538
|
<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></tr></thead>
|
|
1539
1539
|
<tbody>
|
|
1540
|
-
${
|
|
1540
|
+
${r.map((o) => {
|
|
1541
1541
|
const i = s[o.playerId];
|
|
1542
|
-
return i ?
|
|
1542
|
+
return i ? d`<tr>
|
|
1543
1543
|
<td class="num mut">${o.number ?? "·"}</td>
|
|
1544
1544
|
<td style="font-weight:500">${i.firstName} ${i.lastName}</td>
|
|
1545
1545
|
<td>${o.position || "·"}</td>
|
|
1546
1546
|
<td class="mut">${i.classOf || "·"}</td>
|
|
1547
|
-
<td class="num">${
|
|
1547
|
+
<td class="num">${Se(i.heightIn)}</td>
|
|
1548
1548
|
<td class="num">${i.weightLb || "·"}</td>
|
|
1549
1549
|
</tr>` : m;
|
|
1550
1550
|
})}
|
|
@@ -1553,8 +1553,37 @@ class Wt extends b {
|
|
|
1553
1553
|
`;
|
|
1554
1554
|
}
|
|
1555
1555
|
}
|
|
1556
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school",
|
|
1557
|
-
const
|
|
1556
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school", Vt);
|
|
1557
|
+
const De = "https://api.wral.com/search";
|
|
1558
|
+
function Re(a) {
|
|
1559
|
+
return a.map((t) => `uri:"${t}"`).join(" OR ");
|
|
1560
|
+
}
|
|
1561
|
+
function ze(a, t) {
|
|
1562
|
+
const e = String(a || De).replace(/\/+$/, ""), s = new URLSearchParams({ query: Re(t), sort: "score", lang: "en" });
|
|
1563
|
+
return `${e}/v1/query?${s}`;
|
|
1564
|
+
}
|
|
1565
|
+
function Gt(a) {
|
|
1566
|
+
try {
|
|
1567
|
+
const t = new URL(a);
|
|
1568
|
+
if (/(^|\.)smugmug\.com$/i.test(t.hostname)) {
|
|
1569
|
+
const e = t.pathname.split("/").filter(Boolean).pop() || "", s = !e || /^[ni]-[A-Za-z0-9]+$/.test(e);
|
|
1570
|
+
return {
|
|
1571
|
+
uri: a,
|
|
1572
|
+
title: s ? a : decodeURIComponent(e).replace(/-/g, " "),
|
|
1573
|
+
photos: !0
|
|
1574
|
+
};
|
|
1575
|
+
}
|
|
1576
|
+
} catch {
|
|
1577
|
+
}
|
|
1578
|
+
return { uri: a, title: a };
|
|
1579
|
+
}
|
|
1580
|
+
async function Be(a, t, e) {
|
|
1581
|
+
const r = await ((...n) => fetch(...n))(ze(a, t));
|
|
1582
|
+
if (!r.ok) throw new Error(`search answered ${r.status}`);
|
|
1583
|
+
const o = await r.json(), i = new Map((o.items || []).map((n) => [n.uri, n]));
|
|
1584
|
+
return t.map((n) => i.get(n) || Gt(n));
|
|
1585
|
+
}
|
|
1586
|
+
const Ue = w`
|
|
1558
1587
|
.breadcrumbs { font-size: 0.8125rem; margin: 0.9rem 0 0; color: var(--hsot-gray-5); }
|
|
1559
1588
|
.breadcrumbs a { text-decoration: none; }
|
|
1560
1589
|
.scorehead { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; padding: 1.4rem 1rem; }
|
|
@@ -1575,6 +1604,14 @@ const Pe = w`
|
|
|
1575
1604
|
.scorehead .mid { text-align: center; }
|
|
1576
1605
|
.scorehead .bigscore { font-family: var(--hsot-heading-font); font-weight: 700; font-size: 3rem; line-height: 1; color: var(--hsot-black); white-space: nowrap; }
|
|
1577
1606
|
.scorehead .status { margin-top: 0.3rem; font-size: 0.8rem; color: var(--hsot-gray-5); }
|
|
1607
|
+
.covgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
|
|
1608
|
+
.covcard { display: flex; flex-direction: column; text-decoration: none; color: inherit; margin-bottom: 0; }
|
|
1609
|
+
.covcard:hover .covtitle { color: var(--hsot-red-deep); }
|
|
1610
|
+
.covimg { width: 100%; aspect-ratio: 1.91; object-fit: cover; display: block; background: var(--hsot-gray-1); }
|
|
1611
|
+
.covbody { padding: 0.75rem 0.9rem 0.85rem; }
|
|
1612
|
+
.covtitle { font-family: var(--hsot-heading-font); font-weight: 700; font-size: 1.05rem; line-height: 1.25; overflow-wrap: anywhere; }
|
|
1613
|
+
.covdesc { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--hsot-gray-5); line-height: 1.4; }
|
|
1614
|
+
.covmeta { margin-top: 0.45rem; font-size: 0.78rem; color: var(--hsot-gray-5); }
|
|
1578
1615
|
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
|
|
1579
1616
|
.ctxcard { padding: 0.85rem 1rem; }
|
|
1580
1617
|
.ctxcard .who { font-family: var(--hsot-heading-font); font-weight: 700; margin-bottom: 0.4rem; }
|
|
@@ -1585,30 +1622,39 @@ const Pe = w`
|
|
|
1585
1622
|
.cols { grid-template-columns: 1fr; }
|
|
1586
1623
|
}
|
|
1587
1624
|
`;
|
|
1588
|
-
class
|
|
1589
|
-
static styles = [...H,
|
|
1625
|
+
class qt extends b {
|
|
1626
|
+
static styles = [...H, Ue];
|
|
1590
1627
|
static properties = {
|
|
1591
1628
|
...b.properties,
|
|
1592
|
-
gameId: { type: String, attribute: "game-id" }
|
|
1629
|
+
gameId: { type: String, attribute: "game-id" },
|
|
1630
|
+
// The public site search that resolves Game.coverageUrls into cards
|
|
1631
|
+
// (DEV-1236). Shared cross-stage by design — see the studio host's
|
|
1632
|
+
// registry — so the prod default is right everywhere; the attribute
|
|
1633
|
+
// exists for the same reason the href templates do.
|
|
1634
|
+
searchApi: { type: String, attribute: "search-api" }
|
|
1593
1635
|
};
|
|
1594
1636
|
constructor() {
|
|
1595
|
-
super(), this.gameId = "";
|
|
1637
|
+
super(), this.gameId = "", this.searchApi = "";
|
|
1596
1638
|
}
|
|
1597
1639
|
async fetchData(t) {
|
|
1598
|
-
const e = await t.getGame(this.gameId), [
|
|
1640
|
+
const e = await t.getGame(this.gameId), s = Array.isArray(e.coverageUrls) ? e.coverageUrls : [], [r, o, i, n, c, p] = await Promise.all([
|
|
1599
1641
|
t.listSchools(),
|
|
1600
1642
|
t.listTeams({ sport: e.sport }),
|
|
1601
1643
|
t.listConferences(),
|
|
1602
1644
|
t.listRankings({ sport: e.sport }),
|
|
1603
|
-
t.listGames({ sport: e.sport, season: e.season })
|
|
1645
|
+
t.listGames({ sport: e.sport, season: e.season }),
|
|
1646
|
+
// A search outage must not blank the box score — degrade to bare
|
|
1647
|
+
// links (fetchCoverage already degrades per-URL index misses).
|
|
1648
|
+
s.length ? Be(this.searchApi, s).catch(() => s.map(Gt)) : Promise.resolve([])
|
|
1604
1649
|
]);
|
|
1605
1650
|
return {
|
|
1606
1651
|
game: e,
|
|
1607
|
-
schools:
|
|
1608
|
-
teams:
|
|
1609
|
-
conferences:
|
|
1610
|
-
rankings:
|
|
1611
|
-
games:
|
|
1652
|
+
schools: r.items,
|
|
1653
|
+
teams: o.items,
|
|
1654
|
+
conferences: i.items,
|
|
1655
|
+
rankings: n.items,
|
|
1656
|
+
games: c.items,
|
|
1657
|
+
coverage: p
|
|
1612
1658
|
};
|
|
1613
1659
|
}
|
|
1614
1660
|
get ctx() {
|
|
@@ -1623,18 +1669,18 @@ class Vt extends b {
|
|
|
1623
1669
|
}
|
|
1624
1670
|
renderView() {
|
|
1625
1671
|
const t = this.data.game;
|
|
1626
|
-
if (!t) return
|
|
1627
|
-
const e = this.ctx, s = g(this.data.conferences),
|
|
1628
|
-
return
|
|
1672
|
+
if (!t) return d`<div class="view"><p class="empty">Game not found.</p></div>`;
|
|
1673
|
+
const e = this.ctx, s = g(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 = pt(t), n = (l) => t.state === "final" && i !== l && i !== "tie" ? "opacity:0.45" : "", c = t.conferenceId ? s[t.conferenceId] : null, p = this.data.games.filter((l) => l.id !== t.id && l.state === "final" && l.gameType !== "scrimmage" && (l.homeTeamId === t.homeTeamId && l.awayTeamId === t.awayTeamId || l.homeTeamId === t.awayTeamId && l.awayTeamId === t.homeTeamId));
|
|
1674
|
+
return d`
|
|
1629
1675
|
<div class="view">
|
|
1630
1676
|
<p class="breadcrumbs">
|
|
1631
|
-
<a href=${$(e.hrefs.section, { sport: t.sport, view: "scores" })}>${
|
|
1677
|
+
<a href=${$(e.hrefs.section, { sport: t.sport, view: "scores" })}>${J(t.sport)}</a> /
|
|
1632
1678
|
<a href=${$(e.hrefs.section, { sport: t.sport, view: "scores" })}>Scores/Schedules</a> /
|
|
1633
1679
|
${P(e, t.awayTeamId)} at ${P(e, t.homeTeamId)}
|
|
1634
1680
|
</p>
|
|
1635
1681
|
<div class="card">
|
|
1636
1682
|
<div class="scorehead">
|
|
1637
|
-
${this.teamBlock(e, t, t.awayTeamId,
|
|
1683
|
+
${this.teamBlock(e, t, t.awayTeamId, r, !1)}
|
|
1638
1684
|
<div class="mid">
|
|
1639
1685
|
<div class="bigscore">
|
|
1640
1686
|
<span style=${n("away")}>${t.awayScore}</span>
|
|
@@ -1642,75 +1688,84 @@ class Vt extends b {
|
|
|
1642
1688
|
<span style=${n("home")}>${t.homeScore}</span>
|
|
1643
1689
|
</div>
|
|
1644
1690
|
<div class="status">${Y(t)}</div>
|
|
1645
|
-
<div class="status">${y(t.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${t.state === "scheduled" && t.time ?
|
|
1646
|
-
${t.broadcast ?
|
|
1691
|
+
<div class="status">${y(t.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${t.state === "scheduled" && t.time ? d` · ${X(t.time)}` : m} · ${t.venue || "Venue TBD"}
|
|
1692
|
+
${t.broadcast ? d` · <span class="pill class">${t.broadcast}</span>` : m}</div>
|
|
1647
1693
|
<div class="status">
|
|
1648
|
-
<span class="pill type">${t.gameType === "conference" ? `${
|
|
1649
|
-
${t.label ?
|
|
1650
|
-
${(t.tags || []).map((
|
|
1694
|
+
<span class="pill type">${t.gameType === "conference" ? `${c?.name || "Conference"} game` : t.gameType}</span>
|
|
1695
|
+
${t.label ? d`<span class="pill type">Bracket ${t.label}</span>` : m}
|
|
1696
|
+
${(t.tags || []).map((l) => d`<span class="pill type">${l}</span>`)}
|
|
1651
1697
|
</div>
|
|
1652
1698
|
</div>
|
|
1653
1699
|
${this.teamBlock(e, t, t.homeTeamId, o, !0)}
|
|
1654
1700
|
</div>
|
|
1655
|
-
${this.renderLineScore(t,
|
|
1656
|
-
${t.notes ?
|
|
1701
|
+
${this.renderLineScore(t, r, o)}
|
|
1702
|
+
${t.notes ? d`<p class="note" style="padding:0 1rem 0.9rem;text-align:center">${t.notes}</p>` : m}
|
|
1657
1703
|
</div>
|
|
1658
|
-
${
|
|
1704
|
+
${(this.data.coverage || []).length ? d`
|
|
1659
1705
|
<div class="section-title">Coverage</div>
|
|
1660
|
-
<div class="
|
|
1661
|
-
${
|
|
1662
|
-
|
|
1663
|
-
|
|
1706
|
+
<div class="covgrid">
|
|
1707
|
+
${this.data.coverage.map((l) => d`
|
|
1708
|
+
<a class="card covcard" href=${l.uri}>
|
|
1709
|
+
${l.image ? d`<img class="covimg" src=${l.image} alt="" loading="lazy" />` : m}
|
|
1710
|
+
<div class="covbody">
|
|
1711
|
+
<div class="covtitle">${l.videoDuration ? d`<span class="pill live" style="animation:none">Video</span> ` : m}${l.photos ? d`<span class="pill live" style="animation:none">Photos</span> ` : m}${l.title || l.uri}</div>
|
|
1712
|
+
${l.description ? d`<p class="covdesc">${l.description}</p>` : m}
|
|
1713
|
+
${l.author || l.publishedTime ? d`
|
|
1714
|
+
<div class="covmeta">${[l.author, l.publishedTime ? new Date(l.publishedTime).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : ""].filter(Boolean).join(" · ")}</div>
|
|
1715
|
+
` : m}
|
|
1716
|
+
</div>
|
|
1717
|
+
</a>
|
|
1718
|
+
`)}
|
|
1664
1719
|
</div>` : m}
|
|
1665
1720
|
<div class="section-title">Season context</div>
|
|
1666
1721
|
<div class="cols">
|
|
1667
|
-
${[[t.awayTeamId,
|
|
1722
|
+
${[[t.awayTeamId, r], [t.homeTeamId, o]].map(([l, h]) => this.renderContext(e, l, h))}
|
|
1668
1723
|
</div>
|
|
1669
|
-
${p.length ?
|
|
1724
|
+
${p.length ? d`
|
|
1670
1725
|
<div class="section-title">Head to head this season</div>
|
|
1671
1726
|
<div class="card"><ul class="gamelist">
|
|
1672
|
-
${p.map((
|
|
1673
|
-
<span class="d">${y(
|
|
1674
|
-
<span class="opp">${P(e,
|
|
1675
|
-
<a class="box" href=${$(e.hrefs.game, { sport: t.sport, id:
|
|
1727
|
+
${p.map((l) => d`<li>
|
|
1728
|
+
<span class="d">${y(l.date)}</span>${Y(l)}
|
|
1729
|
+
<span class="opp">${P(e, l.awayTeamId)} ${l.awayScore}, ${P(e, l.homeTeamId)} ${l.homeScore}</span>
|
|
1730
|
+
<a class="box" href=${$(e.hrefs.game, { sport: t.sport, id: l.id })}>Box score →</a>
|
|
1676
1731
|
</li>`)}
|
|
1677
1732
|
</ul></div>` : m}
|
|
1678
1733
|
</div>
|
|
1679
1734
|
`;
|
|
1680
1735
|
}
|
|
1681
|
-
teamBlock(t, e, s,
|
|
1682
|
-
if (!
|
|
1683
|
-
const i = t.teamsById[s], n = t.records[s],
|
|
1684
|
-
return
|
|
1736
|
+
teamBlock(t, e, s, r, o) {
|
|
1737
|
+
if (!r) return d`<div class="teamblock ${o ? "right" : ""}"><div class="tname">TBD</div></div>`;
|
|
1738
|
+
const i = t.teamsById[s], n = t.records[s], c = G(r, 58);
|
|
1739
|
+
return d`
|
|
1685
1740
|
<div class="teamblock ${o ? "right" : ""}">
|
|
1686
|
-
${
|
|
1741
|
+
${c ? d`<img class="crest logo" alt="" loading="lazy" src=${c} />` : d`<span class="crest" style="background:${r.colorPrimary || "#030711"};color:${V(r.colorPrimary || "#030711")}">${ft(r)}</span>`}
|
|
1687
1742
|
<div>
|
|
1688
|
-
<div class="tname">${ut(t, s, e.date)}<a href=${$(t.hrefs.school, { id:
|
|
1689
|
-
<div class="trec">${
|
|
1743
|
+
<div class="tname">${ut(t, s, e.date)}<a href=${$(t.hrefs.school, { id: r.id })}>${r.name}</a></div>
|
|
1744
|
+
<div class="trec">${r.mascot || ""} · ${x(n)}${i?.conferenceId ? d` · ${x(n, !0)} conf` : m}</div>
|
|
1690
1745
|
</div>
|
|
1691
1746
|
</div>
|
|
1692
1747
|
`;
|
|
1693
1748
|
}
|
|
1694
1749
|
renderLineScore(t, e, s) {
|
|
1695
|
-
const
|
|
1696
|
-
if (!
|
|
1697
|
-
return
|
|
1698
|
-
const o = Math.max(4, ...
|
|
1699
|
-
const
|
|
1700
|
-
return
|
|
1701
|
-
},
|
|
1750
|
+
const r = t.periodScores || [];
|
|
1751
|
+
if (!r.length)
|
|
1752
|
+
return d`<p class="empty" style="text-align:center">Period scoring will appear once the game starts.</p>`;
|
|
1753
|
+
const o = Math.max(4, ...r.map((p) => p.period)), i = (p) => p <= 4 ? String(p) : `OT${p > 5 ? p - 4 : ""}`, n = (p, l) => {
|
|
1754
|
+
const h = r.find((f) => f.period === l);
|
|
1755
|
+
return h ? h[p] : t.state === "final" ? 0 : "·";
|
|
1756
|
+
}, c = (p, l, h) => d`
|
|
1702
1757
|
<tr>
|
|
1703
|
-
<td class="teamcell">${
|
|
1704
|
-
${Array.from({ length: o }, (f, u) =>
|
|
1705
|
-
<td class="num" style="font-weight:700">${
|
|
1758
|
+
<td class="teamcell">${F(p, 20)}${p?.abbr || "TBD"}</td>
|
|
1759
|
+
${Array.from({ length: o }, (f, u) => d`<td class="num">${n(l, u + 1)}</td>`)}
|
|
1760
|
+
<td class="num" style="font-weight:700">${h}</td>
|
|
1706
1761
|
</tr>`;
|
|
1707
|
-
return
|
|
1762
|
+
return d`
|
|
1708
1763
|
<div class="tablewrap" style="border-top:1px solid var(--hsot-gray-2)">
|
|
1709
1764
|
<table class="data" style="max-width:560px;margin:0.6rem auto 0.9rem">
|
|
1710
|
-
<thead><tr><th>Team</th>${Array.from({ length: o }, (p,
|
|
1765
|
+
<thead><tr><th>Team</th>${Array.from({ length: o }, (p, l) => d`<th class="num">${i(l + 1)}</th>`)}<th class="num">T</th></tr></thead>
|
|
1711
1766
|
<tbody>
|
|
1712
|
-
${
|
|
1713
|
-
${
|
|
1767
|
+
${c(e, "away", t.awayScore)}
|
|
1768
|
+
${c(s, "home", t.homeScore)}
|
|
1714
1769
|
</tbody>
|
|
1715
1770
|
</table>
|
|
1716
1771
|
</div>
|
|
@@ -1718,36 +1773,36 @@ class Vt extends b {
|
|
|
1718
1773
|
}
|
|
1719
1774
|
renderContext(t, e, s) {
|
|
1720
1775
|
if (!s) return m;
|
|
1721
|
-
const
|
|
1722
|
-
return
|
|
1776
|
+
const r = t.records[e], o = mt(this.data.games, e);
|
|
1777
|
+
return d`
|
|
1723
1778
|
<div class="card ctxcard">
|
|
1724
|
-
<div class="who">${
|
|
1779
|
+
<div class="who">${F(s)}${s.name}</div>
|
|
1725
1780
|
<div class="row">
|
|
1726
1781
|
<span>Last 5: ${gt(t, e)}</span>
|
|
1727
|
-
<span>Streak: <b>${
|
|
1728
|
-
<span>PF/PA: <b>${
|
|
1729
|
-
<span>Next: ${o ?
|
|
1782
|
+
<span>Streak: <b>${r ? Q(r.results) : "·"}</b></span>
|
|
1783
|
+
<span>PF/PA: <b>${r ? `${r.pf} / ${r.pa}` : "·"}</b></span>
|
|
1784
|
+
<span>Next: ${o ? d`${y(o.date, { month: "numeric", day: "numeric" })}
|
|
1730
1785
|
${o.homeTeamId === e ? "vs" : "at"} ${q(t, o.homeTeamId === e ? o.awayTeamId : o.homeTeamId)}` : "·"}</span>
|
|
1731
1786
|
</div>
|
|
1732
1787
|
</div>
|
|
1733
1788
|
`;
|
|
1734
1789
|
}
|
|
1735
1790
|
}
|
|
1736
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore",
|
|
1737
|
-
const
|
|
1791
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore", qt);
|
|
1792
|
+
const Oe = {
|
|
1738
1793
|
"hsot-scores": Lt,
|
|
1739
1794
|
"hsot-standings": jt,
|
|
1740
|
-
"hsot-rankings":
|
|
1741
|
-
"hsot-school":
|
|
1742
|
-
"hsot-boxscore":
|
|
1795
|
+
"hsot-rankings": Wt,
|
|
1796
|
+
"hsot-school": Vt,
|
|
1797
|
+
"hsot-boxscore": qt
|
|
1743
1798
|
};
|
|
1744
|
-
function
|
|
1745
|
-
const
|
|
1746
|
-
if (
|
|
1747
|
-
for (const [t, e] of Object.entries(
|
|
1748
|
-
|
|
1799
|
+
function Fe() {
|
|
1800
|
+
const a = globalThis?.customElements;
|
|
1801
|
+
if (a)
|
|
1802
|
+
for (const [t, e] of Object.entries(Oe))
|
|
1803
|
+
a.get(t) || a.define(t, e);
|
|
1749
1804
|
}
|
|
1750
|
-
typeof window < "u" && globalThis.customElements &&
|
|
1805
|
+
typeof window < "u" && globalThis.customElements && Fe();
|
|
1751
1806
|
export {
|
|
1752
|
-
|
|
1807
|
+
Fe as defineAll
|
|
1753
1808
|
};
|