@wral/hsot-data 0.1.7 → 0.1.9
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 +4 -4
- package/dist/define.mjs +1 -1
- package/dist/define.standalone.js +512 -469
- package/dist/{hsot-school-search-31NEMjUb.js → hsot-school-search-D1W24ixG.js} +480 -437
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const V = globalThis,
|
|
2
|
-
let
|
|
1
|
+
const V = globalThis, nt = V.ShadowRoot && (V.ShadyCSS === void 0 || V.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, lt = /* @__PURE__ */ Symbol(), wt = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
let Ft = class {
|
|
3
3
|
constructor(t, e, s) {
|
|
4
|
-
if (this._$cssResult$ = !0, s !==
|
|
4
|
+
if (this._$cssResult$ = !0, s !== lt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
5
5
|
this.cssText = t, this.t = e;
|
|
6
6
|
}
|
|
7
7
|
get styleSheet() {
|
|
8
8
|
let t = this.o;
|
|
9
9
|
const e = this.t;
|
|
10
|
-
if (
|
|
10
|
+
if (nt && t === void 0) {
|
|
11
11
|
const s = e !== void 0 && e.length === 1;
|
|
12
|
-
s && (t =
|
|
12
|
+
s && (t = wt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && wt.set(e, t));
|
|
13
13
|
}
|
|
14
14
|
return t;
|
|
15
15
|
}
|
|
@@ -17,53 +17,53 @@ let Nt = class {
|
|
|
17
17
|
return this.cssText;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const
|
|
21
|
-
const e =
|
|
20
|
+
const se = (a) => new Ft(typeof a == "string" ? a : a + "", void 0, lt), b = (a, ...t) => {
|
|
21
|
+
const e = a.length === 1 ? a[0] : t.reduce((s, r, o) => s + ((i) => {
|
|
22
22
|
if (i._$cssResult$ === !0) return i.cssText;
|
|
23
23
|
if (typeof i == "number") return i;
|
|
24
24
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + i + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
25
|
-
})(
|
|
26
|
-
return new
|
|
27
|
-
},
|
|
28
|
-
if (
|
|
25
|
+
})(r) + a[o + 1], a[0]);
|
|
26
|
+
return new Ft(e, a, lt);
|
|
27
|
+
}, ae = (a, t) => {
|
|
28
|
+
if (nt) a.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
29
29
|
else for (const e of t) {
|
|
30
|
-
const s = document.createElement("style"),
|
|
31
|
-
|
|
30
|
+
const s = document.createElement("style"), r = V.litNonce;
|
|
31
|
+
r !== void 0 && s.setAttribute("nonce", r), s.textContent = e.cssText, a.appendChild(s);
|
|
32
32
|
}
|
|
33
|
-
},
|
|
33
|
+
}, xt = nt ? (a) => a : (a) => a instanceof CSSStyleSheet ? ((t) => {
|
|
34
34
|
let e = "";
|
|
35
35
|
for (const s of t.cssRules) e += s.cssText;
|
|
36
|
-
return
|
|
37
|
-
})(
|
|
38
|
-
const { is: re, defineProperty:
|
|
36
|
+
return se(e);
|
|
37
|
+
})(a) : a;
|
|
38
|
+
const { is: re, defineProperty: oe, getOwnPropertyDescriptor: ie, getOwnPropertyNames: ne, getOwnPropertySymbols: le, getPrototypeOf: ce } = Object, X = globalThis, kt = X.trustedTypes, he = kt ? kt.emptyScript : "", de = X.reactiveElementPolyfillSupport, B = (a, t) => a, it = { toAttribute(a, t) {
|
|
39
39
|
switch (t) {
|
|
40
40
|
case Boolean:
|
|
41
|
-
|
|
41
|
+
a = a ? he : null;
|
|
42
42
|
break;
|
|
43
43
|
case Object:
|
|
44
44
|
case Array:
|
|
45
|
-
|
|
45
|
+
a = a == null ? a : JSON.stringify(a);
|
|
46
46
|
}
|
|
47
|
-
return
|
|
48
|
-
}, fromAttribute(
|
|
49
|
-
let e =
|
|
47
|
+
return a;
|
|
48
|
+
}, fromAttribute(a, t) {
|
|
49
|
+
let e = a;
|
|
50
50
|
switch (t) {
|
|
51
51
|
case Boolean:
|
|
52
|
-
e =
|
|
52
|
+
e = a !== null;
|
|
53
53
|
break;
|
|
54
54
|
case Number:
|
|
55
|
-
e =
|
|
55
|
+
e = a === null ? null : Number(a);
|
|
56
56
|
break;
|
|
57
57
|
case Object:
|
|
58
58
|
case Array:
|
|
59
59
|
try {
|
|
60
|
-
e = JSON.parse(
|
|
60
|
+
e = JSON.parse(a);
|
|
61
61
|
} catch {
|
|
62
62
|
e = null;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
return e;
|
|
66
|
-
} },
|
|
66
|
+
} }, Nt = (a, t) => !re(a, t), _t = { attribute: !0, type: String, converter: it, reflect: !1, useDefault: !1, hasChanged: Nt };
|
|
67
67
|
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), X.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
68
|
let I = class extends HTMLElement {
|
|
69
69
|
static addInitializer(t) {
|
|
@@ -72,46 +72,46 @@ let I = class extends HTMLElement {
|
|
|
72
72
|
static get observedAttributes() {
|
|
73
73
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
74
74
|
}
|
|
75
|
-
static createProperty(t, e =
|
|
75
|
+
static createProperty(t, e = _t) {
|
|
76
76
|
if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
77
|
-
const s = /* @__PURE__ */ Symbol(),
|
|
78
|
-
|
|
77
|
+
const s = /* @__PURE__ */ Symbol(), r = this.getPropertyDescriptor(t, s, e);
|
|
78
|
+
r !== void 0 && oe(this.prototype, t, r);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
static getPropertyDescriptor(t, e, s) {
|
|
82
|
-
const { get:
|
|
82
|
+
const { get: r, set: o } = ie(this.prototype, t) ?? { get() {
|
|
83
83
|
return this[e];
|
|
84
84
|
}, set(i) {
|
|
85
85
|
this[e] = i;
|
|
86
86
|
} };
|
|
87
|
-
return { get:
|
|
88
|
-
const n =
|
|
87
|
+
return { get: r, set(i) {
|
|
88
|
+
const n = r?.call(this);
|
|
89
89
|
o?.call(this, i), this.requestUpdate(t, n, s);
|
|
90
90
|
}, configurable: !0, enumerable: !0 };
|
|
91
91
|
}
|
|
92
92
|
static getPropertyOptions(t) {
|
|
93
|
-
return this.elementProperties.get(t) ??
|
|
93
|
+
return this.elementProperties.get(t) ?? _t;
|
|
94
94
|
}
|
|
95
95
|
static _$Ei() {
|
|
96
96
|
if (this.hasOwnProperty(B("elementProperties"))) return;
|
|
97
|
-
const t =
|
|
97
|
+
const t = ce(this);
|
|
98
98
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
99
99
|
}
|
|
100
100
|
static finalize() {
|
|
101
101
|
if (this.hasOwnProperty(B("finalized"))) return;
|
|
102
102
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(B("properties"))) {
|
|
103
|
-
const e = this.properties, s = [...
|
|
104
|
-
for (const
|
|
103
|
+
const e = this.properties, s = [...ne(e), ...le(e)];
|
|
104
|
+
for (const r of s) this.createProperty(r, e[r]);
|
|
105
105
|
}
|
|
106
106
|
const t = this[Symbol.metadata];
|
|
107
107
|
if (t !== null) {
|
|
108
108
|
const e = litPropertyMetadata.get(t);
|
|
109
|
-
if (e !== void 0) for (const [s,
|
|
109
|
+
if (e !== void 0) for (const [s, r] of e) this.elementProperties.set(s, r);
|
|
110
110
|
}
|
|
111
111
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
112
112
|
for (const [e, s] of this.elementProperties) {
|
|
113
|
-
const
|
|
114
|
-
|
|
113
|
+
const r = this._$Eu(e, s);
|
|
114
|
+
r !== void 0 && this._$Eh.set(r, e);
|
|
115
115
|
}
|
|
116
116
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
117
117
|
}
|
|
@@ -119,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
|
|
123
|
-
} else t !== void 0 && e.push(
|
|
122
|
+
for (const r of s) e.unshift(xt(r));
|
|
123
|
+
} else t !== void 0 && e.push(xt(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 ae(t, this.constructor.elementStyles), t;
|
|
150
150
|
}
|
|
151
151
|
connectedCallback() {
|
|
152
152
|
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((t) => t.hostConnected?.());
|
|
@@ -160,31 +160,31 @@ let I = class extends HTMLElement {
|
|
|
160
160
|
this._$AK(t, s);
|
|
161
161
|
}
|
|
162
162
|
_$ET(t, e) {
|
|
163
|
-
const s = this.constructor.elementProperties.get(t),
|
|
164
|
-
if (
|
|
163
|
+
const s = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, s);
|
|
164
|
+
if (r !== void 0 && s.reflect === !0) {
|
|
165
165
|
const o = (s.converter?.toAttribute !== void 0 ? s.converter : it).toAttribute(e, s.type);
|
|
166
|
-
this._$Em = t, o == null ? this.removeAttribute(
|
|
166
|
+
this._$Em = t, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
_$AK(t, e) {
|
|
170
|
-
const s = this.constructor,
|
|
171
|
-
if (
|
|
172
|
-
const o = s.getPropertyOptions(
|
|
173
|
-
this._$Em =
|
|
170
|
+
const s = this.constructor, r = s._$Eh.get(t);
|
|
171
|
+
if (r !== void 0 && this._$Em !== r) {
|
|
172
|
+
const o = s.getPropertyOptions(r), i = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : it;
|
|
173
|
+
this._$Em = r;
|
|
174
174
|
const n = i.fromAttribute(e, o.type);
|
|
175
|
-
this[
|
|
175
|
+
this[r] = n ?? this._$Ej?.get(r) ?? n, this._$Em = null;
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
requestUpdate(t, e, s,
|
|
178
|
+
requestUpdate(t, e, s, r = !1, o) {
|
|
179
179
|
if (t !== void 0) {
|
|
180
180
|
const i = this.constructor;
|
|
181
|
-
if (
|
|
181
|
+
if (r === !1 && (o = this[t]), s ??= i.getPropertyOptions(t), !((s.hasChanged ?? Nt)(o, e) || s.useDefault && s.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(i._$Eu(t, s)))) return;
|
|
182
182
|
this.C(t, e, s);
|
|
183
183
|
}
|
|
184
184
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
185
185
|
}
|
|
186
|
-
C(t, e, { useDefault: s, reflect:
|
|
187
|
-
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, i ?? e ?? this[t]), o !== !0 || i !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)),
|
|
186
|
+
C(t, e, { useDefault: s, reflect: r, wrapped: o }, i) {
|
|
187
|
+
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, i ?? e ?? this[t]), o !== !0 || i !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), r === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
|
|
188
188
|
}
|
|
189
189
|
async _$EP() {
|
|
190
190
|
this.isUpdatePending = !0;
|
|
@@ -203,13 +203,13 @@ let I = class extends HTMLElement {
|
|
|
203
203
|
if (!this.isUpdatePending) return;
|
|
204
204
|
if (!this.hasUpdated) {
|
|
205
205
|
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
206
|
-
for (const [
|
|
206
|
+
for (const [r, o] of this._$Ep) this[r] = o;
|
|
207
207
|
this._$Ep = void 0;
|
|
208
208
|
}
|
|
209
209
|
const s = this.constructor.elementProperties;
|
|
210
|
-
if (s.size > 0) for (const [
|
|
211
|
-
const { wrapped: i } = o, n = this[
|
|
212
|
-
i !== !0 || this._$AL.has(
|
|
210
|
+
if (s.size > 0) for (const [r, o] of s) {
|
|
211
|
+
const { wrapped: i } = o, n = this[r];
|
|
212
|
+
i !== !0 || this._$AL.has(r) || n === void 0 || this.C(r, void 0, o, n);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
let t = !1;
|
|
@@ -246,54 +246,54 @@ let I = class extends HTMLElement {
|
|
|
246
246
|
firstUpdated(t) {
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
I.elementStyles = [], I.shadowRootOptions = { mode: "open" }, I[B("elementProperties")] = /* @__PURE__ */ new Map(), I[B("finalized")] = /* @__PURE__ */ new Map(),
|
|
250
|
-
const
|
|
251
|
-
\f\r]`,
|
|
252
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), Ct = /'/g,
|
|
253
|
-
function
|
|
254
|
-
if (!
|
|
255
|
-
return
|
|
256
|
-
}
|
|
257
|
-
const
|
|
258
|
-
const e =
|
|
259
|
-
let
|
|
249
|
+
I.elementStyles = [], I.shadowRootOptions = { mode: "open" }, I[B("elementProperties")] = /* @__PURE__ */ new Map(), I[B("finalized")] = /* @__PURE__ */ new Map(), de?.({ ReactiveElement: I }), (X.reactiveElementVersions ??= []).push("2.1.2");
|
|
250
|
+
const ct = globalThis, St = (a) => a, Y = ct.trustedTypes, At = Y ? Y.createPolicy("lit-html", { createHTML: (a) => a }) : void 0, Ut = "$lit$", k = `lit$${Math.random().toFixed(9).slice(2)}$`, Ot = "?" + k, pe = `<${Ot}>`, T = document, F = () => T.createComment(""), N = (a) => a === null || typeof a != "object" && typeof a != "function", ht = Array.isArray, me = (a) => ht(a) || typeof a?.[Symbol.iterator] == "function", rt = `[
|
|
251
|
+
\f\r]`, R = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Tt = /-->/g, It = />/g, S = RegExp(`>|${rt}(?:([^\\s"'>=/]+)(${rt}*=${rt}*(?:[^
|
|
252
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Ct = /'/g, Et = /"/g, Ht = /^(?:script|style|textarea|title)$/i, Mt = (a) => (t, ...e) => ({ _$litType$: a, strings: t, values: e }), l = Mt(1), Pt = Mt(2), P = /* @__PURE__ */ Symbol.for("lit-noChange"), m = /* @__PURE__ */ Symbol.for("lit-nothing"), Dt = /* @__PURE__ */ new WeakMap(), A = T.createTreeWalker(T, 129);
|
|
253
|
+
function Lt(a, t) {
|
|
254
|
+
if (!ht(a) || !a.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
|
+
return At !== void 0 ? At.createHTML(t) : t;
|
|
256
|
+
}
|
|
257
|
+
const fe = (a, t) => {
|
|
258
|
+
const e = a.length - 1, s = [];
|
|
259
|
+
let r, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", i = R;
|
|
260
260
|
for (let n = 0; n < e; n++) {
|
|
261
|
-
const d =
|
|
261
|
+
const d = a[n];
|
|
262
262
|
let c, h, p = -1, f = 0;
|
|
263
|
-
for (; f < d.length && (i.lastIndex = f, h = i.exec(d), h !== null); ) f = i.lastIndex, i ===
|
|
264
|
-
const u = i === S &&
|
|
265
|
-
o += i ===
|
|
263
|
+
for (; f < d.length && (i.lastIndex = f, h = i.exec(d), h !== null); ) f = i.lastIndex, i === R ? h[1] === "!--" ? i = Tt : h[1] !== void 0 ? i = It : h[2] !== void 0 ? (Ht.test(h[2]) && (r = RegExp("</" + h[2], "g")), i = S) : h[3] !== void 0 && (i = S) : i === S ? h[0] === ">" ? (i = r ?? R, p = -1) : h[1] === void 0 ? p = -2 : (p = i.lastIndex - h[2].length, c = h[1], i = h[3] === void 0 ? S : h[3] === '"' ? Et : Ct) : i === Et || i === Ct ? i = S : i === Tt || i === It ? i = R : (i = S, r = void 0);
|
|
264
|
+
const u = i === S && a[n + 1].startsWith("/>") ? " " : "";
|
|
265
|
+
o += i === R ? d + pe : p >= 0 ? (s.push(c), d.slice(0, p) + Ut + d.slice(p) + k + u) : d + k + (p === -2 ? n : u);
|
|
266
266
|
}
|
|
267
|
-
return [
|
|
267
|
+
return [Lt(a, o + (a[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
268
268
|
};
|
|
269
|
-
class
|
|
269
|
+
class U {
|
|
270
270
|
constructor({ strings: t, _$litType$: e }, s) {
|
|
271
|
-
let
|
|
271
|
+
let r;
|
|
272
272
|
this.parts = [];
|
|
273
273
|
let o = 0, i = 0;
|
|
274
|
-
const n = t.length - 1, d = this.parts, [c, h] =
|
|
275
|
-
if (this.el =
|
|
274
|
+
const n = t.length - 1, d = this.parts, [c, h] = fe(t, e);
|
|
275
|
+
if (this.el = U.createElement(c, s), A.currentNode = this.el.content, e === 2 || e === 3) {
|
|
276
276
|
const p = this.el.content.firstChild;
|
|
277
277
|
p.replaceWith(...p.childNodes);
|
|
278
278
|
}
|
|
279
|
-
for (; (
|
|
280
|
-
if (
|
|
281
|
-
if (
|
|
282
|
-
const f = h[i++], u =
|
|
283
|
-
d.push({ type: 1, index: o, name: $[2], strings: u, ctor: $[1] === "." ?
|
|
284
|
-
} else p.startsWith(k) && (d.push({ type: 6, index: o }),
|
|
285
|
-
if (
|
|
286
|
-
const p =
|
|
279
|
+
for (; (r = A.nextNode()) !== null && d.length < n; ) {
|
|
280
|
+
if (r.nodeType === 1) {
|
|
281
|
+
if (r.hasAttributes()) for (const p of r.getAttributeNames()) if (p.endsWith(Ut)) {
|
|
282
|
+
const f = h[i++], u = r.getAttribute(p).split(k), $ = /([.?@])?(.*)/.exec(f);
|
|
283
|
+
d.push({ type: 1, index: o, name: $[2], strings: u, ctor: $[1] === "." ? ge : $[1] === "?" ? ve : $[1] === "@" ? $e : tt }), r.removeAttribute(p);
|
|
284
|
+
} else p.startsWith(k) && (d.push({ type: 6, index: o }), r.removeAttribute(p));
|
|
285
|
+
if (Ht.test(r.tagName)) {
|
|
286
|
+
const p = r.textContent.split(k), f = p.length - 1;
|
|
287
287
|
if (f > 0) {
|
|
288
|
-
|
|
289
|
-
for (let u = 0; u < f; u++)
|
|
290
|
-
|
|
288
|
+
r.textContent = Y ? Y.emptyScript : "";
|
|
289
|
+
for (let u = 0; u < f; u++) r.append(p[u], F()), A.nextNode(), d.push({ type: 2, index: ++o });
|
|
290
|
+
r.append(p[f], F());
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
} else if (
|
|
293
|
+
} else if (r.nodeType === 8) if (r.data === Ot) d.push({ type: 2, index: o });
|
|
294
294
|
else {
|
|
295
295
|
let p = -1;
|
|
296
|
-
for (; (p =
|
|
296
|
+
for (; (p = r.data.indexOf(k, p + 1)) !== -1; ) d.push({ type: 7, index: o }), p += k.length - 1;
|
|
297
297
|
}
|
|
298
298
|
o++;
|
|
299
299
|
}
|
|
@@ -303,13 +303,13 @@ class O {
|
|
|
303
303
|
return s.innerHTML = t, s;
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
if (t ===
|
|
308
|
-
let
|
|
306
|
+
function D(a, t, e = a, s) {
|
|
307
|
+
if (t === P) return t;
|
|
308
|
+
let r = s !== void 0 ? e._$Co?.[s] : e._$Cl;
|
|
309
309
|
const o = N(t) ? void 0 : t._$litDirective$;
|
|
310
|
-
return
|
|
310
|
+
return r?.constructor !== o && (r?._$AO?.(!1), o === void 0 ? r = void 0 : (r = new o(a), r._$AT(a, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = r : e._$Cl = r), r !== void 0 && (t = D(a, r._$AS(a, t.values), r, s)), t;
|
|
311
311
|
}
|
|
312
|
-
class
|
|
312
|
+
class ue {
|
|
313
313
|
constructor(t, e) {
|
|
314
314
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
315
315
|
}
|
|
@@ -320,17 +320,17 @@ class fe {
|
|
|
320
320
|
return this._$AM._$AU;
|
|
321
321
|
}
|
|
322
322
|
u(t) {
|
|
323
|
-
const { el: { content: e }, parts: s } = this._$AD,
|
|
324
|
-
A.currentNode =
|
|
323
|
+
const { el: { content: e }, parts: s } = this._$AD, r = (t?.creationScope ?? T).importNode(e, !0);
|
|
324
|
+
A.currentNode = r;
|
|
325
325
|
let o = A.nextNode(), i = 0, n = 0, d = s[0];
|
|
326
326
|
for (; d !== void 0; ) {
|
|
327
327
|
if (i === d.index) {
|
|
328
328
|
let c;
|
|
329
|
-
d.type === 2 ? c = new M(o, o.nextSibling, this, t) : d.type === 1 ? c = new d.ctor(o, d.name, d.strings, this, t) : d.type === 6 && (c = new
|
|
329
|
+
d.type === 2 ? c = new M(o, o.nextSibling, this, t) : d.type === 1 ? c = new d.ctor(o, d.name, d.strings, this, t) : d.type === 6 && (c = new be(o, this, t)), this._$AV.push(c), d = s[++n];
|
|
330
330
|
}
|
|
331
331
|
i !== d?.index && (o = A.nextNode(), i++);
|
|
332
332
|
}
|
|
333
|
-
return A.currentNode = T,
|
|
333
|
+
return A.currentNode = T, r;
|
|
334
334
|
}
|
|
335
335
|
p(t) {
|
|
336
336
|
let e = 0;
|
|
@@ -341,8 +341,8 @@ class M {
|
|
|
341
341
|
get _$AU() {
|
|
342
342
|
return this._$AM?._$AU ?? this._$Cv;
|
|
343
343
|
}
|
|
344
|
-
constructor(t, e, s,
|
|
345
|
-
this.type = 2, this._$AH = m, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options =
|
|
344
|
+
constructor(t, e, s, r) {
|
|
345
|
+
this.type = 2, this._$AH = m, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = r, this._$Cv = r?.isConnected ?? !0;
|
|
346
346
|
}
|
|
347
347
|
get parentNode() {
|
|
348
348
|
let t = this._$AA.parentNode;
|
|
@@ -356,7 +356,7 @@ class M {
|
|
|
356
356
|
return this._$AB;
|
|
357
357
|
}
|
|
358
358
|
_$AI(t, e = this) {
|
|
359
|
-
t =
|
|
359
|
+
t = D(this, t, e), N(t) ? t === m || t == null || t === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : t !== this._$AH && t !== P && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : me(t) ? this.k(t) : this._(t);
|
|
360
360
|
}
|
|
361
361
|
O(t) {
|
|
362
362
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -368,28 +368,28 @@ class M {
|
|
|
368
368
|
this._$AH !== m && N(this._$AH) ? this._$AA.nextSibling.data = t : this.T(T.createTextNode(t)), this._$AH = t;
|
|
369
369
|
}
|
|
370
370
|
$(t) {
|
|
371
|
-
const { values: e, _$litType$: s } = t,
|
|
372
|
-
if (this._$AH?._$AD ===
|
|
371
|
+
const { values: e, _$litType$: s } = t, r = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = U.createElement(Lt(s.h, s.h[0]), this.options)), s);
|
|
372
|
+
if (this._$AH?._$AD === r) this._$AH.p(e);
|
|
373
373
|
else {
|
|
374
|
-
const o = new
|
|
374
|
+
const o = new ue(r, this), i = o.u(this.options);
|
|
375
375
|
o.p(e), this.T(i), this._$AH = o;
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
_$AC(t) {
|
|
379
|
-
let e =
|
|
380
|
-
return e === void 0 &&
|
|
379
|
+
let e = Dt.get(t.strings);
|
|
380
|
+
return e === void 0 && Dt.set(t.strings, e = new U(t)), e;
|
|
381
381
|
}
|
|
382
382
|
k(t) {
|
|
383
|
-
|
|
383
|
+
ht(this._$AH) || (this._$AH = [], this._$AR());
|
|
384
384
|
const e = this._$AH;
|
|
385
|
-
let s,
|
|
386
|
-
for (const o of t)
|
|
387
|
-
|
|
385
|
+
let s, r = 0;
|
|
386
|
+
for (const o of t) r === e.length ? e.push(s = new M(this.O(F()), this.O(F()), this, this.options)) : s = e[r], s._$AI(o), r++;
|
|
387
|
+
r < e.length && (this._$AR(s && s._$AB.nextSibling, r), e.length = r);
|
|
388
388
|
}
|
|
389
389
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
390
390
|
for (this._$AP?.(!1, !0, e); t !== this._$AB; ) {
|
|
391
|
-
const s =
|
|
392
|
-
|
|
391
|
+
const s = St(t).nextSibling;
|
|
392
|
+
St(t).remove(), t = s;
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
395
|
setConnected(t) {
|
|
@@ -403,25 +403,25 @@ class tt {
|
|
|
403
403
|
get _$AU() {
|
|
404
404
|
return this._$AM._$AU;
|
|
405
405
|
}
|
|
406
|
-
constructor(t, e, s,
|
|
407
|
-
this.type = 1, this._$AH = m, this._$AN = void 0, this.element = t, this.name = e, this._$AM =
|
|
406
|
+
constructor(t, e, s, r, o) {
|
|
407
|
+
this.type = 1, this._$AH = m, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = o, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = m;
|
|
408
408
|
}
|
|
409
|
-
_$AI(t, e = this, s,
|
|
409
|
+
_$AI(t, e = this, s, r) {
|
|
410
410
|
const o = this.strings;
|
|
411
411
|
let i = !1;
|
|
412
|
-
if (o === void 0) t =
|
|
412
|
+
if (o === void 0) t = D(this, t, e, 0), i = !N(t) || t !== this._$AH && t !== P, i && (this._$AH = t);
|
|
413
413
|
else {
|
|
414
414
|
const n = t;
|
|
415
415
|
let d, c;
|
|
416
|
-
for (t = o[0], d = 0; d < o.length - 1; d++) c =
|
|
416
|
+
for (t = o[0], d = 0; d < o.length - 1; d++) c = D(this, n[s + d], e, d), c === P && (c = this._$AH[d]), i ||= !N(c) || c !== this._$AH[d], c === m ? t = m : t !== m && (t += (c ?? "") + o[d + 1]), this._$AH[d] = c;
|
|
417
417
|
}
|
|
418
|
-
i && !
|
|
418
|
+
i && !r && this.j(t);
|
|
419
419
|
}
|
|
420
420
|
j(t) {
|
|
421
421
|
t === m ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
|
-
class
|
|
424
|
+
class ge extends tt {
|
|
425
425
|
constructor() {
|
|
426
426
|
super(...arguments), this.type = 3;
|
|
427
427
|
}
|
|
@@ -429,7 +429,7 @@ class ue extends tt {
|
|
|
429
429
|
this.element[this.name] = t === m ? void 0 : t;
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
|
-
class
|
|
432
|
+
class ve extends tt {
|
|
433
433
|
constructor() {
|
|
434
434
|
super(...arguments), this.type = 4;
|
|
435
435
|
}
|
|
@@ -437,20 +437,20 @@ class ge extends tt {
|
|
|
437
437
|
this.element.toggleAttribute(this.name, !!t && t !== m);
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
class
|
|
441
|
-
constructor(t, e, s,
|
|
442
|
-
super(t, e, s,
|
|
440
|
+
class $e extends tt {
|
|
441
|
+
constructor(t, e, s, r, o) {
|
|
442
|
+
super(t, e, s, r, o), this.type = 5;
|
|
443
443
|
}
|
|
444
444
|
_$AI(t, e = this) {
|
|
445
|
-
if ((t =
|
|
446
|
-
const s = this._$AH,
|
|
447
|
-
|
|
445
|
+
if ((t = D(this, t, e, 0) ?? m) === P) return;
|
|
446
|
+
const s = this._$AH, r = t === m && s !== m || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== m && (s === m || r);
|
|
447
|
+
r && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
448
448
|
}
|
|
449
449
|
handleEvent(t) {
|
|
450
450
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
|
-
class
|
|
453
|
+
class be {
|
|
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,21 +458,21 @@ class $e {
|
|
|
458
458
|
return this._$AM._$AU;
|
|
459
459
|
}
|
|
460
460
|
_$AI(t) {
|
|
461
|
-
|
|
461
|
+
D(this, t);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
const
|
|
464
|
+
const ye = ct.litHtmlPolyfillSupport;
|
|
465
|
+
ye?.(U, M), (ct.litHtmlVersions ??= []).push("3.3.3");
|
|
466
|
+
const we = (a, t, e) => {
|
|
467
467
|
const s = e?.renderBefore ?? t;
|
|
468
|
-
let
|
|
469
|
-
if (
|
|
468
|
+
let r = s._$litPart$;
|
|
469
|
+
if (r === void 0) {
|
|
470
470
|
const o = e?.renderBefore ?? null;
|
|
471
|
-
s._$litPart$ =
|
|
471
|
+
s._$litPart$ = r = new M(t.insertBefore(F(), o), o, void 0, e ?? {});
|
|
472
472
|
}
|
|
473
|
-
return
|
|
473
|
+
return r._$AI(a), r;
|
|
474
474
|
};
|
|
475
|
-
const
|
|
475
|
+
const dt = globalThis;
|
|
476
476
|
class E extends I {
|
|
477
477
|
constructor() {
|
|
478
478
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
@@ -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 = we(e, this.renderRoot, this.renderOptions);
|
|
487
487
|
}
|
|
488
488
|
connectedCallback() {
|
|
489
489
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -492,27 +492,27 @@ class E extends I {
|
|
|
492
492
|
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
493
493
|
}
|
|
494
494
|
render() {
|
|
495
|
-
return
|
|
495
|
+
return P;
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
|
-
E._$litElement$ = !0, E.finalized = !0,
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
(
|
|
502
|
-
const
|
|
503
|
-
function
|
|
504
|
-
const t = Object.entries(
|
|
498
|
+
E._$litElement$ = !0, E.finalized = !0, dt.litElementHydrateSupport?.({ LitElement: E });
|
|
499
|
+
const xe = dt.litElementPolyfillSupport;
|
|
500
|
+
xe?.({ LitElement: E });
|
|
501
|
+
(dt.litElementVersions ??= []).push("4.2.2");
|
|
502
|
+
const ke = 50;
|
|
503
|
+
function _e(a = {}) {
|
|
504
|
+
const t = Object.entries(a).filter(([, s]) => s != null && s !== "");
|
|
505
505
|
if (!t.length) return "";
|
|
506
506
|
const e = new URLSearchParams();
|
|
507
|
-
return t.forEach(([s,
|
|
507
|
+
return t.forEach(([s, r]) => e.set(s, String(r))), `?${e.toString()}`;
|
|
508
508
|
}
|
|
509
|
-
function
|
|
510
|
-
if (!
|
|
511
|
-
const s =
|
|
509
|
+
function Se({ baseUrl: a, token: t = "", fetchFn: e } = {}) {
|
|
510
|
+
if (!a) throw new Error("createClient requires a baseUrl");
|
|
511
|
+
const s = a.replace(/\/+$/, ""), r = e || ((...n) => fetch(...n));
|
|
512
512
|
async function o(n) {
|
|
513
513
|
const d = { Accept: "application/json" };
|
|
514
514
|
t && (d.Authorization = `Bearer ${t}`);
|
|
515
|
-
const c = await
|
|
515
|
+
const c = await r(`${s}${n}`, { headers: d });
|
|
516
516
|
if (!c.ok) {
|
|
517
517
|
const h = new Error(`api-hsot ${c.status} on ${n}`);
|
|
518
518
|
throw h.status = c.status, h;
|
|
@@ -522,8 +522,8 @@ function _e({ baseUrl: r, token: t = "", fetchFn: e } = {}) {
|
|
|
522
522
|
async function i(n, d = {}) {
|
|
523
523
|
const c = [];
|
|
524
524
|
let h = null;
|
|
525
|
-
for (let p = 0; p <
|
|
526
|
-
const f =
|
|
525
|
+
for (let p = 0; p < ke; p += 1) {
|
|
526
|
+
const f = _e(h ? { ...d, cursor: h } : d), u = await o(`${n}${f}`);
|
|
527
527
|
if (c.push(...u.items || []), h = u.nextCursor || null, !h) break;
|
|
528
528
|
}
|
|
529
529
|
return { items: c, total: c.length, nextCursor: null };
|
|
@@ -549,109 +549,109 @@ const ot = {
|
|
|
549
549
|
school: "/school/{id}/",
|
|
550
550
|
section: "/{sport}/{view}/"
|
|
551
551
|
};
|
|
552
|
-
function g(
|
|
553
|
-
return String(
|
|
552
|
+
function g(a, t) {
|
|
553
|
+
return String(a).replace(/\{(\w+)\}/g, (e, s) => t[s] !== void 0 && t[s] !== null ? String(t[s]) : e);
|
|
554
554
|
}
|
|
555
|
-
function L(
|
|
555
|
+
function L(a) {
|
|
556
556
|
return {
|
|
557
|
-
game:
|
|
558
|
-
school:
|
|
559
|
-
section:
|
|
557
|
+
game: a.getAttribute("game-href") || ot.game,
|
|
558
|
+
school: a.getAttribute("school-href") || ot.school,
|
|
559
|
+
section: a.getAttribute("section-href") || ot.section
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
|
-
const
|
|
563
|
-
function y(
|
|
564
|
-
if (!
|
|
565
|
-
const [e, s,
|
|
566
|
-
return !e || !s || !
|
|
562
|
+
const z = (a) => a ? a.charAt(0).toUpperCase() + a.slice(1) : "";
|
|
563
|
+
function y(a, t) {
|
|
564
|
+
if (!a) return "TBD";
|
|
565
|
+
const [e, s, r] = String(a).split("-").map(Number);
|
|
566
|
+
return !e || !s || !r ? "TBD" : new Date(e, s - 1, r).toLocaleDateString("en-US", t || { weekday: "short", month: "short", day: "numeric" });
|
|
567
567
|
}
|
|
568
|
-
function
|
|
569
|
-
if (!
|
|
570
|
-
const [t, e] = String(
|
|
568
|
+
function pt(a) {
|
|
569
|
+
if (!a) return "";
|
|
570
|
+
const [t, e] = String(a).split(":").map(Number);
|
|
571
571
|
if (Number.isNaN(t)) return "";
|
|
572
572
|
const s = t >= 12 ? "PM" : "AM";
|
|
573
573
|
return `${(t + 11) % 12 + 1}:${String(e || 0).padStart(2, "0")} ${s}`;
|
|
574
574
|
}
|
|
575
|
-
function
|
|
576
|
-
return
|
|
575
|
+
function Ae(a) {
|
|
576
|
+
return a ? `${Math.floor(a / 12)}-${a % 12}` : "·";
|
|
577
577
|
}
|
|
578
|
-
function et(
|
|
579
|
-
const t =
|
|
580
|
-
return
|
|
578
|
+
function et(a = /* @__PURE__ */ new Date()) {
|
|
579
|
+
const t = a.getFullYear();
|
|
580
|
+
return a.getMonth() >= 6 ? `${t}-${t + 1}` : `${t - 1}-${t}`;
|
|
581
581
|
}
|
|
582
|
-
function
|
|
582
|
+
function mt(a = /* @__PURE__ */ new Date()) {
|
|
583
583
|
const t = (e) => String(e).padStart(2, "0");
|
|
584
|
-
return `${
|
|
584
|
+
return `${a.getFullYear()}-${t(a.getMonth() + 1)}-${t(a.getDate())}`;
|
|
585
585
|
}
|
|
586
|
-
function
|
|
587
|
-
const e = [...new Set((
|
|
586
|
+
function Te(a, t = mt()) {
|
|
587
|
+
const e = [...new Set((a || []).filter(Boolean))].sort();
|
|
588
588
|
if (!e.length || e.includes(t)) return t;
|
|
589
|
-
const s = e.filter((
|
|
589
|
+
const s = e.filter((r) => r < t);
|
|
590
590
|
return s.length ? s[s.length - 1] : e[0];
|
|
591
591
|
}
|
|
592
|
-
function
|
|
593
|
-
return
|
|
592
|
+
function ft(a) {
|
|
593
|
+
return a ? (a.abbr || a.name || "?").slice(0, 4).toUpperCase() : "?";
|
|
594
594
|
}
|
|
595
|
-
function K(
|
|
596
|
-
if (!
|
|
597
|
-
const t = parseInt(
|
|
598
|
-
return 0.299 * e + 0.587 * s + 0.114 *
|
|
595
|
+
function K(a) {
|
|
596
|
+
if (!a || !/^#[0-9a-fA-F]{6}$/.test(a)) return "#FFFFFF";
|
|
597
|
+
const t = parseInt(a.slice(1), 16), e = t >> 16 & 255, s = t >> 8 & 255, r = t & 255;
|
|
598
|
+
return 0.299 * e + 0.587 * s + 0.114 * r > 150 ? "#0F1B33" : "#FFFFFF";
|
|
599
599
|
}
|
|
600
|
-
const
|
|
601
|
-
const t = ["th", "st", "nd", "rd"], e =
|
|
602
|
-
return
|
|
600
|
+
const Ie = (a) => {
|
|
601
|
+
const t = ["th", "st", "nd", "rd"], e = a % 100;
|
|
602
|
+
return a + (t[(e - 20) % 10] || t[e] || t[0]);
|
|
603
603
|
};
|
|
604
|
-
function
|
|
605
|
-
if (
|
|
606
|
-
if (
|
|
604
|
+
function jt(a) {
|
|
605
|
+
if (a.state === "live") return { kind: "live", label: `Live · ${a.period || ""}`.replace(/ · $/, "") };
|
|
606
|
+
if (a.state === "final") {
|
|
607
607
|
const t = [];
|
|
608
|
-
return
|
|
608
|
+
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(" · ")}` : ""}` };
|
|
609
609
|
}
|
|
610
|
-
return
|
|
610
|
+
return a.state === "postponed" ? { kind: "warn", label: "Postponed" } : a.state === "canceled" ? { kind: "warn", label: "Canceled" } : { kind: "sched", label: `${y(a.date, { month: "short", day: "numeric" })} · ${pt(a.time)}`.replace(/ · $/, "") };
|
|
611
611
|
}
|
|
612
|
-
const
|
|
613
|
-
function _(
|
|
614
|
-
let t = String(
|
|
612
|
+
const Ce = /* @__PURE__ */ new Set(["game", "story", "page", "forum", "video", "gallery"]);
|
|
613
|
+
function _(a) {
|
|
614
|
+
let t = String(a || "").replace(/^[a-z][a-z0-9+.-]*:\/\/[^/#?]*/i, "");
|
|
615
615
|
const e = t.indexOf("#");
|
|
616
616
|
let s = "";
|
|
617
617
|
e !== -1 && (s = t.slice(e).split("?")[0], t = t.slice(0, e));
|
|
618
|
-
let
|
|
619
|
-
return
|
|
618
|
+
let r = t.split("?")[0] + s;
|
|
619
|
+
return r = r.replace(/([^:])\/{2,}/g, "$1/").replace(/^\/{2,}/, "/"), r = r.replace(/^\/(?=#)/, ""), r.length > 1 && (r = r.replace(/\/+$/, "")), r.toLowerCase();
|
|
620
620
|
}
|
|
621
|
-
function
|
|
622
|
-
const
|
|
623
|
-
if (!
|
|
624
|
-
const t = (
|
|
625
|
-
return _((
|
|
621
|
+
function Wt() {
|
|
622
|
+
const a = globalThis.location;
|
|
623
|
+
if (!a) return "";
|
|
624
|
+
const t = (a.hash || "").startsWith("#/") ? a.hash : "";
|
|
625
|
+
return _((a.pathname || "") + t);
|
|
626
626
|
}
|
|
627
|
-
function Ee(
|
|
627
|
+
function Ee(a, t, e) {
|
|
628
628
|
if (!e) return null;
|
|
629
|
-
const s = _(
|
|
629
|
+
const s = _(a);
|
|
630
630
|
if (!s) return null;
|
|
631
|
-
const
|
|
632
|
-
if (s ===
|
|
631
|
+
const r = _(g(t.game, { sport: e, id: "" })), o = _(g(t.school, { id: "" }));
|
|
632
|
+
if (s === r || s.startsWith(`${r}/`) || s === o || s.startsWith(`${o}/`)) return null;
|
|
633
633
|
const i = _(g(t.section, { sport: e, view: "" }));
|
|
634
634
|
if (s === i) return "";
|
|
635
635
|
if (!s.startsWith(`${i}/`)) return null;
|
|
636
636
|
const n = s.slice(i.length + 1), d = n.split("/");
|
|
637
|
-
return d.length > 2 || d.some((c) => !/^[a-z][a-z-]*$/.test(c)) ||
|
|
637
|
+
return d.length > 2 || d.some((c) => !/^[a-z][a-z-]*$/.test(c)) || Ce.has(d[0]) ? null : n;
|
|
638
638
|
}
|
|
639
|
-
function
|
|
640
|
-
const s = (i) => g(e.section, { sport:
|
|
639
|
+
function Pe(a, t, e) {
|
|
640
|
+
const s = (i) => g(e.section, { sport: a, view: i }).replace(/([^:])\/{2,}/g, "$1/"), o = new Set((t || []).map((i) => i && i.gender).filter((i) => i === "boys" || i === "girls")).size === 2 ? [
|
|
641
641
|
{ label: "Boys Standings", href: s("boys/standings") },
|
|
642
642
|
{ label: "Girls Standings", href: s("girls/standings") }
|
|
643
643
|
] : [{ label: "Standings", href: s("standings") }];
|
|
644
644
|
return [
|
|
645
|
-
{ label: `${
|
|
645
|
+
{ label: `${z(a)} Home`, href: s("") },
|
|
646
646
|
{ label: "Scores/Schedule", href: s("scores") },
|
|
647
647
|
{ label: "Playoff Brackets", href: s("brackets") },
|
|
648
648
|
...o,
|
|
649
649
|
{ label: "Polls & Rankings", href: s("rankings") }
|
|
650
650
|
];
|
|
651
651
|
}
|
|
652
|
-
function
|
|
652
|
+
function De(a, t = Wt()) {
|
|
653
653
|
const e = _(t);
|
|
654
|
-
for (const s of
|
|
654
|
+
for (const s of a.querySelectorAll(':scope > a[slot="nav"]'))
|
|
655
655
|
e && _(s.getAttribute("href")) === e ? s.setAttribute("aria-current", "page") : s.removeAttribute("aria-current");
|
|
656
656
|
}
|
|
657
657
|
class w extends E {
|
|
@@ -673,7 +673,7 @@ class w extends E {
|
|
|
673
673
|
this._client = t, this.isConnected && this.load();
|
|
674
674
|
}
|
|
675
675
|
get client() {
|
|
676
|
-
return this._client ? this._client : this.api ?
|
|
676
|
+
return this._client ? this._client : this.api ? Se({ baseUrl: this.api }) : null;
|
|
677
677
|
}
|
|
678
678
|
connectedCallback() {
|
|
679
679
|
super.connectedCallback(), this._setupInterval();
|
|
@@ -685,7 +685,7 @@ class w extends E {
|
|
|
685
685
|
this.load();
|
|
686
686
|
}
|
|
687
687
|
updated(t) {
|
|
688
|
-
t.has("api") && t.get("api") !== void 0 && t.get("api") !== this.api && this.load(), t.has("refreshInterval") && this._setupInterval(),
|
|
688
|
+
t.has("api") && t.get("api") !== void 0 && t.get("api") !== this.api && this.load(), t.has("refreshInterval") && this._setupInterval(), De(this);
|
|
689
689
|
}
|
|
690
690
|
async load() {
|
|
691
691
|
const t = this.client;
|
|
@@ -720,7 +720,7 @@ class w extends E {
|
|
|
720
720
|
return l``;
|
|
721
721
|
}
|
|
722
722
|
}
|
|
723
|
-
const v = (
|
|
723
|
+
const v = (a) => Object.fromEntries((a || []).map((t) => [t.id, t])), ze = b`
|
|
724
724
|
:host {
|
|
725
725
|
--hsot-red: var(--color-red, #D1232A);
|
|
726
726
|
--hsot-red-deep: var(--color-red-dark, #951C21);
|
|
@@ -758,7 +758,7 @@ const v = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), De = b`
|
|
|
758
758
|
outline-offset: 1px;
|
|
759
759
|
}
|
|
760
760
|
.mut { color: var(--hsot-gray-5); }
|
|
761
|
-
`,
|
|
761
|
+
`, Re = b`
|
|
762
762
|
.band { background: var(--hsot-white); color: var(--hsot-black); }
|
|
763
763
|
.band .inner { max-width: 1366px; margin: 0 auto; padding: 1.1rem 1.25rem 0; }
|
|
764
764
|
.band h1, .band h2.bandtitle {
|
|
@@ -807,7 +807,7 @@ const v = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), De = b`
|
|
|
807
807
|
@media (max-width: 720px) {
|
|
808
808
|
.band h1, .band h2.bandtitle, .band.section h1, .band.section h2.bandtitle { font-size: 1.8rem; }
|
|
809
809
|
}
|
|
810
|
-
`,
|
|
810
|
+
`, Be = b`
|
|
811
811
|
.view { max-width: 1366px; margin: 0 auto; padding: 1.25rem; box-sizing: border-box; }
|
|
812
812
|
/* Optional right rail (slot="rail" light-DOM children): a divided 300px
|
|
813
813
|
column on desktop, stacked under the view content on smaller screens. */
|
|
@@ -871,7 +871,7 @@ const v = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), De = b`
|
|
|
871
871
|
.error { padding: 1.2rem 1rem; color: var(--hsot-red-deep); font-size: 0.9rem; }
|
|
872
872
|
.note { font-size: 0.8125rem; color: var(--hsot-gray-5); margin: 0.6rem 0 0; }
|
|
873
873
|
.loading { padding: 1.2rem; color: var(--hsot-gray-5); font-family: var(--hsot-heading-font); }
|
|
874
|
-
`,
|
|
874
|
+
`, Fe = b`
|
|
875
875
|
.pill {
|
|
876
876
|
display: inline-block; font-family: var(--hsot-heading-font); font-weight: 700;
|
|
877
877
|
font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.04em;
|
|
@@ -886,7 +886,7 @@ const v = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), De = b`
|
|
|
886
886
|
.pill.champ { background: var(--hsot-straw); color: #6b5900; }
|
|
887
887
|
@keyframes hsot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
|
|
888
888
|
@media (prefers-reduced-motion: reduce) { .pill.live { animation: none; } }
|
|
889
|
-
`,
|
|
889
|
+
`, Ne = b`
|
|
890
890
|
.tablewrap { overflow-x: auto; }
|
|
891
891
|
table.data { font-family: var(--hsot-heading-font); font-size: 14px; border-collapse: collapse; width: 100%; }
|
|
892
892
|
table.data th {
|
|
@@ -904,7 +904,7 @@ const v = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), De = b`
|
|
|
904
904
|
table.data tbody tr.rowlink:hover { background: var(--hsot-gray-1); }
|
|
905
905
|
table.data td.teamcell a { color: inherit; text-decoration: none; font-weight: 500; }
|
|
906
906
|
table.data td.teamcell a:hover { text-decoration: underline; }
|
|
907
|
-
`,
|
|
907
|
+
`, Ue = b`
|
|
908
908
|
.swatch {
|
|
909
909
|
display: inline-flex; align-items: center; justify-content: center;
|
|
910
910
|
width: 26px; height: 26px; border-radius: 50%;
|
|
@@ -951,16 +951,44 @@ const v = (r) => Object.fromEntries((r || []).map((t) => [t.id, t])), De = b`
|
|
|
951
951
|
.gamelist .opp { flex: 1; min-width: 180px; }
|
|
952
952
|
.gamelist .opp a { text-decoration: none; color: inherit; font-weight: 500; }
|
|
953
953
|
.gamelist .opp a:hover { text-decoration: underline; }
|
|
954
|
+
|
|
955
|
+
/* Scoreboard matchup: "Away <score> at Home <score>".
|
|
956
|
+
Scoped to .matchup, not .opp, because hsot-school's schedule rows
|
|
957
|
+
reuse .opp for a single opponent plus pills and must keep the plain
|
|
958
|
+
inline flow.
|
|
959
|
+
|
|
960
|
+
Each team + score is one .side flex item, so a matchup wider than the
|
|
961
|
+
row breaks *between* the two teams instead of through a school's name
|
|
962
|
+
— the "at North / Moore" and "at Greene / Central" wraps the old
|
|
963
|
+
single-span markup produced. */
|
|
964
|
+
.gamelist .opp.matchup {
|
|
965
|
+
display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.35rem;
|
|
966
|
+
}
|
|
967
|
+
.gamelist .opp.matchup .side { display: inline-flex; align-items: center; }
|
|
968
|
+
.gamelist .opp.matchup .at { margin-left: 0.45rem; }
|
|
969
|
+
@media (max-width: 720px) {
|
|
970
|
+
/* Always two lines on a phone, split after the "at", rather than
|
|
971
|
+
one line for short matchups and a break wherever the text runs
|
|
972
|
+
out for long ones. Consistent rows read better than tight ones. */
|
|
973
|
+
.gamelist .opp.matchup { flex-direction: column; align-items: flex-start; row-gap: 0.15rem; }
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
/* Names the side that forfeited — the pill only says "Final · Forfeit",
|
|
977
|
+
which leaves a 0-0 row ambiguous about who was awarded the win. */
|
|
978
|
+
.gamelist .ff { color: var(--hsot-gray-5); font-size: 0.78rem; font-style: italic; }
|
|
954
979
|
.gamelist .where { color: var(--hsot-gray-5); font-size: 0.78rem; }
|
|
955
980
|
.gamelist a.box { font-size: 0.78rem; }
|
|
956
|
-
`, j = [
|
|
957
|
-
function
|
|
958
|
-
return
|
|
959
|
-
}
|
|
960
|
-
function
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
981
|
+
`, j = [ze, Re, Be, Fe, Ne, Ue, Oe];
|
|
982
|
+
function ut(a) {
|
|
983
|
+
return a.state !== "final" ? null : a.forfeit && a.forfeit !== "none" ? a.forfeit : a.homeScore > a.awayScore ? "home" : a.awayScore > a.homeScore ? "away" : a.tiebreakWinner && a.tiebreakWinner !== "none" ? a.tiebreakWinner : "tie";
|
|
984
|
+
}
|
|
985
|
+
function He(a) {
|
|
986
|
+
return !a || !a.forfeit || a.forfeit === "none" ? null : a.forfeit === "home" ? "away" : a.forfeit === "away" ? "home" : null;
|
|
987
|
+
}
|
|
988
|
+
function W(a, t) {
|
|
989
|
+
const e = {}, s = (o) => (e[o] = e[o] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, e[o]), r = a.filter((o) => o.state === "final" && o.gameType !== "scrimmage" && !0).sort((o, i) => String(o.date).localeCompare(String(i.date)));
|
|
990
|
+
for (const o of r) {
|
|
991
|
+
const i = ut(o), n = o.gameType === "conference";
|
|
964
992
|
for (const d of ["home", "away"]) {
|
|
965
993
|
const c = d === "home" ? o.homeTeamId : o.awayTeamId;
|
|
966
994
|
if (!c) continue;
|
|
@@ -972,41 +1000,41 @@ function W(r, t) {
|
|
|
972
1000
|
}
|
|
973
1001
|
return e;
|
|
974
1002
|
}
|
|
975
|
-
function st(
|
|
976
|
-
if (!
|
|
977
|
-
const t =
|
|
1003
|
+
function st(a) {
|
|
1004
|
+
if (!a || !a.length) return "";
|
|
1005
|
+
const t = a[a.length - 1].mark;
|
|
978
1006
|
let e = 0;
|
|
979
|
-
for (let s =
|
|
1007
|
+
for (let s = a.length - 1; s >= 0 && a[s].mark === t; s -= 1) e += 1;
|
|
980
1008
|
return t + e;
|
|
981
1009
|
}
|
|
982
|
-
const
|
|
983
|
-
const s =
|
|
984
|
-
return s ? (
|
|
985
|
-
},
|
|
986
|
-
function x(
|
|
987
|
-
if (!
|
|
988
|
-
const e = t ?
|
|
989
|
-
return `${e}-${s}${
|
|
990
|
-
}
|
|
991
|
-
function
|
|
992
|
-
return
|
|
1010
|
+
const zt = (a, t, e) => {
|
|
1011
|
+
const s = a + t + e;
|
|
1012
|
+
return s ? (a + e / 2) / s : 0;
|
|
1013
|
+
}, Rt = (a) => a.toFixed(3).replace("0.", ".");
|
|
1014
|
+
function x(a, t = !1) {
|
|
1015
|
+
if (!a) return "0-0";
|
|
1016
|
+
const e = t ? a.cw : a.w, s = t ? a.cl : a.l, r = t ? a.ct : a.t;
|
|
1017
|
+
return `${e}-${s}${r ? `-${r}` : ""}`;
|
|
1018
|
+
}
|
|
1019
|
+
function qt(a, t) {
|
|
1020
|
+
return a.map((e) => {
|
|
993
1021
|
const s = t[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] };
|
|
994
|
-
return { team: e, rec: s, confPct:
|
|
1022
|
+
return { team: e, rec: s, confPct: zt(s.cw, s.cl, s.ct), overallPct: zt(s.w, s.l, s.t) };
|
|
995
1023
|
}).sort((e, s) => s.confPct - e.confPct || s.overallPct - e.overallPct || s.rec.pf - s.rec.pa - (e.rec.pf - e.rec.pa));
|
|
996
1024
|
}
|
|
997
|
-
function
|
|
998
|
-
return
|
|
1025
|
+
function gt(a, t) {
|
|
1026
|
+
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;
|
|
999
1027
|
}
|
|
1000
|
-
function
|
|
1001
|
-
const e =
|
|
1028
|
+
function Bt(a, t) {
|
|
1029
|
+
const e = a[t];
|
|
1002
1030
|
return e && e.results.length ? e.results[e.results.length - 1] : null;
|
|
1003
1031
|
}
|
|
1004
|
-
function
|
|
1032
|
+
function vt(a, t, e, s, r) {
|
|
1005
1033
|
const o = t[e];
|
|
1006
1034
|
if (!o) return null;
|
|
1007
1035
|
const i = /* @__PURE__ */ new Map();
|
|
1008
|
-
for (const d of
|
|
1009
|
-
if (d.sport !== s ||
|
|
1036
|
+
for (const d of a || []) {
|
|
1037
|
+
if (d.sport !== s || r && d.effectiveDate > r || d.gender && o.gender !== d.gender && o.gender !== "coed") continue;
|
|
1010
1038
|
const c = d.gender || "", h = i.get(c);
|
|
1011
1039
|
(!h || d.effectiveDate > h.effectiveDate) && i.set(c, d);
|
|
1012
1040
|
}
|
|
@@ -1017,27 +1045,35 @@ function $t(r, t, e, s, a) {
|
|
|
1017
1045
|
}
|
|
1018
1046
|
return n ? n.rank : null;
|
|
1019
1047
|
}
|
|
1020
|
-
function
|
|
1021
|
-
if (!
|
|
1022
|
-
const s = (
|
|
1048
|
+
function Me(a, t, e) {
|
|
1049
|
+
if (!a) return { kind: "none", delta: 0 };
|
|
1050
|
+
const s = (a.teamIds || []).indexOf(e) + 1;
|
|
1023
1051
|
if (!s) return { kind: "none", delta: 0 };
|
|
1024
1052
|
if (!t) return { kind: "same", delta: 0 };
|
|
1025
|
-
const
|
|
1026
|
-
if (!
|
|
1027
|
-
const o =
|
|
1053
|
+
const r = (t.teamIds || []).indexOf(e) + 1;
|
|
1054
|
+
if (!r) return { kind: "new", delta: 0 };
|
|
1055
|
+
const o = r - s;
|
|
1028
1056
|
return o > 0 ? { kind: "up", delta: o } : o < 0 ? { kind: "down", delta: -o } : { kind: "same", delta: 0 };
|
|
1029
1057
|
}
|
|
1030
|
-
function
|
|
1031
|
-
return /^https?:\/\//i.test(String(
|
|
1058
|
+
function Le(a) {
|
|
1059
|
+
return /^https?:\/\//i.test(String(a || ""));
|
|
1060
|
+
}
|
|
1061
|
+
function Gt(a, { w: t, h: e } = {}) {
|
|
1062
|
+
if (!Le(a)) return "";
|
|
1063
|
+
const s = [];
|
|
1064
|
+
t && s.push(`w=${Math.max(1, Math.round(t))}`), e && s.push(`h=${Math.max(1, Math.round(e))}`), s.push("f=webp");
|
|
1065
|
+
const r = a.includes("?") ? "&" : "?";
|
|
1066
|
+
return `${a}${r}${s.join("&")}`;
|
|
1067
|
+
}
|
|
1068
|
+
function Q(a, t) {
|
|
1069
|
+
const e = t * 2;
|
|
1070
|
+
return Gt(a?.logoAssetId, { w: e, h: e });
|
|
1032
1071
|
}
|
|
1033
|
-
function
|
|
1034
|
-
|
|
1035
|
-
if (!He(e)) return "";
|
|
1036
|
-
const s = Math.max(1, Math.round(t * 2)), a = e.includes("?") ? "&" : "?";
|
|
1037
|
-
return `${e}${a}w=${s}&h=${s}&f=webp`;
|
|
1072
|
+
function je(a, t) {
|
|
1073
|
+
return Gt(a?.photoAssetId, { w: t * 2 });
|
|
1038
1074
|
}
|
|
1039
|
-
function
|
|
1040
|
-
const o =
|
|
1075
|
+
function $t(a, t, { title: e, sub: s, teams: r }) {
|
|
1076
|
+
const o = Wt(), n = !!a.querySelector(':scope > a[slot="nav"]') || Ee(o, t.hrefs, t.sport) !== null;
|
|
1041
1077
|
return l`
|
|
1042
1078
|
<div class="band section">
|
|
1043
1079
|
<div class="inner">
|
|
@@ -1045,10 +1081,10 @@ function bt(r, t, { title: e, sub: s, teams: a }) {
|
|
|
1045
1081
|
${s ? l`<p class="sub">${s}</p>` : m}
|
|
1046
1082
|
</div>
|
|
1047
1083
|
${n ? l`
|
|
1048
|
-
<nav class="sectionnav" aria-label="${
|
|
1084
|
+
<nav class="sectionnav" aria-label="${z(t.sport)} section">
|
|
1049
1085
|
<div class="navrow">
|
|
1050
1086
|
<slot name="nav">
|
|
1051
|
-
${
|
|
1087
|
+
${Pe(t.sport, r, t.hrefs).map((d) => l`<a href=${d.href}
|
|
1052
1088
|
aria-current=${o && _(d.href) === o ? "page" : m}>${d.label}</a>`)}
|
|
1053
1089
|
</slot>
|
|
1054
1090
|
</div>
|
|
@@ -1056,60 +1092,60 @@ function bt(r, t, { title: e, sub: s, teams: a }) {
|
|
|
1056
1092
|
</div>
|
|
1057
1093
|
`;
|
|
1058
1094
|
}
|
|
1059
|
-
const
|
|
1060
|
-
const e =
|
|
1061
|
-
return e ?
|
|
1062
|
-
},
|
|
1063
|
-
function H(
|
|
1064
|
-
if (!
|
|
1065
|
-
const e = Q(
|
|
1095
|
+
const O = (a, t) => {
|
|
1096
|
+
const e = a.teamsById[t];
|
|
1097
|
+
return e ? a.schoolsById[e.schoolId] : null;
|
|
1098
|
+
}, C = (a, t) => O(a, t)?.name || "TBD", Z = (a, t) => O(a, t)?.abbr || "TBD";
|
|
1099
|
+
function H(a, t = 26) {
|
|
1100
|
+
if (!a) return m;
|
|
1101
|
+
const e = Q(a, t);
|
|
1066
1102
|
if (e)
|
|
1067
1103
|
return l`<img class="swatch logo" aria-hidden="true" alt="" loading="lazy"
|
|
1068
1104
|
src=${e} style="width:${t}px;height:${t}px" />`;
|
|
1069
|
-
const s =
|
|
1105
|
+
const s = a.colorPrimary || "#030711", r = K(s);
|
|
1070
1106
|
return l`<span class="swatch" aria-hidden="true"
|
|
1071
|
-
style="width:${t}px;height:${t}px;background:${s};color:${
|
|
1072
|
-
>${
|
|
1107
|
+
style="width:${t}px;height:${t}px;background:${s};color:${r};font-size:${Math.max(8, t * 0.28)}px"
|
|
1108
|
+
>${ft(a)}</span>`;
|
|
1073
1109
|
}
|
|
1074
|
-
function
|
|
1075
|
-
const s =
|
|
1110
|
+
function bt(a, t, e) {
|
|
1111
|
+
const s = vt(a.rankings, a.teamsById, t, a.sport, e);
|
|
1076
1112
|
return s ? l`<span class="rankbadge">#${s}</span>` : m;
|
|
1077
1113
|
}
|
|
1078
|
-
function
|
|
1079
|
-
const s =
|
|
1080
|
-
return s ? l`${
|
|
1114
|
+
function Vt(a, t, e) {
|
|
1115
|
+
const s = O(a, t);
|
|
1116
|
+
return s ? l`${bt(a, t, e)}<a href=${g(a.hrefs.school, { id: s.id })}>${s.name}</a>` : l`<span class="mut">TBD</span>`;
|
|
1081
1117
|
}
|
|
1082
|
-
function
|
|
1083
|
-
const s =
|
|
1118
|
+
function yt(a, t, e = 5) {
|
|
1119
|
+
const s = a.records[t];
|
|
1084
1120
|
if (!s || !s.results.length) return l`<span class="mut">·</span>`;
|
|
1085
|
-
const
|
|
1086
|
-
return l`<span class="dots" role="img" aria-label="last ${
|
|
1087
|
-
${
|
|
1088
|
-
title="${o.mark} ${o.my}-${o.their} vs ${
|
|
1089
|
-
href=${g(
|
|
1121
|
+
const r = s.results.slice(-1 * e);
|
|
1122
|
+
return l`<span class="dots" role="img" aria-label="last ${r.length} results">
|
|
1123
|
+
${r.map((o) => l`<a class="dot ${o.mark}"
|
|
1124
|
+
title="${o.mark} ${o.my}-${o.their} vs ${C(a, o.opp)}"
|
|
1125
|
+
href=${g(a.hrefs.game, { sport: a.sport, id: o.gameId })}>${o.mark}</a>`)}
|
|
1090
1126
|
</span>`;
|
|
1091
1127
|
}
|
|
1092
|
-
function q(
|
|
1093
|
-
return
|
|
1128
|
+
function q(a, t) {
|
|
1129
|
+
return a.querySelector(':scope > [slot="rail"]') ? l`<div class="view withrail">
|
|
1094
1130
|
<div class="viewmain">${t}</div>
|
|
1095
1131
|
<aside class="viewrail"><slot name="rail"></slot></aside>
|
|
1096
1132
|
</div>` : l`<div class="view">${t}</div>`;
|
|
1097
1133
|
}
|
|
1098
|
-
function G(
|
|
1099
|
-
if (!
|
|
1100
|
-
const t = l`<img src=${
|
|
1101
|
-
return l`<div class="promo">${
|
|
1134
|
+
function G(a) {
|
|
1135
|
+
if (!a.promoImage) return m;
|
|
1136
|
+
const t = l`<img src=${a.promoImage} alt=${a.promoAlt || "Sponsor"}>`;
|
|
1137
|
+
return l`<div class="promo">${a.promoHref ? l`<a href=${a.promoHref} target="_blank" rel="sponsored noopener">${t}</a>` : t}</div>`;
|
|
1102
1138
|
}
|
|
1103
|
-
function J(
|
|
1104
|
-
const t =
|
|
1139
|
+
function J(a) {
|
|
1140
|
+
const t = jt(a);
|
|
1105
1141
|
return l`<span class="pill ${t.kind}">${t.label}</span>`;
|
|
1106
1142
|
}
|
|
1107
|
-
function
|
|
1143
|
+
function Yt(a, t, e) {
|
|
1108
1144
|
if (!t) return l`<span class="mut">·</span>`;
|
|
1109
|
-
const s = t.homeTeamId === e ? t.awayTeamId : t.homeTeamId,
|
|
1110
|
-
return l`${t.state === "live" ? l`<span class="pill live">Live</span> ` : l`${y(t.date, { month: "numeric", day: "numeric" })} `}${
|
|
1145
|
+
const s = t.homeTeamId === e ? t.awayTeamId : t.homeTeamId, r = t.homeTeamId === e ? "vs" : "at";
|
|
1146
|
+
return l`${t.state === "live" ? l`<span class="pill live">Live</span> ` : l`${y(t.date, { month: "numeric", day: "numeric" })} `}${r} ${Z(a, s)}`;
|
|
1111
1147
|
}
|
|
1112
|
-
class
|
|
1148
|
+
class Kt extends w {
|
|
1113
1149
|
static styles = j;
|
|
1114
1150
|
static properties = {
|
|
1115
1151
|
...w.properties,
|
|
@@ -1128,17 +1164,17 @@ class Yt extends w {
|
|
|
1128
1164
|
this._datePinned = !!this.date;
|
|
1129
1165
|
}
|
|
1130
1166
|
async fetchData(t) {
|
|
1131
|
-
const e = this.season || et(), [s,
|
|
1167
|
+
const e = this.season || et(), [s, r, o, i, n] = await Promise.all([
|
|
1132
1168
|
t.listSchools(),
|
|
1133
1169
|
t.listTeams({ sport: this.sport }),
|
|
1134
1170
|
t.listConferences(),
|
|
1135
1171
|
t.listGames({ sport: this.sport, season: e }),
|
|
1136
1172
|
t.listRankings({ sport: this.sport })
|
|
1137
1173
|
]);
|
|
1138
|
-
return this._datePinned || (this.date =
|
|
1174
|
+
return this._datePinned || (this.date = Te(i.items.map((d) => d.date)), this._datePinned = !0), {
|
|
1139
1175
|
season: e,
|
|
1140
1176
|
schools: s.items,
|
|
1141
|
-
teams:
|
|
1177
|
+
teams: r.items,
|
|
1142
1178
|
conferences: o.items,
|
|
1143
1179
|
games: i.items,
|
|
1144
1180
|
rankings: n.items
|
|
@@ -1155,9 +1191,9 @@ class Yt extends w {
|
|
|
1155
1191
|
}, this._ctxData = this.data), this._ctx;
|
|
1156
1192
|
}
|
|
1157
1193
|
renderView() {
|
|
1158
|
-
const t = this.ctx, e = v(this.data.conferences), s = [...new Set(this.data.games.map((c) => c.date).filter(Boolean))].sort(),
|
|
1159
|
-
const h = [c.awayTeamId, c.homeTeamId].map((p) =>
|
|
1160
|
-
return h.length ? Math.min(...h) :
|
|
1194
|
+
const t = this.ctx, e = v(this.data.conferences), s = [...new Set(this.data.games.map((c) => c.date).filter(Boolean))].sort(), r = Number.MAX_SAFE_INTEGER, o = (c) => {
|
|
1195
|
+
const h = [c.awayTeamId, c.homeTeamId].map((p) => vt(t.rankings, t.teamsById, p, this.sport, c.date)).filter(Boolean);
|
|
1196
|
+
return h.length ? Math.min(...h) : r;
|
|
1161
1197
|
}, i = this.data.games.filter((c) => c.date === this.date), n = new Map(i.map((c) => [c, o(c)]));
|
|
1162
1198
|
i.sort((c, h) => (c.state === "live" ? 0 : 1) - (h.state === "live" ? 0 : 1) || n.get(c) - n.get(h));
|
|
1163
1199
|
const d = /* @__PURE__ */ new Map();
|
|
@@ -1165,8 +1201,8 @@ class Yt extends w {
|
|
|
1165
1201
|
const h = c.gameType === "conference" && c.conferenceId ? e[c.conferenceId]?.name || "Conference" : c.gameType === "playoff" ? "Playoffs" : c.gameType === "scrimmage" ? "Scrimmages" : "Nonconference";
|
|
1166
1202
|
d.has(h) || d.set(h, []), d.get(h).push(c);
|
|
1167
1203
|
}), l`
|
|
1168
|
-
${
|
|
1169
|
-
title: l`${
|
|
1204
|
+
${$t(this, t, {
|
|
1205
|
+
title: l`${z(this.sport)} scores & schedules`,
|
|
1170
1206
|
sub: l`${y(this.date, { weekday: "long", month: "long", day: "numeric", year: "numeric" })} · ${i.length} games`,
|
|
1171
1207
|
teams: this.data.teams
|
|
1172
1208
|
})}
|
|
@@ -1178,7 +1214,7 @@ class Yt extends w {
|
|
|
1178
1214
|
this.date = c.target.value;
|
|
1179
1215
|
}}>
|
|
1180
1216
|
${(s.includes(this.date) ? s : [...s, this.date].sort()).map((c) => l`<option value=${c} ?selected=${c === this.date}>
|
|
1181
|
-
${y(c, { weekday: "short", month: "short", day: "numeric" })}${c ===
|
|
1217
|
+
${y(c, { weekday: "short", month: "short", day: "numeric" })}${c === mt() ? " · today" : ""}
|
|
1182
1218
|
</option>`)}
|
|
1183
1219
|
</select>
|
|
1184
1220
|
<button class="chip" ?disabled=${s.indexOf(this.date) <= 0}
|
|
@@ -1206,12 +1242,12 @@ class Yt extends w {
|
|
|
1206
1242
|
// a lone score column on the far right read as detached from the teams).
|
|
1207
1243
|
// Scheduled games carry their start time on the status pill alone.
|
|
1208
1244
|
renderGame(t, e) {
|
|
1209
|
-
const s = e.state === "final" || e.state === "live";
|
|
1245
|
+
const s = e.state === "final" || e.state === "live", r = (i, n, d = m) => l`<span class="side">${Vt(t, i, e.date)}${s ? l`<span class="score">${n}</span>` : m}${d}</span>`, o = He(e);
|
|
1210
1246
|
return l`
|
|
1211
1247
|
<li>
|
|
1212
1248
|
${J(e)}
|
|
1213
|
-
<span class="opp">${
|
|
1214
|
-
|
|
1249
|
+
<span class="opp matchup">${r(e.awayTeamId, e.awayScore, l`<span class="at">at</span>`)}${r(e.homeTeamId, e.homeScore)}</span>
|
|
1250
|
+
${o ? l`<span class="ff">${C(t, o === "home" ? e.homeTeamId : e.awayTeamId)} forfeited</span>` : m}
|
|
1215
1251
|
<span class="where">${e.venue || ""}</span>
|
|
1216
1252
|
${e.broadcast ? l`<span class="pill class">${e.broadcast}</span>` : m}
|
|
1217
1253
|
<a class="box" href=${g(t.hrefs.game, { sport: this.sport, id: e.id })}>Box score →</a>
|
|
@@ -1219,8 +1255,8 @@ class Yt extends w {
|
|
|
1219
1255
|
`;
|
|
1220
1256
|
}
|
|
1221
1257
|
}
|
|
1222
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores",
|
|
1223
|
-
class
|
|
1258
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-scores") && globalThis.customElements.define("hsot-scores", Kt);
|
|
1259
|
+
class Qt extends w {
|
|
1224
1260
|
static styles = j;
|
|
1225
1261
|
static properties = {
|
|
1226
1262
|
...w.properties,
|
|
@@ -1233,7 +1269,7 @@ class Kt extends w {
|
|
|
1233
1269
|
super(), this.sport = "football", this.season = "", this.classFilter = "All", this.query = "";
|
|
1234
1270
|
}
|
|
1235
1271
|
async fetchData(t) {
|
|
1236
|
-
const e = this.season || et(), [s,
|
|
1272
|
+
const e = this.season || et(), [s, r, o, i, n] = await Promise.all([
|
|
1237
1273
|
t.listConferences({ active: !0 }),
|
|
1238
1274
|
t.listSchools(),
|
|
1239
1275
|
t.listTeams({ sport: this.sport }),
|
|
@@ -1243,7 +1279,7 @@ class Kt extends w {
|
|
|
1243
1279
|
return {
|
|
1244
1280
|
season: e,
|
|
1245
1281
|
conferences: s.items,
|
|
1246
|
-
schools:
|
|
1282
|
+
schools: r.items,
|
|
1247
1283
|
teams: o.items,
|
|
1248
1284
|
games: i.items,
|
|
1249
1285
|
rankings: n.items
|
|
@@ -1260,10 +1296,10 @@ class Kt extends w {
|
|
|
1260
1296
|
}, this._ctxData = this.data), this._ctx;
|
|
1261
1297
|
}
|
|
1262
1298
|
renderView() {
|
|
1263
|
-
const t = this.ctx, e = ["All", ...new Set(this.data.conferences.flatMap((
|
|
1299
|
+
const t = this.ctx, e = ["All", ...new Set(this.data.conferences.flatMap((r) => r.classifications || []))].slice(0, 9), s = this.data.conferences.filter((r) => r.active !== !1).filter((r) => this.classFilter === "All" || (r.classifications || []).includes(this.classFilter));
|
|
1264
1300
|
return l`
|
|
1265
|
-
${
|
|
1266
|
-
title: l`${
|
|
1301
|
+
${$t(this, t, {
|
|
1302
|
+
title: l`${z(this.sport)} standings`,
|
|
1267
1303
|
sub: l`${this.data.season} season · every conference, computed live from reported results`,
|
|
1268
1304
|
teams: this.data.teams
|
|
1269
1305
|
})}
|
|
@@ -1271,26 +1307,26 @@ class Kt extends w {
|
|
|
1271
1307
|
${G(this)}
|
|
1272
1308
|
<div class="toolbar">
|
|
1273
1309
|
<div role="group" aria-label="Classification filter">
|
|
1274
|
-
${e.map((
|
|
1310
|
+
${e.map((r) => l`<button class="chip ${this.classFilter === r ? "on" : ""}"
|
|
1275
1311
|
@click=${() => {
|
|
1276
|
-
this.classFilter =
|
|
1277
|
-
}}>${
|
|
1312
|
+
this.classFilter = r;
|
|
1313
|
+
}}>${r}</button>`)}
|
|
1278
1314
|
</div>
|
|
1279
1315
|
<input type="search" placeholder="Find a school…" aria-label="Find a school"
|
|
1280
|
-
.value=${this.query} @input=${(
|
|
1281
|
-
this.query =
|
|
1316
|
+
.value=${this.query} @input=${(r) => {
|
|
1317
|
+
this.query = r.target.value;
|
|
1282
1318
|
}}>
|
|
1283
1319
|
<span class="spacer"></span>
|
|
1284
|
-
<span class="asof">Records through ${y(
|
|
1320
|
+
<span class="asof">Records through ${y(mt(), { month: "long", day: "numeric" })} · conference games count toward both records · scrimmages toward neither</span>
|
|
1285
1321
|
</div>
|
|
1286
|
-
${s.map((
|
|
1322
|
+
${s.map((r) => this.renderConference(t, r))}
|
|
1287
1323
|
`)}
|
|
1288
1324
|
`;
|
|
1289
1325
|
}
|
|
1290
1326
|
renderConference(t, e) {
|
|
1291
1327
|
const s = this.data.teams.filter((i) => i.conferenceId === e.id);
|
|
1292
1328
|
if (!s.length) return m;
|
|
1293
|
-
const
|
|
1329
|
+
const r = this.query.trim().toLowerCase(), o = qt(s, t.records);
|
|
1294
1330
|
return l`
|
|
1295
1331
|
<div class="card">
|
|
1296
1332
|
<div class="card-head">
|
|
@@ -1305,16 +1341,16 @@ class Kt extends w {
|
|
|
1305
1341
|
<th>Streak</th><th>Last 5</th><th>Next</th>
|
|
1306
1342
|
</tr></thead>
|
|
1307
1343
|
<tbody>
|
|
1308
|
-
${o.map((i, n) => this.renderRow(t, i, n,
|
|
1344
|
+
${o.map((i, n) => this.renderRow(t, i, n, r))}
|
|
1309
1345
|
</tbody>
|
|
1310
1346
|
</table></div>
|
|
1311
1347
|
</div>
|
|
1312
1348
|
`;
|
|
1313
1349
|
}
|
|
1314
|
-
renderRow(t, e, s,
|
|
1350
|
+
renderRow(t, e, s, r) {
|
|
1315
1351
|
const o = t.schoolsById[e.team.schoolId], i = o?.name || e.team.name || "TBD";
|
|
1316
|
-
if (
|
|
1317
|
-
const n = e.rec.pf - e.rec.pa, d =
|
|
1352
|
+
if (r && !i.toLowerCase().includes(r)) return m;
|
|
1353
|
+
const n = e.rec.pf - e.rec.pa, d = gt(this.data.games, e.team.id), c = (e.team.championships || []).map((p) => l`
|
|
1318
1354
|
<span class="pill champ" title="${p.season} ${p.title} champion">★ ${p.season} ${p.title}</span>`), h = () => {
|
|
1319
1355
|
location.href = g(t.hrefs.school, { id: e.team.schoolId });
|
|
1320
1356
|
};
|
|
@@ -1324,25 +1360,25 @@ class Kt extends w {
|
|
|
1324
1360
|
}}>
|
|
1325
1361
|
<td class="mut">${s + 1}</td>
|
|
1326
1362
|
<td class="teamcell">
|
|
1327
|
-
${H(o)}${
|
|
1363
|
+
${H(o)}${bt(t, e.team.id, null)}
|
|
1328
1364
|
<a href=${g(t.hrefs.school, { id: e.team.schoolId })}>${i}</a> ${c}
|
|
1329
1365
|
</td>
|
|
1330
1366
|
<td class="num">${x(e.rec, !0)}</td>
|
|
1331
|
-
<td class="num">${
|
|
1367
|
+
<td class="num">${Rt(e.confPct)}</td>
|
|
1332
1368
|
<td class="num">${x(e.rec)}</td>
|
|
1333
|
-
<td class="num">${
|
|
1369
|
+
<td class="num">${Rt(e.overallPct)}</td>
|
|
1334
1370
|
<td class="num">${e.rec.pf}</td>
|
|
1335
1371
|
<td class="num">${e.rec.pa}</td>
|
|
1336
1372
|
<td class="num" style="color:${n >= 0 ? "var(--hsot-win)" : "var(--hsot-loss)"}">${n > 0 ? "+" : ""}${n}</td>
|
|
1337
1373
|
<td>${st(e.rec.results) || "·"}</td>
|
|
1338
|
-
<td>${
|
|
1339
|
-
<td>${
|
|
1374
|
+
<td>${yt(t, e.team.id)}</td>
|
|
1375
|
+
<td>${Yt(t, d, e.team.id)}</td>
|
|
1340
1376
|
</tr>
|
|
1341
1377
|
`;
|
|
1342
1378
|
}
|
|
1343
1379
|
}
|
|
1344
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings",
|
|
1345
|
-
const
|
|
1380
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-standings") && globalThis.customElements.define("hsot-standings", Qt);
|
|
1381
|
+
const We = b`
|
|
1346
1382
|
.hero1 {
|
|
1347
1383
|
border-radius: var(--hsot-radius-md); color: var(--hsot-white);
|
|
1348
1384
|
padding: 1.3rem 1.4rem; display: flex; align-items: center; gap: 1.2rem;
|
|
@@ -1359,8 +1395,8 @@ const Me = b`
|
|
|
1359
1395
|
.delta.new { background: var(--hsot-straw); color: #6b5900; border-radius: var(--hsot-radius-xs); padding: 0.1rem 0.3rem; font-size: 0.7rem; }
|
|
1360
1396
|
.sparkline { vertical-align: middle; }
|
|
1361
1397
|
`;
|
|
1362
|
-
class
|
|
1363
|
-
static styles = [...j,
|
|
1398
|
+
class Zt extends w {
|
|
1399
|
+
static styles = [...j, We];
|
|
1364
1400
|
static properties = {
|
|
1365
1401
|
...w.properties,
|
|
1366
1402
|
sport: { type: String },
|
|
@@ -1377,7 +1413,7 @@ class Qt extends w {
|
|
|
1377
1413
|
t && (this.pollDate = t);
|
|
1378
1414
|
}
|
|
1379
1415
|
async fetchData(t) {
|
|
1380
|
-
const e = this.season || et(), [s,
|
|
1416
|
+
const e = this.season || et(), [s, r, o, i, n] = await Promise.all([
|
|
1381
1417
|
t.listRankings({ sport: this.sport, ...this.gender ? { gender: this.gender } : {} }),
|
|
1382
1418
|
t.listSchools(),
|
|
1383
1419
|
t.listTeams({ sport: this.sport }),
|
|
@@ -1387,7 +1423,7 @@ class Qt extends w {
|
|
|
1387
1423
|
return {
|
|
1388
1424
|
season: e,
|
|
1389
1425
|
polls: d,
|
|
1390
|
-
schools:
|
|
1426
|
+
schools: r.items,
|
|
1391
1427
|
teams: o.items,
|
|
1392
1428
|
conferences: i.items,
|
|
1393
1429
|
games: n.items
|
|
@@ -1407,8 +1443,8 @@ class Qt extends w {
|
|
|
1407
1443
|
const n = e.map((p, f) => {
|
|
1408
1444
|
const u = (p.teamIds || []).indexOf(t);
|
|
1409
1445
|
if (u === -1) return null;
|
|
1410
|
-
const $ = e.length === 1 ? 96 / 2 : f / (e.length - 1) * 90 + 3,
|
|
1411
|
-
return { x: $, y:
|
|
1446
|
+
const $ = e.length === 1 ? 96 / 2 : f / (e.length - 1) * 90 + 3, at = 3 + u / 24 * 20;
|
|
1447
|
+
return { x: $, y: at };
|
|
1412
1448
|
}), d = [];
|
|
1413
1449
|
let c = [];
|
|
1414
1450
|
if (n.forEach((p) => {
|
|
@@ -1416,22 +1452,22 @@ class Qt extends w {
|
|
|
1416
1452
|
}), c.length && d.push(c), !d.length) return m;
|
|
1417
1453
|
const h = n[s];
|
|
1418
1454
|
return l`<svg class="sparkline" width=${96} height=${26} viewBox="0 0 ${96} ${26}" role="img" aria-label="rank history">
|
|
1419
|
-
${d.map((p) =>
|
|
1455
|
+
${d.map((p) => Pt`<polyline fill="none" stroke="var(--hsot-red)" stroke-width="2"
|
|
1420
1456
|
points=${p.map((f) => `${f.x.toFixed(1)},${f.y.toFixed(1)}`).join(" ")}></polyline>`)}
|
|
1421
|
-
${h ?
|
|
1457
|
+
${h ? Pt`<circle cx=${h.x.toFixed(1)} cy=${h.y.toFixed(1)} r="3" fill="var(--hsot-black)"></circle>` : m}
|
|
1422
1458
|
</svg>`;
|
|
1423
1459
|
}
|
|
1424
1460
|
movement(t, e, s) {
|
|
1425
|
-
const
|
|
1426
|
-
return
|
|
1461
|
+
const r = Me(t, e, s);
|
|
1462
|
+
return r.kind === "up" ? l`<span class="delta up">▲ ${r.delta}</span>` : r.kind === "down" ? l`<span class="delta down">▼ ${r.delta}</span>` : r.kind === "new" ? l`<span class="delta new">NEW</span>` : r.kind === "same" ? l`<span class="delta same">—</span>` : l`<span class="delta same">·</span>`;
|
|
1427
1463
|
}
|
|
1428
1464
|
renderView() {
|
|
1429
1465
|
const t = this.ctx, e = this.data.polls;
|
|
1430
1466
|
if (!e.length) return l`<div class="view"><p class="empty">No ${this.sport} polls published yet this season.</p></div>`;
|
|
1431
|
-
const s = Math.max(0, e.findIndex((p) => p.effectiveDate === this.pollDate)),
|
|
1467
|
+
const s = Math.max(0, e.findIndex((p) => p.effectiveDate === this.pollDate)), r = e[s] || e[0], o = e[s + 1] || null, i = e.slice().reverse(), n = i.indexOf(r), d = v(this.data.conferences), c = (r.teamIds || [])[0], h = c ? O(t, c) : null;
|
|
1432
1468
|
return l`
|
|
1433
|
-
${
|
|
1434
|
-
title: l`${
|
|
1469
|
+
${$t(this, t, {
|
|
1470
|
+
title: l`${z(this.sport)} Top 25`,
|
|
1435
1471
|
sub: l`The HighSchoolOT poll · updated weekly · ${e.length} polls this season`,
|
|
1436
1472
|
teams: this.data.teams
|
|
1437
1473
|
})}
|
|
@@ -1442,7 +1478,7 @@ class Qt extends w {
|
|
|
1442
1478
|
<select id="pollsel" @change=${(p) => {
|
|
1443
1479
|
this.pollDate = p.target.value;
|
|
1444
1480
|
}}>
|
|
1445
|
-
${e.map((p, f) => l`<option value=${p.effectiveDate} ?selected=${p ===
|
|
1481
|
+
${e.map((p, f) => l`<option value=${p.effectiveDate} ?selected=${p === r}>
|
|
1446
1482
|
${y(p.effectiveDate, { month: "long", day: "numeric", year: "numeric" })}${f === 0 ? " · current" : ""}
|
|
1447
1483
|
</option>`)}
|
|
1448
1484
|
</select>
|
|
@@ -1457,22 +1493,22 @@ class Qt extends w {
|
|
|
1457
1493
|
<span class="spacer"></span>
|
|
1458
1494
|
<span class="asof">Movement vs. the previous poll · sparkline = season rank history</span>
|
|
1459
1495
|
</div>
|
|
1460
|
-
${h ? this.renderHero(t,
|
|
1496
|
+
${h ? this.renderHero(t, r, o, c, h, d) : m}
|
|
1461
1497
|
<div class="card"><div class="tablewrap"><table class="data">
|
|
1462
1498
|
<thead><tr>
|
|
1463
1499
|
<th class="num">Rk</th><th>Mvmt</th><th>Team</th><th class="num">Record</th>
|
|
1464
1500
|
<th>Conference</th><th>Last result</th><th>Next</th><th>Season</th>
|
|
1465
1501
|
</tr></thead>
|
|
1466
1502
|
<tbody>
|
|
1467
|
-
${(
|
|
1503
|
+
${(r.teamIds || []).map((p, f) => f === 0 || !p ? m : this.renderRow(t, r, o, i, n, d, p, f + 1))}
|
|
1468
1504
|
</tbody>
|
|
1469
1505
|
</table></div></div>
|
|
1470
1506
|
<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>
|
|
1471
1507
|
`)}
|
|
1472
1508
|
`;
|
|
1473
1509
|
}
|
|
1474
|
-
renderHero(t, e, s,
|
|
1475
|
-
const n = t.records[
|
|
1510
|
+
renderHero(t, e, s, r, o, i) {
|
|
1511
|
+
const n = t.records[r], d = Bt(t.records, r), c = i[t.teamsById[r]?.conferenceId], h = `linear-gradient(120deg, ${o.colorPrimary || "#030711"} 0%, var(--hsot-black) 85%)`;
|
|
1476
1512
|
return l`
|
|
1477
1513
|
<div class="hero1" style="background:${h}">
|
|
1478
1514
|
<div class="bigrank">#1</div>
|
|
@@ -1483,21 +1519,21 @@ class Qt extends w {
|
|
|
1483
1519
|
${x(n)} overall${c ? l` · ${x(n, !0)} ${c.name}` : m}
|
|
1484
1520
|
· streak ${st(n?.results) || "·"}
|
|
1485
1521
|
${d ? l` · last: ${d.mark} ${d.my}-${d.their} vs ${Z(t, d.opp)}` : m}
|
|
1486
|
-
${this.movement(e, s,
|
|
1522
|
+
${this.movement(e, s, r)}
|
|
1487
1523
|
</div>
|
|
1488
1524
|
</div>
|
|
1489
1525
|
</div>
|
|
1490
1526
|
`;
|
|
1491
1527
|
}
|
|
1492
|
-
renderRow(t, e, s,
|
|
1493
|
-
const c =
|
|
1528
|
+
renderRow(t, e, s, r, o, i, n, d) {
|
|
1529
|
+
const c = O(t, n);
|
|
1494
1530
|
if (!c) return m;
|
|
1495
|
-
const h = t.records[n], p =
|
|
1531
|
+
const h = t.records[n], p = Bt(t.records, n), f = gt(this.data.games, n), u = i[t.teamsById[n]?.conferenceId], $ = () => {
|
|
1496
1532
|
location.href = g(t.hrefs.school, { id: c.id });
|
|
1497
1533
|
};
|
|
1498
1534
|
return l`
|
|
1499
|
-
<tr class="rowlink" @click=${(
|
|
1500
|
-
|
|
1535
|
+
<tr class="rowlink" @click=${(at) => {
|
|
1536
|
+
at.target.closest("a") || $();
|
|
1501
1537
|
}}>
|
|
1502
1538
|
<td class="num" style="font-weight:700">${d}</td>
|
|
1503
1539
|
<td>${this.movement(e, s, n)}</td>
|
|
@@ -1508,14 +1544,14 @@ class Qt extends w {
|
|
|
1508
1544
|
<td>${p ? l`<a class="box" style="text-decoration:none" href=${g(t.hrefs.game, { sport: this.sport, id: p.gameId })}>
|
|
1509
1545
|
<b style="color:${p.mark === "W" ? "var(--hsot-win)" : p.mark === "L" ? "var(--hsot-loss)" : "var(--hsot-tie)"}">${p.mark}</b>
|
|
1510
1546
|
${p.my}-${p.their} vs ${Z(t, p.opp)}</a>` : l`<span class="mut">·</span>`}</td>
|
|
1511
|
-
<td>${
|
|
1512
|
-
<td>${this.sparkline(n,
|
|
1547
|
+
<td>${Yt(t, f, n)}</td>
|
|
1548
|
+
<td>${this.sparkline(n, r, o)}</td>
|
|
1513
1549
|
</tr>
|
|
1514
1550
|
`;
|
|
1515
1551
|
}
|
|
1516
1552
|
}
|
|
1517
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings",
|
|
1518
|
-
const
|
|
1553
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-rankings") && globalThis.customElements.define("hsot-rankings", Zt);
|
|
1554
|
+
const qe = b`
|
|
1519
1555
|
.schoolhero { color: var(--hsot-white); padding: 1.6rem 1.25rem 1.3rem; }
|
|
1520
1556
|
.schoolhero .inner { max-width: 1366px; margin: 0 auto; display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
|
|
1521
1557
|
.schoolhero .crest {
|
|
@@ -1538,10 +1574,14 @@ const Le = b`
|
|
|
1538
1574
|
.tile .v { font-family: var(--hsot-heading-font); font-weight: 700; font-size: 1.7rem; line-height: 1.15; color: var(--hsot-black); }
|
|
1539
1575
|
.tile .s { font-size: 0.78rem; color: var(--hsot-gray-5); }
|
|
1540
1576
|
.cols { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 1.25rem; }
|
|
1577
|
+
/* The season roster photo heads the roster card, above the table. Natural
|
|
1578
|
+
height: a team photo is never cropped to a box — the card's overflow
|
|
1579
|
+
rounds its top corners. */
|
|
1580
|
+
.rosterphoto { display: block; width: 100%; height: auto; background: var(--hsot-gray-1); border-bottom: 1px solid var(--hsot-gray-2); }
|
|
1541
1581
|
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } .schoolhero h1 { font-size: 1.9rem; } }
|
|
1542
1582
|
`;
|
|
1543
|
-
class
|
|
1544
|
-
static styles = [...j,
|
|
1583
|
+
class Jt extends w {
|
|
1584
|
+
static styles = [...j, qe];
|
|
1545
1585
|
static properties = {
|
|
1546
1586
|
...w.properties,
|
|
1547
1587
|
schoolId: { type: String, attribute: "school-id" },
|
|
@@ -1597,13 +1637,13 @@ class Zt extends w {
|
|
|
1597
1637
|
this.sport = t, this.load();
|
|
1598
1638
|
}
|
|
1599
1639
|
renderView() {
|
|
1600
|
-
const { school: t, teams: e, active: s, season:
|
|
1640
|
+
const { school: t, teams: e, active: s, season: r } = this.data;
|
|
1601
1641
|
if (!t) return l`<div class="view"><p class="empty">School not found.</p></div>`;
|
|
1602
1642
|
const o = this.ctx, i = K(t.colorPrimary || "#030711"), n = (t.adm || [])[0], d = v(this.data.conferences), c = s ? d[s.conferenceId] : null;
|
|
1603
1643
|
return l`
|
|
1604
1644
|
<div class="schoolhero" style="background:linear-gradient(115deg, ${t.colorPrimary || "#030711"} 0%, ${t.colorPrimary || "#030711"} 55%, var(--hsot-black) 100%);color:${i}">
|
|
1605
1645
|
<div class="inner">
|
|
1606
|
-
${Q(t, 84) ? l`<img class="crest logo" alt="" loading="lazy" src=${Q(t, 84)} />` : l`<div class="crest" style="background:${t.colorSecondary || "#7C7C7C"};color:${K(t.colorSecondary || "#7C7C7C")}">${
|
|
1646
|
+
${Q(t, 84) ? l`<img class="crest logo" alt="" loading="lazy" src=${Q(t, 84)} />` : l`<div class="crest" style="background:${t.colorSecondary || "#7C7C7C"};color:${K(t.colorSecondary || "#7C7C7C")}">${ft(t)}</div>`}
|
|
1607
1647
|
<div style="min-width:260px">
|
|
1608
1648
|
<h1>${t.name} <span class="mascot">${t.mascot || ""}</span></h1>
|
|
1609
1649
|
<div class="facts">
|
|
@@ -1626,21 +1666,21 @@ class Zt extends w {
|
|
|
1626
1666
|
</div>
|
|
1627
1667
|
${q(this, l`
|
|
1628
1668
|
${G(this)}
|
|
1629
|
-
${s ? this.renderTeam(o, s, c,
|
|
1669
|
+
${s ? this.renderTeam(o, s, c, r) : l`<p class="empty">No teams recorded for this school yet.</p>`}
|
|
1630
1670
|
`)}
|
|
1631
1671
|
`;
|
|
1632
1672
|
}
|
|
1633
|
-
renderTeam(t, e, s,
|
|
1634
|
-
const o = t.records[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, i = o.w + o.l + o.t, n = s ? this.data.allTeams.filter((p) => p.conferenceId === s.id) : [], d = s ?
|
|
1673
|
+
renderTeam(t, e, s, r) {
|
|
1674
|
+
const o = t.records[e.id] || { w: 0, l: 0, t: 0, cw: 0, cl: 0, ct: 0, pf: 0, pa: 0, results: [] }, i = o.w + o.l + o.t, n = s ? this.data.allTeams.filter((p) => p.conferenceId === s.id) : [], d = s ? qt(n, t.records).findIndex((p) => p.team.id === e.id) + 1 : 0, c = vt(t.rankings, t.teamsById, e.id, e.sport, null), h = this.data.games.filter((p) => p.homeTeamId === e.id || p.awayTeamId === e.id).sort((p, f) => String(p.date).localeCompare(String(f.date)));
|
|
1635
1675
|
return l`
|
|
1636
1676
|
<div class="tiles">
|
|
1637
1677
|
<div class="tile"><div class="k">Overall</div><div class="v">${x(o)}</div><div class="s">${i} games played</div></div>
|
|
1638
1678
|
<div class="tile"><div class="k">${s?.name || "Conference"}</div><div class="v">${x(o, !0)}</div>
|
|
1639
|
-
<div class="s">${d ? `${
|
|
1679
|
+
<div class="s">${d ? `${Ie(d)} of ${n.length}` : "·"}</div></div>
|
|
1640
1680
|
<div class="tile"><div class="k">Points</div><div class="v">${i ? (o.pf / i).toFixed(1) : "0.0"}</div>
|
|
1641
1681
|
<div class="s">scored per game · ${i ? (o.pa / i).toFixed(1) : "0.0"} allowed</div></div>
|
|
1642
1682
|
<div class="tile"><div class="k">Streak</div><div class="v">${st(o.results) || "·"}</div>
|
|
1643
|
-
<div class="s">last 5: ${
|
|
1683
|
+
<div class="s">last 5: ${yt(t, e.id)}</div></div>
|
|
1644
1684
|
<div class="tile"><div class="k">HSOT Top 25</div><div class="v">${c ? `#${c}` : "NR"}</div>
|
|
1645
1685
|
<div class="s"><a href=${g(t.hrefs.section, { sport: e.sport, view: "rankings" })}>full poll</a></div></div>
|
|
1646
1686
|
</div>
|
|
@@ -1652,30 +1692,30 @@ class Zt extends w {
|
|
|
1652
1692
|
<div>
|
|
1653
1693
|
<div class="section-title">Schedule & results</div>
|
|
1654
1694
|
<div class="card">
|
|
1655
|
-
${h.length ? l`<ul class="gamelist">${h.map((p) => this.renderGameRow(t, e, p))}</ul>` : l`<p class="empty">No ${e.sport} games recorded for ${
|
|
1695
|
+
${h.length ? l`<ul class="gamelist">${h.map((p) => this.renderGameRow(t, e, p))}</ul>` : l`<p class="empty">No ${e.sport} games recorded for ${r}.</p>`}
|
|
1656
1696
|
</div>
|
|
1657
1697
|
</div>
|
|
1658
1698
|
<div>
|
|
1659
|
-
<div class="section-title">Roster · ${
|
|
1660
|
-
<div class="card">${this.renderRoster(
|
|
1699
|
+
<div class="section-title">Roster · ${r}</div>
|
|
1700
|
+
<div class="card">${this.renderRoster(e, r)}</div>
|
|
1661
1701
|
</div>
|
|
1662
1702
|
</div>
|
|
1663
1703
|
`;
|
|
1664
1704
|
}
|
|
1665
1705
|
renderGameRow(t, e, s) {
|
|
1666
|
-
const
|
|
1667
|
-
let d = l`<span class="mut">${
|
|
1706
|
+
const r = s.homeTeamId === e.id, o = r ? s.awayTeamId : s.homeTeamId, i = r ? s.homeScore : s.awayScore, n = r ? s.awayScore : s.homeScore;
|
|
1707
|
+
let d = l`<span class="mut">${pt(s.time)}</span>`;
|
|
1668
1708
|
if (s.state === "final") {
|
|
1669
|
-
const h =
|
|
1709
|
+
const h = ut(s), p = h === "tie" ? "T" : h === (r ? "home" : "away") ? "W" : "L";
|
|
1670
1710
|
d = l`<span class=${p}>${p}</span> ${i}-${n}${s.finish === "overtime" ? l` <span class="mut">OT</span>` : m}${s.forfeit && s.forfeit !== "none" ? l` <span class="mut">FF</span>` : m}`;
|
|
1671
1711
|
} else s.state === "live" && (d = l`<span style="color:var(--hsot-red)">${i}-${n}</span>`);
|
|
1672
1712
|
const c = s.gameType === "conference" ? "Conf" : s.gameType === "nonconference" ? "Non-conf" : s.gameType === "playoff" ? `Playoff${s.label ? ` · ${s.label}` : ""}` : "Scrimmage";
|
|
1673
1713
|
return l`
|
|
1674
1714
|
<li>
|
|
1675
1715
|
<span class="d">${y(s.date)}</span>
|
|
1676
|
-
${
|
|
1716
|
+
${jt(s).kind === "sched" ? m : J(s)}
|
|
1677
1717
|
<span class="res">${d}</span>
|
|
1678
|
-
<span class="opp">${
|
|
1718
|
+
<span class="opp">${r ? "vs" : "at"} ${Vt(t, o, s.date)}
|
|
1679
1719
|
<span class="pill type">${c}</span>
|
|
1680
1720
|
${s.broadcast ? l`<span class="pill class">${s.broadcast}</span>` : m}
|
|
1681
1721
|
</span>
|
|
@@ -1684,24 +1724,27 @@ class Zt extends w {
|
|
|
1684
1724
|
</li>
|
|
1685
1725
|
`;
|
|
1686
1726
|
}
|
|
1687
|
-
renderRoster(t) {
|
|
1688
|
-
const
|
|
1689
|
-
if (!
|
|
1690
|
-
return l`<p class="empty">Roster not published for ${
|
|
1691
|
-
const s = v(this.data.players),
|
|
1727
|
+
renderRoster(t, e) {
|
|
1728
|
+
const s = this.data.roster;
|
|
1729
|
+
if (!s)
|
|
1730
|
+
return l`<p class="empty">Roster not published for ${e}.</p>`;
|
|
1731
|
+
const r = je(s, 560), o = this.data.school?.name || "", i = v(this.data.players), n = s.entries.slice().sort((c, h) => (c.number || 0) - (h.number || 0)), d = n.some((c) => i[c.playerId]?.college);
|
|
1692
1732
|
return l`
|
|
1733
|
+
${r ? l`<img class="rosterphoto" src=${r} loading="lazy" decoding="async"
|
|
1734
|
+
alt="${o} ${t.name} ${e} team photo" />` : m}
|
|
1693
1735
|
<div class="tablewrap"><table class="data">
|
|
1694
|
-
<thead><tr><th class="num">No.</th><th>Player</th><th>Pos</th><th>Class</th><th class="num">Ht</th><th class="num">Wt</th
|
|
1736
|
+
<thead><tr><th class="num">No.</th><th>Player</th><th>Pos</th><th>Class</th><th class="num">Ht</th><th class="num">Wt</th>${d ? l`<th>College</th>` : m}</tr></thead>
|
|
1695
1737
|
<tbody>
|
|
1696
|
-
${
|
|
1697
|
-
const
|
|
1698
|
-
return
|
|
1699
|
-
<td class="num mut">${
|
|
1700
|
-
<td style="font-weight:500">${
|
|
1701
|
-
<td>${
|
|
1702
|
-
<td class="mut">${
|
|
1703
|
-
<td class="num">${
|
|
1704
|
-
<td class="num">${
|
|
1738
|
+
${n.map((c) => {
|
|
1739
|
+
const h = i[c.playerId];
|
|
1740
|
+
return h ? l`<tr>
|
|
1741
|
+
<td class="num mut">${c.number ?? "·"}</td>
|
|
1742
|
+
<td style="font-weight:500">${h.firstName} ${h.lastName}</td>
|
|
1743
|
+
<td>${c.position || "·"}</td>
|
|
1744
|
+
<td class="mut">${h.classOf || "·"}</td>
|
|
1745
|
+
<td class="num">${Ae(h.heightIn)}</td>
|
|
1746
|
+
<td class="num">${h.weightLb || "·"}</td>
|
|
1747
|
+
${d ? l`<td>${h.college || "·"}</td>` : m}
|
|
1705
1748
|
</tr>` : m;
|
|
1706
1749
|
})}
|
|
1707
1750
|
</tbody>
|
|
@@ -1709,37 +1752,37 @@ class Zt extends w {
|
|
|
1709
1752
|
`;
|
|
1710
1753
|
}
|
|
1711
1754
|
}
|
|
1712
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school",
|
|
1713
|
-
const
|
|
1714
|
-
function
|
|
1715
|
-
return
|
|
1755
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-school") && globalThis.customElements.define("hsot-school", Jt);
|
|
1756
|
+
const Ge = "https://api.wral.com/search";
|
|
1757
|
+
function Ve(a) {
|
|
1758
|
+
return a.map((t) => `uri:"${t}"`).join(" OR ");
|
|
1716
1759
|
}
|
|
1717
|
-
function
|
|
1718
|
-
const e = String(
|
|
1760
|
+
function Ye(a, t) {
|
|
1761
|
+
const e = String(a || Ge).replace(/\/+$/, ""), s = new URLSearchParams({ query: Ve(t), sort: "score", lang: "en" });
|
|
1719
1762
|
return `${e}/v1/query?${s}`;
|
|
1720
1763
|
}
|
|
1721
|
-
function
|
|
1764
|
+
function Xt(a) {
|
|
1722
1765
|
try {
|
|
1723
|
-
const t = new URL(
|
|
1766
|
+
const t = new URL(a);
|
|
1724
1767
|
if (/(^|\.)smugmug\.com$/i.test(t.hostname)) {
|
|
1725
1768
|
const e = t.pathname.split("/").filter(Boolean).pop() || "", s = !e || /^[ni]-[A-Za-z0-9]+$/.test(e);
|
|
1726
1769
|
return {
|
|
1727
|
-
uri:
|
|
1728
|
-
title: s ?
|
|
1770
|
+
uri: a,
|
|
1771
|
+
title: s ? a : decodeURIComponent(e).replace(/-/g, " "),
|
|
1729
1772
|
photos: !0
|
|
1730
1773
|
};
|
|
1731
1774
|
}
|
|
1732
1775
|
} catch {
|
|
1733
1776
|
}
|
|
1734
|
-
return { uri:
|
|
1777
|
+
return { uri: a, title: a };
|
|
1735
1778
|
}
|
|
1736
|
-
async function
|
|
1737
|
-
const
|
|
1738
|
-
if (!
|
|
1739
|
-
const o = await
|
|
1740
|
-
return t.map((n) => i.get(n) ||
|
|
1779
|
+
async function Ke(a, t, e) {
|
|
1780
|
+
const r = await ((...n) => fetch(...n))(Ye(a, t));
|
|
1781
|
+
if (!r.ok) throw new Error(`search answered ${r.status}`);
|
|
1782
|
+
const o = await r.json(), i = new Map((o.items || []).map((n) => [n.uri, n]));
|
|
1783
|
+
return t.map((n) => i.get(n) || Xt(n));
|
|
1741
1784
|
}
|
|
1742
|
-
const
|
|
1785
|
+
const Qe = b`
|
|
1743
1786
|
.breadcrumbs { font-size: 0.8125rem; margin: 0.9rem 0 0; color: var(--hsot-gray-5); }
|
|
1744
1787
|
.breadcrumbs a { text-decoration: none; }
|
|
1745
1788
|
.scorehead { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; padding: 1.4rem 1rem; }
|
|
@@ -1778,8 +1821,8 @@ const Ve = b`
|
|
|
1778
1821
|
.cols { grid-template-columns: 1fr; }
|
|
1779
1822
|
}
|
|
1780
1823
|
`;
|
|
1781
|
-
class
|
|
1782
|
-
static styles = [...j,
|
|
1824
|
+
class te extends w {
|
|
1825
|
+
static styles = [...j, Qe];
|
|
1783
1826
|
static properties = {
|
|
1784
1827
|
...w.properties,
|
|
1785
1828
|
gameId: { type: String, attribute: "game-id" },
|
|
@@ -1793,7 +1836,7 @@ class Xt extends w {
|
|
|
1793
1836
|
super(), this.gameId = "", this.searchApi = "";
|
|
1794
1837
|
}
|
|
1795
1838
|
async fetchData(t) {
|
|
1796
|
-
const e = await t.getGame(this.gameId), s = Array.isArray(e.coverageUrls) ? e.coverageUrls : [], [
|
|
1839
|
+
const e = await t.getGame(this.gameId), s = Array.isArray(e.coverageUrls) ? e.coverageUrls : [], [r, o, i, n, d, c] = await Promise.all([
|
|
1797
1840
|
t.listSchools(),
|
|
1798
1841
|
t.listTeams({ sport: e.sport }),
|
|
1799
1842
|
t.listConferences(),
|
|
@@ -1801,11 +1844,11 @@ class Xt extends w {
|
|
|
1801
1844
|
t.listGames({ sport: e.sport, season: e.season }),
|
|
1802
1845
|
// A search outage must not blank the box score — degrade to bare
|
|
1803
1846
|
// links (fetchCoverage already degrades per-URL index misses).
|
|
1804
|
-
s.length ?
|
|
1847
|
+
s.length ? Ke(this.searchApi, s).catch(() => s.map(Xt)) : Promise.resolve([])
|
|
1805
1848
|
]);
|
|
1806
1849
|
return {
|
|
1807
1850
|
game: e,
|
|
1808
|
-
schools:
|
|
1851
|
+
schools: r.items,
|
|
1809
1852
|
teams: o.items,
|
|
1810
1853
|
conferences: i.items,
|
|
1811
1854
|
rankings: n.items,
|
|
@@ -1826,18 +1869,18 @@ class Xt extends w {
|
|
|
1826
1869
|
renderView() {
|
|
1827
1870
|
const t = this.data.game;
|
|
1828
1871
|
if (!t) return l`<div class="view"><p class="empty">Game not found.</p></div>`;
|
|
1829
|
-
const e = this.ctx, s = v(this.data.conferences),
|
|
1872
|
+
const e = this.ctx, s = v(this.data.conferences), r = e.teamsById[t.awayTeamId] ? e.schoolsById[e.teamsById[t.awayTeamId].schoolId] : null, o = e.teamsById[t.homeTeamId] ? e.schoolsById[e.teamsById[t.homeTeamId].schoolId] : null, i = ut(t), n = (h) => t.state === "final" && i !== h && i !== "tie" ? "opacity:0.45" : "", d = t.conferenceId ? s[t.conferenceId] : null, c = this.data.games.filter((h) => h.id !== t.id && h.state === "final" && h.gameType !== "scrimmage" && (h.homeTeamId === t.homeTeamId && h.awayTeamId === t.awayTeamId || h.homeTeamId === t.awayTeamId && h.awayTeamId === t.homeTeamId));
|
|
1830
1873
|
return l`
|
|
1831
1874
|
${q(this, l`
|
|
1832
1875
|
${G(this)}
|
|
1833
1876
|
<p class="breadcrumbs">
|
|
1834
|
-
<a href=${g(e.hrefs.section, { sport: t.sport, view: "scores" })}>${
|
|
1877
|
+
<a href=${g(e.hrefs.section, { sport: t.sport, view: "scores" })}>${z(t.sport)}</a> /
|
|
1835
1878
|
<a href=${g(e.hrefs.section, { sport: t.sport, view: "scores" })}>Scores/Schedules</a> /
|
|
1836
|
-
${
|
|
1879
|
+
${C(e, t.awayTeamId)} at ${C(e, t.homeTeamId)}
|
|
1837
1880
|
</p>
|
|
1838
1881
|
<div class="card">
|
|
1839
1882
|
<div class="scorehead">
|
|
1840
|
-
${this.teamBlock(e, t, t.awayTeamId,
|
|
1883
|
+
${this.teamBlock(e, t, t.awayTeamId, r, !1)}
|
|
1841
1884
|
<div class="mid">
|
|
1842
1885
|
<div class="bigscore">
|
|
1843
1886
|
<span style=${n("away")}>${t.awayScore}</span>
|
|
@@ -1845,7 +1888,7 @@ class Xt extends w {
|
|
|
1845
1888
|
<span style=${n("home")}>${t.homeScore}</span>
|
|
1846
1889
|
</div>
|
|
1847
1890
|
<div class="status">${J(t)}</div>
|
|
1848
|
-
<div class="status">${y(t.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${t.state === "scheduled" && t.time ? l` · ${
|
|
1891
|
+
<div class="status">${y(t.date, { weekday: "short", month: "short", day: "numeric", year: "numeric" })}${t.state === "scheduled" && t.time ? l` · ${pt(t.time)}` : m} · ${t.venue || "Venue TBD"}
|
|
1849
1892
|
${t.broadcast ? l` · <span class="pill class">${t.broadcast}</span>` : m}</div>
|
|
1850
1893
|
<div class="status">
|
|
1851
1894
|
<span class="pill type">${t.gameType === "conference" ? `${d?.name || "Conference"} game` : t.gameType}</span>
|
|
@@ -1855,7 +1898,7 @@ class Xt extends w {
|
|
|
1855
1898
|
</div>
|
|
1856
1899
|
${this.teamBlock(e, t, t.homeTeamId, o, !0)}
|
|
1857
1900
|
</div>
|
|
1858
|
-
${this.renderLineScore(t,
|
|
1901
|
+
${this.renderLineScore(t, r, o)}
|
|
1859
1902
|
${t.notes ? l`<p class="note" style="padding:0 1rem 0.9rem;text-align:center">${t.notes}</p>` : m}
|
|
1860
1903
|
</div>
|
|
1861
1904
|
${(this.data.coverage || []).length ? l`
|
|
@@ -1876,39 +1919,39 @@ class Xt extends w {
|
|
|
1876
1919
|
</div>` : m}
|
|
1877
1920
|
<div class="section-title">Season context</div>
|
|
1878
1921
|
<div class="cols">
|
|
1879
|
-
${[[t.awayTeamId,
|
|
1922
|
+
${[[t.awayTeamId, r], [t.homeTeamId, o]].map(([h, p]) => this.renderContext(e, h, p))}
|
|
1880
1923
|
</div>
|
|
1881
1924
|
${c.length ? l`
|
|
1882
1925
|
<div class="section-title">Head to head this season</div>
|
|
1883
1926
|
<div class="card"><ul class="gamelist">
|
|
1884
1927
|
${c.map((h) => l`<li>
|
|
1885
1928
|
<span class="d">${y(h.date)}</span>${J(h)}
|
|
1886
|
-
<span class="opp">${
|
|
1929
|
+
<span class="opp">${C(e, h.awayTeamId)} ${h.awayScore}, ${C(e, h.homeTeamId)} ${h.homeScore}</span>
|
|
1887
1930
|
<a class="box" href=${g(e.hrefs.game, { sport: t.sport, id: h.id })}>Box score →</a>
|
|
1888
1931
|
</li>`)}
|
|
1889
1932
|
</ul></div>` : m}
|
|
1890
1933
|
`)}
|
|
1891
1934
|
`;
|
|
1892
1935
|
}
|
|
1893
|
-
teamBlock(t, e, s,
|
|
1894
|
-
if (!
|
|
1895
|
-
const i = t.teamsById[s], n = t.records[s], d = Q(
|
|
1936
|
+
teamBlock(t, e, s, r, o) {
|
|
1937
|
+
if (!r) return l`<div class="teamblock ${o ? "right" : ""}"><div class="tname">TBD</div></div>`;
|
|
1938
|
+
const i = t.teamsById[s], n = t.records[s], d = Q(r, 58);
|
|
1896
1939
|
return l`
|
|
1897
1940
|
<div class="teamblock ${o ? "right" : ""}">
|
|
1898
|
-
${d ? l`<img class="crest logo" alt="" loading="lazy" src=${d} />` : l`<span class="crest" style="background:${
|
|
1941
|
+
${d ? l`<img class="crest logo" alt="" loading="lazy" src=${d} />` : l`<span class="crest" style="background:${r.colorPrimary || "#030711"};color:${K(r.colorPrimary || "#030711")}">${ft(r)}</span>`}
|
|
1899
1942
|
<div>
|
|
1900
|
-
<div class="tname">${
|
|
1901
|
-
<div class="trec">${
|
|
1943
|
+
<div class="tname">${bt(t, s, e.date)}<a href=${g(t.hrefs.school, { id: r.id })}>${r.name}</a></div>
|
|
1944
|
+
<div class="trec">${r.mascot || ""} · ${x(n)}${i?.conferenceId ? l` · ${x(n, !0)} conf` : m}</div>
|
|
1902
1945
|
</div>
|
|
1903
1946
|
</div>
|
|
1904
1947
|
`;
|
|
1905
1948
|
}
|
|
1906
1949
|
renderLineScore(t, e, s) {
|
|
1907
|
-
const
|
|
1908
|
-
if (!
|
|
1950
|
+
const r = t.periodScores || [];
|
|
1951
|
+
if (!r.length)
|
|
1909
1952
|
return l`<p class="empty" style="text-align:center">Period scoring will appear once the game starts.</p>`;
|
|
1910
|
-
const o = Math.max(4, ...
|
|
1911
|
-
const p =
|
|
1953
|
+
const o = Math.max(4, ...r.map((c) => c.period)), i = (c) => c <= 4 ? String(c) : `OT${c > 5 ? c - 4 : ""}`, n = (c, h) => {
|
|
1954
|
+
const p = r.find((f) => f.period === h);
|
|
1912
1955
|
return p ? p[c] : t.state === "final" ? 0 : "·";
|
|
1913
1956
|
}, d = (c, h, p) => l`
|
|
1914
1957
|
<tr>
|
|
@@ -1930,14 +1973,14 @@ class Xt extends w {
|
|
|
1930
1973
|
}
|
|
1931
1974
|
renderContext(t, e, s) {
|
|
1932
1975
|
if (!s) return m;
|
|
1933
|
-
const
|
|
1976
|
+
const r = t.records[e], o = gt(this.data.games, e);
|
|
1934
1977
|
return l`
|
|
1935
1978
|
<div class="card ctxcard">
|
|
1936
1979
|
<div class="who">${H(s)}${s.name}</div>
|
|
1937
1980
|
<div class="row">
|
|
1938
|
-
<span>Last 5: ${
|
|
1939
|
-
<span>Streak: <b>${
|
|
1940
|
-
<span>PF/PA: <b>${
|
|
1981
|
+
<span>Last 5: ${yt(t, e)}</span>
|
|
1982
|
+
<span>Streak: <b>${r ? st(r.results) : "·"}</b></span>
|
|
1983
|
+
<span>PF/PA: <b>${r ? `${r.pf} / ${r.pa}` : "·"}</b></span>
|
|
1941
1984
|
<span>Next: ${o ? l`${y(o.date, { month: "numeric", day: "numeric" })}
|
|
1942
1985
|
${o.homeTeamId === e ? "vs" : "at"} ${Z(t, o.homeTeamId === e ? o.awayTeamId : o.homeTeamId)}` : "·"}</span>
|
|
1943
1986
|
</div>
|
|
@@ -1945,9 +1988,9 @@ class Xt extends w {
|
|
|
1945
1988
|
`;
|
|
1946
1989
|
}
|
|
1947
1990
|
}
|
|
1948
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore",
|
|
1949
|
-
const
|
|
1950
|
-
class
|
|
1991
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-boxscore") && globalThis.customElements.define("hsot-boxscore", te);
|
|
1992
|
+
const Ze = 250, Je = 2;
|
|
1993
|
+
class ee extends E {
|
|
1951
1994
|
static properties = {
|
|
1952
1995
|
api: { type: String },
|
|
1953
1996
|
schoolHref: { type: String, attribute: "school-href" },
|
|
@@ -2027,11 +2070,11 @@ class te extends E {
|
|
|
2027
2070
|
}
|
|
2028
2071
|
onInput(t) {
|
|
2029
2072
|
const e = t.target.value.trim();
|
|
2030
|
-
if (clearTimeout(this.debounceTimer), e.length <
|
|
2073
|
+
if (clearTimeout(this.debounceTimer), e.length < Je) {
|
|
2031
2074
|
this.abortController?.abort(), this.results = [], this.open = !1, this.searched = !1;
|
|
2032
2075
|
return;
|
|
2033
2076
|
}
|
|
2034
|
-
this.debounceTimer = setTimeout(() => this.search(e),
|
|
2077
|
+
this.debounceTimer = setTimeout(() => this.search(e), Ze);
|
|
2035
2078
|
}
|
|
2036
2079
|
async search(t) {
|
|
2037
2080
|
this.abortController?.abort(), this.abortController = new AbortController();
|
|
@@ -2041,8 +2084,8 @@ class te extends E {
|
|
|
2041
2084
|
});
|
|
2042
2085
|
if (!s.ok)
|
|
2043
2086
|
return;
|
|
2044
|
-
const
|
|
2045
|
-
this.results =
|
|
2087
|
+
const r = await s.json();
|
|
2088
|
+
this.results = r.items || [], this.activeIndex = -1, this.searched = !0, this.open = !0;
|
|
2046
2089
|
} catch (e) {
|
|
2047
2090
|
e.name !== "AbortError" && console.warn("school search failed", e);
|
|
2048
2091
|
}
|
|
@@ -2076,7 +2119,7 @@ class te extends E {
|
|
|
2076
2119
|
return [t.location, t.county && `${t.county} County`].filter(Boolean).join(" — ");
|
|
2077
2120
|
}
|
|
2078
2121
|
renderOption(t, e) {
|
|
2079
|
-
const s = this.where(t),
|
|
2122
|
+
const s = this.where(t), r = (o) => {
|
|
2080
2123
|
o.preventDefault(), this.go(t);
|
|
2081
2124
|
};
|
|
2082
2125
|
return l`
|
|
@@ -2084,7 +2127,7 @@ class te extends E {
|
|
|
2084
2127
|
id="school-option-${e}"
|
|
2085
2128
|
role="option"
|
|
2086
2129
|
aria-selected="${e === this.activeIndex ? "true" : "false"}"
|
|
2087
|
-
@pointerdown="${
|
|
2130
|
+
@pointerdown="${r}"
|
|
2088
2131
|
@mousemove="${() => {
|
|
2089
2132
|
this.activeIndex = e;
|
|
2090
2133
|
}}"
|
|
@@ -2098,7 +2141,7 @@ class te extends E {
|
|
|
2098
2141
|
const t = this.searched && !this.results.length, e = l`<li class="empty">No schools found</li>`;
|
|
2099
2142
|
return l`
|
|
2100
2143
|
<ul id="school-search-listbox" role="listbox" aria-label="Schools">
|
|
2101
|
-
${this.results.map((s,
|
|
2144
|
+
${this.results.map((s, r) => this.renderOption(s, r))}
|
|
2102
2145
|
${t ? e : m}
|
|
2103
2146
|
</ul>
|
|
2104
2147
|
`;
|
|
@@ -2124,22 +2167,22 @@ class te extends E {
|
|
|
2124
2167
|
`;
|
|
2125
2168
|
}
|
|
2126
2169
|
}
|
|
2127
|
-
globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search",
|
|
2128
|
-
const
|
|
2129
|
-
"hsot-scores":
|
|
2130
|
-
"hsot-standings":
|
|
2131
|
-
"hsot-rankings":
|
|
2132
|
-
"hsot-school":
|
|
2133
|
-
"hsot-boxscore":
|
|
2134
|
-
"hsot-school-search":
|
|
2170
|
+
globalThis?.customElements && !globalThis.customElements.get("hsot-school-search") && globalThis.customElements.define("hsot-school-search", ee);
|
|
2171
|
+
const Xe = {
|
|
2172
|
+
"hsot-scores": Kt,
|
|
2173
|
+
"hsot-standings": Qt,
|
|
2174
|
+
"hsot-rankings": Zt,
|
|
2175
|
+
"hsot-school": Jt,
|
|
2176
|
+
"hsot-boxscore": te,
|
|
2177
|
+
"hsot-school-search": ee
|
|
2135
2178
|
};
|
|
2136
|
-
function
|
|
2137
|
-
const
|
|
2138
|
-
if (
|
|
2139
|
-
for (const [t, e] of Object.entries(
|
|
2140
|
-
|
|
2179
|
+
function ts() {
|
|
2180
|
+
const a = globalThis?.customElements;
|
|
2181
|
+
if (a)
|
|
2182
|
+
for (const [t, e] of Object.entries(Xe))
|
|
2183
|
+
a.get(t) || a.define(t, e);
|
|
2141
2184
|
}
|
|
2142
|
-
typeof window < "u" && globalThis.customElements &&
|
|
2185
|
+
typeof window < "u" && globalThis.customElements && ts();
|
|
2143
2186
|
export {
|
|
2144
|
-
|
|
2187
|
+
ts as defineAll
|
|
2145
2188
|
};
|