@wral/hsot-data 0.1.14 → 0.2.0
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 +2 -1
- package/dist/define.mjs +11 -10
- package/dist/define.standalone.js +957 -623
- package/dist/{hsot-school-search-CtMiZfDB.js → hsot-brackets-D5cwGage.js} +844 -503
- package/dist/index.mjs +23 -15
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
1
|
+
const Z = globalThis, dt = Z.ShadowRoot && (Z.ShadyCSS === void 0 || Z.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, pt = /* @__PURE__ */ Symbol(), St = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
let Gt = class {
|
|
3
3
|
constructor(t, e, s) {
|
|
4
|
-
if (this._$cssResult$ = !0, s !==
|
|
4
|
+
if (this._$cssResult$ = !0, s !== pt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
5
5
|
this.cssText = t, this.t = e;
|
|
6
6
|
}
|
|
7
7
|
get styleSheet() {
|
|
8
8
|
let t = this.o;
|
|
9
9
|
const e = this.t;
|
|
10
|
-
if (
|
|
10
|
+
if (dt && t === void 0) {
|
|
11
11
|
const s = e !== void 0 && e.length === 1;
|
|
12
|
-
s && (t =
|
|
12
|
+
s && (t = St.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && St.set(e, t));
|
|
13
13
|
}
|
|
14
14
|
return t;
|
|
15
15
|
}
|
|
@@ -17,28 +17,28 @@ let Nt = class {
|
|
|
17
17
|
return this.cssText;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const
|
|
21
|
-
const e = a.length === 1 ? a[0] : t.reduce((s, r, o) => s + ((
|
|
22
|
-
if (
|
|
23
|
-
if (typeof
|
|
24
|
-
throw Error("Value passed to 'css' function must be a 'css' function result: " +
|
|
20
|
+
const ue = (a) => new Gt(typeof a == "string" ? a : a + "", void 0, pt), y = (a, ...t) => {
|
|
21
|
+
const e = a.length === 1 ? a[0] : t.reduce((s, r, o) => s + ((n) => {
|
|
22
|
+
if (n._$cssResult$ === !0) return n.cssText;
|
|
23
|
+
if (typeof n == "number") return n;
|
|
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
25
|
})(r) + a[o + 1], a[0]);
|
|
26
|
-
return new
|
|
27
|
-
},
|
|
28
|
-
if (
|
|
26
|
+
return new Gt(e, a, pt);
|
|
27
|
+
}, fe = (a, t) => {
|
|
28
|
+
if (dt) a.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
29
29
|
else for (const e of t) {
|
|
30
|
-
const s = document.createElement("style"), r =
|
|
30
|
+
const s = document.createElement("style"), r = Z.litNonce;
|
|
31
31
|
r !== void 0 && s.setAttribute("nonce", r), s.textContent = e.cssText, a.appendChild(s);
|
|
32
32
|
}
|
|
33
|
-
},
|
|
33
|
+
}, _t = dt ? (a) => a : (a) => a instanceof CSSStyleSheet ? ((t) => {
|
|
34
34
|
let e = "";
|
|
35
35
|
for (const s of t.cssRules) e += s.cssText;
|
|
36
|
-
return
|
|
36
|
+
return ue(e);
|
|
37
37
|
})(a) : a;
|
|
38
|
-
const { is:
|
|
38
|
+
const { is: ge, defineProperty: ve, getOwnPropertyDescriptor: $e, getOwnPropertyNames: be, getOwnPropertySymbols: ye, getPrototypeOf: we } = Object, at = globalThis, At = at.trustedTypes, xe = At ? At.emptyScript : "", ke = at.reactiveElementPolyfillSupport, L = (a, t) => a, ht = { toAttribute(a, t) {
|
|
39
39
|
switch (t) {
|
|
40
40
|
case Boolean:
|
|
41
|
-
a = a ?
|
|
41
|
+
a = a ? xe : null;
|
|
42
42
|
break;
|
|
43
43
|
case Object:
|
|
44
44
|
case Array:
|
|
@@ -63,44 +63,44 @@ const { is: oe, defineProperty: ie, getOwnPropertyDescriptor: ne, getOwnProperty
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
return e;
|
|
66
|
-
} },
|
|
67
|
-
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"),
|
|
68
|
-
let
|
|
66
|
+
} }, jt = (a, t) => !ge(a, t), Tt = { attribute: !0, type: String, converter: ht, reflect: !1, useDefault: !1, hasChanged: jt };
|
|
67
|
+
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), at.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
|
+
let z = class extends HTMLElement {
|
|
69
69
|
static addInitializer(t) {
|
|
70
70
|
this._$Ei(), (this.l ??= []).push(t);
|
|
71
71
|
}
|
|
72
72
|
static get observedAttributes() {
|
|
73
73
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
74
74
|
}
|
|
75
|
-
static createProperty(t, e =
|
|
75
|
+
static createProperty(t, e = Tt) {
|
|
76
76
|
if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
77
77
|
const s = /* @__PURE__ */ Symbol(), r = this.getPropertyDescriptor(t, s, e);
|
|
78
|
-
r !== void 0 &&
|
|
78
|
+
r !== void 0 && ve(this.prototype, t, r);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
static getPropertyDescriptor(t, e, s) {
|
|
82
|
-
const { get: r, set: o } =
|
|
82
|
+
const { get: r, set: o } = $e(this.prototype, t) ?? { get() {
|
|
83
83
|
return this[e];
|
|
84
|
-
}, set(
|
|
85
|
-
this[e] =
|
|
84
|
+
}, set(n) {
|
|
85
|
+
this[e] = n;
|
|
86
86
|
} };
|
|
87
|
-
return { get: r, set(
|
|
88
|
-
const
|
|
89
|
-
o?.call(this,
|
|
87
|
+
return { get: r, set(n) {
|
|
88
|
+
const i = r?.call(this);
|
|
89
|
+
o?.call(this, n), this.requestUpdate(t, i, s);
|
|
90
90
|
}, configurable: !0, enumerable: !0 };
|
|
91
91
|
}
|
|
92
92
|
static getPropertyOptions(t) {
|
|
93
|
-
return this.elementProperties.get(t) ??
|
|
93
|
+
return this.elementProperties.get(t) ?? Tt;
|
|
94
94
|
}
|
|
95
95
|
static _$Ei() {
|
|
96
|
-
if (this.hasOwnProperty(
|
|
97
|
-
const t =
|
|
96
|
+
if (this.hasOwnProperty(L("elementProperties"))) return;
|
|
97
|
+
const t = we(this);
|
|
98
98
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
99
99
|
}
|
|
100
100
|
static finalize() {
|
|
101
|
-
if (this.hasOwnProperty(
|
|
102
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
103
|
-
const e = this.properties, s = [...
|
|
101
|
+
if (this.hasOwnProperty(L("finalized"))) return;
|
|
102
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(L("properties"))) {
|
|
103
|
+
const e = this.properties, s = [...be(e), ...ye(e)];
|
|
104
104
|
for (const r of s) this.createProperty(r, e[r]);
|
|
105
105
|
}
|
|
106
106
|
const t = this[Symbol.metadata];
|
|
@@ -119,8 +119,8 @@ let I = class extends HTMLElement {
|
|
|
119
119
|
const e = [];
|
|
120
120
|
if (Array.isArray(t)) {
|
|
121
121
|
const s = new Set(t.flat(1 / 0).reverse());
|
|
122
|
-
for (const r of s) e.unshift(
|
|
123
|
-
} else t !== void 0 && e.push(
|
|
122
|
+
for (const r of s) e.unshift(_t(r));
|
|
123
|
+
} else t !== void 0 && e.push(_t(t));
|
|
124
124
|
return e;
|
|
125
125
|
}
|
|
126
126
|
static _$Eu(t, e) {
|
|
@@ -146,7 +146,7 @@ let I = class extends HTMLElement {
|
|
|
146
146
|
}
|
|
147
147
|
createRenderRoot() {
|
|
148
148
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
149
|
-
return
|
|
149
|
+
return fe(t, this.constructor.elementStyles), t;
|
|
150
150
|
}
|
|
151
151
|
connectedCallback() {
|
|
152
152
|
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((t) => t.hostConnected?.());
|
|
@@ -162,29 +162,29 @@ let I = class extends HTMLElement {
|
|
|
162
162
|
_$ET(t, e) {
|
|
163
163
|
const s = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, s);
|
|
164
164
|
if (r !== void 0 && s.reflect === !0) {
|
|
165
|
-
const o = (s.converter?.toAttribute !== void 0 ? s.converter :
|
|
165
|
+
const o = (s.converter?.toAttribute !== void 0 ? s.converter : ht).toAttribute(e, s.type);
|
|
166
166
|
this._$Em = t, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
_$AK(t, e) {
|
|
170
170
|
const s = this.constructor, r = s._$Eh.get(t);
|
|
171
171
|
if (r !== void 0 && this._$Em !== r) {
|
|
172
|
-
const o = s.getPropertyOptions(r),
|
|
172
|
+
const o = s.getPropertyOptions(r), n = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : ht;
|
|
173
173
|
this._$Em = r;
|
|
174
|
-
const
|
|
175
|
-
this[r] =
|
|
174
|
+
const i = n.fromAttribute(e, o.type);
|
|
175
|
+
this[r] = i ?? this._$Ej?.get(r) ?? i, this._$Em = null;
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
requestUpdate(t, e, s, r = !1, o) {
|
|
179
179
|
if (t !== void 0) {
|
|
180
|
-
const
|
|
181
|
-
if (r === !1 && (o = this[t]), s ??=
|
|
180
|
+
const n = this.constructor;
|
|
181
|
+
if (r === !1 && (o = this[t]), s ??= n.getPropertyOptions(t), !((s.hasChanged ?? jt)(o, e) || s.useDefault && s.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(n._$Eu(t, s)))) return;
|
|
182
182
|
this.C(t, e, s);
|
|
183
183
|
}
|
|
184
184
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
185
185
|
}
|
|
186
|
-
C(t, e, { useDefault: s, reflect: r, wrapped: o },
|
|
187
|
-
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t,
|
|
186
|
+
C(t, e, { useDefault: s, reflect: r, wrapped: o }, n) {
|
|
187
|
+
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, n ?? e ?? this[t]), o !== !0 || n !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), r === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
|
|
188
188
|
}
|
|
189
189
|
async _$EP() {
|
|
190
190
|
this.isUpdatePending = !0;
|
|
@@ -208,8 +208,8 @@ let I = class extends HTMLElement {
|
|
|
208
208
|
}
|
|
209
209
|
const s = this.constructor.elementProperties;
|
|
210
210
|
if (s.size > 0) for (const [r, o] of s) {
|
|
211
|
-
const { wrapped:
|
|
212
|
-
|
|
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 t = !1;
|
|
@@ -246,70 +246,70 @@ let I = class extends HTMLElement {
|
|
|
246
246
|
firstUpdated(t) {
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
|
|
250
|
-
const
|
|
251
|
-
\f\r]`,
|
|
252
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
253
|
-
function
|
|
254
|
-
if (!
|
|
255
|
-
return
|
|
256
|
-
}
|
|
257
|
-
const
|
|
249
|
+
z.elementStyles = [], z.shadowRootOptions = { mode: "open" }, z[L("elementProperties")] = /* @__PURE__ */ new Map(), z[L("finalized")] = /* @__PURE__ */ new Map(), ke?.({ ReactiveElement: z }), (at.reactiveElementVersions ??= []).push("2.1.2");
|
|
250
|
+
const mt = globalThis, It = (a) => a, J = mt.trustedTypes, Ct = J ? J.createPolicy("lit-html", { createHTML: (a) => a }) : void 0, qt = "$lit$", S = `lit$${Math.random().toFixed(9).slice(2)}$`, Wt = "?" + S, Se = `<${Wt}>`, I = document, G = () => I.createComment(""), j = (a) => a === null || typeof a != "object" && typeof a != "function", ut = Array.isArray, _e = (a) => ut(a) || typeof a?.[Symbol.iterator] == "function", lt = `[
|
|
251
|
+
\f\r]`, H = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Et = /-->/g, Pt = />/g, A = RegExp(`>|${lt}(?:([^\\s"'>=/]+)(${lt}*=${lt}*(?:[^
|
|
252
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Dt = /'/g, Bt = /"/g, Vt = /^(?:script|style|textarea|title)$/i, Yt = (a) => (t, ...e) => ({ _$litType$: a, strings: t, values: e }), h = Yt(1), zt = Yt(2), M = /* @__PURE__ */ Symbol.for("lit-noChange"), m = /* @__PURE__ */ Symbol.for("lit-nothing"), Rt = /* @__PURE__ */ new WeakMap(), T = I.createTreeWalker(I, 129);
|
|
253
|
+
function Kt(a, t) {
|
|
254
|
+
if (!ut(a) || !a.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
|
+
return Ct !== void 0 ? Ct.createHTML(t) : t;
|
|
256
|
+
}
|
|
257
|
+
const Ae = (a, t) => {
|
|
258
258
|
const e = a.length - 1, s = [];
|
|
259
|
-
let r, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "",
|
|
260
|
-
for (let
|
|
261
|
-
const
|
|
262
|
-
let c,
|
|
263
|
-
for (;
|
|
264
|
-
const
|
|
265
|
-
o +=
|
|
266
|
-
}
|
|
267
|
-
return [
|
|
259
|
+
let r, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = H;
|
|
260
|
+
for (let i = 0; i < e; i++) {
|
|
261
|
+
const l = a[i];
|
|
262
|
+
let c, d, p = -1, u = 0;
|
|
263
|
+
for (; u < l.length && (n.lastIndex = u, d = n.exec(l), d !== null); ) u = n.lastIndex, n === H ? d[1] === "!--" ? n = Et : d[1] !== void 0 ? n = Pt : d[2] !== void 0 ? (Vt.test(d[2]) && (r = RegExp("</" + d[2], "g")), n = A) : d[3] !== void 0 && (n = A) : n === A ? d[0] === ">" ? (n = r ?? H, p = -1) : d[1] === void 0 ? p = -2 : (p = n.lastIndex - d[2].length, c = d[1], n = d[3] === void 0 ? A : d[3] === '"' ? Bt : Dt) : n === Bt || n === Dt ? n = A : n === Et || n === Pt ? n = H : (n = A, r = void 0);
|
|
264
|
+
const f = n === A && a[i + 1].startsWith("/>") ? " " : "";
|
|
265
|
+
o += n === H ? l + Se : p >= 0 ? (s.push(c), l.slice(0, p) + qt + l.slice(p) + S + f) : l + S + (p === -2 ? i : f);
|
|
266
|
+
}
|
|
267
|
+
return [Kt(a, o + (a[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
268
268
|
};
|
|
269
|
-
class
|
|
269
|
+
class q {
|
|
270
270
|
constructor({ strings: t, _$litType$: e }, s) {
|
|
271
271
|
let r;
|
|
272
272
|
this.parts = [];
|
|
273
|
-
let o = 0,
|
|
274
|
-
const
|
|
275
|
-
if (this.el =
|
|
273
|
+
let o = 0, n = 0;
|
|
274
|
+
const i = t.length - 1, l = this.parts, [c, d] = Ae(t, e);
|
|
275
|
+
if (this.el = q.createElement(c, s), T.currentNode = this.el.content, e === 2 || e === 3) {
|
|
276
276
|
const p = this.el.content.firstChild;
|
|
277
277
|
p.replaceWith(...p.childNodes);
|
|
278
278
|
}
|
|
279
|
-
for (; (r =
|
|
279
|
+
for (; (r = T.nextNode()) !== null && l.length < i; ) {
|
|
280
280
|
if (r.nodeType === 1) {
|
|
281
|
-
if (r.hasAttributes()) for (const p of r.getAttributeNames()) if (p.endsWith(
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
} else p.startsWith(
|
|
285
|
-
if (
|
|
286
|
-
const p = r.textContent.split(
|
|
287
|
-
if (
|
|
288
|
-
r.textContent =
|
|
289
|
-
for (let
|
|
290
|
-
r.append(p[
|
|
281
|
+
if (r.hasAttributes()) for (const p of r.getAttributeNames()) if (p.endsWith(qt)) {
|
|
282
|
+
const u = d[n++], f = r.getAttribute(p).split(S), g = /([.?@])?(.*)/.exec(u);
|
|
283
|
+
l.push({ type: 1, index: o, name: g[2], strings: f, ctor: g[1] === "." ? Ie : g[1] === "?" ? Ce : g[1] === "@" ? Ee : rt }), r.removeAttribute(p);
|
|
284
|
+
} else p.startsWith(S) && (l.push({ type: 6, index: o }), r.removeAttribute(p));
|
|
285
|
+
if (Vt.test(r.tagName)) {
|
|
286
|
+
const p = r.textContent.split(S), u = p.length - 1;
|
|
287
|
+
if (u > 0) {
|
|
288
|
+
r.textContent = J ? J.emptyScript : "";
|
|
289
|
+
for (let f = 0; f < u; f++) r.append(p[f], G()), T.nextNode(), l.push({ type: 2, index: ++o });
|
|
290
|
+
r.append(p[u], G());
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
} else if (r.nodeType === 8) if (r.data ===
|
|
293
|
+
} else if (r.nodeType === 8) if (r.data === Wt) l.push({ type: 2, index: o });
|
|
294
294
|
else {
|
|
295
295
|
let p = -1;
|
|
296
|
-
for (; (p = r.data.indexOf(
|
|
296
|
+
for (; (p = r.data.indexOf(S, p + 1)) !== -1; ) l.push({ type: 7, index: o }), p += S.length - 1;
|
|
297
297
|
}
|
|
298
298
|
o++;
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
301
|
static createElement(t, e) {
|
|
302
|
-
const s =
|
|
302
|
+
const s = I.createElement("template");
|
|
303
303
|
return s.innerHTML = t, s;
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
if (t ===
|
|
306
|
+
function F(a, t, e = a, s) {
|
|
307
|
+
if (t === M) return t;
|
|
308
308
|
let r = s !== void 0 ? e._$Co?.[s] : e._$Cl;
|
|
309
|
-
const o =
|
|
310
|
-
return r?.constructor !== o && (r?._$AO?.(!1), o === void 0 ? r = void 0 : (r = new o(a), r._$AT(a, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = r : e._$Cl = r), r !== void 0 && (t =
|
|
309
|
+
const o = j(t) ? void 0 : t._$litDirective$;
|
|
310
|
+
return r?.constructor !== o && (r?._$AO?.(!1), o === void 0 ? r = void 0 : (r = new o(a), r._$AT(a, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = r : e._$Cl = r), r !== void 0 && (t = F(a, r._$AS(a, t.values), r, s)), t;
|
|
311
311
|
}
|
|
312
|
-
class
|
|
312
|
+
class Te {
|
|
313
313
|
constructor(t, e) {
|
|
314
314
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
315
315
|
}
|
|
@@ -320,24 +320,24 @@ class ge {
|
|
|
320
320
|
return this._$AM._$AU;
|
|
321
321
|
}
|
|
322
322
|
u(t) {
|
|
323
|
-
const { el: { content: e }, parts: s } = this._$AD, r = (t?.creationScope ??
|
|
324
|
-
|
|
325
|
-
let o =
|
|
326
|
-
for (;
|
|
327
|
-
if (
|
|
323
|
+
const { el: { content: e }, parts: s } = this._$AD, r = (t?.creationScope ?? I).importNode(e, !0);
|
|
324
|
+
T.currentNode = r;
|
|
325
|
+
let o = T.nextNode(), n = 0, i = 0, l = s[0];
|
|
326
|
+
for (; l !== void 0; ) {
|
|
327
|
+
if (n === l.index) {
|
|
328
328
|
let c;
|
|
329
|
-
|
|
329
|
+
l.type === 2 ? c = new V(o, o.nextSibling, this, t) : l.type === 1 ? c = new l.ctor(o, l.name, l.strings, this, t) : l.type === 6 && (c = new Pe(o, this, t)), this._$AV.push(c), l = s[++i];
|
|
330
330
|
}
|
|
331
|
-
|
|
331
|
+
n !== l?.index && (o = T.nextNode(), n++);
|
|
332
332
|
}
|
|
333
|
-
return
|
|
333
|
+
return T.currentNode = I, r;
|
|
334
334
|
}
|
|
335
335
|
p(t) {
|
|
336
336
|
let e = 0;
|
|
337
337
|
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
class
|
|
340
|
+
class V {
|
|
341
341
|
get _$AU() {
|
|
342
342
|
return this._$AM?._$AU ?? this._$Cv;
|
|
343
343
|
}
|
|
@@ -356,7 +356,7 @@ class M {
|
|
|
356
356
|
return this._$AB;
|
|
357
357
|
}
|
|
358
358
|
_$AI(t, e = this) {
|
|
359
|
-
t =
|
|
359
|
+
t = F(this, t, e), j(t) ? t === m || t == null || t === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : t !== this._$AH && t !== M && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : _e(t) ? this.k(t) : this._(t);
|
|
360
360
|
}
|
|
361
361
|
O(t) {
|
|
362
362
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -365,38 +365,38 @@ class M {
|
|
|
365
365
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
366
366
|
}
|
|
367
367
|
_(t) {
|
|
368
|
-
this._$AH !== m &&
|
|
368
|
+
this._$AH !== m && j(this._$AH) ? this._$AA.nextSibling.data = t : this.T(I.createTextNode(t)), this._$AH = t;
|
|
369
369
|
}
|
|
370
370
|
$(t) {
|
|
371
|
-
const { values: e, _$litType$: s } = t, r = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el =
|
|
371
|
+
const { values: e, _$litType$: s } = t, r = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = q.createElement(Kt(s.h, s.h[0]), this.options)), s);
|
|
372
372
|
if (this._$AH?._$AD === r) this._$AH.p(e);
|
|
373
373
|
else {
|
|
374
|
-
const o = new
|
|
375
|
-
o.p(e), this.T(
|
|
374
|
+
const o = new Te(r, this), n = o.u(this.options);
|
|
375
|
+
o.p(e), this.T(n), this._$AH = o;
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
_$AC(t) {
|
|
379
|
-
let e =
|
|
380
|
-
return e === void 0 &&
|
|
379
|
+
let e = Rt.get(t.strings);
|
|
380
|
+
return e === void 0 && Rt.set(t.strings, e = new q(t)), e;
|
|
381
381
|
}
|
|
382
382
|
k(t) {
|
|
383
|
-
|
|
383
|
+
ut(this._$AH) || (this._$AH = [], this._$AR());
|
|
384
384
|
const e = this._$AH;
|
|
385
385
|
let s, r = 0;
|
|
386
|
-
for (const o of t) r === e.length ? e.push(s = new
|
|
386
|
+
for (const o of t) r === e.length ? e.push(s = new V(this.O(G()), this.O(G()), this, this.options)) : s = e[r], s._$AI(o), r++;
|
|
387
387
|
r < e.length && (this._$AR(s && s._$AB.nextSibling, r), e.length = r);
|
|
388
388
|
}
|
|
389
389
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
390
390
|
for (this._$AP?.(!1, !0, e); t !== this._$AB; ) {
|
|
391
|
-
const s =
|
|
392
|
-
|
|
391
|
+
const s = It(t).nextSibling;
|
|
392
|
+
It(t).remove(), t = s;
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
395
|
setConnected(t) {
|
|
396
396
|
this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
|
-
class
|
|
399
|
+
class rt {
|
|
400
400
|
get tagName() {
|
|
401
401
|
return this.element.tagName;
|
|
402
402
|
}
|
|
@@ -408,20 +408,20 @@ class tt {
|
|
|
408
408
|
}
|
|
409
409
|
_$AI(t, e = this, s, r) {
|
|
410
410
|
const o = this.strings;
|
|
411
|
-
let
|
|
412
|
-
if (o === void 0) t =
|
|
411
|
+
let n = !1;
|
|
412
|
+
if (o === void 0) t = F(this, t, e, 0), n = !j(t) || t !== this._$AH && t !== M, n && (this._$AH = t);
|
|
413
413
|
else {
|
|
414
|
-
const
|
|
415
|
-
let
|
|
416
|
-
for (t = o[0],
|
|
414
|
+
const i = t;
|
|
415
|
+
let l, c;
|
|
416
|
+
for (t = o[0], l = 0; l < o.length - 1; l++) c = F(this, i[s + l], e, l), c === M && (c = this._$AH[l]), n ||= !j(c) || c !== this._$AH[l], c === m ? t = m : t !== m && (t += (c ?? "") + o[l + 1]), this._$AH[l] = c;
|
|
417
417
|
}
|
|
418
|
-
|
|
418
|
+
n && !r && this.j(t);
|
|
419
419
|
}
|
|
420
420
|
j(t) {
|
|
421
421
|
t === m ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
|
-
class
|
|
424
|
+
class Ie extends rt {
|
|
425
425
|
constructor() {
|
|
426
426
|
super(...arguments), this.type = 3;
|
|
427
427
|
}
|
|
@@ -429,7 +429,7 @@ class ve extends tt {
|
|
|
429
429
|
this.element[this.name] = t === m ? void 0 : t;
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
|
-
class
|
|
432
|
+
class Ce extends rt {
|
|
433
433
|
constructor() {
|
|
434
434
|
super(...arguments), this.type = 4;
|
|
435
435
|
}
|
|
@@ -437,12 +437,12 @@ class $e extends tt {
|
|
|
437
437
|
this.element.toggleAttribute(this.name, !!t && t !== m);
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
class
|
|
440
|
+
class Ee extends rt {
|
|
441
441
|
constructor(t, e, s, r, o) {
|
|
442
442
|
super(t, e, s, r, o), this.type = 5;
|
|
443
443
|
}
|
|
444
444
|
_$AI(t, e = this) {
|
|
445
|
-
if ((t =
|
|
445
|
+
if ((t = F(this, t, e, 0) ?? m) === M) return;
|
|
446
446
|
const s = this._$AH, r = t === m && s !== m || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== m && (s === m || r);
|
|
447
447
|
r && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
448
448
|
}
|
|
@@ -450,7 +450,7 @@ class be extends tt {
|
|
|
450
450
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
|
-
class
|
|
453
|
+
class Pe {
|
|
454
454
|
constructor(t, e, s) {
|
|
455
455
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
|
|
456
456
|
}
|
|
@@ -458,22 +458,22 @@ class ye {
|
|
|
458
458
|
return this._$AM._$AU;
|
|
459
459
|
}
|
|
460
460
|
_$AI(t) {
|
|
461
|
-
|
|
461
|
+
F(this, t);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
const
|
|
464
|
+
const De = mt.litHtmlPolyfillSupport;
|
|
465
|
+
De?.(q, V), (mt.litHtmlVersions ??= []).push("3.3.3");
|
|
466
|
+
const Be = (a, t, e) => {
|
|
467
467
|
const s = e?.renderBefore ?? t;
|
|
468
468
|
let r = s._$litPart$;
|
|
469
469
|
if (r === void 0) {
|
|
470
470
|
const o = e?.renderBefore ?? null;
|
|
471
|
-
s._$litPart$ = r = new
|
|
471
|
+
s._$litPart$ = r = new V(t.insertBefore(G(), o), o, void 0, e ?? {});
|
|
472
472
|
}
|
|
473
473
|
return r._$AI(a), r;
|
|
474
474
|
};
|
|
475
|
-
const
|
|
476
|
-
class
|
|
475
|
+
const ft = globalThis;
|
|
476
|
+
class N extends z {
|
|
477
477
|
constructor() {
|
|
478
478
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
479
479
|
}
|
|
@@ -483,7 +483,7 @@ class E extends I {
|
|
|
483
483
|
}
|
|
484
484
|
update(t) {
|
|
485
485
|
const e = this.render();
|
|
486
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do =
|
|
486
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Be(e, this.renderRoot, this.renderOptions);
|
|
487
487
|
}
|
|
488
488
|
connectedCallback() {
|
|
489
489
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -492,130 +492,131 @@ class E extends I {
|
|
|
492
492
|
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
493
493
|
}
|
|
494
494
|
render() {
|
|
495
|
-
return
|
|
495
|
+
return M;
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
|
-
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
(
|
|
502
|
-
const
|
|
503
|
-
function
|
|
498
|
+
N._$litElement$ = !0, N.finalized = !0, ft.litElementHydrateSupport?.({ LitElement: N });
|
|
499
|
+
const ze = ft.litElementPolyfillSupport;
|
|
500
|
+
ze?.({ LitElement: N });
|
|
501
|
+
(ft.litElementVersions ??= []).push("4.2.2");
|
|
502
|
+
const Re = 50;
|
|
503
|
+
function Ne(a = {}) {
|
|
504
504
|
const t = Object.entries(a).filter(([, s]) => s != null && s !== "");
|
|
505
505
|
if (!t.length) return "";
|
|
506
506
|
const e = new URLSearchParams();
|
|
507
507
|
return t.forEach(([s, r]) => e.set(s, String(r))), `?${e.toString()}`;
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function Me({ baseUrl: a, token: t = "", fetchFn: e } = {}) {
|
|
510
510
|
if (!a) throw new Error("createClient requires a baseUrl");
|
|
511
|
-
const s = a.replace(/\/+$/, ""), r = e || ((...
|
|
512
|
-
async function o(
|
|
513
|
-
const
|
|
514
|
-
t && (
|
|
515
|
-
const c = await r(`${s}${
|
|
511
|
+
const s = a.replace(/\/+$/, ""), r = e || ((...i) => fetch(...i));
|
|
512
|
+
async function o(i) {
|
|
513
|
+
const l = { Accept: "application/json" };
|
|
514
|
+
t && (l.Authorization = `Bearer ${t}`);
|
|
515
|
+
const c = await r(`${s}${i}`, { headers: l });
|
|
516
516
|
if (!c.ok) {
|
|
517
|
-
const
|
|
518
|
-
throw
|
|
517
|
+
const d = new Error(`api-hsot ${c.status} on ${i}`);
|
|
518
|
+
throw d.status = c.status, d;
|
|
519
519
|
}
|
|
520
520
|
return c.json();
|
|
521
521
|
}
|
|
522
|
-
async function i
|
|
522
|
+
async function n(i, l = {}) {
|
|
523
523
|
const c = [];
|
|
524
|
-
let
|
|
525
|
-
for (let p = 0; p <
|
|
526
|
-
const
|
|
527
|
-
if (c.push(...
|
|
524
|
+
let d = null;
|
|
525
|
+
for (let p = 0; p < Re; p += 1) {
|
|
526
|
+
const u = Ne(d ? { ...l, cursor: d } : l), f = await o(`${i}${u}`);
|
|
527
|
+
if (c.push(...f.items || []), d = f.nextCursor || null, !d) break;
|
|
528
528
|
}
|
|
529
529
|
return { items: c, total: c.length, nextCursor: null };
|
|
530
530
|
}
|
|
531
531
|
return {
|
|
532
|
-
listSchools: (
|
|
533
|
-
getSchool: (
|
|
534
|
-
listTeams: (
|
|
535
|
-
getTeam: (
|
|
536
|
-
listConferences: (
|
|
537
|
-
listPlayers: (
|
|
538
|
-
listRosters: (
|
|
539
|
-
listGames: (
|
|
540
|
-
getGame: (
|
|
541
|
-
listTournaments: (
|
|
542
|
-
listSeedings: (
|
|
543
|
-
|
|
532
|
+
listSchools: (i) => n("/schools", i),
|
|
533
|
+
getSchool: (i) => o(`/schools/${i}`),
|
|
534
|
+
listTeams: (i) => n("/teams", i),
|
|
535
|
+
getTeam: (i) => o(`/teams/${i}`),
|
|
536
|
+
listConferences: (i) => n("/conferences", i),
|
|
537
|
+
listPlayers: (i) => n("/players", i),
|
|
538
|
+
listRosters: (i) => n("/rosters", i),
|
|
539
|
+
listGames: (i) => n("/games", i),
|
|
540
|
+
getGame: (i) => o(`/games/${i}`),
|
|
541
|
+
listTournaments: (i) => n("/tournaments", i),
|
|
542
|
+
listSeedings: (i, l) => n(`/tournaments/${i}/seedings`, l),
|
|
543
|
+
listEdges: (i, l) => n(`/tournaments/${i}/edges`, l),
|
|
544
|
+
listRankings: (i) => n("/rankings", i),
|
|
544
545
|
listSports: () => o("/sports")
|
|
545
546
|
};
|
|
546
547
|
}
|
|
547
|
-
const
|
|
548
|
+
const ct = {
|
|
548
549
|
game: "/{sport}/game/{id}/",
|
|
549
550
|
school: "/school/{id}/",
|
|
550
551
|
section: "/{sport}/{view}/"
|
|
551
552
|
};
|
|
552
|
-
function
|
|
553
|
+
function v(a, t) {
|
|
553
554
|
return String(a).replace(/\{(\w+)\}/g, (e, s) => t[s] !== void 0 && t[s] !== null ? String(t[s]) : e);
|
|
554
555
|
}
|
|
555
|
-
function
|
|
556
|
+
function O(a) {
|
|
556
557
|
return {
|
|
557
|
-
game: a.getAttribute("game-href") ||
|
|
558
|
-
school: a.getAttribute("school-href") ||
|
|
559
|
-
section: a.getAttribute("section-href") ||
|
|
558
|
+
game: a.getAttribute("game-href") || ct.game,
|
|
559
|
+
school: a.getAttribute("school-href") || ct.school,
|
|
560
|
+
section: a.getAttribute("section-href") || ct.section
|
|
560
561
|
};
|
|
561
562
|
}
|
|
562
|
-
const
|
|
563
|
-
function
|
|
563
|
+
const B = (a) => a ? a.charAt(0).toUpperCase() + a.slice(1) : "";
|
|
564
|
+
function w(a, t) {
|
|
564
565
|
if (!a) return "TBD";
|
|
565
566
|
const [e, s, r] = String(a).split("-").map(Number);
|
|
566
567
|
return !e || !s || !r ? "TBD" : new Date(e, s - 1, r).toLocaleDateString("en-US", t || { weekday: "short", month: "short", day: "numeric" });
|
|
567
568
|
}
|
|
568
|
-
function
|
|
569
|
+
function gt(a) {
|
|
569
570
|
if (!a) return "";
|
|
570
571
|
const [t, e] = String(a).split(":").map(Number);
|
|
571
572
|
if (Number.isNaN(t)) return "";
|
|
572
573
|
const s = t >= 12 ? "PM" : "AM";
|
|
573
574
|
return `${(t + 11) % 12 + 1}:${String(e || 0).padStart(2, "0")} ${s}`;
|
|
574
575
|
}
|
|
575
|
-
function
|
|
576
|
+
function Fe(a) {
|
|
576
577
|
return a ? `${Math.floor(a / 12)}-${a % 12}` : "·";
|
|
577
578
|
}
|
|
578
|
-
function
|
|
579
|
+
function Oe(a) {
|
|
579
580
|
return (Array.isArray(a?.positions) ? a.positions : String(a?.position ?? "").split(/[/,]/)).map((e) => String(e ?? "").trim()).filter(Boolean).join("/");
|
|
580
581
|
}
|
|
581
|
-
function
|
|
582
|
+
function Y(a = /* @__PURE__ */ new Date()) {
|
|
582
583
|
const t = a.getFullYear();
|
|
583
584
|
return a.getMonth() >= 6 ? `${t}-${t + 1}` : `${t - 1}-${t}`;
|
|
584
585
|
}
|
|
585
|
-
function
|
|
586
|
+
function vt(a = /* @__PURE__ */ new Date()) {
|
|
586
587
|
const t = (e) => String(e).padStart(2, "0");
|
|
587
588
|
return `${a.getFullYear()}-${t(a.getMonth() + 1)}-${t(a.getDate())}`;
|
|
588
589
|
}
|
|
589
|
-
function
|
|
590
|
+
function Ue(a, t = vt()) {
|
|
590
591
|
const e = [...new Set((a || []).filter(Boolean))].sort();
|
|
591
592
|
if (!e.length || e.includes(t)) return t;
|
|
592
593
|
const s = e.filter((r) => r < t);
|
|
593
594
|
return s.length ? s[s.length - 1] : e[0];
|
|
594
595
|
}
|
|
595
|
-
function
|
|
596
|
+
function $t(a) {
|
|
596
597
|
return a ? (a.abbr || a.name || "?").slice(0, 4).toUpperCase() : "?";
|
|
597
598
|
}
|
|
598
|
-
function
|
|
599
|
+
function X(a) {
|
|
599
600
|
if (!a || !/^#[0-9a-fA-F]{6}$/.test(a)) return "#FFFFFF";
|
|
600
601
|
const t = parseInt(a.slice(1), 16), e = t >> 16 & 255, s = t >> 8 & 255, r = t & 255;
|
|
601
602
|
return 0.299 * e + 0.587 * s + 0.114 * r > 150 ? "#0F1B33" : "#FFFFFF";
|
|
602
603
|
}
|
|
603
|
-
const
|
|
604
|
+
const He = (a) => {
|
|
604
605
|
const t = ["th", "st", "nd", "rd"], e = a % 100;
|
|
605
606
|
return a + (t[(e - 20) % 10] || t[e] || t[0]);
|
|
606
607
|
};
|
|
607
|
-
function
|
|
608
|
+
function Nt(a, t) {
|
|
608
609
|
const e = (o) => {
|
|
609
|
-
const
|
|
610
|
-
return
|
|
610
|
+
const n = /^\d+/.exec(String(o ?? ""));
|
|
611
|
+
return n ? Number(n[0]) : null;
|
|
611
612
|
}, s = e(a), r = e(t);
|
|
612
613
|
return s !== null && r !== null && s !== r ? r - s : s !== null && r === null ? -1 : s === null && r !== null ? 1 : String(a ?? "").localeCompare(String(t ?? ""), "en", { sensitivity: "base" });
|
|
613
614
|
}
|
|
614
|
-
function
|
|
615
|
+
function Le(a, t) {
|
|
615
616
|
const e = (s) => String(s?.name ?? s ?? "");
|
|
616
617
|
return e(a).localeCompare(e(t), "en", { numeric: !0, sensitivity: "base" });
|
|
617
618
|
}
|
|
618
|
-
function
|
|
619
|
+
function Qt(a) {
|
|
619
620
|
if (a.state === "live") {
|
|
620
621
|
const t = [a.period, a.clock].filter(Boolean).join(" ");
|
|
621
622
|
return { kind: "live", label: t ? `Live · ${t}` : "Live" };
|
|
@@ -624,9 +625,9 @@ function Wt(a) {
|
|
|
624
625
|
const t = [];
|
|
625
626
|
return a.finish === "overtime" && t.push("OT"), a.finish === "shootout" && t.push("PK-SO"), a.forfeit && a.forfeit !== "none" && t.push("Forfeit"), { kind: "final", label: `Final${t.length ? ` · ${t.join(" · ")}` : ""}` };
|
|
626
627
|
}
|
|
627
|
-
return a.state === "postponed" ? { kind: "warn", label: "Postponed" } : a.state === "canceled" ? { kind: "warn", label: "Canceled" } : { kind: "sched", label: `${
|
|
628
|
+
return a.state === "postponed" ? { kind: "warn", label: "Postponed" } : a.state === "canceled" ? { kind: "warn", label: "Canceled" } : { kind: "sched", label: `${w(a.date, { month: "short", day: "numeric" })} · ${gt(a.time)}`.replace(/ · $/, "") };
|
|
628
629
|
}
|
|
629
|
-
const
|
|
630
|
+
const Ge = /* @__PURE__ */ new Set(["game", "story", "page", "forum", "video", "gallery"]);
|
|
630
631
|
function _(a) {
|
|
631
632
|
let t = String(a || "").replace(/^[a-z][a-z0-9+.-]*:\/\/[^/#?]*/i, "");
|
|
632
633
|
const e = t.indexOf("#");
|
|
@@ -635,43 +636,43 @@ function _(a) {
|
|
|
635
636
|
let r = t.split("?")[0] + s;
|
|
636
637
|
return r = r.replace(/([^:])\/{2,}/g, "$1/").replace(/^\/{2,}/, "/"), r = r.replace(/^\/(?=#)/, ""), r.length > 1 && (r = r.replace(/\/+$/, "")), r.toLowerCase();
|
|
637
638
|
}
|
|
638
|
-
function
|
|
639
|
+
function Zt() {
|
|
639
640
|
const a = globalThis.location;
|
|
640
641
|
if (!a) return "";
|
|
641
642
|
const t = (a.hash || "").startsWith("#/") ? a.hash : "";
|
|
642
643
|
return _((a.pathname || "") + t);
|
|
643
644
|
}
|
|
644
|
-
function
|
|
645
|
+
function je(a, t, e) {
|
|
645
646
|
if (!e) return null;
|
|
646
647
|
const s = _(a);
|
|
647
648
|
if (!s) return null;
|
|
648
|
-
const r = _(
|
|
649
|
+
const r = _(v(t.game, { sport: e, id: "" })), o = _(v(t.school, { id: "" }));
|
|
649
650
|
if (s === r || s.startsWith(`${r}/`) || s === o || s.startsWith(`${o}/`)) return null;
|
|
650
|
-
const
|
|
651
|
-
if (s ===
|
|
652
|
-
if (!s.startsWith(`${
|
|
653
|
-
const
|
|
654
|
-
return
|
|
655
|
-
}
|
|
656
|
-
function
|
|
657
|
-
const s = (
|
|
651
|
+
const n = _(v(t.section, { sport: e, view: "" }));
|
|
652
|
+
if (s === n) return "";
|
|
653
|
+
if (!s.startsWith(`${n}/`)) return null;
|
|
654
|
+
const i = s.slice(n.length + 1), l = i.split("/");
|
|
655
|
+
return l.length > 2 || l.some((c) => !/^[a-z][a-z-]*$/.test(c)) || Ge.has(l[0]) ? null : i;
|
|
656
|
+
}
|
|
657
|
+
function qe(a, t, e) {
|
|
658
|
+
const s = (n) => v(e.section, { sport: a, view: n }).replace(/([^:])\/{2,}/g, "$1/"), o = new Set((t || []).map((n) => n && n.gender).filter((n) => n === "boys" || n === "girls")).size === 2 ? [
|
|
658
659
|
{ label: "Boys Standings", href: s("boys/standings") },
|
|
659
660
|
{ label: "Girls Standings", href: s("girls/standings") }
|
|
660
661
|
] : [{ label: "Standings", href: s("standings") }];
|
|
661
662
|
return [
|
|
662
|
-
{ label: `${
|
|
663
|
+
{ label: `${B(a)} Home`, href: s("") },
|
|
663
664
|
{ label: "Scores/Schedule", href: s("scores") },
|
|
664
665
|
{ label: "Playoff Brackets", href: s("brackets") },
|
|
665
666
|
...o,
|
|
666
667
|
{ label: "Polls & Rankings", href: s("rankings") }
|
|
667
668
|
];
|
|
668
669
|
}
|
|
669
|
-
function
|
|
670
|
+
function We(a, t = Zt()) {
|
|
670
671
|
const e = _(t);
|
|
671
672
|
for (const s of a.querySelectorAll(':scope > a[slot="nav"]'))
|
|
672
673
|
e && _(s.getAttribute("href")) === e ? s.setAttribute("aria-current", "page") : s.removeAttribute("aria-current");
|
|
673
674
|
}
|
|
674
|
-
class
|
|
675
|
+
class b extends N {
|
|
675
676
|
static properties = {
|
|
676
677
|
api: { type: String },
|
|
677
678
|
refreshInterval: { type: Number, attribute: "refresh-interval" },
|
|
@@ -690,7 +691,7 @@ class w extends E {
|
|
|
690
691
|
this._client = t, this.isConnected && this.load();
|
|
691
692
|
}
|
|
692
693
|
get client() {
|
|
693
|
-
return this._client ? this._client : this.api ?
|
|
694
|
+
return this._client ? this._client : this.api ? Me({ baseUrl: this.api }) : null;
|
|
694
695
|
}
|
|
695
696
|
connectedCallback() {
|
|
696
697
|
super.connectedCallback(), this._setupInterval();
|
|
@@ -702,7 +703,7 @@ class w extends E {
|
|
|
702
703
|
this.load();
|
|
703
704
|
}
|
|
704
705
|
updated(t) {
|
|
705
|
-
t.has("api") && t.get("api") !== void 0 && t.get("api") !== this.api && this.load(), t.has("refreshInterval") && this._setupInterval(),
|
|
706
|
+
t.has("api") && t.get("api") !== void 0 && t.get("api") !== this.api && this.load(), t.has("refreshInterval") && this._setupInterval(), We(this);
|
|
706
707
|
}
|
|
707
708
|
async load() {
|
|
708
709
|
const t = this.client;
|
|
@@ -731,13 +732,13 @@ class w extends E {
|
|
|
731
732
|
this._refreshId && (clearInterval(this._refreshId), this._refreshId = null);
|
|
732
733
|
}
|
|
733
734
|
render() {
|
|
734
|
-
return this.error === "not-configured" ?
|
|
735
|
+
return this.error === "not-configured" ? h`<div class="error">This component needs an <code>api</code> attribute (the api-hsot public read-surface base URL) or an injected client.</div>` : this.error ? h`<div class="error">Unable to load right now. <button class="chip" @click=${() => this.load()}>Retry</button></div>` : this.data ? this.renderView() : h`<div class="loading" role="status">Loading…</div>`;
|
|
735
736
|
}
|
|
736
737
|
renderView() {
|
|
737
|
-
return
|
|
738
|
+
return h``;
|
|
738
739
|
}
|
|
739
740
|
}
|
|
740
|
-
const
|
|
741
|
+
const $ = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Ve = y`
|
|
741
742
|
:host {
|
|
742
743
|
--hsot-red: var(--color-red, #D1232A);
|
|
743
744
|
--hsot-red-deep: var(--color-red-dark, #951C21);
|
|
@@ -775,7 +776,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Fe = b`
|
|
|
775
776
|
outline-offset: 1px;
|
|
776
777
|
}
|
|
777
778
|
.mut { color: var(--hsot-gray-5); }
|
|
778
|
-
`,
|
|
779
|
+
`, Ye = y`
|
|
779
780
|
.band { background: var(--hsot-white); color: var(--hsot-black); }
|
|
780
781
|
.band .inner { max-width: 1366px; margin: 0 auto; padding: 1.1rem 1.25rem 0; }
|
|
781
782
|
.band h1, .band h2.bandtitle {
|
|
@@ -824,7 +825,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Fe = b`
|
|
|
824
825
|
@media (max-width: 720px) {
|
|
825
826
|
.band h1, .band h2.bandtitle, .band.section h1, .band.section h2.bandtitle { font-size: 1.8rem; }
|
|
826
827
|
}
|
|
827
|
-
`,
|
|
828
|
+
`, Ke = y`
|
|
828
829
|
.view { max-width: 1366px; margin: 0 auto; padding: 1.25rem; box-sizing: border-box; }
|
|
829
830
|
/* Optional right rail (slot="rail" light-DOM children): a divided 300px
|
|
830
831
|
column on desktop, stacked under the view content on smaller screens. */
|
|
@@ -888,7 +889,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Fe = b`
|
|
|
888
889
|
.error { padding: 1.2rem 1rem; color: var(--hsot-red-deep); font-size: 0.9rem; }
|
|
889
890
|
.note { font-size: 0.8125rem; color: var(--hsot-gray-5); margin: 0.6rem 0 0; }
|
|
890
891
|
.loading { padding: 1.2rem; color: var(--hsot-gray-5); font-family: var(--hsot-heading-font); }
|
|
891
|
-
`,
|
|
892
|
+
`, Qe = y`
|
|
892
893
|
.pill {
|
|
893
894
|
display: inline-block; font-family: var(--hsot-heading-font); font-weight: 700;
|
|
894
895
|
font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em;
|
|
@@ -903,7 +904,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Fe = b`
|
|
|
903
904
|
.pill.champ { background: var(--hsot-straw); color: #6b5900; }
|
|
904
905
|
@keyframes hsot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
|
|
905
906
|
@media (prefers-reduced-motion: reduce) { .pill.live { animation: none; } }
|
|
906
|
-
`,
|
|
907
|
+
`, Ze = y`
|
|
907
908
|
.tablewrap { overflow-x: auto; }
|
|
908
909
|
table.data { font-family: var(--hsot-heading-font); font-size: 14px; border-collapse: collapse; width: 100%; }
|
|
909
910
|
table.data th {
|
|
@@ -921,7 +922,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Fe = b`
|
|
|
921
922
|
table.data tbody tr.rowlink:hover { background: var(--hsot-gray-1); }
|
|
922
923
|
table.data td.teamcell a { color: inherit; text-decoration: none; font-weight: 500; }
|
|
923
924
|
table.data td.teamcell a:hover { text-decoration: underline; }
|
|
924
|
-
`,
|
|
925
|
+
`, Je = y`
|
|
925
926
|
.swatch {
|
|
926
927
|
display: inline-flex; align-items: center; justify-content: center;
|
|
927
928
|
width: 26px; height: 26px; border-radius: 50%;
|
|
@@ -945,7 +946,7 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Fe = b`
|
|
|
945
946
|
.dot.W { background: var(--hsot-win); }
|
|
946
947
|
.dot.L { background: var(--hsot-loss); }
|
|
947
948
|
.dot.T { background: var(--hsot-tie); }
|
|
948
|
-
`,
|
|
949
|
+
`, Xe = y`
|
|
949
950
|
ul.gamelist { list-style: none; margin: 0; padding: 0; }
|
|
950
951
|
.gamelist li {
|
|
951
952
|
display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 1rem;
|
|
@@ -995,74 +996,74 @@ const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), Fe = b`
|
|
|
995
996
|
.gamelist .ff { color: var(--hsot-gray-5); font-size: 0.78rem; font-style: italic; }
|
|
996
997
|
.gamelist .where { color: var(--hsot-gray-5); font-size: 0.78rem; }
|
|
997
998
|
.gamelist a.box { font-size: 0.78rem; }
|
|
998
|
-
`,
|
|
999
|
-
function
|
|
999
|
+
`, U = [Ve, Ye, Ke, Qe, Ze, Je, Xe];
|
|
1000
|
+
function ot(a) {
|
|
1000
1001
|
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";
|
|
1001
1002
|
}
|
|
1002
|
-
function
|
|
1003
|
+
function ts(a) {
|
|
1003
1004
|
return a && (a.forfeit === "home" || a.forfeit === "away") ? a.forfeit : null;
|
|
1004
1005
|
}
|
|
1005
|
-
function
|
|
1006
|
-
const e = {}, s = (o) => (e[o] = e[o] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, e[o]), r = a.filter((o) => o.state === "final" && o.gameType !== "scrimmage" && !0).sort((o,
|
|
1006
|
+
function K(a, t) {
|
|
1007
|
+
const e = {}, s = (o) => (e[o] = e[o] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, e[o]), r = a.filter((o) => o.state === "final" && o.gameType !== "scrimmage" && !0).sort((o, n) => String(o.date).localeCompare(String(n.date)));
|
|
1007
1008
|
for (const o of r) {
|
|
1008
|
-
const
|
|
1009
|
-
for (const
|
|
1010
|
-
const c =
|
|
1009
|
+
const n = ot(o), i = o.gameType === "conference";
|
|
1010
|
+
for (const l of ["home", "away"]) {
|
|
1011
|
+
const c = l === "home" ? o.homeTeamId : o.awayTeamId;
|
|
1011
1012
|
if (!c) continue;
|
|
1012
|
-
const
|
|
1013
|
-
|
|
1014
|
-
let
|
|
1015
|
-
|
|
1013
|
+
const d = s(c), p = l === "home" ? o.homeScore : o.awayScore, u = l === "home" ? o.awayScore : o.homeScore;
|
|
1014
|
+
d.pf += p, d.pa += u;
|
|
1015
|
+
let f = "T";
|
|
1016
|
+
n === "tie" ? (d.t += 1, i && (d.ct += 1)) : n === l ? (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: p, their: u, opp: l === "home" ? o.awayTeamId : o.homeTeamId, conf: i });
|
|
1016
1017
|
}
|
|
1017
1018
|
}
|
|
1018
1019
|
return e;
|
|
1019
1020
|
}
|
|
1020
|
-
function
|
|
1021
|
+
function nt(a) {
|
|
1021
1022
|
if (!a || !a.length) return "";
|
|
1022
1023
|
const t = a[a.length - 1].mark;
|
|
1023
1024
|
let e = 0;
|
|
1024
1025
|
for (let s = a.length - 1; s >= 0 && a[s].mark === t; s -= 1) e += 1;
|
|
1025
1026
|
return t + e;
|
|
1026
1027
|
}
|
|
1027
|
-
const
|
|
1028
|
+
const Mt = (a, t, e) => {
|
|
1028
1029
|
const s = a + t + e;
|
|
1029
1030
|
return s ? (a + e / 2) / s : 0;
|
|
1030
|
-
},
|
|
1031
|
-
function
|
|
1031
|
+
}, Ft = (a) => a.toFixed(3).replace("0.", ".");
|
|
1032
|
+
function k(a, t = !1) {
|
|
1032
1033
|
if (!a) return "0-0";
|
|
1033
1034
|
const e = t ? a.cw : a.w, s = t ? a.cl : a.l, r = t ? a.ct : a.t;
|
|
1034
1035
|
return `${e}-${s}${r ? `-${r}` : ""}`;
|
|
1035
1036
|
}
|
|
1036
|
-
function
|
|
1037
|
+
function Jt(a, t) {
|
|
1037
1038
|
return a.map((e) => {
|
|
1038
1039
|
const s = t[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] };
|
|
1039
|
-
return { team: e, rec: s, confPct:
|
|
1040
|
+
return { team: e, rec: s, confPct: Mt(s.cw, s.cl, s.ct), overallPct: Mt(s.w, s.l, s.t) };
|
|
1040
1041
|
}).sort((e, s) => s.confPct - e.confPct || s.overallPct - e.overallPct || s.rec.pf - s.rec.pa - (e.rec.pf - e.rec.pa));
|
|
1041
1042
|
}
|
|
1042
|
-
function
|
|
1043
|
+
function bt(a, t) {
|
|
1043
1044
|
return a.filter((e) => (e.homeTeamId === t || e.awayTeamId === t) && (e.state === "scheduled" || e.state === "live") && e.gameType !== "scrimmage").sort((e, s) => String(e.date).localeCompare(String(s.date)))[0] || null;
|
|
1044
1045
|
}
|
|
1045
|
-
function
|
|
1046
|
+
function Ot(a, t) {
|
|
1046
1047
|
const e = a[t];
|
|
1047
1048
|
return e && e.results.length ? e.results[e.results.length - 1] : null;
|
|
1048
1049
|
}
|
|
1049
|
-
function
|
|
1050
|
+
function yt(a, t, e, s, r) {
|
|
1050
1051
|
const o = t[e];
|
|
1051
1052
|
if (!o) return null;
|
|
1052
|
-
const
|
|
1053
|
-
for (const
|
|
1054
|
-
if (
|
|
1055
|
-
const c =
|
|
1056
|
-
(!
|
|
1053
|
+
const n = /* @__PURE__ */ new Map();
|
|
1054
|
+
for (const l of a || []) {
|
|
1055
|
+
if (l.sport !== s || r && l.effectiveDate > r || l.gender && o.gender !== l.gender && o.gender !== "coed") continue;
|
|
1056
|
+
const c = l.gender || "", d = n.get(c);
|
|
1057
|
+
(!d || l.effectiveDate > d.effectiveDate) && n.set(c, l);
|
|
1057
1058
|
}
|
|
1058
|
-
let
|
|
1059
|
-
for (const
|
|
1060
|
-
const c = (
|
|
1061
|
-
c !== -1 && (!
|
|
1059
|
+
let i = null;
|
|
1060
|
+
for (const l of n.values()) {
|
|
1061
|
+
const c = (l.teamIds || []).indexOf(e);
|
|
1062
|
+
c !== -1 && (!i || l.effectiveDate > i.effectiveDate) && (i = { poll: l, rank: c + 1 });
|
|
1062
1063
|
}
|
|
1063
|
-
return
|
|
1064
|
+
return i ? i.rank : null;
|
|
1064
1065
|
}
|
|
1065
|
-
function
|
|
1066
|
+
function es(a, t, e) {
|
|
1066
1067
|
if (!a) return { kind: "none", delta: 0 };
|
|
1067
1068
|
const s = (a.teamIds || []).indexOf(e) + 1;
|
|
1068
1069
|
if (!s) return { kind: "none", delta: 0 };
|
|
@@ -1072,100 +1073,100 @@ function We(a, t, e) {
|
|
|
1072
1073
|
const o = r - s;
|
|
1073
1074
|
return o > 0 ? { kind: "up", delta: o } : o < 0 ? { kind: "down", delta: -o } : { kind: "same", delta: 0 };
|
|
1074
1075
|
}
|
|
1075
|
-
function
|
|
1076
|
+
function ss(a) {
|
|
1076
1077
|
return /^https?:\/\//i.test(String(a || ""));
|
|
1077
1078
|
}
|
|
1078
|
-
function
|
|
1079
|
-
if (!
|
|
1079
|
+
function Xt(a, { w: t, h: e } = {}) {
|
|
1080
|
+
if (!ss(a)) return "";
|
|
1080
1081
|
const s = [];
|
|
1081
1082
|
t && s.push(`w=${Math.max(1, Math.round(t))}`), e && s.push(`h=${Math.max(1, Math.round(e))}`), s.push("f=webp");
|
|
1082
1083
|
const r = a.includes("?") ? "&" : "?";
|
|
1083
1084
|
return `${a}${r}${s.join("&")}`;
|
|
1084
1085
|
}
|
|
1085
|
-
function
|
|
1086
|
+
function tt(a, t) {
|
|
1086
1087
|
const e = t * 2;
|
|
1087
|
-
return
|
|
1088
|
+
return Xt(a?.logoAssetId, { w: e, h: e });
|
|
1088
1089
|
}
|
|
1089
|
-
function
|
|
1090
|
-
return
|
|
1090
|
+
function as(a, t) {
|
|
1091
|
+
return Xt(a?.photoAssetId, { w: t * 2 });
|
|
1091
1092
|
}
|
|
1092
|
-
function
|
|
1093
|
-
const o =
|
|
1094
|
-
return
|
|
1093
|
+
function it(a, t, { title: e, sub: s, teams: r }) {
|
|
1094
|
+
const o = Zt(), i = !!a.querySelector(':scope > a[slot="nav"]') || je(o, t.hrefs, t.sport) !== null;
|
|
1095
|
+
return h`
|
|
1095
1096
|
<div class="band section">
|
|
1096
1097
|
<div class="inner">
|
|
1097
1098
|
<h1>${e}</h1>
|
|
1098
|
-
${s ?
|
|
1099
|
+
${s ? h`<p class="sub">${s}</p>` : m}
|
|
1099
1100
|
</div>
|
|
1100
|
-
${
|
|
1101
|
-
<nav class="sectionnav" aria-label="${
|
|
1101
|
+
${i ? h`
|
|
1102
|
+
<nav class="sectionnav" aria-label="${B(t.sport)} section">
|
|
1102
1103
|
<div class="navrow">
|
|
1103
1104
|
<slot name="nav">
|
|
1104
|
-
${
|
|
1105
|
-
aria-current=${o && _(
|
|
1105
|
+
${qe(t.sport, r, t.hrefs).map((l) => h`<a href=${l.href}
|
|
1106
|
+
aria-current=${o && _(l.href) === o ? "page" : m}>${l.label}</a>`)}
|
|
1106
1107
|
</slot>
|
|
1107
1108
|
</div>
|
|
1108
1109
|
</nav>` : m}
|
|
1109
1110
|
</div>
|
|
1110
1111
|
`;
|
|
1111
1112
|
}
|
|
1112
|
-
const
|
|
1113
|
+
const C = (a, t) => {
|
|
1113
1114
|
const e = a.teamsById[t];
|
|
1114
1115
|
return e ? a.schoolsById[e.schoolId] : null;
|
|
1115
|
-
},
|
|
1116
|
-
function
|
|
1116
|
+
}, R = (a, t) => C(a, t)?.name || "TBD", et = (a, t) => C(a, t)?.abbr || "TBD";
|
|
1117
|
+
function E(a, t = 26) {
|
|
1117
1118
|
if (!a) return m;
|
|
1118
|
-
const e =
|
|
1119
|
+
const e = tt(a, t);
|
|
1119
1120
|
if (e)
|
|
1120
|
-
return
|
|
1121
|
+
return h`<img class="swatch logo" aria-hidden="true" alt="" loading="lazy"
|
|
1121
1122
|
src=${e} style="width:${t}px;height:${t}px" />`;
|
|
1122
|
-
const s = a.colorPrimary || "#030711", r =
|
|
1123
|
-
return
|
|
1123
|
+
const s = a.colorPrimary || "#030711", r = X(s);
|
|
1124
|
+
return h`<span class="swatch" aria-hidden="true"
|
|
1124
1125
|
style="width:${t}px;height:${t}px;background:${s};color:${r};font-size:${Math.max(8, t * 0.28)}px"
|
|
1125
|
-
>${
|
|
1126
|
+
>${$t(a)}</span>`;
|
|
1126
1127
|
}
|
|
1127
|
-
function
|
|
1128
|
-
const s =
|
|
1129
|
-
return s ?
|
|
1128
|
+
function wt(a, t, e) {
|
|
1129
|
+
const s = yt(a.rankings, a.teamsById, t, a.sport, e);
|
|
1130
|
+
return s ? h`<span class="rankbadge">#${s}</span>` : m;
|
|
1130
1131
|
}
|
|
1131
|
-
function
|
|
1132
|
-
const s =
|
|
1133
|
-
return s ?
|
|
1132
|
+
function st(a, t, e) {
|
|
1133
|
+
const s = C(a, t);
|
|
1134
|
+
return s ? h`${wt(a, t, e)}<a href=${v(a.hrefs.school, { id: s.id })}>${s.name}</a>` : h`<span class="mut">TBD</span>`;
|
|
1134
1135
|
}
|
|
1135
|
-
function
|
|
1136
|
+
function xt(a, t, e = 5) {
|
|
1136
1137
|
const s = a.records[t];
|
|
1137
|
-
if (!s || !s.results.length) return
|
|
1138
|
+
if (!s || !s.results.length) return h`<span class="mut">·</span>`;
|
|
1138
1139
|
const r = s.results.slice(-1 * e);
|
|
1139
|
-
return
|
|
1140
|
-
${r.map((o) =>
|
|
1141
|
-
title="${o.mark} ${o.my}-${o.their} vs ${
|
|
1142
|
-
href=${
|
|
1140
|
+
return h`<span class="dots" role="img" aria-label="last ${r.length} results">
|
|
1141
|
+
${r.map((o) => h`<a class="dot ${o.mark}"
|
|
1142
|
+
title="${o.mark} ${o.my}-${o.their} vs ${R(a, o.opp)}"
|
|
1143
|
+
href=${v(a.hrefs.game, { sport: a.sport, id: o.gameId })}>${o.mark}</a>`)}
|
|
1143
1144
|
</span>`;
|
|
1144
1145
|
}
|
|
1145
|
-
function
|
|
1146
|
-
return a.querySelector(':scope > [slot="rail"]') ?
|
|
1146
|
+
function P(a, t) {
|
|
1147
|
+
return a.querySelector(':scope > [slot="rail"]') ? h`<div class="view withrail">
|
|
1147
1148
|
<div class="viewmain">${t}</div>
|
|
1148
1149
|
<aside class="viewrail"><slot name="rail"></slot></aside>
|
|
1149
|
-
</div>` :
|
|
1150
|
+
</div>` : h`<div class="view">${t}</div>`;
|
|
1150
1151
|
}
|
|
1151
|
-
function
|
|
1152
|
+
function D(a) {
|
|
1152
1153
|
if (!a.promoImage) return m;
|
|
1153
|
-
const t =
|
|
1154
|
-
return
|
|
1154
|
+
const t = h`<img src=${a.promoImage} alt=${a.promoAlt || "Sponsor"}>`;
|
|
1155
|
+
return h`<div class="promo">${a.promoHref ? h`<a href=${a.promoHref} target="_blank" rel="sponsored noopener">${t}</a>` : t}</div>`;
|
|
1155
1156
|
}
|
|
1156
|
-
function
|
|
1157
|
-
const t =
|
|
1158
|
-
return
|
|
1157
|
+
function W(a) {
|
|
1158
|
+
const t = Qt(a);
|
|
1159
|
+
return h`<span class="pill ${t.kind}">${t.label}</span>`;
|
|
1159
1160
|
}
|
|
1160
|
-
function
|
|
1161
|
-
if (!t) return
|
|
1161
|
+
function te(a, t, e) {
|
|
1162
|
+
if (!t) return h`<span class="mut">·</span>`;
|
|
1162
1163
|
const s = t.homeTeamId === e ? t.awayTeamId : t.homeTeamId, r = t.homeTeamId === e ? "vs" : "at";
|
|
1163
|
-
return
|
|
1164
|
+
return h`${t.state === "live" ? h`<span class="pill live">Live</span> ` : h`${w(t.date, { month: "numeric", day: "numeric" })} `}${r} ${et(a, s)}`;
|
|
1164
1165
|
}
|
|
1165
|
-
class
|
|
1166
|
-
static styles =
|
|
1166
|
+
class ee extends b {
|
|
1167
|
+
static styles = U;
|
|
1167
1168
|
static properties = {
|
|
1168
|
-
...
|
|
1169
|
+
...b.properties,
|
|
1169
1170
|
sport: { type: String },
|
|
1170
1171
|
season: { type: String },
|
|
1171
1172
|
date: { type: String }
|
|
@@ -1181,57 +1182,57 @@ class Qt extends w {
|
|
|
1181
1182
|
this._datePinned = !!this.date;
|
|
1182
1183
|
}
|
|
1183
1184
|
async fetchData(t) {
|
|
1184
|
-
const e = this.season ||
|
|
1185
|
+
const e = this.season || Y(), [s, r, o, n, i] = await Promise.all([
|
|
1185
1186
|
t.listSchools(),
|
|
1186
1187
|
t.listTeams({ sport: this.sport }),
|
|
1187
1188
|
t.listConferences(),
|
|
1188
1189
|
t.listGames({ sport: this.sport, season: e }),
|
|
1189
1190
|
t.listRankings({ sport: this.sport })
|
|
1190
1191
|
]);
|
|
1191
|
-
return this._datePinned || (this.date =
|
|
1192
|
+
return this._datePinned || (this.date = Ue(n.items.map((l) => l.date)), this._datePinned = !0), {
|
|
1192
1193
|
season: e,
|
|
1193
1194
|
schools: s.items,
|
|
1194
1195
|
teams: r.items,
|
|
1195
1196
|
conferences: o.items,
|
|
1196
|
-
games:
|
|
1197
|
-
rankings:
|
|
1197
|
+
games: n.items,
|
|
1198
|
+
rankings: i.items
|
|
1198
1199
|
};
|
|
1199
1200
|
}
|
|
1200
1201
|
get ctx() {
|
|
1201
1202
|
return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
|
|
1202
|
-
teamsById:
|
|
1203
|
-
schoolsById:
|
|
1204
|
-
records:
|
|
1203
|
+
teamsById: $(this.data.teams),
|
|
1204
|
+
schoolsById: $(this.data.schools),
|
|
1205
|
+
records: K(this.data.games),
|
|
1205
1206
|
rankings: this.data.rankings,
|
|
1206
|
-
hrefs:
|
|
1207
|
+
hrefs: O(this),
|
|
1207
1208
|
sport: this.sport
|
|
1208
1209
|
}, this._ctxData = this.data), this._ctx;
|
|
1209
1210
|
}
|
|
1210
1211
|
renderView() {
|
|
1211
|
-
const t = this.ctx, e =
|
|
1212
|
-
const
|
|
1213
|
-
return
|
|
1214
|
-
},
|
|
1215
|
-
|
|
1216
|
-
const
|
|
1217
|
-
return
|
|
1218
|
-
const
|
|
1219
|
-
|
|
1220
|
-
}),
|
|
1221
|
-
${
|
|
1222
|
-
title:
|
|
1223
|
-
sub:
|
|
1212
|
+
const t = this.ctx, e = $(this.data.conferences), s = [...new Set(this.data.games.map((c) => c.date).filter(Boolean))].sort(), r = Number.MAX_SAFE_INTEGER, o = (c) => {
|
|
1213
|
+
const d = [c.awayTeamId, c.homeTeamId].map((p) => yt(t.rankings, t.teamsById, p, this.sport, c.date)).filter(Boolean);
|
|
1214
|
+
return d.length ? Math.min(...d) : r;
|
|
1215
|
+
}, n = this.data.games.filter((c) => c.date === this.date), i = new Map(n.map((c) => [c, o(c)]));
|
|
1216
|
+
n.sort((c, d) => (c.state === "live" ? 0 : 1) - (d.state === "live" ? 0 : 1) || i.get(c) - i.get(d));
|
|
1217
|
+
const l = /* @__PURE__ */ new Map();
|
|
1218
|
+
return n.forEach((c) => {
|
|
1219
|
+
const d = c.gameType === "conference" && c.conferenceId ? e[c.conferenceId]?.name || "Conference" : c.gameType === "playoff" ? "Playoffs" : c.gameType === "scrimmage" ? "Scrimmages" : "Nonconference";
|
|
1220
|
+
l.has(d) || l.set(d, []), l.get(d).push(c);
|
|
1221
|
+
}), h`
|
|
1222
|
+
${it(this, t, {
|
|
1223
|
+
title: h`${B(this.sport)} scores & schedules`,
|
|
1224
|
+
sub: h`${w(this.date, { weekday: "long", month: "long", day: "numeric", year: "numeric" })} · ${n.length} games`,
|
|
1224
1225
|
teams: this.data.teams
|
|
1225
1226
|
})}
|
|
1226
|
-
${
|
|
1227
|
-
${
|
|
1227
|
+
${P(this, h`
|
|
1228
|
+
${D(this)}
|
|
1228
1229
|
<div class="toolbar">
|
|
1229
1230
|
<label class="asof" for="datesel">Date</label>
|
|
1230
1231
|
<select id="datesel" @change=${(c) => {
|
|
1231
1232
|
this.date = c.target.value;
|
|
1232
1233
|
}}>
|
|
1233
|
-
${(s.includes(this.date) ? s : [...s, this.date].sort()).map((c) =>
|
|
1234
|
-
${
|
|
1234
|
+
${(s.includes(this.date) ? s : [...s, this.date].sort()).map((c) => h`<option value=${c} ?selected=${c === this.date}>
|
|
1235
|
+
${w(c, { weekday: "short", month: "short", day: "numeric" })}${c === vt() ? " · today" : ""}
|
|
1235
1236
|
</option>`)}
|
|
1236
1237
|
</select>
|
|
1237
1238
|
<button class="chip" ?disabled=${s.indexOf(this.date) <= 0}
|
|
@@ -1245,11 +1246,11 @@ class Qt extends w {
|
|
|
1245
1246
|
<span class="spacer"></span>
|
|
1246
1247
|
<span class="asof">Live games first · report a score to see it update here</span>
|
|
1247
1248
|
</div>
|
|
1248
|
-
${
|
|
1249
|
-
${[...
|
|
1249
|
+
${n.length ? m : h`<p class="empty">No ${this.sport} games on this date.</p>`}
|
|
1250
|
+
${[...l.entries()].map(([c, d]) => h`
|
|
1250
1251
|
<div class="section-title">${c}</div>
|
|
1251
1252
|
<div class="card"><ul class="gamelist">
|
|
1252
|
-
${
|
|
1253
|
+
${d.map((p) => this.renderGame(t, p))}
|
|
1253
1254
|
</ul></div>
|
|
1254
1255
|
`)}
|
|
1255
1256
|
`)}
|
|
@@ -1259,24 +1260,24 @@ class Qt extends w {
|
|
|
1259
1260
|
// a lone score column on the far right read as detached from the teams).
|
|
1260
1261
|
// Scheduled games carry their start time on the status pill alone.
|
|
1261
1262
|
renderGame(t, e) {
|
|
1262
|
-
const s = e.state === "final" || e.state === "live", r = (i, l
|
|
1263
|
-
return
|
|
1263
|
+
const s = e.state === "final" || e.state === "live", r = (n, i, l = m) => h`<span class="side">${st(t, n, e.date)}${s ? h`<span class="score">${i}</span>` : m}${l}</span>`, o = ts(e);
|
|
1264
|
+
return h`
|
|
1264
1265
|
<li>
|
|
1265
|
-
${
|
|
1266
|
-
<span class="opp matchup">${r(e.awayTeamId, e.awayScore,
|
|
1267
|
-
${o ?
|
|
1266
|
+
${W(e)}
|
|
1267
|
+
<span class="opp matchup">${r(e.awayTeamId, e.awayScore, h`<span class="at">at</span>`)}${r(e.homeTeamId, e.homeScore)}</span>
|
|
1268
|
+
${o ? h`<span class="ff">${R(t, o === "home" ? e.homeTeamId : e.awayTeamId)} forfeited</span>` : m}
|
|
1268
1269
|
<span class="where">${e.venue || ""}</span>
|
|
1269
|
-
${e.broadcast ?
|
|
1270
|
-
<a class="box" href=${
|
|
1270
|
+
${e.broadcast ? h`<span class="pill class">${e.broadcast}</span>` : m}
|
|
1271
|
+
<a class="box" href=${v(t.hrefs.game, { sport: this.sport, id: e.id })}>Box score →</a>
|
|
1271
1272
|
</li>
|
|
1272
1273
|
`;
|
|
1273
1274
|
}
|
|
1274
1275
|
}
|
|
1275
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores",
|
|
1276
|
-
class
|
|
1277
|
-
static styles =
|
|
1276
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores", ee);
|
|
1277
|
+
class se extends b {
|
|
1278
|
+
static styles = U;
|
|
1278
1279
|
static properties = {
|
|
1279
|
-
...
|
|
1280
|
+
...b.properties,
|
|
1280
1281
|
sport: { type: String },
|
|
1281
1282
|
season: { type: String },
|
|
1282
1283
|
classFilter: { state: !0 },
|
|
@@ -1286,7 +1287,7 @@ class Zt extends w {
|
|
|
1286
1287
|
super(), this.sport = "football", this.season = "", this.classFilter = "All", this.query = "";
|
|
1287
1288
|
}
|
|
1288
1289
|
async fetchData(t) {
|
|
1289
|
-
const e = this.season ||
|
|
1290
|
+
const e = this.season || Y(), [s, r, o, n, i] = await Promise.all([
|
|
1290
1291
|
t.listConferences({ active: !0 }),
|
|
1291
1292
|
t.listSchools(),
|
|
1292
1293
|
t.listTeams({ sport: this.sport }),
|
|
@@ -1298,33 +1299,33 @@ class Zt extends w {
|
|
|
1298
1299
|
conferences: s.items,
|
|
1299
1300
|
schools: r.items,
|
|
1300
1301
|
teams: o.items,
|
|
1301
|
-
games:
|
|
1302
|
-
rankings:
|
|
1302
|
+
games: n.items,
|
|
1303
|
+
rankings: i.items
|
|
1303
1304
|
};
|
|
1304
1305
|
}
|
|
1305
1306
|
get ctx() {
|
|
1306
1307
|
return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
|
|
1307
|
-
teamsById:
|
|
1308
|
-
schoolsById:
|
|
1309
|
-
records:
|
|
1308
|
+
teamsById: $(this.data.teams),
|
|
1309
|
+
schoolsById: $(this.data.schools),
|
|
1310
|
+
records: K(this.data.games),
|
|
1310
1311
|
rankings: this.data.rankings,
|
|
1311
|
-
hrefs:
|
|
1312
|
+
hrefs: O(this),
|
|
1312
1313
|
sport: this.sport
|
|
1313
1314
|
}, this._ctxData = this.data), this._ctx;
|
|
1314
1315
|
}
|
|
1315
1316
|
renderView() {
|
|
1316
|
-
const t = this.ctx, e = ["All", ...[...new Set(this.data.conferences.flatMap((r) => r.classifications || []))].sort(
|
|
1317
|
-
return
|
|
1318
|
-
${
|
|
1319
|
-
title:
|
|
1320
|
-
sub:
|
|
1317
|
+
const t = this.ctx, e = ["All", ...[...new Set(this.data.conferences.flatMap((r) => r.classifications || []))].sort(Nt)].slice(0, 9), s = this.data.conferences.filter((r) => r.active !== !1).filter((r) => this.classFilter === "All" || (r.classifications || []).includes(this.classFilter)).sort(Le);
|
|
1318
|
+
return h`
|
|
1319
|
+
${it(this, t, {
|
|
1320
|
+
title: h`${B(this.sport)} standings`,
|
|
1321
|
+
sub: h`${this.data.season} season · every conference, computed live from reported results`,
|
|
1321
1322
|
teams: this.data.teams
|
|
1322
1323
|
})}
|
|
1323
|
-
${
|
|
1324
|
-
${
|
|
1324
|
+
${P(this, h`
|
|
1325
|
+
${D(this)}
|
|
1325
1326
|
<div class="toolbar">
|
|
1326
1327
|
<div role="group" aria-label="Classification filter">
|
|
1327
|
-
${e.map((r) =>
|
|
1328
|
+
${e.map((r) => h`<button class="chip ${this.classFilter === r ? "on" : ""}"
|
|
1328
1329
|
@click=${() => {
|
|
1329
1330
|
this.classFilter = r;
|
|
1330
1331
|
}}>${r}</button>`)}
|
|
@@ -1334,21 +1335,21 @@ class Zt extends w {
|
|
|
1334
1335
|
this.query = r.target.value;
|
|
1335
1336
|
}}>
|
|
1336
1337
|
<span class="spacer"></span>
|
|
1337
|
-
<span class="asof">Records through ${
|
|
1338
|
+
<span class="asof">Records through ${w(vt(), { month: "long", day: "numeric" })} · conference games count toward both records · scrimmages toward neither</span>
|
|
1338
1339
|
</div>
|
|
1339
1340
|
${s.map((r) => this.renderConference(t, r))}
|
|
1340
1341
|
`)}
|
|
1341
1342
|
`;
|
|
1342
1343
|
}
|
|
1343
1344
|
renderConference(t, e) {
|
|
1344
|
-
const s = this.data.teams.filter((
|
|
1345
|
+
const s = this.data.teams.filter((n) => n.conferenceId === e.id);
|
|
1345
1346
|
if (!s.length) return m;
|
|
1346
|
-
const r = this.query.trim().toLowerCase(), o =
|
|
1347
|
-
return
|
|
1347
|
+
const r = this.query.trim().toLowerCase(), o = Jt(s, t.records);
|
|
1348
|
+
return h`
|
|
1348
1349
|
<div class="card">
|
|
1349
1350
|
<div class="card-head">
|
|
1350
1351
|
<h2>${e.name}</h2>
|
|
1351
|
-
${[...e.classifications || []].sort(
|
|
1352
|
+
${[...e.classifications || []].sort(Nt).map((n) => h`<span class="pill class">${n}</span>`)}
|
|
1352
1353
|
<span class="meta">${o.length} teams · membership derives from teams</span>
|
|
1353
1354
|
</div>
|
|
1354
1355
|
<div class="tablewrap"><table class="data">
|
|
@@ -1358,43 +1359,43 @@ class Zt extends w {
|
|
|
1358
1359
|
<th>Streak</th><th>Last 5</th><th>Next</th>
|
|
1359
1360
|
</tr></thead>
|
|
1360
1361
|
<tbody>
|
|
1361
|
-
${o.map((
|
|
1362
|
+
${o.map((n, i) => this.renderRow(t, n, i, r))}
|
|
1362
1363
|
</tbody>
|
|
1363
1364
|
</table></div>
|
|
1364
1365
|
</div>
|
|
1365
1366
|
`;
|
|
1366
1367
|
}
|
|
1367
1368
|
renderRow(t, e, s, r) {
|
|
1368
|
-
const o = t.schoolsById[e.team.schoolId],
|
|
1369
|
-
if (r && !
|
|
1370
|
-
const
|
|
1371
|
-
location.href =
|
|
1369
|
+
const o = t.schoolsById[e.team.schoolId], n = o?.name || e.team.name || "TBD";
|
|
1370
|
+
if (r && !n.toLowerCase().includes(r)) return m;
|
|
1371
|
+
const i = e.rec.pf - e.rec.pa, l = bt(this.data.games, e.team.id), c = () => {
|
|
1372
|
+
location.href = v(t.hrefs.school, { id: e.team.schoolId });
|
|
1372
1373
|
};
|
|
1373
|
-
return
|
|
1374
|
-
<tr class="rowlink" @click=${(
|
|
1375
|
-
|
|
1374
|
+
return h`
|
|
1375
|
+
<tr class="rowlink" @click=${(d) => {
|
|
1376
|
+
d.target.closest("a") || c();
|
|
1376
1377
|
}}>
|
|
1377
1378
|
<td class="mut">${s + 1}</td>
|
|
1378
1379
|
<td class="teamcell">
|
|
1379
|
-
${
|
|
1380
|
-
<a href=${
|
|
1380
|
+
${E(o)}${wt(t, e.team.id, null)}
|
|
1381
|
+
<a href=${v(t.hrefs.school, { id: e.team.schoolId })}>${n}</a>
|
|
1381
1382
|
</td>
|
|
1382
|
-
<td class="num">${
|
|
1383
|
-
<td class="num">${
|
|
1384
|
-
<td class="num">${
|
|
1385
|
-
<td class="num">${
|
|
1383
|
+
<td class="num">${k(e.rec, !0)}</td>
|
|
1384
|
+
<td class="num">${Ft(e.confPct)}</td>
|
|
1385
|
+
<td class="num">${k(e.rec)}</td>
|
|
1386
|
+
<td class="num">${Ft(e.overallPct)}</td>
|
|
1386
1387
|
<td class="num">${e.rec.pf}</td>
|
|
1387
1388
|
<td class="num">${e.rec.pa}</td>
|
|
1388
|
-
<td class="num" style="color:${
|
|
1389
|
-
<td>${
|
|
1390
|
-
<td>${
|
|
1391
|
-
<td>${
|
|
1389
|
+
<td class="num" style="color:${i >= 0 ? "var(--hsot-win)" : "var(--hsot-loss)"}">${i > 0 ? "+" : ""}${i}</td>
|
|
1390
|
+
<td>${nt(e.rec.results) || "·"}</td>
|
|
1391
|
+
<td>${xt(t, e.team.id)}</td>
|
|
1392
|
+
<td>${te(t, l, e.team.id)}</td>
|
|
1392
1393
|
</tr>
|
|
1393
1394
|
`;
|
|
1394
1395
|
}
|
|
1395
1396
|
}
|
|
1396
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings",
|
|
1397
|
-
const
|
|
1397
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings", se);
|
|
1398
|
+
const rs = y`
|
|
1398
1399
|
.hero1 {
|
|
1399
1400
|
border-radius: var(--hsot-radius-md); color: var(--hsot-white);
|
|
1400
1401
|
padding: 1.3rem 1.4rem; display: flex; align-items: center; gap: 1.2rem;
|
|
@@ -1411,10 +1412,10 @@ const Ve = b`
|
|
|
1411
1412
|
.delta.new { background: var(--hsot-straw); color: #6b5900; border-radius: var(--hsot-radius-xs); padding: 0.1rem 0.3rem; font-size: 0.7rem; }
|
|
1412
1413
|
.sparkline { vertical-align: middle; }
|
|
1413
1414
|
`;
|
|
1414
|
-
class
|
|
1415
|
-
static styles = [...
|
|
1415
|
+
class ae extends b {
|
|
1416
|
+
static styles = [...U, rs];
|
|
1416
1417
|
static properties = {
|
|
1417
|
-
...
|
|
1418
|
+
...b.properties,
|
|
1418
1419
|
sport: { type: String },
|
|
1419
1420
|
gender: { type: String },
|
|
1420
1421
|
season: { type: String },
|
|
@@ -1429,73 +1430,73 @@ class Jt extends w {
|
|
|
1429
1430
|
t && (this.pollDate = t);
|
|
1430
1431
|
}
|
|
1431
1432
|
async fetchData(t) {
|
|
1432
|
-
const e = this.season ||
|
|
1433
|
+
const e = this.season || Y(), [s, r, o, n, i] = await Promise.all([
|
|
1433
1434
|
t.listRankings({ sport: this.sport, ...this.gender ? { gender: this.gender } : {} }),
|
|
1434
1435
|
t.listSchools(),
|
|
1435
1436
|
t.listTeams({ sport: this.sport }),
|
|
1436
1437
|
t.listConferences(),
|
|
1437
1438
|
t.listGames({ sport: this.sport, season: e })
|
|
1438
|
-
]),
|
|
1439
|
+
]), l = s.items.filter((c) => !this.gender || !c.gender || c.gender === this.gender).sort((c, d) => d.effectiveDate.localeCompare(c.effectiveDate));
|
|
1439
1440
|
return {
|
|
1440
1441
|
season: e,
|
|
1441
|
-
polls:
|
|
1442
|
+
polls: l,
|
|
1442
1443
|
schools: r.items,
|
|
1443
1444
|
teams: o.items,
|
|
1444
|
-
conferences:
|
|
1445
|
-
games:
|
|
1445
|
+
conferences: n.items,
|
|
1446
|
+
games: i.items
|
|
1446
1447
|
};
|
|
1447
1448
|
}
|
|
1448
1449
|
get ctx() {
|
|
1449
1450
|
return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
|
|
1450
|
-
teamsById:
|
|
1451
|
-
schoolsById:
|
|
1452
|
-
records:
|
|
1451
|
+
teamsById: $(this.data.teams),
|
|
1452
|
+
schoolsById: $(this.data.schools),
|
|
1453
|
+
records: K(this.data.games),
|
|
1453
1454
|
rankings: this.data.polls,
|
|
1454
|
-
hrefs:
|
|
1455
|
+
hrefs: O(this),
|
|
1455
1456
|
sport: this.sport
|
|
1456
1457
|
}, this._ctxData = this.data), this._ctx;
|
|
1457
1458
|
}
|
|
1458
1459
|
sparkline(t, e, s) {
|
|
1459
|
-
const
|
|
1460
|
-
const
|
|
1461
|
-
if (
|
|
1462
|
-
const
|
|
1463
|
-
return { x:
|
|
1464
|
-
}),
|
|
1460
|
+
const i = e.map((p, u) => {
|
|
1461
|
+
const f = (p.teamIds || []).indexOf(t);
|
|
1462
|
+
if (f === -1) return null;
|
|
1463
|
+
const g = e.length === 1 ? 96 / 2 : u / (e.length - 1) * 90 + 3, x = 3 + f / 24 * 20;
|
|
1464
|
+
return { x: g, y: x };
|
|
1465
|
+
}), l = [];
|
|
1465
1466
|
let c = [];
|
|
1466
|
-
if (
|
|
1467
|
-
p ? c.push(p) : c.length && (
|
|
1468
|
-
}), c.length &&
|
|
1469
|
-
const
|
|
1470
|
-
return
|
|
1471
|
-
${
|
|
1472
|
-
points=${p.map((
|
|
1473
|
-
${
|
|
1467
|
+
if (i.forEach((p) => {
|
|
1468
|
+
p ? c.push(p) : c.length && (l.push(c), c = []);
|
|
1469
|
+
}), c.length && l.push(c), !l.length) return m;
|
|
1470
|
+
const d = i[s];
|
|
1471
|
+
return h`<svg class="sparkline" width=${96} height=${26} viewBox="0 0 ${96} ${26}" role="img" aria-label="rank history">
|
|
1472
|
+
${l.map((p) => zt`<polyline fill="none" stroke="var(--hsot-red)" stroke-width="2"
|
|
1473
|
+
points=${p.map((u) => `${u.x.toFixed(1)},${u.y.toFixed(1)}`).join(" ")}></polyline>`)}
|
|
1474
|
+
${d ? zt`<circle cx=${d.x.toFixed(1)} cy=${d.y.toFixed(1)} r="3" fill="var(--hsot-black)"></circle>` : m}
|
|
1474
1475
|
</svg>`;
|
|
1475
1476
|
}
|
|
1476
1477
|
movement(t, e, s) {
|
|
1477
|
-
const r =
|
|
1478
|
-
return r.kind === "up" ?
|
|
1478
|
+
const r = es(t, e, s);
|
|
1479
|
+
return r.kind === "up" ? h`<span class="delta up">▲ ${r.delta}</span>` : r.kind === "down" ? h`<span class="delta down">▼ ${r.delta}</span>` : r.kind === "new" ? h`<span class="delta new">NEW</span>` : r.kind === "same" ? h`<span class="delta same">—</span>` : h`<span class="delta same">·</span>`;
|
|
1479
1480
|
}
|
|
1480
1481
|
renderView() {
|
|
1481
1482
|
const t = this.ctx, e = this.data.polls;
|
|
1482
|
-
if (!e.length) return
|
|
1483
|
-
const s = Math.max(0, e.findIndex((p) => p.effectiveDate === this.pollDate)), r = e[s] || e[0], o = e[s + 1] || null,
|
|
1484
|
-
return
|
|
1485
|
-
${
|
|
1486
|
-
title:
|
|
1487
|
-
sub:
|
|
1483
|
+
if (!e.length) return h`<div class="view"><p class="empty">No ${this.sport} polls published yet this season.</p></div>`;
|
|
1484
|
+
const s = Math.max(0, e.findIndex((p) => p.effectiveDate === this.pollDate)), r = e[s] || e[0], o = e[s + 1] || null, n = e.slice().reverse(), i = n.indexOf(r), l = $(this.data.conferences), c = (r.teamIds || [])[0], d = c ? C(t, c) : null;
|
|
1485
|
+
return h`
|
|
1486
|
+
${it(this, t, {
|
|
1487
|
+
title: h`${B(this.sport)} Top 25`,
|
|
1488
|
+
sub: h`The HighSchoolOT poll · updated weekly · ${e.length} polls this season`,
|
|
1488
1489
|
teams: this.data.teams
|
|
1489
1490
|
})}
|
|
1490
|
-
${
|
|
1491
|
-
${
|
|
1491
|
+
${P(this, h`
|
|
1492
|
+
${D(this)}
|
|
1492
1493
|
<div class="toolbar">
|
|
1493
1494
|
<label class="asof" for="pollsel">Poll of</label>
|
|
1494
1495
|
<select id="pollsel" @change=${(p) => {
|
|
1495
1496
|
this.pollDate = p.target.value;
|
|
1496
1497
|
}}>
|
|
1497
|
-
${e.map((p,
|
|
1498
|
-
${
|
|
1498
|
+
${e.map((p, u) => h`<option value=${p.effectiveDate} ?selected=${p === r}>
|
|
1499
|
+
${w(p.effectiveDate, { month: "long", day: "numeric", year: "numeric" })}${u === 0 ? " · current" : ""}
|
|
1499
1500
|
</option>`)}
|
|
1500
1501
|
</select>
|
|
1501
1502
|
<button class="chip" ?disabled=${s >= e.length - 1}
|
|
@@ -1509,65 +1510,65 @@ class Jt extends w {
|
|
|
1509
1510
|
<span class="spacer"></span>
|
|
1510
1511
|
<span class="asof">Movement vs. the previous poll · sparkline = season rank history</span>
|
|
1511
1512
|
</div>
|
|
1512
|
-
${
|
|
1513
|
+
${d ? this.renderHero(t, r, o, c, d, l) : m}
|
|
1513
1514
|
<div class="card"><div class="tablewrap"><table class="data">
|
|
1514
1515
|
<thead><tr>
|
|
1515
1516
|
<th class="num">Rk</th><th>Mvmt</th><th>Team</th><th class="num">Record</th>
|
|
1516
1517
|
<th>Conference</th><th>Last result</th><th>Next</th><th>Season</th>
|
|
1517
1518
|
</tr></thead>
|
|
1518
1519
|
<tbody>
|
|
1519
|
-
${(r.teamIds || []).map((p,
|
|
1520
|
+
${(r.teamIds || []).map((p, u) => u === 0 || !p ? m : this.renderRow(t, r, o, n, i, l, p, u + 1))}
|
|
1520
1521
|
</tbody>
|
|
1521
1522
|
</table></div></div>
|
|
1522
1523
|
<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>
|
|
1523
1524
|
`)}
|
|
1524
1525
|
`;
|
|
1525
1526
|
}
|
|
1526
|
-
renderHero(t, e, s, r, o,
|
|
1527
|
-
const
|
|
1528
|
-
return
|
|
1529
|
-
<div class="hero1" style="background:${
|
|
1527
|
+
renderHero(t, e, s, r, o, n) {
|
|
1528
|
+
const i = t.records[r], l = Ot(t.records, r), c = n[t.teamsById[r]?.conferenceId], d = `linear-gradient(120deg, ${o.colorPrimary || "#030711"} 0%, var(--hsot-black) 85%)`;
|
|
1529
|
+
return h`
|
|
1530
|
+
<div class="hero1" style="background:${d}">
|
|
1530
1531
|
<div class="bigrank">#1</div>
|
|
1531
|
-
${
|
|
1532
|
+
${E(o, 64)}
|
|
1532
1533
|
<div>
|
|
1533
|
-
<h2><a href=${
|
|
1534
|
+
<h2><a href=${v(t.hrefs.school, { id: o.id })}>${o.name} ${o.mascot || ""}</a></h2>
|
|
1534
1535
|
<div class="facts">
|
|
1535
|
-
${
|
|
1536
|
-
· streak ${
|
|
1537
|
-
${
|
|
1536
|
+
${k(i)} overall${c ? h` · ${k(i, !0)} ${c.name}` : m}
|
|
1537
|
+
· streak ${nt(i?.results) || "·"}
|
|
1538
|
+
${l ? h` · last: ${l.mark} ${l.my}-${l.their} vs ${et(t, l.opp)}` : m}
|
|
1538
1539
|
${this.movement(e, s, r)}
|
|
1539
1540
|
</div>
|
|
1540
1541
|
</div>
|
|
1541
1542
|
</div>
|
|
1542
1543
|
`;
|
|
1543
1544
|
}
|
|
1544
|
-
renderRow(t, e, s, r, o, i, l
|
|
1545
|
-
const c =
|
|
1545
|
+
renderRow(t, e, s, r, o, n, i, l) {
|
|
1546
|
+
const c = C(t, i);
|
|
1546
1547
|
if (!c) return m;
|
|
1547
|
-
const
|
|
1548
|
-
location.href =
|
|
1548
|
+
const d = t.records[i], p = Ot(t.records, i), u = bt(this.data.games, i), f = n[t.teamsById[i]?.conferenceId], g = () => {
|
|
1549
|
+
location.href = v(t.hrefs.school, { id: c.id });
|
|
1549
1550
|
};
|
|
1550
|
-
return
|
|
1551
|
-
<tr class="rowlink" @click=${(
|
|
1552
|
-
|
|
1551
|
+
return h`
|
|
1552
|
+
<tr class="rowlink" @click=${(x) => {
|
|
1553
|
+
x.target.closest("a") || g();
|
|
1553
1554
|
}}>
|
|
1554
|
-
<td class="num" style="font-weight:700">${
|
|
1555
|
-
<td>${this.movement(e, s,
|
|
1556
|
-
<td class="teamcell">${
|
|
1555
|
+
<td class="num" style="font-weight:700">${l}</td>
|
|
1556
|
+
<td>${this.movement(e, s, i)}</td>
|
|
1557
|
+
<td class="teamcell">${E(c)}<a href=${v(t.hrefs.school, { id: c.id })}>${c.name}</a>
|
|
1557
1558
|
<span class="mut" style="font-size:0.78rem">${c.mascot || ""}</span></td>
|
|
1558
|
-
<td class="num">${
|
|
1559
|
-
<td class="mut">${
|
|
1560
|
-
<td>${p ?
|
|
1559
|
+
<td class="num">${k(d)}</td>
|
|
1560
|
+
<td class="mut">${f?.name || "Independent"}</td>
|
|
1561
|
+
<td>${p ? h`<a class="box" style="text-decoration:none" href=${v(t.hrefs.game, { sport: this.sport, id: p.gameId })}>
|
|
1561
1562
|
<b style="color:${p.mark === "W" ? "var(--hsot-win)" : p.mark === "L" ? "var(--hsot-loss)" : "var(--hsot-tie)"}">${p.mark}</b>
|
|
1562
|
-
${p.my}-${p.their} vs ${
|
|
1563
|
-
<td>${
|
|
1564
|
-
<td>${this.sparkline(
|
|
1563
|
+
${p.my}-${p.their} vs ${et(t, p.opp)}</a>` : h`<span class="mut">·</span>`}</td>
|
|
1564
|
+
<td>${te(t, u, i)}</td>
|
|
1565
|
+
<td>${this.sparkline(i, r, o)}</td>
|
|
1565
1566
|
</tr>
|
|
1566
1567
|
`;
|
|
1567
1568
|
}
|
|
1568
1569
|
}
|
|
1569
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings",
|
|
1570
|
-
const
|
|
1570
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings", ae);
|
|
1571
|
+
const os = y`
|
|
1571
1572
|
.schoolhero { color: var(--hsot-white); padding: 1.6rem 1.25rem 1.3rem; }
|
|
1572
1573
|
.schoolhero .inner { max-width: 1366px; margin: 0 auto; display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
|
|
1573
1574
|
.schoolhero .crest {
|
|
@@ -1621,10 +1622,10 @@ const Ye = b`
|
|
|
1621
1622
|
table.data.roster .sub { display: block; font-weight: 400; font-size: 0.78rem; color: var(--hsot-gray-5); }
|
|
1622
1623
|
}
|
|
1623
1624
|
`;
|
|
1624
|
-
class
|
|
1625
|
-
static styles = [...
|
|
1625
|
+
class re extends b {
|
|
1626
|
+
static styles = [...U, os];
|
|
1626
1627
|
static properties = {
|
|
1627
|
-
...
|
|
1628
|
+
...b.properties,
|
|
1628
1629
|
schoolId: { type: String, attribute: "school-id" },
|
|
1629
1630
|
sport: { type: String },
|
|
1630
1631
|
season: { type: String },
|
|
@@ -1639,38 +1640,38 @@ class Xt extends w {
|
|
|
1639
1640
|
t && !this.sport && (this.sport = t);
|
|
1640
1641
|
}
|
|
1641
1642
|
async fetchData(t) {
|
|
1642
|
-
const e = this.season ||
|
|
1643
|
-
|
|
1644
|
-
|
|
1643
|
+
const e = this.season || Y(), s = await t.getSchool(this.schoolId), o = (await t.listTeams({ schoolId: this.schoolId })).items, n = o.find((g) => g.sport === (this.sport || "football")) || o[0] || null, [i, l, c, d, p, u, f] = await Promise.all([
|
|
1644
|
+
n ? t.listGames({ sport: n.sport, season: e }) : Promise.resolve({ items: [] }),
|
|
1645
|
+
n ? t.listTeams({ sport: n.sport }) : Promise.resolve({ items: [] }),
|
|
1645
1646
|
t.listSchools(),
|
|
1646
1647
|
t.listConferences(),
|
|
1647
|
-
|
|
1648
|
-
|
|
1648
|
+
n ? t.listRankings({ sport: n.sport }) : Promise.resolve({ items: [] }),
|
|
1649
|
+
n ? t.listRosters({ teamId: n.id }) : Promise.resolve({ items: [] }),
|
|
1649
1650
|
// teamId is the public surface's one players filter (roster
|
|
1650
1651
|
// membership) — never fetch the whole collection.
|
|
1651
|
-
|
|
1652
|
+
n ? t.listPlayers({ teamId: n.id }) : Promise.resolve({ items: [] })
|
|
1652
1653
|
]);
|
|
1653
1654
|
return {
|
|
1654
1655
|
season: e,
|
|
1655
1656
|
school: s,
|
|
1656
1657
|
teams: o,
|
|
1657
|
-
active:
|
|
1658
|
-
games:
|
|
1659
|
-
allTeams:
|
|
1658
|
+
active: n,
|
|
1659
|
+
games: i.items,
|
|
1660
|
+
allTeams: l.items,
|
|
1660
1661
|
schools: c.items,
|
|
1661
|
-
conferences:
|
|
1662
|
+
conferences: d.items,
|
|
1662
1663
|
rankings: p.items,
|
|
1663
|
-
roster:
|
|
1664
|
-
players:
|
|
1664
|
+
roster: u.items.find((g) => g.season === e) || null,
|
|
1665
|
+
players: f.items
|
|
1665
1666
|
};
|
|
1666
1667
|
}
|
|
1667
1668
|
get ctx() {
|
|
1668
1669
|
return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
|
|
1669
|
-
teamsById:
|
|
1670
|
-
schoolsById:
|
|
1671
|
-
records:
|
|
1670
|
+
teamsById: $(this.data.allTeams.length ? this.data.allTeams : this.data.teams),
|
|
1671
|
+
schoolsById: $(this.data.schools),
|
|
1672
|
+
records: K(this.data.games),
|
|
1672
1673
|
rankings: this.data.rankings,
|
|
1673
|
-
hrefs:
|
|
1674
|
+
hrefs: O(this),
|
|
1674
1675
|
sport: this.data.active?.sport || "football"
|
|
1675
1676
|
}, this._ctxData = this.data), this._ctx;
|
|
1676
1677
|
}
|
|
@@ -1679,61 +1680,61 @@ class Xt extends w {
|
|
|
1679
1680
|
}
|
|
1680
1681
|
renderView() {
|
|
1681
1682
|
const { school: t, teams: e, active: s, season: r } = this.data;
|
|
1682
|
-
if (!t) return
|
|
1683
|
-
const o = this.ctx,
|
|
1684
|
-
return
|
|
1685
|
-
<div class="schoolhero" style="background:linear-gradient(115deg, ${t.colorPrimary || "#030711"} 0%, ${t.colorPrimary || "#030711"} 55%, var(--hsot-black) 100%);color:${
|
|
1683
|
+
if (!t) return h`<div class="view"><p class="empty">School not found.</p></div>`;
|
|
1684
|
+
const o = this.ctx, n = X(t.colorPrimary || "#030711"), i = (t.adm || [])[0], l = $(this.data.conferences), c = s ? l[s.conferenceId] : null;
|
|
1685
|
+
return h`
|
|
1686
|
+
<div class="schoolhero" style="background:linear-gradient(115deg, ${t.colorPrimary || "#030711"} 0%, ${t.colorPrimary || "#030711"} 55%, var(--hsot-black) 100%);color:${n}">
|
|
1686
1687
|
<div class="inner">
|
|
1687
|
-
${
|
|
1688
|
+
${tt(t, 84) ? h`<img class="crest logo" alt="" loading="lazy" src=${tt(t, 84)} />` : h`<div class="crest" style="background:${t.colorSecondary || "#7C7C7C"};color:${X(t.colorSecondary || "#7C7C7C")}">${$t(t)}</div>`}
|
|
1688
1689
|
<div style="min-width:260px">
|
|
1689
1690
|
<h1>${t.name} <span class="mascot">${t.mascot || ""}</span></h1>
|
|
1690
1691
|
<div class="facts">
|
|
1691
|
-
${t.location ?
|
|
1692
|
-
${t.association ?
|
|
1693
|
-
${c ?
|
|
1694
|
-
${
|
|
1695
|
-
${t.openingYear ?
|
|
1696
|
-
${t.areaCode ?
|
|
1692
|
+
${t.location ? h`<span><b>Location</b>${t.location}${t.county ? h` · ${t.county} County` : m}</span>` : m}
|
|
1693
|
+
${t.association ? h`<span><b>League</b>${t.association}${t.classification ? h` · ${t.classification}` : m}</span>` : m}
|
|
1694
|
+
${c ? h`<span><b>Conference</b>${c.name}</span>` : m}
|
|
1695
|
+
${i ? h`<span><b>Enrollment</b>${i.value.toLocaleString()} (${i.season} ADM)</span>` : m}
|
|
1696
|
+
${t.openingYear ? h`<span><b>Opened</b>${t.openingYear}</span>` : m}
|
|
1697
|
+
${t.areaCode ? h`<span><b>Area</b>${t.areaCode}</span>` : m}
|
|
1697
1698
|
</div>
|
|
1698
1699
|
</div>
|
|
1699
1700
|
</div>
|
|
1700
1701
|
</div>
|
|
1701
1702
|
<div class="band">
|
|
1702
1703
|
<nav class="tabs" aria-label="Teams">
|
|
1703
|
-
${e.map((
|
|
1704
|
-
p.preventDefault(), this.switchSport(
|
|
1705
|
-
}}>${
|
|
1704
|
+
${e.map((d) => d.id === s?.id ? h`<a class="on" href="#" @click=${(p) => p.preventDefault()}>${d.name}</a>` : h`<a href="#" @click=${(p) => {
|
|
1705
|
+
p.preventDefault(), this.switchSport(d.sport);
|
|
1706
|
+
}}>${d.name}</a>`)}
|
|
1706
1707
|
</nav>
|
|
1707
1708
|
</div>
|
|
1708
|
-
${
|
|
1709
|
-
${
|
|
1710
|
-
${s ? this.renderTeam(o, s, c, r) :
|
|
1709
|
+
${P(this, h`
|
|
1710
|
+
${D(this)}
|
|
1711
|
+
${s ? this.renderTeam(o, s, c, r) : h`<p class="empty">No teams recorded for this school yet.</p>`}
|
|
1711
1712
|
`)}
|
|
1712
1713
|
`;
|
|
1713
1714
|
}
|
|
1714
1715
|
renderTeam(t, e, s, r) {
|
|
1715
|
-
const o = t.records[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] },
|
|
1716
|
-
return
|
|
1716
|
+
const o = t.records[e.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 ? this.data.allTeams.filter((p) => p.conferenceId === s.id) : [], l = s ? Jt(i, t.records).findIndex((p) => p.team.id === e.id) + 1 : 0, c = yt(t.rankings, t.teamsById, e.id, e.sport, null), d = this.data.games.filter((p) => p.homeTeamId === e.id || p.awayTeamId === e.id).sort((p, u) => String(p.date).localeCompare(String(u.date)));
|
|
1717
|
+
return h`
|
|
1717
1718
|
<div class="tiles">
|
|
1718
|
-
<div class="tile"><div class="k">Overall</div><div class="v">${
|
|
1719
|
-
<div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${
|
|
1720
|
-
<div class="s">${
|
|
1721
|
-
<div class="tile"><div class="k">Points</div><div class="v">${
|
|
1722
|
-
<div class="s">scored per game · ${
|
|
1723
|
-
<div class="tile"><div class="k">Streak</div><div class="v">${
|
|
1724
|
-
<div class="s">last 5: ${
|
|
1719
|
+
<div class="tile"><div class="k">Overall</div><div class="v">${k(o)}</div><div class="s">${n} games played</div></div>
|
|
1720
|
+
<div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${k(o, !0)}</div>
|
|
1721
|
+
<div class="s">${l ? `${He(l)} of ${i.length}` : "·"}</div></div>
|
|
1722
|
+
<div class="tile"><div class="k">Points</div><div class="v">${n ? (o.pf / n).toFixed(1) : "0.0"}</div>
|
|
1723
|
+
<div class="s">scored per game · ${n ? (o.pa / n).toFixed(1) : "0.0"} allowed</div></div>
|
|
1724
|
+
<div class="tile"><div class="k">Streak</div><div class="v">${nt(o.results) || "·"}</div>
|
|
1725
|
+
<div class="s">last 5: ${xt(t, e.id)}</div></div>
|
|
1725
1726
|
<div class="tile"><div class="k">HSOT Top 25</div><div class="v">${c ? `#${c}` : "NR"}</div>
|
|
1726
|
-
<div class="s"><a href=${
|
|
1727
|
+
<div class="s"><a href=${v(t.hrefs.section, { sport: e.sport, view: "rankings" })}>full poll</a></div></div>
|
|
1727
1728
|
</div>
|
|
1728
|
-
${(e.championships || []).length ?
|
|
1729
|
+
${(e.championships || []).length ? h`
|
|
1729
1730
|
<div style="margin:-0.2rem 0 1rem;display:flex;gap:0.4rem;flex-wrap:wrap">
|
|
1730
|
-
${e.championships.map((p) =>
|
|
1731
|
+
${e.championships.map((p) => h`<span class="pill champ">★ ${p.season} ${p.title} champion${p.classification ? ` · ${p.classification}` : ""}${p.region ? ` · ${p.region}` : ""}</span>`)}
|
|
1731
1732
|
</div>` : m}
|
|
1732
1733
|
<div class="cols">
|
|
1733
1734
|
<div>
|
|
1734
1735
|
<div class="section-title">Schedule & results</div>
|
|
1735
1736
|
<div class="card">
|
|
1736
|
-
${
|
|
1737
|
+
${d.length ? h`<ul class="gamelist">${d.map((p) => this.renderGameRow(t, e, p))}</ul>` : h`<p class="empty">No ${e.sport} games recorded for ${r}.</p>`}
|
|
1737
1738
|
</div>
|
|
1738
1739
|
</div>
|
|
1739
1740
|
<div>
|
|
@@ -1744,50 +1745,50 @@ class Xt extends w {
|
|
|
1744
1745
|
`;
|
|
1745
1746
|
}
|
|
1746
1747
|
renderGameRow(t, e, s) {
|
|
1747
|
-
const r = s.homeTeamId === e.id, o = r ? s.awayTeamId : s.homeTeamId,
|
|
1748
|
-
let
|
|
1748
|
+
const r = s.homeTeamId === e.id, o = r ? s.awayTeamId : s.homeTeamId, n = r ? s.homeScore : s.awayScore, i = r ? s.awayScore : s.homeScore;
|
|
1749
|
+
let l = h`<span class="mut">${gt(s.time)}</span>`;
|
|
1749
1750
|
if (s.state === "final") {
|
|
1750
|
-
const
|
|
1751
|
-
|
|
1752
|
-
} else s.state === "live" && (
|
|
1751
|
+
const d = ot(s), p = d === "tie" ? "T" : d === (r ? "home" : "away") ? "W" : "L";
|
|
1752
|
+
l = h`<span class=${p}>${p}</span> ${n}-${i}${s.finish === "overtime" ? h` <span class="mut">OT</span>` : m}${s.forfeit && s.forfeit !== "none" ? h` <span class="mut">FF</span>` : m}`;
|
|
1753
|
+
} else s.state === "live" && (l = h`<span style="color:var(--hsot-red)">${n}-${i}</span>`);
|
|
1753
1754
|
const c = s.gameType === "conference" ? "Conf" : s.gameType === "nonconference" ? "Non-conf" : s.gameType === "playoff" ? `Playoff${s.label ? ` · ${s.label}` : ""}` : "Scrimmage";
|
|
1754
|
-
return
|
|
1755
|
+
return h`
|
|
1755
1756
|
<li>
|
|
1756
|
-
<span class="d">${
|
|
1757
|
-
${
|
|
1758
|
-
<span class="res">${
|
|
1759
|
-
<span class="opp">${r ? "vs" : "at"} ${
|
|
1757
|
+
<span class="d">${w(s.date)}</span>
|
|
1758
|
+
${Qt(s).kind === "sched" ? m : W(s)}
|
|
1759
|
+
<span class="res">${l}</span>
|
|
1760
|
+
<span class="opp">${r ? "vs" : "at"} ${st(t, o, s.date)}
|
|
1760
1761
|
<span class="pill type">${c}</span>
|
|
1761
|
-
${s.broadcast ?
|
|
1762
|
+
${s.broadcast ? h`<span class="pill class">${s.broadcast}</span>` : m}
|
|
1762
1763
|
</span>
|
|
1763
1764
|
<span class="where">${s.venue || ""}</span>
|
|
1764
|
-
<a class="box" href=${
|
|
1765
|
+
<a class="box" href=${v(t.hrefs.game, { sport: e.sport, id: s.id })}>Box score →</a>
|
|
1765
1766
|
</li>
|
|
1766
1767
|
`;
|
|
1767
1768
|
}
|
|
1768
1769
|
renderRoster(t, e) {
|
|
1769
1770
|
const s = this.data.roster;
|
|
1770
1771
|
if (!s)
|
|
1771
|
-
return
|
|
1772
|
-
const r =
|
|
1773
|
-
return
|
|
1774
|
-
${r ?
|
|
1772
|
+
return h`<p class="empty">Roster not published for ${e}.</p>`;
|
|
1773
|
+
const r = as(s, 560), o = this.data.school?.name || "", n = $(this.data.players), i = s.entries.slice().sort((c, d) => (c.number || 0) - (d.number || 0)), l = i.some((c) => n[c.playerId]?.college);
|
|
1774
|
+
return h`
|
|
1775
|
+
${r ? h`<img class="rosterphoto" src=${r} loading="lazy" decoding="async"
|
|
1775
1776
|
alt="${o} ${t.name} ${e} team photo" />` : m}
|
|
1776
1777
|
<div class="tablewrap"><table class="data roster">
|
|
1777
|
-
<thead><tr><th class="num">No.</th><th>Player</th><th class="pos">Pos</th><th class="cls">Class</th><th class="num">Ht</th><th class="num">Wt</th>${
|
|
1778
|
+
<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>${l ? h`<th>College</th>` : m}</tr></thead>
|
|
1778
1779
|
<tbody>
|
|
1779
|
-
${
|
|
1780
|
-
const
|
|
1781
|
-
if (!
|
|
1782
|
-
const p =
|
|
1783
|
-
return
|
|
1780
|
+
${i.map((c) => {
|
|
1781
|
+
const d = n[c.playerId];
|
|
1782
|
+
if (!d) return m;
|
|
1783
|
+
const p = Oe(c), u = [p, d.classOf].filter(Boolean).join(" · ") || "·";
|
|
1784
|
+
return h`<tr>
|
|
1784
1785
|
<td class="num mut">${c.number ?? "·"}</td>
|
|
1785
|
-
<td class="player" style="font-weight:500">${
|
|
1786
|
+
<td class="player" style="font-weight:500">${d.firstName} ${d.lastName}<span class="sub">${u}</span></td>
|
|
1786
1787
|
<td class="pos">${p || "·"}</td>
|
|
1787
|
-
<td class="cls mut">${
|
|
1788
|
-
<td class="num">${
|
|
1789
|
-
<td class="num">${
|
|
1790
|
-
${
|
|
1788
|
+
<td class="cls mut">${d.classOf || "·"}</td>
|
|
1789
|
+
<td class="num">${Fe(d.heightIn)}</td>
|
|
1790
|
+
<td class="num">${d.weightLb || "·"}</td>
|
|
1791
|
+
${l ? h`<td class="college">${d.college || "·"}</td>` : m}
|
|
1791
1792
|
</tr>`;
|
|
1792
1793
|
})}
|
|
1793
1794
|
</tbody>
|
|
@@ -1795,16 +1796,69 @@ class Xt extends w {
|
|
|
1795
1796
|
`;
|
|
1796
1797
|
}
|
|
1797
1798
|
}
|
|
1798
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school",
|
|
1799
|
-
const
|
|
1800
|
-
|
|
1799
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school", re);
|
|
1800
|
+
const oe = {
|
|
1801
|
+
football: ["quarters", 4],
|
|
1802
|
+
flag_football: ["quarters", 4],
|
|
1803
|
+
basketball: ["quarters", 4],
|
|
1804
|
+
lacrosse: ["quarters", 4],
|
|
1805
|
+
field_hockey: ["quarters", 4],
|
|
1806
|
+
soccer: ["halves", 2],
|
|
1807
|
+
baseball: ["innings", 7],
|
|
1808
|
+
softball: ["innings", 7],
|
|
1809
|
+
volleyball: ["sets", 3]
|
|
1810
|
+
};
|
|
1811
|
+
function ne(a) {
|
|
1812
|
+
return (oe[a] || ["quarters", 4])[0];
|
|
1813
|
+
}
|
|
1814
|
+
function kt(a) {
|
|
1815
|
+
return (oe[a] || ["quarters", 4])[1];
|
|
1816
|
+
}
|
|
1817
|
+
function ns(a, t) {
|
|
1818
|
+
const e = ne(a), s = kt(a);
|
|
1819
|
+
if (t <= s || e === "innings" || e === "sets") return String(t);
|
|
1820
|
+
const r = t - s;
|
|
1821
|
+
return `OT${r > 1 ? r : ""}`;
|
|
1822
|
+
}
|
|
1823
|
+
function is(a, t) {
|
|
1824
|
+
const e = String(a ?? "").trim();
|
|
1825
|
+
let s;
|
|
1826
|
+
return (s = /^(\d+)Q$/i.exec(e)) || (s = /^(\d+)H$/i.exec(e)) ? Number(s[1]) : /^half$/i.test(e) ? ne(t) === "halves" ? 1 : 2 : (s = /^(\d*)OT(\d*)$/i.exec(e)) ? kt(t) + Number(s[1] || s[2] || 1) : (s = /^[TB](\d+)$/i.exec(e)) || (s = /^(\d+)(?:st|nd|rd|th)\s*set$/i.exec(e)) || (s = /^set\s*(\d+)$/i.exec(e)) ? Number(s[1]) : null;
|
|
1827
|
+
}
|
|
1828
|
+
const Q = (a) => Number.isInteger(a) && a >= 0 ? a : null;
|
|
1829
|
+
function ls(a) {
|
|
1830
|
+
const t = Array.isArray(a?.scoringPlays) ? a.scoringPlays : [];
|
|
1831
|
+
if (!t.length) return null;
|
|
1832
|
+
const e = a.sport, s = /* @__PURE__ */ new Map();
|
|
1833
|
+
for (const p of t) {
|
|
1834
|
+
const u = is(p?.period, e), f = Q(p?.homeScore), g = Q(p?.awayScore);
|
|
1835
|
+
if (!u || f === null || g === null) return null;
|
|
1836
|
+
const x = s.get(u) || { home: 0, away: 0 };
|
|
1837
|
+
x.home = Math.max(x.home, f), x.away = Math.max(x.away, g), s.set(u, x);
|
|
1838
|
+
}
|
|
1839
|
+
const r = Math.max(...s.keys()), o = [];
|
|
1840
|
+
let n = !0, i = { home: 0, away: 0 };
|
|
1841
|
+
for (let p = 1; p <= r; p += 1) {
|
|
1842
|
+
const u = s.get(p) || i, f = u.home - i.home, g = u.away - i.away;
|
|
1843
|
+
(f < 0 || g < 0) && (n = !1), o.push({ period: p, 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) };
|
|
1844
|
+
}
|
|
1845
|
+
const l = Q(a.homeScore) ?? 0, c = Q(a.awayScore) ?? 0, d = n && i.home === l && i.away === c;
|
|
1846
|
+
return n = n && i.home <= l && i.away <= c, { periods: o, reconciled: d, consistent: n };
|
|
1847
|
+
}
|
|
1848
|
+
function cs(a) {
|
|
1849
|
+
if (Array.isArray(a?.periodScores) && a.periodScores.length) return a.periodScores;
|
|
1850
|
+
const t = ls(a);
|
|
1851
|
+
return t ? a.state === "final" ? t.reconciled ? t.periods : null : t.consistent ? t.periods : null : null;
|
|
1852
|
+
}
|
|
1853
|
+
const hs = "https://api.wral.com/search";
|
|
1854
|
+
function ds(a) {
|
|
1801
1855
|
return a.map((t) => `uri:"${t}"`).join(" OR ");
|
|
1802
1856
|
}
|
|
1803
|
-
function
|
|
1804
|
-
const e = String(a ||
|
|
1857
|
+
function ps(a, t) {
|
|
1858
|
+
const e = String(a || hs).replace(/\/+$/, ""), s = new URLSearchParams({ query: ds(t), sort: "score", lang: "en" });
|
|
1805
1859
|
return `${e}/v1/query?${s}`;
|
|
1806
1860
|
}
|
|
1807
|
-
function
|
|
1861
|
+
function ie(a) {
|
|
1808
1862
|
try {
|
|
1809
1863
|
const t = new URL(a);
|
|
1810
1864
|
if (/(^|\.)smugmug\.com$/i.test(t.hostname)) {
|
|
@@ -1819,13 +1873,13 @@ function te(a) {
|
|
|
1819
1873
|
}
|
|
1820
1874
|
return { uri: a, title: a };
|
|
1821
1875
|
}
|
|
1822
|
-
async function
|
|
1823
|
-
const r = await ((...
|
|
1876
|
+
async function ms(a, t, e) {
|
|
1877
|
+
const r = await ((...i) => fetch(...i))(ps(a, t));
|
|
1824
1878
|
if (!r.ok) throw new Error(`search answered ${r.status}`);
|
|
1825
|
-
const o = await r.json(),
|
|
1826
|
-
return t.map((
|
|
1879
|
+
const o = await r.json(), n = new Map((o.items || []).map((i) => [i.uri, i]));
|
|
1880
|
+
return t.map((i) => n.get(i) || ie(i));
|
|
1827
1881
|
}
|
|
1828
|
-
const
|
|
1882
|
+
const us = y`
|
|
1829
1883
|
.breadcrumbs { font-size: 0.8125rem; margin: 0.9rem 0 0; color: var(--hsot-gray-5); }
|
|
1830
1884
|
.breadcrumbs a { text-decoration: none; }
|
|
1831
1885
|
.scorehead { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; padding: 1.4rem 1rem; }
|
|
@@ -1878,10 +1932,10 @@ const Xe = b`
|
|
|
1878
1932
|
.cols { grid-template-columns: 1fr; }
|
|
1879
1933
|
}
|
|
1880
1934
|
`;
|
|
1881
|
-
class
|
|
1882
|
-
static styles = [...
|
|
1935
|
+
class le extends b {
|
|
1936
|
+
static styles = [...U, us];
|
|
1883
1937
|
static properties = {
|
|
1884
|
-
...
|
|
1938
|
+
...b.properties,
|
|
1885
1939
|
gameId: { type: String, attribute: "game-id" },
|
|
1886
1940
|
// The public site search that resolves Game.coverageUrls into cards
|
|
1887
1941
|
// (DEV-1236). Shared cross-stage by design — see the studio host's
|
|
@@ -1893,7 +1947,7 @@ class ee extends w {
|
|
|
1893
1947
|
super(), this.gameId = "", this.searchApi = "";
|
|
1894
1948
|
}
|
|
1895
1949
|
async fetchData(t) {
|
|
1896
|
-
const e = await t.getGame(this.gameId), s = Array.isArray(e.coverageUrls) ? e.coverageUrls : [], [r, o, i, l,
|
|
1950
|
+
const e = await t.getGame(this.gameId), s = Array.isArray(e.coverageUrls) ? e.coverageUrls : [], [r, o, n, i, l, c] = await Promise.all([
|
|
1897
1951
|
t.listSchools(),
|
|
1898
1952
|
t.listTeams({ sport: e.sport }),
|
|
1899
1953
|
t.listConferences(),
|
|
@@ -1901,75 +1955,75 @@ class ee extends w {
|
|
|
1901
1955
|
t.listGames({ sport: e.sport, season: e.season }),
|
|
1902
1956
|
// A search outage must not blank the box score — degrade to bare
|
|
1903
1957
|
// links (fetchCoverage already degrades per-URL index misses).
|
|
1904
|
-
s.length ?
|
|
1958
|
+
s.length ? ms(this.searchApi, s).catch(() => s.map(ie)) : Promise.resolve([])
|
|
1905
1959
|
]);
|
|
1906
1960
|
return {
|
|
1907
1961
|
game: e,
|
|
1908
1962
|
schools: r.items,
|
|
1909
1963
|
teams: o.items,
|
|
1910
|
-
conferences:
|
|
1911
|
-
rankings:
|
|
1912
|
-
games:
|
|
1964
|
+
conferences: n.items,
|
|
1965
|
+
rankings: i.items,
|
|
1966
|
+
games: l.items,
|
|
1913
1967
|
coverage: c
|
|
1914
1968
|
};
|
|
1915
1969
|
}
|
|
1916
1970
|
get ctx() {
|
|
1917
1971
|
return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
|
|
1918
|
-
teamsById:
|
|
1919
|
-
schoolsById:
|
|
1920
|
-
records:
|
|
1972
|
+
teamsById: $(this.data.teams),
|
|
1973
|
+
schoolsById: $(this.data.schools),
|
|
1974
|
+
records: K(this.data.games),
|
|
1921
1975
|
rankings: this.data.rankings,
|
|
1922
|
-
hrefs:
|
|
1976
|
+
hrefs: O(this),
|
|
1923
1977
|
sport: this.data.game.sport
|
|
1924
1978
|
}, this._ctxData = this.data), this._ctx;
|
|
1925
1979
|
}
|
|
1926
1980
|
renderView() {
|
|
1927
1981
|
const t = this.data.game;
|
|
1928
|
-
if (!t) return
|
|
1929
|
-
const e = this.ctx, s =
|
|
1930
|
-
return
|
|
1931
|
-
${
|
|
1932
|
-
${
|
|
1982
|
+
if (!t) return h`<div class="view"><p class="empty">Game not found.</p></div>`;
|
|
1983
|
+
const e = this.ctx, s = $(this.data.conferences), r = e.teamsById[t.awayTeamId] ? e.schoolsById[e.teamsById[t.awayTeamId].schoolId] : null, o = e.teamsById[t.homeTeamId] ? e.schoolsById[e.teamsById[t.homeTeamId].schoolId] : null, n = ot(t), i = (d) => t.state === "final" && n !== d && n !== "tie" ? "opacity:0.45" : "", l = t.conferenceId ? s[t.conferenceId] : null, c = this.data.games.filter((d) => d.id !== t.id && d.state === "final" && d.gameType !== "scrimmage" && (d.homeTeamId === t.homeTeamId && d.awayTeamId === t.awayTeamId || d.homeTeamId === t.awayTeamId && d.awayTeamId === t.homeTeamId));
|
|
1984
|
+
return h`
|
|
1985
|
+
${P(this, h`
|
|
1986
|
+
${D(this)}
|
|
1933
1987
|
<p class="breadcrumbs">
|
|
1934
|
-
<a href=${
|
|
1935
|
-
<a href=${
|
|
1936
|
-
${
|
|
1988
|
+
<a href=${v(e.hrefs.section, { sport: t.sport, view: "scores" })}>${B(t.sport)}</a> /
|
|
1989
|
+
<a href=${v(e.hrefs.section, { sport: t.sport, view: "scores" })}>Scores/Schedules</a> /
|
|
1990
|
+
${R(e, t.awayTeamId)} at ${R(e, t.homeTeamId)}
|
|
1937
1991
|
</p>
|
|
1938
1992
|
<div class="card">
|
|
1939
1993
|
<div class="scorehead">
|
|
1940
1994
|
${this.teamBlock(e, t, t.awayTeamId, r, !1)}
|
|
1941
1995
|
<div class="mid">
|
|
1942
1996
|
<div class="bigscore">
|
|
1943
|
-
<span style=${
|
|
1997
|
+
<span style=${i("away")}>${t.awayScore}</span>
|
|
1944
1998
|
<span class="mut" style="font-size:1.6rem">–</span>
|
|
1945
|
-
<span style=${
|
|
1999
|
+
<span style=${i("home")}>${t.homeScore}</span>
|
|
1946
2000
|
</div>
|
|
1947
|
-
<div class="status">${
|
|
1948
|
-
<div class="status">${
|
|
1949
|
-
${t.broadcast ?
|
|
2001
|
+
<div class="status">${W(t)}</div>
|
|
2002
|
+
<div class="status">${w(t.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${t.state === "scheduled" && t.time ? h` · ${gt(t.time)}` : m} · ${t.venue || "Venue TBD"}
|
|
2003
|
+
${t.broadcast ? h` · <span class="pill class">${t.broadcast}</span>` : m}</div>
|
|
1950
2004
|
<div class="status">
|
|
1951
|
-
<span class="pill type">${t.gameType === "conference" ? `${
|
|
1952
|
-
${t.label ?
|
|
1953
|
-
${(t.tags || []).map((
|
|
2005
|
+
<span class="pill type">${t.gameType === "conference" ? `${l?.name || "Conference"} game` : t.gameType}</span>
|
|
2006
|
+
${t.label ? h`<span class="pill type">Bracket ${t.label}</span>` : m}
|
|
2007
|
+
${(t.tags || []).map((d) => h`<span class="pill type">${d}</span>`)}
|
|
1954
2008
|
</div>
|
|
1955
2009
|
</div>
|
|
1956
2010
|
${this.teamBlock(e, t, t.homeTeamId, o, !0)}
|
|
1957
2011
|
</div>
|
|
1958
2012
|
${this.renderLineScore(t, r, o)}
|
|
1959
2013
|
${this.renderScoringPlays(t, r, o)}
|
|
1960
|
-
${t.notes ?
|
|
2014
|
+
${t.notes ? h`<p class="note gamenote">${t.notes}</p>` : m}
|
|
1961
2015
|
</div>
|
|
1962
|
-
${(this.data.coverage || []).length ?
|
|
2016
|
+
${(this.data.coverage || []).length ? h`
|
|
1963
2017
|
<div class="section-title">Coverage</div>
|
|
1964
2018
|
<div class="covgrid">
|
|
1965
|
-
${this.data.coverage.map((
|
|
1966
|
-
<a class="card covcard" href=${
|
|
1967
|
-
${
|
|
2019
|
+
${this.data.coverage.map((d) => h`
|
|
2020
|
+
<a class="card covcard" href=${d.uri}>
|
|
2021
|
+
${d.image ? h`<img class="covimg" src=${d.image} alt="" loading="lazy" />` : m}
|
|
1968
2022
|
<div class="covbody">
|
|
1969
|
-
<div class="covtitle">${
|
|
1970
|
-
${
|
|
1971
|
-
${
|
|
1972
|
-
<div class="covmeta">${[
|
|
2023
|
+
<div class="covtitle">${d.videoDuration ? h`<span class="pill live" style="animation:none">Video</span> ` : m}${d.photos ? h`<span class="pill live" style="animation:none">Photos</span> ` : m}${d.title || d.uri}</div>
|
|
2024
|
+
${d.description ? h`<p class="covdesc">${d.description}</p>` : m}
|
|
2025
|
+
${d.author || d.publishedTime ? h`
|
|
2026
|
+
<div class="covmeta">${[d.author, d.publishedTime ? new Date(d.publishedTime).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : ""].filter(Boolean).join(" · ")}</div>
|
|
1973
2027
|
` : m}
|
|
1974
2028
|
</div>
|
|
1975
2029
|
</a>
|
|
@@ -1977,53 +2031,53 @@ class ee extends w {
|
|
|
1977
2031
|
</div>` : m}
|
|
1978
2032
|
<div class="section-title">Season context</div>
|
|
1979
2033
|
<div class="cols">
|
|
1980
|
-
${[[t.awayTeamId, r], [t.homeTeamId, o]].map(([
|
|
2034
|
+
${[[t.awayTeamId, r], [t.homeTeamId, o]].map(([d, p]) => this.renderContext(e, d, p))}
|
|
1981
2035
|
</div>
|
|
1982
|
-
${c.length ?
|
|
2036
|
+
${c.length ? h`
|
|
1983
2037
|
<div class="section-title">Head to head this season</div>
|
|
1984
2038
|
<div class="card"><ul class="gamelist">
|
|
1985
|
-
${c.map((
|
|
1986
|
-
<span class="d">${
|
|
1987
|
-
<span class="opp">${
|
|
1988
|
-
<a class="box" href=${
|
|
2039
|
+
${c.map((d) => h`<li>
|
|
2040
|
+
<span class="d">${w(d.date)}</span>${W(d)}
|
|
2041
|
+
<span class="opp">${R(e, d.awayTeamId)} ${d.awayScore}, ${R(e, d.homeTeamId)} ${d.homeScore}</span>
|
|
2042
|
+
<a class="box" href=${v(e.hrefs.game, { sport: t.sport, id: d.id })}>Box score →</a>
|
|
1989
2043
|
</li>`)}
|
|
1990
2044
|
</ul></div>` : m}
|
|
1991
2045
|
`)}
|
|
1992
2046
|
`;
|
|
1993
2047
|
}
|
|
1994
2048
|
teamBlock(t, e, s, r, o) {
|
|
1995
|
-
if (!r) return
|
|
1996
|
-
const
|
|
1997
|
-
return
|
|
2049
|
+
if (!r) return h`<div class="teamblock ${o ? "right" : ""}"><div class="tname">TBD</div></div>`;
|
|
2050
|
+
const n = t.teamsById[s], i = t.records[s], l = tt(r, 58);
|
|
2051
|
+
return h`
|
|
1998
2052
|
<div class="teamblock ${o ? "right" : ""}">
|
|
1999
|
-
${
|
|
2053
|
+
${l ? h`<img class="crest logo" alt="" loading="lazy" src=${l} />` : h`<span class="crest" style="background:${r.colorPrimary || "#030711"};color:${X(r.colorPrimary || "#030711")}">${$t(r)}</span>`}
|
|
2000
2054
|
<div>
|
|
2001
|
-
<div class="tname">${
|
|
2002
|
-
<div class="trec">${r.mascot || ""} · ${
|
|
2055
|
+
<div class="tname">${wt(t, s, e.date)}<a href=${v(t.hrefs.school, { id: r.id })}>${r.name}</a></div>
|
|
2056
|
+
<div class="trec">${r.mascot || ""} · ${k(i)}${n?.conferenceId ? h` · ${k(i, !0)} conf` : m}</div>
|
|
2003
2057
|
</div>
|
|
2004
2058
|
</div>
|
|
2005
2059
|
`;
|
|
2006
2060
|
}
|
|
2007
2061
|
renderLineScore(t, e, s) {
|
|
2008
|
-
const r = t
|
|
2009
|
-
if (!r
|
|
2010
|
-
return
|
|
2011
|
-
const o = Math.max(
|
|
2012
|
-
const p = r.find((
|
|
2062
|
+
const r = cs(t);
|
|
2063
|
+
if (!r)
|
|
2064
|
+
return t.state === "scheduled" ? h`<p class="empty" style="text-align:center">Period scoring will appear once the game starts.</p>` : m;
|
|
2065
|
+
const o = Math.max(kt(t.sport), ...r.map((c) => c.period)), n = (c) => ns(t.sport, c), i = (c, d) => {
|
|
2066
|
+
const p = r.find((u) => u.period === d);
|
|
2013
2067
|
return p ? p[c] : t.state === "final" ? 0 : "·";
|
|
2014
|
-
},
|
|
2068
|
+
}, l = (c, d, p) => h`
|
|
2015
2069
|
<tr>
|
|
2016
|
-
<td class="teamcell">${
|
|
2017
|
-
${Array.from({ length: o }, (
|
|
2070
|
+
<td class="teamcell">${E(c, 20)}${c?.abbr || "TBD"}</td>
|
|
2071
|
+
${Array.from({ length: o }, (u, f) => h`<td class="num">${i(d, f + 1)}</td>`)}
|
|
2018
2072
|
<td class="num" style="font-weight:700">${p}</td>
|
|
2019
2073
|
</tr>`;
|
|
2020
|
-
return
|
|
2074
|
+
return h`
|
|
2021
2075
|
<div class="tablewrap" style="border-top:1px solid var(--hsot-gray-2)">
|
|
2022
2076
|
<table class="data" style="max-width:560px;margin:0.6rem auto 0.9rem">
|
|
2023
|
-
<thead><tr><th>Team</th>${Array.from({ length: o }, (c,
|
|
2077
|
+
<thead><tr><th>Team</th>${Array.from({ length: o }, (c, d) => h`<th class="num">${n(d + 1)}</th>`)}<th class="num">T</th></tr></thead>
|
|
2024
2078
|
<tbody>
|
|
2025
|
-
${
|
|
2026
|
-
${
|
|
2079
|
+
${l(e, "away", t.awayScore)}
|
|
2080
|
+
${l(s, "home", t.homeScore)}
|
|
2027
2081
|
</tbody>
|
|
2028
2082
|
</table>
|
|
2029
2083
|
</div>
|
|
@@ -2032,8 +2086,8 @@ class ee extends w {
|
|
|
2032
2086
|
renderScoringPlays(t, e, s) {
|
|
2033
2087
|
const r = Array.isArray(t.scoringPlays) ? t.scoringPlays : [];
|
|
2034
2088
|
if (!r.length) return m;
|
|
2035
|
-
const o = (
|
|
2036
|
-
return
|
|
2089
|
+
const o = (n) => [n.period, n.clock].filter(Boolean).join(" ");
|
|
2090
|
+
return h`
|
|
2037
2091
|
<div class="plays">
|
|
2038
2092
|
<div class="plays-title">Scoring plays</div>
|
|
2039
2093
|
<div class="tablewrap">
|
|
@@ -2043,11 +2097,11 @@ class ee extends w {
|
|
|
2043
2097
|
<th class="num">${e?.abbr || "Away"}</th><th class="num">${s?.abbr || "Home"}</th>
|
|
2044
2098
|
</tr></thead>
|
|
2045
2099
|
<tbody>
|
|
2046
|
-
${r.map((
|
|
2047
|
-
<td class="when">${o(
|
|
2048
|
-
<td class="play">${
|
|
2049
|
-
<td class="num">${
|
|
2050
|
-
<td class="num">${
|
|
2100
|
+
${r.map((n) => h`<tr>
|
|
2101
|
+
<td class="when">${o(n) || "·"}</td>
|
|
2102
|
+
<td class="play">${n.description || "·"}</td>
|
|
2103
|
+
<td class="num">${n.awayScore}</td>
|
|
2104
|
+
<td class="num">${n.homeScore}</td>
|
|
2051
2105
|
</tr>`)}
|
|
2052
2106
|
</tbody>
|
|
2053
2107
|
</table>
|
|
@@ -2057,24 +2111,24 @@ class ee extends w {
|
|
|
2057
2111
|
}
|
|
2058
2112
|
renderContext(t, e, s) {
|
|
2059
2113
|
if (!s) return m;
|
|
2060
|
-
const r = t.records[e], o =
|
|
2061
|
-
return
|
|
2114
|
+
const r = t.records[e], o = bt(this.data.games, e);
|
|
2115
|
+
return h`
|
|
2062
2116
|
<div class="card ctxcard">
|
|
2063
|
-
<div class="who">${
|
|
2117
|
+
<div class="who">${E(s)}${s.name}</div>
|
|
2064
2118
|
<div class="row">
|
|
2065
|
-
<span>Last 5: ${
|
|
2066
|
-
<span>Streak: <b>${r ?
|
|
2119
|
+
<span>Last 5: ${xt(t, e)}</span>
|
|
2120
|
+
<span>Streak: <b>${r ? nt(r.results) : "·"}</b></span>
|
|
2067
2121
|
<span>PF/PA: <b>${r ? `${r.pf} / ${r.pa}` : "·"}</b></span>
|
|
2068
|
-
<span>Next: ${o ?
|
|
2069
|
-
${o.homeTeamId === e ? "vs" : "at"} ${
|
|
2122
|
+
<span>Next: ${o ? h`${w(o.date, { month: "numeric", day: "numeric" })}
|
|
2123
|
+
${o.homeTeamId === e ? "vs" : "at"} ${et(t, o.homeTeamId === e ? o.awayTeamId : o.homeTeamId)}` : "·"}</span>
|
|
2070
2124
|
</div>
|
|
2071
2125
|
</div>
|
|
2072
2126
|
`;
|
|
2073
2127
|
}
|
|
2074
2128
|
}
|
|
2075
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore",
|
|
2076
|
-
const
|
|
2077
|
-
class
|
|
2129
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore", le);
|
|
2130
|
+
const fs = 250, gs = 2;
|
|
2131
|
+
class ce extends N {
|
|
2078
2132
|
static properties = {
|
|
2079
2133
|
api: { type: String },
|
|
2080
2134
|
schoolHref: { type: String, attribute: "school-href" },
|
|
@@ -2085,7 +2139,7 @@ class se extends E {
|
|
|
2085
2139
|
activeIndex: { state: !0 },
|
|
2086
2140
|
searched: { state: !0 }
|
|
2087
2141
|
};
|
|
2088
|
-
static styles =
|
|
2142
|
+
static styles = y`
|
|
2089
2143
|
:host {
|
|
2090
2144
|
display: block;
|
|
2091
2145
|
position: relative;
|
|
@@ -2154,11 +2208,11 @@ class se extends E {
|
|
|
2154
2208
|
}
|
|
2155
2209
|
onInput(t) {
|
|
2156
2210
|
const e = t.target.value.trim();
|
|
2157
|
-
if (clearTimeout(this.debounceTimer), e.length <
|
|
2211
|
+
if (clearTimeout(this.debounceTimer), e.length < gs) {
|
|
2158
2212
|
this.abortController?.abort(), this.results = [], this.open = !1, this.searched = !1;
|
|
2159
2213
|
return;
|
|
2160
2214
|
}
|
|
2161
|
-
this.debounceTimer = setTimeout(() => this.search(e),
|
|
2215
|
+
this.debounceTimer = setTimeout(() => this.search(e), fs);
|
|
2162
2216
|
}
|
|
2163
2217
|
async search(t) {
|
|
2164
2218
|
this.abortController?.abort(), this.abortController = new AbortController();
|
|
@@ -2206,7 +2260,7 @@ class se extends E {
|
|
|
2206
2260
|
const s = this.where(t), r = (o) => {
|
|
2207
2261
|
o.preventDefault(), this.go(t);
|
|
2208
2262
|
};
|
|
2209
|
-
return
|
|
2263
|
+
return h`
|
|
2210
2264
|
<li
|
|
2211
2265
|
id="school-option-${e}"
|
|
2212
2266
|
role="option"
|
|
@@ -2217,13 +2271,13 @@ class se extends E {
|
|
|
2217
2271
|
}}"
|
|
2218
2272
|
>
|
|
2219
2273
|
<span class="name">${t.name}</span>
|
|
2220
|
-
${s ?
|
|
2274
|
+
${s ? h`<span class="where">${s}</span>` : m}
|
|
2221
2275
|
</li>
|
|
2222
2276
|
`;
|
|
2223
2277
|
}
|
|
2224
2278
|
renderListbox() {
|
|
2225
|
-
const t = this.searched && !this.results.length, e =
|
|
2226
|
-
return
|
|
2279
|
+
const t = this.searched && !this.results.length, e = h`<li class="empty">No schools found</li>`;
|
|
2280
|
+
return h`
|
|
2227
2281
|
<ul id="school-search-listbox" role="listbox" aria-label="Schools">
|
|
2228
2282
|
${this.results.map((s, r) => this.renderOption(s, r))}
|
|
2229
2283
|
${t ? e : m}
|
|
@@ -2232,7 +2286,7 @@ class se extends E {
|
|
|
2232
2286
|
}
|
|
2233
2287
|
render() {
|
|
2234
2288
|
const t = this.activeIndex >= 0 ? `school-option-${this.activeIndex}` : "";
|
|
2235
|
-
return
|
|
2289
|
+
return h`
|
|
2236
2290
|
<input
|
|
2237
2291
|
type="text"
|
|
2238
2292
|
role="combobox"
|
|
@@ -2251,22 +2305,302 @@ class se extends E {
|
|
|
2251
2305
|
`;
|
|
2252
2306
|
}
|
|
2253
2307
|
}
|
|
2254
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search",
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
"
|
|
2260
|
-
|
|
2261
|
-
|
|
2308
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search", ce);
|
|
2309
|
+
function he(a, t) {
|
|
2310
|
+
const e = new Map(a.map((l) => [l.id, l])), s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
2311
|
+
for (const l of t || [])
|
|
2312
|
+
l.outcome === "winner" && (s.has(l.targetGameId) || s.set(l.targetGameId, []), s.get(l.targetGameId).push(l), r.has(l.sourceGameId) || r.set(l.sourceGameId, []), r.get(l.sourceGameId).push(l));
|
|
2313
|
+
const o = a.filter((l) => !r.has(l.id)), n = (l) => l.targetSlot === "home" ? 0 : 1;
|
|
2314
|
+
function i(l) {
|
|
2315
|
+
const c = e.get(l);
|
|
2316
|
+
if (!c) return null;
|
|
2317
|
+
const p = [...s.get(l) || []].sort((u, f) => n(u) - n(f)).map((u) => i(u.sourceGameId)).filter(Boolean);
|
|
2318
|
+
return { game: c, children: p, bracketGroup: c.bracketGroup };
|
|
2319
|
+
}
|
|
2320
|
+
return o.length === 1 ? i(o[0].id) : o.map((l) => i(l.id));
|
|
2321
|
+
}
|
|
2322
|
+
function de(a, t = [], e = 0) {
|
|
2323
|
+
if (!a) return t;
|
|
2324
|
+
t[e] || (t[e] = []), t[e].push(a.game);
|
|
2325
|
+
for (const s of a.children || []) de(s, t, e + 1);
|
|
2326
|
+
return t;
|
|
2327
|
+
}
|
|
2328
|
+
const vs = (a) => Math.max(1, Math.round(Math.log2(a || 2)));
|
|
2329
|
+
function $s({ round: a, perGroup: t, groupCount: e = 1 }) {
|
|
2330
|
+
const s = vs(t), o = (e === 4 ? s + 2 : e === 2 ? s + 1 : s) - a;
|
|
2331
|
+
return o === 0 ? e > 1 ? "Championship" : "Final" : o === 1 ? "Semifinal" : `Round ${a}`;
|
|
2332
|
+
}
|
|
2333
|
+
function bs(a) {
|
|
2334
|
+
if (!a || !a.length) return "setup";
|
|
2335
|
+
const t = Math.max(...a.map((s) => s.round ?? 0)), e = a.filter((s) => (s.round ?? 0) === t);
|
|
2336
|
+
return e.length && e.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";
|
|
2337
|
+
}
|
|
2338
|
+
function ys(a, t) {
|
|
2339
|
+
const e = a?.groupNames || [];
|
|
2340
|
+
if (e.length >= 2) {
|
|
2341
|
+
const r = e.map((o) => ({ key: o, name: o }));
|
|
2342
|
+
return (t || []).some((o) => o.bracketGroup === "Championship") && r.push({ key: "Championship", name: "Championship" }), r;
|
|
2343
|
+
}
|
|
2344
|
+
const s = [...new Set((t || []).map((r) => r.bracketGroup).filter(Boolean))];
|
|
2345
|
+
return [{ key: null, name: s.length === 1 ? s[0] : "Bracket" }];
|
|
2346
|
+
}
|
|
2347
|
+
const ws = (a, t) => t?.key == null ? [...a || []] : (a || []).filter((e) => e.bracketGroup === t.key), Ut = (a) => {
|
|
2348
|
+
const t = /(\d+)\s*$/.exec(a.label || "");
|
|
2349
|
+
return t ? Number(t[1]) : 1 / 0;
|
|
2350
|
+
}, Ht = (a, t) => Ut(a) - Ut(t) || String(a.id).localeCompare(String(t.id));
|
|
2351
|
+
function xs(a, t) {
|
|
2352
|
+
if (a.every((r) => Number.isInteger(r.round))) return (r) => r.round;
|
|
2353
|
+
const e = he(a, t), s = /* @__PURE__ */ new Map();
|
|
2354
|
+
for (const r of Array.isArray(e) ? e : [e]) {
|
|
2355
|
+
const o = de(r), n = o.length - 1;
|
|
2356
|
+
o.forEach((i, l) => i.forEach((c) => s.set(c.id, n - l + 1)));
|
|
2357
|
+
}
|
|
2358
|
+
return (r) => Number.isInteger(r.round) ? r.round : s.get(r.id) || 1;
|
|
2359
|
+
}
|
|
2360
|
+
function ks(a, t, e) {
|
|
2361
|
+
const s = ws(a, e);
|
|
2362
|
+
if (!s.length) return [];
|
|
2363
|
+
const r = xs(a || [], t || []), o = /* @__PURE__ */ new Map();
|
|
2364
|
+
for (const c of s) {
|
|
2365
|
+
const d = r(c);
|
|
2366
|
+
o.has(d) || o.set(d, []), o.get(d).push(c);
|
|
2367
|
+
}
|
|
2368
|
+
const n = /* @__PURE__ */ new Map();
|
|
2369
|
+
for (const c of t || [])
|
|
2370
|
+
c.outcome === "winner" && (n.has(c.targetGameId) || n.set(c.targetGameId, []), n.get(c.targetGameId).push(c.sourceGameId));
|
|
2371
|
+
const i = [];
|
|
2372
|
+
let l = null;
|
|
2373
|
+
for (const c of [...o.keys()].sort((d, p) => d - p)) {
|
|
2374
|
+
let d = [...o.get(c)];
|
|
2375
|
+
if (l) {
|
|
2376
|
+
const p = (u) => {
|
|
2377
|
+
const f = (n.get(u.id) || []).map((g) => l.get(g)).filter((g) => g !== void 0);
|
|
2378
|
+
return f.length ? Math.min(...f) : 1 / 0;
|
|
2379
|
+
};
|
|
2380
|
+
d.sort((u, f) => p(u) - p(f) || Ht(u, f));
|
|
2381
|
+
} else
|
|
2382
|
+
d.sort(Ht);
|
|
2383
|
+
l = new Map(d.map((p, u) => [p.id, u])), i.push({ round: c, games: d });
|
|
2384
|
+
}
|
|
2385
|
+
return i;
|
|
2386
|
+
}
|
|
2387
|
+
function Ss(a, t, e) {
|
|
2388
|
+
const s = a[`${t}TeamId`] || null, r = (e || []).find((n) => n.gameId === a.id && n.slot === t), o = a[`${t}Seed`] ?? r?.seed ?? null;
|
|
2389
|
+
return { teamId: s, seed: o, bye: !s && !!r?.isBye };
|
|
2390
|
+
}
|
|
2391
|
+
function pe(a) {
|
|
2392
|
+
const t = ot(a);
|
|
2393
|
+
return t === "home" || t === "away" ? t : null;
|
|
2394
|
+
}
|
|
2395
|
+
function _s(a, t) {
|
|
2396
|
+
const e = he(a || [], t || []);
|
|
2397
|
+
if (!e || Array.isArray(e)) return null;
|
|
2398
|
+
const s = pe(e.game);
|
|
2399
|
+
return s && e.game[`${s}TeamId`] || null;
|
|
2400
|
+
}
|
|
2401
|
+
const Lt = { active: 0, setup: 1, complete: 2 };
|
|
2402
|
+
function As(a, { id: t, param: e } = {}) {
|
|
2403
|
+
const s = a || [];
|
|
2404
|
+
if (!s.length) return null;
|
|
2405
|
+
for (const r of [t, e]) {
|
|
2406
|
+
if (!r) continue;
|
|
2407
|
+
const o = s.find((n) => n.id === r);
|
|
2408
|
+
if (o) return o;
|
|
2409
|
+
}
|
|
2410
|
+
return [...s].sort((r, o) => (Lt[r.status] ?? 3) - (Lt[o.status] ?? 3) || String(r.name || "").localeCompare(String(o.name || "")))[0];
|
|
2411
|
+
}
|
|
2412
|
+
const Ts = y`
|
|
2413
|
+
.bracket { display: flex; gap: 1rem; align-items: stretch; overflow-x: auto; padding-bottom: 0.5rem; }
|
|
2414
|
+
.round { flex: 0 0 250px; display: flex; flex-direction: column; min-width: 0; }
|
|
2415
|
+
.roundhead {
|
|
2416
|
+
margin: 0 0 0.6rem; padding-bottom: 0.35rem; border-bottom: 3px solid var(--hsot-gray-2);
|
|
2417
|
+
font-family: var(--hsot-heading-font); font-weight: 700; font-size: 0.8rem;
|
|
2418
|
+
text-transform: uppercase; letter-spacing: 0.04em; color: var(--hsot-gray-6);
|
|
2419
|
+
}
|
|
2420
|
+
/* Equal-flex bands center each matchup between the two that feed it. */
|
|
2421
|
+
.games { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 0.6rem; }
|
|
2422
|
+
.matchup {
|
|
2423
|
+
background: var(--hsot-white); border: 1px solid var(--hsot-gray-2);
|
|
2424
|
+
border-radius: var(--hsot-radius-md); overflow: hidden;
|
|
2425
|
+
}
|
|
2426
|
+
.matchup.live { border-color: var(--hsot-red); }
|
|
2427
|
+
.slot { display: flex; align-items: center; gap: 0.45rem; padding: 0.45rem 0.6rem; font-size: 0.9rem; min-height: 2.1rem; box-sizing: border-box; }
|
|
2428
|
+
.slot + .slot { border-top: 1px solid var(--hsot-gray-2); }
|
|
2429
|
+
.slot .seed {
|
|
2430
|
+
flex: none; width: 1.3rem; text-align: right; font-family: var(--hsot-heading-font);
|
|
2431
|
+
font-size: 0.75rem; color: var(--hsot-gray-5); font-variant-numeric: tabular-nums;
|
|
2432
|
+
}
|
|
2433
|
+
.slot .swatch { margin-right: 0; }
|
|
2434
|
+
.slot .tname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
2435
|
+
.slot .tname a { color: inherit; text-decoration: none; font-weight: 500; }
|
|
2436
|
+
.slot .tname a:hover { text-decoration: underline; }
|
|
2437
|
+
.slot .tname.bye { font-style: italic; color: var(--hsot-gray-5); }
|
|
2438
|
+
.slot .score {
|
|
2439
|
+
flex: none; min-width: 1.6rem; text-align: right; font-family: var(--hsot-heading-font);
|
|
2440
|
+
font-weight: 700; font-variant-numeric: tabular-nums;
|
|
2441
|
+
}
|
|
2442
|
+
.slot.winner .tname a, .slot.winner .tname { font-weight: 700; }
|
|
2443
|
+
.slot.winner .score { color: var(--hsot-red-deep); }
|
|
2444
|
+
.slot.loser { color: var(--hsot-gray-5); }
|
|
2445
|
+
.mfoot {
|
|
2446
|
+
display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.6rem;
|
|
2447
|
+
background: var(--hsot-gray-1); border-top: 1px solid var(--hsot-gray-2); font-size: 0.75rem;
|
|
2448
|
+
}
|
|
2449
|
+
.mfoot .spacer { flex: 1; }
|
|
2450
|
+
.mfoot .label { color: var(--hsot-gray-5); font-family: var(--hsot-heading-font); }
|
|
2451
|
+
.champ {
|
|
2452
|
+
display: flex; align-items: center; gap: 0.5rem; margin: 0 0 1rem;
|
|
2453
|
+
font-family: var(--hsot-heading-font); font-size: 1.05rem;
|
|
2454
|
+
}
|
|
2455
|
+
.champ .tname a { color: inherit; text-decoration: none; font-weight: 700; }
|
|
2456
|
+
@media (max-width: 720px) { .round { flex-basis: 215px; } }
|
|
2457
|
+
`;
|
|
2458
|
+
class me extends b {
|
|
2459
|
+
static styles = [U, Ts];
|
|
2460
|
+
static properties = {
|
|
2461
|
+
...b.properties,
|
|
2462
|
+
sport: { type: String },
|
|
2463
|
+
season: { type: String },
|
|
2464
|
+
tournamentId: { type: String, attribute: "tournament-id" },
|
|
2465
|
+
picked: { state: !0 },
|
|
2466
|
+
group: { state: !0 }
|
|
2467
|
+
};
|
|
2468
|
+
constructor() {
|
|
2469
|
+
super(), this.sport = "football", this.season = "", this.tournamentId = "", this.picked = "", this.group = null;
|
|
2470
|
+
}
|
|
2471
|
+
async fetchData(t) {
|
|
2472
|
+
const e = this.season || Y(), s = (await t.listTournaments({ sport: this.sport, season: e })).items, r = new URLSearchParams(globalThis.location?.search || "").get("tournament"), o = As(s, { id: this.picked || this.tournamentId, param: r });
|
|
2473
|
+
if (!o) return { season: e, tournaments: s, tournament: null };
|
|
2474
|
+
const [n, i, l, c, d] = await Promise.all([
|
|
2475
|
+
t.listSeedings(o.id),
|
|
2476
|
+
t.listEdges(o.id),
|
|
2477
|
+
t.listGames({ tournamentId: o.id }),
|
|
2478
|
+
t.listSchools(),
|
|
2479
|
+
t.listTeams({ sport: this.sport })
|
|
2480
|
+
]);
|
|
2481
|
+
return {
|
|
2482
|
+
season: e,
|
|
2483
|
+
tournaments: s,
|
|
2484
|
+
tournament: o,
|
|
2485
|
+
seedings: n.items,
|
|
2486
|
+
edges: i.items,
|
|
2487
|
+
games: l.items,
|
|
2488
|
+
schools: c.items,
|
|
2489
|
+
teams: d.items
|
|
2490
|
+
};
|
|
2491
|
+
}
|
|
2492
|
+
get ctx() {
|
|
2493
|
+
return (!this._ctx || this._ctxData !== this.data) && (this._ctx = {
|
|
2494
|
+
teamsById: $(this.data.teams),
|
|
2495
|
+
schoolsById: $(this.data.schools),
|
|
2496
|
+
records: {},
|
|
2497
|
+
rankings: [],
|
|
2498
|
+
hrefs: O(this),
|
|
2499
|
+
sport: this.sport
|
|
2500
|
+
}, this._ctxData = this.data), this._ctx;
|
|
2501
|
+
}
|
|
2502
|
+
/** Switch tournaments: remember the pick, deep-link it, reload the scoped data. */
|
|
2503
|
+
pick(t) {
|
|
2504
|
+
if (t !== this.data?.tournament?.id) {
|
|
2505
|
+
this.picked = t, this.group = null;
|
|
2506
|
+
try {
|
|
2507
|
+
const e = new URL(globalThis.location.href);
|
|
2508
|
+
e.searchParams.set("tournament", t), globalThis.history?.replaceState(null, "", e);
|
|
2509
|
+
} catch {
|
|
2510
|
+
}
|
|
2511
|
+
this.load();
|
|
2512
|
+
}
|
|
2513
|
+
}
|
|
2514
|
+
renderView() {
|
|
2515
|
+
const t = this.data, e = this.ctx, s = it(this, e, {
|
|
2516
|
+
title: h`${B(this.sport)} playoff brackets`,
|
|
2517
|
+
sub: t.tournament ? h`${t.tournament.name} · ${t.season} season` : h`${t.season} season`,
|
|
2518
|
+
teams: t.teams
|
|
2519
|
+
});
|
|
2520
|
+
if (!t.tournament)
|
|
2521
|
+
return h`${s}${P(this, h`
|
|
2522
|
+
${D(this)}
|
|
2523
|
+
<div class="card"><div class="empty">No ${this.sport} brackets have been published for the ${t.season} season yet.</div></div>
|
|
2524
|
+
`)}`;
|
|
2525
|
+
const r = ys(t.tournament, t.games), o = r.find((p) => p.key === this.group) || r[0], n = (t.tournament.groupNames || []).length >= 2 ? t.tournament.groupNames.length : 1, i = (Number(t.tournament.size) || 0) / n, l = ks(t.games, t.edges, o), c = bs(t.games), d = _s(t.games, t.edges);
|
|
2526
|
+
return h`
|
|
2527
|
+
${s}
|
|
2528
|
+
${P(this, h`
|
|
2529
|
+
${D(this)}
|
|
2530
|
+
<div class="toolbar">
|
|
2531
|
+
${t.tournaments.length > 1 ? h`
|
|
2532
|
+
<div role="group" aria-label="Tournament">
|
|
2533
|
+
${t.tournaments.map((p) => h`<button class="chip ${p.id === t.tournament.id ? "on" : ""}"
|
|
2534
|
+
@click=${() => this.pick(p.id)}>${p.name}</button>`)}
|
|
2535
|
+
</div>` : m}
|
|
2536
|
+
${r.length > 1 ? h`
|
|
2537
|
+
<div role="tablist" aria-label="Bracket group">
|
|
2538
|
+
${r.map((p) => h`<button class="chip ${p.key === o.key ? "on" : ""}" role="tab"
|
|
2539
|
+
aria-selected=${p.key === o.key ? "true" : "false"}
|
|
2540
|
+
@click=${() => {
|
|
2541
|
+
this.group = p.key;
|
|
2542
|
+
}}>${p.name}</button>`)}
|
|
2543
|
+
</div>` : m}
|
|
2544
|
+
<span class="spacer"></span>
|
|
2545
|
+
<span class="pill ${c === "complete" ? "final" : c === "active" ? "class" : "type"}">${c === "complete" ? "Complete" : c === "active" ? "In progress" : "Bracket set"}</span>
|
|
2546
|
+
<span class="asof">${t.tournament.size}-team ${String(t.tournament.format || "").replace(/_/g, " ")}</span>
|
|
2547
|
+
</div>
|
|
2548
|
+
${d ? h`<div class="champ"><span class="pill champ">Champion</span>
|
|
2549
|
+
${E(C(e, d), 26)}<span class="tname">${st(e, d)}</span></div>` : m}
|
|
2550
|
+
${l.length ? h`
|
|
2551
|
+
<div class="bracket" role="region" aria-label="${o.name} bracket">
|
|
2552
|
+
${l.map((p) => h`
|
|
2553
|
+
<section class="round">
|
|
2554
|
+
<h3 class="roundhead">${$s({ round: p.round, perGroup: i, groupCount: n })}</h3>
|
|
2555
|
+
<div class="games">${p.games.map((u) => this.renderMatchup(e, u))}</div>
|
|
2556
|
+
</section>`)}
|
|
2557
|
+
</div>` : h`<div class="card"><div class="empty">This bracket has no games yet.</div></div>`}
|
|
2558
|
+
`)}
|
|
2559
|
+
`;
|
|
2560
|
+
}
|
|
2561
|
+
renderMatchup(t, e) {
|
|
2562
|
+
const s = e.homeTeamId && e.awayTeamId || e.state === "final" || e.state === "live";
|
|
2563
|
+
return h`
|
|
2564
|
+
<article class="matchup ${e.state}" aria-label="${e.label || "Matchup"}">
|
|
2565
|
+
${this.renderSlot(t, e, "home")}
|
|
2566
|
+
${this.renderSlot(t, e, "away")}
|
|
2567
|
+
<footer class="mfoot">
|
|
2568
|
+
${W(e)}
|
|
2569
|
+
${e.label ? h`<span class="label">${e.label}</span>` : m}
|
|
2570
|
+
<span class="spacer"></span>
|
|
2571
|
+
${s ? h`<a class="box" href=${v(t.hrefs.game, { sport: this.sport, id: e.id })}>Box score</a>` : m}
|
|
2572
|
+
</footer>
|
|
2573
|
+
</article>
|
|
2574
|
+
`;
|
|
2575
|
+
}
|
|
2576
|
+
renderSlot(t, e, s) {
|
|
2577
|
+
const { teamId: r, seed: o, bye: n } = Ss(e, s, this.data.seedings), i = pe(e), l = e.state === "live" || e.state === "final";
|
|
2578
|
+
return h`
|
|
2579
|
+
<div class="slot ${i ? i === s ? "winner" : "loser" : ""}">
|
|
2580
|
+
<span class="seed">${o ?? ""}</span>
|
|
2581
|
+
${r ? h`${E(C(t, r), 22)}<span class="tname">${st(t, r, e.date)}</span>` : n ? h`<span class="tname bye">Bye</span>` : h`<span class="tname mut">TBD</span>`}
|
|
2582
|
+
${l ? h`<span class="score">${e[`${s}Score`] ?? 0}</span>` : m}
|
|
2583
|
+
</div>
|
|
2584
|
+
`;
|
|
2585
|
+
}
|
|
2586
|
+
}
|
|
2587
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-brackets") && globalThis.customElements.define("hsot-brackets", me);
|
|
2588
|
+
const Is = {
|
|
2589
|
+
"hsot-scores": ee,
|
|
2590
|
+
"hsot-standings": se,
|
|
2591
|
+
"hsot-rankings": ae,
|
|
2592
|
+
"hsot-school": re,
|
|
2593
|
+
"hsot-boxscore": le,
|
|
2594
|
+
"hsot-school-search": ce,
|
|
2595
|
+
"hsot-brackets": me
|
|
2262
2596
|
};
|
|
2263
|
-
function
|
|
2597
|
+
function Cs() {
|
|
2264
2598
|
const a = globalThis?.customElements;
|
|
2265
2599
|
if (a)
|
|
2266
|
-
for (const [t, e] of Object.entries(
|
|
2600
|
+
for (const [t, e] of Object.entries(Is))
|
|
2267
2601
|
a.get(t) || a.define(t, e);
|
|
2268
2602
|
}
|
|
2269
|
-
typeof window < "u" && globalThis.customElements &&
|
|
2603
|
+
typeof window < "u" && globalThis.customElements && Cs();
|
|
2270
2604
|
export {
|
|
2271
|
-
|
|
2605
|
+
Cs as defineAll
|
|
2272
2606
|
};
|