@sensiblestats/widget-react 0.114.1 → 0.115.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/index.cjs +144 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +199 -90
- package/dist/index.js.map +1 -1
- package/dist/styles.css +19 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/StatsWidget.tsx
|
|
2
|
-
import { useCallback as useCallback25, useEffect as
|
|
2
|
+
import { useCallback as useCallback25, useEffect as useEffect46, useMemo as useMemo11, useRef as useRef37, useState as useState72 } from "react";
|
|
3
3
|
import { StatsWidgetClient } from "@sensiblestats/widget-sdk";
|
|
4
4
|
|
|
5
5
|
// src/kickoff.ts
|
|
@@ -416,6 +416,15 @@ var STRINGS = {
|
|
|
416
416
|
propsLast5: "Last 5 games",
|
|
417
417
|
propsLadderOnly: "Ladder only",
|
|
418
418
|
propsMarkets: (n) => `${n} markets`,
|
|
419
|
+
propsLast5Live: "Last 5 games + live",
|
|
420
|
+
propsLiveBar: "Live",
|
|
421
|
+
propsMinutes: (t) => `${t} min`,
|
|
422
|
+
propsLineChip: (l) => `line ${l}`,
|
|
423
|
+
propsShooting: (made, att) => `FG ${made}/${att}`,
|
|
424
|
+
propsFouls: (n) => `${n} PF`,
|
|
425
|
+
propsStatsLive: (t) => `Stats ${t} UTC \xB7 live`,
|
|
426
|
+
propsStatsAt: (t) => `Stats ${t} UTC`,
|
|
427
|
+
propsStatsAgo: (t, m) => `Stats ${t} UTC \xB7 ${m} min ago`,
|
|
419
428
|
propsStatShort: (stat) => NBA_STAT_SHORT_EN[stat] ?? stat,
|
|
420
429
|
matchupPace: "Pace",
|
|
421
430
|
matchupOffRating: "Offensive rating",
|
|
@@ -1097,6 +1106,15 @@ var STRINGS = {
|
|
|
1097
1106
|
propsLast5: "Son 5 ma\xE7",
|
|
1098
1107
|
propsLadderOnly: "Sadece alternatif",
|
|
1099
1108
|
propsMarkets: (n) => `${n} market`,
|
|
1109
|
+
propsLast5Live: "Son 5 ma\xE7 + canl\u0131",
|
|
1110
|
+
propsLiveBar: "Canl\u0131",
|
|
1111
|
+
propsMinutes: (t) => `${t} dk`,
|
|
1112
|
+
propsLineChip: (l) => `baraj ${l}`,
|
|
1113
|
+
propsShooting: (made, att) => `\u0130B ${made}/${att}`,
|
|
1114
|
+
propsFouls: (n) => `${n} faul`,
|
|
1115
|
+
propsStatsLive: (t) => `\u0130statistik ${t} UTC \xB7 canl\u0131`,
|
|
1116
|
+
propsStatsAt: (t) => `\u0130statistik ${t} UTC`,
|
|
1117
|
+
propsStatsAgo: (t, m) => `\u0130statistik ${t} UTC \xB7 ${m} dk \xF6nce`,
|
|
1100
1118
|
propsStatShort: (stat) => NBA_STAT_SHORT_TR[stat] ?? stat,
|
|
1101
1119
|
matchupPace: "Tempo",
|
|
1102
1120
|
matchupOffRating: "H\xFCcum reytingi",
|
|
@@ -1441,7 +1459,7 @@ function parseOddsFormat(value) {
|
|
|
1441
1459
|
}
|
|
1442
1460
|
|
|
1443
1461
|
// src/version.generated.ts
|
|
1444
|
-
var WIDGET_REACT_VERSION = "0.
|
|
1462
|
+
var WIDGET_REACT_VERSION = "0.115.0";
|
|
1445
1463
|
|
|
1446
1464
|
// src/config.ts
|
|
1447
1465
|
function normalizeUi(cfg) {
|
|
@@ -4174,6 +4192,7 @@ function useTabs(initial = "chat") {
|
|
|
4174
4192
|
|
|
4175
4193
|
// src/useLiveMonitor.ts
|
|
4176
4194
|
var PROPS_FRESH_MS = 6e4;
|
|
4195
|
+
var PROPS_LIVE_FRESH_MS = 1e4;
|
|
4177
4196
|
var MARKET_FRESH_MS = 45e3;
|
|
4178
4197
|
var MARKET_FETCH_TIMEOUT_MS = 15e3;
|
|
4179
4198
|
var DEFAULT_FOOTBALL_MARKET = "FULLTIME_RESULT";
|
|
@@ -4283,7 +4302,7 @@ function useLiveMonitor(opts) {
|
|
|
4283
4302
|
if (!fn) return;
|
|
4284
4303
|
const key = monitorMatchKey(sport, matchId);
|
|
4285
4304
|
const cur = playerPropsRef.current[key];
|
|
4286
|
-
if (cur?.loading || cur && Date.now() - cur.fetchedAt < PROPS_FRESH_MS) return;
|
|
4305
|
+
if (cur?.loading || cur && Date.now() - cur.fetchedAt < (cur.bundle?.live ? PROPS_LIVE_FRESH_MS : PROPS_FRESH_MS)) return;
|
|
4287
4306
|
const put = (entry) => {
|
|
4288
4307
|
playerPropsRef.current = { ...playerPropsRef.current, [key]: entry };
|
|
4289
4308
|
setPlayerProps((prev) => ({ ...prev, [key]: entry }));
|
|
@@ -7157,7 +7176,7 @@ function ChatFab({ label, greeting, popupText, logoUrl, onOpen, onDismissPopup,
|
|
|
7157
7176
|
}
|
|
7158
7177
|
|
|
7159
7178
|
// src/components/ChatPanel.tsx
|
|
7160
|
-
import { useCallback as useCallback24, useEffect as
|
|
7179
|
+
import { useCallback as useCallback24, useEffect as useEffect45, useLayoutEffect as useLayoutEffect2, useMemo as useMemo10, useRef as useRef36, useState as useState71 } from "react";
|
|
7161
7180
|
|
|
7162
7181
|
// src/components/ChatHeader.tsx
|
|
7163
7182
|
import { useEffect as useEffect24, useRef as useRef20, useState as useState28 } from "react";
|
|
@@ -10151,11 +10170,13 @@ function MonitorSkeleton({ pin, monitor, ui }) {
|
|
|
10151
10170
|
import { SPORTS as SPORTS6 } from "@sensiblestats/widget-sdk";
|
|
10152
10171
|
|
|
10153
10172
|
// src/components/NbaPropsSection.tsx
|
|
10154
|
-
import { useState as useState43 } from "react";
|
|
10173
|
+
import { useEffect as useEffect32, useState as useState43 } from "react";
|
|
10155
10174
|
|
|
10156
10175
|
// src/components/PropsPieces.tsx
|
|
10157
10176
|
import { useEffect as useEffect31, useState as useState42 } from "react";
|
|
10158
10177
|
import { Fragment as Fragment15, jsx as jsx73, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
10178
|
+
var livePlayer = (bundle, p) => bundle.live === true || !p.live ? p : { ...p, live: null };
|
|
10179
|
+
var mmss = (seconds) => `${Math.floor(seconds / 60)}:${String(seconds % 60).padStart(2, "0")}`;
|
|
10159
10180
|
var MAX_TIMER_MS = 2147483647;
|
|
10160
10181
|
var hasMainLine = (s) => s.over != null || s.under != null;
|
|
10161
10182
|
function preKickoff(match) {
|
|
@@ -10224,51 +10245,68 @@ function PriceCell({ hitsText, children }) {
|
|
|
10224
10245
|
/* @__PURE__ */ jsx73("span", { className: "ss-w-props-rung-hits", children: hitsText })
|
|
10225
10246
|
] });
|
|
10226
10247
|
}
|
|
10227
|
-
function PropBars({ bars, line, title, wide, ui }) {
|
|
10248
|
+
function PropBars({ bars, line, title, wide, ui, note }) {
|
|
10228
10249
|
const values = bars.map((b) => b.value);
|
|
10229
10250
|
const top = Math.max(...values, line ?? 0, 1) * 1.1;
|
|
10230
10251
|
const pct = (v) => `${v / top * 100}%`;
|
|
10252
|
+
const hasLive = bars.some((b) => b.live);
|
|
10253
|
+
const columns = { "--ss-bars": bars.length };
|
|
10254
|
+
const barClass = (b, v) => b.live ? "ss-w-props-bar ss-w-props-bar--live" : wide && line != null && v < line ? "ss-w-props-bar ss-w-props-bar--under" : "ss-w-props-bar";
|
|
10231
10255
|
return /* @__PURE__ */ jsxs68("div", { className: "ss-w-props-l5", children: [
|
|
10232
|
-
/* @__PURE__ */
|
|
10233
|
-
|
|
10234
|
-
|
|
10256
|
+
note ? /* @__PURE__ */ jsxs68("div", { className: "ss-w-props-l5-head", children: [
|
|
10257
|
+
/* @__PURE__ */ jsx73("span", { className: "ss-w-props-cap", children: title }),
|
|
10258
|
+
note
|
|
10259
|
+
] }) : /* @__PURE__ */ jsx73("span", { className: "ss-w-props-cap", children: title }),
|
|
10260
|
+
/* @__PURE__ */ jsxs68("div", { className: `${wide ? "ss-w-props-bars ss-w-props-bars--wide" : "ss-w-props-bars"}${hasLive ? " ss-w-props-bars--live" : ""}`, style: hasLive ? columns : void 0, children: [
|
|
10261
|
+
bars.map((b, i) => /* @__PURE__ */ jsx73(
|
|
10235
10262
|
"span",
|
|
10236
10263
|
{
|
|
10237
|
-
className:
|
|
10238
|
-
style: { height: pct(
|
|
10239
|
-
children: /* @__PURE__ */ jsx73("span", { className: "ss-w-props-val", children:
|
|
10264
|
+
className: barClass(b, b.value),
|
|
10265
|
+
style: { height: pct(b.value) },
|
|
10266
|
+
children: /* @__PURE__ */ jsx73("span", { className: "ss-w-props-val", children: b.value })
|
|
10240
10267
|
},
|
|
10241
10268
|
i
|
|
10242
10269
|
)),
|
|
10243
10270
|
line != null && /* @__PURE__ */ jsx73("span", { className: "ss-w-props-ref", style: { bottom: pct(line) }, children: /* @__PURE__ */ jsx73("span", { className: "ss-w-props-ref-lab", children: ui.nba.lineText(String(line)) }) })
|
|
10244
10271
|
] }),
|
|
10245
|
-
/* @__PURE__ */ jsx73("div", { className: wide ? "ss-w-props-opps ss-w-props-opps--wide" : "ss-w-props-opps", children: bars.map((b, i) => /* @__PURE__ */ jsxs68("span", { children: [
|
|
10272
|
+
/* @__PURE__ */ jsx73("div", { className: `${wide ? "ss-w-props-opps ss-w-props-opps--wide" : "ss-w-props-opps"}${hasLive ? " ss-w-props-opps--live" : ""}`, style: hasLive ? columns : void 0, children: bars.map((b, i) => /* @__PURE__ */ jsxs68("span", { children: [
|
|
10246
10273
|
b.away && /* @__PURE__ */ jsx73("i", { className: "ss-w-props-at", children: "@" }),
|
|
10247
|
-
b.label
|
|
10274
|
+
b.live ? /* @__PURE__ */ jsx73("b", { children: b.label }) : b.label
|
|
10248
10275
|
] }, i)) })
|
|
10249
10276
|
] });
|
|
10250
10277
|
}
|
|
10251
|
-
function PropPlayerPanel({ player, bundle, descriptor, ui, slip }) {
|
|
10278
|
+
function PropPlayerPanel({ player: given, bundle, descriptor, ui, slip }) {
|
|
10279
|
+
const player = livePlayer(bundle, given);
|
|
10252
10280
|
const stats = descriptor.stats.map((k) => player.stats.find((s) => s.stat === k)).filter((s) => s != null);
|
|
10253
10281
|
const [picked, setPicked] = useState42(null);
|
|
10254
10282
|
const active = stats.find((s) => s.stat === picked) ?? stats[0];
|
|
10255
10283
|
const sample = active?.games?.length ?? 0;
|
|
10256
10284
|
const hitsOf = (price, text) => descriptor.showHits && sample > 0 && price.hits != null ? text(price.hits) : null;
|
|
10257
10285
|
const bars = active ? descriptor.bars(active, player) : [];
|
|
10258
|
-
const title = typeof descriptor.barsTitle === "function" ? descriptor.barsTitle(bars.length) : descriptor.barsTitle;
|
|
10286
|
+
const title = typeof descriptor.barsTitle === "function" ? descriptor.barsTitle(bars.length, bars.some((b) => b.live)) : descriptor.barsTitle;
|
|
10259
10287
|
const priceProps = { bundle, descriptor, ui, slip };
|
|
10288
|
+
const liveValue = (s) => player.live ? descriptor.live?.(s, player) ?? null : null;
|
|
10289
|
+
const liveChips = stats.some((s) => liveValue(s) !== null);
|
|
10260
10290
|
return /* @__PURE__ */ jsxs68("div", { className: "ss-w-props-panel", children: [
|
|
10261
|
-
/* @__PURE__ */ jsx73("div", { className: "ss-w-props-chips", children: stats.map((s) =>
|
|
10262
|
-
|
|
10263
|
-
|
|
10264
|
-
|
|
10265
|
-
|
|
10266
|
-
|
|
10267
|
-
|
|
10268
|
-
|
|
10269
|
-
|
|
10270
|
-
|
|
10271
|
-
|
|
10291
|
+
/* @__PURE__ */ jsx73("div", { className: liveChips ? "ss-w-props-chips ss-w-props-chips--live" : "ss-w-props-chips", children: stats.map((s) => {
|
|
10292
|
+
const now = liveValue(s);
|
|
10293
|
+
return /* @__PURE__ */ jsxs68(
|
|
10294
|
+
"button",
|
|
10295
|
+
{
|
|
10296
|
+
type: "button",
|
|
10297
|
+
className: "ss-w-props-chip",
|
|
10298
|
+
"aria-pressed": s === active,
|
|
10299
|
+
"aria-label": now !== null ? [`${now} ${descriptor.statLabel(s.stat)}`, s.line != null ? ui.nba.propsLineChip(ui.nba.lineText(String(s.line))) : null].filter(Boolean).join(", ") : void 0,
|
|
10300
|
+
onClick: () => setPicked(s.stat),
|
|
10301
|
+
children: [
|
|
10302
|
+
now !== null && /* @__PURE__ */ jsx73("b", { children: now }),
|
|
10303
|
+
descriptor.statLabel(s.stat),
|
|
10304
|
+
now !== null && s.line != null && /* @__PURE__ */ jsx73("i", { children: ui.nba.propsLineChip(ui.nba.lineText(String(s.line))) })
|
|
10305
|
+
]
|
|
10306
|
+
},
|
|
10307
|
+
s.stat
|
|
10308
|
+
);
|
|
10309
|
+
}) }),
|
|
10272
10310
|
active && hasMainLine(active) && /* @__PURE__ */ jsxs68("div", { className: descriptor.sport === "americanfootball" ? "ss-w-props-ou ss-w-props-ou--nfl" : "ss-w-props-ou", children: [
|
|
10273
10311
|
active.over && /* @__PURE__ */ jsx73(PriceCell, { hitsText: hitsOf(active.over, (h) => fillNfl(ui.nfl.hits, { h, n: sample })), children: /* @__PURE__ */ jsx73(PropPrice, { price: active.over, label: ui.nba.over(ui.nba.lineText(String(active.over.line ?? active.line))), stat: active, ...priceProps }) }),
|
|
10274
10312
|
active.under && /* @__PURE__ */ jsx73(PriceCell, { hitsText: hitsOf(active.under, (h) => fillNfl(ui.nfl.hits, { h, n: sample })), children: /* @__PURE__ */ jsx73(PropPrice, { price: active.under, label: ui.nba.under(ui.nba.lineText(String(active.under.line ?? active.line))), stat: active, ...priceProps }) })
|
|
@@ -10285,15 +10323,17 @@ function PropPlayerPanel({ player, bundle, descriptor, ui, slip }) {
|
|
|
10285
10323
|
}
|
|
10286
10324
|
) }, p.matchOddsId)) })
|
|
10287
10325
|
] }),
|
|
10288
|
-
active && bars.length > 0 && /* @__PURE__ */ jsx73(PropBars, { bars, line: active.line, title, wide: descriptor.tenGameBars, ui })
|
|
10326
|
+
active && bars.length > 0 && /* @__PURE__ */ jsx73(PropBars, { bars, line: active.line, title, wide: descriptor.tenGameBars, ui, note: player.live ? descriptor.liveNote?.(player, ui) : null })
|
|
10289
10327
|
] });
|
|
10290
10328
|
}
|
|
10291
10329
|
function PropRoster({ bundle, players, side, descriptor, ui, slip }) {
|
|
10292
10330
|
const [openId, setOpenId] = useState42(null);
|
|
10293
|
-
return /* @__PURE__ */ jsx73("div", { className: "ss-w-props-list", children: players.map((
|
|
10331
|
+
return /* @__PURE__ */ jsx73("div", { className: "ss-w-props-list", children: players.map((given) => {
|
|
10332
|
+
const p = livePlayer(bundle, given);
|
|
10294
10333
|
const isOpen = openId === p.playerId;
|
|
10295
10334
|
const main = descriptor.mainStat(p);
|
|
10296
|
-
const
|
|
10335
|
+
const now = main && p.live ? descriptor.live?.(main, p) ?? null : null;
|
|
10336
|
+
const meta = [p.position, p.live ? ui.nba.propsMinutes(mmss(p.live.secondsPlayed)) : null, ui.nba.propsMarkets(p.stats.length)].filter(Boolean).join(" \xB7 ");
|
|
10297
10337
|
return /* @__PURE__ */ jsxs68("div", { className: "ss-w-props-item", children: [
|
|
10298
10338
|
/* @__PURE__ */ jsxs68(
|
|
10299
10339
|
"button",
|
|
@@ -10308,14 +10348,17 @@ function PropRoster({ bundle, players, side, descriptor, ui, slip }) {
|
|
|
10308
10348
|
/* @__PURE__ */ jsx73("span", { className: "ss-w-props-name", children: p.name }),
|
|
10309
10349
|
/* @__PURE__ */ jsx73("span", { className: "ss-w-props-meta", children: meta })
|
|
10310
10350
|
] }),
|
|
10311
|
-
/* @__PURE__ */ jsx73("span", { className: "ss-w-props-main", children: main?.line != null ? /* @__PURE__ */ jsxs68(Fragment15, { children: [
|
|
10351
|
+
/* @__PURE__ */ jsx73("span", { className: now !== null ? "ss-w-props-main ss-w-props-main--live" : "ss-w-props-main", children: main?.line != null ? /* @__PURE__ */ jsxs68(Fragment15, { children: [
|
|
10312
10352
|
/* @__PURE__ */ jsx73("span", { className: "ss-w-props-stat", children: descriptor.statShort(main.stat) }),
|
|
10313
|
-
/* @__PURE__ */
|
|
10353
|
+
now !== null ? /* @__PURE__ */ jsxs68("span", { className: "ss-w-props-nowline", children: [
|
|
10354
|
+
/* @__PURE__ */ jsx73("span", { className: "ss-w-props-now", children: now }),
|
|
10355
|
+
/* @__PURE__ */ jsx73("span", { className: "ss-w-props-line", children: `\xB7 ${ui.nba.lineText(String(main.line))}` })
|
|
10356
|
+
] }) : /* @__PURE__ */ jsx73("span", { className: "ss-w-props-line", children: ui.nba.lineText(String(main.line)) })
|
|
10314
10357
|
] }) : /* @__PURE__ */ jsx73("span", { className: "ss-w-props-stat", children: ui.nba.propsLadderOnly }) })
|
|
10315
10358
|
]
|
|
10316
10359
|
}
|
|
10317
10360
|
),
|
|
10318
|
-
isOpen && /* @__PURE__ */ jsx73(PropPlayerPanel, { player:
|
|
10361
|
+
isOpen && /* @__PURE__ */ jsx73(PropPlayerPanel, { player: given, bundle, descriptor, ui, slip })
|
|
10319
10362
|
] }, p.playerId);
|
|
10320
10363
|
}) });
|
|
10321
10364
|
}
|
|
@@ -10329,21 +10372,65 @@ var GAME_VALUE = {
|
|
|
10329
10372
|
assists: (g) => g.ast,
|
|
10330
10373
|
threes: (g) => g.fg3m
|
|
10331
10374
|
};
|
|
10332
|
-
var
|
|
10375
|
+
var LIVE_VALUE = {
|
|
10376
|
+
points: (l) => l.pts,
|
|
10377
|
+
rebounds: (l) => l.reb,
|
|
10378
|
+
assists: (l) => l.ast,
|
|
10379
|
+
threes: (l) => l.fg3m
|
|
10380
|
+
};
|
|
10381
|
+
var BOX_QUIET_MS = 12e4;
|
|
10382
|
+
var foulTrouble = (pf, period) => period != null && pf >= (period <= 2 ? 3 : 4);
|
|
10383
|
+
var nbaDescriptor = (ui, match) => ({
|
|
10333
10384
|
sport: "basketball",
|
|
10334
10385
|
stats: STAT_ORDER,
|
|
10335
10386
|
statLabel: ui.nba.stat,
|
|
10336
10387
|
statShort: ui.nba.propsStatShort,
|
|
10337
10388
|
mainStat: (p) => p.stats.find((s) => s.stat === "points" && hasMainLine(s)) ?? p.stats.find(hasMainLine),
|
|
10338
|
-
bars: (stat, player) =>
|
|
10339
|
-
|
|
10389
|
+
bars: (stat, player) => {
|
|
10390
|
+
const past = [...player.last5].reverse().map((g) => ({ label: g.opponent, value: (GAME_VALUE[stat.stat] ?? (() => 0))(g) }));
|
|
10391
|
+
const now = LIVE_VALUE[stat.stat];
|
|
10392
|
+
return player.live && now ? [...past, { label: ui.nba.propsLiveBar, value: now(player.live), live: true }] : past;
|
|
10393
|
+
},
|
|
10394
|
+
live: (stat, player) => {
|
|
10395
|
+
const now = LIVE_VALUE[stat.stat];
|
|
10396
|
+
return player.live && now ? now(player.live) : null;
|
|
10397
|
+
},
|
|
10398
|
+
liveNote: (player) => {
|
|
10399
|
+
const l = player.live;
|
|
10400
|
+
if (!l) return null;
|
|
10401
|
+
return /* @__PURE__ */ jsxs69("span", { className: "ss-w-props-l5-note", children: [
|
|
10402
|
+
ui.nba.propsShooting(l.fgm, l.fga),
|
|
10403
|
+
" \xB7 ",
|
|
10404
|
+
/* @__PURE__ */ jsx74("span", { className: foulTrouble(l.pf, match.basketball?.period) ? "ss-w-props-pf--warn" : void 0, children: ui.nba.propsFouls(l.pf) })
|
|
10405
|
+
] });
|
|
10406
|
+
},
|
|
10407
|
+
barsTitle: (_n, hasLive) => hasLive ? ui.nba.propsLast5Live : ui.nba.propsLast5,
|
|
10340
10408
|
showHits: false,
|
|
10341
10409
|
rungLabel: (line, ui2) => `${ui2.nba.lineText(String(line))}+`,
|
|
10342
10410
|
tenGameBars: false
|
|
10343
10411
|
});
|
|
10412
|
+
function StatsClock({ bundle, match, ui }) {
|
|
10413
|
+
const [tick, setTick] = useState43(0);
|
|
10414
|
+
const at = bundle.live === true && bundle.boxAsOfUtc ? Date.parse(bundle.boxAsOfUtc) : Number.NaN;
|
|
10415
|
+
const time = clock2(bundle.boxAsOfUtc);
|
|
10416
|
+
const valid = !Number.isNaN(at) && time !== "";
|
|
10417
|
+
const onBreak = atBreak(match);
|
|
10418
|
+
useEffect32(() => {
|
|
10419
|
+
if (!valid || onBreak) return;
|
|
10420
|
+
const age2 = Date.now() - at;
|
|
10421
|
+
const wait = age2 < BOX_QUIET_MS ? BOX_QUIET_MS - age2 : 6e4 - age2 % 6e4;
|
|
10422
|
+
const id = setTimeout(() => setTick((t) => t + 1), wait);
|
|
10423
|
+
return () => clearTimeout(id);
|
|
10424
|
+
}, [valid, onBreak, at, tick]);
|
|
10425
|
+
if (!valid) return null;
|
|
10426
|
+
if (onBreak) return /* @__PURE__ */ jsx74("span", { className: "ss-w-props-asof", children: ui.nba.propsStatsAt(time) });
|
|
10427
|
+
const age = Date.now() - at;
|
|
10428
|
+
if (age >= BOX_QUIET_MS) return /* @__PURE__ */ jsx74("span", { className: "ss-w-props-asof", children: ui.nba.propsStatsAgo(time, Math.floor(age / 6e4)) });
|
|
10429
|
+
return /* @__PURE__ */ jsx74("span", { className: "ss-w-props-asof ss-w-props-asof--live", children: ui.nba.propsStatsLive(time) });
|
|
10430
|
+
}
|
|
10344
10431
|
function NbaPropsSection({ match, monitor, ui, slip }) {
|
|
10345
10432
|
const [side, setSide] = useState43("home");
|
|
10346
|
-
const descriptor = nbaDescriptor(ui);
|
|
10433
|
+
const descriptor = nbaDescriptor(ui, match);
|
|
10347
10434
|
const { bundle, live, open } = usePropsOpen(match, monitor, descriptor);
|
|
10348
10435
|
if (!open || !bundle || bundle.players.length === 0 || (bundle.live ?? false) !== live) return null;
|
|
10349
10436
|
const bySide = (s) => bundle.players.filter((p) => p.side === s);
|
|
@@ -10354,7 +10441,10 @@ function NbaPropsSection({ match, monitor, ui, slip }) {
|
|
|
10354
10441
|
{ side: "away", abbreviation: bundle.awayAbbreviation }
|
|
10355
10442
|
];
|
|
10356
10443
|
return /* @__PURE__ */ jsxs69("section", { className: "ss-w-props", lang: ui.locale, children: [
|
|
10357
|
-
/* @__PURE__ */
|
|
10444
|
+
/* @__PURE__ */ jsxs69("div", { className: "ss-w-props-headrow", children: [
|
|
10445
|
+
/* @__PURE__ */ jsx74("div", { className: "ss-w-props-head", children: ui.nba.propsTitle }),
|
|
10446
|
+
/* @__PURE__ */ jsx74(StatsClock, { bundle, match, ui })
|
|
10447
|
+
] }),
|
|
10358
10448
|
/* @__PURE__ */ jsx74("div", { className: "ss-w-props-seg", children: sides.map((s) => /* @__PURE__ */ jsx74("button", { type: "button", className: "ss-w-props-side", "aria-pressed": shown2 === s.side, onClick: () => setSide(s.side), children: `${s.abbreviation} \xB7 ${bySide(s.side).length}` }, s.side)) }),
|
|
10359
10449
|
/* @__PURE__ */ jsx74(PropRoster, { bundle, players: bySide(shown2), side: shown2, descriptor, ui, slip }, shown2)
|
|
10360
10450
|
] });
|
|
@@ -10804,7 +10894,7 @@ function NflMonitorCard({ match, monitor, ui, slip }) {
|
|
|
10804
10894
|
}
|
|
10805
10895
|
|
|
10806
10896
|
// src/components/ScoreboardStrip.tsx
|
|
10807
|
-
import { useEffect as
|
|
10897
|
+
import { useEffect as useEffect33, useRef as useRef26 } from "react";
|
|
10808
10898
|
import { SPORTS as SPORTS7, sportOf as sportOf11 } from "@sensiblestats/widget-sdk";
|
|
10809
10899
|
import { jsx as jsx79, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
10810
10900
|
function nbaStatus(m, ui) {
|
|
@@ -10880,7 +10970,7 @@ function rowsFor(m) {
|
|
|
10880
10970
|
}
|
|
10881
10971
|
function ScoreboardStrip({ tiles, selectedKey, onSelect, ui }) {
|
|
10882
10972
|
const stripRef = useRef26(null);
|
|
10883
|
-
|
|
10973
|
+
useEffect33(() => {
|
|
10884
10974
|
const strip = stripRef.current;
|
|
10885
10975
|
const pressed = strip?.querySelector('[aria-pressed="true"]');
|
|
10886
10976
|
if (!strip || !pressed) return;
|
|
@@ -11058,7 +11148,7 @@ function TrendsPanel({ monitor, ui, slip }) {
|
|
|
11058
11148
|
}
|
|
11059
11149
|
|
|
11060
11150
|
// src/components/TodayPanel.tsx
|
|
11061
|
-
import { useEffect as
|
|
11151
|
+
import { useEffect as useEffect35, useId as useId2, useMemo as useMemo9, useState as useState48 } from "react";
|
|
11062
11152
|
import { matchKey as matchKey7 } from "@sensiblestats/widget-sdk";
|
|
11063
11153
|
|
|
11064
11154
|
// src/placement.ts
|
|
@@ -11186,7 +11276,7 @@ function LeagueTile({ group, starClickable: starClickable2, disambiguate, onOpen
|
|
|
11186
11276
|
}
|
|
11187
11277
|
|
|
11188
11278
|
// src/components/LeagueDetail.tsx
|
|
11189
|
-
import { useEffect as
|
|
11279
|
+
import { useEffect as useEffect34, useState as useState47 } from "react";
|
|
11190
11280
|
import { matchKey as matchKey5 } from "@sensiblestats/widget-sdk";
|
|
11191
11281
|
|
|
11192
11282
|
// src/components/FixtureRow.tsx
|
|
@@ -11250,10 +11340,10 @@ import { jsx as jsx83, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
|
11250
11340
|
var STAR_PATH2 = "M12 2.5l2.9 5.9 6.5.95-4.7 4.58 1.1 6.47L12 17.35 6.1 20.4l1.1-6.47L2.5 9.35l6.5-.95z";
|
|
11251
11341
|
function LeagueDetail({ group, position, states, stale, ui, monitor, starTap, onBack, onPrev, onNext }) {
|
|
11252
11342
|
const [toast, setToast] = useState47(null);
|
|
11253
|
-
|
|
11343
|
+
useEffect34(() => {
|
|
11254
11344
|
setToast(null);
|
|
11255
11345
|
}, [group.competitionId]);
|
|
11256
|
-
|
|
11346
|
+
useEffect34(() => {
|
|
11257
11347
|
if (toast === null) return;
|
|
11258
11348
|
const id = setTimeout(() => setToast(null), 4e3);
|
|
11259
11349
|
return () => clearTimeout(id);
|
|
@@ -11494,7 +11584,7 @@ function TodayPanel({ discovery, ui, monitor }) {
|
|
|
11494
11584
|
const [query, setQuery] = useState48("");
|
|
11495
11585
|
const [selectedCompetitionId, setSelectedCompetitionId] = useState48(null);
|
|
11496
11586
|
const [toast, setToast] = useState48(null);
|
|
11497
|
-
|
|
11587
|
+
useEffect35(() => {
|
|
11498
11588
|
if (toast === null) return;
|
|
11499
11589
|
const id = setTimeout(() => setToast(null), 4e3);
|
|
11500
11590
|
return () => clearTimeout(id);
|
|
@@ -11540,7 +11630,7 @@ function TodayPanel({ discovery, ui, monitor }) {
|
|
|
11540
11630
|
}
|
|
11541
11631
|
const openIndex = selectedCompetitionId === null ? -1 : placement.order.findIndex((g) => g.competitionId === selectedCompetitionId);
|
|
11542
11632
|
const openGroup = openIndex === -1 ? void 0 : placement.order[openIndex];
|
|
11543
|
-
|
|
11633
|
+
useEffect35(() => {
|
|
11544
11634
|
if (selectedCompetitionId !== null && openGroup === void 0) setSelectedCompetitionId(null);
|
|
11545
11635
|
}, [selectedCompetitionId, openGroup]);
|
|
11546
11636
|
const liveRows = stale ? [] : visibleGroups.flatMap((group) => group.matches.filter((m) => isTreatedLive(states.get(matchKey7(m.sport, m.matchId)), stale)).map((match) => ({ match, rank: group.rank }))).sort((a, b) => a.rank - b.rank);
|
|
@@ -11696,7 +11786,7 @@ function TodayPanel({ discovery, ui, monitor }) {
|
|
|
11696
11786
|
}
|
|
11697
11787
|
|
|
11698
11788
|
// src/components/GamesPanel.tsx
|
|
11699
|
-
import { useEffect as
|
|
11789
|
+
import { useEffect as useEffect39, useState as useState63 } from "react";
|
|
11700
11790
|
|
|
11701
11791
|
// src/components/GamesLoginWall.tsx
|
|
11702
11792
|
import { jsx as jsx88 } from "react/jsx-runtime";
|
|
@@ -11705,7 +11795,7 @@ function GamesLoginWall({ ui }) {
|
|
|
11705
11795
|
}
|
|
11706
11796
|
|
|
11707
11797
|
// src/components/GamesHub.tsx
|
|
11708
|
-
import { useEffect as
|
|
11798
|
+
import { useEffect as useEffect36, useState as useState49 } from "react";
|
|
11709
11799
|
|
|
11710
11800
|
// src/components/games/ui/gameMeta.ts
|
|
11711
11801
|
function prettifyGameId(gameId) {
|
|
@@ -11857,7 +11947,7 @@ function pickHeroGame(games) {
|
|
|
11857
11947
|
var tileKey = (g) => `${g.gameId}-${g.gameDay}-${g.fixtureId}`;
|
|
11858
11948
|
function GamesHub({ games, myWeeklyRow, weeklyPrize, onOpen, ui }) {
|
|
11859
11949
|
const [, setTick] = useState49(0);
|
|
11860
|
-
|
|
11950
|
+
useEffect36(() => {
|
|
11861
11951
|
const id = setInterval(() => setTick((t) => t + 1), 6e4);
|
|
11862
11952
|
return () => clearInterval(id);
|
|
11863
11953
|
}, []);
|
|
@@ -11917,7 +12007,7 @@ function GamesHub({ games, myWeeklyRow, weeklyPrize, onOpen, ui }) {
|
|
|
11917
12007
|
}
|
|
11918
12008
|
|
|
11919
12009
|
// src/components/GameScreenHost.tsx
|
|
11920
|
-
import { useEffect as
|
|
12010
|
+
import { useEffect as useEffect38, useRef as useRef31, useState as useState61 } from "react";
|
|
11921
12011
|
|
|
11922
12012
|
// src/useGamePlay.ts
|
|
11923
12013
|
import { useCallback as useCallback23, useRef as useRef29, useState as useState50 } from "react";
|
|
@@ -12869,7 +12959,7 @@ function CareerPathGame({
|
|
|
12869
12959
|
}
|
|
12870
12960
|
|
|
12871
12961
|
// src/components/games/BeatTheGridGame.tsx
|
|
12872
|
-
import React, { useEffect as
|
|
12962
|
+
import React, { useEffect as useEffect37, useId as useId5, useRef as useRef30, useState as useState55 } from "react";
|
|
12873
12963
|
|
|
12874
12964
|
// src/components/games/ui/OptionList.tsx
|
|
12875
12965
|
import { jsx as jsx106 } from "react/jsx-runtime";
|
|
@@ -12961,7 +13051,7 @@ function SearchSheet({
|
|
|
12961
13051
|
const [query, setQuery] = useState55("");
|
|
12962
13052
|
const inputId = useId5();
|
|
12963
13053
|
const inputRef = useRef30(null);
|
|
12964
|
-
|
|
13054
|
+
useEffect37(() => {
|
|
12965
13055
|
inputRef.current?.focus();
|
|
12966
13056
|
}, [row, col]);
|
|
12967
13057
|
const filtered = playerPool.filter(
|
|
@@ -14265,7 +14355,7 @@ function GameScreenHost({
|
|
|
14265
14355
|
}) {
|
|
14266
14356
|
const { gameId, fixtureId, gameDay = "", lockAtUtc = null } = selected;
|
|
14267
14357
|
const [configJson, setConfigJson] = useState61(null);
|
|
14268
|
-
|
|
14358
|
+
useEffect38(() => {
|
|
14269
14359
|
setConfigJson(null);
|
|
14270
14360
|
if (!conversation) return;
|
|
14271
14361
|
let cancelled = false;
|
|
@@ -14288,12 +14378,12 @@ function GameScreenHost({
|
|
|
14288
14378
|
fixtureId: fixtureId || void 0,
|
|
14289
14379
|
locale: ui.games.lang
|
|
14290
14380
|
});
|
|
14291
|
-
|
|
14381
|
+
useEffect38(() => {
|
|
14292
14382
|
if (conversation) hydrate();
|
|
14293
14383
|
}, [conversation, gameId]);
|
|
14294
14384
|
const hydrateRef = useRef31(hydrate);
|
|
14295
14385
|
hydrateRef.current = hydrate;
|
|
14296
|
-
|
|
14386
|
+
useEffect38(() => {
|
|
14297
14387
|
if (!FIXTURE_GAME_IDS.has(gameId)) return;
|
|
14298
14388
|
if (rawStatus !== "pending") return;
|
|
14299
14389
|
const timerId = setInterval(() => {
|
|
@@ -14596,7 +14686,7 @@ function GamesPanel({
|
|
|
14596
14686
|
}) {
|
|
14597
14687
|
const [selected, setSelected] = useState63(null);
|
|
14598
14688
|
const [segment, setSegment] = useState63("play");
|
|
14599
|
-
|
|
14689
|
+
useEffect39(() => {
|
|
14600
14690
|
ensureGamesFonts();
|
|
14601
14691
|
}, []);
|
|
14602
14692
|
if (!loggedIn) return /* @__PURE__ */ jsx120(GamesLoginWall, { ui });
|
|
@@ -14660,10 +14750,10 @@ function GamesPanel({
|
|
|
14660
14750
|
}
|
|
14661
14751
|
|
|
14662
14752
|
// src/components/FavouritesPanel.tsx
|
|
14663
|
-
import { useEffect as
|
|
14753
|
+
import { useEffect as useEffect42, useRef as useRef33, useState as useState66 } from "react";
|
|
14664
14754
|
|
|
14665
14755
|
// src/components/FavouriteChips.tsx
|
|
14666
|
-
import { useEffect as
|
|
14756
|
+
import { useEffect as useEffect40, useState as useState64 } from "react";
|
|
14667
14757
|
import { Fragment as Fragment35, jsx as jsx121, jsxs as jsxs107 } from "react/jsx-runtime";
|
|
14668
14758
|
async function toggleWithNotice(controller, kind, id, onNotice) {
|
|
14669
14759
|
const outcome = await controller.toggle(kind, id);
|
|
@@ -14711,10 +14801,10 @@ function Group({ title, entities, sport, ui, controller, onNotice }) {
|
|
|
14711
14801
|
function FavouriteChips({ controller, ui, sport, sportLabel, onNotice }) {
|
|
14712
14802
|
const [confirming, setConfirming] = useState64(false);
|
|
14713
14803
|
const data = controller.data;
|
|
14714
|
-
|
|
14804
|
+
useEffect40(() => {
|
|
14715
14805
|
setConfirming(false);
|
|
14716
14806
|
}, [sport]);
|
|
14717
|
-
|
|
14807
|
+
useEffect40(() => {
|
|
14718
14808
|
if (!confirming) return;
|
|
14719
14809
|
const onPointerDown = (e) => {
|
|
14720
14810
|
if (!(e.target instanceof Element) || !e.target.closest("[data-fav-confirm]")) setConfirming(false);
|
|
@@ -14768,7 +14858,7 @@ function FavouriteChips({ controller, ui, sport, sportLabel, onNotice }) {
|
|
|
14768
14858
|
}
|
|
14769
14859
|
|
|
14770
14860
|
// src/components/FavouritesSearch.tsx
|
|
14771
|
-
import { useEffect as
|
|
14861
|
+
import { useEffect as useEffect41, useRef as useRef32, useState as useState65 } from "react";
|
|
14772
14862
|
import { jsx as jsx122, jsxs as jsxs108 } from "react/jsx-runtime";
|
|
14773
14863
|
var MIN_LETTERS = 2;
|
|
14774
14864
|
var MAX_LENGTH = 64;
|
|
@@ -14782,7 +14872,7 @@ function FavouritesSearch({ controller, ui, sport, onNotice }) {
|
|
|
14782
14872
|
const queryKey = `${sport}|${trimmed}`;
|
|
14783
14873
|
const results2 = answer?.key === queryKey ? answer.rows : [];
|
|
14784
14874
|
const settled = answer?.key === queryKey;
|
|
14785
|
-
|
|
14875
|
+
useEffect41(() => {
|
|
14786
14876
|
setAnswer(null);
|
|
14787
14877
|
if (trimmed.length < MIN_LETTERS) return;
|
|
14788
14878
|
let cancelled = false;
|
|
@@ -14850,10 +14940,10 @@ function FavouritesPanel({ controller, ui, sport, sports, onSportChange }) {
|
|
|
14850
14940
|
const [notice, setNotice] = useState66(null);
|
|
14851
14941
|
const refreshRef = useRef33(controller.refresh);
|
|
14852
14942
|
refreshRef.current = controller.refresh;
|
|
14853
|
-
|
|
14943
|
+
useEffect42(() => {
|
|
14854
14944
|
void refreshRef.current();
|
|
14855
14945
|
}, []);
|
|
14856
|
-
|
|
14946
|
+
useEffect42(() => {
|
|
14857
14947
|
setNotice(null);
|
|
14858
14948
|
}, [sport]);
|
|
14859
14949
|
const sportLabel = sports.find((s) => s.sport === sport)?.label ?? capitalised(sport);
|
|
@@ -14880,7 +14970,7 @@ function FavouritesPanel({ controller, ui, sport, sports, onSportChange }) {
|
|
|
14880
14970
|
}
|
|
14881
14971
|
|
|
14882
14972
|
// src/components/dashboard/v8/SentenceBuilder.tsx
|
|
14883
|
-
import { useEffect as
|
|
14973
|
+
import { useEffect as useEffect43, useRef as useRef34, useState as useState67 } from "react";
|
|
14884
14974
|
import { Fragment as Fragment36, jsx as jsx124, jsxs as jsxs110 } from "react/jsx-runtime";
|
|
14885
14975
|
var TOTALS = ["any", "3", "5", "10", "20", "50"];
|
|
14886
14976
|
var BASE_LEGS = [1, 2, 3, 4];
|
|
@@ -14937,7 +15027,7 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
14937
15027
|
const [first] = useState67(() => requestFor(view));
|
|
14938
15028
|
const { grid, status, confirmed, request } = useBuilderGrid({ conversation, locale: ui.presets.lang, memory: memory3, initial: first });
|
|
14939
15029
|
const lastRequest = useRef34(first);
|
|
14940
|
-
|
|
15030
|
+
useEffect43(() => {
|
|
14941
15031
|
void request(lastRequest.current);
|
|
14942
15032
|
}, [request]);
|
|
14943
15033
|
const send = (req) => {
|
|
@@ -14972,12 +15062,12 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
14972
15062
|
useNextKickoffRender(rows ? rows.map((l) => l.kickoffUtc) : []);
|
|
14973
15063
|
const [startedNote, setStartedNote] = useState67(false);
|
|
14974
15064
|
const anyStarted = rows !== null && rows.some((l) => !preMatchOpen(l.kickoffUtc, Date.now()));
|
|
14975
|
-
|
|
15065
|
+
useEffect43(() => {
|
|
14976
15066
|
if (startedNote && status === "ready" && !anyStarted) setStartedNote(false);
|
|
14977
15067
|
}, [startedNote, status, anyStarted]);
|
|
14978
15068
|
const market = rows?.[0]?.market;
|
|
14979
15069
|
const [seen, setSeen] = useState67(null);
|
|
14980
|
-
|
|
15070
|
+
useEffect43(() => {
|
|
14981
15071
|
if (market) setSeen(market);
|
|
14982
15072
|
}, [market]);
|
|
14983
15073
|
const marketName = view.marketKey === null ? null : marketOptions?.find((m) => m.key === view.marketKey)?.label ?? market ?? seen;
|
|
@@ -14990,14 +15080,14 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
14990
15080
|
const quotedAt = rows ? oldestQuote(rows) : null;
|
|
14991
15081
|
const combo = ready && grid.total !== null ? { sport, totalChosen: view.total, totalActual: grid.total } : void 0;
|
|
14992
15082
|
const canWiden = gamesOptions === null || allGames !== null;
|
|
14993
|
-
|
|
15083
|
+
useEffect43(() => {
|
|
14994
15084
|
if (!empty2 || !singles || widened || !canWiden || autoWidened.current) return;
|
|
14995
15085
|
autoWidened.current = true;
|
|
14996
15086
|
const next = { ...view, widen: true, matchIds: [], gamesId: allGames ? allGames.id : view.gamesId };
|
|
14997
15087
|
commit(next, true);
|
|
14998
15088
|
send(requestFor(next));
|
|
14999
15089
|
}, [empty2, singles, widened, canWiden, view]);
|
|
15000
|
-
|
|
15090
|
+
useEffect43(() => {
|
|
15001
15091
|
if (coolOff) onCoolOff?.();
|
|
15002
15092
|
}, [coolOff, onCoolOff]);
|
|
15003
15093
|
if (coolOff) return null;
|
|
@@ -15657,16 +15747,16 @@ function PlayerDetail({ detail, loading, ui, seasonName, onClose }) {
|
|
|
15657
15747
|
}
|
|
15658
15748
|
|
|
15659
15749
|
// src/components/PresetTools.tsx
|
|
15660
|
-
import { useEffect as
|
|
15750
|
+
import { useEffect as useEffect44, useId as useId10, useRef as useRef35, useState as useState70 } from "react";
|
|
15661
15751
|
import { Fragment as Fragment39, jsx as jsx134, jsxs as jsxs118 } from "react/jsx-runtime";
|
|
15662
15752
|
var FOCUSABLE = 'button:not([disabled]), [href], input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
15663
15753
|
function PresetToolModal({ title, closeLabel, onClose, children, footer, className }) {
|
|
15664
15754
|
const dialogRef = useRef35(null);
|
|
15665
15755
|
const titleId = useId10();
|
|
15666
|
-
|
|
15756
|
+
useEffect44(() => {
|
|
15667
15757
|
dialogRef.current?.focus({ preventScroll: true });
|
|
15668
15758
|
}, []);
|
|
15669
|
-
|
|
15759
|
+
useEffect44(() => {
|
|
15670
15760
|
const onKey = (e) => {
|
|
15671
15761
|
if (e.key !== "Escape") return;
|
|
15672
15762
|
e.stopPropagation();
|
|
@@ -15818,7 +15908,7 @@ import { Fragment as Fragment40, jsx as jsx136, jsxs as jsxs120 } from "react/js
|
|
|
15818
15908
|
var FULLSCREEN_QUERY = "(max-width: 639px)";
|
|
15819
15909
|
function useIsModal() {
|
|
15820
15910
|
const [modal, setModal] = useState71(false);
|
|
15821
|
-
|
|
15911
|
+
useEffect45(() => {
|
|
15822
15912
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
|
|
15823
15913
|
const mql = window.matchMedia(FULLSCREEN_QUERY);
|
|
15824
15914
|
const sync = () => setModal(mql.matches);
|
|
@@ -15860,16 +15950,16 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
15860
15950
|
const hasBuilder = !clubBrand && (builderOptions?.length ?? 0) > 0;
|
|
15861
15951
|
const tabs = monitor ?? (hasBuilder ? tabState : void 0);
|
|
15862
15952
|
const activeTab = tabs?.activeTab;
|
|
15863
|
-
|
|
15953
|
+
useEffect45(() => {
|
|
15864
15954
|
if (activeTab === "squad" || selectedPlayerId === null) return;
|
|
15865
15955
|
setSelectedPlayerId(null);
|
|
15866
15956
|
clearPlayerDetail?.();
|
|
15867
15957
|
}, [activeTab, selectedPlayerId, clearPlayerDetail]);
|
|
15868
|
-
|
|
15958
|
+
useEffect45(() => {
|
|
15869
15959
|
if (activeTab === "favourites" && !favouritesEnabled) setMonitorTab?.("chat");
|
|
15870
15960
|
}, [activeTab, favouritesEnabled, setMonitorTab]);
|
|
15871
15961
|
const storedTab = tabState?.activeTab;
|
|
15872
|
-
|
|
15962
|
+
useEffect45(() => {
|
|
15873
15963
|
const unreachable = storedTab === "builder" ? !hasBuilder : !monitor && storedTab !== void 0 && storedTab !== "chat";
|
|
15874
15964
|
if (unreachable) setMonitorTab?.("chat");
|
|
15875
15965
|
}, [storedTab, hasBuilder, monitor, setMonitorTab]);
|
|
@@ -15882,7 +15972,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
15882
15972
|
track({ name: "widget_close", method, tab: closeTab, answering });
|
|
15883
15973
|
close();
|
|
15884
15974
|
}, [track, closeTab, answering, close]);
|
|
15885
|
-
|
|
15975
|
+
useEffect45(() => {
|
|
15886
15976
|
const onKey = (e) => {
|
|
15887
15977
|
if (e.key === "Escape") closeWith("escape");
|
|
15888
15978
|
};
|
|
@@ -15898,7 +15988,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
15898
15988
|
tabs?.setActiveTab("chat");
|
|
15899
15989
|
send(text, { grounding, source: "live_fact" });
|
|
15900
15990
|
};
|
|
15901
|
-
|
|
15991
|
+
useEffect45(() => {
|
|
15902
15992
|
if (monitor && monitor.activeTab !== "chat" && state.isStreaming) monitor.markChatActivity();
|
|
15903
15993
|
}, [monitor, state.isStreaming, state.messages.length]);
|
|
15904
15994
|
const onChatTab = !tabs || tabs.activeTab === "chat";
|
|
@@ -15920,10 +16010,10 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
15920
16010
|
panelRef.current?.querySelector(".ss-w-kebab")?.focus();
|
|
15921
16011
|
}, []);
|
|
15922
16012
|
const paused = isPaused(state.limit);
|
|
15923
|
-
|
|
16013
|
+
useEffect45(() => {
|
|
15924
16014
|
if (paused) setTool(null);
|
|
15925
16015
|
}, [paused]);
|
|
15926
|
-
|
|
16016
|
+
useEffect45(() => {
|
|
15927
16017
|
if (!paused) return;
|
|
15928
16018
|
if (typedSendRef.current) limitRef.current?.focus();
|
|
15929
16019
|
typedSendRef.current = false;
|
|
@@ -15949,13 +16039,13 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
15949
16039
|
const k = ui.bettingKickoff(kickoffUtc);
|
|
15950
16040
|
return `${k.dayLabel} ${k.time}`;
|
|
15951
16041
|
}, [ui]);
|
|
15952
|
-
|
|
16042
|
+
useEffect45(() => {
|
|
15953
16043
|
if (tool) return;
|
|
15954
16044
|
const target = focusAfterCloseRef.current;
|
|
15955
16045
|
focusAfterCloseRef.current = null;
|
|
15956
16046
|
if (target === "composer") inputRef.current?.focus();
|
|
15957
16047
|
}, [tool]);
|
|
15958
|
-
|
|
16048
|
+
useEffect45(() => {
|
|
15959
16049
|
if (!tool || onChatTab && presetGrid) return;
|
|
15960
16050
|
focusAfterCloseRef.current = "composer";
|
|
15961
16051
|
setTool(null);
|
|
@@ -17918,6 +18008,25 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
17918
18008
|
.ss-w-props-ref { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--ss-w-ink); }
|
|
17919
18009
|
.ss-w-props-ref-lab { position: absolute; right: 0; top: -7px; width: 28px; text-align: right; line-height: 13px; border-radius: 3px; background: var(--ss-w-bubble); font-size: 9.5px; font-weight: 600; color: var(--ss-w-faint); font-variant-numeric: tabular-nums; }
|
|
17920
18010
|
.ss-w-props-opps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding-right: 32px; text-align: center; font-size: 10px; color: var(--ss-w-faint); }
|
|
18011
|
+
/* Live stats on NBA props (u620): box clock, stat chips with a value, a hatched live bar. */
|
|
18012
|
+
.ss-w-props-headrow { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
|
|
18013
|
+
.ss-w-props-asof { font-size: 10.5px; font-weight: 600; color: var(--ss-w-faint); font-variant-numeric: tabular-nums; text-align: right; }
|
|
18014
|
+
.ss-w-props-asof--live, .ss-w-props-pf--warn { color: var(--ss-w-warn); }
|
|
18015
|
+
.ss-w-props-main--live { flex-direction: column; align-items: flex-end; flex-wrap: nowrap; gap: 2px; max-width: none; }
|
|
18016
|
+
.ss-w-props-nowline { display: flex; align-items: baseline; gap: 4px; }
|
|
18017
|
+
.ss-w-props-now { font-size: 12.5px; font-weight: 800; color: var(--ss-w-ink); }
|
|
18018
|
+
.ss-w-props-main--live .ss-w-props-line { font-weight: 600; color: var(--ss-w-faint); }
|
|
18019
|
+
.ss-w-props-chips--live { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
|
|
18020
|
+
.ss-w-props-chips--live .ss-w-props-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 44px; padding: 6px 4px; border-radius: 10px; font-size: 11px; white-space: normal; text-align: center; }
|
|
18021
|
+
.ss-w-props-chips--live .ss-w-props-chip b { font-size: 15px; font-weight: 800; color: var(--ss-w-ink); font-variant-numeric: tabular-nums; }
|
|
18022
|
+
.ss-w-props-chips--live .ss-w-props-chip i { font-style: normal; font-size: 10px; font-weight: 500; color: var(--ss-w-faint); font-variant-numeric: tabular-nums; }
|
|
18023
|
+
.ss-w-props-chips--live .ss-w-props-chip[aria-pressed="true"] b, .ss-w-props-chips--live .ss-w-props-chip[aria-pressed="true"] i { color: #fff; }
|
|
18024
|
+
.ss-w-props-l5-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; column-gap: 8px; row-gap: 2px; min-width: 0; }
|
|
18025
|
+
.ss-w-props-l5-note { font-size: 11px; color: var(--ss-w-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
18026
|
+
.ss-w-props-bars--live { grid-template-columns: repeat(var(--ss-bars, 6), minmax(0, 1fr)); gap: 5px; }
|
|
18027
|
+
.ss-w-props-opps--live { grid-template-columns: repeat(var(--ss-bars, 6), minmax(0, 1fr)); gap: 5px; }
|
|
18028
|
+
.ss-w-props-opps b { font-weight: 700; color: var(--ss-w-ink); }
|
|
18029
|
+
.ss-w-props-bar--live { background: repeating-linear-gradient(135deg, var(--ss-w-ink) 0 3px, var(--ss-w-faint) 3px 6px); }
|
|
17921
18030
|
/* NFL props (u605): three tabs, ten-game bars coloured by the line, and the fact and scorer grids. */
|
|
17922
18031
|
.ss-w-props-trends { margin-bottom: 8px; }
|
|
17923
18032
|
.ss-w-props-seg--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
@@ -18665,11 +18774,11 @@ function StatsWidget(props) {
|
|
|
18665
18774
|
pinnedMatchIds
|
|
18666
18775
|
});
|
|
18667
18776
|
const todayHasContent = visibleGroupsOf(discovery.groups, discovery.states).length > 0;
|
|
18668
|
-
|
|
18777
|
+
useEffect46(() => {
|
|
18669
18778
|
setHasToday(todayHasContent);
|
|
18670
18779
|
}, [todayHasContent]);
|
|
18671
18780
|
const prevLiveSnapshotRef = useRef37(monitor.snapshot);
|
|
18672
|
-
|
|
18781
|
+
useEffect46(() => {
|
|
18673
18782
|
const snap = monitor.snapshot;
|
|
18674
18783
|
if (!snap || snap === prevLiveSnapshotRef.current) return;
|
|
18675
18784
|
prevLiveSnapshotRef.current = snap;
|
|
@@ -18760,7 +18869,7 @@ function StatsWidget(props) {
|
|
|
18760
18869
|
const presetGrid = usePresetGrid({ getPricePresets, isOpen: controller.state.isOpen, locale: ui.presets.lang });
|
|
18761
18870
|
const markTodayActivity = monitor.markTodayActivity;
|
|
18762
18871
|
const prevLiveCountRef = useRef37(0);
|
|
18763
|
-
|
|
18872
|
+
useEffect46(() => {
|
|
18764
18873
|
const rose = prevLiveCountRef.current === 0 && discovery.liveCount > 0;
|
|
18765
18874
|
prevLiveCountRef.current = discovery.liveCount;
|
|
18766
18875
|
if (rose) markTodayActivity();
|
|
@@ -18813,7 +18922,7 @@ function StatsWidget(props) {
|
|
|
18813
18922
|
const onControlRef = useRef37(props.onControl);
|
|
18814
18923
|
onControlRef.current = props.onControl;
|
|
18815
18924
|
const { open: openPanel, close: closePanel } = controller;
|
|
18816
|
-
|
|
18925
|
+
useEffect46(() => {
|
|
18817
18926
|
onControlRef.current?.({ open: openPanel, close: closePanel });
|
|
18818
18927
|
return () => onControlRef.current?.(null);
|
|
18819
18928
|
}, [openPanel, closePanel]);
|
|
@@ -18830,11 +18939,11 @@ function StatsWidget(props) {
|
|
|
18830
18939
|
page: cfg?.page
|
|
18831
18940
|
}
|
|
18832
18941
|
};
|
|
18833
|
-
|
|
18942
|
+
useEffect46(() => {
|
|
18834
18943
|
if (!logger) return;
|
|
18835
18944
|
logger.setIdentity({ operatorUserId, anonymousUserId, conversationId });
|
|
18836
18945
|
}, [logger, operatorUserId, anonymousUserId, conversationId]);
|
|
18837
|
-
|
|
18946
|
+
useEffect46(() => {
|
|
18838
18947
|
if (!logger) return;
|
|
18839
18948
|
logger.resume();
|
|
18840
18949
|
const onHide = () => {
|
|
@@ -18852,7 +18961,7 @@ function StatsWidget(props) {
|
|
|
18852
18961
|
logger.dispose();
|
|
18853
18962
|
};
|
|
18854
18963
|
}, [logger]);
|
|
18855
|
-
|
|
18964
|
+
useEffect46(() => {
|
|
18856
18965
|
if (!built || !ui.injectStyles) return;
|
|
18857
18966
|
const node = rootRef.current?.getRootNode();
|
|
18858
18967
|
if (node) injectStyles(node);
|