@sensiblestats/widget-react 0.104.0 → 0.105.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 +230 -216
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +110 -96
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/StatsWidget.tsx
|
|
2
|
-
import { useCallback as useCallback24, useEffect as useEffect37, useMemo as useMemo7, useRef as useRef33, useState as
|
|
2
|
+
import { useCallback as useCallback24, useEffect as useEffect37, useMemo as useMemo7, useRef as useRef33, useState as useState61 } from "react";
|
|
3
3
|
import { StatsWidgetClient } from "@sensiblestats/widget-sdk";
|
|
4
4
|
|
|
5
5
|
// src/kickoff.ts
|
|
@@ -1170,7 +1170,7 @@ function isEnglishLocale(locale) {
|
|
|
1170
1170
|
}
|
|
1171
1171
|
|
|
1172
1172
|
// src/version.generated.ts
|
|
1173
|
-
var WIDGET_REACT_VERSION = "0.
|
|
1173
|
+
var WIDGET_REACT_VERSION = "0.105.0";
|
|
1174
1174
|
|
|
1175
1175
|
// src/config.ts
|
|
1176
1176
|
function normalizeUi(cfg) {
|
|
@@ -4666,7 +4666,7 @@ function ChatFab({ label, greeting, popupText, logoUrl, onOpen, onDismissPopup,
|
|
|
4666
4666
|
}
|
|
4667
4667
|
|
|
4668
4668
|
// src/components/ChatPanel.tsx
|
|
4669
|
-
import { useCallback as useCallback23, useEffect as useEffect36, useLayoutEffect, useMemo as useMemo6, useRef as useRef32, useState as
|
|
4669
|
+
import { useCallback as useCallback23, useEffect as useEffect36, useLayoutEffect, useMemo as useMemo6, useRef as useRef32, useState as useState60 } from "react";
|
|
4670
4670
|
|
|
4671
4671
|
// src/components/ChatHeader.tsx
|
|
4672
4672
|
import { useEffect as useEffect16, useRef as useRef17, useState as useState15 } from "react";
|
|
@@ -4747,6 +4747,9 @@ function ChatHeader({
|
|
|
4747
4747
|
// src/components/MessageList.tsx
|
|
4748
4748
|
import { useEffect as useEffect23, useRef as useRef21 } from "react";
|
|
4749
4749
|
|
|
4750
|
+
// src/components/ChatMessage.tsx
|
|
4751
|
+
import { useState as useState33 } from "react";
|
|
4752
|
+
|
|
4750
4753
|
// src/components/Markdown.tsx
|
|
4751
4754
|
import ReactMarkdown from "react-markdown";
|
|
4752
4755
|
import remarkGfm from "remark-gfm";
|
|
@@ -6768,16 +6771,23 @@ var LAYOUT_CLASSES = {
|
|
|
6768
6771
|
function layoutClass(layout) {
|
|
6769
6772
|
return Object.prototype.hasOwnProperty.call(LAYOUT_CLASSES, layout) ? LAYOUT_CLASSES[layout] : LAYOUT_CLASSES.goal;
|
|
6770
6773
|
}
|
|
6771
|
-
function
|
|
6774
|
+
function switchSets(dashboards) {
|
|
6775
|
+
return dashboards && dashboards.length >= 2 ? dashboards : null;
|
|
6776
|
+
}
|
|
6777
|
+
function initialSport(sets, defaultSport) {
|
|
6778
|
+
return (sets?.some((s) => s.sport === defaultSport) ? defaultSport : sets?.[0]?.sport) ?? "";
|
|
6779
|
+
}
|
|
6780
|
+
function GreetingDashboard({ dashboard, dashboards, defaultSport, onTap, onSportChange, oddsLabel, liveLabel: liveLabel3, sportGroupLabel }) {
|
|
6772
6781
|
const log = useEventLog();
|
|
6773
6782
|
const scope = useSportScope();
|
|
6774
|
-
const sets = dashboards
|
|
6775
|
-
const [selected, setSelected] = useState26(() => (sets
|
|
6783
|
+
const sets = switchSets(dashboards);
|
|
6784
|
+
const [selected, setSelected] = useState26(() => initialSport(sets, defaultSport));
|
|
6776
6785
|
const active = sets?.find((s) => s.sport === selected) ?? null;
|
|
6777
6786
|
const shown = active ? active.dashboard : dashboard;
|
|
6778
6787
|
const select = (sport) => {
|
|
6779
6788
|
if (sport === selected) return;
|
|
6780
6789
|
setSelected(sport);
|
|
6790
|
+
onSportChange?.(sport);
|
|
6781
6791
|
if (scope) writeSportChoice(scope.operatorId, encodedUserKey(scope.operatorUserId, scope.anonymousUserId), sport, Date.now());
|
|
6782
6792
|
log?.log({ name: "dashboard_sport_switch", outcome: sport });
|
|
6783
6793
|
};
|
|
@@ -7616,6 +7626,7 @@ function FanDashboardCard({ card, onTap, ui, goalEvents }) {
|
|
|
7616
7626
|
// src/components/ChatMessage.tsx
|
|
7617
7627
|
import { jsx as jsx49, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
7618
7628
|
function ChatMessage({ message, disabled, onAct, onTap, ui, slip, monitor }) {
|
|
7629
|
+
const [sport, setSport] = useState33(null);
|
|
7619
7630
|
if (message.role === "user") {
|
|
7620
7631
|
return /* @__PURE__ */ jsx49("div", { className: "ss-w-msg ss-w-user", "data-msg-id": message.id, children: /* @__PURE__ */ jsx49("div", { className: "ss-w-bubble", children: message.text }) });
|
|
7621
7632
|
}
|
|
@@ -7623,9 +7634,12 @@ function ChatMessage({ message, disabled, onAct, onTap, ui, slip, monitor }) {
|
|
|
7623
7634
|
onAct({ message: card.actionLabel, actionRef: card.actionRef, label: card.actionLabel || card.title || "" });
|
|
7624
7635
|
};
|
|
7625
7636
|
const compact = toCompactList(message.marketOdds);
|
|
7637
|
+
const sets = message.greetingDashboard ? switchSets(message.greetingDashboards) : null;
|
|
7638
|
+
const setChips = sets?.some((s) => s.suggestedActions) ? sets.find((s) => s.sport === (sport ?? initialSport(sets, message.defaultSport)))?.suggestedActions ?? [] : null;
|
|
7639
|
+
const actions = setChips ? setChips.map((c) => toActionVM({ ...c })) : message.actions;
|
|
7626
7640
|
return /* @__PURE__ */ jsxs45("div", { className: "ss-w-msg ss-w-bot", "data-msg-id": message.id, children: [
|
|
7627
7641
|
message.text && !message.greetingDashboard && !message.clubFanDashboard ? /* @__PURE__ */ jsx49(Markdown, { text: message.text }) : null,
|
|
7628
|
-
message.greetingDashboard && !message.clubFanDashboard ? /* @__PURE__ */ jsx49(GreetingDashboard, { dashboard: message.greetingDashboard, dashboards: message.greetingDashboards, defaultSport: message.defaultSport, onTap, oddsLabel: ui?.oddsLabel, liveLabel: ui?.liveLabel, sportGroupLabel: ui?.sportGroupLabel }) : null,
|
|
7642
|
+
message.greetingDashboard && !message.clubFanDashboard ? /* @__PURE__ */ jsx49(GreetingDashboard, { dashboard: message.greetingDashboard, dashboards: message.greetingDashboards, defaultSport: message.defaultSport, onTap, onSportChange: setSport, oddsLabel: ui?.oddsLabel, liveLabel: ui?.liveLabel, sportGroupLabel: ui?.sportGroupLabel }) : null,
|
|
7629
7643
|
message.clubFanDashboard ? /* @__PURE__ */ jsx49(ClubFanDashboard, { dashboard: message.clubFanDashboard, onTap: onFanDashboardTap, ui }) : null,
|
|
7630
7644
|
/* @__PURE__ */ jsx49(EntityCardList, { cards: message.cards, disabled, showLessLabel: ui?.showLess, showMoreLabel: ui?.showMore }),
|
|
7631
7645
|
/* @__PURE__ */ jsx49(BettingInsightList, { insights: message.insights, ui, slip, monitor }),
|
|
@@ -7634,7 +7648,7 @@ function ChatMessage({ message, disabled, onAct, onTap, ui, slip, monitor }) {
|
|
|
7634
7648
|
/* @__PURE__ */ jsx49(ComboCardList, { cards: message.comboCards ?? [], ui, slip, monitor }),
|
|
7635
7649
|
compact ? /* @__PURE__ */ jsx49(CompactOddsList, { list: compact, ui, slip, monitor }) : /* @__PURE__ */ jsx49(MarketOddsCardList, { cards: message.marketOdds, ui, slip, monitor }),
|
|
7636
7650
|
/* @__PURE__ */ jsx49(OddsMovementCardList, { cards: message.oddsMovement, ui, monitor }),
|
|
7637
|
-
/* @__PURE__ */ jsx49(ActionButtons, { actions
|
|
7651
|
+
/* @__PURE__ */ jsx49(ActionButtons, { actions, loading: false, disabled, onAct })
|
|
7638
7652
|
] });
|
|
7639
7653
|
}
|
|
7640
7654
|
|
|
@@ -7722,10 +7736,10 @@ function MessageList({ controller, ui, slip, onDashboardTap, monitor }) {
|
|
|
7722
7736
|
}
|
|
7723
7737
|
|
|
7724
7738
|
// src/components/ChatInput.tsx
|
|
7725
|
-
import { forwardRef, useEffect as useEffect24, useImperativeHandle, useRef as useRef22, useState as
|
|
7739
|
+
import { forwardRef, useEffect as useEffect24, useImperativeHandle, useRef as useRef22, useState as useState34 } from "react";
|
|
7726
7740
|
import { jsx as jsx52, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
7727
7741
|
var ChatInput = forwardRef(function ChatInput2({ placeholder, streaming, onSend, onStop, stopLabel = "Stop response", sendLabel = "Send message", disabled = false, onType }, ref) {
|
|
7728
|
-
const [value, setValue] =
|
|
7742
|
+
const [value, setValue] = useState34("");
|
|
7729
7743
|
const textareaRef = useRef22(null);
|
|
7730
7744
|
const stopRef = useRef22(null);
|
|
7731
7745
|
const textBoxWantsFocusRef = useRef22(false);
|
|
@@ -7896,10 +7910,10 @@ function MarketAccordion({ match, monitor, ui, slip }) {
|
|
|
7896
7910
|
}
|
|
7897
7911
|
|
|
7898
7912
|
// src/components/LiveFactBlock.tsx
|
|
7899
|
-
import { useState as
|
|
7913
|
+
import { useState as useState35 } from "react";
|
|
7900
7914
|
import { jsx as jsx55, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
7901
7915
|
function LiveFactBlock({ facts, matchId, ui, slip, onAsk }) {
|
|
7902
|
-
const [expanded, setExpanded] =
|
|
7916
|
+
const [expanded, setExpanded] = useState35(false);
|
|
7903
7917
|
const [current, ...earlier] = facts;
|
|
7904
7918
|
if (!current) return null;
|
|
7905
7919
|
const m = current.market;
|
|
@@ -7967,7 +7981,7 @@ function LiveFactBlock({ facts, matchId, ui, slip, onAsk }) {
|
|
|
7967
7981
|
}
|
|
7968
7982
|
|
|
7969
7983
|
// src/components/MonitorFormH2H.tsx
|
|
7970
|
-
import { useState as
|
|
7984
|
+
import { useState as useState36 } from "react";
|
|
7971
7985
|
import { Fragment as Fragment11, jsx as jsx56, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
7972
7986
|
function resultClass2(result) {
|
|
7973
7987
|
if (result === "W") return "ss-w-h2h-result--win";
|
|
@@ -7983,7 +7997,7 @@ function FormDots({ form, ui }) {
|
|
|
7983
7997
|
return /* @__PURE__ */ jsx56("div", { className: "ss-w-h2h-dots", children: form.map((m, i) => /* @__PURE__ */ jsx56("span", { className: `ss-w-h2h-result ${resultClass2(m.result)}`, children: resultLabel(m.result, ui) }, i)) });
|
|
7984
7998
|
}
|
|
7985
7999
|
function MonitorFormH2H({ formAndH2H, homeTeamName, awayTeamName, ui }) {
|
|
7986
|
-
const [expanded, setExpanded] =
|
|
8000
|
+
const [expanded, setExpanded] = useState36(false);
|
|
7987
8001
|
const { homeForm, awayForm, h2h, homeShortCode, awayShortCode } = formAndH2H;
|
|
7988
8002
|
if (homeForm.length === 0 && awayForm.length === 0 && !h2h) {
|
|
7989
8003
|
return /* @__PURE__ */ jsx56(Fragment11, {});
|
|
@@ -8216,7 +8230,7 @@ function MonitorSkeleton({ pin, monitor, ui }) {
|
|
|
8216
8230
|
import { SPORTS as SPORTS5 } from "@sensiblestats/widget-sdk";
|
|
8217
8231
|
|
|
8218
8232
|
// src/components/NbaPropsSection.tsx
|
|
8219
|
-
import { useEffect as useEffect26, useState as
|
|
8233
|
+
import { useEffect as useEffect26, useState as useState37 } from "react";
|
|
8220
8234
|
import { Fragment as Fragment12, jsx as jsx59, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
8221
8235
|
var STAT_ORDER = ["points", "rebounds", "assists", "threes"];
|
|
8222
8236
|
var MAX_TIMER_MS = 2147483647;
|
|
@@ -8278,7 +8292,7 @@ function Last5({ games, stat, line, ui }) {
|
|
|
8278
8292
|
}
|
|
8279
8293
|
function PlayerPanel({ player, bundle, ui, slip }) {
|
|
8280
8294
|
const stats = STAT_ORDER.map((k) => player.stats.find((s) => s.stat === k)).filter((s) => s != null);
|
|
8281
|
-
const [picked, setPicked] =
|
|
8295
|
+
const [picked, setPicked] = useState37(null);
|
|
8282
8296
|
const active = stats.find((s) => s.stat === picked) ?? stats[0];
|
|
8283
8297
|
return /* @__PURE__ */ jsxs54("div", { className: "ss-w-props-panel", children: [
|
|
8284
8298
|
/* @__PURE__ */ jsx59("div", { className: "ss-w-props-chips", children: stats.map((s) => /* @__PURE__ */ jsx59(
|
|
@@ -8315,7 +8329,7 @@ function PlayerPanel({ player, bundle, ui, slip }) {
|
|
|
8315
8329
|
] });
|
|
8316
8330
|
}
|
|
8317
8331
|
function Roster({ bundle, players, side, ui, slip }) {
|
|
8318
|
-
const [openId, setOpenId] =
|
|
8332
|
+
const [openId, setOpenId] = useState37(null);
|
|
8319
8333
|
return /* @__PURE__ */ jsx59("div", { className: "ss-w-props-list", children: players.map((p) => {
|
|
8320
8334
|
const isOpen = openId === p.playerId;
|
|
8321
8335
|
const main = p.stats.find((s) => s.stat === "points" && hasMainLine(s)) ?? p.stats.find(hasMainLine);
|
|
@@ -8346,8 +8360,8 @@ function Roster({ bundle, players, side, ui, slip }) {
|
|
|
8346
8360
|
}) });
|
|
8347
8361
|
}
|
|
8348
8362
|
function NbaPropsSection({ match, monitor, ui, slip }) {
|
|
8349
|
-
const [side, setSide] =
|
|
8350
|
-
const [, setTick] =
|
|
8363
|
+
const [side, setSide] = useState37("home");
|
|
8364
|
+
const [, setTick] = useState37(0);
|
|
8351
8365
|
const pre = preTip(match);
|
|
8352
8366
|
const live = match.phase === "live";
|
|
8353
8367
|
const open = pre || live;
|
|
@@ -8833,7 +8847,7 @@ function OddsPanel({ monitor, ui, slip }) {
|
|
|
8833
8847
|
}
|
|
8834
8848
|
|
|
8835
8849
|
// src/components/TodayPanel.tsx
|
|
8836
|
-
import { useEffect as useEffect29, useId as useId2, useMemo as useMemo5, useState as
|
|
8850
|
+
import { useEffect as useEffect29, useId as useId2, useMemo as useMemo5, useState as useState40 } from "react";
|
|
8837
8851
|
import { matchKey as matchKey7 } from "@sensiblestats/widget-sdk";
|
|
8838
8852
|
|
|
8839
8853
|
// src/placement.ts
|
|
@@ -8898,9 +8912,9 @@ function matchingFixtures(group, query) {
|
|
|
8898
8912
|
}
|
|
8899
8913
|
|
|
8900
8914
|
// src/useStarTap.ts
|
|
8901
|
-
import { useCallback as useCallback19, useRef as useRef25, useState as
|
|
8915
|
+
import { useCallback as useCallback19, useRef as useRef25, useState as useState38 } from "react";
|
|
8902
8916
|
function useStarTap(starLeague) {
|
|
8903
|
-
const [pendingId, setPendingId] =
|
|
8917
|
+
const [pendingId, setPendingId] = useState38(null);
|
|
8904
8918
|
const pendingRef = useRef25(null);
|
|
8905
8919
|
const tap = useCallback19(async (competitionId, next) => {
|
|
8906
8920
|
if (pendingRef.current !== null) return false;
|
|
@@ -8961,7 +8975,7 @@ function LeagueTile({ group, starClickable: starClickable2, disambiguate, onOpen
|
|
|
8961
8975
|
}
|
|
8962
8976
|
|
|
8963
8977
|
// src/components/LeagueDetail.tsx
|
|
8964
|
-
import { useEffect as useEffect28, useState as
|
|
8978
|
+
import { useEffect as useEffect28, useState as useState39 } from "react";
|
|
8965
8979
|
import { matchKey as matchKey5 } from "@sensiblestats/widget-sdk";
|
|
8966
8980
|
|
|
8967
8981
|
// src/components/FixtureRow.tsx
|
|
@@ -9024,7 +9038,7 @@ function FixtureRow({ match, state, stale, ui, monitor }) {
|
|
|
9024
9038
|
import { jsx as jsx66, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
9025
9039
|
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";
|
|
9026
9040
|
function LeagueDetail({ group, position, states, stale, ui, monitor, starTap, onBack, onPrev, onNext }) {
|
|
9027
|
-
const [toast, setToast] =
|
|
9041
|
+
const [toast, setToast] = useState39(null);
|
|
9028
9042
|
useEffect28(() => {
|
|
9029
9043
|
setToast(null);
|
|
9030
9044
|
}, [group.competitionId]);
|
|
@@ -9266,9 +9280,9 @@ import { Fragment as Fragment16, jsx as jsx70, jsxs as jsxs64 } from "react/jsx-
|
|
|
9266
9280
|
function TodayPanel({ discovery, ui, monitor }) {
|
|
9267
9281
|
const { groups, states, stale, starLeague } = discovery;
|
|
9268
9282
|
const searchId = useId2();
|
|
9269
|
-
const [query, setQuery] =
|
|
9270
|
-
const [selectedCompetitionId, setSelectedCompetitionId] =
|
|
9271
|
-
const [toast, setToast] =
|
|
9283
|
+
const [query, setQuery] = useState40("");
|
|
9284
|
+
const [selectedCompetitionId, setSelectedCompetitionId] = useState40(null);
|
|
9285
|
+
const [toast, setToast] = useState40(null);
|
|
9272
9286
|
useEffect29(() => {
|
|
9273
9287
|
if (toast === null) return;
|
|
9274
9288
|
const id = setTimeout(() => setToast(null), 4e3);
|
|
@@ -9471,7 +9485,7 @@ function TodayPanel({ discovery, ui, monitor }) {
|
|
|
9471
9485
|
}
|
|
9472
9486
|
|
|
9473
9487
|
// src/components/GamesPanel.tsx
|
|
9474
|
-
import { useEffect as useEffect33, useState as
|
|
9488
|
+
import { useEffect as useEffect33, useState as useState55 } from "react";
|
|
9475
9489
|
|
|
9476
9490
|
// src/components/GamesLoginWall.tsx
|
|
9477
9491
|
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
@@ -9480,7 +9494,7 @@ function GamesLoginWall({ ui }) {
|
|
|
9480
9494
|
}
|
|
9481
9495
|
|
|
9482
9496
|
// src/components/GamesHub.tsx
|
|
9483
|
-
import { useEffect as useEffect30, useState as
|
|
9497
|
+
import { useEffect as useEffect30, useState as useState41 } from "react";
|
|
9484
9498
|
|
|
9485
9499
|
// src/components/games/ui/gameMeta.ts
|
|
9486
9500
|
function prettifyGameId(gameId) {
|
|
@@ -9631,7 +9645,7 @@ function pickHeroGame(games) {
|
|
|
9631
9645
|
}
|
|
9632
9646
|
var tileKey = (g) => `${g.gameId}-${g.gameDay}-${g.fixtureId}`;
|
|
9633
9647
|
function GamesHub({ games, myWeeklyRow, weeklyPrize, onOpen, ui }) {
|
|
9634
|
-
const [, setTick] =
|
|
9648
|
+
const [, setTick] = useState41(0);
|
|
9635
9649
|
useEffect30(() => {
|
|
9636
9650
|
const id = setInterval(() => setTick((t) => t + 1), 6e4);
|
|
9637
9651
|
return () => clearInterval(id);
|
|
@@ -9692,10 +9706,10 @@ function GamesHub({ games, myWeeklyRow, weeklyPrize, onOpen, ui }) {
|
|
|
9692
9706
|
}
|
|
9693
9707
|
|
|
9694
9708
|
// src/components/GameScreenHost.tsx
|
|
9695
|
-
import { useEffect as useEffect32, useRef as useRef29, useState as
|
|
9709
|
+
import { useEffect as useEffect32, useRef as useRef29, useState as useState53 } from "react";
|
|
9696
9710
|
|
|
9697
9711
|
// src/useGamePlay.ts
|
|
9698
|
-
import { useCallback as useCallback21, useRef as useRef27, useState as
|
|
9712
|
+
import { useCallback as useCallback21, useRef as useRef27, useState as useState42 } from "react";
|
|
9699
9713
|
function toSubmitResult(payload) {
|
|
9700
9714
|
return {
|
|
9701
9715
|
// 'pending' means the play is recorded but awaiting resolution (fixture games)
|
|
@@ -9707,9 +9721,9 @@ function toSubmitResult(payload) {
|
|
|
9707
9721
|
};
|
|
9708
9722
|
}
|
|
9709
9723
|
function useGamePlay(conversation, { gameId, gameDay, fixtureId, locale, refresh }) {
|
|
9710
|
-
const [result, setResult] =
|
|
9711
|
-
const [submitting, setSubmitting] =
|
|
9712
|
-
const [rawStatus, setRawStatus] =
|
|
9724
|
+
const [result, setResult] = useState42(null);
|
|
9725
|
+
const [submitting, setSubmitting] = useState42(false);
|
|
9726
|
+
const [rawStatus, setRawStatus] = useState42(null);
|
|
9713
9727
|
const inFlightRef = useRef27(false);
|
|
9714
9728
|
const convRef = useRef27(conversation);
|
|
9715
9729
|
convRef.current = conversation;
|
|
@@ -9767,7 +9781,7 @@ function useGamePlay(conversation, { gameId, gameDay, fixtureId, locale, refresh
|
|
|
9767
9781
|
}
|
|
9768
9782
|
|
|
9769
9783
|
// src/components/games/MysteryTigerGame.tsx
|
|
9770
|
-
import { useState as
|
|
9784
|
+
import { useState as useState44, useId as useId3 } from "react";
|
|
9771
9785
|
|
|
9772
9786
|
// src/components/games/nationFlags.ts
|
|
9773
9787
|
var FLAGS = {
|
|
@@ -9978,7 +9992,7 @@ function isNationCode(flag) {
|
|
|
9978
9992
|
}
|
|
9979
9993
|
|
|
9980
9994
|
// src/components/games/PlayerAvatar.tsx
|
|
9981
|
-
import { useState as
|
|
9995
|
+
import { useState as useState43 } from "react";
|
|
9982
9996
|
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
9983
9997
|
function initialsOf(name) {
|
|
9984
9998
|
const parts = name.trim().split(/\s+/).filter(Boolean);
|
|
@@ -9996,7 +10010,7 @@ function PlayerAvatar({
|
|
|
9996
10010
|
imagePath,
|
|
9997
10011
|
className
|
|
9998
10012
|
}) {
|
|
9999
|
-
const [failed, setFailed] =
|
|
10013
|
+
const [failed, setFailed] = useState43(false);
|
|
10000
10014
|
const showImage = Boolean(imagePath) && !isPlaceholderImage(imagePath) && !failed;
|
|
10001
10015
|
return /* @__PURE__ */ jsx76("div", { className, "aria-hidden": "true", children: showImage ? /* @__PURE__ */ jsx76("img", { src: imagePath, alt: "", loading: "lazy", onError: () => setFailed(true) }) : /* @__PURE__ */ jsx76("span", { className: "ss-w-av-initials", children: initialsOf(name) }) });
|
|
10002
10016
|
}
|
|
@@ -10237,7 +10251,7 @@ function MysteryTigerGame({
|
|
|
10237
10251
|
onBack
|
|
10238
10252
|
}) {
|
|
10239
10253
|
const t = ui.games.mysteryTiger;
|
|
10240
|
-
const [query, setQuery] =
|
|
10254
|
+
const [query, setQuery] = useState44("");
|
|
10241
10255
|
const inputId = useId3();
|
|
10242
10256
|
const clientState = parseClientState(result?.clientStateJson);
|
|
10243
10257
|
const guessResults = clientState?.guessResults ?? [];
|
|
@@ -10499,13 +10513,13 @@ function HigherOrLowerGame({
|
|
|
10499
10513
|
}
|
|
10500
10514
|
|
|
10501
10515
|
// src/components/games/CareerPathGame.tsx
|
|
10502
|
-
import { useState as
|
|
10516
|
+
import { useState as useState46, useId as useId4 } from "react";
|
|
10503
10517
|
|
|
10504
10518
|
// src/components/games/ui/CrestShield.tsx
|
|
10505
|
-
import { useState as
|
|
10519
|
+
import { useState as useState45 } from "react";
|
|
10506
10520
|
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
10507
10521
|
function CrestShield({ src, name, size = 28 }) {
|
|
10508
|
-
const [failed, setFailed] =
|
|
10522
|
+
const [failed, setFailed] = useState45(false);
|
|
10509
10523
|
if (src && !isPlaceholderImage(src) && !failed) {
|
|
10510
10524
|
return /* @__PURE__ */ jsx87("img", { className: "ss-g-crest", src, alt: name, width: size, height: size, loading: "lazy", onError: () => setFailed(true) });
|
|
10511
10525
|
}
|
|
@@ -10537,7 +10551,7 @@ function CareerPathGame({
|
|
|
10537
10551
|
}) {
|
|
10538
10552
|
const s = ui.games.careerPath;
|
|
10539
10553
|
const title = gameTitle({ gameId: "career-path" }, ui.games.titles);
|
|
10540
|
-
const [query, setQuery] =
|
|
10554
|
+
const [query, setQuery] = useState46("");
|
|
10541
10555
|
const inputId = useId4();
|
|
10542
10556
|
const clientState = parseClientState3(result?.clientStateJson);
|
|
10543
10557
|
const alreadyGuessedIds = new Set(clientState?.guessResults.map((g) => g.playerId) ?? []);
|
|
@@ -10644,7 +10658,7 @@ function CareerPathGame({
|
|
|
10644
10658
|
}
|
|
10645
10659
|
|
|
10646
10660
|
// src/components/games/BeatTheGridGame.tsx
|
|
10647
|
-
import React, { useEffect as useEffect31, useId as useId5, useRef as useRef28, useState as
|
|
10661
|
+
import React, { useEffect as useEffect31, useId as useId5, useRef as useRef28, useState as useState47 } from "react";
|
|
10648
10662
|
|
|
10649
10663
|
// src/components/games/ui/OptionList.tsx
|
|
10650
10664
|
import { jsx as jsx89 } from "react/jsx-runtime";
|
|
@@ -10733,7 +10747,7 @@ function SearchSheet({
|
|
|
10733
10747
|
ui
|
|
10734
10748
|
}) {
|
|
10735
10749
|
const s = ui.games.beatTheGrid;
|
|
10736
|
-
const [query, setQuery] =
|
|
10750
|
+
const [query, setQuery] = useState47("");
|
|
10737
10751
|
const inputId = useId5();
|
|
10738
10752
|
const inputRef = useRef28(null);
|
|
10739
10753
|
useEffect31(() => {
|
|
@@ -10801,7 +10815,7 @@ function BeatTheGridGame({
|
|
|
10801
10815
|
}) {
|
|
10802
10816
|
const s = ui.games.beatTheGrid;
|
|
10803
10817
|
const title = gameTitle({ gameId: "beat-the-grid" }, ui.games.titles);
|
|
10804
|
-
const [activeCell, setActiveCell] =
|
|
10818
|
+
const [activeCell, setActiveCell] = useState47(null);
|
|
10805
10819
|
const clientState = parseClientState4(result?.clientStateJson);
|
|
10806
10820
|
const filledCells = clientState?.cells ?? [];
|
|
10807
10821
|
const isLocked2 = result?.alreadyPlayed === true || clientState?.isComplete === true;
|
|
@@ -10956,7 +10970,7 @@ function BeatTheGridGame({
|
|
|
10956
10970
|
}
|
|
10957
10971
|
|
|
10958
10972
|
// src/components/games/GuessTheXiGame.tsx
|
|
10959
|
-
import { useState as
|
|
10973
|
+
import { useState as useState48, useId as useId6 } from "react";
|
|
10960
10974
|
|
|
10961
10975
|
// src/components/games/ui/PitchSvg.tsx
|
|
10962
10976
|
import { Fragment as Fragment25, jsx as jsx91, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
@@ -11045,7 +11059,7 @@ function GuessTheXiGame({
|
|
|
11045
11059
|
onBack
|
|
11046
11060
|
}) {
|
|
11047
11061
|
const t = ui.games.guessTheXi;
|
|
11048
|
-
const [query, setQuery] =
|
|
11062
|
+
const [query, setQuery] = useState48("");
|
|
11049
11063
|
const inputId = useId6();
|
|
11050
11064
|
const clientState = parseClientState5(result?.clientStateJson);
|
|
11051
11065
|
const isOver = result?.alreadyPlayed === true || clientState?.status === "solved" || clientState?.status === "failed";
|
|
@@ -11188,7 +11202,7 @@ function GuessTheXiGame({
|
|
|
11188
11202
|
}
|
|
11189
11203
|
|
|
11190
11204
|
// src/components/games/DailyQuizGame.tsx
|
|
11191
|
-
import { useState as
|
|
11205
|
+
import { useState as useState49 } from "react";
|
|
11192
11206
|
import { Fragment as Fragment27, jsx as jsx93, jsxs as jsxs81 } from "react/jsx-runtime";
|
|
11193
11207
|
function parseClientState6(json) {
|
|
11194
11208
|
if (!json) return null;
|
|
@@ -11229,8 +11243,8 @@ function DailyQuizGame({
|
|
|
11229
11243
|
}) {
|
|
11230
11244
|
const s = ui.games.dailyQuiz;
|
|
11231
11245
|
const title = gameTitle({ gameId: "daily-quiz" }, ui.games.titles);
|
|
11232
|
-
const [selections, setSelections] =
|
|
11233
|
-
const [page, setPage] =
|
|
11246
|
+
const [selections, setSelections] = useState49(/* @__PURE__ */ new Map());
|
|
11247
|
+
const [page, setPage] = useState49(0);
|
|
11234
11248
|
const clientState = parseClientState6(result?.clientStateJson);
|
|
11235
11249
|
const results = clientState?.results ?? [];
|
|
11236
11250
|
const isRevealed = results.length > 0 || result?.alreadyPlayed === true;
|
|
@@ -11340,7 +11354,7 @@ function DailyQuizGame({
|
|
|
11340
11354
|
}
|
|
11341
11355
|
|
|
11342
11356
|
// src/components/games/MatchdayPredictorGame.tsx
|
|
11343
|
-
import { useId as useId7, useState as
|
|
11357
|
+
import { useId as useId7, useState as useState50 } from "react";
|
|
11344
11358
|
import { jsx as jsx94, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
11345
11359
|
var SCORER_SEARCH_THRESHOLD = 9;
|
|
11346
11360
|
function parseClientState7(json) {
|
|
@@ -11436,11 +11450,11 @@ function MatchdayPredictorGame({
|
|
|
11436
11450
|
onBack
|
|
11437
11451
|
}) {
|
|
11438
11452
|
const t = ui.games.predictor;
|
|
11439
|
-
const [homeScore, setHomeScore] =
|
|
11440
|
-
const [awayScore, setAwayScore] =
|
|
11441
|
-
const [firstScorerPlayerId, setFirstScorerPlayerId] =
|
|
11442
|
-
const [lastEdited, setLastEdited] =
|
|
11443
|
-
const [query, setQuery] =
|
|
11453
|
+
const [homeScore, setHomeScore] = useState50(0);
|
|
11454
|
+
const [awayScore, setAwayScore] = useState50(0);
|
|
11455
|
+
const [firstScorerPlayerId, setFirstScorerPlayerId] = useState50(null);
|
|
11456
|
+
const [lastEdited, setLastEdited] = useState50("home");
|
|
11457
|
+
const [query, setQuery] = useState50("");
|
|
11444
11458
|
const searchId = useId7();
|
|
11445
11459
|
const clientState = parseClientState7(result?.clientStateJson);
|
|
11446
11460
|
const alreadyPlayed = result?.alreadyPlayed === true;
|
|
@@ -11608,7 +11622,7 @@ function MatchdayPredictorGame({
|
|
|
11608
11622
|
}
|
|
11609
11623
|
|
|
11610
11624
|
// src/components/games/StartingXiGame.tsx
|
|
11611
|
-
import { useId as useId8, useState as
|
|
11625
|
+
import { useId as useId8, useState as useState51 } from "react";
|
|
11612
11626
|
import { Fragment as Fragment28, jsx as jsx95, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
11613
11627
|
var POINTS_PER_STARTER = 8;
|
|
11614
11628
|
var XI_SIZE = 11;
|
|
@@ -11652,9 +11666,9 @@ function StartingXiGame({
|
|
|
11652
11666
|
lockAtUtc
|
|
11653
11667
|
}) {
|
|
11654
11668
|
const t = ui.games.startingXi;
|
|
11655
|
-
const [slotPlayers, setSlotPlayers] =
|
|
11656
|
-
const [active, setActive] =
|
|
11657
|
-
const [query, setQuery] =
|
|
11669
|
+
const [slotPlayers, setSlotPlayers] = useState51(() => Array(XI_SIZE).fill(null));
|
|
11670
|
+
const [active, setActive] = useState51(0);
|
|
11671
|
+
const [query, setQuery] = useState51("");
|
|
11658
11672
|
const searchId = useId8();
|
|
11659
11673
|
const clientState = parseClientState8(result?.clientStateJson);
|
|
11660
11674
|
const alreadyPlayed = result?.alreadyPlayed === true;
|
|
@@ -11794,7 +11808,7 @@ function StartingXiGame({
|
|
|
11794
11808
|
}
|
|
11795
11809
|
|
|
11796
11810
|
// src/components/games/StatLadderGame.tsx
|
|
11797
|
-
import { useId as useId9, useState as
|
|
11811
|
+
import { useId as useId9, useState as useState52 } from "react";
|
|
11798
11812
|
import { jsx as jsx96, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
11799
11813
|
function ladderClue(ladder) {
|
|
11800
11814
|
const mystery = ladder.find((r) => r.rank === 2);
|
|
@@ -11831,8 +11845,8 @@ function StatLadderGame({
|
|
|
11831
11845
|
onBack
|
|
11832
11846
|
}) {
|
|
11833
11847
|
const t = ui.games.statLadder;
|
|
11834
|
-
const [query, setQuery] =
|
|
11835
|
-
const [selectedId, setSelectedId] =
|
|
11848
|
+
const [query, setQuery] = useState52("");
|
|
11849
|
+
const [selectedId, setSelectedId] = useState52(null);
|
|
11836
11850
|
const searchId = useId9();
|
|
11837
11851
|
const clientState = parseClientState9(result?.clientStateJson);
|
|
11838
11852
|
const revealed = clientState != null;
|
|
@@ -12039,7 +12053,7 @@ function GameScreenHost({
|
|
|
12039
12053
|
ui
|
|
12040
12054
|
}) {
|
|
12041
12055
|
const { gameId, fixtureId, gameDay = "", lockAtUtc = null } = selected;
|
|
12042
|
-
const [configJson, setConfigJson] =
|
|
12056
|
+
const [configJson, setConfigJson] = useState53(null);
|
|
12043
12057
|
useEffect32(() => {
|
|
12044
12058
|
setConfigJson(null);
|
|
12045
12059
|
if (!conversation) return;
|
|
@@ -12181,7 +12195,7 @@ function GameScreenHost({
|
|
|
12181
12195
|
}
|
|
12182
12196
|
|
|
12183
12197
|
// src/components/Leaderboard.tsx
|
|
12184
|
-
import { useState as
|
|
12198
|
+
import { useState as useState54 } from "react";
|
|
12185
12199
|
|
|
12186
12200
|
// src/components/LeaderboardRow.tsx
|
|
12187
12201
|
import { jsx as jsx99, jsxs as jsxs86 } from "react/jsx-runtime";
|
|
@@ -12266,7 +12280,7 @@ function Leaderboard({
|
|
|
12266
12280
|
ui,
|
|
12267
12281
|
onPlay
|
|
12268
12282
|
}) {
|
|
12269
|
-
const [segment, setSegment] =
|
|
12283
|
+
const [segment, setSegment] = useState54("weekly");
|
|
12270
12284
|
const myRow = segment === "weekly" ? data.myWeeklyRow : data.myAllTimeRow;
|
|
12271
12285
|
const offBoard = myRow !== null && myRow !== void 0 && myRow.rank === -1;
|
|
12272
12286
|
const isEmpty = segment === "weekly" ? data.weeklyTop.length === 0 : data.allTimeTop.length === 0;
|
|
@@ -12369,8 +12383,8 @@ function GamesPanel({
|
|
|
12369
12383
|
leaderboardLoading,
|
|
12370
12384
|
refreshHub
|
|
12371
12385
|
}) {
|
|
12372
|
-
const [selected, setSelected] =
|
|
12373
|
-
const [segment, setSegment] =
|
|
12386
|
+
const [selected, setSelected] = useState55(null);
|
|
12387
|
+
const [segment, setSegment] = useState55("play");
|
|
12374
12388
|
useEffect33(() => {
|
|
12375
12389
|
ensureGamesFonts();
|
|
12376
12390
|
}, []);
|
|
@@ -12672,10 +12686,10 @@ function Squad({ squad, loading, ui, view, onToggleView, stats, statsLoading, se
|
|
|
12672
12686
|
}
|
|
12673
12687
|
|
|
12674
12688
|
// src/components/PlayerPhoto.tsx
|
|
12675
|
-
import { useState as
|
|
12689
|
+
import { useState as useState56 } from "react";
|
|
12676
12690
|
import { jsx as jsx108 } from "react/jsx-runtime";
|
|
12677
12691
|
function PlayerPhoto({ photoUrl, jerseyNumber, size }) {
|
|
12678
|
-
const [failed, setFailed] =
|
|
12692
|
+
const [failed, setFailed] = useState56(false);
|
|
12679
12693
|
const box = { width: size, height: size };
|
|
12680
12694
|
if (photoUrl && !failed) {
|
|
12681
12695
|
return /* @__PURE__ */ jsx108("img", { className: "ss-w-pd-photo", style: box, src: photoUrl, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
@@ -12710,7 +12724,7 @@ function MiniPitch({ positionCode }) {
|
|
|
12710
12724
|
}
|
|
12711
12725
|
|
|
12712
12726
|
// src/components/PerformanceBars.tsx
|
|
12713
|
-
import { useState as
|
|
12727
|
+
import { useState as useState57 } from "react";
|
|
12714
12728
|
import { jsx as jsx110, jsxs as jsxs94 } from "react/jsx-runtime";
|
|
12715
12729
|
var GROUPS = ["shooting", "passing", "possession", "defending"];
|
|
12716
12730
|
function finite3(v) {
|
|
@@ -12756,7 +12770,7 @@ function unrankedLine(ui, reason) {
|
|
|
12756
12770
|
}
|
|
12757
12771
|
}
|
|
12758
12772
|
function PerformanceBars({ performance, competitionName, strings }) {
|
|
12759
|
-
const [mode, setMode] =
|
|
12773
|
+
const [mode, setMode] = useState57("total");
|
|
12760
12774
|
const labelled = performance.metrics.filter((m) => Object.prototype.hasOwnProperty.call(strings.perfMetric, m.key));
|
|
12761
12775
|
if (!labelled.some((m) => valueOf(m, "total") !== null || valueOf(m, "per90") !== null)) return null;
|
|
12762
12776
|
const subtitle = !performance.ranked ? unrankedLine(strings, performance.unrankedReason) : competitionName ? strings.perfRankedAgainst(competitionName, performance.positionGroup) : null;
|
|
@@ -12965,7 +12979,7 @@ function PresetSpeedDial({ expanded, showDot, strings, onToggle, onOpen, rootRef
|
|
|
12965
12979
|
}
|
|
12966
12980
|
|
|
12967
12981
|
// src/components/PresetTools.tsx
|
|
12968
|
-
import { Fragment as Fragment32, useEffect as useEffect34, useId as useId11, useRef as useRef30, useState as
|
|
12982
|
+
import { Fragment as Fragment32, useEffect as useEffect34, useId as useId11, useRef as useRef30, useState as useState58 } from "react";
|
|
12969
12983
|
import { Fragment as Fragment33, jsx as jsx113, jsxs as jsxs97 } from "react/jsx-runtime";
|
|
12970
12984
|
var FOCUSABLE = 'button:not([disabled]), [href], input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
12971
12985
|
function PresetToolModal({ title, closeLabel, onClose, children, footer }) {
|
|
@@ -13085,15 +13099,15 @@ function SetNumbersTool({ grid, strings, streaming, onSend, onClose }) {
|
|
|
13085
13099
|
const totals = comboTotals(grid);
|
|
13086
13100
|
const legChoices = comboLegChoices(grid);
|
|
13087
13101
|
const count = FIXED_SINGLES_COUNT;
|
|
13088
|
-
const [maxPrice, setMaxPrice] =
|
|
13089
|
-
const [minPrice, setMinPrice] =
|
|
13090
|
-
const [start] =
|
|
13091
|
-
const [total, setTotal] =
|
|
13092
|
-
const [legs, setLegs] =
|
|
13093
|
-
const [bigStart] =
|
|
13094
|
-
const [bigTotal, setBigTotal] =
|
|
13095
|
-
const [bigLegs, setBigLegs] =
|
|
13096
|
-
const [announcement, setAnnouncement] =
|
|
13102
|
+
const [maxPrice, setMaxPrice] = useState58(() => startSingles(grid.singles, limits, START.maxPrice, count));
|
|
13103
|
+
const [minPrice, setMinPrice] = useState58(() => startSingles(grid.singlesFrom, floors, START.minPrice, count));
|
|
13104
|
+
const [start] = useState58(() => startCombo(grid, totals, legChoices, START.comboTotal, START.comboLegs));
|
|
13105
|
+
const [total, setTotal] = useState58(start.total);
|
|
13106
|
+
const [legs, setLegs] = useState58(start.legs);
|
|
13107
|
+
const [bigStart] = useState58(() => startCombo(grid, totals, legChoices, BIG_COMBO.total, BIG_COMBO.legs));
|
|
13108
|
+
const [bigTotal, setBigTotal] = useState58(bigStart.total);
|
|
13109
|
+
const [bigLegs, setBigLegs] = useState58(bigStart.legs);
|
|
13110
|
+
const [announcement, setAnnouncement] = useState58("");
|
|
13097
13111
|
const maxCell = findSingles(grid.singles, maxPrice, count);
|
|
13098
13112
|
const minCell = findSingles(grid.singlesFrom, minPrice, count);
|
|
13099
13113
|
const comboCell = findCombo(grid, total, legs);
|
|
@@ -13137,7 +13151,7 @@ function SetNumbersTool({ grid, strings, streaming, onSend, onClose }) {
|
|
|
13137
13151
|
const totalChoices = totals.map((v) => ({ value: v, text: v.toFixed(1), available: legChoices.some((n) => !!findCombo(grid, v, n)) }));
|
|
13138
13152
|
const legChoicesFor = (t) => legChoices.map((n) => ({ value: n, text: String(n), available: !!findCombo(grid, t, n) }));
|
|
13139
13153
|
const markets = grid.markets ?? [];
|
|
13140
|
-
const [marketIdx, setMarketIdx] =
|
|
13154
|
+
const [marketIdx, setMarketIdx] = useState58(0);
|
|
13141
13155
|
const marketCell = markets[marketIdx] ?? null;
|
|
13142
13156
|
const marketLabels = markets.map((c) => strings.marketShort(c.marketDeveloperName, c.marketLabel, c.selectionLabel ?? null));
|
|
13143
13157
|
const singlesReady = (cell2) => cell2 ? strings.readyCount(cell2.picks.length) : strings.unavailable;
|
|
@@ -13218,14 +13232,14 @@ function SetNumbersTool({ grid, strings, streaming, onSend, onClose }) {
|
|
|
13218
13232
|
function BuildComboTool({ grid, strings, streaming, formatKickoff, initialTotal, initialLegs, onSend, onClose }) {
|
|
13219
13233
|
const totals = comboTotals(grid);
|
|
13220
13234
|
const legChoices = comboLegChoices(grid);
|
|
13221
|
-
const [start] =
|
|
13222
|
-
const [total, setTotal] =
|
|
13223
|
-
const [legs, setLegs] =
|
|
13235
|
+
const [start] = useState58(() => initialTotal === void 0 ? startCombo(grid, totals, legChoices, START.comboTotal, START.comboLegs) : null);
|
|
13236
|
+
const [total, setTotal] = useState58(() => initialTotal !== void 0 ? nearest(totals, initialTotal) : start.total);
|
|
13237
|
+
const [legs, setLegs] = useState58(() => {
|
|
13224
13238
|
if (initialTotal === void 0) return initialLegs !== void 0 ? clampLegs(legChoices, initialLegs) : start.legs;
|
|
13225
13239
|
const from = initialLegs !== void 0 ? clampLegs(legChoices, initialLegs) : startValue(legChoices, START.comboLegs);
|
|
13226
13240
|
return legsForTotal(grid, nearest(totals, initialTotal), from);
|
|
13227
13241
|
});
|
|
13228
|
-
const [announcement, setAnnouncement] =
|
|
13242
|
+
const [announcement, setAnnouncement] = useState58("");
|
|
13229
13243
|
const cell2 = findCombo(grid, total, legs);
|
|
13230
13244
|
const minLegs = legChoices[0] ?? legs;
|
|
13231
13245
|
const maxLegs = legChoices[legChoices.length - 1] ?? legs;
|
|
@@ -13258,7 +13272,7 @@ function BuildComboTool({ grid, strings, streaming, formatKickoff, initialTotal,
|
|
|
13258
13272
|
}
|
|
13259
13273
|
|
|
13260
13274
|
// src/usePresetDial.ts
|
|
13261
|
-
import { useCallback as useCallback22, useEffect as useEffect35, useRef as useRef31, useState as
|
|
13275
|
+
import { useCallback as useCallback22, useEffect as useEffect35, useRef as useRef31, useState as useState59 } from "react";
|
|
13262
13276
|
function sendInFlight(messages, isStreaming) {
|
|
13263
13277
|
const last = messages[messages.length - 1];
|
|
13264
13278
|
return isStreaming && !!last && last.role === "assistant" && !last.done && !last.isGreeting;
|
|
@@ -13272,7 +13286,7 @@ function lastUserId(messages) {
|
|
|
13272
13286
|
}
|
|
13273
13287
|
var SCROLL_KEYS = /* @__PURE__ */ new Set(["ArrowUp", "ArrowDown", "PageUp", "PageDown", "Home", "End", " "]);
|
|
13274
13288
|
function usePresetDial({ layerRef, dialRef, dialButtonRef, messages, isStreaming, activeTab }) {
|
|
13275
|
-
const [expanded, setExpanded] =
|
|
13289
|
+
const [expanded, setExpanded] = useState59(() => !sendInFlight(messages, isStreaming));
|
|
13276
13290
|
const fold = useCallback22(() => setExpanded(false), []);
|
|
13277
13291
|
const toggle = useCallback22(() => setExpanded((e) => !e), []);
|
|
13278
13292
|
const currentUserId = lastUserId(messages);
|
|
@@ -13358,7 +13372,7 @@ function markToolSeen() {
|
|
|
13358
13372
|
import { Fragment as Fragment34, jsx as jsx114, jsxs as jsxs98 } from "react/jsx-runtime";
|
|
13359
13373
|
var FULLSCREEN_QUERY = "(max-width: 639px)";
|
|
13360
13374
|
function useIsModal() {
|
|
13361
|
-
const [modal, setModal] =
|
|
13375
|
+
const [modal, setModal] = useState60(false);
|
|
13362
13376
|
useEffect36(() => {
|
|
13363
13377
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
|
|
13364
13378
|
const mql = window.matchMedia(FULLSCREEN_QUERY);
|
|
@@ -13373,8 +13387,8 @@ var HIDDEN_LAYER_STYLE = { position: "absolute", inset: 0, visibility: "hidden",
|
|
|
13373
13387
|
var SQUAD_LAYER_STYLE = { display: "flex", flexDirection: "column", flex: 1, minHeight: 0 };
|
|
13374
13388
|
function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, gamesResult, leaderboardResult, clubFixturesResult, clubStandingsResult, clubSquadResult, clubSquadStatsResult, clubPlayerDetailResult, loggedIn, conversation, presetGrid }) {
|
|
13375
13389
|
const { state, close, stop, send, reset } = controller;
|
|
13376
|
-
const [squadView, setSquadView] =
|
|
13377
|
-
const [selectedPlayerId, setSelectedPlayerId] =
|
|
13390
|
+
const [squadView, setSquadView] = useState60("roster");
|
|
13391
|
+
const [selectedPlayerId, setSelectedPlayerId] = useState60(null);
|
|
13378
13392
|
const clearPlayerDetail = clubPlayerDetailResult?.clear;
|
|
13379
13393
|
const fetchPlayerDetail = clubPlayerDetailResult?.fetch;
|
|
13380
13394
|
const squadLayerRef = useRef32(null);
|
|
@@ -13428,8 +13442,8 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
13428
13442
|
const limitRef = useRef32(null);
|
|
13429
13443
|
const typedSendRef = useRef32(false);
|
|
13430
13444
|
const focusAfterCloseRef = useRef32(null);
|
|
13431
|
-
const [tool, setTool] =
|
|
13432
|
-
const [toolSeen, setToolSeen] =
|
|
13445
|
+
const [tool, setTool] = useState60(null);
|
|
13446
|
+
const [toolSeen, setToolSeen] = useState60(readToolSeen);
|
|
13433
13447
|
const dial = usePresetDial({
|
|
13434
13448
|
layerRef,
|
|
13435
13449
|
dialRef,
|
|
@@ -15876,7 +15890,7 @@ function StatsWidget(props) {
|
|
|
15876
15890
|
[cfg?.operatorId, cfg?.userContext?.operatorUserId, cfg?.userContext?.anonymousUserId]
|
|
15877
15891
|
);
|
|
15878
15892
|
const controller = useChatStream(built?.conversation ?? emptyConversation(), ui.starters, built ? ui.greetingMessage : void 0, convStorageKey, cfg?.page, sportScope);
|
|
15879
|
-
const [hasToday, setHasToday] =
|
|
15893
|
+
const [hasToday, setHasToday] = useState61(false);
|
|
15880
15894
|
const liveCardWatches = useMemo7(() => {
|
|
15881
15895
|
const seen = /* @__PURE__ */ new Set();
|
|
15882
15896
|
const out = [];
|