@wral/hsot-data 0.1.1 → 0.1.2
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 +341 -314
- package/dist/{hsot-boxscore-D-tEuTZe.js → hsot-boxscore-DiJN2Ik6.js} +293 -266
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const j = globalThis,
|
|
2
|
-
let
|
|
1
|
+
const j = globalThis, nt = j.ShadowRoot && (j.ShadyCSS === void 0 || j.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, lt = /* @__PURE__ */ Symbol(), $t = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
let Dt = class {
|
|
3
3
|
constructor(t, e, s) {
|
|
4
|
-
if (this._$cssResult$ = !0, s !==
|
|
4
|
+
if (this._$cssResult$ = !0, s !== lt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
5
5
|
this.cssText = t, this.t = e;
|
|
6
6
|
}
|
|
7
7
|
get styleSheet() {
|
|
8
8
|
let t = this.o;
|
|
9
9
|
const e = this.t;
|
|
10
|
-
if (
|
|
10
|
+
if (nt && t === void 0) {
|
|
11
11
|
const s = e !== void 0 && e.length === 1;
|
|
12
|
-
s && (t =
|
|
12
|
+
s && (t = $t.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && $t.set(e, t));
|
|
13
13
|
}
|
|
14
14
|
return t;
|
|
15
15
|
}
|
|
@@ -17,28 +17,28 @@ let Pt = class {
|
|
|
17
17
|
return this.cssText;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const
|
|
20
|
+
const qt = (r) => new Dt(typeof r == "string" ? r : r + "", void 0, lt), w = (r, ...t) => {
|
|
21
21
|
const e = r.length === 1 ? r[0] : t.reduce((s, a, 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
25
|
})(a) + r[o + 1], r[0]);
|
|
26
|
-
return new
|
|
27
|
-
},
|
|
28
|
-
if (
|
|
26
|
+
return new Dt(e, r, lt);
|
|
27
|
+
}, Yt = (r, t) => {
|
|
28
|
+
if (nt) r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
29
29
|
else for (const e of t) {
|
|
30
30
|
const s = document.createElement("style"), a = j.litNonce;
|
|
31
31
|
a !== void 0 && s.setAttribute("nonce", a), s.textContent = e.cssText, r.appendChild(s);
|
|
32
32
|
}
|
|
33
|
-
},
|
|
33
|
+
}, vt = nt ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
|
34
34
|
let e = "";
|
|
35
35
|
for (const s of t.cssRules) e += s.cssText;
|
|
36
|
-
return
|
|
36
|
+
return qt(e);
|
|
37
37
|
})(r) : r;
|
|
38
|
-
const { is:
|
|
38
|
+
const { is: Kt, defineProperty: Zt, getOwnPropertyDescriptor: Jt, getOwnPropertyNames: Qt, getOwnPropertySymbols: Xt, getPrototypeOf: te } = Object, K = globalThis, yt = K.trustedTypes, ee = yt ? yt.emptyScript : "", se = K.reactiveElementPolyfillSupport, D = (r, t) => r, rt = { toAttribute(r, t) {
|
|
39
39
|
switch (t) {
|
|
40
40
|
case Boolean:
|
|
41
|
-
r = r ?
|
|
41
|
+
r = r ? ee : null;
|
|
42
42
|
break;
|
|
43
43
|
case Object:
|
|
44
44
|
case Array:
|
|
@@ -63,8 +63,8 @@ const { is: Yt, defineProperty: Kt, getOwnPropertyDescriptor: Zt, getOwnProperty
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
return e;
|
|
66
|
-
} },
|
|
67
|
-
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"),
|
|
66
|
+
} }, Rt = (r, t) => !Kt(r, t), bt = { attribute: !0, type: String, converter: rt, reflect: !1, useDefault: !1, hasChanged: Rt };
|
|
67
|
+
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), K.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
68
|
let T = class extends HTMLElement {
|
|
69
69
|
static addInitializer(t) {
|
|
70
70
|
this._$Ei(), (this.l ??= []).push(t);
|
|
@@ -72,14 +72,14 @@ let T = class extends HTMLElement {
|
|
|
72
72
|
static get observedAttributes() {
|
|
73
73
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
74
74
|
}
|
|
75
|
-
static createProperty(t, e =
|
|
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
77
|
const s = /* @__PURE__ */ Symbol(), a = this.getPropertyDescriptor(t, s, e);
|
|
78
|
-
a !== void 0 &&
|
|
78
|
+
a !== void 0 && Zt(this.prototype, t, a);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
static getPropertyDescriptor(t, e, s) {
|
|
82
|
-
const { get: a, set: o } =
|
|
82
|
+
const { get: a, set: o } = Jt(this.prototype, t) ?? { get() {
|
|
83
83
|
return this[e];
|
|
84
84
|
}, set(i) {
|
|
85
85
|
this[e] = i;
|
|
@@ -90,17 +90,17 @@ let T = class extends HTMLElement {
|
|
|
90
90
|
}, configurable: !0, enumerable: !0 };
|
|
91
91
|
}
|
|
92
92
|
static getPropertyOptions(t) {
|
|
93
|
-
return this.elementProperties.get(t) ??
|
|
93
|
+
return this.elementProperties.get(t) ?? bt;
|
|
94
94
|
}
|
|
95
95
|
static _$Ei() {
|
|
96
96
|
if (this.hasOwnProperty(D("elementProperties"))) return;
|
|
97
|
-
const t =
|
|
97
|
+
const t = te(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 = [...
|
|
103
|
+
const e = this.properties, s = [...Qt(e), ...Xt(e)];
|
|
104
104
|
for (const a of s) this.createProperty(a, e[a]);
|
|
105
105
|
}
|
|
106
106
|
const t = this[Symbol.metadata];
|
|
@@ -119,8 +119,8 @@ 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 a of s) e.unshift(
|
|
123
|
-
} else t !== void 0 && e.push(
|
|
122
|
+
for (const a of s) e.unshift(vt(a));
|
|
123
|
+
} else t !== void 0 && e.push(vt(t));
|
|
124
124
|
return e;
|
|
125
125
|
}
|
|
126
126
|
static _$Eu(t, e) {
|
|
@@ -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 Yt(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?.());
|
|
@@ -162,14 +162,14 @@ let T = class extends HTMLElement {
|
|
|
162
162
|
_$ET(t, e) {
|
|
163
163
|
const s = this.constructor.elementProperties.get(t), a = this.constructor._$Eu(t, s);
|
|
164
164
|
if (a !== void 0 && s.reflect === !0) {
|
|
165
|
-
const o = (s.converter?.toAttribute !== void 0 ? s.converter :
|
|
165
|
+
const o = (s.converter?.toAttribute !== void 0 ? s.converter : rt).toAttribute(e, s.type);
|
|
166
166
|
this._$Em = t, o == null ? this.removeAttribute(a) : this.setAttribute(a, o), this._$Em = null;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
_$AK(t, e) {
|
|
170
170
|
const s = this.constructor, a = s._$Eh.get(t);
|
|
171
171
|
if (a !== void 0 && this._$Em !== a) {
|
|
172
|
-
const o = s.getPropertyOptions(a), i = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter :
|
|
172
|
+
const o = s.getPropertyOptions(a), i = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : rt;
|
|
173
173
|
this._$Em = a;
|
|
174
174
|
const n = i.fromAttribute(e, o.type);
|
|
175
175
|
this[a] = n ?? this._$Ej?.get(a) ?? n, this._$Em = null;
|
|
@@ -178,7 +178,7 @@ let T = class extends HTMLElement {
|
|
|
178
178
|
requestUpdate(t, e, s, a = !1, o) {
|
|
179
179
|
if (t !== void 0) {
|
|
180
180
|
const i = this.constructor;
|
|
181
|
-
if (a === !1 && (o = this[t]), s ??= i.getPropertyOptions(t), !((s.hasChanged ??
|
|
181
|
+
if (a === !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());
|
|
@@ -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
|
|
251
|
-
\f\r]`, E = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
252
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
253
|
-
function
|
|
254
|
-
if (!
|
|
255
|
-
return
|
|
249
|
+
T.elementStyles = [], T.shadowRootOptions = { mode: "open" }, T[D("elementProperties")] = /* @__PURE__ */ new Map(), T[D("finalized")] = /* @__PURE__ */ new Map(), se?.({ ReactiveElement: T }), (K.reactiveElementVersions ??= []).push("2.1.2");
|
|
250
|
+
const ct = globalThis, wt = (r) => r, G = ct.trustedTypes, xt = G ? G.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, zt = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`, Bt = "?" + _, ae = `<${Bt}>`, A = document, z = () => A.createComment(""), B = (r) => r === null || typeof r != "object" && typeof r != "function", dt = Array.isArray, re = (r) => dt(r) || typeof r?.[Symbol.iterator] == "function", st = `[
|
|
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, Ot = /^(?:script|style|textarea|title)$/i, Nt = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), c = Nt(1), Tt = Nt(2), I = /* @__PURE__ */ Symbol.for("lit-noChange"), m = /* @__PURE__ */ Symbol.for("lit-nothing"), It = /* @__PURE__ */ new WeakMap(), S = A.createTreeWalker(A, 129);
|
|
253
|
+
function Ut(r, t) {
|
|
254
|
+
if (!dt(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
|
+
return xt !== void 0 ? xt.createHTML(t) : t;
|
|
256
256
|
}
|
|
257
|
-
const
|
|
257
|
+
const oe = (r, t) => {
|
|
258
258
|
const e = r.length - 1, s = [];
|
|
259
259
|
let a, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", i = E;
|
|
260
260
|
for (let n = 0; n < e; n++) {
|
|
261
261
|
const l = r[n];
|
|
262
|
-
let p, h,
|
|
263
|
-
for (; f < l.length && (i.lastIndex = f, h = i.exec(l), h !== null); ) f = i.lastIndex, i === E ? h[1] === "!--" ? i =
|
|
262
|
+
let p, h, d = -1, f = 0;
|
|
263
|
+
for (; f < l.length && (i.lastIndex = f, h = i.exec(l), h !== null); ) f = i.lastIndex, i === E ? h[1] === "!--" ? i = _t : h[1] !== void 0 ? i = kt : h[2] !== void 0 ? (Ot.test(h[2]) && (a = RegExp("</" + h[2], "g")), i = k) : h[3] !== void 0 && (i = k) : i === k ? h[0] === ">" ? (i = a ?? E, d = -1) : h[1] === void 0 ? d = -2 : (d = i.lastIndex - h[2].length, p = h[1], i = h[3] === void 0 ? k : h[3] === '"' ? At : St) : i === At || i === St ? i = k : i === _t || i === kt ? i = E : (i = k, a = void 0);
|
|
264
264
|
const u = i === k && r[n + 1].startsWith("/>") ? " " : "";
|
|
265
|
-
o += i === E ? l +
|
|
265
|
+
o += i === E ? l + ae : d >= 0 ? (s.push(p), l.slice(0, d) + zt + l.slice(d) + _ + u) : l + _ + (d === -2 ? n : u);
|
|
266
266
|
}
|
|
267
|
-
return [
|
|
267
|
+
return [Ut(r, o + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
268
268
|
};
|
|
269
269
|
class O {
|
|
270
270
|
constructor({ strings: t, _$litType$: e }, s) {
|
|
271
271
|
let a;
|
|
272
272
|
this.parts = [];
|
|
273
273
|
let o = 0, i = 0;
|
|
274
|
-
const n = t.length - 1, l = this.parts, [p, h] =
|
|
274
|
+
const n = t.length - 1, l = this.parts, [p, h] = oe(t, e);
|
|
275
275
|
if (this.el = O.createElement(p, s), S.currentNode = this.el.content, e === 2 || e === 3) {
|
|
276
|
-
const
|
|
277
|
-
|
|
276
|
+
const d = this.el.content.firstChild;
|
|
277
|
+
d.replaceWith(...d.childNodes);
|
|
278
278
|
}
|
|
279
279
|
for (; (a = S.nextNode()) !== null && l.length < n; ) {
|
|
280
280
|
if (a.nodeType === 1) {
|
|
281
|
-
if (a.hasAttributes()) for (const
|
|
282
|
-
const f = h[i++], u = a.getAttribute(
|
|
283
|
-
l.push({ type: 1, index: o, name: v[2], strings: u, ctor: v[1] === "." ?
|
|
284
|
-
} else
|
|
285
|
-
if (
|
|
286
|
-
const
|
|
281
|
+
if (a.hasAttributes()) for (const d of a.getAttributeNames()) if (d.endsWith(zt)) {
|
|
282
|
+
const f = h[i++], u = a.getAttribute(d).split(_), v = /([.?@])?(.*)/.exec(f);
|
|
283
|
+
l.push({ type: 1, index: o, name: v[2], strings: u, ctor: v[1] === "." ? ne : v[1] === "?" ? le : v[1] === "@" ? ce : Z }), a.removeAttribute(d);
|
|
284
|
+
} else d.startsWith(_) && (l.push({ type: 6, index: o }), a.removeAttribute(d));
|
|
285
|
+
if (Ot.test(a.tagName)) {
|
|
286
|
+
const d = a.textContent.split(_), f = d.length - 1;
|
|
287
287
|
if (f > 0) {
|
|
288
288
|
a.textContent = G ? G.emptyScript : "";
|
|
289
|
-
for (let u = 0; u < f; u++) a.append(
|
|
290
|
-
a.append(
|
|
289
|
+
for (let u = 0; u < f; u++) a.append(d[u], z()), S.nextNode(), l.push({ type: 2, index: ++o });
|
|
290
|
+
a.append(d[f], z());
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
} else if (a.nodeType === 8) if (a.data === Bt) l.push({ type: 2, index: o });
|
|
294
294
|
else {
|
|
295
|
-
let
|
|
296
|
-
for (; (
|
|
295
|
+
let d = -1;
|
|
296
|
+
for (; (d = a.data.indexOf(_, d + 1)) !== -1; ) l.push({ type: 7, index: o }), d += _.length - 1;
|
|
297
297
|
}
|
|
298
298
|
o++;
|
|
299
299
|
}
|
|
@@ -306,10 +306,10 @@ class O {
|
|
|
306
306
|
function C(r, t, e = r, s) {
|
|
307
307
|
if (t === I) return t;
|
|
308
308
|
let a = s !== void 0 ? e._$Co?.[s] : e._$Cl;
|
|
309
|
-
const o =
|
|
309
|
+
const o = B(t) ? void 0 : t._$litDirective$;
|
|
310
310
|
return a?.constructor !== o && (a?._$AO?.(!1), o === void 0 ? a = void 0 : (a = new o(r), a._$AT(r, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = a : e._$Cl = a), a !== void 0 && (t = C(r, a._$AS(r, t.values), a, s)), t;
|
|
311
311
|
}
|
|
312
|
-
class
|
|
312
|
+
class ie {
|
|
313
313
|
constructor(t, e) {
|
|
314
314
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
315
315
|
}
|
|
@@ -326,7 +326,7 @@ class oe {
|
|
|
326
326
|
for (; l !== void 0; ) {
|
|
327
327
|
if (i === l.index) {
|
|
328
328
|
let p;
|
|
329
|
-
l.type === 2 ? p = new
|
|
329
|
+
l.type === 2 ? p = new F(o, o.nextSibling, this, t) : l.type === 1 ? p = new l.ctor(o, l.name, l.strings, this, t) : l.type === 6 && (p = new de(o, this, t)), this._$AV.push(p), l = s[++n];
|
|
330
330
|
}
|
|
331
331
|
i !== l?.index && (o = S.nextNode(), i++);
|
|
332
332
|
}
|
|
@@ -337,7 +337,7 @@ class oe {
|
|
|
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 F {
|
|
341
341
|
get _$AU() {
|
|
342
342
|
return this._$AM?._$AU ?? this._$Cv;
|
|
343
343
|
}
|
|
@@ -356,7 +356,7 @@ class U {
|
|
|
356
356
|
return this._$AB;
|
|
357
357
|
}
|
|
358
358
|
_$AI(t, e = this) {
|
|
359
|
-
t = C(this, t, e),
|
|
359
|
+
t = C(this, t, e), B(t) ? t === m || t == null || t === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : t !== this._$AH && t !== I && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : re(t) ? this.k(t) : this._(t);
|
|
360
360
|
}
|
|
361
361
|
O(t) {
|
|
362
362
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -365,38 +365,38 @@ class U {
|
|
|
365
365
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
366
366
|
}
|
|
367
367
|
_(t) {
|
|
368
|
-
this._$AH !== m &&
|
|
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, a = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = O.createElement(
|
|
371
|
+
const { values: e, _$litType$: s } = t, a = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = O.createElement(Ut(s.h, s.h[0]), this.options)), s);
|
|
372
372
|
if (this._$AH?._$AD === a) this._$AH.p(e);
|
|
373
373
|
else {
|
|
374
|
-
const o = new
|
|
374
|
+
const o = new ie(a, 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 = It.get(t.strings);
|
|
380
|
+
return e === void 0 && It.set(t.strings, e = new O(t)), e;
|
|
381
381
|
}
|
|
382
382
|
k(t) {
|
|
383
|
-
|
|
383
|
+
dt(this._$AH) || (this._$AH = [], this._$AR());
|
|
384
384
|
const e = this._$AH;
|
|
385
385
|
let s, a = 0;
|
|
386
|
-
for (const o of t) a === e.length ? e.push(s = new
|
|
386
|
+
for (const o of t) a === e.length ? e.push(s = new F(this.O(z()), this.O(z()), this, this.options)) : s = e[a], s._$AI(o), a++;
|
|
387
387
|
a < e.length && (this._$AR(s && s._$AB.nextSibling, a), e.length = a);
|
|
388
388
|
}
|
|
389
389
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
390
390
|
for (this._$AP?.(!1, !0, e); t !== this._$AB; ) {
|
|
391
|
-
const s =
|
|
392
|
-
|
|
391
|
+
const s = wt(t).nextSibling;
|
|
392
|
+
wt(t).remove(), t = s;
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
395
|
setConnected(t) {
|
|
396
396
|
this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
|
-
class
|
|
399
|
+
class Z {
|
|
400
400
|
get tagName() {
|
|
401
401
|
return this.element.tagName;
|
|
402
402
|
}
|
|
@@ -409,11 +409,11 @@ class K {
|
|
|
409
409
|
_$AI(t, e = this, s, a) {
|
|
410
410
|
const o = this.strings;
|
|
411
411
|
let i = !1;
|
|
412
|
-
if (o === void 0) t = C(this, t, e, 0), i = !
|
|
412
|
+
if (o === void 0) t = C(this, t, e, 0), i = !B(t) || t !== this._$AH && t !== I, i && (this._$AH = t);
|
|
413
413
|
else {
|
|
414
414
|
const n = t;
|
|
415
415
|
let l, p;
|
|
416
|
-
for (t = o[0], l = 0; l < o.length - 1; l++) p = C(this, n[s + l], e, l), p === I && (p = this._$AH[l]), i ||= !
|
|
416
|
+
for (t = o[0], l = 0; l < o.length - 1; l++) p = C(this, n[s + l], e, l), p === I && (p = this._$AH[l]), i ||= !B(p) || p !== this._$AH[l], p === m ? t = m : t !== m && (t += (p ?? "") + o[l + 1]), this._$AH[l] = p;
|
|
417
417
|
}
|
|
418
418
|
i && !a && this.j(t);
|
|
419
419
|
}
|
|
@@ -421,7 +421,7 @@ class K {
|
|
|
421
421
|
t === m ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
|
-
class
|
|
424
|
+
class ne extends Z {
|
|
425
425
|
constructor() {
|
|
426
426
|
super(...arguments), this.type = 3;
|
|
427
427
|
}
|
|
@@ -429,7 +429,7 @@ class ie extends K {
|
|
|
429
429
|
this.element[this.name] = t === m ? void 0 : t;
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
|
-
class
|
|
432
|
+
class le extends Z {
|
|
433
433
|
constructor() {
|
|
434
434
|
super(...arguments), this.type = 4;
|
|
435
435
|
}
|
|
@@ -437,7 +437,7 @@ class ne extends K {
|
|
|
437
437
|
this.element.toggleAttribute(this.name, !!t && t !== m);
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
class
|
|
440
|
+
class ce extends Z {
|
|
441
441
|
constructor(t, e, s, a, o) {
|
|
442
442
|
super(t, e, s, a, o), this.type = 5;
|
|
443
443
|
}
|
|
@@ -450,7 +450,7 @@ class le extends K {
|
|
|
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 de {
|
|
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
|
}
|
|
@@ -461,18 +461,18 @@ class ce {
|
|
|
461
461
|
C(this, t);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
const
|
|
464
|
+
const he = ct.litHtmlPolyfillSupport;
|
|
465
|
+
he?.(O, F), (ct.litHtmlVersions ??= []).push("3.3.3");
|
|
466
|
+
const pe = (r, t, e) => {
|
|
467
467
|
const s = e?.renderBefore ?? t;
|
|
468
468
|
let a = s._$litPart$;
|
|
469
469
|
if (a === void 0) {
|
|
470
470
|
const o = e?.renderBefore ?? null;
|
|
471
|
-
s._$litPart$ = a = new
|
|
471
|
+
s._$litPart$ = a = new F(t.insertBefore(z(), o), o, void 0, e ?? {});
|
|
472
472
|
}
|
|
473
473
|
return a._$AI(r), a;
|
|
474
474
|
};
|
|
475
|
-
const
|
|
475
|
+
const ht = globalThis;
|
|
476
476
|
class R extends T {
|
|
477
477
|
constructor() {
|
|
478
478
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
@@ -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 = pe(e, this.renderRoot, this.renderOptions);
|
|
487
487
|
}
|
|
488
488
|
connectedCallback() {
|
|
489
489
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -495,18 +495,18 @@ class R extends T {
|
|
|
495
495
|
return I;
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
|
-
R._$litElement$ = !0, R.finalized = !0,
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
(
|
|
502
|
-
const
|
|
503
|
-
function
|
|
498
|
+
R._$litElement$ = !0, R.finalized = !0, ht.litElementHydrateSupport?.({ LitElement: R });
|
|
499
|
+
const me = ht.litElementPolyfillSupport;
|
|
500
|
+
me?.({ LitElement: R });
|
|
501
|
+
(ht.litElementVersions ??= []).push("4.2.2");
|
|
502
|
+
const fe = 50;
|
|
503
|
+
function ue(r = {}) {
|
|
504
504
|
const t = Object.entries(r).filter(([, s]) => s != null && s !== "");
|
|
505
505
|
if (!t.length) return "";
|
|
506
506
|
const e = new URLSearchParams();
|
|
507
507
|
return t.forEach(([s, a]) => e.set(s, String(a))), `?${e.toString()}`;
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function ge({ baseUrl: r, token: t = "", fetchFn: e } = {}) {
|
|
510
510
|
if (!r) throw new Error("createClient requires a baseUrl");
|
|
511
511
|
const s = r.replace(/\/+$/, ""), a = e || ((...n) => fetch(...n));
|
|
512
512
|
async function o(n) {
|
|
@@ -522,8 +522,8 @@ function ue({ baseUrl: r, token: t = "", fetchFn: e } = {}) {
|
|
|
522
522
|
async function i(n, l = {}) {
|
|
523
523
|
const p = [];
|
|
524
524
|
let h = null;
|
|
525
|
-
for (let
|
|
526
|
-
const f =
|
|
525
|
+
for (let d = 0; d < fe; d += 1) {
|
|
526
|
+
const f = ue(h ? { ...l, cursor: h } : l), u = await o(`${n}${f}`);
|
|
527
527
|
if (p.push(...u.items || []), h = u.nextCursor || null, !h) break;
|
|
528
528
|
}
|
|
529
529
|
return { items: p, total: p.length, nextCursor: null };
|
|
@@ -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 ? ge({ 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" ? c`<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 ? c`<div class="error">Unable to load right now. <button class="chip" @click=${() => this.load()}>Retry</button></div>` : this.data ? this.renderView() : c`<div class="loading" role="status">Loading…</div>`;
|
|
605
605
|
}
|
|
606
606
|
renderView() {
|
|
607
|
-
return
|
|
607
|
+
return c``;
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
|
-
const g = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])),
|
|
610
|
+
const g = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), $e = 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])), ge = w`
|
|
|
641
641
|
outline-offset: 1px;
|
|
642
642
|
}
|
|
643
643
|
.mut { color: var(--hsot-gray-5); }
|
|
644
|
-
`,
|
|
644
|
+
`, ve = 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])), ge = 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
|
+
`, ye = 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])), ge = 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
|
+
`, be = 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])), ge = 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
|
+
`, we = 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,13 +737,19 @@ const g = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), ge = 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
|
+
`, xe = w`
|
|
741
741
|
.swatch {
|
|
742
742
|
display: inline-flex; align-items: center; justify-content: center;
|
|
743
743
|
width: 26px; height: 26px; border-radius: 50%;
|
|
744
744
|
font-family: var(--hsot-heading-font); font-weight: 700; font-size: 0.55rem;
|
|
745
745
|
margin-right: 0.5rem; vertical-align: middle; flex: none;
|
|
746
746
|
}
|
|
747
|
+
/* Picked school logo (DEV-1236 ref) in the same footprint: contained,
|
|
748
|
+
never cropped, on white so any logo art stays legible. */
|
|
749
|
+
.swatch.logo {
|
|
750
|
+
object-fit: contain; background: var(--hsot-white);
|
|
751
|
+
border: 1px solid var(--hsot-gray-2); padding: 2px; box-sizing: border-box;
|
|
752
|
+
}
|
|
747
753
|
.rankbadge { font-weight: 700; color: var(--hsot-red-deep); font-size: 0.8em; margin-right: 0.22rem; }
|
|
748
754
|
.dots { display: inline-flex; gap: 3px; }
|
|
749
755
|
.dot {
|
|
@@ -755,7 +761,7 @@ const g = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), ge = w`
|
|
|
755
761
|
.dot.W { background: var(--hsot-win); }
|
|
756
762
|
.dot.L { background: var(--hsot-loss); }
|
|
757
763
|
.dot.T { background: var(--hsot-tie); }
|
|
758
|
-
`,
|
|
764
|
+
`, _e = w`
|
|
759
765
|
ul.gamelist { list-style: none; margin: 0; padding: 0; }
|
|
760
766
|
.gamelist li {
|
|
761
767
|
display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 1rem;
|
|
@@ -772,36 +778,36 @@ const g = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), ge = w`
|
|
|
772
778
|
.gamelist .opp a:hover { text-decoration: underline; }
|
|
773
779
|
.gamelist .where { color: var(--hsot-gray-5); font-size: 0.78rem; }
|
|
774
780
|
.gamelist a.box { font-size: 0.78rem; }
|
|
775
|
-
`, H = [
|
|
776
|
-
function
|
|
781
|
+
`, H = [$e, ve, ye, be, we, xe, _e];
|
|
782
|
+
function pt(r) {
|
|
777
783
|
return r.state !== "final" ? null : r.forfeit && r.forfeit !== "none" ? r.forfeit : r.homeScore > r.awayScore ? "home" : r.awayScore > r.homeScore ? "away" : r.tiebreakWinner && r.tiebreakWinner !== "none" ? r.tiebreakWinner : "tie";
|
|
778
784
|
}
|
|
779
785
|
function M(r, t) {
|
|
780
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]), a = r.filter((o) => o.state === "final" && o.gameType !== "scrimmage" && !0).sort((o, i) => String(o.date).localeCompare(String(i.date)));
|
|
781
787
|
for (const o of a) {
|
|
782
|
-
const i =
|
|
788
|
+
const i = pt(o), n = o.gameType === "conference";
|
|
783
789
|
for (const l of ["home", "away"]) {
|
|
784
790
|
const p = l === "home" ? o.homeTeamId : o.awayTeamId;
|
|
785
791
|
if (!p) continue;
|
|
786
|
-
const h = s(p),
|
|
787
|
-
h.pf +=
|
|
792
|
+
const h = s(p), d = l === "home" ? o.homeScore : o.awayScore, f = l === "home" ? o.awayScore : o.homeScore;
|
|
793
|
+
h.pf += d, h.pa += f;
|
|
788
794
|
let u = "T";
|
|
789
|
-
i === "tie" ? (h.t += 1, n && (h.ct += 1)) : i === l ? (h.w += 1, n && (h.cw += 1), u = "W") : (h.l += 1, n && (h.cl += 1), u = "L"), h.results.push({ gameId: o.id, date: o.date, mark: u, my:
|
|
795
|
+
i === "tie" ? (h.t += 1, n && (h.ct += 1)) : i === l ? (h.w += 1, n && (h.cw += 1), u = "W") : (h.l += 1, n && (h.cl += 1), u = "L"), h.results.push({ gameId: o.id, date: o.date, mark: u, my: d, their: f, opp: l === "home" ? o.awayTeamId : o.homeTeamId, conf: n });
|
|
790
796
|
}
|
|
791
797
|
}
|
|
792
798
|
return e;
|
|
793
799
|
}
|
|
794
|
-
function
|
|
800
|
+
function J(r) {
|
|
795
801
|
if (!r || !r.length) return "";
|
|
796
802
|
const t = r[r.length - 1].mark;
|
|
797
803
|
let e = 0;
|
|
798
804
|
for (let s = r.length - 1; s >= 0 && r[s].mark === t; s -= 1) e += 1;
|
|
799
805
|
return t + e;
|
|
800
806
|
}
|
|
801
|
-
const
|
|
807
|
+
const Ct = (r, t, e) => {
|
|
802
808
|
const s = r + t + e;
|
|
803
809
|
return s ? (r + e / 2) / s : 0;
|
|
804
|
-
},
|
|
810
|
+
}, Et = (r) => r.toFixed(3).replace("0.", ".");
|
|
805
811
|
function x(r, t = !1) {
|
|
806
812
|
if (!r) return "0-0";
|
|
807
813
|
const e = t ? r.cw : r.w, s = t ? r.cl : r.l, a = t ? r.ct : r.t;
|
|
@@ -810,17 +816,17 @@ function x(r, t = !1) {
|
|
|
810
816
|
function Ft(r, t) {
|
|
811
817
|
return r.map((e) => {
|
|
812
818
|
const s = t[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] };
|
|
813
|
-
return { team: e, rec: s, confPct:
|
|
819
|
+
return { team: e, rec: s, confPct: Ct(s.cw, s.cl, s.ct), overallPct: Ct(s.w, s.l, s.t) };
|
|
814
820
|
}).sort((e, s) => s.confPct - e.confPct || s.overallPct - e.overallPct || s.rec.pf - s.rec.pa - (e.rec.pf - e.rec.pa));
|
|
815
821
|
}
|
|
816
|
-
function
|
|
822
|
+
function mt(r, t) {
|
|
817
823
|
return r.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;
|
|
818
824
|
}
|
|
819
|
-
function
|
|
825
|
+
function Pt(r, t) {
|
|
820
826
|
const e = r[t];
|
|
821
827
|
return e && e.results.length ? e.results[e.results.length - 1] : null;
|
|
822
828
|
}
|
|
823
|
-
const
|
|
829
|
+
const at = {
|
|
824
830
|
game: "/{sport}/game/{id}/",
|
|
825
831
|
school: "/school/{id}/",
|
|
826
832
|
section: "/{sport}/{view}/"
|
|
@@ -830,36 +836,36 @@ function $(r, t) {
|
|
|
830
836
|
}
|
|
831
837
|
function L(r) {
|
|
832
838
|
return {
|
|
833
|
-
game: r.getAttribute("game-href") ||
|
|
834
|
-
school: r.getAttribute("school-href") ||
|
|
835
|
-
section: r.getAttribute("section-href") ||
|
|
839
|
+
game: r.getAttribute("game-href") || at.game,
|
|
840
|
+
school: r.getAttribute("school-href") || at.school,
|
|
841
|
+
section: r.getAttribute("section-href") || at.section
|
|
836
842
|
};
|
|
837
843
|
}
|
|
838
|
-
const
|
|
844
|
+
const Q = (r) => r ? r.charAt(0).toUpperCase() + r.slice(1) : "";
|
|
839
845
|
function y(r, t) {
|
|
840
846
|
if (!r) return "TBD";
|
|
841
847
|
const [e, s, a] = String(r).split("-").map(Number);
|
|
842
848
|
return !e || !s || !a ? "TBD" : new Date(e, s - 1, a).toLocaleDateString("en-US", t || { weekday: "short", month: "short", day: "numeric" });
|
|
843
849
|
}
|
|
844
|
-
function
|
|
850
|
+
function X(r) {
|
|
845
851
|
if (!r) return "";
|
|
846
852
|
const [t, e] = String(r).split(":").map(Number);
|
|
847
853
|
if (Number.isNaN(t)) return "";
|
|
848
854
|
const s = t >= 12 ? "PM" : "AM";
|
|
849
855
|
return `${(t + 11) % 12 + 1}:${String(e || 0).padStart(2, "0")} ${s}`;
|
|
850
856
|
}
|
|
851
|
-
function
|
|
857
|
+
function ke(r) {
|
|
852
858
|
return r ? `${Math.floor(r / 12)}-${r % 12}` : "·";
|
|
853
859
|
}
|
|
854
|
-
function
|
|
860
|
+
function tt(r = /* @__PURE__ */ new Date()) {
|
|
855
861
|
const t = r.getFullYear();
|
|
856
862
|
return r.getMonth() >= 6 ? `${t}-${t + 1}` : `${t - 1}-${t}`;
|
|
857
863
|
}
|
|
858
|
-
function
|
|
864
|
+
function ot(r = /* @__PURE__ */ new Date()) {
|
|
859
865
|
const t = (e) => String(e).padStart(2, "0");
|
|
860
866
|
return `${r.getFullYear()}-${t(r.getMonth() + 1)}-${t(r.getDate())}`;
|
|
861
867
|
}
|
|
862
|
-
function
|
|
868
|
+
function ft(r) {
|
|
863
869
|
return r ? (r.abbr || r.name || "?").slice(0, 4).toUpperCase() : "?";
|
|
864
870
|
}
|
|
865
871
|
function W(r) {
|
|
@@ -867,19 +873,19 @@ function W(r) {
|
|
|
867
873
|
const t = parseInt(r.slice(1), 16), e = t >> 16 & 255, s = t >> 8 & 255, a = t & 255;
|
|
868
874
|
return 0.299 * e + 0.587 * s + 0.114 * a > 150 ? "#0F1B33" : "#FFFFFF";
|
|
869
875
|
}
|
|
870
|
-
const
|
|
876
|
+
const Se = (r) => {
|
|
871
877
|
const t = ["th", "st", "nd", "rd"], e = r % 100;
|
|
872
878
|
return r + (t[(e - 20) % 10] || t[e] || t[0]);
|
|
873
879
|
};
|
|
874
|
-
function
|
|
880
|
+
function Ae(r) {
|
|
875
881
|
if (r.state === "live") return { kind: "live", label: `Live · ${r.period || ""}`.replace(/ · $/, "") };
|
|
876
882
|
if (r.state === "final") {
|
|
877
883
|
const t = [];
|
|
878
884
|
return r.finish === "overtime" && t.push("OT"), r.finish === "shootout" && t.push("PK-SO"), r.forfeit && r.forfeit !== "none" && t.push("Forfeit"), { kind: "final", label: `Final${t.length ? ` · ${t.join(" · ")}` : ""}` };
|
|
879
885
|
}
|
|
880
|
-
return r.state === "postponed" ? { kind: "warn", label: "Postponed" } : r.state === "canceled" ? { kind: "warn", label: "Canceled" } : { kind: "sched", label: `${y(r.date, { month: "short", day: "numeric" })} · ${
|
|
886
|
+
return r.state === "postponed" ? { kind: "warn", label: "Postponed" } : r.state === "canceled" ? { kind: "warn", label: "Canceled" } : { kind: "sched", label: `${y(r.date, { month: "short", day: "numeric" })} · ${X(r.time)}`.replace(/ · $/, "") };
|
|
881
887
|
}
|
|
882
|
-
function
|
|
888
|
+
function Ht(r, t, e, s, a) {
|
|
883
889
|
const o = t[e];
|
|
884
890
|
if (!o) return null;
|
|
885
891
|
const i = /* @__PURE__ */ new Map();
|
|
@@ -895,7 +901,7 @@ function Ut(r, t, e, s, a) {
|
|
|
895
901
|
}
|
|
896
902
|
return n ? n.rank : null;
|
|
897
903
|
}
|
|
898
|
-
function
|
|
904
|
+
function Te(r, t, e) {
|
|
899
905
|
if (!r) return { kind: "none", delta: 0 };
|
|
900
906
|
const s = (r.teamIds || []).indexOf(e) + 1;
|
|
901
907
|
if (!s) return { kind: "none", delta: 0 };
|
|
@@ -905,45 +911,58 @@ function Ae(r, t, e) {
|
|
|
905
911
|
const o = a - s;
|
|
906
912
|
return o > 0 ? { kind: "up", delta: o } : o < 0 ? { kind: "down", delta: -o } : { kind: "same", delta: 0 };
|
|
907
913
|
}
|
|
914
|
+
function Ie(r) {
|
|
915
|
+
return /^https?:\/\//i.test(String(r || ""));
|
|
916
|
+
}
|
|
917
|
+
function V(r, t) {
|
|
918
|
+
const e = r?.logoAssetId;
|
|
919
|
+
if (!Ie(e)) return "";
|
|
920
|
+
const s = Math.max(1, Math.round(t * 2)), a = e.includes("?") ? "&" : "?";
|
|
921
|
+
return `${e}${a}w=${s}&h=${s}&f=webp`;
|
|
922
|
+
}
|
|
908
923
|
const N = (r, t) => {
|
|
909
924
|
const e = r.teamsById[t];
|
|
910
925
|
return e ? r.schoolsById[e.schoolId] : null;
|
|
911
|
-
}, P = (r, t) => N(r, t)?.name || "TBD",
|
|
912
|
-
function
|
|
926
|
+
}, P = (r, t) => N(r, t)?.name || "TBD", q = (r, t) => N(r, t)?.abbr || "TBD";
|
|
927
|
+
function U(r, t = 26) {
|
|
913
928
|
if (!r) return m;
|
|
914
|
-
const e = r
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
929
|
+
const e = V(r, t);
|
|
930
|
+
if (e)
|
|
931
|
+
return c`<img class="swatch logo" aria-hidden="true" alt="" loading="lazy"
|
|
932
|
+
src=${e} style="width:${t}px;height:${t}px" />`;
|
|
933
|
+
const s = r.colorPrimary || "#030711", a = W(s);
|
|
934
|
+
return c`<span class="swatch" aria-hidden="true"
|
|
935
|
+
style="width:${t}px;height:${t}px;background:${s};color:${a};font-size:${Math.max(8, t * 0.28)}px"
|
|
936
|
+
>${ft(r)}</span>`;
|
|
918
937
|
}
|
|
919
|
-
function
|
|
920
|
-
const s =
|
|
921
|
-
return s ?
|
|
938
|
+
function ut(r, t, e) {
|
|
939
|
+
const s = Ht(r.rankings, r.teamsById, t, r.sport, e);
|
|
940
|
+
return s ? c`<span class="rankbadge">#${s}</span>` : m;
|
|
922
941
|
}
|
|
923
|
-
function
|
|
942
|
+
function it(r, t, e) {
|
|
924
943
|
const s = N(r, t);
|
|
925
|
-
return s ?
|
|
944
|
+
return s ? c`${ut(r, t, e)}<a href=${$(r.hrefs.school, { id: s.id })}>${s.name}</a>` : c`<span class="mut">TBD</span>`;
|
|
926
945
|
}
|
|
927
|
-
function
|
|
946
|
+
function gt(r, t, e = 5) {
|
|
928
947
|
const s = r.records[t];
|
|
929
|
-
if (!s || !s.results.length) return
|
|
948
|
+
if (!s || !s.results.length) return c`<span class="mut">·</span>`;
|
|
930
949
|
const a = s.results.slice(-1 * e);
|
|
931
|
-
return
|
|
932
|
-
${a.map((o) =>
|
|
950
|
+
return c`<span class="dots" role="img" aria-label="last ${a.length} results">
|
|
951
|
+
${a.map((o) => c`<a class="dot ${o.mark}"
|
|
933
952
|
title="${o.mark} ${o.my}-${o.their} vs ${P(r, o.opp)}"
|
|
934
953
|
href=${$(r.hrefs.game, { sport: r.sport, id: o.gameId })}>${o.mark}</a>`)}
|
|
935
954
|
</span>`;
|
|
936
955
|
}
|
|
937
|
-
function
|
|
938
|
-
const t =
|
|
939
|
-
return
|
|
956
|
+
function Y(r) {
|
|
957
|
+
const t = Ae(r);
|
|
958
|
+
return c`<span class="pill ${t.kind}">${t.label}</span>`;
|
|
940
959
|
}
|
|
941
|
-
function
|
|
942
|
-
if (!t) return
|
|
960
|
+
function Mt(r, t, e) {
|
|
961
|
+
if (!t) return c`<span class="mut">·</span>`;
|
|
943
962
|
const s = t.homeTeamId === e ? t.awayTeamId : t.homeTeamId, a = t.homeTeamId === e ? "vs" : "at";
|
|
944
|
-
return
|
|
963
|
+
return c`${t.state === "live" ? c`<span class="pill live">Live</span> ` : c`${y(t.date, { month: "numeric", day: "numeric" })} `}${a} ${q(r, s)}`;
|
|
945
964
|
}
|
|
946
|
-
class
|
|
965
|
+
class Lt extends b {
|
|
947
966
|
static styles = H;
|
|
948
967
|
static properties = {
|
|
949
968
|
...b.properties,
|
|
@@ -957,11 +976,11 @@ class Mt extends b {
|
|
|
957
976
|
connectedCallback() {
|
|
958
977
|
if (super.connectedCallback(), !this.date) {
|
|
959
978
|
const t = new URLSearchParams(globalThis.location?.search || "").get("date");
|
|
960
|
-
this.date = t ||
|
|
979
|
+
this.date = t || ot();
|
|
961
980
|
}
|
|
962
981
|
}
|
|
963
982
|
async fetchData(t) {
|
|
964
|
-
const e = this.season ||
|
|
983
|
+
const e = this.season || tt(), [s, a, o, i, n] = await Promise.all([
|
|
965
984
|
t.listSchools(),
|
|
966
985
|
t.listTeams({ sport: this.sport }),
|
|
967
986
|
t.listConferences(),
|
|
@@ -992,10 +1011,10 @@ class Mt extends b {
|
|
|
992
1011
|
return a.forEach((i) => {
|
|
993
1012
|
const n = i.gameType === "conference" && i.conferenceId ? e[i.conferenceId]?.name || "Conference" : i.gameType === "playoff" ? "Playoffs" : i.gameType === "scrimmage" ? "Scrimmages" : "Nonconference";
|
|
994
1013
|
o.has(n) || o.set(n, []), o.get(n).push(i);
|
|
995
|
-
}),
|
|
1014
|
+
}), c`
|
|
996
1015
|
<div class="band">
|
|
997
1016
|
<div class="inner">
|
|
998
|
-
<h1>${
|
|
1017
|
+
<h1>${Q(this.sport)} scores & schedules</h1>
|
|
999
1018
|
<p class="sub">${y(this.date, { weekday: "long", month: "long", day: "numeric", year: "numeric" })} · ${a.length} games</p>
|
|
1000
1019
|
</div>
|
|
1001
1020
|
</div>
|
|
@@ -1005,8 +1024,8 @@ class Mt extends b {
|
|
|
1005
1024
|
<select id="datesel" @change=${(i) => {
|
|
1006
1025
|
this.date = i.target.value;
|
|
1007
1026
|
}}>
|
|
1008
|
-
${s.map((i) =>
|
|
1009
|
-
${y(i, { weekday: "short", month: "short", day: "numeric" })}${i ===
|
|
1027
|
+
${s.map((i) => c`<option value=${i} ?selected=${i === this.date}>
|
|
1028
|
+
${y(i, { weekday: "short", month: "short", day: "numeric" })}${i === ot() ? " · today" : ""}
|
|
1010
1029
|
</option>`)}
|
|
1011
1030
|
</select>
|
|
1012
1031
|
<button class="chip" ?disabled=${s.indexOf(this.date) <= 0}
|
|
@@ -1020,8 +1039,8 @@ class Mt extends b {
|
|
|
1020
1039
|
<span class="spacer"></span>
|
|
1021
1040
|
<span class="asof">Live games first · report a score to see it update here</span>
|
|
1022
1041
|
</div>
|
|
1023
|
-
${a.length ? m :
|
|
1024
|
-
${[...o.entries()].map(([i, n]) =>
|
|
1042
|
+
${a.length ? m : c`<p class="empty">No ${this.sport} games on this date.</p>`}
|
|
1043
|
+
${[...o.entries()].map(([i, n]) => c`
|
|
1025
1044
|
<div class="section-title">${i}</div>
|
|
1026
1045
|
<div class="card"><ul class="gamelist">
|
|
1027
1046
|
${n.map((l) => this.renderGame(t, l))}
|
|
@@ -1031,21 +1050,21 @@ class Mt extends b {
|
|
|
1031
1050
|
`;
|
|
1032
1051
|
}
|
|
1033
1052
|
renderGame(t, e) {
|
|
1034
|
-
const s = e.state === "final" || e.state === "live" ? `${e.awayScore}-${e.homeScore}` :
|
|
1035
|
-
return
|
|
1053
|
+
const s = e.state === "final" || e.state === "live" ? `${e.awayScore}-${e.homeScore}` : X(e.time);
|
|
1054
|
+
return c`
|
|
1036
1055
|
<li>
|
|
1037
|
-
${
|
|
1038
|
-
<span class="opp">${
|
|
1056
|
+
${Y(e)}
|
|
1057
|
+
<span class="opp">${it(t, e.awayTeamId, e.date)} at ${it(t, e.homeTeamId, e.date)}</span>
|
|
1039
1058
|
<span class="res" style="width:auto">${s}</span>
|
|
1040
1059
|
<span class="where">${e.venue || ""}</span>
|
|
1041
|
-
${e.broadcast ?
|
|
1060
|
+
${e.broadcast ? c`<span class="pill class">${e.broadcast}</span>` : m}
|
|
1042
1061
|
<a class="box" href=${$(t.hrefs.game, { sport: this.sport, id: e.id })}>Box score →</a>
|
|
1043
1062
|
</li>
|
|
1044
1063
|
`;
|
|
1045
1064
|
}
|
|
1046
1065
|
}
|
|
1047
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores",
|
|
1048
|
-
class
|
|
1066
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores", Lt);
|
|
1067
|
+
class jt extends b {
|
|
1049
1068
|
static styles = H;
|
|
1050
1069
|
static properties = {
|
|
1051
1070
|
...b.properties,
|
|
@@ -1058,7 +1077,7 @@ class Lt extends b {
|
|
|
1058
1077
|
super(), this.sport = "football", this.season = "", this.classFilter = "All", this.query = "";
|
|
1059
1078
|
}
|
|
1060
1079
|
async fetchData(t) {
|
|
1061
|
-
const e = this.season ||
|
|
1080
|
+
const e = this.season || tt(), [s, a, o, i, n] = await Promise.all([
|
|
1062
1081
|
t.listConferences({ active: !0 }),
|
|
1063
1082
|
t.listSchools(),
|
|
1064
1083
|
t.listTeams({ sport: this.sport }),
|
|
@@ -1086,17 +1105,17 @@ class Lt extends b {
|
|
|
1086
1105
|
}
|
|
1087
1106
|
renderView() {
|
|
1088
1107
|
const t = this.ctx, e = ["All", ...new Set(this.data.conferences.flatMap((a) => a.classifications || []))].slice(0, 9), s = this.data.conferences.filter((a) => a.active !== !1).filter((a) => this.classFilter === "All" || (a.classifications || []).includes(this.classFilter));
|
|
1089
|
-
return
|
|
1108
|
+
return c`
|
|
1090
1109
|
<div class="band">
|
|
1091
1110
|
<div class="inner">
|
|
1092
|
-
<h1>${
|
|
1111
|
+
<h1>${Q(this.sport)} standings</h1>
|
|
1093
1112
|
<p class="sub">${this.data.season} season · every conference, computed live from reported results</p>
|
|
1094
1113
|
</div>
|
|
1095
1114
|
</div>
|
|
1096
1115
|
<div class="view">
|
|
1097
1116
|
<div class="toolbar">
|
|
1098
1117
|
<div role="group" aria-label="Classification filter">
|
|
1099
|
-
${e.map((a) =>
|
|
1118
|
+
${e.map((a) => c`<button class="chip ${this.classFilter === a ? "on" : ""}"
|
|
1100
1119
|
@click=${() => {
|
|
1101
1120
|
this.classFilter = a;
|
|
1102
1121
|
}}>${a}</button>`)}
|
|
@@ -1106,7 +1125,7 @@ class Lt extends b {
|
|
|
1106
1125
|
this.query = a.target.value;
|
|
1107
1126
|
}}>
|
|
1108
1127
|
<span class="spacer"></span>
|
|
1109
|
-
<span class="asof">Records through ${y(
|
|
1128
|
+
<span class="asof">Records through ${y(ot(), { month: "long", day: "numeric" })} · conference games count toward both records · scrimmages toward neither</span>
|
|
1110
1129
|
</div>
|
|
1111
1130
|
${s.map((a) => this.renderConference(t, a))}
|
|
1112
1131
|
</div>
|
|
@@ -1116,11 +1135,11 @@ class Lt extends b {
|
|
|
1116
1135
|
const s = this.data.teams.filter((i) => i.conferenceId === e.id);
|
|
1117
1136
|
if (!s.length) return m;
|
|
1118
1137
|
const a = this.query.trim().toLowerCase(), o = Ft(s, t.records);
|
|
1119
|
-
return
|
|
1138
|
+
return c`
|
|
1120
1139
|
<div class="card">
|
|
1121
1140
|
<div class="card-head">
|
|
1122
1141
|
<h2>${e.name}</h2>
|
|
1123
|
-
${(e.classifications || []).map((i) =>
|
|
1142
|
+
${(e.classifications || []).map((i) => c`<span class="pill class">${i}</span>`)}
|
|
1124
1143
|
<span class="meta">${o.length} teams · membership derives from teams</span>
|
|
1125
1144
|
</div>
|
|
1126
1145
|
<div class="tablewrap"><table class="data">
|
|
@@ -1139,35 +1158,35 @@ class Lt extends b {
|
|
|
1139
1158
|
renderRow(t, e, s, a) {
|
|
1140
1159
|
const o = t.schoolsById[e.team.schoolId], i = o?.name || e.team.name || "TBD";
|
|
1141
1160
|
if (a && !i.toLowerCase().includes(a)) return m;
|
|
1142
|
-
const n = e.rec.pf - e.rec.pa, l =
|
|
1143
|
-
<span class="pill champ" title="${
|
|
1161
|
+
const n = e.rec.pf - e.rec.pa, l = mt(this.data.games, e.team.id), p = (e.team.championships || []).map((d) => c`
|
|
1162
|
+
<span class="pill champ" title="${d.season} ${d.title} champion">★ ${d.season} ${d.title}</span>`), h = () => {
|
|
1144
1163
|
location.href = $(t.hrefs.school, { id: e.team.schoolId });
|
|
1145
1164
|
};
|
|
1146
|
-
return
|
|
1147
|
-
<tr class="rowlink" @click=${(
|
|
1148
|
-
|
|
1165
|
+
return c`
|
|
1166
|
+
<tr class="rowlink" @click=${(d) => {
|
|
1167
|
+
d.target.closest("a") || h();
|
|
1149
1168
|
}}>
|
|
1150
1169
|
<td class="mut">${s + 1}</td>
|
|
1151
1170
|
<td class="teamcell">
|
|
1152
|
-
${
|
|
1171
|
+
${U(o)}${ut(t, e.team.id, null)}
|
|
1153
1172
|
<a href=${$(t.hrefs.school, { id: e.team.schoolId })}>${i}</a> ${p}
|
|
1154
1173
|
</td>
|
|
1155
1174
|
<td class="num">${x(e.rec, !0)}</td>
|
|
1156
|
-
<td class="num">${
|
|
1175
|
+
<td class="num">${Et(e.confPct)}</td>
|
|
1157
1176
|
<td class="num">${x(e.rec)}</td>
|
|
1158
|
-
<td class="num">${
|
|
1177
|
+
<td class="num">${Et(e.overallPct)}</td>
|
|
1159
1178
|
<td class="num">${e.rec.pf}</td>
|
|
1160
1179
|
<td class="num">${e.rec.pa}</td>
|
|
1161
1180
|
<td class="num" style="color:${n >= 0 ? "var(--hsot-win)" : "var(--hsot-loss)"}">${n > 0 ? "+" : ""}${n}</td>
|
|
1162
|
-
<td>${
|
|
1163
|
-
<td>${
|
|
1164
|
-
<td>${
|
|
1181
|
+
<td>${J(e.rec.results) || "·"}</td>
|
|
1182
|
+
<td>${gt(t, e.team.id)}</td>
|
|
1183
|
+
<td>${Mt(t, l, e.team.id)}</td>
|
|
1165
1184
|
</tr>
|
|
1166
1185
|
`;
|
|
1167
1186
|
}
|
|
1168
1187
|
}
|
|
1169
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings",
|
|
1170
|
-
const
|
|
1188
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings", jt);
|
|
1189
|
+
const Ce = w`
|
|
1171
1190
|
.hero1 {
|
|
1172
1191
|
border-radius: var(--hsot-radius-md); color: var(--hsot-white);
|
|
1173
1192
|
padding: 1.3rem 1.4rem; display: flex; align-items: center; gap: 1.2rem;
|
|
@@ -1184,8 +1203,8 @@ const Te = w`
|
|
|
1184
1203
|
.delta.new { background: var(--hsot-straw); color: #6b5900; border-radius: var(--hsot-radius-xs); padding: 0.1rem 0.3rem; font-size: 0.7rem; }
|
|
1185
1204
|
.sparkline { vertical-align: middle; }
|
|
1186
1205
|
`;
|
|
1187
|
-
class
|
|
1188
|
-
static styles = [...H,
|
|
1206
|
+
class Gt extends b {
|
|
1207
|
+
static styles = [...H, Ce];
|
|
1189
1208
|
static properties = {
|
|
1190
1209
|
...b.properties,
|
|
1191
1210
|
sport: { type: String },
|
|
@@ -1202,7 +1221,7 @@ class jt extends b {
|
|
|
1202
1221
|
t && (this.pollDate = t);
|
|
1203
1222
|
}
|
|
1204
1223
|
async fetchData(t) {
|
|
1205
|
-
const e = this.season ||
|
|
1224
|
+
const e = this.season || tt(), [s, a, o, i, n] = await Promise.all([
|
|
1206
1225
|
t.listRankings({ sport: this.sport, ...this.gender ? { gender: this.gender } : {} }),
|
|
1207
1226
|
t.listSchools(),
|
|
1208
1227
|
t.listTeams({ sport: this.sport }),
|
|
@@ -1229,46 +1248,46 @@ class jt extends b {
|
|
|
1229
1248
|
}, this._ctxData = this.data), this._ctx;
|
|
1230
1249
|
}
|
|
1231
1250
|
sparkline(t, e, s) {
|
|
1232
|
-
const n = e.map((
|
|
1233
|
-
const u = (
|
|
1251
|
+
const n = e.map((d, f) => {
|
|
1252
|
+
const u = (d.teamIds || []).indexOf(t);
|
|
1234
1253
|
if (u === -1) return null;
|
|
1235
|
-
const v = e.length === 1 ? 96 / 2 : f / (e.length - 1) * 90 + 3,
|
|
1236
|
-
return { x: v, y:
|
|
1254
|
+
const v = e.length === 1 ? 96 / 2 : f / (e.length - 1) * 90 + 3, et = 3 + u / 24 * 20;
|
|
1255
|
+
return { x: v, y: et };
|
|
1237
1256
|
}), l = [];
|
|
1238
1257
|
let p = [];
|
|
1239
|
-
if (n.forEach((
|
|
1240
|
-
|
|
1258
|
+
if (n.forEach((d) => {
|
|
1259
|
+
d ? p.push(d) : p.length && (l.push(p), p = []);
|
|
1241
1260
|
}), p.length && l.push(p), !l.length) return m;
|
|
1242
1261
|
const h = n[s];
|
|
1243
|
-
return
|
|
1244
|
-
${l.map((
|
|
1245
|
-
points=${
|
|
1246
|
-
${h ?
|
|
1262
|
+
return c`<svg class="sparkline" width=${96} height=${26} viewBox="0 0 ${96} ${26}" role="img" aria-label="rank history">
|
|
1263
|
+
${l.map((d) => Tt`<polyline fill="none" stroke="var(--hsot-red)" stroke-width="2"
|
|
1264
|
+
points=${d.map((f) => `${f.x.toFixed(1)},${f.y.toFixed(1)}`).join(" ")}></polyline>`)}
|
|
1265
|
+
${h ? Tt`<circle cx=${h.x.toFixed(1)} cy=${h.y.toFixed(1)} r="3" fill="var(--hsot-black)"></circle>` : m}
|
|
1247
1266
|
</svg>`;
|
|
1248
1267
|
}
|
|
1249
1268
|
movement(t, e, s) {
|
|
1250
|
-
const a =
|
|
1251
|
-
return a.kind === "up" ?
|
|
1269
|
+
const a = Te(t, e, s);
|
|
1270
|
+
return a.kind === "up" ? c`<span class="delta up">▲ ${a.delta}</span>` : a.kind === "down" ? c`<span class="delta down">▼ ${a.delta}</span>` : a.kind === "new" ? c`<span class="delta new">NEW</span>` : a.kind === "same" ? c`<span class="delta same">—</span>` : c`<span class="delta same">·</span>`;
|
|
1252
1271
|
}
|
|
1253
1272
|
renderView() {
|
|
1254
1273
|
const t = this.ctx, e = this.data.polls;
|
|
1255
|
-
if (!e.length) return
|
|
1256
|
-
const s = Math.max(0, e.findIndex((
|
|
1257
|
-
return
|
|
1274
|
+
if (!e.length) return c`<div class="view"><p class="empty">No ${this.sport} polls published yet this season.</p></div>`;
|
|
1275
|
+
const s = Math.max(0, e.findIndex((d) => d.effectiveDate === this.pollDate)), a = e[s] || e[0], o = e[s + 1] || null, i = e.slice().reverse(), n = i.indexOf(a), l = g(this.data.conferences), p = (a.teamIds || [])[0], h = p ? N(t, p) : null;
|
|
1276
|
+
return c`
|
|
1258
1277
|
<div class="band">
|
|
1259
1278
|
<div class="inner">
|
|
1260
|
-
<h1>${
|
|
1279
|
+
<h1>${Q(this.sport)} Top 25</h1>
|
|
1261
1280
|
<p class="sub">The HighSchoolOT poll · updated weekly · ${e.length} polls this season</p>
|
|
1262
1281
|
</div>
|
|
1263
1282
|
</div>
|
|
1264
1283
|
<div class="view">
|
|
1265
1284
|
<div class="toolbar">
|
|
1266
1285
|
<label class="asof" for="pollsel">Poll of</label>
|
|
1267
|
-
<select id="pollsel" @change=${(
|
|
1268
|
-
this.pollDate =
|
|
1286
|
+
<select id="pollsel" @change=${(d) => {
|
|
1287
|
+
this.pollDate = d.target.value;
|
|
1269
1288
|
}}>
|
|
1270
|
-
${e.map((
|
|
1271
|
-
${y(
|
|
1289
|
+
${e.map((d, f) => c`<option value=${d.effectiveDate} ?selected=${d === a}>
|
|
1290
|
+
${y(d.effectiveDate, { month: "long", day: "numeric", year: "numeric" })}${f === 0 ? " · current" : ""}
|
|
1272
1291
|
</option>`)}
|
|
1273
1292
|
</select>
|
|
1274
1293
|
<button class="chip" ?disabled=${s >= e.length - 1}
|
|
@@ -1289,7 +1308,7 @@ class jt extends b {
|
|
|
1289
1308
|
<th>Conference</th><th>Last result</th><th>Next</th><th>Season</th>
|
|
1290
1309
|
</tr></thead>
|
|
1291
1310
|
<tbody>
|
|
1292
|
-
${(a.teamIds || []).map((
|
|
1311
|
+
${(a.teamIds || []).map((d, f) => f === 0 || !d ? m : this.renderRow(t, a, o, i, n, l, d, f + 1))}
|
|
1293
1312
|
</tbody>
|
|
1294
1313
|
</table></div></div>
|
|
1295
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>
|
|
@@ -1297,17 +1316,17 @@ class jt extends b {
|
|
|
1297
1316
|
`;
|
|
1298
1317
|
}
|
|
1299
1318
|
renderHero(t, e, s, a, o, i) {
|
|
1300
|
-
const n = t.records[a], l =
|
|
1301
|
-
return
|
|
1319
|
+
const n = t.records[a], l = Pt(t.records, a), p = i[t.teamsById[a]?.conferenceId], h = `linear-gradient(120deg, ${o.colorPrimary || "#030711"} 0%, var(--hsot-black) 85%)`;
|
|
1320
|
+
return c`
|
|
1302
1321
|
<div class="hero1" style="background:${h}">
|
|
1303
1322
|
<div class="bigrank">#1</div>
|
|
1304
|
-
${
|
|
1323
|
+
${U(o, 64)}
|
|
1305
1324
|
<div>
|
|
1306
1325
|
<h2><a href=${$(t.hrefs.school, { id: o.id })}>${o.name} ${o.mascot || ""}</a></h2>
|
|
1307
1326
|
<div class="facts">
|
|
1308
|
-
${x(n)} overall${p ?
|
|
1309
|
-
· streak ${
|
|
1310
|
-
${l ?
|
|
1327
|
+
${x(n)} overall${p ? c` · ${x(n, !0)} ${p.name}` : m}
|
|
1328
|
+
· streak ${J(n?.results) || "·"}
|
|
1329
|
+
${l ? c` · last: ${l.mark} ${l.my}-${l.their} vs ${q(t, l.opp)}` : m}
|
|
1311
1330
|
${this.movement(e, s, a)}
|
|
1312
1331
|
</div>
|
|
1313
1332
|
</div>
|
|
@@ -1317,30 +1336,30 @@ class jt extends b {
|
|
|
1317
1336
|
renderRow(t, e, s, a, o, i, n, l) {
|
|
1318
1337
|
const p = N(t, n);
|
|
1319
1338
|
if (!p) return m;
|
|
1320
|
-
const h = t.records[n],
|
|
1339
|
+
const h = t.records[n], d = Pt(t.records, n), f = mt(this.data.games, n), u = i[t.teamsById[n]?.conferenceId], v = () => {
|
|
1321
1340
|
location.href = $(t.hrefs.school, { id: p.id });
|
|
1322
1341
|
};
|
|
1323
|
-
return
|
|
1324
|
-
<tr class="rowlink" @click=${(
|
|
1325
|
-
|
|
1342
|
+
return c`
|
|
1343
|
+
<tr class="rowlink" @click=${(et) => {
|
|
1344
|
+
et.target.closest("a") || v();
|
|
1326
1345
|
}}>
|
|
1327
1346
|
<td class="num" style="font-weight:700">${l}</td>
|
|
1328
1347
|
<td>${this.movement(e, s, n)}</td>
|
|
1329
|
-
<td class="teamcell">${
|
|
1348
|
+
<td class="teamcell">${U(p)}<a href=${$(t.hrefs.school, { id: p.id })}>${p.name}</a>
|
|
1330
1349
|
<span class="mut" style="font-size:0.78rem">${p.mascot || ""}</span></td>
|
|
1331
1350
|
<td class="num">${x(h)}</td>
|
|
1332
1351
|
<td class="mut">${u?.name || "Independent"}</td>
|
|
1333
|
-
<td>${
|
|
1334
|
-
<b style="color:${
|
|
1335
|
-
${
|
|
1336
|
-
<td>${
|
|
1352
|
+
<td>${d ? c`<a class="box" style="text-decoration:none" href=${$(t.hrefs.game, { sport: this.sport, id: d.gameId })}>
|
|
1353
|
+
<b style="color:${d.mark === "W" ? "var(--hsot-win)" : d.mark === "L" ? "var(--hsot-loss)" : "var(--hsot-tie)"}">${d.mark}</b>
|
|
1354
|
+
${d.my}-${d.their} vs ${q(t, d.opp)}</a>` : c`<span class="mut">·</span>`}</td>
|
|
1355
|
+
<td>${Mt(t, f, n)}</td>
|
|
1337
1356
|
<td>${this.sparkline(n, a, o)}</td>
|
|
1338
1357
|
</tr>
|
|
1339
1358
|
`;
|
|
1340
1359
|
}
|
|
1341
1360
|
}
|
|
1342
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings",
|
|
1343
|
-
const
|
|
1361
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings", Gt);
|
|
1362
|
+
const Ee = w`
|
|
1344
1363
|
.schoolhero { color: var(--hsot-white); padding: 1.6rem 1.25rem 1.3rem; }
|
|
1345
1364
|
.schoolhero .inner { max-width: 1366px; margin: 0 auto; display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
|
|
1346
1365
|
.schoolhero .crest {
|
|
@@ -1349,6 +1368,10 @@ const Ie = w`
|
|
|
1349
1368
|
font-family: var(--hsot-heading-font); font-weight: 700; font-size: 1.5rem;
|
|
1350
1369
|
border: 3px solid rgba(255,255,255,0.6);
|
|
1351
1370
|
}
|
|
1371
|
+
.schoolhero .crest.logo {
|
|
1372
|
+
object-fit: contain; background: var(--hsot-white);
|
|
1373
|
+
padding: 6px; box-sizing: border-box;
|
|
1374
|
+
}
|
|
1352
1375
|
.schoolhero h1 { margin: 0; font-family: var(--hsot-heading-font); font-size: 2.6rem; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; }
|
|
1353
1376
|
.schoolhero .mascot { font-size: 1.05rem; opacity: 0.85; font-family: var(--hsot-heading-font); text-transform: uppercase; letter-spacing: 0.06em; }
|
|
1354
1377
|
.schoolhero .facts { display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; margin-top: 0.55rem; font-size: 0.85rem; opacity: 0.95; }
|
|
@@ -1361,8 +1384,8 @@ const Ie = w`
|
|
|
1361
1384
|
.cols { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 1.25rem; }
|
|
1362
1385
|
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } .schoolhero h1 { font-size: 1.9rem; } }
|
|
1363
1386
|
`;
|
|
1364
|
-
class
|
|
1365
|
-
static styles = [...H,
|
|
1387
|
+
class Wt extends b {
|
|
1388
|
+
static styles = [...H, Ee];
|
|
1366
1389
|
static properties = {
|
|
1367
1390
|
...b.properties,
|
|
1368
1391
|
schoolId: { type: String, attribute: "school-id" },
|
|
@@ -1379,7 +1402,7 @@ class Gt extends b {
|
|
|
1379
1402
|
t && !this.sport && (this.sport = t);
|
|
1380
1403
|
}
|
|
1381
1404
|
async fetchData(t) {
|
|
1382
|
-
const e = this.season ||
|
|
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, l, p, h, d, f, u] = await Promise.all([
|
|
1383
1406
|
i ? t.listGames({ sport: i.sport, season: e }) : Promise.resolve({ items: [] }),
|
|
1384
1407
|
i ? t.listTeams({ sport: i.sport }) : Promise.resolve({ items: [] }),
|
|
1385
1408
|
t.listSchools(),
|
|
@@ -1399,7 +1422,7 @@ class Gt extends b {
|
|
|
1399
1422
|
allTeams: l.items,
|
|
1400
1423
|
schools: p.items,
|
|
1401
1424
|
conferences: h.items,
|
|
1402
|
-
rankings:
|
|
1425
|
+
rankings: d.items,
|
|
1403
1426
|
roster: f.items.find((v) => v.season === e) || null,
|
|
1404
1427
|
players: u.items
|
|
1405
1428
|
};
|
|
@@ -1419,61 +1442,61 @@ class Gt extends b {
|
|
|
1419
1442
|
}
|
|
1420
1443
|
renderView() {
|
|
1421
1444
|
const { school: t, teams: e, active: s, season: a } = this.data;
|
|
1422
|
-
if (!t) return
|
|
1445
|
+
if (!t) return c`<div class="view"><p class="empty">School not found.</p></div>`;
|
|
1423
1446
|
const o = this.ctx, i = W(t.colorPrimary || "#030711"), n = (t.adm || [])[0], l = g(this.data.conferences), p = s ? l[s.conferenceId] : null;
|
|
1424
|
-
return
|
|
1447
|
+
return c`
|
|
1425
1448
|
<div class="schoolhero" style="background:linear-gradient(115deg, ${t.colorPrimary || "#030711"} 0%, ${t.colorPrimary || "#030711"} 55%, var(--hsot-black) 100%);color:${i}">
|
|
1426
1449
|
<div class="inner">
|
|
1427
|
-
|
|
1450
|
+
${V(t, 84) ? c`<img class="crest logo" alt="" loading="lazy" src=${V(t, 84)} />` : c`<div class="crest" style="background:${t.colorSecondary || "#7C7C7C"};color:${W(t.colorSecondary || "#7C7C7C")}">${ft(t)}</div>`}
|
|
1428
1451
|
<div style="min-width:260px">
|
|
1429
1452
|
<h1>${t.name} <span class="mascot">${t.mascot || ""}</span></h1>
|
|
1430
1453
|
<div class="facts">
|
|
1431
|
-
${t.location ?
|
|
1432
|
-
${t.association ?
|
|
1433
|
-
${p ?
|
|
1434
|
-
${n ?
|
|
1435
|
-
${t.openingYear ?
|
|
1436
|
-
${t.areaCode ?
|
|
1437
|
-
${t.tagSlug ?
|
|
1454
|
+
${t.location ? c`<span><b>Location</b>${t.location}${t.county ? c` · ${t.county} County` : m}</span>` : m}
|
|
1455
|
+
${t.association ? c`<span><b>League</b>${t.association}${t.classification ? c` · ${t.classification}` : m}</span>` : m}
|
|
1456
|
+
${p ? c`<span><b>Conference</b>${p.name}</span>` : m}
|
|
1457
|
+
${n ? c`<span><b>Enrollment</b>${n.value.toLocaleString()} (${n.season} ADM)</span>` : m}
|
|
1458
|
+
${t.openingYear ? c`<span><b>Opened</b>${t.openingYear}</span>` : m}
|
|
1459
|
+
${t.areaCode ? c`<span><b>Area</b>${t.areaCode}</span>` : m}
|
|
1460
|
+
${t.tagSlug ? c`<span><b>Tag</b>#${t.tagSlug}</span>` : m}
|
|
1438
1461
|
</div>
|
|
1439
1462
|
</div>
|
|
1440
1463
|
</div>
|
|
1441
1464
|
</div>
|
|
1442
1465
|
<div class="band">
|
|
1443
1466
|
<nav class="tabs" aria-label="Teams">
|
|
1444
|
-
${e.map((h) => h.id === s?.id ?
|
|
1445
|
-
|
|
1467
|
+
${e.map((h) => h.id === s?.id ? c`<a class="on" href="#" @click=${(d) => d.preventDefault()}>${h.name}</a>` : c`<a href="#" @click=${(d) => {
|
|
1468
|
+
d.preventDefault(), this.switchSport(h.sport);
|
|
1446
1469
|
}}>${h.name}</a>`)}
|
|
1447
1470
|
</nav>
|
|
1448
1471
|
</div>
|
|
1449
1472
|
<div class="view">
|
|
1450
|
-
${s ? this.renderTeam(o, s, p, a) :
|
|
1473
|
+
${s ? this.renderTeam(o, s, p, a) : c`<p class="empty">No teams recorded for this school yet.</p>`}
|
|
1451
1474
|
</div>
|
|
1452
1475
|
`;
|
|
1453
1476
|
}
|
|
1454
1477
|
renderTeam(t, e, s, a) {
|
|
1455
|
-
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((
|
|
1456
|
-
return
|
|
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((d) => d.conferenceId === s.id) : [], l = s ? Ft(n, t.records).findIndex((d) => d.team.id === e.id) + 1 : 0, p = Ht(t.rankings, t.teamsById, e.id, e.sport, null), h = this.data.games.filter((d) => d.homeTeamId === e.id || d.awayTeamId === e.id).sort((d, f) => String(d.date).localeCompare(String(f.date)));
|
|
1479
|
+
return c`
|
|
1457
1480
|
<div class="tiles">
|
|
1458
1481
|
<div class="tile"><div class="k">Overall</div><div class="v">${x(o)}</div><div class="s">${i} games played</div></div>
|
|
1459
1482
|
<div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${x(o, !0)}</div>
|
|
1460
|
-
<div class="s">${l ? `${
|
|
1483
|
+
<div class="s">${l ? `${Se(l)} of ${n.length}` : "·"}</div></div>
|
|
1461
1484
|
<div class="tile"><div class="k">Points</div><div class="v">${i ? (o.pf / i).toFixed(1) : "0.0"}</div>
|
|
1462
1485
|
<div class="s">scored per game · ${i ? (o.pa / i).toFixed(1) : "0.0"} allowed</div></div>
|
|
1463
|
-
<div class="tile"><div class="k">Streak</div><div class="v">${
|
|
1464
|
-
<div class="s">last 5: ${
|
|
1486
|
+
<div class="tile"><div class="k">Streak</div><div class="v">${J(o.results) || "·"}</div>
|
|
1487
|
+
<div class="s">last 5: ${gt(t, e.id)}</div></div>
|
|
1465
1488
|
<div class="tile"><div class="k">HSOT Top 25</div><div class="v">${p ? `#${p}` : "NR"}</div>
|
|
1466
1489
|
<div class="s"><a href=${$(t.hrefs.section, { sport: e.sport, view: "rankings" })}>full poll</a></div></div>
|
|
1467
1490
|
</div>
|
|
1468
|
-
${(e.championships || []).length ?
|
|
1491
|
+
${(e.championships || []).length ? c`
|
|
1469
1492
|
<div style="margin:-0.2rem 0 1rem;display:flex;gap:0.4rem;flex-wrap:wrap">
|
|
1470
|
-
${e.championships.map((
|
|
1493
|
+
${e.championships.map((d) => c`<span class="pill champ">★ ${d.season} ${d.title} champion${d.classification ? ` · ${d.classification}` : ""}${d.region ? ` · ${d.region}` : ""}</span>`)}
|
|
1471
1494
|
</div>` : m}
|
|
1472
1495
|
<div class="cols">
|
|
1473
1496
|
<div>
|
|
1474
1497
|
<div class="section-title">Schedule & results</div>
|
|
1475
1498
|
<div class="card">
|
|
1476
|
-
${h.length ?
|
|
1499
|
+
${h.length ? c`<ul class="gamelist">${h.map((d) => this.renderGameRow(t, e, d))}</ul>` : c`<p class="empty">No ${e.sport} games recorded for ${a}.</p>`}
|
|
1477
1500
|
</div>
|
|
1478
1501
|
</div>
|
|
1479
1502
|
<div>
|
|
@@ -1485,20 +1508,20 @@ class Gt extends b {
|
|
|
1485
1508
|
}
|
|
1486
1509
|
renderGameRow(t, e, s) {
|
|
1487
1510
|
const a = s.homeTeamId === e.id, o = a ? s.awayTeamId : s.homeTeamId, i = a ? s.homeScore : s.awayScore, n = a ? s.awayScore : s.homeScore;
|
|
1488
|
-
let l =
|
|
1511
|
+
let l = c`<span class="mut">${X(s.time)}</span>`;
|
|
1489
1512
|
if (s.state === "final") {
|
|
1490
|
-
const h =
|
|
1491
|
-
l =
|
|
1492
|
-
} else s.state === "live" && (l =
|
|
1513
|
+
const h = pt(s), d = h === "tie" ? "T" : h === (a ? "home" : "away") ? "W" : "L";
|
|
1514
|
+
l = c`<span class=${d}>${d}</span> ${i}-${n}${s.finish === "overtime" ? c` <span class="mut">OT</span>` : m}${s.forfeit && s.forfeit !== "none" ? c` <span class="mut">FF</span>` : m}`;
|
|
1515
|
+
} else s.state === "live" && (l = c`<span style="color:var(--hsot-red)">${i}-${n}</span>`);
|
|
1493
1516
|
const p = s.gameType === "conference" ? "Conf" : s.gameType === "nonconference" ? "Non-conf" : s.gameType === "playoff" ? `Playoff${s.label ? ` · ${s.label}` : ""}` : "Scrimmage";
|
|
1494
|
-
return
|
|
1517
|
+
return c`
|
|
1495
1518
|
<li>
|
|
1496
1519
|
<span class="d">${y(s.date)}</span>
|
|
1497
|
-
${
|
|
1520
|
+
${Y(s)}
|
|
1498
1521
|
<span class="res">${l}</span>
|
|
1499
|
-
<span class="opp">${a ? "vs" : "at"} ${
|
|
1522
|
+
<span class="opp">${a ? "vs" : "at"} ${it(t, o, s.date)}
|
|
1500
1523
|
<span class="pill type">${p}</span>
|
|
1501
|
-
${s.broadcast ?
|
|
1524
|
+
${s.broadcast ? c`<span class="pill class">${s.broadcast}</span>` : m}
|
|
1502
1525
|
</span>
|
|
1503
1526
|
<span class="where">${s.venue || ""}</span>
|
|
1504
1527
|
<a class="box" href=${$(t.hrefs.game, { sport: e.sport, id: s.id })}>Box score →</a>
|
|
@@ -1508,20 +1531,20 @@ class Gt extends b {
|
|
|
1508
1531
|
renderRoster(t) {
|
|
1509
1532
|
const e = this.data.roster;
|
|
1510
1533
|
if (!e)
|
|
1511
|
-
return
|
|
1534
|
+
return c`<p class="empty">Roster not published for ${t}.</p>`;
|
|
1512
1535
|
const s = g(this.data.players), a = e.entries.slice().sort((o, i) => (o.number || 0) - (i.number || 0));
|
|
1513
|
-
return
|
|
1536
|
+
return c`
|
|
1514
1537
|
<div class="tablewrap"><table class="data">
|
|
1515
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>
|
|
1516
1539
|
<tbody>
|
|
1517
1540
|
${a.map((o) => {
|
|
1518
1541
|
const i = s[o.playerId];
|
|
1519
|
-
return i ?
|
|
1542
|
+
return i ? c`<tr>
|
|
1520
1543
|
<td class="num mut">${o.number ?? "·"}</td>
|
|
1521
1544
|
<td style="font-weight:500">${i.firstName} ${i.lastName}</td>
|
|
1522
1545
|
<td>${o.position || "·"}</td>
|
|
1523
1546
|
<td class="mut">${i.classOf || "·"}</td>
|
|
1524
|
-
<td class="num">${
|
|
1547
|
+
<td class="num">${ke(i.heightIn)}</td>
|
|
1525
1548
|
<td class="num">${i.weightLb || "·"}</td>
|
|
1526
1549
|
</tr>` : m;
|
|
1527
1550
|
})}
|
|
@@ -1530,8 +1553,8 @@ class Gt extends b {
|
|
|
1530
1553
|
`;
|
|
1531
1554
|
}
|
|
1532
1555
|
}
|
|
1533
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school",
|
|
1534
|
-
const
|
|
1556
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school", Wt);
|
|
1557
|
+
const Pe = w`
|
|
1535
1558
|
.breadcrumbs { font-size: 0.8125rem; margin: 0.9rem 0 0; color: var(--hsot-gray-5); }
|
|
1536
1559
|
.breadcrumbs a { text-decoration: none; }
|
|
1537
1560
|
.scorehead { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; padding: 1.4rem 1rem; }
|
|
@@ -1542,6 +1565,10 @@ const Ce = w`
|
|
|
1542
1565
|
display: flex; align-items: center; justify-content: center;
|
|
1543
1566
|
font-family: var(--hsot-heading-font); font-weight: 700; color: var(--hsot-white);
|
|
1544
1567
|
}
|
|
1568
|
+
.scorehead .crest.logo {
|
|
1569
|
+
object-fit: contain; background: var(--hsot-white);
|
|
1570
|
+
border: 1px solid var(--hsot-gray-2); padding: 4px; box-sizing: border-box;
|
|
1571
|
+
}
|
|
1545
1572
|
.scorehead .tname { font-family: var(--hsot-heading-font); font-weight: 700; font-size: 1.15rem; line-height: 1.15; }
|
|
1546
1573
|
.scorehead .tname a { color: inherit; text-decoration: none; }
|
|
1547
1574
|
.scorehead .trec { font-size: 0.8rem; color: var(--hsot-gray-5); }
|
|
@@ -1558,8 +1585,8 @@ const Ce = w`
|
|
|
1558
1585
|
.cols { grid-template-columns: 1fr; }
|
|
1559
1586
|
}
|
|
1560
1587
|
`;
|
|
1561
|
-
class
|
|
1562
|
-
static styles = [...H,
|
|
1588
|
+
class Vt extends b {
|
|
1589
|
+
static styles = [...H, Pe];
|
|
1563
1590
|
static properties = {
|
|
1564
1591
|
...b.properties,
|
|
1565
1592
|
gameId: { type: String, attribute: "game-id" }
|
|
@@ -1596,12 +1623,12 @@ class Wt extends b {
|
|
|
1596
1623
|
}
|
|
1597
1624
|
renderView() {
|
|
1598
1625
|
const t = this.data.game;
|
|
1599
|
-
if (!t) return
|
|
1600
|
-
const e = this.ctx, s = g(this.data.conferences), a = 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 =
|
|
1601
|
-
return
|
|
1626
|
+
if (!t) return c`<div class="view"><p class="empty">Game not found.</p></div>`;
|
|
1627
|
+
const e = this.ctx, s = g(this.data.conferences), a = 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 = (h) => t.state === "final" && i !== h && i !== "tie" ? "opacity:0.45" : "", l = t.conferenceId ? s[t.conferenceId] : null, p = this.data.games.filter((h) => h.id !== t.id && h.state === "final" && h.gameType !== "scrimmage" && (h.homeTeamId === t.homeTeamId && h.awayTeamId === t.awayTeamId || h.homeTeamId === t.awayTeamId && h.awayTeamId === t.homeTeamId));
|
|
1628
|
+
return c`
|
|
1602
1629
|
<div class="view">
|
|
1603
1630
|
<p class="breadcrumbs">
|
|
1604
|
-
<a href=${$(e.hrefs.section, { sport: t.sport, view: "scores" })}>${
|
|
1631
|
+
<a href=${$(e.hrefs.section, { sport: t.sport, view: "scores" })}>${Q(t.sport)}</a> /
|
|
1605
1632
|
<a href=${$(e.hrefs.section, { sport: t.sport, view: "scores" })}>Scores/Schedules</a> /
|
|
1606
1633
|
${P(e, t.awayTeamId)} at ${P(e, t.homeTeamId)}
|
|
1607
1634
|
</p>
|
|
@@ -1614,36 +1641,36 @@ class Wt extends b {
|
|
|
1614
1641
|
<span class="mut" style="font-size:1.6rem">–</span>
|
|
1615
1642
|
<span style=${n("home")}>${t.homeScore}</span>
|
|
1616
1643
|
</div>
|
|
1617
|
-
<div class="status">${
|
|
1618
|
-
<div class="status">${y(t.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${t.state === "scheduled" && t.time ?
|
|
1619
|
-
${t.broadcast ?
|
|
1644
|
+
<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 ? c` · ${X(t.time)}` : m} · ${t.venue || "Venue TBD"}
|
|
1646
|
+
${t.broadcast ? c` · <span class="pill class">${t.broadcast}</span>` : m}</div>
|
|
1620
1647
|
<div class="status">
|
|
1621
1648
|
<span class="pill type">${t.gameType === "conference" ? `${l?.name || "Conference"} game` : t.gameType}</span>
|
|
1622
|
-
${t.label ?
|
|
1623
|
-
${(t.tags || []).map((h) =>
|
|
1649
|
+
${t.label ? c`<span class="pill type">Bracket ${t.label}</span>` : m}
|
|
1650
|
+
${(t.tags || []).map((h) => c`<span class="pill type">${h}</span>`)}
|
|
1624
1651
|
</div>
|
|
1625
1652
|
</div>
|
|
1626
1653
|
${this.teamBlock(e, t, t.homeTeamId, o, !0)}
|
|
1627
1654
|
</div>
|
|
1628
1655
|
${this.renderLineScore(t, a, o)}
|
|
1629
|
-
${t.notes ?
|
|
1656
|
+
${t.notes ? c`<p class="note" style="padding:0 1rem 0.9rem;text-align:center">${t.notes}</p>` : m}
|
|
1630
1657
|
</div>
|
|
1631
|
-
${t.storyAssetId || t.videoAssetId ?
|
|
1658
|
+
${t.storyAssetId || t.videoAssetId ? c`
|
|
1632
1659
|
<div class="section-title">Coverage</div>
|
|
1633
1660
|
<div class="card" style="padding:0.8rem 1rem;display:flex;gap:0.5rem;flex-wrap:wrap;align-items:center">
|
|
1634
|
-
${t.storyAssetId ?
|
|
1635
|
-
${t.videoAssetId ?
|
|
1661
|
+
${t.storyAssetId ? c`<span class="pill class" title="Game.storyAssetId">Game story · ${t.storyAssetId}</span>` : m}
|
|
1662
|
+
${t.videoAssetId ? c`<span class="pill class" title="Game.videoAssetId">Highlights · ${t.videoAssetId}</span>` : m}
|
|
1636
1663
|
<span class="asof">Story and video ride the Game resource as Studio asset references.</span>
|
|
1637
1664
|
</div>` : m}
|
|
1638
1665
|
<div class="section-title">Season context</div>
|
|
1639
1666
|
<div class="cols">
|
|
1640
|
-
${[[t.awayTeamId, a], [t.homeTeamId, o]].map(([h,
|
|
1667
|
+
${[[t.awayTeamId, a], [t.homeTeamId, o]].map(([h, d]) => this.renderContext(e, h, d))}
|
|
1641
1668
|
</div>
|
|
1642
|
-
${p.length ?
|
|
1669
|
+
${p.length ? c`
|
|
1643
1670
|
<div class="section-title">Head to head this season</div>
|
|
1644
1671
|
<div class="card"><ul class="gamelist">
|
|
1645
|
-
${p.map((h) =>
|
|
1646
|
-
<span class="d">${y(h.date)}</span>${
|
|
1672
|
+
${p.map((h) => c`<li>
|
|
1673
|
+
<span class="d">${y(h.date)}</span>${Y(h)}
|
|
1647
1674
|
<span class="opp">${P(e, h.awayTeamId)} ${h.awayScore}, ${P(e, h.homeTeamId)} ${h.homeScore}</span>
|
|
1648
1675
|
<a class="box" href=${$(e.hrefs.game, { sport: t.sport, id: h.id })}>Box score →</a>
|
|
1649
1676
|
</li>`)}
|
|
@@ -1652,14 +1679,14 @@ class Wt extends b {
|
|
|
1652
1679
|
`;
|
|
1653
1680
|
}
|
|
1654
1681
|
teamBlock(t, e, s, a, o) {
|
|
1655
|
-
if (!a) return
|
|
1656
|
-
const i = t.teamsById[s], n = t.records[s];
|
|
1657
|
-
return
|
|
1682
|
+
if (!a) return c`<div class="teamblock ${o ? "right" : ""}"><div class="tname">TBD</div></div>`;
|
|
1683
|
+
const i = t.teamsById[s], n = t.records[s], l = V(a, 58);
|
|
1684
|
+
return c`
|
|
1658
1685
|
<div class="teamblock ${o ? "right" : ""}">
|
|
1659
|
-
|
|
1686
|
+
${l ? c`<img class="crest logo" alt="" loading="lazy" src=${l} />` : c`<span class="crest" style="background:${a.colorPrimary || "#030711"};color:${W(a.colorPrimary || "#030711")}">${ft(a)}</span>`}
|
|
1660
1687
|
<div>
|
|
1661
|
-
<div class="tname">${
|
|
1662
|
-
<div class="trec">${a.mascot || ""} · ${x(n)}${i?.conferenceId ?
|
|
1688
|
+
<div class="tname">${ut(t, s, e.date)}<a href=${$(t.hrefs.school, { id: a.id })}>${a.name}</a></div>
|
|
1689
|
+
<div class="trec">${a.mascot || ""} · ${x(n)}${i?.conferenceId ? c` · ${x(n, !0)} conf` : m}</div>
|
|
1663
1690
|
</div>
|
|
1664
1691
|
</div>
|
|
1665
1692
|
`;
|
|
@@ -1667,20 +1694,20 @@ class Wt extends b {
|
|
|
1667
1694
|
renderLineScore(t, e, s) {
|
|
1668
1695
|
const a = t.periodScores || [];
|
|
1669
1696
|
if (!a.length)
|
|
1670
|
-
return
|
|
1697
|
+
return c`<p class="empty" style="text-align:center">Period scoring will appear once the game starts.</p>`;
|
|
1671
1698
|
const o = Math.max(4, ...a.map((p) => p.period)), i = (p) => p <= 4 ? String(p) : `OT${p > 5 ? p - 4 : ""}`, n = (p, h) => {
|
|
1672
|
-
const
|
|
1673
|
-
return
|
|
1674
|
-
}, l = (p, h,
|
|
1699
|
+
const d = a.find((f) => f.period === h);
|
|
1700
|
+
return d ? d[p] : t.state === "final" ? 0 : "·";
|
|
1701
|
+
}, l = (p, h, d) => c`
|
|
1675
1702
|
<tr>
|
|
1676
|
-
<td class="teamcell">${
|
|
1677
|
-
${Array.from({ length: o }, (f, u) =>
|
|
1678
|
-
<td class="num" style="font-weight:700">${
|
|
1703
|
+
<td class="teamcell">${U(p, 20)}${p?.abbr || "TBD"}</td>
|
|
1704
|
+
${Array.from({ length: o }, (f, u) => c`<td class="num">${n(h, u + 1)}</td>`)}
|
|
1705
|
+
<td class="num" style="font-weight:700">${d}</td>
|
|
1679
1706
|
</tr>`;
|
|
1680
|
-
return
|
|
1707
|
+
return c`
|
|
1681
1708
|
<div class="tablewrap" style="border-top:1px solid var(--hsot-gray-2)">
|
|
1682
1709
|
<table class="data" style="max-width:560px;margin:0.6rem auto 0.9rem">
|
|
1683
|
-
<thead><tr><th>Team</th>${Array.from({ length: o }, (p, h) =>
|
|
1710
|
+
<thead><tr><th>Team</th>${Array.from({ length: o }, (p, h) => c`<th class="num">${i(h + 1)}</th>`)}<th class="num">T</th></tr></thead>
|
|
1684
1711
|
<tbody>
|
|
1685
1712
|
${l(e, "away", t.awayScore)}
|
|
1686
1713
|
${l(s, "home", t.homeScore)}
|
|
@@ -1691,36 +1718,36 @@ class Wt extends b {
|
|
|
1691
1718
|
}
|
|
1692
1719
|
renderContext(t, e, s) {
|
|
1693
1720
|
if (!s) return m;
|
|
1694
|
-
const a = t.records[e], o =
|
|
1695
|
-
return
|
|
1721
|
+
const a = t.records[e], o = mt(this.data.games, e);
|
|
1722
|
+
return c`
|
|
1696
1723
|
<div class="card ctxcard">
|
|
1697
|
-
<div class="who">${
|
|
1724
|
+
<div class="who">${U(s)}${s.name}</div>
|
|
1698
1725
|
<div class="row">
|
|
1699
|
-
<span>Last 5: ${
|
|
1700
|
-
<span>Streak: <b>${a ?
|
|
1726
|
+
<span>Last 5: ${gt(t, e)}</span>
|
|
1727
|
+
<span>Streak: <b>${a ? J(a.results) : "·"}</b></span>
|
|
1701
1728
|
<span>PF/PA: <b>${a ? `${a.pf} / ${a.pa}` : "·"}</b></span>
|
|
1702
|
-
<span>Next: ${o ?
|
|
1703
|
-
${o.homeTeamId === e ? "vs" : "at"} ${
|
|
1729
|
+
<span>Next: ${o ? c`${y(o.date, { month: "numeric", day: "numeric" })}
|
|
1730
|
+
${o.homeTeamId === e ? "vs" : "at"} ${q(t, o.homeTeamId === e ? o.awayTeamId : o.homeTeamId)}` : "·"}</span>
|
|
1704
1731
|
</div>
|
|
1705
1732
|
</div>
|
|
1706
1733
|
`;
|
|
1707
1734
|
}
|
|
1708
1735
|
}
|
|
1709
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore",
|
|
1710
|
-
const
|
|
1711
|
-
"hsot-scores":
|
|
1712
|
-
"hsot-standings":
|
|
1713
|
-
"hsot-rankings":
|
|
1714
|
-
"hsot-school":
|
|
1715
|
-
"hsot-boxscore":
|
|
1736
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore", Vt);
|
|
1737
|
+
const De = {
|
|
1738
|
+
"hsot-scores": Lt,
|
|
1739
|
+
"hsot-standings": jt,
|
|
1740
|
+
"hsot-rankings": Gt,
|
|
1741
|
+
"hsot-school": Wt,
|
|
1742
|
+
"hsot-boxscore": Vt
|
|
1716
1743
|
};
|
|
1717
|
-
function
|
|
1744
|
+
function Re() {
|
|
1718
1745
|
const r = globalThis?.customElements;
|
|
1719
1746
|
if (r)
|
|
1720
|
-
for (const [t, e] of Object.entries(
|
|
1747
|
+
for (const [t, e] of Object.entries(De))
|
|
1721
1748
|
r.get(t) || r.define(t, e);
|
|
1722
1749
|
}
|
|
1723
|
-
typeof window < "u" && globalThis.customElements &&
|
|
1750
|
+
typeof window < "u" && globalThis.customElements && Re();
|
|
1724
1751
|
export {
|
|
1725
|
-
|
|
1752
|
+
Re as defineAll
|
|
1726
1753
|
};
|