@wral/hsot-data 0.4.0 → 0.5.1
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/README.md +21 -4
- package/dist/define.mjs +1 -1
- package/dist/define.standalone.js +807 -732
- package/dist/{hsot-brackets-Bqk0gI3J.js → hsot-brackets-ClfXvdcH.js} +552 -477
- 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, me = J.ShadowRoot && (J.ShadyCSS === void 0 || J.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ue = /* @__PURE__ */ Symbol(), Te = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
let qe = class {
|
|
3
3
|
constructor(e, t, s) {
|
|
4
|
-
if (this._$cssResult$ = !0, s !==
|
|
4
|
+
if (this._$cssResult$ = !0, s !== ue) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
5
5
|
this.cssText = e, this.t = t;
|
|
6
6
|
}
|
|
7
7
|
get styleSheet() {
|
|
8
8
|
let e = this.o;
|
|
9
9
|
const t = this.t;
|
|
10
|
-
if (
|
|
10
|
+
if (me && e === void 0) {
|
|
11
11
|
const s = t !== void 0 && t.length === 1;
|
|
12
|
-
s && (e =
|
|
12
|
+
s && (e = Te.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), s && Te.set(t, e));
|
|
13
13
|
}
|
|
14
14
|
return e;
|
|
15
15
|
}
|
|
@@ -17,101 +17,101 @@ let je = class {
|
|
|
17
17
|
return this.cssText;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const
|
|
21
|
-
const t =
|
|
20
|
+
const kt = (a) => new qe(typeof a == "string" ? a : a + "", void 0, ue), y = (a, ...e) => {
|
|
21
|
+
const t = a.length === 1 ? a[0] : e.reduce((s, r, o) => s + ((n) => {
|
|
22
22
|
if (n._$cssResult$ === !0) return n.cssText;
|
|
23
23
|
if (typeof n == "number") return n;
|
|
24
24
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + n + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
25
|
-
})(
|
|
26
|
-
return new
|
|
27
|
-
},
|
|
28
|
-
if (
|
|
25
|
+
})(r) + a[o + 1], a[0]);
|
|
26
|
+
return new qe(t, a, ue);
|
|
27
|
+
}, St = (a, e) => {
|
|
28
|
+
if (me) a.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
|
|
29
29
|
else for (const t of e) {
|
|
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 = t.cssText, a.appendChild(s);
|
|
32
32
|
}
|
|
33
|
-
},
|
|
33
|
+
}, Ae = me ? (a) => a : (a) => a instanceof CSSStyleSheet ? ((e) => {
|
|
34
34
|
let t = "";
|
|
35
35
|
for (const s of e.cssRules) t += s.cssText;
|
|
36
|
-
return
|
|
37
|
-
})(
|
|
38
|
-
const { is:
|
|
36
|
+
return kt(t);
|
|
37
|
+
})(a) : a;
|
|
38
|
+
const { is: _t, defineProperty: Tt, getOwnPropertyDescriptor: At, getOwnPropertyNames: It, getOwnPropertySymbols: Ct, getPrototypeOf: Et } = Object, re = globalThis, Ie = re.trustedTypes, Pt = Ie ? Ie.emptyScript : "", Bt = re.reactiveElementPolyfillSupport, G = (a, e) => a, he = { toAttribute(a, e) {
|
|
39
39
|
switch (e) {
|
|
40
40
|
case Boolean:
|
|
41
|
-
|
|
41
|
+
a = a ? Pt : 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 t =
|
|
47
|
+
return a;
|
|
48
|
+
}, fromAttribute(a, e) {
|
|
49
|
+
let t = a;
|
|
50
50
|
switch (e) {
|
|
51
51
|
case Boolean:
|
|
52
|
-
t =
|
|
52
|
+
t = a !== null;
|
|
53
53
|
break;
|
|
54
54
|
case Number:
|
|
55
|
-
t =
|
|
55
|
+
t = a === null ? null : Number(a);
|
|
56
56
|
break;
|
|
57
57
|
case Object:
|
|
58
58
|
case Array:
|
|
59
59
|
try {
|
|
60
|
-
t = JSON.parse(
|
|
60
|
+
t = JSON.parse(a);
|
|
61
61
|
} catch {
|
|
62
62
|
t = null;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
return t;
|
|
66
|
-
} },
|
|
67
|
-
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"),
|
|
68
|
-
let
|
|
66
|
+
} }, We = (a, e) => !_t(a, e), Ce = { attribute: !0, type: String, converter: he, reflect: !1, useDefault: !1, hasChanged: We };
|
|
67
|
+
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), re.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
|
+
let R = class extends HTMLElement {
|
|
69
69
|
static addInitializer(e) {
|
|
70
70
|
this._$Ei(), (this.l ??= []).push(e);
|
|
71
71
|
}
|
|
72
72
|
static get observedAttributes() {
|
|
73
73
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
74
74
|
}
|
|
75
|
-
static createProperty(e, t =
|
|
75
|
+
static createProperty(e, t = Ce) {
|
|
76
76
|
if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
|
|
77
|
-
const s = /* @__PURE__ */ Symbol(),
|
|
78
|
-
|
|
77
|
+
const s = /* @__PURE__ */ Symbol(), r = this.getPropertyDescriptor(e, s, t);
|
|
78
|
+
r !== void 0 && Tt(this.prototype, e, r);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
static getPropertyDescriptor(e, t, s) {
|
|
82
|
-
const { get:
|
|
82
|
+
const { get: r, set: o } = At(this.prototype, e) ?? { get() {
|
|
83
83
|
return this[t];
|
|
84
84
|
}, set(n) {
|
|
85
85
|
this[t] = n;
|
|
86
86
|
} };
|
|
87
|
-
return { get:
|
|
88
|
-
const i =
|
|
87
|
+
return { get: r, set(n) {
|
|
88
|
+
const i = r?.call(this);
|
|
89
89
|
o?.call(this, n), this.requestUpdate(e, i, s);
|
|
90
90
|
}, configurable: !0, enumerable: !0 };
|
|
91
91
|
}
|
|
92
92
|
static getPropertyOptions(e) {
|
|
93
|
-
return this.elementProperties.get(e) ??
|
|
93
|
+
return this.elementProperties.get(e) ?? Ce;
|
|
94
94
|
}
|
|
95
95
|
static _$Ei() {
|
|
96
96
|
if (this.hasOwnProperty(G("elementProperties"))) return;
|
|
97
|
-
const e =
|
|
97
|
+
const e = Et(this);
|
|
98
98
|
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
99
99
|
}
|
|
100
100
|
static finalize() {
|
|
101
101
|
if (this.hasOwnProperty(G("finalized"))) return;
|
|
102
102
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(G("properties"))) {
|
|
103
|
-
const t = this.properties, s = [...
|
|
104
|
-
for (const
|
|
103
|
+
const t = this.properties, s = [...It(t), ...Ct(t)];
|
|
104
|
+
for (const r of s) this.createProperty(r, t[r]);
|
|
105
105
|
}
|
|
106
106
|
const e = this[Symbol.metadata];
|
|
107
107
|
if (e !== null) {
|
|
108
108
|
const t = litPropertyMetadata.get(e);
|
|
109
|
-
if (t !== void 0) for (const [s,
|
|
109
|
+
if (t !== void 0) for (const [s, r] of t) this.elementProperties.set(s, r);
|
|
110
110
|
}
|
|
111
111
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
112
112
|
for (const [t, s] of this.elementProperties) {
|
|
113
|
-
const
|
|
114
|
-
|
|
113
|
+
const r = this._$Eu(t, s);
|
|
114
|
+
r !== void 0 && this._$Eh.set(r, t);
|
|
115
115
|
}
|
|
116
116
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
117
117
|
}
|
|
@@ -119,8 +119,8 @@ let z = class extends HTMLElement {
|
|
|
119
119
|
const t = [];
|
|
120
120
|
if (Array.isArray(e)) {
|
|
121
121
|
const s = new Set(e.flat(1 / 0).reverse());
|
|
122
|
-
for (const
|
|
123
|
-
} else e !== void 0 && t.push(
|
|
122
|
+
for (const r of s) t.unshift(Ae(r));
|
|
123
|
+
} else e !== void 0 && t.push(Ae(e));
|
|
124
124
|
return t;
|
|
125
125
|
}
|
|
126
126
|
static _$Eu(e, t) {
|
|
@@ -146,7 +146,7 @@ let z = class extends HTMLElement {
|
|
|
146
146
|
}
|
|
147
147
|
createRenderRoot() {
|
|
148
148
|
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
149
|
-
return
|
|
149
|
+
return St(e, this.constructor.elementStyles), e;
|
|
150
150
|
}
|
|
151
151
|
connectedCallback() {
|
|
152
152
|
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((e) => e.hostConnected?.());
|
|
@@ -160,31 +160,31 @@ let z = class extends HTMLElement {
|
|
|
160
160
|
this._$AK(e, s);
|
|
161
161
|
}
|
|
162
162
|
_$ET(e, t) {
|
|
163
|
-
const s = this.constructor.elementProperties.get(e),
|
|
164
|
-
if (
|
|
165
|
-
const o = (s.converter?.toAttribute !== void 0 ? s.converter :
|
|
166
|
-
this._$Em = e, o == null ? this.removeAttribute(
|
|
163
|
+
const s = this.constructor.elementProperties.get(e), r = this.constructor._$Eu(e, s);
|
|
164
|
+
if (r !== void 0 && s.reflect === !0) {
|
|
165
|
+
const o = (s.converter?.toAttribute !== void 0 ? s.converter : he).toAttribute(t, s.type);
|
|
166
|
+
this._$Em = e, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
_$AK(e, t) {
|
|
170
|
-
const s = this.constructor,
|
|
171
|
-
if (
|
|
172
|
-
const o = s.getPropertyOptions(
|
|
173
|
-
this._$Em =
|
|
170
|
+
const s = this.constructor, r = s._$Eh.get(e);
|
|
171
|
+
if (r !== void 0 && this._$Em !== r) {
|
|
172
|
+
const o = s.getPropertyOptions(r), n = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : he;
|
|
173
|
+
this._$Em = r;
|
|
174
174
|
const i = n.fromAttribute(t, o.type);
|
|
175
|
-
this[
|
|
175
|
+
this[r] = i ?? this._$Ej?.get(r) ?? i, this._$Em = null;
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
requestUpdate(e, t, s,
|
|
178
|
+
requestUpdate(e, t, s, r = !1, o) {
|
|
179
179
|
if (e !== void 0) {
|
|
180
180
|
const n = this.constructor;
|
|
181
|
-
if (
|
|
181
|
+
if (r === !1 && (o = this[e]), s ??= n.getPropertyOptions(e), !((s.hasChanged ?? We)(o, t) || s.useDefault && s.reflect && o === this._$Ej?.get(e) && !this.hasAttribute(n._$Eu(e, s)))) return;
|
|
182
182
|
this.C(e, t, s);
|
|
183
183
|
}
|
|
184
184
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
185
185
|
}
|
|
186
|
-
C(e, t, { useDefault: s, reflect:
|
|
187
|
-
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, n ?? t ?? this[e]), o !== !0 || n !== void 0) || (this._$AL.has(e) || (this.hasUpdated || s || (t = void 0), this._$AL.set(e, t)),
|
|
186
|
+
C(e, t, { useDefault: s, reflect: r, wrapped: o }, n) {
|
|
187
|
+
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, n ?? t ?? this[e]), o !== !0 || n !== void 0) || (this._$AL.has(e) || (this.hasUpdated || s || (t = void 0), this._$AL.set(e, t)), r === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
|
|
188
188
|
}
|
|
189
189
|
async _$EP() {
|
|
190
190
|
this.isUpdatePending = !0;
|
|
@@ -203,13 +203,13 @@ let z = 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: n } = o, i = this[
|
|
212
|
-
n !== !0 || this._$AL.has(
|
|
210
|
+
if (s.size > 0) for (const [r, o] of s) {
|
|
211
|
+
const { wrapped: n } = o, i = this[r];
|
|
212
|
+
n !== !0 || this._$AL.has(r) || i === void 0 || this.C(r, void 0, o, i);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
let e = !1;
|
|
@@ -246,70 +246,70 @@ let z = class extends HTMLElement {
|
|
|
246
246
|
firstUpdated(e) {
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
|
|
250
|
-
const
|
|
251
|
-
\f\r]`, H = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
252
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
253
|
-
function
|
|
254
|
-
if (!
|
|
255
|
-
return
|
|
256
|
-
}
|
|
257
|
-
const
|
|
258
|
-
const t =
|
|
259
|
-
let
|
|
249
|
+
R.elementStyles = [], R.shadowRootOptions = { mode: "open" }, R[G("elementProperties")] = /* @__PURE__ */ new Map(), R[G("finalized")] = /* @__PURE__ */ new Map(), Bt?.({ ReactiveElement: R }), (re.reactiveElementVersions ??= []).push("2.1.2");
|
|
250
|
+
const fe = globalThis, Ee = (a) => a, X = fe.trustedTypes, Pe = X ? X.createPolicy("lit-html", { createHTML: (a) => a }) : void 0, Ve = "$lit$", _ = `lit$${Math.random().toFixed(9).slice(2)}$`, Ye = "?" + _, Dt = `<${Ye}>`, C = document, j = () => C.createComment(""), q = (a) => a === null || typeof a != "object" && typeof a != "function", ge = Array.isArray, Rt = (a) => ge(a) || typeof a?.[Symbol.iterator] == "function", ce = `[
|
|
251
|
+
\f\r]`, H = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Be = /-->/g, De = />/g, A = RegExp(`>|${ce}(?:([^\\s"'>=/]+)(${ce}*=${ce}*(?:[^
|
|
252
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Re = /'/g, ze = /"/g, Ke = /^(?:script|style|textarea|title)$/i, Qe = (a) => (e, ...t) => ({ _$litType$: a, strings: e, values: t }), l = Qe(1), Ne = Qe(2), F = /* @__PURE__ */ Symbol.for("lit-noChange"), m = /* @__PURE__ */ Symbol.for("lit-nothing"), Fe = /* @__PURE__ */ new WeakMap(), I = C.createTreeWalker(C, 129);
|
|
253
|
+
function Ze(a, e) {
|
|
254
|
+
if (!ge(a) || !a.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
|
+
return Pe !== void 0 ? Pe.createHTML(e) : e;
|
|
256
|
+
}
|
|
257
|
+
const zt = (a, e) => {
|
|
258
|
+
const t = a.length - 1, s = [];
|
|
259
|
+
let r, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", n = H;
|
|
260
260
|
for (let i = 0; i < t; i++) {
|
|
261
|
-
const c =
|
|
262
|
-
let d, h
|
|
263
|
-
for (; u < c.length && (n.lastIndex = u,
|
|
264
|
-
const f = n === A &&
|
|
265
|
-
o += n === H ? c +
|
|
261
|
+
const c = a[i];
|
|
262
|
+
let p, d, h = -1, u = 0;
|
|
263
|
+
for (; u < c.length && (n.lastIndex = u, d = n.exec(c), d !== null); ) u = n.lastIndex, n === H ? d[1] === "!--" ? n = Be : d[1] !== void 0 ? n = De : d[2] !== void 0 ? (Ke.test(d[2]) && (r = RegExp("</" + d[2], "g")), n = A) : d[3] !== void 0 && (n = A) : n === A ? d[0] === ">" ? (n = r ?? H, h = -1) : d[1] === void 0 ? h = -2 : (h = n.lastIndex - d[2].length, p = d[1], n = d[3] === void 0 ? A : d[3] === '"' ? ze : Re) : n === ze || n === Re ? n = A : n === Be || n === De ? n = H : (n = A, r = void 0);
|
|
264
|
+
const f = n === A && a[i + 1].startsWith("/>") ? " " : "";
|
|
265
|
+
o += n === H ? c + Dt : h >= 0 ? (s.push(p), c.slice(0, h) + Ve + c.slice(h) + _ + f) : c + _ + (h === -2 ? i : f);
|
|
266
266
|
}
|
|
267
|
-
return [
|
|
267
|
+
return [Ze(a, o + (a[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), s];
|
|
268
268
|
};
|
|
269
269
|
class W {
|
|
270
270
|
constructor({ strings: e, _$litType$: t }, s) {
|
|
271
|
-
let
|
|
271
|
+
let r;
|
|
272
272
|
this.parts = [];
|
|
273
273
|
let o = 0, n = 0;
|
|
274
|
-
const i = e.length - 1, c = this.parts, [
|
|
275
|
-
if (this.el = W.createElement(
|
|
276
|
-
const
|
|
277
|
-
|
|
274
|
+
const i = e.length - 1, c = this.parts, [p, d] = zt(e, t);
|
|
275
|
+
if (this.el = W.createElement(p, s), I.currentNode = this.el.content, t === 2 || t === 3) {
|
|
276
|
+
const h = this.el.content.firstChild;
|
|
277
|
+
h.replaceWith(...h.childNodes);
|
|
278
278
|
}
|
|
279
|
-
for (; (
|
|
280
|
-
if (
|
|
281
|
-
if (
|
|
282
|
-
const u =
|
|
283
|
-
c.push({ type: 1, index: o, name:
|
|
284
|
-
} else
|
|
285
|
-
if (
|
|
286
|
-
const
|
|
279
|
+
for (; (r = I.nextNode()) !== null && c.length < i; ) {
|
|
280
|
+
if (r.nodeType === 1) {
|
|
281
|
+
if (r.hasAttributes()) for (const h of r.getAttributeNames()) if (h.endsWith(Ve)) {
|
|
282
|
+
const u = d[n++], f = r.getAttribute(h).split(_), g = /([.?@])?(.*)/.exec(u);
|
|
283
|
+
c.push({ type: 1, index: o, name: g[2], strings: f, ctor: g[1] === "." ? Ft : g[1] === "?" ? Mt : g[1] === "@" ? Ot : oe }), r.removeAttribute(h);
|
|
284
|
+
} else h.startsWith(_) && (c.push({ type: 6, index: o }), r.removeAttribute(h));
|
|
285
|
+
if (Ke.test(r.tagName)) {
|
|
286
|
+
const h = r.textContent.split(_), u = h.length - 1;
|
|
287
287
|
if (u > 0) {
|
|
288
|
-
|
|
289
|
-
for (let f = 0; f < u; f++)
|
|
290
|
-
|
|
288
|
+
r.textContent = X ? X.emptyScript : "";
|
|
289
|
+
for (let f = 0; f < u; f++) r.append(h[f], j()), I.nextNode(), c.push({ type: 2, index: ++o });
|
|
290
|
+
r.append(h[u], j());
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
} else if (
|
|
293
|
+
} else if (r.nodeType === 8) if (r.data === Ye) 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
|
}
|
|
300
300
|
}
|
|
301
301
|
static createElement(e, t) {
|
|
302
|
-
const s =
|
|
302
|
+
const s = C.createElement("template");
|
|
303
303
|
return s.innerHTML = e, s;
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
if (e ===
|
|
308
|
-
let
|
|
306
|
+
function M(a, e, t = a, s) {
|
|
307
|
+
if (e === F) return e;
|
|
308
|
+
let r = s !== void 0 ? t._$Co?.[s] : t._$Cl;
|
|
309
309
|
const o = q(e) ? void 0 : e._$litDirective$;
|
|
310
|
-
return
|
|
310
|
+
return r?.constructor !== o && (r?._$AO?.(!1), o === void 0 ? r = void 0 : (r = new o(a), r._$AT(a, t, s)), s !== void 0 ? (t._$Co ??= [])[s] = r : t._$Cl = r), r !== void 0 && (e = M(a, r._$AS(a, e.values), r, s)), e;
|
|
311
311
|
}
|
|
312
|
-
class
|
|
312
|
+
class Nt {
|
|
313
313
|
constructor(e, t) {
|
|
314
314
|
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
|
|
315
315
|
}
|
|
@@ -320,17 +320,17 @@ class Pt {
|
|
|
320
320
|
return this._$AM._$AU;
|
|
321
321
|
}
|
|
322
322
|
u(e) {
|
|
323
|
-
const { el: { content: t }, parts: s } = this._$AD,
|
|
324
|
-
I.currentNode =
|
|
323
|
+
const { el: { content: t }, parts: s } = this._$AD, r = (e?.creationScope ?? C).importNode(t, !0);
|
|
324
|
+
I.currentNode = r;
|
|
325
325
|
let o = I.nextNode(), n = 0, i = 0, c = s[0];
|
|
326
326
|
for (; c !== void 0; ) {
|
|
327
327
|
if (n === c.index) {
|
|
328
|
-
let
|
|
329
|
-
c.type === 2 ?
|
|
328
|
+
let p;
|
|
329
|
+
c.type === 2 ? p = new Y(o, o.nextSibling, this, e) : c.type === 1 ? p = new c.ctor(o, c.name, c.strings, this, e) : c.type === 6 && (p = new Ut(o, this, e)), this._$AV.push(p), c = s[++i];
|
|
330
330
|
}
|
|
331
331
|
n !== c?.index && (o = I.nextNode(), n++);
|
|
332
332
|
}
|
|
333
|
-
return I.currentNode =
|
|
333
|
+
return I.currentNode = C, r;
|
|
334
334
|
}
|
|
335
335
|
p(e) {
|
|
336
336
|
let t = 0;
|
|
@@ -341,8 +341,8 @@ class Y {
|
|
|
341
341
|
get _$AU() {
|
|
342
342
|
return this._$AM?._$AU ?? this._$Cv;
|
|
343
343
|
}
|
|
344
|
-
constructor(e, t, s,
|
|
345
|
-
this.type = 2, this._$AH = m, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = s, this.options =
|
|
344
|
+
constructor(e, t, s, r) {
|
|
345
|
+
this.type = 2, this._$AH = m, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = s, this.options = r, this._$Cv = r?.isConnected ?? !0;
|
|
346
346
|
}
|
|
347
347
|
get parentNode() {
|
|
348
348
|
let e = this._$AA.parentNode;
|
|
@@ -356,7 +356,7 @@ class Y {
|
|
|
356
356
|
return this._$AB;
|
|
357
357
|
}
|
|
358
358
|
_$AI(e, t = this) {
|
|
359
|
-
e =
|
|
359
|
+
e = M(this, e, t), q(e) ? e === m || e == null || e === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : e !== this._$AH && e !== F && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Rt(e) ? this.k(e) : this._(e);
|
|
360
360
|
}
|
|
361
361
|
O(e) {
|
|
362
362
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -365,26 +365,26 @@ class Y {
|
|
|
365
365
|
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
366
366
|
}
|
|
367
367
|
_(e) {
|
|
368
|
-
this._$AH !== m && q(this._$AH) ? this._$AA.nextSibling.data = e : this.T(
|
|
368
|
+
this._$AH !== m && q(this._$AH) ? this._$AA.nextSibling.data = e : this.T(C.createTextNode(e)), this._$AH = e;
|
|
369
369
|
}
|
|
370
370
|
$(e) {
|
|
371
|
-
const { values: t, _$litType$: s } = e,
|
|
372
|
-
if (this._$AH?._$AD ===
|
|
371
|
+
const { values: t, _$litType$: s } = e, r = typeof s == "number" ? this._$AC(e) : (s.el === void 0 && (s.el = W.createElement(Ze(s.h, s.h[0]), this.options)), s);
|
|
372
|
+
if (this._$AH?._$AD === r) this._$AH.p(t);
|
|
373
373
|
else {
|
|
374
|
-
const o = new
|
|
374
|
+
const o = new Nt(r, this), n = o.u(this.options);
|
|
375
375
|
o.p(t), this.T(n), this._$AH = o;
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
_$AC(e) {
|
|
379
|
-
let t =
|
|
380
|
-
return t === void 0 &&
|
|
379
|
+
let t = Fe.get(e.strings);
|
|
380
|
+
return t === void 0 && Fe.set(e.strings, t = new W(e)), t;
|
|
381
381
|
}
|
|
382
382
|
k(e) {
|
|
383
|
-
|
|
383
|
+
ge(this._$AH) || (this._$AH = [], this._$AR());
|
|
384
384
|
const t = this._$AH;
|
|
385
|
-
let s,
|
|
386
|
-
for (const o of e)
|
|
387
|
-
|
|
385
|
+
let s, r = 0;
|
|
386
|
+
for (const o of e) r === t.length ? t.push(s = new Y(this.O(j()), this.O(j()), this, this.options)) : s = t[r], s._$AI(o), r++;
|
|
387
|
+
r < t.length && (this._$AR(s && s._$AB.nextSibling, r), t.length = r);
|
|
388
388
|
}
|
|
389
389
|
_$AR(e = this._$AA.nextSibling, t) {
|
|
390
390
|
for (this._$AP?.(!1, !0, t); e !== this._$AB; ) {
|
|
@@ -403,25 +403,25 @@ class oe {
|
|
|
403
403
|
get _$AU() {
|
|
404
404
|
return this._$AM._$AU;
|
|
405
405
|
}
|
|
406
|
-
constructor(e, t, s,
|
|
407
|
-
this.type = 1, this._$AH = m, this._$AN = void 0, this.element = e, this.name = t, this._$AM =
|
|
406
|
+
constructor(e, t, s, r, o) {
|
|
407
|
+
this.type = 1, this._$AH = m, this._$AN = void 0, this.element = e, this.name = t, 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(e, t = this, s,
|
|
409
|
+
_$AI(e, t = this, s, r) {
|
|
410
410
|
const o = this.strings;
|
|
411
411
|
let n = !1;
|
|
412
|
-
if (o === void 0) e =
|
|
412
|
+
if (o === void 0) e = M(this, e, t, 0), n = !q(e) || e !== this._$AH && e !== F, n && (this._$AH = e);
|
|
413
413
|
else {
|
|
414
414
|
const i = e;
|
|
415
|
-
let c,
|
|
416
|
-
for (e = o[0], c = 0; c < o.length - 1; c++)
|
|
415
|
+
let c, p;
|
|
416
|
+
for (e = o[0], c = 0; c < o.length - 1; c++) p = M(this, i[s + c], t, c), p === F && (p = this._$AH[c]), n ||= !q(p) || p !== this._$AH[c], p === m ? e = m : e !== m && (e += (p ?? "") + o[c + 1]), this._$AH[c] = p;
|
|
417
417
|
}
|
|
418
|
-
n && !
|
|
418
|
+
n && !r && this.j(e);
|
|
419
419
|
}
|
|
420
420
|
j(e) {
|
|
421
421
|
e === m ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
|
-
class
|
|
424
|
+
class Ft extends oe {
|
|
425
425
|
constructor() {
|
|
426
426
|
super(...arguments), this.type = 3;
|
|
427
427
|
}
|
|
@@ -429,7 +429,7 @@ class Bt extends oe {
|
|
|
429
429
|
this.element[this.name] = e === m ? void 0 : e;
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
|
-
class
|
|
432
|
+
class Mt extends oe {
|
|
433
433
|
constructor() {
|
|
434
434
|
super(...arguments), this.type = 4;
|
|
435
435
|
}
|
|
@@ -437,20 +437,20 @@ class Dt extends oe {
|
|
|
437
437
|
this.element.toggleAttribute(this.name, !!e && e !== m);
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
class
|
|
441
|
-
constructor(e, t, s,
|
|
442
|
-
super(e, t, s,
|
|
440
|
+
class Ot extends oe {
|
|
441
|
+
constructor(e, t, s, r, o) {
|
|
442
|
+
super(e, t, s, r, o), this.type = 5;
|
|
443
443
|
}
|
|
444
444
|
_$AI(e, t = this) {
|
|
445
|
-
if ((e =
|
|
446
|
-
const s = this._$AH,
|
|
447
|
-
|
|
445
|
+
if ((e = M(this, e, t, 0) ?? m) === F) return;
|
|
446
|
+
const s = this._$AH, r = e === m && s !== m || e.capture !== s.capture || e.once !== s.once || e.passive !== s.passive, o = e !== m && (s === m || r);
|
|
447
|
+
r && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
448
448
|
}
|
|
449
449
|
handleEvent(e) {
|
|
450
450
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
|
-
class
|
|
453
|
+
class Ut {
|
|
454
454
|
constructor(e, t, s) {
|
|
455
455
|
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = s;
|
|
456
456
|
}
|
|
@@ -458,22 +458,22 @@ class Rt {
|
|
|
458
458
|
return this._$AM._$AU;
|
|
459
459
|
}
|
|
460
460
|
_$AI(e) {
|
|
461
|
-
|
|
461
|
+
M(this, e);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
const
|
|
464
|
+
const Ht = fe.litHtmlPolyfillSupport;
|
|
465
|
+
Ht?.(W, Y), (fe.litHtmlVersions ??= []).push("3.3.3");
|
|
466
|
+
const Lt = (a, e, t) => {
|
|
467
467
|
const s = t?.renderBefore ?? e;
|
|
468
|
-
let
|
|
469
|
-
if (
|
|
468
|
+
let r = s._$litPart$;
|
|
469
|
+
if (r === void 0) {
|
|
470
470
|
const o = t?.renderBefore ?? null;
|
|
471
|
-
s._$litPart$ =
|
|
471
|
+
s._$litPart$ = r = new Y(e.insertBefore(j(), o), o, void 0, t ?? {});
|
|
472
472
|
}
|
|
473
|
-
return
|
|
473
|
+
return r._$AI(a), r;
|
|
474
474
|
};
|
|
475
|
-
const
|
|
476
|
-
class N extends
|
|
475
|
+
const ve = globalThis;
|
|
476
|
+
class N extends R {
|
|
477
477
|
constructor() {
|
|
478
478
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
479
479
|
}
|
|
@@ -483,7 +483,7 @@ class N extends z {
|
|
|
483
483
|
}
|
|
484
484
|
update(e) {
|
|
485
485
|
const t = this.render();
|
|
486
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do =
|
|
486
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Lt(t, this.renderRoot, this.renderOptions);
|
|
487
487
|
}
|
|
488
488
|
connectedCallback() {
|
|
489
489
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -492,41 +492,41 @@ class N extends z {
|
|
|
492
492
|
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
493
493
|
}
|
|
494
494
|
render() {
|
|
495
|
-
return
|
|
495
|
+
return F;
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
|
-
N._$litElement$ = !0, N.finalized = !0,
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
(
|
|
502
|
-
const
|
|
503
|
-
function
|
|
504
|
-
const e = Object.entries(
|
|
498
|
+
N._$litElement$ = !0, N.finalized = !0, ve.litElementHydrateSupport?.({ LitElement: N });
|
|
499
|
+
const Gt = ve.litElementPolyfillSupport;
|
|
500
|
+
Gt?.({ LitElement: N });
|
|
501
|
+
(ve.litElementVersions ??= []).push("4.2.2");
|
|
502
|
+
const jt = 50;
|
|
503
|
+
function qt(a = {}) {
|
|
504
|
+
const e = Object.entries(a).filter(([, s]) => s != null && s !== "");
|
|
505
505
|
if (!e.length) return "";
|
|
506
506
|
const t = new URLSearchParams();
|
|
507
|
-
return e.forEach(([s,
|
|
507
|
+
return e.forEach(([s, r]) => t.set(s, String(r))), `?${t.toString()}`;
|
|
508
508
|
}
|
|
509
|
-
function
|
|
510
|
-
if (!
|
|
511
|
-
const s =
|
|
509
|
+
function Wt({ baseUrl: a, token: e = "", fetchFn: t } = {}) {
|
|
510
|
+
if (!a) throw new Error("createClient requires a baseUrl");
|
|
511
|
+
const s = a.replace(/\/+$/, ""), r = t || ((...i) => fetch(...i));
|
|
512
512
|
async function o(i) {
|
|
513
513
|
const c = { Accept: "application/json" };
|
|
514
514
|
e && (c.Authorization = `Bearer ${e}`);
|
|
515
|
-
const
|
|
516
|
-
if (!
|
|
517
|
-
const
|
|
518
|
-
throw
|
|
515
|
+
const p = await r(`${s}${i}`, { headers: c });
|
|
516
|
+
if (!p.ok) {
|
|
517
|
+
const d = new Error(`api-hsot ${p.status} on ${i}`);
|
|
518
|
+
throw d.status = p.status, d;
|
|
519
519
|
}
|
|
520
|
-
return
|
|
520
|
+
return p.json();
|
|
521
521
|
}
|
|
522
522
|
async function n(i, c = {}) {
|
|
523
|
-
const
|
|
524
|
-
let
|
|
525
|
-
for (let
|
|
526
|
-
const u =
|
|
527
|
-
if (
|
|
523
|
+
const p = [];
|
|
524
|
+
let d = null;
|
|
525
|
+
for (let h = 0; h < jt; h += 1) {
|
|
526
|
+
const u = qt(d ? { ...c, cursor: d } : c), f = await o(`${i}${u}`);
|
|
527
|
+
if (p.push(...f.items || []), d = f.nextCursor || null, !d) break;
|
|
528
528
|
}
|
|
529
|
-
return { items:
|
|
529
|
+
return { items: p, total: p.length, nextCursor: null };
|
|
530
530
|
}
|
|
531
531
|
return {
|
|
532
532
|
listSchools: (i) => n("/schools", i),
|
|
@@ -553,145 +553,145 @@ const L = {
|
|
|
553
553
|
// reportHref() drops the parameter when there is none.
|
|
554
554
|
report: "/report-a-score/?game={id}"
|
|
555
555
|
};
|
|
556
|
-
function
|
|
557
|
-
return String(
|
|
556
|
+
function v(a, e) {
|
|
557
|
+
return String(a).replace(/\{(\w+)\}/g, (t, s) => e[s] !== void 0 && e[s] !== null ? String(e[s]) : t);
|
|
558
558
|
}
|
|
559
|
-
function O(
|
|
559
|
+
function O(a) {
|
|
560
560
|
return {
|
|
561
|
-
game:
|
|
562
|
-
school:
|
|
563
|
-
section:
|
|
564
|
-
report:
|
|
561
|
+
game: a.getAttribute("game-href") || L.game,
|
|
562
|
+
school: a.getAttribute("school-href") || L.school,
|
|
563
|
+
section: a.getAttribute("section-href") || L.section,
|
|
564
|
+
report: a.getAttribute("report-href") || L.report
|
|
565
565
|
};
|
|
566
566
|
}
|
|
567
|
-
function
|
|
568
|
-
const t =
|
|
567
|
+
function Je(a, e = "") {
|
|
568
|
+
const t = v(a.report || L.report, { id: e || "" });
|
|
569
569
|
return e ? t : t.replace(/([?&])game=(?=&|$)/, "$1").replace(/[?&]$/, "").replace(/\?&/, "?");
|
|
570
570
|
}
|
|
571
|
-
const k = (
|
|
572
|
-
function x(
|
|
573
|
-
if (!
|
|
574
|
-
const [t, s,
|
|
575
|
-
return !t || !s || !
|
|
571
|
+
const k = (a) => a ? a.charAt(0).toUpperCase() + a.slice(1) : "";
|
|
572
|
+
function x(a, e) {
|
|
573
|
+
if (!a) return "TBD";
|
|
574
|
+
const [t, s, r] = String(a).split("-").map(Number);
|
|
575
|
+
return !t || !s || !r ? "TBD" : new Date(t, s - 1, r).toLocaleDateString("en-US", e || { weekday: "short", month: "short", day: "numeric" });
|
|
576
576
|
}
|
|
577
|
-
function
|
|
578
|
-
if (!
|
|
579
|
-
const [e, t] = String(
|
|
577
|
+
function $e(a) {
|
|
578
|
+
if (!a) return "";
|
|
579
|
+
const [e, t] = String(a).split(":").map(Number);
|
|
580
580
|
if (Number.isNaN(e)) return "";
|
|
581
581
|
const s = e >= 12 ? "PM" : "AM";
|
|
582
582
|
return `${(e + 11) % 12 + 1}:${String(t || 0).padStart(2, "0")} ${s}`;
|
|
583
583
|
}
|
|
584
|
-
function
|
|
585
|
-
return
|
|
584
|
+
function Vt(a) {
|
|
585
|
+
return a ? `${Math.floor(a / 12)}-${a % 12}` : "·";
|
|
586
586
|
}
|
|
587
|
-
function
|
|
588
|
-
return (Array.isArray(
|
|
587
|
+
function Yt(a) {
|
|
588
|
+
return (Array.isArray(a?.positions) ? a.positions : String(a?.position ?? "").split(/[/,]/)).map((t) => String(t ?? "").trim()).filter(Boolean).join("/");
|
|
589
589
|
}
|
|
590
|
-
function K(
|
|
591
|
-
const e =
|
|
592
|
-
return
|
|
590
|
+
function K(a = /* @__PURE__ */ new Date()) {
|
|
591
|
+
const e = a.getFullYear();
|
|
592
|
+
return a.getMonth() >= 6 ? `${e}-${e + 1}` : `${e - 1}-${e}`;
|
|
593
593
|
}
|
|
594
|
-
function
|
|
594
|
+
function be(a = /* @__PURE__ */ new Date()) {
|
|
595
595
|
const e = (t) => String(t).padStart(2, "0");
|
|
596
|
-
return `${
|
|
596
|
+
return `${a.getFullYear()}-${e(a.getMonth() + 1)}-${e(a.getDate())}`;
|
|
597
597
|
}
|
|
598
|
-
function
|
|
599
|
-
const t = [...new Set((
|
|
598
|
+
function Kt(a, e = be()) {
|
|
599
|
+
const t = [...new Set((a || []).filter(Boolean))].sort();
|
|
600
600
|
if (!t.length || t.includes(e)) return e;
|
|
601
|
-
const s = t.filter((
|
|
601
|
+
const s = t.filter((r) => r < e);
|
|
602
602
|
return s.length ? s[s.length - 1] : t[0];
|
|
603
603
|
}
|
|
604
|
-
function
|
|
605
|
-
return
|
|
604
|
+
function ye(a) {
|
|
605
|
+
return a ? (a.abbr || a.name || "?").slice(0, 4).toUpperCase() : "?";
|
|
606
606
|
}
|
|
607
|
-
function ee(
|
|
608
|
-
if (!
|
|
609
|
-
const e = parseInt(
|
|
610
|
-
return 0.299 * t + 0.587 * s + 0.114 *
|
|
607
|
+
function ee(a) {
|
|
608
|
+
if (!a || !/^#[0-9a-fA-F]{6}$/.test(a)) return "#FFFFFF";
|
|
609
|
+
const e = parseInt(a.slice(1), 16), t = e >> 16 & 255, s = e >> 8 & 255, r = e & 255;
|
|
610
|
+
return 0.299 * t + 0.587 * s + 0.114 * r > 150 ? "#0F1B33" : "#FFFFFF";
|
|
611
611
|
}
|
|
612
|
-
const
|
|
613
|
-
const e = ["th", "st", "nd", "rd"], t =
|
|
614
|
-
return
|
|
612
|
+
const Qt = (a) => {
|
|
613
|
+
const e = ["th", "st", "nd", "rd"], t = a % 100;
|
|
614
|
+
return a + (e[(t - 20) % 10] || e[t] || e[0]);
|
|
615
615
|
};
|
|
616
|
-
function
|
|
616
|
+
function de(a, e) {
|
|
617
617
|
const t = (o) => {
|
|
618
618
|
const n = /^\d+/.exec(String(o ?? ""));
|
|
619
619
|
return n ? Number(n[0]) : null;
|
|
620
|
-
}, s = t(
|
|
621
|
-
return s !== null &&
|
|
620
|
+
}, s = t(a), r = t(e);
|
|
621
|
+
return s !== null && r !== null && s !== r ? r - s : s !== null && r === null ? -1 : s === null && r !== null ? 1 : String(a ?? "").localeCompare(String(e ?? ""), "en", { sensitivity: "base" });
|
|
622
622
|
}
|
|
623
|
-
function
|
|
623
|
+
function Xe(a, e) {
|
|
624
624
|
const t = (s) => String(s?.name ?? s ?? "");
|
|
625
|
-
return t(
|
|
625
|
+
return t(a).localeCompare(t(e), "en", { numeric: !0, sensitivity: "base" });
|
|
626
626
|
}
|
|
627
|
-
function
|
|
628
|
-
if (
|
|
629
|
-
const e = [
|
|
627
|
+
function et(a) {
|
|
628
|
+
if (a.state === "live") {
|
|
629
|
+
const e = [a.period, a.clock].filter(Boolean).join(" ");
|
|
630
630
|
return { kind: "live", label: e ? `Live · ${e}` : "Live" };
|
|
631
631
|
}
|
|
632
|
-
if (
|
|
632
|
+
if (a.state === "final") {
|
|
633
633
|
const e = [];
|
|
634
|
-
return
|
|
634
|
+
return a.finish === "overtime" && e.push("OT"), a.finish === "shootout" && e.push("PK-SO"), a.forfeit && a.forfeit !== "none" && e.push("Forfeit"), { kind: "final", label: `Final${e.length ? ` · ${e.join(" · ")}` : ""}` };
|
|
635
635
|
}
|
|
636
|
-
return
|
|
636
|
+
return a.state === "postponed" ? { kind: "warn", label: "Postponed" } : a.state === "canceled" ? { kind: "warn", label: "Canceled" } : { kind: "sched", label: `${x(a.date, { month: "short", day: "numeric" })} · ${$e(a.time)}`.replace(/ · $/, "") };
|
|
637
637
|
}
|
|
638
|
-
const
|
|
639
|
-
function
|
|
640
|
-
return e ?
|
|
638
|
+
const Zt = ["boys", "girls"];
|
|
639
|
+
function tt(a, e) {
|
|
640
|
+
return e ? a ? a.gender === e || a.gender === "coed" : !1 : !0;
|
|
641
641
|
}
|
|
642
|
-
function
|
|
643
|
-
return e ? (
|
|
642
|
+
function st(a, e) {
|
|
643
|
+
return e ? (a || []).filter((t) => tt(t, e)) : a || [];
|
|
644
644
|
}
|
|
645
|
-
function
|
|
646
|
-
const e = new Set((
|
|
647
|
-
return
|
|
645
|
+
function pe(a) {
|
|
646
|
+
const e = new Set((a || []).map((t) => t && t.gender));
|
|
647
|
+
return Zt.filter((t) => e.has(t));
|
|
648
648
|
}
|
|
649
|
-
const
|
|
650
|
-
function T(
|
|
651
|
-
let e = String(
|
|
649
|
+
const Jt = (a) => pe(a).length === 2, Xt = /* @__PURE__ */ new Set(["game", "story", "page", "forum", "video", "gallery"]);
|
|
650
|
+
function T(a) {
|
|
651
|
+
let e = String(a || "").replace(/^[a-z][a-z0-9+.-]*:\/\/[^/#?]*/i, "");
|
|
652
652
|
const t = e.indexOf("#");
|
|
653
653
|
let s = "";
|
|
654
654
|
t !== -1 && (s = e.slice(t).split("?")[0], e = e.slice(0, t));
|
|
655
|
-
let
|
|
656
|
-
return
|
|
655
|
+
let r = e.split("?")[0] + s;
|
|
656
|
+
return r = r.replace(/([^:])\/{2,}/g, "$1/").replace(/^\/{2,}/, "/"), r = r.replace(/^\/(?=#)/, ""), r.length > 1 && (r = r.replace(/\/+$/, "")), r.toLowerCase();
|
|
657
657
|
}
|
|
658
|
-
function
|
|
659
|
-
const
|
|
660
|
-
if (!
|
|
661
|
-
const e = (
|
|
662
|
-
return T((
|
|
658
|
+
function at() {
|
|
659
|
+
const a = globalThis.location;
|
|
660
|
+
if (!a) return "";
|
|
661
|
+
const e = (a.hash || "").startsWith("#/") ? a.hash : "";
|
|
662
|
+
return T((a.pathname || "") + e);
|
|
663
663
|
}
|
|
664
|
-
function
|
|
664
|
+
function es(a, e, t) {
|
|
665
665
|
if (!t) return null;
|
|
666
|
-
const s = T(
|
|
666
|
+
const s = T(a);
|
|
667
667
|
if (!s) return null;
|
|
668
|
-
const
|
|
669
|
-
if (s ===
|
|
670
|
-
const n = T(
|
|
668
|
+
const r = T(v(e.game, { sport: t, id: "" })), o = T(v(e.school, { id: "" }));
|
|
669
|
+
if (s === r || s.startsWith(`${r}/`) || s === o || s.startsWith(`${o}/`)) return null;
|
|
670
|
+
const n = T(v(e.section, { sport: t, view: "" }));
|
|
671
671
|
if (s === n) return "";
|
|
672
672
|
if (!s.startsWith(`${n}/`)) return null;
|
|
673
673
|
const i = s.slice(n.length + 1), c = i.split("/");
|
|
674
|
-
return c.length > 2 || c.some((
|
|
674
|
+
return c.length > 2 || c.some((p) => !/^[a-z][a-z-]*$/.test(p)) || Xt.has(c[0]) ? null : i;
|
|
675
675
|
}
|
|
676
|
-
function
|
|
677
|
-
const s = (o) =>
|
|
676
|
+
function ts(a, e, t) {
|
|
677
|
+
const s = (o) => v(t.section, { sport: a, view: o }).replace(/([^:])\/{2,}/g, "$1/"), r = Jt(e) ? [
|
|
678
678
|
{ label: "Boys Standings", href: s("boys/standings") },
|
|
679
679
|
{ label: "Girls Standings", href: s("girls/standings") }
|
|
680
680
|
] : [{ label: "Standings", href: s("standings") }];
|
|
681
681
|
return [
|
|
682
|
-
{ label: `${k(
|
|
682
|
+
{ label: `${k(a)} Home`, href: s("") },
|
|
683
683
|
{ label: "Scores/Schedule", href: s("scores") },
|
|
684
684
|
{ label: "Playoff Brackets", href: s("brackets") },
|
|
685
|
-
...
|
|
685
|
+
...r,
|
|
686
686
|
{ label: "Polls & Rankings", href: s("rankings") }
|
|
687
687
|
];
|
|
688
688
|
}
|
|
689
|
-
function
|
|
689
|
+
function ss(a, e = at()) {
|
|
690
690
|
const t = T(e);
|
|
691
|
-
for (const s of
|
|
691
|
+
for (const s of a.querySelectorAll(':scope > a[slot="nav"]'))
|
|
692
692
|
t && T(s.getAttribute("href")) === t ? s.setAttribute("aria-current", "page") : s.removeAttribute("aria-current");
|
|
693
693
|
}
|
|
694
|
-
class
|
|
694
|
+
class w extends N {
|
|
695
695
|
static properties = {
|
|
696
696
|
api: { type: String },
|
|
697
697
|
refreshInterval: { type: Number, attribute: "refresh-interval" },
|
|
@@ -710,7 +710,7 @@ class y extends N {
|
|
|
710
710
|
this._client = e, this.isConnected && this.load();
|
|
711
711
|
}
|
|
712
712
|
get client() {
|
|
713
|
-
return this._client ? this._client : this.api ?
|
|
713
|
+
return this._client ? this._client : this.api ? Wt({ baseUrl: this.api }) : null;
|
|
714
714
|
}
|
|
715
715
|
connectedCallback() {
|
|
716
716
|
super.connectedCallback(), this._setupInterval();
|
|
@@ -722,7 +722,7 @@ class y extends N {
|
|
|
722
722
|
this.load();
|
|
723
723
|
}
|
|
724
724
|
updated(e) {
|
|
725
|
-
e.has("api") && e.get("api") !== void 0 && e.get("api") !== this.api && this.load(), e.has("refreshInterval") && this._setupInterval(),
|
|
725
|
+
e.has("api") && e.get("api") !== void 0 && e.get("api") !== this.api && this.load(), e.has("refreshInterval") && this._setupInterval(), ss(this);
|
|
726
726
|
}
|
|
727
727
|
async load() {
|
|
728
728
|
const e = this.client;
|
|
@@ -757,7 +757,7 @@ class y extends N {
|
|
|
757
757
|
return l``;
|
|
758
758
|
}
|
|
759
759
|
}
|
|
760
|
-
const b = (
|
|
760
|
+
const b = (a) => Object.fromEntries((a || []).map((e) => [e.id, e])), as = y`
|
|
761
761
|
:host {
|
|
762
762
|
--hsot-red: var(--color-red, #D1232A);
|
|
763
763
|
--hsot-red-deep: var(--color-red-dark, #951C21);
|
|
@@ -795,7 +795,7 @@ const b = (r) => Object.fromEntries((r || []).map((e) => [e.id, e])), Xt = w`
|
|
|
795
795
|
outline-offset: 1px;
|
|
796
796
|
}
|
|
797
797
|
.mut { color: var(--hsot-gray-5); }
|
|
798
|
-
`,
|
|
798
|
+
`, rs = y`
|
|
799
799
|
.band { background: var(--hsot-white); color: var(--hsot-black); }
|
|
800
800
|
.band .inner { max-width: 1366px; margin: 0 auto; padding: 1.1rem 1.25rem 0; }
|
|
801
801
|
.band h1, .band h2.bandtitle {
|
|
@@ -844,7 +844,7 @@ const b = (r) => Object.fromEntries((r || []).map((e) => [e.id, e])), Xt = w`
|
|
|
844
844
|
@media (max-width: 720px) {
|
|
845
845
|
.band h1, .band h2.bandtitle, .band.section h1, .band.section h2.bandtitle { font-size: 1.8rem; }
|
|
846
846
|
}
|
|
847
|
-
`,
|
|
847
|
+
`, os = y`
|
|
848
848
|
.view { max-width: 1366px; margin: 0 auto; padding: 1.25rem; box-sizing: border-box; }
|
|
849
849
|
/* Optional right rail (slot="rail" light-DOM children): a divided 300px
|
|
850
850
|
column on desktop, stacked under the view content on smaller screens. */
|
|
@@ -908,7 +908,7 @@ const b = (r) => Object.fromEntries((r || []).map((e) => [e.id, e])), Xt = w`
|
|
|
908
908
|
.error { padding: 1.2rem 1rem; color: var(--hsot-red-deep); font-size: 0.9rem; }
|
|
909
909
|
.note { font-size: 0.8125rem; color: var(--hsot-gray-5); margin: 0.6rem 0 0; }
|
|
910
910
|
.loading { padding: 1.2rem; color: var(--hsot-gray-5); font-family: var(--hsot-heading-font); }
|
|
911
|
-
`,
|
|
911
|
+
`, ns = y`
|
|
912
912
|
.pill {
|
|
913
913
|
display: inline-block; font-family: var(--hsot-heading-font); font-weight: 700;
|
|
914
914
|
font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em;
|
|
@@ -923,7 +923,7 @@ const b = (r) => Object.fromEntries((r || []).map((e) => [e.id, e])), Xt = w`
|
|
|
923
923
|
.pill.champ { background: var(--hsot-straw); color: #6b5900; }
|
|
924
924
|
@keyframes hsot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
|
|
925
925
|
@media (prefers-reduced-motion: reduce) { .pill.live { animation: none; } }
|
|
926
|
-
`,
|
|
926
|
+
`, is = y`
|
|
927
927
|
.tablewrap { overflow-x: auto; }
|
|
928
928
|
table.data { font-family: var(--hsot-heading-font); font-size: 14px; border-collapse: collapse; width: 100%; }
|
|
929
929
|
table.data th {
|
|
@@ -941,7 +941,7 @@ const b = (r) => Object.fromEntries((r || []).map((e) => [e.id, e])), Xt = w`
|
|
|
941
941
|
table.data tbody tr.rowlink:hover { background: var(--hsot-gray-1); }
|
|
942
942
|
table.data td.teamcell a { color: inherit; text-decoration: none; font-weight: 500; }
|
|
943
943
|
table.data td.teamcell a:hover { text-decoration: underline; }
|
|
944
|
-
`,
|
|
944
|
+
`, ls = y`
|
|
945
945
|
.swatch {
|
|
946
946
|
display: inline-flex; align-items: center; justify-content: center;
|
|
947
947
|
width: 26px; height: 26px; border-radius: 50%;
|
|
@@ -965,7 +965,7 @@ const b = (r) => Object.fromEntries((r || []).map((e) => [e.id, e])), Xt = w`
|
|
|
965
965
|
.dot.W { background: var(--hsot-win); }
|
|
966
966
|
.dot.L { background: var(--hsot-loss); }
|
|
967
967
|
.dot.T { background: var(--hsot-tie); }
|
|
968
|
-
`,
|
|
968
|
+
`, cs = y`
|
|
969
969
|
ul.gamelist { list-style: none; margin: 0; padding: 0; }
|
|
970
970
|
.gamelist li {
|
|
971
971
|
display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 1rem;
|
|
@@ -1015,102 +1015,102 @@ const b = (r) => Object.fromEntries((r || []).map((e) => [e.id, e])), Xt = w`
|
|
|
1015
1015
|
.gamelist .ff { color: var(--hsot-gray-5); font-size: 0.78rem; font-style: italic; }
|
|
1016
1016
|
.gamelist .where { color: var(--hsot-gray-5); font-size: 0.78rem; }
|
|
1017
1017
|
.gamelist a.box { font-size: 0.78rem; }
|
|
1018
|
-
`, U = [
|
|
1019
|
-
function ne(
|
|
1020
|
-
return
|
|
1018
|
+
`, U = [as, rs, os, ns, is, ls, cs];
|
|
1019
|
+
function ne(a) {
|
|
1020
|
+
return a.state !== "final" ? null : a.forfeit === "home" ? "away" : a.forfeit === "away" || a.homeScore > a.awayScore ? "home" : a.awayScore > a.homeScore ? "away" : a.tiebreakWinner && a.tiebreakWinner !== "none" ? a.tiebreakWinner : "tie";
|
|
1021
1021
|
}
|
|
1022
|
-
function
|
|
1023
|
-
return
|
|
1022
|
+
function hs(a) {
|
|
1023
|
+
return a && (a.forfeit === "home" || a.forfeit === "away") ? a.forfeit : null;
|
|
1024
1024
|
}
|
|
1025
|
-
function Q(
|
|
1026
|
-
const t = {}, s = (o) => (t[o] = t[o] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, t[o]),
|
|
1027
|
-
for (const o of
|
|
1025
|
+
function Q(a, e) {
|
|
1026
|
+
const t = {}, s = (o) => (t[o] = t[o] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, t[o]), r = a.filter((o) => o.state === "final" && o.gameType !== "scrimmage" && !0).sort((o, n) => String(o.date).localeCompare(String(n.date)));
|
|
1027
|
+
for (const o of r) {
|
|
1028
1028
|
const n = ne(o), i = o.gameType === "conference";
|
|
1029
1029
|
for (const c of ["home", "away"]) {
|
|
1030
|
-
const
|
|
1031
|
-
if (!
|
|
1032
|
-
const
|
|
1033
|
-
|
|
1030
|
+
const p = c === "home" ? o.homeTeamId : o.awayTeamId;
|
|
1031
|
+
if (!p) continue;
|
|
1032
|
+
const d = s(p), h = c === "home" ? o.homeScore : o.awayScore, u = c === "home" ? o.awayScore : o.homeScore;
|
|
1033
|
+
d.pf += h, d.pa += u;
|
|
1034
1034
|
let f = "T";
|
|
1035
|
-
n === "tie" ? (
|
|
1035
|
+
n === "tie" ? (d.t += 1, i && (d.ct += 1)) : n === c ? (d.w += 1, i && (d.cw += 1), f = "W") : (d.l += 1, i && (d.cl += 1), f = "L"), d.results.push({ gameId: o.id, date: o.date, mark: f, my: h, their: u, opp: c === "home" ? o.awayTeamId : o.homeTeamId, conf: i });
|
|
1036
1036
|
}
|
|
1037
1037
|
}
|
|
1038
1038
|
return t;
|
|
1039
1039
|
}
|
|
1040
|
-
function ie(
|
|
1041
|
-
if (!
|
|
1042
|
-
const e =
|
|
1040
|
+
function ie(a) {
|
|
1041
|
+
if (!a || !a.length) return "";
|
|
1042
|
+
const e = a[a.length - 1].mark;
|
|
1043
1043
|
let t = 0;
|
|
1044
|
-
for (let s =
|
|
1044
|
+
for (let s = a.length - 1; s >= 0 && a[s].mark === e; s -= 1) t += 1;
|
|
1045
1045
|
return e + t;
|
|
1046
1046
|
}
|
|
1047
|
-
const
|
|
1048
|
-
const s =
|
|
1049
|
-
return s ? (
|
|
1050
|
-
}, Oe = (
|
|
1051
|
-
function S(
|
|
1052
|
-
if (!
|
|
1053
|
-
const t = e ?
|
|
1054
|
-
return `${t}-${s}${
|
|
1055
|
-
}
|
|
1056
|
-
function
|
|
1057
|
-
return
|
|
1047
|
+
const Me = (a, e, t) => {
|
|
1048
|
+
const s = a + e + t;
|
|
1049
|
+
return s ? (a + t / 2) / s : 0;
|
|
1050
|
+
}, Oe = (a) => a.toFixed(3).replace("0.", ".");
|
|
1051
|
+
function S(a, e = !1) {
|
|
1052
|
+
if (!a) return "0-0";
|
|
1053
|
+
const t = e ? a.cw : a.w, s = e ? a.cl : a.l, r = e ? a.ct : a.t;
|
|
1054
|
+
return `${t}-${s}${r ? `-${r}` : ""}`;
|
|
1055
|
+
}
|
|
1056
|
+
function rt(a, e) {
|
|
1057
|
+
return a.map((t) => {
|
|
1058
1058
|
const s = e[t.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] };
|
|
1059
|
-
return { team: t, rec: s, confPct:
|
|
1059
|
+
return { team: t, rec: s, confPct: Me(s.cw, s.cl, s.ct), overallPct: Me(s.w, s.l, s.t) };
|
|
1060
1060
|
}).sort((t, s) => s.confPct - t.confPct || s.overallPct - t.overallPct || s.rec.pf - s.rec.pa - (t.rec.pf - t.rec.pa));
|
|
1061
1061
|
}
|
|
1062
|
-
function
|
|
1063
|
-
return
|
|
1062
|
+
function we(a, e) {
|
|
1063
|
+
return a.filter((t) => (t.homeTeamId === e || t.awayTeamId === e) && (t.state === "scheduled" || t.state === "live") && t.gameType !== "scrimmage").sort((t, s) => String(t.date).localeCompare(String(s.date)))[0] || null;
|
|
1064
1064
|
}
|
|
1065
|
-
function Ue(
|
|
1066
|
-
const t =
|
|
1065
|
+
function Ue(a, e) {
|
|
1066
|
+
const t = a[e];
|
|
1067
1067
|
return t && t.results.length ? t.results[t.results.length - 1] : null;
|
|
1068
1068
|
}
|
|
1069
|
-
function
|
|
1069
|
+
function xe(a, e, t, s, r) {
|
|
1070
1070
|
const o = e[t];
|
|
1071
1071
|
if (!o) return null;
|
|
1072
1072
|
const n = /* @__PURE__ */ new Map();
|
|
1073
|
-
for (const c of
|
|
1074
|
-
if (c.sport !== s ||
|
|
1075
|
-
const
|
|
1076
|
-
(!
|
|
1073
|
+
for (const c of a || []) {
|
|
1074
|
+
if (c.sport !== s || r && c.effectiveDate > r || c.gender && o.gender !== c.gender && o.gender !== "coed") continue;
|
|
1075
|
+
const p = c.gender || "", d = n.get(p);
|
|
1076
|
+
(!d || c.effectiveDate > d.effectiveDate) && n.set(p, c);
|
|
1077
1077
|
}
|
|
1078
1078
|
let i = null;
|
|
1079
1079
|
for (const c of n.values()) {
|
|
1080
|
-
const
|
|
1081
|
-
|
|
1080
|
+
const p = (c.teamIds || []).indexOf(t);
|
|
1081
|
+
p !== -1 && (!i || c.effectiveDate > i.effectiveDate) && (i = { poll: c, rank: p + 1 });
|
|
1082
1082
|
}
|
|
1083
1083
|
return i ? i.rank : null;
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1086
|
-
if (!
|
|
1087
|
-
const s = (
|
|
1085
|
+
function ds(a, e, t) {
|
|
1086
|
+
if (!a) return { kind: "none", delta: 0 };
|
|
1087
|
+
const s = (a.teamIds || []).indexOf(t) + 1;
|
|
1088
1088
|
if (!s) return { kind: "none", delta: 0 };
|
|
1089
1089
|
if (!e) return { kind: "same", delta: 0 };
|
|
1090
|
-
const
|
|
1091
|
-
if (!
|
|
1092
|
-
const o =
|
|
1090
|
+
const r = (e.teamIds || []).indexOf(t) + 1;
|
|
1091
|
+
if (!r) return { kind: "new", delta: 0 };
|
|
1092
|
+
const o = r - s;
|
|
1093
1093
|
return o > 0 ? { kind: "up", delta: o } : o < 0 ? { kind: "down", delta: -o } : { kind: "same", delta: 0 };
|
|
1094
1094
|
}
|
|
1095
|
-
function
|
|
1096
|
-
return /^https?:\/\//i.test(String(
|
|
1095
|
+
function ps(a) {
|
|
1096
|
+
return /^https?:\/\//i.test(String(a || ""));
|
|
1097
1097
|
}
|
|
1098
|
-
function
|
|
1099
|
-
if (!
|
|
1098
|
+
function ot(a, { w: e, h: t } = {}) {
|
|
1099
|
+
if (!ps(a)) return "";
|
|
1100
1100
|
const s = [];
|
|
1101
1101
|
e && s.push(`w=${Math.max(1, Math.round(e))}`), t && s.push(`h=${Math.max(1, Math.round(t))}`), s.push("f=webp");
|
|
1102
|
-
const
|
|
1103
|
-
return `${
|
|
1102
|
+
const r = a.includes("?") ? "&" : "?";
|
|
1103
|
+
return `${a}${r}${s.join("&")}`;
|
|
1104
1104
|
}
|
|
1105
|
-
function te(
|
|
1105
|
+
function te(a, e) {
|
|
1106
1106
|
const t = e * 2;
|
|
1107
|
-
return
|
|
1107
|
+
return ot(a?.logoAssetId, { w: t, h: t });
|
|
1108
1108
|
}
|
|
1109
|
-
function
|
|
1110
|
-
return
|
|
1109
|
+
function ms(a, e) {
|
|
1110
|
+
return ot(a?.photoAssetId, { w: e * 2 });
|
|
1111
1111
|
}
|
|
1112
|
-
function le(
|
|
1113
|
-
const o =
|
|
1112
|
+
function le(a, e, { title: t, sub: s, teams: r }) {
|
|
1113
|
+
const o = at(), i = !!a.querySelector(':scope > a[slot="nav"]') || es(o, e.hrefs, e.sport) !== null;
|
|
1114
1114
|
return l`
|
|
1115
1115
|
<div class="band section">
|
|
1116
1116
|
<div class="inner">
|
|
@@ -1121,7 +1121,7 @@ function le(r, e, { title: t, sub: s, teams: a }) {
|
|
|
1121
1121
|
<nav class="sectionnav" aria-label="${k(e.sport)} section">
|
|
1122
1122
|
<div class="navrow">
|
|
1123
1123
|
<slot name="nav">
|
|
1124
|
-
${
|
|
1124
|
+
${ts(e.sport, r, e.hrefs).map((c) => l`<a href=${c.href}
|
|
1125
1125
|
aria-current=${o && T(c.href) === o ? "page" : m}>${c.label}</a>`)}
|
|
1126
1126
|
</slot>
|
|
1127
1127
|
</div>
|
|
@@ -1129,89 +1129,139 @@ function le(r, e, { title: t, sub: s, teams: a }) {
|
|
|
1129
1129
|
</div>
|
|
1130
1130
|
`;
|
|
1131
1131
|
}
|
|
1132
|
-
const
|
|
1133
|
-
const t =
|
|
1134
|
-
return t ?
|
|
1135
|
-
},
|
|
1136
|
-
function P(
|
|
1137
|
-
if (!
|
|
1138
|
-
const t = te(
|
|
1132
|
+
const E = (a, e) => {
|
|
1133
|
+
const t = a.teamsById[e];
|
|
1134
|
+
return t ? a.schoolsById[t.schoolId] : null;
|
|
1135
|
+
}, z = (a, e) => E(a, e)?.name || "TBD", se = (a, e) => E(a, e)?.abbr || "TBD";
|
|
1136
|
+
function P(a, e = 26) {
|
|
1137
|
+
if (!a) return m;
|
|
1138
|
+
const t = te(a, e);
|
|
1139
1139
|
if (t)
|
|
1140
1140
|
return l`<img class="swatch logo" aria-hidden="true" alt="" loading="lazy"
|
|
1141
1141
|
src=${t} style="width:${e}px;height:${e}px" />`;
|
|
1142
|
-
const s =
|
|
1142
|
+
const s = a.colorPrimary || "#030711", r = ee(s);
|
|
1143
1143
|
return l`<span class="swatch" aria-hidden="true"
|
|
1144
|
-
style="width:${e}px;height:${e}px;background:${s};color:${
|
|
1145
|
-
>${
|
|
1144
|
+
style="width:${e}px;height:${e}px;background:${s};color:${r};font-size:${Math.max(8, e * 0.28)}px"
|
|
1145
|
+
>${ye(a)}</span>`;
|
|
1146
1146
|
}
|
|
1147
|
-
function
|
|
1148
|
-
const s =
|
|
1147
|
+
function ke(a, e, t) {
|
|
1148
|
+
const s = xe(a.rankings, a.teamsById, e, a.sport, t);
|
|
1149
1149
|
return s ? l`<span class="rankbadge">#${s}</span>` : m;
|
|
1150
1150
|
}
|
|
1151
|
-
function
|
|
1152
|
-
const s =
|
|
1153
|
-
return s ? l`${
|
|
1151
|
+
function ae(a, e, t) {
|
|
1152
|
+
const s = E(a, e);
|
|
1153
|
+
return s ? l`${ke(a, e, t)}<a href=${v(a.hrefs.school, { id: s.id })}>${s.name}</a>` : l`<span class="mut">TBD</span>`;
|
|
1154
1154
|
}
|
|
1155
|
-
function
|
|
1156
|
-
const s =
|
|
1155
|
+
function Se(a, e, t = 5) {
|
|
1156
|
+
const s = a.records[e];
|
|
1157
1157
|
if (!s || !s.results.length) return l`<span class="mut">·</span>`;
|
|
1158
|
-
const
|
|
1159
|
-
return l`<span class="dots" role="img" aria-label="last ${
|
|
1160
|
-
${
|
|
1161
|
-
title="${o.mark} ${o.my}-${o.their} vs ${
|
|
1162
|
-
href=${
|
|
1158
|
+
const r = s.results.slice(-1 * t);
|
|
1159
|
+
return l`<span class="dots" role="img" aria-label="last ${r.length} results">
|
|
1160
|
+
${r.map((o) => l`<a class="dot ${o.mark}"
|
|
1161
|
+
title="${o.mark} ${o.my}-${o.their} vs ${z(a, o.opp)}"
|
|
1162
|
+
href=${v(a.hrefs.game, { sport: a.sport, id: o.gameId })}>${o.mark}</a>`)}
|
|
1163
1163
|
</span>`;
|
|
1164
1164
|
}
|
|
1165
|
-
function B(
|
|
1166
|
-
return
|
|
1165
|
+
function B(a, e) {
|
|
1166
|
+
return a.querySelector(':scope > [slot="rail"]') ? l`<div class="view withrail">
|
|
1167
1167
|
<div class="viewmain">${e}</div>
|
|
1168
1168
|
<aside class="viewrail"><slot name="rail"></slot></aside>
|
|
1169
1169
|
</div>` : l`<div class="view">${e}</div>`;
|
|
1170
1170
|
}
|
|
1171
|
-
function D(
|
|
1172
|
-
if (!
|
|
1173
|
-
const e = l`<img src=${
|
|
1174
|
-
return l`<div class="promo">${
|
|
1171
|
+
function D(a) {
|
|
1172
|
+
if (!a.promoImage) return m;
|
|
1173
|
+
const e = l`<img src=${a.promoImage} alt=${a.promoAlt || "Sponsor"}>`;
|
|
1174
|
+
return l`<div class="promo">${a.promoHref ? l`<a href=${a.promoHref} target="_blank" rel="sponsored noopener">${e}</a>` : e}</div>`;
|
|
1175
1175
|
}
|
|
1176
|
-
function V(
|
|
1177
|
-
const e =
|
|
1176
|
+
function V(a) {
|
|
1177
|
+
const e = et(a);
|
|
1178
1178
|
return l`<span class="pill ${e.kind}">${e.label}</span>`;
|
|
1179
1179
|
}
|
|
1180
|
-
function
|
|
1180
|
+
function nt(a, e, t) {
|
|
1181
1181
|
if (!e) return l`<span class="mut">·</span>`;
|
|
1182
|
-
const s = e.homeTeamId === t ? e.awayTeamId : e.homeTeamId,
|
|
1183
|
-
return l`${e.state === "live" ? l`<span class="pill live">Live</span> ` : l`${x(e.date, { month: "numeric", day: "numeric" })} `}${
|
|
1182
|
+
const s = e.homeTeamId === t ? e.awayTeamId : e.homeTeamId, r = e.homeTeamId === t ? "vs" : "at";
|
|
1183
|
+
return l`${e.state === "live" ? l`<span class="pill live">Live</span> ` : l`${x(e.date, { month: "numeric", day: "numeric" })} `}${r} ${se(a, s)}`;
|
|
1184
1184
|
}
|
|
1185
|
-
|
|
1186
|
-
|
|
1185
|
+
const us = ["all", "conferences"], it = "all", He = (a) => us.includes(a) ? a : it, lt = Number.MAX_SAFE_INTEGER, ct = (a, e, t) => {
|
|
1186
|
+
const s = a[t];
|
|
1187
|
+
return s && e[s.schoolId] || null;
|
|
1188
|
+
};
|
|
1189
|
+
function fs(a, e) {
|
|
1190
|
+
const t = (a || []).map((s) => e[s.schoolId]?.areaCode).filter(Boolean);
|
|
1191
|
+
return [...new Set(t)].sort();
|
|
1192
|
+
}
|
|
1193
|
+
function gs(a, e, t, s) {
|
|
1194
|
+
return e ? [a.awayTeamId, a.homeTeamId].some((r) => ct(t, s, r)?.areaCode === e) : !0;
|
|
1195
|
+
}
|
|
1196
|
+
function vs(a, e, t, s) {
|
|
1197
|
+
const r = (i) => ct(t, s, i)?.name || "", o = (i, c) => !i - !c || Xe(i, c), n = new Map((a || []).map((i) => [i, {
|
|
1198
|
+
rank: e(i) || lt,
|
|
1199
|
+
away: r(i.awayTeamId),
|
|
1200
|
+
home: r(i.homeTeamId)
|
|
1201
|
+
}]));
|
|
1202
|
+
return [...n.keys()].sort((i, c) => {
|
|
1203
|
+
const p = n.get(i), d = n.get(c);
|
|
1204
|
+
return p.rank - d.rank || o(p.away, d.away) || o(p.home, d.home) || String(i.time || "").localeCompare(String(c.time || ""));
|
|
1205
|
+
});
|
|
1206
|
+
}
|
|
1207
|
+
function $s(a, e) {
|
|
1208
|
+
const t = new Map((a || []).map((r) => [r, e(r) || lt])), s = (r) => r.state === "live" ? 0 : 1;
|
|
1209
|
+
return [...t.keys()].sort((r, o) => s(r) - s(o) || t.get(r) - t.get(o));
|
|
1210
|
+
}
|
|
1211
|
+
function bs(a, e) {
|
|
1212
|
+
if (a.gameType === "conference" && a.conferenceId) {
|
|
1213
|
+
const t = e[a.conferenceId] || null;
|
|
1214
|
+
return { name: t?.name || "Conference", conference: t };
|
|
1215
|
+
}
|
|
1216
|
+
return a.gameType === "playoff" ? { name: "Playoffs", conference: null } : a.gameType === "scrimmage" ? { name: "Scrimmages", conference: null } : { name: "Nonconference", conference: null };
|
|
1217
|
+
}
|
|
1218
|
+
function ys(a, e) {
|
|
1219
|
+
const t = /* @__PURE__ */ new Map();
|
|
1220
|
+
return (a || []).forEach((s) => {
|
|
1221
|
+
const { name: r, conference: o } = bs(s, e);
|
|
1222
|
+
t.has(r) || t.set(r, { name: r, conference: o, games: [] }), t.get(r).games.push(s);
|
|
1223
|
+
}), [...t.values()];
|
|
1224
|
+
}
|
|
1225
|
+
const ws = y`
|
|
1226
|
+
.toolbar.filters { gap: 0.5rem 1.1rem; }
|
|
1227
|
+
.filters [role="group"] { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
|
|
1228
|
+
.filters .asof { margin-right: 0.1rem; }
|
|
1229
|
+
/* A phone can't fit the label and six chips on one line; the label takes
|
|
1230
|
+
its own row so the chips stay together instead of stranding the last. */
|
|
1231
|
+
@media (max-width: 480px) { .filters .asof { flex-basis: 100%; } }
|
|
1232
|
+
/* Conference headings carry the standings cards' classification pills. */
|
|
1233
|
+
.section-title .pill { margin-left: 0.3rem; vertical-align: 0.1em; }
|
|
1234
|
+
`;
|
|
1235
|
+
class ht extends w {
|
|
1236
|
+
static styles = [...U, ws];
|
|
1187
1237
|
static properties = {
|
|
1188
|
-
...
|
|
1238
|
+
...w.properties,
|
|
1189
1239
|
sport: { type: String },
|
|
1190
1240
|
season: { type: String },
|
|
1191
|
-
date: { type: String }
|
|
1241
|
+
date: { type: String },
|
|
1242
|
+
view: { type: String },
|
|
1243
|
+
areaCode: { type: String, attribute: "area-code" }
|
|
1192
1244
|
};
|
|
1193
1245
|
constructor() {
|
|
1194
|
-
super(), this.sport = "football", this.season = "", this.date = "", this._datePinned = !1;
|
|
1246
|
+
super(), this.sport = "football", this.season = "", this.date = "", this.view = "", this.areaCode = "", this._datePinned = !1;
|
|
1195
1247
|
}
|
|
1196
1248
|
connectedCallback() {
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
}
|
|
1201
|
-
this._datePinned = !!this.date;
|
|
1249
|
+
super.connectedCallback();
|
|
1250
|
+
const e = new URLSearchParams(globalThis.location?.search || "");
|
|
1251
|
+
!this.date && e.get("date") && (this.date = e.get("date")), !this.view && e.get("view") && (this.view = e.get("view")), !this.areaCode && e.get("area") && (this.areaCode = e.get("area")), this._datePinned = !!this.date;
|
|
1202
1252
|
}
|
|
1203
1253
|
async fetchData(e) {
|
|
1204
|
-
const t = this.season || K(), [s,
|
|
1254
|
+
const t = this.season || K(), [s, r, o, n, i] = await Promise.all([
|
|
1205
1255
|
e.listSchools(),
|
|
1206
1256
|
e.listTeams({ sport: this.sport }),
|
|
1207
1257
|
e.listConferences(),
|
|
1208
1258
|
e.listGames({ sport: this.sport, season: t }),
|
|
1209
1259
|
e.listRankings({ sport: this.sport })
|
|
1210
1260
|
]);
|
|
1211
|
-
return this._datePinned || (this.date =
|
|
1261
|
+
return this._datePinned || (this.date = Kt(n.items.map((c) => c.date)), this._datePinned = !0), {
|
|
1212
1262
|
season: t,
|
|
1213
1263
|
schools: s.items,
|
|
1214
|
-
teams:
|
|
1264
|
+
teams: r.items,
|
|
1215
1265
|
conferences: o.items,
|
|
1216
1266
|
games: n.items,
|
|
1217
1267
|
rankings: i.items
|
|
@@ -1227,31 +1277,39 @@ class ot extends y {
|
|
|
1227
1277
|
sport: this.sport
|
|
1228
1278
|
}, this._ctxData = this.data), this._ctx;
|
|
1229
1279
|
}
|
|
1280
|
+
/** Pick a view or an area (null leaves it alone) and deep-link the result. */
|
|
1281
|
+
pick({ view: e = null, area: t = null }) {
|
|
1282
|
+
e !== null && (this.view = e), t !== null && (this.areaCode = t);
|
|
1283
|
+
try {
|
|
1284
|
+
const s = new URL(globalThis.location.href), r = (o, n, i) => n && n !== i ? s.searchParams.set(o, n) : s.searchParams.delete(o);
|
|
1285
|
+
r("view", He(this.view), it), r("area", this.areaCode, ""), globalThis.history?.replaceState(null, "", s);
|
|
1286
|
+
} catch {
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1230
1289
|
renderView() {
|
|
1231
|
-
const e = this.ctx, t = b(this.data.conferences), s = [...new Set(this.data.games.map((
|
|
1232
|
-
const
|
|
1233
|
-
return
|
|
1234
|
-
},
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
}), l`
|
|
1290
|
+
const e = this.ctx, t = b(this.data.conferences), s = [...new Set(this.data.games.map((h) => h.date).filter(Boolean))].sort(), r = He(this.view), o = fs(this.data.teams, e.schoolsById), n = o.includes(this.areaCode) ? this.areaCode : "", i = (h) => {
|
|
1291
|
+
const u = [h.awayTeamId, h.homeTeamId].map((f) => xe(e.rankings, e.teamsById, f, this.sport, h.date)).filter(Boolean);
|
|
1292
|
+
return u.length ? Math.min(...u) : null;
|
|
1293
|
+
}, c = this.data.games.filter((h) => h.date === this.date), p = c.filter((h) => gs(h, n, e.teamsById, e.schoolsById)), d = r === "conferences" ? ys($s(p, i), t) : p.length ? [{
|
|
1294
|
+
name: n ? `All games · ${n}` : "All games",
|
|
1295
|
+
conference: null,
|
|
1296
|
+
games: vs(p, i, e.teamsById, e.schoolsById)
|
|
1297
|
+
}] : [];
|
|
1298
|
+
return l`
|
|
1241
1299
|
${le(this, e, {
|
|
1242
1300
|
title: l`${k(this.sport)} scores & schedules`,
|
|
1243
|
-
sub: l`${x(this.date, { weekday: "long", month: "long", day: "numeric", year: "numeric" })} · ${
|
|
1301
|
+
sub: l`${x(this.date, { weekday: "long", month: "long", day: "numeric", year: "numeric" })} · ${c.length} games`,
|
|
1244
1302
|
teams: this.data.teams
|
|
1245
1303
|
})}
|
|
1246
1304
|
${B(this, l`
|
|
1247
1305
|
${D(this)}
|
|
1248
1306
|
<div class="toolbar">
|
|
1249
1307
|
<label class="asof" for="datesel">Date</label>
|
|
1250
|
-
<select id="datesel" @change=${(
|
|
1251
|
-
this.date =
|
|
1308
|
+
<select id="datesel" @change=${(h) => {
|
|
1309
|
+
this.date = h.target.value;
|
|
1252
1310
|
}}>
|
|
1253
|
-
${(s.includes(this.date) ? s : [...s, this.date].sort()).map((
|
|
1254
|
-
${x(
|
|
1311
|
+
${(s.includes(this.date) ? s : [...s, this.date].sort()).map((h) => l`<option value=${h} ?selected=${h === this.date}>
|
|
1312
|
+
${x(h, { weekday: "short", month: "short", day: "numeric" })}${h === be() ? " · today" : ""}
|
|
1255
1313
|
</option>`)}
|
|
1256
1314
|
</select>
|
|
1257
1315
|
<button class="chip" ?disabled=${s.indexOf(this.date) <= 0}
|
|
@@ -1263,13 +1321,30 @@ class ot extends y {
|
|
|
1263
1321
|
this.date = s[s.indexOf(this.date) + 1];
|
|
1264
1322
|
}}>Next →</button>
|
|
1265
1323
|
<span class="spacer"></span>
|
|
1266
|
-
<span class="asof"
|
|
1324
|
+
<span class="asof">${r === "conferences" ? "Live games first" : "Ranked matchups first, then A–Z by road team"}
|
|
1325
|
+
· <a href=${Je(e.hrefs)}>report a score</a> to see it update here</span>
|
|
1267
1326
|
</div>
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1327
|
+
<div class="toolbar filters">
|
|
1328
|
+
<div role="group" aria-label="Scoreboard view">
|
|
1329
|
+
${[["all", "All games"], ["conferences", "Conferences view"]].map(([h, u]) => l`<button
|
|
1330
|
+
class="chip ${r === h ? "on" : ""}" aria-pressed=${r === h ? "true" : "false"}
|
|
1331
|
+
@click=${() => this.pick({ view: h })}>${u}</button>`)}
|
|
1332
|
+
</div>
|
|
1333
|
+
${o.length ? l`
|
|
1334
|
+
<div role="group" aria-label="Filter by area code">
|
|
1335
|
+
<span class="asof">Area code</span>
|
|
1336
|
+
${o.map((h) => l`<button class="chip ${n === h ? "on" : ""}"
|
|
1337
|
+
aria-pressed=${n === h ? "true" : "false"}
|
|
1338
|
+
@click=${() => this.pick({ area: n === h ? "" : h })}>${h}</button>`)}
|
|
1339
|
+
</div>` : m}
|
|
1340
|
+
</div>
|
|
1341
|
+
${c.length ? m : l`<p class="empty">No ${this.sport} games on this date.</p>`}
|
|
1342
|
+
${c.length && !p.length ? l`<p class="empty">No ${this.sport} games in the ${n} area code on this date.
|
|
1343
|
+
<button class="chip" @click=${() => this.pick({ area: "" })}>Every area</button></p>` : m}
|
|
1344
|
+
${d.map(({ name: h, conference: u, games: f }) => l`
|
|
1345
|
+
<div class="section-title">${h}${[...u?.classifications || []].sort(de).map((g) => l`<span class="pill class">${g}</span>`)}</div>
|
|
1271
1346
|
<div class="card"><ul class="gamelist">
|
|
1272
|
-
${
|
|
1347
|
+
${f.map((g) => this.renderGame(e, g))}
|
|
1273
1348
|
</ul></div>
|
|
1274
1349
|
`)}
|
|
1275
1350
|
`)}
|
|
@@ -1279,24 +1354,24 @@ class ot extends y {
|
|
|
1279
1354
|
// a lone score column on the far right read as detached from the teams).
|
|
1280
1355
|
// Scheduled games carry their start time on the status pill alone.
|
|
1281
1356
|
renderGame(e, t) {
|
|
1282
|
-
const s = t.state === "final" || t.state === "live",
|
|
1357
|
+
const s = t.state === "final" || t.state === "live", r = (n, i, c = m) => l`<span class="side">${ae(e, n, t.date)}${s ? l`<span class="score">${i}</span>` : m}${c}</span>`, o = hs(t);
|
|
1283
1358
|
return l`
|
|
1284
1359
|
<li>
|
|
1285
1360
|
${V(t)}
|
|
1286
|
-
<span class="opp matchup">${
|
|
1287
|
-
${o ? l`<span class="ff">${
|
|
1361
|
+
<span class="opp matchup">${r(t.awayTeamId, t.awayScore, l`<span class="at">at</span>`)}${r(t.homeTeamId, t.homeScore)}</span>
|
|
1362
|
+
${o ? l`<span class="ff">${z(e, o === "home" ? t.homeTeamId : t.awayTeamId)} forfeited</span>` : m}
|
|
1288
1363
|
<span class="where">${t.venue || ""}</span>
|
|
1289
1364
|
${t.broadcast ? l`<span class="pill class">${t.broadcast}</span>` : m}
|
|
1290
|
-
<a class="box" href=${
|
|
1365
|
+
<a class="box" href=${v(e.hrefs.game, { sport: this.sport, id: t.id })}>Box score →</a>
|
|
1291
1366
|
</li>
|
|
1292
1367
|
`;
|
|
1293
1368
|
}
|
|
1294
1369
|
}
|
|
1295
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores",
|
|
1296
|
-
class
|
|
1370
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores", ht);
|
|
1371
|
+
class dt extends w {
|
|
1297
1372
|
static styles = U;
|
|
1298
1373
|
static properties = {
|
|
1299
|
-
...
|
|
1374
|
+
...w.properties,
|
|
1300
1375
|
sport: { type: String },
|
|
1301
1376
|
gender: { type: String },
|
|
1302
1377
|
season: { type: String },
|
|
@@ -1314,11 +1389,11 @@ class nt extends y {
|
|
|
1314
1389
|
*/
|
|
1315
1390
|
get viewGender() {
|
|
1316
1391
|
if (this.gender) return this.gender;
|
|
1317
|
-
const e =
|
|
1392
|
+
const e = pe(this.data?.teams);
|
|
1318
1393
|
return e.length < 2 ? "" : e.includes(this.pickedGender) ? this.pickedGender : e[0];
|
|
1319
1394
|
}
|
|
1320
1395
|
async fetchData(e) {
|
|
1321
|
-
const t = this.season || K(), [s,
|
|
1396
|
+
const t = this.season || K(), [s, r, o, n, i] = await Promise.all([
|
|
1322
1397
|
e.listConferences({ active: !0 }),
|
|
1323
1398
|
e.listSchools(),
|
|
1324
1399
|
// Deliberately NOT gender-filtered: the sub-nav decides whether to
|
|
@@ -1334,7 +1409,7 @@ class nt extends y {
|
|
|
1334
1409
|
return {
|
|
1335
1410
|
season: t,
|
|
1336
1411
|
conferences: s.items,
|
|
1337
|
-
schools:
|
|
1412
|
+
schools: r.items,
|
|
1338
1413
|
teams: o.items,
|
|
1339
1414
|
games: n.items,
|
|
1340
1415
|
rankings: i.items
|
|
@@ -1350,11 +1425,11 @@ class nt extends y {
|
|
|
1350
1425
|
sport: this.sport,
|
|
1351
1426
|
// The teams this view stands for — one side of a gendered
|
|
1352
1427
|
// sport, or all of them when the sport fields only one.
|
|
1353
|
-
teams:
|
|
1428
|
+
teams: st(this.data.teams, this.viewGender)
|
|
1354
1429
|
}, this._ctxData = this.data, this._ctxGender = this.viewGender), this._ctx;
|
|
1355
1430
|
}
|
|
1356
1431
|
renderView() {
|
|
1357
|
-
const e = this.ctx, t = this.viewGender, s = this.gender ? [] :
|
|
1432
|
+
const e = this.ctx, t = this.viewGender, s = this.gender ? [] : pe(this.data.teams), r = ["All", ...[...new Set(this.data.conferences.flatMap((n) => n.classifications || []))].sort(de)].slice(0, 9), o = this.data.conferences.filter((n) => n.active !== !1).filter((n) => this.classFilter === "All" || (n.classifications || []).includes(this.classFilter)).sort(Xe);
|
|
1358
1433
|
return l`
|
|
1359
1434
|
${le(this, e, {
|
|
1360
1435
|
title: l`${t ? `${k(t)} ` : ""}${k(this.sport)} standings`,
|
|
@@ -1376,7 +1451,7 @@ class nt extends y {
|
|
|
1376
1451
|
}}>${k(n)}</button>`)}
|
|
1377
1452
|
</div>` : m}
|
|
1378
1453
|
<div role="group" aria-label="Classification filter">
|
|
1379
|
-
${
|
|
1454
|
+
${r.map((n) => l`<button class="chip ${this.classFilter === n ? "on" : ""}"
|
|
1380
1455
|
@click=${() => {
|
|
1381
1456
|
this.classFilter = n;
|
|
1382
1457
|
}}>${n}</button>`)}
|
|
@@ -1386,7 +1461,7 @@ class nt extends y {
|
|
|
1386
1461
|
this.query = n.target.value;
|
|
1387
1462
|
}}>
|
|
1388
1463
|
<span class="spacer"></span>
|
|
1389
|
-
<span class="asof">Records through ${x(
|
|
1464
|
+
<span class="asof">Records through ${x(be(), { month: "long", day: "numeric" })} · conference games count toward both records · scrimmages toward neither</span>
|
|
1390
1465
|
</div>
|
|
1391
1466
|
${o.map((n) => this.renderConference(e, n))}
|
|
1392
1467
|
`)}
|
|
@@ -1395,12 +1470,12 @@ class nt extends y {
|
|
|
1395
1470
|
renderConference(e, t) {
|
|
1396
1471
|
const s = e.teams.filter((n) => n.conferenceId === t.id);
|
|
1397
1472
|
if (!s.length) return m;
|
|
1398
|
-
const
|
|
1473
|
+
const r = this.query.trim().toLowerCase(), o = rt(s, e.records);
|
|
1399
1474
|
return l`
|
|
1400
1475
|
<div class="card">
|
|
1401
1476
|
<div class="card-head">
|
|
1402
1477
|
<h2>${t.name}</h2>
|
|
1403
|
-
${[...t.classifications || []].sort(
|
|
1478
|
+
${[...t.classifications || []].sort(de).map((n) => l`<span class="pill class">${n}</span>`)}
|
|
1404
1479
|
<span class="meta">${o.length} teams · membership derives from teams</span>
|
|
1405
1480
|
</div>
|
|
1406
1481
|
<div class="tablewrap"><table class="data">
|
|
@@ -1410,26 +1485,26 @@ class nt extends y {
|
|
|
1410
1485
|
<th>Streak</th><th>Last 5</th><th>Next</th>
|
|
1411
1486
|
</tr></thead>
|
|
1412
1487
|
<tbody>
|
|
1413
|
-
${o.map((n, i) => this.renderRow(e, n, i,
|
|
1488
|
+
${o.map((n, i) => this.renderRow(e, n, i, r))}
|
|
1414
1489
|
</tbody>
|
|
1415
1490
|
</table></div>
|
|
1416
1491
|
</div>
|
|
1417
1492
|
`;
|
|
1418
1493
|
}
|
|
1419
|
-
renderRow(e, t, s,
|
|
1494
|
+
renderRow(e, t, s, r) {
|
|
1420
1495
|
const o = e.schoolsById[t.team.schoolId], n = o?.name || t.team.name || "TBD";
|
|
1421
|
-
if (
|
|
1422
|
-
const i = t.rec.pf - t.rec.pa, c =
|
|
1423
|
-
location.href =
|
|
1496
|
+
if (r && !n.toLowerCase().includes(r)) return m;
|
|
1497
|
+
const i = t.rec.pf - t.rec.pa, c = we(this.data.games, t.team.id), p = () => {
|
|
1498
|
+
location.href = v(e.hrefs.school, { id: t.team.schoolId });
|
|
1424
1499
|
};
|
|
1425
1500
|
return l`
|
|
1426
|
-
<tr class="rowlink" @click=${(
|
|
1427
|
-
|
|
1501
|
+
<tr class="rowlink" @click=${(d) => {
|
|
1502
|
+
d.target.closest("a") || p();
|
|
1428
1503
|
}}>
|
|
1429
1504
|
<td class="mut">${s + 1}</td>
|
|
1430
1505
|
<td class="teamcell">
|
|
1431
|
-
${P(o)}${
|
|
1432
|
-
<a href=${
|
|
1506
|
+
${P(o)}${ke(e, t.team.id, null)}
|
|
1507
|
+
<a href=${v(e.hrefs.school, { id: t.team.schoolId })}>${n}</a>
|
|
1433
1508
|
</td>
|
|
1434
1509
|
<td class="num">${S(t.rec, !0)}</td>
|
|
1435
1510
|
<td class="num">${Oe(t.confPct)}</td>
|
|
@@ -1439,14 +1514,14 @@ class nt extends y {
|
|
|
1439
1514
|
<td class="num">${t.rec.pa}</td>
|
|
1440
1515
|
<td class="num" style="color:${i >= 0 ? "var(--hsot-win)" : "var(--hsot-loss)"}">${i > 0 ? "+" : ""}${i}</td>
|
|
1441
1516
|
<td>${ie(t.rec.results) || "·"}</td>
|
|
1442
|
-
<td>${
|
|
1443
|
-
<td>${
|
|
1517
|
+
<td>${Se(e, t.team.id)}</td>
|
|
1518
|
+
<td>${nt(e, c, t.team.id)}</td>
|
|
1444
1519
|
</tr>
|
|
1445
1520
|
`;
|
|
1446
1521
|
}
|
|
1447
1522
|
}
|
|
1448
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings",
|
|
1449
|
-
const
|
|
1523
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings", dt);
|
|
1524
|
+
const xs = y`
|
|
1450
1525
|
.hero1 {
|
|
1451
1526
|
border-radius: var(--hsot-radius-md); color: var(--hsot-white);
|
|
1452
1527
|
padding: 1.3rem 1.4rem; display: flex; align-items: center; gap: 1.2rem;
|
|
@@ -1463,10 +1538,10 @@ const ds = w`
|
|
|
1463
1538
|
.delta.new { background: var(--hsot-straw); color: #6b5900; border-radius: var(--hsot-radius-xs); padding: 0.1rem 0.3rem; font-size: 0.7rem; }
|
|
1464
1539
|
.sparkline { vertical-align: middle; }
|
|
1465
1540
|
`;
|
|
1466
|
-
class
|
|
1467
|
-
static styles = [...U,
|
|
1541
|
+
class pt extends w {
|
|
1542
|
+
static styles = [...U, xs];
|
|
1468
1543
|
static properties = {
|
|
1469
|
-
...
|
|
1544
|
+
...w.properties,
|
|
1470
1545
|
sport: { type: String },
|
|
1471
1546
|
gender: { type: String },
|
|
1472
1547
|
season: { type: String },
|
|
@@ -1481,17 +1556,17 @@ class it extends y {
|
|
|
1481
1556
|
e && (this.pollDate = e);
|
|
1482
1557
|
}
|
|
1483
1558
|
async fetchData(e) {
|
|
1484
|
-
const t = this.season || K(), [s,
|
|
1559
|
+
const t = this.season || K(), [s, r, o, n, i] = await Promise.all([
|
|
1485
1560
|
e.listRankings({ sport: this.sport, ...this.gender ? { gender: this.gender } : {} }),
|
|
1486
1561
|
e.listSchools(),
|
|
1487
1562
|
e.listTeams({ sport: this.sport }),
|
|
1488
1563
|
e.listConferences(),
|
|
1489
1564
|
e.listGames({ sport: this.sport, season: t })
|
|
1490
|
-
]), c = s.items.filter((
|
|
1565
|
+
]), c = s.items.filter((p) => !this.gender || !p.gender || p.gender === this.gender).sort((p, d) => d.effectiveDate.localeCompare(p.effectiveDate));
|
|
1491
1566
|
return {
|
|
1492
1567
|
season: t,
|
|
1493
1568
|
polls: c,
|
|
1494
|
-
schools:
|
|
1569
|
+
schools: r.items,
|
|
1495
1570
|
teams: o.items,
|
|
1496
1571
|
conferences: n.items,
|
|
1497
1572
|
games: i.items
|
|
@@ -1508,31 +1583,31 @@ class it extends y {
|
|
|
1508
1583
|
}, this._ctxData = this.data), this._ctx;
|
|
1509
1584
|
}
|
|
1510
1585
|
sparkline(e, t, s) {
|
|
1511
|
-
const i = t.map((
|
|
1512
|
-
const f = (
|
|
1586
|
+
const i = t.map((h, u) => {
|
|
1587
|
+
const f = (h.teamIds || []).indexOf(e);
|
|
1513
1588
|
if (f === -1) return null;
|
|
1514
|
-
const
|
|
1515
|
-
return { x:
|
|
1589
|
+
const g = t.length === 1 ? 96 / 2 : u / (t.length - 1) * 90 + 3, $ = 3 + f / 24 * 20;
|
|
1590
|
+
return { x: g, y: $ };
|
|
1516
1591
|
}), c = [];
|
|
1517
|
-
let
|
|
1518
|
-
if (i.forEach((
|
|
1519
|
-
|
|
1520
|
-
}),
|
|
1521
|
-
const
|
|
1592
|
+
let p = [];
|
|
1593
|
+
if (i.forEach((h) => {
|
|
1594
|
+
h ? p.push(h) : p.length && (c.push(p), p = []);
|
|
1595
|
+
}), p.length && c.push(p), !c.length) return m;
|
|
1596
|
+
const d = i[s];
|
|
1522
1597
|
return l`<svg class="sparkline" width=${96} height=${26} viewBox="0 0 ${96} ${26}" role="img" aria-label="rank history">
|
|
1523
|
-
${c.map((
|
|
1524
|
-
points=${
|
|
1525
|
-
${
|
|
1598
|
+
${c.map((h) => Ne`<polyline fill="none" stroke="var(--hsot-red)" stroke-width="2"
|
|
1599
|
+
points=${h.map((u) => `${u.x.toFixed(1)},${u.y.toFixed(1)}`).join(" ")}></polyline>`)}
|
|
1600
|
+
${d ? Ne`<circle cx=${d.x.toFixed(1)} cy=${d.y.toFixed(1)} r="3" fill="var(--hsot-black)"></circle>` : m}
|
|
1526
1601
|
</svg>`;
|
|
1527
1602
|
}
|
|
1528
1603
|
movement(e, t, s) {
|
|
1529
|
-
const
|
|
1530
|
-
return
|
|
1604
|
+
const r = ds(e, t, s);
|
|
1605
|
+
return r.kind === "up" ? l`<span class="delta up">▲ ${r.delta}</span>` : r.kind === "down" ? l`<span class="delta down">▼ ${r.delta}</span>` : r.kind === "new" ? l`<span class="delta new">NEW</span>` : r.kind === "same" ? l`<span class="delta same">—</span>` : l`<span class="delta same">·</span>`;
|
|
1531
1606
|
}
|
|
1532
1607
|
renderView() {
|
|
1533
1608
|
const e = this.ctx, t = this.data.polls;
|
|
1534
1609
|
if (!t.length) return l`<div class="view"><p class="empty">No ${this.sport} polls published yet this season.</p></div>`;
|
|
1535
|
-
const s = Math.max(0, t.findIndex((
|
|
1610
|
+
const s = Math.max(0, t.findIndex((h) => h.effectiveDate === this.pollDate)), r = t[s] || t[0], o = t[s + 1] || null, n = t.slice().reverse(), i = n.indexOf(r), c = b(this.data.conferences), p = (r.teamIds || [])[0], d = p ? E(e, p) : null;
|
|
1536
1611
|
return l`
|
|
1537
1612
|
${le(this, e, {
|
|
1538
1613
|
title: l`${k(this.sport)} Top 25`,
|
|
@@ -1543,11 +1618,11 @@ class it extends y {
|
|
|
1543
1618
|
${D(this)}
|
|
1544
1619
|
<div class="toolbar">
|
|
1545
1620
|
<label class="asof" for="pollsel">Poll of</label>
|
|
1546
|
-
<select id="pollsel" @change=${(
|
|
1547
|
-
this.pollDate =
|
|
1621
|
+
<select id="pollsel" @change=${(h) => {
|
|
1622
|
+
this.pollDate = h.target.value;
|
|
1548
1623
|
}}>
|
|
1549
|
-
${t.map((
|
|
1550
|
-
${x(
|
|
1624
|
+
${t.map((h, u) => l`<option value=${h.effectiveDate} ?selected=${h === r}>
|
|
1625
|
+
${x(h.effectiveDate, { month: "long", day: "numeric", year: "numeric" })}${u === 0 ? " · current" : ""}
|
|
1551
1626
|
</option>`)}
|
|
1552
1627
|
</select>
|
|
1553
1628
|
<button class="chip" ?disabled=${s >= t.length - 1}
|
|
@@ -1561,65 +1636,65 @@ class it extends y {
|
|
|
1561
1636
|
<span class="spacer"></span>
|
|
1562
1637
|
<span class="asof">Movement vs. the previous poll · sparkline = season rank history</span>
|
|
1563
1638
|
</div>
|
|
1564
|
-
${
|
|
1639
|
+
${d ? this.renderHero(e, r, o, p, d, c) : m}
|
|
1565
1640
|
<div class="card"><div class="tablewrap"><table class="data">
|
|
1566
1641
|
<thead><tr>
|
|
1567
1642
|
<th class="num">Rk</th><th>Mvmt</th><th>Team</th><th class="num">Record</th>
|
|
1568
1643
|
<th>Conference</th><th>Last result</th><th>Next</th><th>Season</th>
|
|
1569
1644
|
</tr></thead>
|
|
1570
1645
|
<tbody>
|
|
1571
|
-
${(
|
|
1646
|
+
${(r.teamIds || []).map((h, u) => u === 0 || !h ? m : this.renderRow(e, r, o, n, i, c, h, u + 1))}
|
|
1572
1647
|
</tbody>
|
|
1573
1648
|
</table></div></div>
|
|
1574
1649
|
<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>
|
|
1575
1650
|
`)}
|
|
1576
1651
|
`;
|
|
1577
1652
|
}
|
|
1578
|
-
renderHero(e, t, s,
|
|
1579
|
-
const i = e.records[
|
|
1653
|
+
renderHero(e, t, s, r, o, n) {
|
|
1654
|
+
const i = e.records[r], c = Ue(e.records, r), p = n[e.teamsById[r]?.conferenceId], d = `linear-gradient(120deg, ${o.colorPrimary || "#030711"} 0%, var(--hsot-black) 85%)`;
|
|
1580
1655
|
return l`
|
|
1581
|
-
<div class="hero1" style="background:${
|
|
1656
|
+
<div class="hero1" style="background:${d}">
|
|
1582
1657
|
<div class="bigrank">#1</div>
|
|
1583
1658
|
${P(o, 64)}
|
|
1584
1659
|
<div>
|
|
1585
|
-
<h2><a href=${
|
|
1660
|
+
<h2><a href=${v(e.hrefs.school, { id: o.id })}>${o.name} ${o.mascot || ""}</a></h2>
|
|
1586
1661
|
<div class="facts">
|
|
1587
|
-
${S(i)} overall${
|
|
1662
|
+
${S(i)} overall${p ? l` · ${S(i, !0)} ${p.name}` : m}
|
|
1588
1663
|
· streak ${ie(i?.results) || "·"}
|
|
1589
1664
|
${c ? l` · last: ${c.mark} ${c.my}-${c.their} vs ${se(e, c.opp)}` : m}
|
|
1590
|
-
${this.movement(t, s,
|
|
1665
|
+
${this.movement(t, s, r)}
|
|
1591
1666
|
</div>
|
|
1592
1667
|
</div>
|
|
1593
1668
|
</div>
|
|
1594
1669
|
`;
|
|
1595
1670
|
}
|
|
1596
|
-
renderRow(e, t, s,
|
|
1597
|
-
const
|
|
1598
|
-
if (!
|
|
1599
|
-
const
|
|
1600
|
-
location.href =
|
|
1671
|
+
renderRow(e, t, s, r, o, n, i, c) {
|
|
1672
|
+
const p = E(e, i);
|
|
1673
|
+
if (!p) return m;
|
|
1674
|
+
const d = e.records[i], h = Ue(e.records, i), u = we(this.data.games, i), f = n[e.teamsById[i]?.conferenceId], g = () => {
|
|
1675
|
+
location.href = v(e.hrefs.school, { id: p.id });
|
|
1601
1676
|
};
|
|
1602
1677
|
return l`
|
|
1603
1678
|
<tr class="rowlink" @click=${($) => {
|
|
1604
|
-
$.target.closest("a") ||
|
|
1679
|
+
$.target.closest("a") || g();
|
|
1605
1680
|
}}>
|
|
1606
1681
|
<td class="num" style="font-weight:700">${c}</td>
|
|
1607
1682
|
<td>${this.movement(t, s, i)}</td>
|
|
1608
|
-
<td class="teamcell">${P(
|
|
1609
|
-
<span class="mut" style="font-size:0.78rem">${
|
|
1610
|
-
<td class="num">${S(
|
|
1683
|
+
<td class="teamcell">${P(p)}<a href=${v(e.hrefs.school, { id: p.id })}>${p.name}</a>
|
|
1684
|
+
<span class="mut" style="font-size:0.78rem">${p.mascot || ""}</span></td>
|
|
1685
|
+
<td class="num">${S(d)}</td>
|
|
1611
1686
|
<td class="mut">${f?.name || "Independent"}</td>
|
|
1612
|
-
<td>${
|
|
1613
|
-
<b style="color:${
|
|
1614
|
-
${
|
|
1615
|
-
<td>${
|
|
1616
|
-
<td>${this.sparkline(i,
|
|
1687
|
+
<td>${h ? l`<a class="box" style="text-decoration:none" href=${v(e.hrefs.game, { sport: this.sport, id: h.gameId })}>
|
|
1688
|
+
<b style="color:${h.mark === "W" ? "var(--hsot-win)" : h.mark === "L" ? "var(--hsot-loss)" : "var(--hsot-tie)"}">${h.mark}</b>
|
|
1689
|
+
${h.my}-${h.their} vs ${se(e, h.opp)}</a>` : l`<span class="mut">·</span>`}</td>
|
|
1690
|
+
<td>${nt(e, u, i)}</td>
|
|
1691
|
+
<td>${this.sparkline(i, r, o)}</td>
|
|
1617
1692
|
</tr>
|
|
1618
1693
|
`;
|
|
1619
1694
|
}
|
|
1620
1695
|
}
|
|
1621
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings",
|
|
1622
|
-
const
|
|
1696
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings", pt);
|
|
1697
|
+
const ks = y`
|
|
1623
1698
|
.schoolhero { color: var(--hsot-white); padding: 1.6rem 1.25rem 1.3rem; }
|
|
1624
1699
|
.schoolhero .inner { max-width: 1366px; margin: 0 auto; display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
|
|
1625
1700
|
.schoolhero .crest {
|
|
@@ -1673,10 +1748,10 @@ const hs = w`
|
|
|
1673
1748
|
table.data.roster .sub { display: block; font-weight: 400; font-size: 0.78rem; color: var(--hsot-gray-5); }
|
|
1674
1749
|
}
|
|
1675
1750
|
`;
|
|
1676
|
-
class
|
|
1677
|
-
static styles = [...U,
|
|
1751
|
+
class mt extends w {
|
|
1752
|
+
static styles = [...U, ks];
|
|
1678
1753
|
static properties = {
|
|
1679
|
-
...
|
|
1754
|
+
...w.properties,
|
|
1680
1755
|
schoolId: { type: String, attribute: "school-id" },
|
|
1681
1756
|
sport: { type: String },
|
|
1682
1757
|
gender: { type: String },
|
|
@@ -1692,7 +1767,7 @@ class lt extends y {
|
|
|
1692
1767
|
t && !this.sport && (this.sport = t), s && !this.gender && (this.gender = s);
|
|
1693
1768
|
}
|
|
1694
1769
|
async fetchData(e) {
|
|
1695
|
-
const t = this.season || K(), s = await e.getSchool(this.schoolId), o = (await e.listTeams({ schoolId: this.schoolId })).items, n = this.sport || "football", i = o.find(($) => $.id === this.activeTeamId) || o.find(($) => $.sport === n &&
|
|
1770
|
+
const t = this.season || K(), s = await e.getSchool(this.schoolId), o = (await e.listTeams({ schoolId: this.schoolId })).items, n = this.sport || "football", i = o.find(($) => $.id === this.activeTeamId) || o.find(($) => $.sport === n && tt($, this.gender)) || o.find(($) => $.sport === n) || o[0] || null, [c, p, d, h, u, f, g] = await Promise.all([
|
|
1696
1771
|
i ? e.listGames({ sport: i.sport, season: t }) : Promise.resolve({ items: [] }),
|
|
1697
1772
|
i ? e.listTeams({ sport: i.sport }) : Promise.resolve({ items: [] }),
|
|
1698
1773
|
e.listSchools(),
|
|
@@ -1709,12 +1784,12 @@ class lt extends y {
|
|
|
1709
1784
|
teams: o,
|
|
1710
1785
|
active: i,
|
|
1711
1786
|
games: c.items,
|
|
1712
|
-
allTeams:
|
|
1713
|
-
schools:
|
|
1714
|
-
conferences:
|
|
1787
|
+
allTeams: p.items,
|
|
1788
|
+
schools: d.items,
|
|
1789
|
+
conferences: h.items,
|
|
1715
1790
|
rankings: u.items,
|
|
1716
1791
|
roster: f.items.find(($) => $.season === t) || null,
|
|
1717
|
-
players:
|
|
1792
|
+
players: g.items
|
|
1718
1793
|
};
|
|
1719
1794
|
}
|
|
1720
1795
|
get ctx() {
|
|
@@ -1736,19 +1811,19 @@ class lt extends y {
|
|
|
1736
1811
|
e && (this.activeTeamId = e.id, this.sport = e.sport, this.gender = e.gender || "", this.load());
|
|
1737
1812
|
}
|
|
1738
1813
|
renderView() {
|
|
1739
|
-
const { school: e, teams: t, active: s, season:
|
|
1814
|
+
const { school: e, teams: t, active: s, season: r } = this.data;
|
|
1740
1815
|
if (!e) return l`<div class="view"><p class="empty">School not found.</p></div>`;
|
|
1741
|
-
const o = this.ctx, n = ee(e.colorPrimary || "#030711"), i = (e.adm || [])[0], c = b(this.data.conferences),
|
|
1816
|
+
const o = this.ctx, n = ee(e.colorPrimary || "#030711"), i = (e.adm || [])[0], c = b(this.data.conferences), p = s ? c[s.conferenceId] : null;
|
|
1742
1817
|
return l`
|
|
1743
1818
|
<div class="schoolhero" style="background:linear-gradient(115deg, ${e.colorPrimary || "#030711"} 0%, ${e.colorPrimary || "#030711"} 55%, var(--hsot-black) 100%);color:${n}">
|
|
1744
1819
|
<div class="inner">
|
|
1745
|
-
${te(e, 84) ? l`<img class="crest logo" alt="" loading="lazy" src=${te(e, 84)} />` : l`<div class="crest" style="background:${e.colorSecondary || "#7C7C7C"};color:${ee(e.colorSecondary || "#7C7C7C")}">${
|
|
1820
|
+
${te(e, 84) ? l`<img class="crest logo" alt="" loading="lazy" src=${te(e, 84)} />` : l`<div class="crest" style="background:${e.colorSecondary || "#7C7C7C"};color:${ee(e.colorSecondary || "#7C7C7C")}">${ye(e)}</div>`}
|
|
1746
1821
|
<div style="min-width:260px">
|
|
1747
1822
|
<h1>${e.name} <span class="mascot">${e.mascot || ""}</span></h1>
|
|
1748
1823
|
<div class="facts">
|
|
1749
1824
|
${e.location ? l`<span><b>Location</b>${e.location}${e.county ? l` · ${e.county} County` : m}</span>` : m}
|
|
1750
1825
|
${e.association ? l`<span><b>League</b>${e.association}${e.classification ? l` · ${e.classification}` : m}</span>` : m}
|
|
1751
|
-
${
|
|
1826
|
+
${p ? l`<span><b>Conference</b>${p.name}</span>` : m}
|
|
1752
1827
|
${i ? l`<span><b>Enrollment</b>${i.value.toLocaleString()} (${i.season} ADM)</span>` : m}
|
|
1753
1828
|
${e.openingYear ? l`<span><b>Opened</b>${e.openingYear}</span>` : m}
|
|
1754
1829
|
${e.areaCode ? l`<span><b>Area</b>${e.areaCode}</span>` : m}
|
|
@@ -1758,68 +1833,68 @@ class lt extends y {
|
|
|
1758
1833
|
</div>
|
|
1759
1834
|
<div class="band">
|
|
1760
1835
|
<nav class="tabs" aria-label="Teams">
|
|
1761
|
-
${t.map((
|
|
1762
|
-
|
|
1763
|
-
}}>${
|
|
1836
|
+
${t.map((d) => d.id === s?.id ? l`<a class="on" href="#" aria-current="page" @click=${(h) => h.preventDefault()}>${d.name}</a>` : l`<a href="#" @click=${(h) => {
|
|
1837
|
+
h.preventDefault(), this.switchTeam(d);
|
|
1838
|
+
}}>${d.name}</a>`)}
|
|
1764
1839
|
</nav>
|
|
1765
1840
|
</div>
|
|
1766
1841
|
${B(this, l`
|
|
1767
1842
|
${D(this)}
|
|
1768
|
-
${s ? this.renderTeam(o, s,
|
|
1843
|
+
${s ? this.renderTeam(o, s, p, r) : l`<p class="empty">No teams recorded for this school yet.</p>`}
|
|
1769
1844
|
`)}
|
|
1770
1845
|
`;
|
|
1771
1846
|
}
|
|
1772
|
-
renderTeam(e, t, s,
|
|
1773
|
-
const o = e.records[t.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, n = o.w + o.l + o.t, i = s ?
|
|
1847
|
+
renderTeam(e, t, s, r) {
|
|
1848
|
+
const o = e.records[t.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, n = o.w + o.l + o.t, i = s ? st(this.data.allTeams.filter((h) => h.conferenceId === s.id), t.gender) : [], c = s ? rt(i, e.records).findIndex((h) => h.team.id === t.id) + 1 : 0, p = xe(e.rankings, e.teamsById, t.id, t.sport, null), d = this.data.games.filter((h) => h.homeTeamId === t.id || h.awayTeamId === t.id).sort((h, u) => String(h.date).localeCompare(String(u.date)));
|
|
1774
1849
|
return l`
|
|
1775
1850
|
<div class="tiles">
|
|
1776
1851
|
<div class="tile"><div class="k">Overall</div><div class="v">${S(o)}</div><div class="s">${n} games played</div></div>
|
|
1777
1852
|
<div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${S(o, !0)}</div>
|
|
1778
|
-
<div class="s">${c ? `${
|
|
1853
|
+
<div class="s">${c ? `${Qt(c)} of ${i.length}` : "·"}</div></div>
|
|
1779
1854
|
<div class="tile"><div class="k">Points</div><div class="v">${n ? (o.pf / n).toFixed(1) : "0.0"}</div>
|
|
1780
1855
|
<div class="s">scored per game · ${n ? (o.pa / n).toFixed(1) : "0.0"} allowed</div></div>
|
|
1781
1856
|
<div class="tile"><div class="k">Streak</div><div class="v">${ie(o.results) || "·"}</div>
|
|
1782
|
-
<div class="s">last 5: ${
|
|
1783
|
-
<div class="tile"><div class="k">HSOT Top 25</div><div class="v">${
|
|
1784
|
-
<div class="s"><a href=${
|
|
1857
|
+
<div class="s">last 5: ${Se(e, t.id)}</div></div>
|
|
1858
|
+
<div class="tile"><div class="k">HSOT Top 25</div><div class="v">${p ? `#${p}` : "NR"}</div>
|
|
1859
|
+
<div class="s"><a href=${v(e.hrefs.section, { sport: t.sport, view: "rankings" })}>full poll</a></div></div>
|
|
1785
1860
|
</div>
|
|
1786
1861
|
${(t.championships || []).length ? l`
|
|
1787
1862
|
<div style="margin:-0.2rem 0 1rem;display:flex;gap:0.4rem;flex-wrap:wrap">
|
|
1788
|
-
${t.championships.map((
|
|
1863
|
+
${t.championships.map((h) => l`<span class="pill champ">★ ${h.season} ${h.title} champion${h.classification ? ` · ${h.classification}` : ""}${h.region ? ` · ${h.region}` : ""}</span>`)}
|
|
1789
1864
|
</div>` : m}
|
|
1790
1865
|
<div class="cols">
|
|
1791
1866
|
<div>
|
|
1792
1867
|
<div class="section-title">Schedule & results</div>
|
|
1793
1868
|
<div class="card">
|
|
1794
|
-
${
|
|
1869
|
+
${d.length ? l`<ul class="gamelist">${d.map((h) => this.renderGameRow(e, t, h))}</ul>` : l`<p class="empty">No ${t.sport} games recorded for ${r}.</p>`}
|
|
1795
1870
|
</div>
|
|
1796
1871
|
</div>
|
|
1797
1872
|
<div>
|
|
1798
|
-
<div class="section-title">Roster · ${
|
|
1799
|
-
<div class="card">${this.renderRoster(t,
|
|
1873
|
+
<div class="section-title">Roster · ${r}</div>
|
|
1874
|
+
<div class="card">${this.renderRoster(t, r)}</div>
|
|
1800
1875
|
</div>
|
|
1801
1876
|
</div>
|
|
1802
1877
|
`;
|
|
1803
1878
|
}
|
|
1804
1879
|
renderGameRow(e, t, s) {
|
|
1805
|
-
const
|
|
1806
|
-
let c = l`<span class="mut">${
|
|
1880
|
+
const r = s.homeTeamId === t.id, o = r ? s.awayTeamId : s.homeTeamId, n = r ? s.homeScore : s.awayScore, i = r ? s.awayScore : s.homeScore;
|
|
1881
|
+
let c = l`<span class="mut">${$e(s.time)}</span>`;
|
|
1807
1882
|
if (s.state === "final") {
|
|
1808
|
-
const
|
|
1809
|
-
c = l`<span class=${
|
|
1883
|
+
const d = ne(s), h = d === "tie" ? "T" : d === (r ? "home" : "away") ? "W" : "L";
|
|
1884
|
+
c = l`<span class=${h}>${h}</span> ${n}-${i}${s.finish === "overtime" ? l` <span class="mut">OT</span>` : m}${s.forfeit && s.forfeit !== "none" ? l` <span class="mut">FF</span>` : m}`;
|
|
1810
1885
|
} else s.state === "live" && (c = l`<span style="color:var(--hsot-red)">${n}-${i}</span>`);
|
|
1811
|
-
const
|
|
1886
|
+
const p = s.gameType === "conference" ? "Conf" : s.gameType === "nonconference" ? "Non-conf" : s.gameType === "playoff" ? `Playoff${s.label ? ` · ${s.label}` : ""}` : "Scrimmage";
|
|
1812
1887
|
return l`
|
|
1813
1888
|
<li>
|
|
1814
1889
|
<span class="d">${x(s.date)}</span>
|
|
1815
|
-
${
|
|
1890
|
+
${et(s).kind === "sched" ? m : V(s)}
|
|
1816
1891
|
<span class="res">${c}</span>
|
|
1817
|
-
<span class="opp">${
|
|
1818
|
-
<span class="pill type">${
|
|
1892
|
+
<span class="opp">${r ? "vs" : "at"} ${ae(e, o, s.date)}
|
|
1893
|
+
<span class="pill type">${p}</span>
|
|
1819
1894
|
${s.broadcast ? l`<span class="pill class">${s.broadcast}</span>` : m}
|
|
1820
1895
|
</span>
|
|
1821
1896
|
<span class="where">${s.venue || ""}</span>
|
|
1822
|
-
<a class="box" href=${
|
|
1897
|
+
<a class="box" href=${v(e.hrefs.game, { sport: t.sport, id: s.id })}>Box score →</a>
|
|
1823
1898
|
</li>
|
|
1824
1899
|
`;
|
|
1825
1900
|
}
|
|
@@ -1827,25 +1902,25 @@ class lt extends y {
|
|
|
1827
1902
|
const s = this.data.roster;
|
|
1828
1903
|
if (!s)
|
|
1829
1904
|
return l`<p class="empty">Roster not published for ${t}.</p>`;
|
|
1830
|
-
const
|
|
1905
|
+
const r = ms(s, 560), o = this.data.school?.name || "", n = b(this.data.players), i = s.entries.slice().sort((p, d) => (p.number || 0) - (d.number || 0)), c = i.some((p) => n[p.playerId]?.college);
|
|
1831
1906
|
return l`
|
|
1832
|
-
${
|
|
1907
|
+
${r ? l`<img class="rosterphoto" src=${r} loading="lazy" decoding="async"
|
|
1833
1908
|
alt="${o} ${e.name} ${t} team photo" />` : m}
|
|
1834
1909
|
<div class="tablewrap"><table class="data roster">
|
|
1835
1910
|
<thead><tr><th class="num">No.</th><th>Player</th><th class="pos">Pos</th><th class="cls">Class</th><th class="num">Ht</th><th class="num">Wt</th>${c ? l`<th>College</th>` : m}</tr></thead>
|
|
1836
1911
|
<tbody>
|
|
1837
|
-
${i.map((
|
|
1838
|
-
const
|
|
1839
|
-
if (!
|
|
1840
|
-
const
|
|
1912
|
+
${i.map((p) => {
|
|
1913
|
+
const d = n[p.playerId];
|
|
1914
|
+
if (!d) return m;
|
|
1915
|
+
const h = Yt(p), u = [h, d.classOf].filter(Boolean).join(" · ") || "·";
|
|
1841
1916
|
return l`<tr>
|
|
1842
|
-
<td class="num mut">${
|
|
1843
|
-
<td class="player" style="font-weight:500">${
|
|
1844
|
-
<td class="pos">${
|
|
1845
|
-
<td class="cls mut">${
|
|
1846
|
-
<td class="num">${
|
|
1847
|
-
<td class="num">${
|
|
1848
|
-
${c ? l`<td class="college">${
|
|
1917
|
+
<td class="num mut">${p.number ?? "·"}</td>
|
|
1918
|
+
<td class="player" style="font-weight:500">${d.firstName} ${d.lastName}<span class="sub">${u}</span></td>
|
|
1919
|
+
<td class="pos">${h || "·"}</td>
|
|
1920
|
+
<td class="cls mut">${d.classOf || "·"}</td>
|
|
1921
|
+
<td class="num">${Vt(d.heightIn)}</td>
|
|
1922
|
+
<td class="num">${d.weightLb || "·"}</td>
|
|
1923
|
+
${c ? l`<td class="college">${d.college || "·"}</td>` : m}
|
|
1849
1924
|
</tr>`;
|
|
1850
1925
|
})}
|
|
1851
1926
|
</tbody>
|
|
@@ -1853,8 +1928,8 @@ class lt extends y {
|
|
|
1853
1928
|
`;
|
|
1854
1929
|
}
|
|
1855
1930
|
}
|
|
1856
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school",
|
|
1857
|
-
const
|
|
1931
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school", mt);
|
|
1932
|
+
const ut = {
|
|
1858
1933
|
football: ["quarters", 4],
|
|
1859
1934
|
flag_football: ["quarters", 4],
|
|
1860
1935
|
basketball: ["quarters", 4],
|
|
@@ -1865,78 +1940,78 @@ const ct = {
|
|
|
1865
1940
|
softball: ["innings", 7],
|
|
1866
1941
|
volleyball: ["sets", 3]
|
|
1867
1942
|
};
|
|
1868
|
-
function
|
|
1869
|
-
return (
|
|
1943
|
+
function ft(a) {
|
|
1944
|
+
return (ut[a] || ["quarters", 4])[0];
|
|
1870
1945
|
}
|
|
1871
|
-
function
|
|
1872
|
-
return (
|
|
1946
|
+
function _e(a) {
|
|
1947
|
+
return (ut[a] || ["quarters", 4])[1];
|
|
1873
1948
|
}
|
|
1874
|
-
function
|
|
1875
|
-
const t =
|
|
1949
|
+
function Ss(a, e) {
|
|
1950
|
+
const t = ft(a), s = _e(a);
|
|
1876
1951
|
if (e <= s || t === "innings" || t === "sets") return String(e);
|
|
1877
|
-
const
|
|
1878
|
-
return `OT${
|
|
1952
|
+
const r = e - s;
|
|
1953
|
+
return `OT${r > 1 ? r : ""}`;
|
|
1879
1954
|
}
|
|
1880
|
-
function
|
|
1881
|
-
const t = String(
|
|
1955
|
+
function _s(a, e) {
|
|
1956
|
+
const t = String(a ?? "").trim();
|
|
1882
1957
|
let s;
|
|
1883
|
-
return (s = /^(\d+)Q$/i.exec(t)) || (s = /^(\d+)H$/i.exec(t)) ? Number(s[1]) : /^half$/i.test(t) ?
|
|
1958
|
+
return (s = /^(\d+)Q$/i.exec(t)) || (s = /^(\d+)H$/i.exec(t)) ? Number(s[1]) : /^half$/i.test(t) ? ft(e) === "halves" ? 1 : 2 : (s = /^(\d*)OT(\d*)$/i.exec(t)) ? _e(e) + Number(s[1] || s[2] || 1) : (s = /^[TB](\d+)$/i.exec(t)) || (s = /^(\d+)(?:st|nd|rd|th)\s*set$/i.exec(t)) || (s = /^set\s*(\d+)$/i.exec(t)) ? Number(s[1]) : null;
|
|
1884
1959
|
}
|
|
1885
|
-
const Z = (
|
|
1886
|
-
function
|
|
1887
|
-
const e = Array.isArray(
|
|
1960
|
+
const Z = (a) => Number.isInteger(a) && a >= 0 ? a : null;
|
|
1961
|
+
function Ts(a) {
|
|
1962
|
+
const e = Array.isArray(a?.scoringPlays) ? a.scoringPlays : [];
|
|
1888
1963
|
if (!e.length) return null;
|
|
1889
|
-
const t =
|
|
1890
|
-
for (const
|
|
1891
|
-
const u =
|
|
1892
|
-
if (!u || f === null ||
|
|
1964
|
+
const t = a.sport, s = /* @__PURE__ */ new Map();
|
|
1965
|
+
for (const h of e) {
|
|
1966
|
+
const u = _s(h?.period, t), f = Z(h?.homeScore), g = Z(h?.awayScore);
|
|
1967
|
+
if (!u || f === null || g === null) return null;
|
|
1893
1968
|
const $ = s.get(u) || { home: 0, away: 0 };
|
|
1894
|
-
$.home = Math.max($.home, f), $.away = Math.max($.away,
|
|
1969
|
+
$.home = Math.max($.home, f), $.away = Math.max($.away, g), s.set(u, $);
|
|
1895
1970
|
}
|
|
1896
|
-
const
|
|
1971
|
+
const r = Math.max(...s.keys()), o = [];
|
|
1897
1972
|
let n = !0, i = { home: 0, away: 0 };
|
|
1898
|
-
for (let
|
|
1899
|
-
const u = s.get(
|
|
1900
|
-
(f < 0 ||
|
|
1973
|
+
for (let h = 1; h <= r; h += 1) {
|
|
1974
|
+
const u = s.get(h) || i, f = u.home - i.home, g = u.away - i.away;
|
|
1975
|
+
(f < 0 || g < 0) && (n = !1), o.push({ period: h, home: Math.max(f, 0), away: Math.max(g, 0) }), i = { home: Math.max(u.home, i.home), away: Math.max(u.away, i.away) };
|
|
1901
1976
|
}
|
|
1902
|
-
const c = Z(
|
|
1903
|
-
return n = n && i.home <= c && i.away <=
|
|
1977
|
+
const c = Z(a.homeScore) ?? 0, p = Z(a.awayScore) ?? 0, d = n && i.home === c && i.away === p;
|
|
1978
|
+
return n = n && i.home <= c && i.away <= p, { periods: o, reconciled: d, consistent: n };
|
|
1904
1979
|
}
|
|
1905
|
-
function
|
|
1906
|
-
if (Array.isArray(
|
|
1907
|
-
const e =
|
|
1908
|
-
return e ?
|
|
1980
|
+
function As(a) {
|
|
1981
|
+
if (Array.isArray(a?.periodScores) && a.periodScores.length) return a.periodScores;
|
|
1982
|
+
const e = Ts(a);
|
|
1983
|
+
return e ? a.state === "final" ? e.reconciled ? e.periods : null : e.consistent ? e.periods : null : null;
|
|
1909
1984
|
}
|
|
1910
|
-
const
|
|
1911
|
-
function
|
|
1912
|
-
return
|
|
1985
|
+
const Is = "https://api.wral.com/search";
|
|
1986
|
+
function Cs(a) {
|
|
1987
|
+
return a.map((e) => `uri:"${e}"`).join(" OR ");
|
|
1913
1988
|
}
|
|
1914
|
-
function
|
|
1915
|
-
const t = String(
|
|
1989
|
+
function Es(a, e) {
|
|
1990
|
+
const t = String(a || Is).replace(/\/+$/, ""), s = new URLSearchParams({ query: Cs(e), sort: "score", lang: "en" });
|
|
1916
1991
|
return `${t}/v1/query?${s}`;
|
|
1917
1992
|
}
|
|
1918
|
-
function
|
|
1993
|
+
function gt(a) {
|
|
1919
1994
|
try {
|
|
1920
|
-
const e = new URL(
|
|
1995
|
+
const e = new URL(a);
|
|
1921
1996
|
if (/(^|\.)smugmug\.com$/i.test(e.hostname)) {
|
|
1922
1997
|
const t = e.pathname.split("/").filter(Boolean).pop() || "", s = !t || /^[ni]-[A-Za-z0-9]+$/.test(t);
|
|
1923
1998
|
return {
|
|
1924
|
-
uri:
|
|
1925
|
-
title: s ?
|
|
1999
|
+
uri: a,
|
|
2000
|
+
title: s ? a : decodeURIComponent(t).replace(/-/g, " "),
|
|
1926
2001
|
photos: !0
|
|
1927
2002
|
};
|
|
1928
2003
|
}
|
|
1929
2004
|
} catch {
|
|
1930
2005
|
}
|
|
1931
|
-
return { uri:
|
|
2006
|
+
return { uri: a, title: a };
|
|
1932
2007
|
}
|
|
1933
|
-
async function
|
|
1934
|
-
const
|
|
1935
|
-
if (!
|
|
1936
|
-
const o = await
|
|
1937
|
-
return e.map((i) => n.get(i) ||
|
|
2008
|
+
async function Ps(a, e, t) {
|
|
2009
|
+
const r = await ((...i) => fetch(...i))(Es(a, e));
|
|
2010
|
+
if (!r.ok) throw new Error(`search answered ${r.status}`);
|
|
2011
|
+
const o = await r.json(), n = new Map((o.items || []).map((i) => [i.uri, i]));
|
|
2012
|
+
return e.map((i) => n.get(i) || gt(i));
|
|
1938
2013
|
}
|
|
1939
|
-
const
|
|
2014
|
+
const Bs = y`
|
|
1940
2015
|
.breadcrumbs { font-size: 0.8125rem; margin: 0.9rem 0 0; color: var(--hsot-gray-5); }
|
|
1941
2016
|
.breadcrumbs a { text-decoration: none; }
|
|
1942
2017
|
.scorehead { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; padding: 1.4rem 1rem; }
|
|
@@ -1992,10 +2067,10 @@ const ys = w`
|
|
|
1992
2067
|
.cols { grid-template-columns: 1fr; }
|
|
1993
2068
|
}
|
|
1994
2069
|
`;
|
|
1995
|
-
class
|
|
1996
|
-
static styles = [...U,
|
|
2070
|
+
class vt extends w {
|
|
2071
|
+
static styles = [...U, Bs];
|
|
1997
2072
|
static properties = {
|
|
1998
|
-
...
|
|
2073
|
+
...w.properties,
|
|
1999
2074
|
gameId: { type: String, attribute: "game-id" },
|
|
2000
2075
|
// The public site search that resolves Game.coverageUrls into cards
|
|
2001
2076
|
// (DEV-1236). Shared cross-stage by design — see the studio host's
|
|
@@ -2013,7 +2088,7 @@ class pt extends y {
|
|
|
2013
2088
|
super(), this.gameId = "", this.searchApi = "", this.embed = !1;
|
|
2014
2089
|
}
|
|
2015
2090
|
async fetchData(e) {
|
|
2016
|
-
const t = await e.getGame(this.gameId), s = Array.isArray(t.coverageUrls) ? t.coverageUrls : [], [
|
|
2091
|
+
const t = await e.getGame(this.gameId), s = Array.isArray(t.coverageUrls) ? t.coverageUrls : [], [r, o, n, i, c, p] = await Promise.all([
|
|
2017
2092
|
e.listSchools(),
|
|
2018
2093
|
e.listTeams({ sport: t.sport }),
|
|
2019
2094
|
e.listConferences(),
|
|
@@ -2023,16 +2098,16 @@ class pt extends y {
|
|
|
2023
2098
|
// links (fetchCoverage already degrades per-URL index misses).
|
|
2024
2099
|
// The embed drops the Coverage grid, so it skips the search
|
|
2025
2100
|
// round-trip entirely rather than fetching cards it will not render.
|
|
2026
|
-
s.length && !this.embed ?
|
|
2101
|
+
s.length && !this.embed ? Ps(this.searchApi, s).catch(() => s.map(gt)) : Promise.resolve([])
|
|
2027
2102
|
]);
|
|
2028
2103
|
return {
|
|
2029
2104
|
game: t,
|
|
2030
|
-
schools:
|
|
2105
|
+
schools: r.items,
|
|
2031
2106
|
teams: o.items,
|
|
2032
2107
|
conferences: n.items,
|
|
2033
2108
|
rankings: i.items,
|
|
2034
2109
|
games: c.items,
|
|
2035
|
-
coverage:
|
|
2110
|
+
coverage: p
|
|
2036
2111
|
};
|
|
2037
2112
|
}
|
|
2038
2113
|
get ctx() {
|
|
@@ -2048,19 +2123,19 @@ class pt extends y {
|
|
|
2048
2123
|
renderView() {
|
|
2049
2124
|
const e = this.data.game;
|
|
2050
2125
|
if (!e) return l`<div class="view"><p class="empty">Game not found.</p></div>`;
|
|
2051
|
-
const t = this.ctx, s = b(this.data.conferences),
|
|
2126
|
+
const t = this.ctx, s = b(this.data.conferences), r = t.teamsById[e.awayTeamId] ? t.schoolsById[t.teamsById[e.awayTeamId].schoolId] : null, o = t.teamsById[e.homeTeamId] ? t.schoolsById[t.teamsById[e.homeTeamId].schoolId] : null, n = ne(e), i = (d) => e.state === "final" && n !== d && n !== "tie" ? "opacity:0.45" : "", c = e.conferenceId ? s[e.conferenceId] : null, p = this.data.games.filter((d) => d.id !== e.id && d.state === "final" && d.gameType !== "scrimmage" && (d.homeTeamId === e.homeTeamId && d.awayTeamId === e.awayTeamId || d.homeTeamId === e.awayTeamId && d.awayTeamId === e.homeTeamId));
|
|
2052
2127
|
return l`
|
|
2053
2128
|
${B(this, l`
|
|
2054
2129
|
${D(this)}
|
|
2055
2130
|
${this.embed ? m : l`
|
|
2056
2131
|
<p class="breadcrumbs">
|
|
2057
|
-
<a href=${
|
|
2058
|
-
<a href=${
|
|
2059
|
-
${
|
|
2132
|
+
<a href=${v(t.hrefs.section, { sport: e.sport, view: "scores" })}>${k(e.sport)}</a> /
|
|
2133
|
+
<a href=${v(t.hrefs.section, { sport: e.sport, view: "scores" })}>Scores/Schedules</a> /
|
|
2134
|
+
${z(t, e.awayTeamId)} at ${z(t, e.homeTeamId)}
|
|
2060
2135
|
</p>`}
|
|
2061
2136
|
<div class="card">
|
|
2062
2137
|
<div class="scorehead">
|
|
2063
|
-
${this.teamBlock(t, e, e.awayTeamId,
|
|
2138
|
+
${this.teamBlock(t, e, e.awayTeamId, r, !1)}
|
|
2064
2139
|
<div class="mid">
|
|
2065
2140
|
<div class="bigscore">
|
|
2066
2141
|
<span style=${i("away")}>${e.awayScore}</span>
|
|
@@ -2068,39 +2143,39 @@ class pt extends y {
|
|
|
2068
2143
|
<span style=${i("home")}>${e.homeScore}</span>
|
|
2069
2144
|
</div>
|
|
2070
2145
|
<div class="status">${V(e)}</div>
|
|
2071
|
-
<div class="status">${x(e.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${e.state === "scheduled" && e.time ? l` · ${
|
|
2146
|
+
<div class="status">${x(e.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${e.state === "scheduled" && e.time ? l` · ${$e(e.time)}` : m} · ${e.venue || "Venue TBD"}
|
|
2072
2147
|
${e.broadcast ? l` · <span class="pill class">${e.broadcast}</span>` : m}</div>
|
|
2073
2148
|
<div class="status">
|
|
2074
2149
|
<span class="pill type">${e.gameType === "conference" ? `${c?.name || "Conference"} game` : e.gameType}</span>
|
|
2075
2150
|
${e.label ? l`<span class="pill type">Bracket ${e.label}</span>` : m}
|
|
2076
|
-
${(e.tags || []).map((
|
|
2151
|
+
${(e.tags || []).map((d) => l`<span class="pill type">${d}</span>`)}
|
|
2077
2152
|
</div>
|
|
2078
2153
|
${this.embed ? m : l`
|
|
2079
2154
|
<div class="status">
|
|
2080
|
-
<a href=${
|
|
2155
|
+
<a href=${Je(t.hrefs, e.id)}>Report a score for this game</a>
|
|
2081
2156
|
</div>`}
|
|
2082
2157
|
</div>
|
|
2083
2158
|
${this.teamBlock(t, e, e.homeTeamId, o, !0)}
|
|
2084
2159
|
</div>
|
|
2085
|
-
${this.renderLineScore(e,
|
|
2086
|
-
${this.renderScoringPlays(e,
|
|
2160
|
+
${this.renderLineScore(e, r, o)}
|
|
2161
|
+
${this.renderScoringPlays(e, r, o)}
|
|
2087
2162
|
${e.notes ? l`<p class="note gamenote">${e.notes}</p>` : m}
|
|
2088
2163
|
</div>
|
|
2089
2164
|
${this.embed ? l`
|
|
2090
2165
|
<p class="fullbox">
|
|
2091
|
-
<a href=${
|
|
2166
|
+
<a href=${v(t.hrefs.game, { sport: e.sport, id: e.id })}>Full box score →</a>
|
|
2092
2167
|
</p>` : l`
|
|
2093
2168
|
${(this.data.coverage || []).length ? l`
|
|
2094
2169
|
<div class="section-title">Coverage</div>
|
|
2095
2170
|
<div class="covgrid">
|
|
2096
|
-
${this.data.coverage.map((
|
|
2097
|
-
<a class="card covcard" href=${
|
|
2098
|
-
${
|
|
2171
|
+
${this.data.coverage.map((d) => l`
|
|
2172
|
+
<a class="card covcard" href=${d.uri}>
|
|
2173
|
+
${d.image ? l`<img class="covimg" src=${d.image} alt="" loading="lazy" />` : m}
|
|
2099
2174
|
<div class="covbody">
|
|
2100
|
-
<div class="covtitle">${
|
|
2101
|
-
${
|
|
2102
|
-
${
|
|
2103
|
-
<div class="covmeta">${[
|
|
2175
|
+
<div class="covtitle">${d.videoDuration ? l`<span class="pill live" style="animation:none">Video</span> ` : m}${d.photos ? l`<span class="pill live" style="animation:none">Photos</span> ` : m}${d.title || d.uri}</div>
|
|
2176
|
+
${d.description ? l`<p class="covdesc">${d.description}</p>` : m}
|
|
2177
|
+
${d.author || d.publishedTime ? l`
|
|
2178
|
+
<div class="covmeta">${[d.author, d.publishedTime ? new Date(d.publishedTime).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : ""].filter(Boolean).join(" · ")}</div>
|
|
2104
2179
|
` : m}
|
|
2105
2180
|
</div>
|
|
2106
2181
|
</a>
|
|
@@ -2108,50 +2183,50 @@ class pt extends y {
|
|
|
2108
2183
|
</div>` : m}
|
|
2109
2184
|
<div class="section-title">Season context</div>
|
|
2110
2185
|
<div class="cols">
|
|
2111
|
-
${[[e.awayTeamId,
|
|
2186
|
+
${[[e.awayTeamId, r], [e.homeTeamId, o]].map(([d, h]) => this.renderContext(t, d, h))}
|
|
2112
2187
|
</div>
|
|
2113
|
-
${
|
|
2188
|
+
${p.length ? l`
|
|
2114
2189
|
<div class="section-title">Head to head this season</div>
|
|
2115
2190
|
<div class="card"><ul class="gamelist">
|
|
2116
|
-
${
|
|
2117
|
-
<span class="d">${x(
|
|
2118
|
-
<span class="opp">${
|
|
2119
|
-
<a class="box" href=${
|
|
2191
|
+
${p.map((d) => l`<li>
|
|
2192
|
+
<span class="d">${x(d.date)}</span>${V(d)}
|
|
2193
|
+
<span class="opp">${z(t, d.awayTeamId)} ${d.awayScore}, ${z(t, d.homeTeamId)} ${d.homeScore}</span>
|
|
2194
|
+
<a class="box" href=${v(t.hrefs.game, { sport: e.sport, id: d.id })}>Box score →</a>
|
|
2120
2195
|
</li>`)}
|
|
2121
2196
|
</ul></div>` : m}`}
|
|
2122
2197
|
`)}
|
|
2123
2198
|
`;
|
|
2124
2199
|
}
|
|
2125
|
-
teamBlock(e, t, s,
|
|
2126
|
-
if (!
|
|
2127
|
-
const n = e.teamsById[s], i = e.records[s], c = te(
|
|
2200
|
+
teamBlock(e, t, s, r, o) {
|
|
2201
|
+
if (!r) return l`<div class="teamblock ${o ? "right" : ""}"><div class="tname">TBD</div></div>`;
|
|
2202
|
+
const n = e.teamsById[s], i = e.records[s], c = te(r, 58);
|
|
2128
2203
|
return l`
|
|
2129
2204
|
<div class="teamblock ${o ? "right" : ""}">
|
|
2130
|
-
${c ? l`<img class="crest logo" alt="" loading="lazy" src=${c} />` : l`<span class="crest" style="background:${
|
|
2205
|
+
${c ? l`<img class="crest logo" alt="" loading="lazy" src=${c} />` : l`<span class="crest" style="background:${r.colorPrimary || "#030711"};color:${ee(r.colorPrimary || "#030711")}">${ye(r)}</span>`}
|
|
2131
2206
|
<div>
|
|
2132
|
-
<div class="tname">${
|
|
2133
|
-
<div class="trec">${
|
|
2207
|
+
<div class="tname">${ke(e, s, t.date)}<a href=${v(e.hrefs.school, { id: r.id })}>${r.name}</a></div>
|
|
2208
|
+
<div class="trec">${r.mascot || ""} · ${S(i)}${n?.conferenceId ? l` · ${S(i, !0)} conf` : m}</div>
|
|
2134
2209
|
</div>
|
|
2135
2210
|
</div>
|
|
2136
2211
|
`;
|
|
2137
2212
|
}
|
|
2138
2213
|
renderLineScore(e, t, s) {
|
|
2139
|
-
const
|
|
2140
|
-
if (!
|
|
2214
|
+
const r = As(e);
|
|
2215
|
+
if (!r)
|
|
2141
2216
|
return e.state === "scheduled" ? l`<p class="empty" style="text-align:center">Period scoring will appear once the game starts.</p>` : m;
|
|
2142
|
-
const o = Math.max(
|
|
2143
|
-
const
|
|
2144
|
-
return
|
|
2145
|
-
}, c = (d, h
|
|
2217
|
+
const o = Math.max(_e(e.sport), ...r.map((p) => p.period)), n = (p) => Ss(e.sport, p), i = (p, d) => {
|
|
2218
|
+
const h = r.find((u) => u.period === d);
|
|
2219
|
+
return h ? h[p] : e.state === "final" ? 0 : "·";
|
|
2220
|
+
}, c = (p, d, h) => l`
|
|
2146
2221
|
<tr>
|
|
2147
|
-
<td class="teamcell">${P(
|
|
2148
|
-
${Array.from({ length: o }, (u, f) => l`<td class="num">${i(
|
|
2149
|
-
<td class="num" style="font-weight:700">${
|
|
2222
|
+
<td class="teamcell">${P(p, 20)}${p?.abbr || "TBD"}</td>
|
|
2223
|
+
${Array.from({ length: o }, (u, f) => l`<td class="num">${i(d, f + 1)}</td>`)}
|
|
2224
|
+
<td class="num" style="font-weight:700">${h}</td>
|
|
2150
2225
|
</tr>`;
|
|
2151
2226
|
return l`
|
|
2152
2227
|
<div class="tablewrap" style="border-top:1px solid var(--hsot-gray-2)">
|
|
2153
2228
|
<table class="data" style="max-width:560px;margin:0.6rem auto 0.9rem">
|
|
2154
|
-
<thead><tr><th>Team</th>${Array.from({ length: o }, (
|
|
2229
|
+
<thead><tr><th>Team</th>${Array.from({ length: o }, (p, d) => l`<th class="num">${n(d + 1)}</th>`)}<th class="num">T</th></tr></thead>
|
|
2155
2230
|
<tbody>
|
|
2156
2231
|
${c(t, "away", e.awayScore)}
|
|
2157
2232
|
${c(s, "home", e.homeScore)}
|
|
@@ -2161,8 +2236,8 @@ class pt extends y {
|
|
|
2161
2236
|
`;
|
|
2162
2237
|
}
|
|
2163
2238
|
renderScoringPlays(e, t, s) {
|
|
2164
|
-
const
|
|
2165
|
-
if (!
|
|
2239
|
+
const r = Array.isArray(e.scoringPlays) ? e.scoringPlays : [];
|
|
2240
|
+
if (!r.length) return m;
|
|
2166
2241
|
const o = (n) => [n.period, n.clock].filter(Boolean).join(" ");
|
|
2167
2242
|
return l`
|
|
2168
2243
|
<div class="plays">
|
|
@@ -2174,7 +2249,7 @@ class pt extends y {
|
|
|
2174
2249
|
<th class="num">${t?.abbr || "Away"}</th><th class="num">${s?.abbr || "Home"}</th>
|
|
2175
2250
|
</tr></thead>
|
|
2176
2251
|
<tbody>
|
|
2177
|
-
${
|
|
2252
|
+
${r.map((n) => l`<tr>
|
|
2178
2253
|
<td class="when">${o(n) || "·"}</td>
|
|
2179
2254
|
<td class="play">${n.description || "·"}</td>
|
|
2180
2255
|
<td class="num">${n.awayScore}</td>
|
|
@@ -2188,14 +2263,14 @@ class pt extends y {
|
|
|
2188
2263
|
}
|
|
2189
2264
|
renderContext(e, t, s) {
|
|
2190
2265
|
if (!s) return m;
|
|
2191
|
-
const
|
|
2266
|
+
const r = e.records[t], o = we(this.data.games, t);
|
|
2192
2267
|
return l`
|
|
2193
2268
|
<div class="card ctxcard">
|
|
2194
2269
|
<div class="who">${P(s)}${s.name}</div>
|
|
2195
2270
|
<div class="row">
|
|
2196
|
-
<span>Last 5: ${
|
|
2197
|
-
<span>Streak: <b>${
|
|
2198
|
-
<span>PF/PA: <b>${
|
|
2271
|
+
<span>Last 5: ${Se(e, t)}</span>
|
|
2272
|
+
<span>Streak: <b>${r ? ie(r.results) : "·"}</b></span>
|
|
2273
|
+
<span>PF/PA: <b>${r ? `${r.pf} / ${r.pa}` : "·"}</b></span>
|
|
2199
2274
|
<span>Next: ${o ? l`${x(o.date, { month: "numeric", day: "numeric" })}
|
|
2200
2275
|
${o.homeTeamId === t ? "vs" : "at"} ${se(e, o.homeTeamId === t ? o.awayTeamId : o.homeTeamId)}` : "·"}</span>
|
|
2201
2276
|
</div>
|
|
@@ -2203,9 +2278,9 @@ class pt extends y {
|
|
|
2203
2278
|
`;
|
|
2204
2279
|
}
|
|
2205
2280
|
}
|
|
2206
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore",
|
|
2207
|
-
const
|
|
2208
|
-
class
|
|
2281
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore", vt);
|
|
2282
|
+
const Ds = 250, Rs = 2;
|
|
2283
|
+
class $t extends N {
|
|
2209
2284
|
static properties = {
|
|
2210
2285
|
api: { type: String },
|
|
2211
2286
|
schoolHref: { type: String, attribute: "school-href" },
|
|
@@ -2216,7 +2291,7 @@ class mt extends N {
|
|
|
2216
2291
|
activeIndex: { state: !0 },
|
|
2217
2292
|
searched: { state: !0 }
|
|
2218
2293
|
};
|
|
2219
|
-
static styles =
|
|
2294
|
+
static styles = y`
|
|
2220
2295
|
:host {
|
|
2221
2296
|
display: block;
|
|
2222
2297
|
position: relative;
|
|
@@ -2285,11 +2360,11 @@ class mt extends N {
|
|
|
2285
2360
|
}
|
|
2286
2361
|
onInput(e) {
|
|
2287
2362
|
const t = e.target.value.trim();
|
|
2288
|
-
if (clearTimeout(this.debounceTimer), t.length <
|
|
2363
|
+
if (clearTimeout(this.debounceTimer), t.length < Rs) {
|
|
2289
2364
|
this.abortController?.abort(), this.results = [], this.open = !1, this.searched = !1;
|
|
2290
2365
|
return;
|
|
2291
2366
|
}
|
|
2292
|
-
this.debounceTimer = setTimeout(() => this.search(t),
|
|
2367
|
+
this.debounceTimer = setTimeout(() => this.search(t), Ds);
|
|
2293
2368
|
}
|
|
2294
2369
|
async search(e) {
|
|
2295
2370
|
this.abortController?.abort(), this.abortController = new AbortController();
|
|
@@ -2299,8 +2374,8 @@ class mt extends N {
|
|
|
2299
2374
|
});
|
|
2300
2375
|
if (!s.ok)
|
|
2301
2376
|
return;
|
|
2302
|
-
const
|
|
2303
|
-
this.results =
|
|
2377
|
+
const r = await s.json();
|
|
2378
|
+
this.results = r.items || [], this.activeIndex = -1, this.searched = !0, this.open = !0;
|
|
2304
2379
|
} catch (t) {
|
|
2305
2380
|
t.name !== "AbortError" && console.warn("school search failed", t);
|
|
2306
2381
|
}
|
|
@@ -2334,7 +2409,7 @@ class mt extends N {
|
|
|
2334
2409
|
return [e.location, e.county && `${e.county} County`].filter(Boolean).join(" — ");
|
|
2335
2410
|
}
|
|
2336
2411
|
renderOption(e, t) {
|
|
2337
|
-
const s = this.where(e),
|
|
2412
|
+
const s = this.where(e), r = (o) => {
|
|
2338
2413
|
o.preventDefault(), this.go(e);
|
|
2339
2414
|
};
|
|
2340
2415
|
return l`
|
|
@@ -2342,7 +2417,7 @@ class mt extends N {
|
|
|
2342
2417
|
id="school-option-${t}"
|
|
2343
2418
|
role="option"
|
|
2344
2419
|
aria-selected="${t === this.activeIndex ? "true" : "false"}"
|
|
2345
|
-
@pointerdown="${
|
|
2420
|
+
@pointerdown="${r}"
|
|
2346
2421
|
@mousemove="${() => {
|
|
2347
2422
|
this.activeIndex = t;
|
|
2348
2423
|
}}"
|
|
@@ -2356,7 +2431,7 @@ class mt extends N {
|
|
|
2356
2431
|
const e = this.searched && !this.results.length, t = l`<li class="empty">No schools found</li>`;
|
|
2357
2432
|
return l`
|
|
2358
2433
|
<ul id="school-search-listbox" role="listbox" aria-label="Schools">
|
|
2359
|
-
${this.results.map((s,
|
|
2434
|
+
${this.results.map((s, r) => this.renderOption(s, r))}
|
|
2360
2435
|
${e ? t : m}
|
|
2361
2436
|
</ul>
|
|
2362
2437
|
`;
|
|
@@ -2382,111 +2457,111 @@ class mt extends N {
|
|
|
2382
2457
|
`;
|
|
2383
2458
|
}
|
|
2384
2459
|
}
|
|
2385
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search",
|
|
2386
|
-
function
|
|
2387
|
-
const t = new Map(
|
|
2460
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search", $t);
|
|
2461
|
+
function bt(a, e) {
|
|
2462
|
+
const t = new Map(a.map((c) => [c.id, c])), s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
2388
2463
|
for (const c of e || [])
|
|
2389
|
-
c.outcome === "winner" && (s.has(c.targetGameId) || s.set(c.targetGameId, []), s.get(c.targetGameId).push(c),
|
|
2390
|
-
const o =
|
|
2464
|
+
c.outcome === "winner" && (s.has(c.targetGameId) || s.set(c.targetGameId, []), s.get(c.targetGameId).push(c), r.has(c.sourceGameId) || r.set(c.sourceGameId, []), r.get(c.sourceGameId).push(c));
|
|
2465
|
+
const o = a.filter((c) => !r.has(c.id)), n = (c) => c.targetSlot === "home" ? 0 : 1;
|
|
2391
2466
|
function i(c) {
|
|
2392
|
-
const
|
|
2393
|
-
if (!
|
|
2394
|
-
const
|
|
2395
|
-
return { game:
|
|
2467
|
+
const p = t.get(c);
|
|
2468
|
+
if (!p) return null;
|
|
2469
|
+
const h = [...s.get(c) || []].sort((u, f) => n(u) - n(f)).map((u) => i(u.sourceGameId)).filter(Boolean);
|
|
2470
|
+
return { game: p, children: h, bracketGroup: p.bracketGroup };
|
|
2396
2471
|
}
|
|
2397
2472
|
return o.length === 1 ? i(o[0].id) : o.map((c) => i(c.id));
|
|
2398
2473
|
}
|
|
2399
|
-
function
|
|
2400
|
-
if (!
|
|
2401
|
-
e[t] || (e[t] = []), e[t].push(
|
|
2402
|
-
for (const s of
|
|
2474
|
+
function yt(a, e = [], t = 0) {
|
|
2475
|
+
if (!a) return e;
|
|
2476
|
+
e[t] || (e[t] = []), e[t].push(a.game);
|
|
2477
|
+
for (const s of a.children || []) yt(s, e, t + 1);
|
|
2403
2478
|
return e;
|
|
2404
2479
|
}
|
|
2405
|
-
const
|
|
2406
|
-
function
|
|
2407
|
-
const s =
|
|
2408
|
-
return o === 0 ? t > 1 ? "Championship" : "Final" : o === 1 ? "Semifinal" : `Round ${
|
|
2480
|
+
const zs = (a) => Math.max(1, Math.round(Math.log2(a || 2)));
|
|
2481
|
+
function Ns({ round: a, perGroup: e, groupCount: t = 1 }) {
|
|
2482
|
+
const s = zs(e), o = (t === 4 ? s + 2 : t === 2 ? s + 1 : s) - a;
|
|
2483
|
+
return o === 0 ? t > 1 ? "Championship" : "Final" : o === 1 ? "Semifinal" : `Round ${a}`;
|
|
2409
2484
|
}
|
|
2410
|
-
function
|
|
2411
|
-
if (!
|
|
2412
|
-
const e = Math.max(...
|
|
2413
|
-
return t.length && t.every((s) => s.state === "final") ? "complete" :
|
|
2485
|
+
function Fs(a) {
|
|
2486
|
+
if (!a || !a.length) return "setup";
|
|
2487
|
+
const e = Math.max(...a.map((s) => s.round ?? 0)), t = a.filter((s) => (s.round ?? 0) === e);
|
|
2488
|
+
return t.length && t.every((s) => s.state === "final") ? "complete" : a.some((s) => s.state !== "scheduled" || s.homeScore || s.awayScore || s.round === 1 && (s.homeTeamId || s.awayTeamId)) ? "active" : "setup";
|
|
2414
2489
|
}
|
|
2415
|
-
function
|
|
2416
|
-
const t =
|
|
2490
|
+
function Ms(a, e) {
|
|
2491
|
+
const t = a?.groupNames || [];
|
|
2417
2492
|
if (t.length >= 2) {
|
|
2418
|
-
const
|
|
2419
|
-
return (e || []).some((o) => o.bracketGroup === "Championship") &&
|
|
2493
|
+
const r = t.map((o) => ({ key: o, name: o }));
|
|
2494
|
+
return (e || []).some((o) => o.bracketGroup === "Championship") && r.push({ key: "Championship", name: "Championship" }), r;
|
|
2420
2495
|
}
|
|
2421
|
-
const s = [...new Set((e || []).map((
|
|
2496
|
+
const s = [...new Set((e || []).map((r) => r.bracketGroup).filter(Boolean))];
|
|
2422
2497
|
return [{ key: null, name: s.length === 1 ? s[0] : "Bracket" }];
|
|
2423
2498
|
}
|
|
2424
|
-
const
|
|
2425
|
-
const e = /(\d+)\s*$/.exec(
|
|
2499
|
+
const Os = (a, e) => e?.key == null ? [...a || []] : (a || []).filter((t) => t.bracketGroup === e.key), Le = (a) => {
|
|
2500
|
+
const e = /(\d+)\s*$/.exec(a.label || "");
|
|
2426
2501
|
return e ? Number(e[1]) : 1 / 0;
|
|
2427
|
-
},
|
|
2428
|
-
function
|
|
2429
|
-
if (
|
|
2430
|
-
const t =
|
|
2431
|
-
for (const
|
|
2432
|
-
const o =
|
|
2433
|
-
o.forEach((i, c) => i.forEach((
|
|
2434
|
-
}
|
|
2435
|
-
return (
|
|
2436
|
-
}
|
|
2437
|
-
function
|
|
2438
|
-
const s =
|
|
2502
|
+
}, Ge = (a, e) => Le(a) - Le(e) || String(a.id).localeCompare(String(e.id));
|
|
2503
|
+
function Us(a, e) {
|
|
2504
|
+
if (a.every((r) => Number.isInteger(r.round))) return (r) => r.round;
|
|
2505
|
+
const t = bt(a, e), s = /* @__PURE__ */ new Map();
|
|
2506
|
+
for (const r of Array.isArray(t) ? t : [t]) {
|
|
2507
|
+
const o = yt(r), n = o.length - 1;
|
|
2508
|
+
o.forEach((i, c) => i.forEach((p) => s.set(p.id, n - c + 1)));
|
|
2509
|
+
}
|
|
2510
|
+
return (r) => Number.isInteger(r.round) ? r.round : s.get(r.id) || 1;
|
|
2511
|
+
}
|
|
2512
|
+
function Hs(a, e, t) {
|
|
2513
|
+
const s = Os(a, t);
|
|
2439
2514
|
if (!s.length) return [];
|
|
2440
|
-
const
|
|
2441
|
-
for (const
|
|
2442
|
-
const
|
|
2443
|
-
o.has(
|
|
2515
|
+
const r = Us(a || [], e || []), o = /* @__PURE__ */ new Map();
|
|
2516
|
+
for (const p of s) {
|
|
2517
|
+
const d = r(p);
|
|
2518
|
+
o.has(d) || o.set(d, []), o.get(d).push(p);
|
|
2444
2519
|
}
|
|
2445
2520
|
const n = /* @__PURE__ */ new Map();
|
|
2446
|
-
for (const
|
|
2447
|
-
|
|
2521
|
+
for (const p of e || [])
|
|
2522
|
+
p.outcome === "winner" && (n.has(p.targetGameId) || n.set(p.targetGameId, []), n.get(p.targetGameId).push(p.sourceGameId));
|
|
2448
2523
|
const i = [];
|
|
2449
2524
|
let c = null;
|
|
2450
|
-
for (const
|
|
2451
|
-
let
|
|
2525
|
+
for (const p of [...o.keys()].sort((d, h) => d - h)) {
|
|
2526
|
+
let d = [...o.get(p)];
|
|
2452
2527
|
if (c) {
|
|
2453
|
-
const
|
|
2454
|
-
const f = (n.get(u.id) || []).map((
|
|
2528
|
+
const h = (u) => {
|
|
2529
|
+
const f = (n.get(u.id) || []).map((g) => c.get(g)).filter((g) => g !== void 0);
|
|
2455
2530
|
return f.length ? Math.min(...f) : 1 / 0;
|
|
2456
2531
|
};
|
|
2457
|
-
|
|
2532
|
+
d.sort((u, f) => h(u) - h(f) || Ge(u, f));
|
|
2458
2533
|
} else
|
|
2459
|
-
|
|
2460
|
-
c = new Map(
|
|
2534
|
+
d.sort(Ge);
|
|
2535
|
+
c = new Map(d.map((h, u) => [h.id, u])), i.push({ round: p, games: d });
|
|
2461
2536
|
}
|
|
2462
2537
|
return i;
|
|
2463
2538
|
}
|
|
2464
|
-
function
|
|
2465
|
-
const s =
|
|
2466
|
-
return { teamId: s, seed: o, bye: !s && !!
|
|
2539
|
+
function Ls(a, e, t) {
|
|
2540
|
+
const s = a[`${e}TeamId`] || null, r = (t || []).find((n) => n.gameId === a.id && n.slot === e), o = a[`${e}Seed`] ?? r?.seed ?? null;
|
|
2541
|
+
return { teamId: s, seed: o, bye: !s && !!r?.isBye };
|
|
2467
2542
|
}
|
|
2468
|
-
function
|
|
2469
|
-
const e = ne(
|
|
2543
|
+
function wt(a) {
|
|
2544
|
+
const e = ne(a);
|
|
2470
2545
|
return e === "home" || e === "away" ? e : null;
|
|
2471
2546
|
}
|
|
2472
|
-
function
|
|
2473
|
-
const t =
|
|
2547
|
+
function Gs(a, e) {
|
|
2548
|
+
const t = bt(a || [], e || []);
|
|
2474
2549
|
if (!t || Array.isArray(t)) return null;
|
|
2475
|
-
const s =
|
|
2550
|
+
const s = wt(t.game);
|
|
2476
2551
|
return s && t.game[`${s}TeamId`] || null;
|
|
2477
2552
|
}
|
|
2478
|
-
const
|
|
2479
|
-
function
|
|
2480
|
-
const s =
|
|
2553
|
+
const je = { active: 0, setup: 1, complete: 2 };
|
|
2554
|
+
function js(a, { id: e, param: t } = {}) {
|
|
2555
|
+
const s = a || [];
|
|
2481
2556
|
if (!s.length) return null;
|
|
2482
|
-
for (const
|
|
2483
|
-
if (!
|
|
2484
|
-
const o = s.find((n) => n.id ===
|
|
2557
|
+
for (const r of [e, t]) {
|
|
2558
|
+
if (!r) continue;
|
|
2559
|
+
const o = s.find((n) => n.id === r);
|
|
2485
2560
|
if (o) return o;
|
|
2486
2561
|
}
|
|
2487
|
-
return [...s].sort((
|
|
2562
|
+
return [...s].sort((r, o) => (je[r.status] ?? 3) - (je[o.status] ?? 3) || String(r.name || "").localeCompare(String(o.name || "")))[0];
|
|
2488
2563
|
}
|
|
2489
|
-
const
|
|
2564
|
+
const qs = y`
|
|
2490
2565
|
.bracket { display: flex; gap: 1rem; align-items: stretch; overflow-x: auto; padding-bottom: 0.5rem; }
|
|
2491
2566
|
.round { flex: 0 0 250px; display: flex; flex-direction: column; min-width: 0; }
|
|
2492
2567
|
.roundhead {
|
|
@@ -2532,10 +2607,10 @@ const Ds = w`
|
|
|
2532
2607
|
.champ .tname a { color: inherit; text-decoration: none; font-weight: 700; }
|
|
2533
2608
|
@media (max-width: 720px) { .round { flex-basis: 215px; } }
|
|
2534
2609
|
`;
|
|
2535
|
-
class
|
|
2536
|
-
static styles = [U,
|
|
2610
|
+
class xt extends w {
|
|
2611
|
+
static styles = [U, qs];
|
|
2537
2612
|
static properties = {
|
|
2538
|
-
...
|
|
2613
|
+
...w.properties,
|
|
2539
2614
|
sport: { type: String },
|
|
2540
2615
|
season: { type: String },
|
|
2541
2616
|
tournamentId: { type: String, attribute: "tournament-id" },
|
|
@@ -2546,9 +2621,9 @@ class vt extends y {
|
|
|
2546
2621
|
super(), this.sport = "football", this.season = "", this.tournamentId = "", this.picked = "", this.group = null;
|
|
2547
2622
|
}
|
|
2548
2623
|
async fetchData(e) {
|
|
2549
|
-
const t = this.season || K(), s = (await e.listTournaments({ sport: this.sport, season: t })).items,
|
|
2624
|
+
const t = this.season || K(), s = (await e.listTournaments({ sport: this.sport, season: t })).items, r = new URLSearchParams(globalThis.location?.search || "").get("tournament"), o = js(s, { id: this.picked || this.tournamentId, param: r });
|
|
2550
2625
|
if (!o) return { season: t, tournaments: s, tournament: null };
|
|
2551
|
-
const [n, i, c,
|
|
2626
|
+
const [n, i, c, p, d] = await Promise.all([
|
|
2552
2627
|
e.listSeedings(o.id),
|
|
2553
2628
|
e.listEdges(o.id),
|
|
2554
2629
|
e.listGames({ tournamentId: o.id }),
|
|
@@ -2562,8 +2637,8 @@ class vt extends y {
|
|
|
2562
2637
|
seedings: n.items,
|
|
2563
2638
|
edges: i.items,
|
|
2564
2639
|
games: c.items,
|
|
2565
|
-
schools:
|
|
2566
|
-
teams:
|
|
2640
|
+
schools: p.items,
|
|
2641
|
+
teams: d.items
|
|
2567
2642
|
};
|
|
2568
2643
|
}
|
|
2569
2644
|
get ctx() {
|
|
@@ -2599,7 +2674,7 @@ class vt extends y {
|
|
|
2599
2674
|
${D(this)}
|
|
2600
2675
|
<div class="card"><div class="empty">No ${this.sport} brackets have been published for the ${e.season} season yet.</div></div>
|
|
2601
2676
|
`)}`;
|
|
2602
|
-
const
|
|
2677
|
+
const r = Ms(e.tournament, e.games), o = r.find((h) => h.key === this.group) || r[0], n = (e.tournament.groupNames || []).length >= 2 ? e.tournament.groupNames.length : 1, i = (Number(e.tournament.size) || 0) / n, c = Hs(e.games, e.edges, o), p = Fs(e.games), d = Gs(e.games, e.edges);
|
|
2603
2678
|
return l`
|
|
2604
2679
|
${s}
|
|
2605
2680
|
${B(this, l`
|
|
@@ -2607,29 +2682,29 @@ class vt extends y {
|
|
|
2607
2682
|
<div class="toolbar">
|
|
2608
2683
|
${e.tournaments.length > 1 ? l`
|
|
2609
2684
|
<div role="group" aria-label="Tournament">
|
|
2610
|
-
${e.tournaments.map((
|
|
2611
|
-
@click=${() => this.pick(
|
|
2685
|
+
${e.tournaments.map((h) => l`<button class="chip ${h.id === e.tournament.id ? "on" : ""}"
|
|
2686
|
+
@click=${() => this.pick(h.id)}>${h.name}</button>`)}
|
|
2612
2687
|
</div>` : m}
|
|
2613
|
-
${
|
|
2688
|
+
${r.length > 1 ? l`
|
|
2614
2689
|
<div role="tablist" aria-label="Bracket group">
|
|
2615
|
-
${
|
|
2616
|
-
aria-selected=${
|
|
2690
|
+
${r.map((h) => l`<button class="chip ${h.key === o.key ? "on" : ""}" role="tab"
|
|
2691
|
+
aria-selected=${h.key === o.key ? "true" : "false"}
|
|
2617
2692
|
@click=${() => {
|
|
2618
|
-
this.group =
|
|
2619
|
-
}}>${
|
|
2693
|
+
this.group = h.key;
|
|
2694
|
+
}}>${h.name}</button>`)}
|
|
2620
2695
|
</div>` : m}
|
|
2621
2696
|
<span class="spacer"></span>
|
|
2622
|
-
<span class="pill ${
|
|
2697
|
+
<span class="pill ${p === "complete" ? "final" : p === "active" ? "class" : "type"}">${p === "complete" ? "Complete" : p === "active" ? "In progress" : "Bracket set"}</span>
|
|
2623
2698
|
<span class="asof">${e.tournament.size}-team ${String(e.tournament.format || "").replace(/_/g, " ")}</span>
|
|
2624
2699
|
</div>
|
|
2625
|
-
${
|
|
2626
|
-
${P(
|
|
2700
|
+
${d ? l`<div class="champ"><span class="pill champ">Champion</span>
|
|
2701
|
+
${P(E(t, d), 26)}<span class="tname">${ae(t, d)}</span></div>` : m}
|
|
2627
2702
|
${c.length ? l`
|
|
2628
2703
|
<div class="bracket" role="region" aria-label="${o.name} bracket">
|
|
2629
|
-
${c.map((
|
|
2704
|
+
${c.map((h) => l`
|
|
2630
2705
|
<section class="round">
|
|
2631
|
-
<h3 class="roundhead">${
|
|
2632
|
-
<div class="games">${
|
|
2706
|
+
<h3 class="roundhead">${Ns({ round: h.round, perGroup: i, groupCount: n })}</h3>
|
|
2707
|
+
<div class="games">${h.games.map((u) => this.renderMatchup(t, u))}</div>
|
|
2633
2708
|
</section>`)}
|
|
2634
2709
|
</div>` : l`<div class="card"><div class="empty">This bracket has no games yet.</div></div>`}
|
|
2635
2710
|
`)}
|
|
@@ -2645,39 +2720,39 @@ class vt extends y {
|
|
|
2645
2720
|
${V(t)}
|
|
2646
2721
|
${t.label ? l`<span class="label">${t.label}</span>` : m}
|
|
2647
2722
|
<span class="spacer"></span>
|
|
2648
|
-
${s ? l`<a class="box" href=${
|
|
2723
|
+
${s ? l`<a class="box" href=${v(e.hrefs.game, { sport: this.sport, id: t.id })}>Box score</a>` : m}
|
|
2649
2724
|
</footer>
|
|
2650
2725
|
</article>
|
|
2651
2726
|
`;
|
|
2652
2727
|
}
|
|
2653
2728
|
renderSlot(e, t, s) {
|
|
2654
|
-
const { teamId:
|
|
2729
|
+
const { teamId: r, seed: o, bye: n } = Ls(t, s, this.data.seedings), i = wt(t), c = t.state === "live" || t.state === "final";
|
|
2655
2730
|
return l`
|
|
2656
2731
|
<div class="slot ${i ? i === s ? "winner" : "loser" : ""}">
|
|
2657
2732
|
<span class="seed">${o ?? ""}</span>
|
|
2658
|
-
${
|
|
2733
|
+
${r ? l`${P(E(e, r), 22)}<span class="tname">${ae(e, r, t.date)}</span>` : n ? l`<span class="tname bye">Bye</span>` : l`<span class="tname mut">TBD</span>`}
|
|
2659
2734
|
${c ? l`<span class="score">${t[`${s}Score`] ?? 0}</span>` : m}
|
|
2660
2735
|
</div>
|
|
2661
2736
|
`;
|
|
2662
2737
|
}
|
|
2663
2738
|
}
|
|
2664
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-brackets") && globalThis.customElements.define("hsot-brackets",
|
|
2665
|
-
const
|
|
2666
|
-
"hsot-scores":
|
|
2667
|
-
"hsot-standings":
|
|
2668
|
-
"hsot-rankings":
|
|
2669
|
-
"hsot-school":
|
|
2670
|
-
"hsot-boxscore":
|
|
2671
|
-
"hsot-school-search":
|
|
2672
|
-
"hsot-brackets":
|
|
2739
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-brackets") && globalThis.customElements.define("hsot-brackets", xt);
|
|
2740
|
+
const Ws = {
|
|
2741
|
+
"hsot-scores": ht,
|
|
2742
|
+
"hsot-standings": dt,
|
|
2743
|
+
"hsot-rankings": pt,
|
|
2744
|
+
"hsot-school": mt,
|
|
2745
|
+
"hsot-boxscore": vt,
|
|
2746
|
+
"hsot-school-search": $t,
|
|
2747
|
+
"hsot-brackets": xt
|
|
2673
2748
|
};
|
|
2674
|
-
function
|
|
2675
|
-
const
|
|
2676
|
-
if (
|
|
2677
|
-
for (const [e, t] of Object.entries(
|
|
2678
|
-
|
|
2749
|
+
function Vs() {
|
|
2750
|
+
const a = globalThis?.customElements;
|
|
2751
|
+
if (a)
|
|
2752
|
+
for (const [e, t] of Object.entries(Ws))
|
|
2753
|
+
a.get(e) || a.define(e, t);
|
|
2679
2754
|
}
|
|
2680
|
-
typeof window < "u" && globalThis.customElements &&
|
|
2755
|
+
typeof window < "u" && globalThis.customElements && Vs();
|
|
2681
2756
|
export {
|
|
2682
|
-
|
|
2757
|
+
Vs as defineAll
|
|
2683
2758
|
};
|