@wral/hsot-data 0.1.14 → 0.2.0

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