@sensiblestats/widget-react 0.138.1 → 0.138.2
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 +8 -0
- package/dist/index.cjs +327 -312
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +163 -148
- package/dist/index.js.map +1 -1
- package/dist/styles.css +2 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/StatsWidget.tsx
|
|
2
|
-
import { useCallback as useCallback28, useEffect as useEffect54, useMemo as useMemo13, useRef as useRef46, useState as
|
|
2
|
+
import { useCallback as useCallback28, useEffect as useEffect54, useMemo as useMemo13, useRef as useRef46, useState as useState84 } from "react";
|
|
3
3
|
import { StatsWidgetClient } from "@sensiblestats/widget-sdk";
|
|
4
4
|
|
|
5
5
|
// src/strings/tag.ts
|
|
@@ -1298,7 +1298,7 @@ function parseOddsFormat(value) {
|
|
|
1298
1298
|
}
|
|
1299
1299
|
|
|
1300
1300
|
// src/version.generated.ts
|
|
1301
|
-
var WIDGET_REACT_VERSION = "0.138.
|
|
1301
|
+
var WIDGET_REACT_VERSION = "0.138.2";
|
|
1302
1302
|
|
|
1303
1303
|
// src/config.ts
|
|
1304
1304
|
function hostTag(cfg) {
|
|
@@ -2462,6 +2462,9 @@ function toNflInsightVM(card) {
|
|
|
2462
2462
|
competition: str(card.competitionName),
|
|
2463
2463
|
kickoffLabel: str(card.kickoffLabel),
|
|
2464
2464
|
kickoffUtc: str(card.kickoffUtc) ?? null,
|
|
2465
|
+
homeTeamImage: str(card.homeTeamImagePath),
|
|
2466
|
+
awayTeamImage: str(card.awayTeamImagePath),
|
|
2467
|
+
competitionImage: str(card.competitionImagePath),
|
|
2465
2468
|
addToSlipEnabled: card.addToSlipEnabled === true,
|
|
2466
2469
|
disclaimer: str(card.disclaimer),
|
|
2467
2470
|
selections,
|
|
@@ -7814,7 +7817,7 @@ function ChatFab({ label, busy = false, greeting, popupText, logoUrl, onOpen, on
|
|
|
7814
7817
|
}
|
|
7815
7818
|
|
|
7816
7819
|
// src/components/ChatPanel.tsx
|
|
7817
|
-
import { useCallback as useCallback27, useEffect as useEffect53, useLayoutEffect as useLayoutEffect2, useMemo as useMemo12, useRef as useRef45, useState as
|
|
7820
|
+
import { useCallback as useCallback27, useEffect as useEffect53, useLayoutEffect as useLayoutEffect2, useMemo as useMemo12, useRef as useRef45, useState as useState83 } from "react";
|
|
7818
7821
|
|
|
7819
7822
|
// src/components/ChatHeader.tsx
|
|
7820
7823
|
import { useEffect as useEffect29, useRef as useRef25, useState as useState35 } from "react";
|
|
@@ -7935,7 +7938,7 @@ function ChatHeader({
|
|
|
7935
7938
|
import { useEffect as useEffect33, useRef as useRef28 } from "react";
|
|
7936
7939
|
|
|
7937
7940
|
// src/components/ChatMessage.tsx
|
|
7938
|
-
import { useState as
|
|
7941
|
+
import { useState as useState46 } from "react";
|
|
7939
7942
|
|
|
7940
7943
|
// src/components/Markdown.tsx
|
|
7941
7944
|
import ReactMarkdown from "react-markdown";
|
|
@@ -8883,6 +8886,9 @@ function NbaInsightList({ insights, ui, slip, monitor }) {
|
|
|
8883
8886
|
return /* @__PURE__ */ jsx38("div", { className: "ss-w-nba-cards", children: insights.map((vm, i) => /* @__PURE__ */ jsx38(NbaCard, { vm, ui, slip, monitor }, `${vm.id}:${i}`)) });
|
|
8884
8887
|
}
|
|
8885
8888
|
|
|
8889
|
+
// src/components/NflInsightList.tsx
|
|
8890
|
+
import { useState as useState38 } from "react";
|
|
8891
|
+
|
|
8886
8892
|
// src/strings/types.ts
|
|
8887
8893
|
var fillNfl = (template, values) => template.replace(/\{(\w+)\}/g, (whole, key) => key in values ? String(values[key]) : whole);
|
|
8888
8894
|
|
|
@@ -8891,7 +8897,11 @@ import { Fragment as Fragment8, jsx as jsx39, jsxs as jsxs34 } from "react/jsx-r
|
|
|
8891
8897
|
var oneDecimal2 = (n, ui) => formatNumber(n, ui.locale, { minimumFractionDigits: 1, maximumFractionDigits: 1 });
|
|
8892
8898
|
var cap = (text2, ui) => text2 ? upperCase(text2.charAt(0), ui.locale) + text2.slice(1) : text2;
|
|
8893
8899
|
var lineNumber = (line) => Number(line.replace("\u2212", "-").replace(",", "."));
|
|
8894
|
-
function Badge({ abbr }) {
|
|
8900
|
+
function Badge({ abbr, url }) {
|
|
8901
|
+
const [failed, setFailed] = useState38(false);
|
|
8902
|
+
if (url && !failed) {
|
|
8903
|
+
return /* @__PURE__ */ jsx39("img", { className: "ss-w-nfl-badge ss-w-nfl-badge--img", src: url, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
8904
|
+
}
|
|
8895
8905
|
return /* @__PURE__ */ jsx39("span", { className: "ss-w-nfl-badge", children: abbr });
|
|
8896
8906
|
}
|
|
8897
8907
|
function Price({ vm, selection, label, ui, slip, nowMs }) {
|
|
@@ -8932,12 +8942,12 @@ function Head2({ vm, ui, monitor }) {
|
|
|
8932
8942
|
/* @__PURE__ */ jsxs34("div", { className: "ss-w-nfl-head-l", children: [
|
|
8933
8943
|
/* @__PURE__ */ jsxs34("p", { className: "ss-w-nfl-meta", children: [
|
|
8934
8944
|
/* @__PURE__ */ jsxs34("span", { className: "ss-w-nfl-side", children: [
|
|
8935
|
-
/* @__PURE__ */ jsx39(Badge, { abbr: vm.homeAbbr }),
|
|
8945
|
+
/* @__PURE__ */ jsx39(Badge, { abbr: vm.homeAbbr, url: vm.homeTeamImage }),
|
|
8936
8946
|
vm.homeTeamName ? /* @__PURE__ */ jsx39("span", { children: vm.homeTeamName }) : null
|
|
8937
8947
|
] }),
|
|
8938
8948
|
/* @__PURE__ */ jsx39("span", { className: "ss-w-nfl-sep", "aria-hidden": "true", children: "\xB7" }),
|
|
8939
8949
|
/* @__PURE__ */ jsxs34("span", { className: "ss-w-nfl-side", children: [
|
|
8940
|
-
/* @__PURE__ */ jsx39(Badge, { abbr: vm.awayAbbr }),
|
|
8950
|
+
/* @__PURE__ */ jsx39(Badge, { abbr: vm.awayAbbr, url: vm.awayTeamImage }),
|
|
8941
8951
|
vm.awayTeamName ? /* @__PURE__ */ jsx39("span", { children: vm.awayTeamName }) : null
|
|
8942
8952
|
] }),
|
|
8943
8953
|
vm.kickoffLabel ? /* @__PURE__ */ jsx39("span", { className: "ss-w-nfl-kick", children: vm.kickoffLabel }) : null
|
|
@@ -9011,8 +9021,8 @@ function LineMove2({ vm, lm, ui, slip, nowMs }) {
|
|
|
9011
9021
|
const nfl = ui.nfl;
|
|
9012
9022
|
const { oddsFormat } = useOddsSettings();
|
|
9013
9023
|
const who = (side) => {
|
|
9014
|
-
if (side === "home") return /* @__PURE__ */ jsx39(Badge, { abbr: vm.homeAbbr });
|
|
9015
|
-
if (side === "away") return /* @__PURE__ */ jsx39(Badge, { abbr: vm.awayAbbr });
|
|
9024
|
+
if (side === "home") return /* @__PURE__ */ jsx39(Badge, { abbr: vm.homeAbbr, url: vm.homeTeamImage });
|
|
9025
|
+
if (side === "away") return /* @__PURE__ */ jsx39(Badge, { abbr: vm.awayAbbr, url: vm.awayTeamImage });
|
|
9016
9026
|
return cap(side === "under" ? nfl.under : nfl.over, ui);
|
|
9017
9027
|
};
|
|
9018
9028
|
return /* @__PURE__ */ jsxs34("div", { className: "ss-w-nfl-lm", children: [
|
|
@@ -9499,7 +9509,7 @@ function TennisInsightList({ insights, ui }) {
|
|
|
9499
9509
|
}
|
|
9500
9510
|
|
|
9501
9511
|
// src/components/CompactOddsList.tsx
|
|
9502
|
-
import { useEffect as useEffect30, useRef as useRef26, useState as
|
|
9512
|
+
import { useEffect as useEffect30, useRef as useRef26, useState as useState39 } from "react";
|
|
9503
9513
|
import { mayPinOrSlip as mayPinOrSlip5, slipSportOf as slipSportOf6, sportOf as sportOf10 } from "@sensiblestats/widget-sdk";
|
|
9504
9514
|
|
|
9505
9515
|
// src/compactList.ts
|
|
@@ -9621,9 +9631,9 @@ function Row({ row, columns, ui, slip, monitor, rowRef }) {
|
|
|
9621
9631
|
] });
|
|
9622
9632
|
}
|
|
9623
9633
|
function CompactOddsList({ list, ui, slip, monitor }) {
|
|
9624
|
-
const [shown2, setShown] =
|
|
9634
|
+
const [shown2, setShown] = useState39(COMPACT_PAGE);
|
|
9625
9635
|
const hidden = list.rowCount - shown2;
|
|
9626
|
-
const [focusIndex, setFocusIndex] =
|
|
9636
|
+
const [focusIndex, setFocusIndex] = useState39(null);
|
|
9627
9637
|
const focusRef = useRef26(null);
|
|
9628
9638
|
useEffect30(() => {
|
|
9629
9639
|
if (focusIndex !== null) focusRef.current?.focus();
|
|
@@ -9860,7 +9870,7 @@ function FixtureCard({ card, ui }) {
|
|
|
9860
9870
|
}
|
|
9861
9871
|
|
|
9862
9872
|
// src/components/dashboard/CountdownCard.tsx
|
|
9863
|
-
import { Fragment as Fragment12, useEffect as useEffect31, useState as
|
|
9873
|
+
import { Fragment as Fragment12, useEffect as useEffect31, useState as useState40 } from "react";
|
|
9864
9874
|
import { jsx as jsx45, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
9865
9875
|
var DAY_MS3 = 864e5;
|
|
9866
9876
|
function remainingSegments(kickoffUnix, nowMs, withSeconds) {
|
|
@@ -9879,8 +9889,8 @@ function remainingSegments(kickoffUnix, nowMs, withSeconds) {
|
|
|
9879
9889
|
function CountdownCard({ card, ui }) {
|
|
9880
9890
|
const { data } = card;
|
|
9881
9891
|
const unitLabel = { d: data.daysUnit, h: data.hoursUnit, m: data.minutesUnit, s: data.secondsUnit };
|
|
9882
|
-
const [nowMs, setNowMs] =
|
|
9883
|
-
const [reduced] =
|
|
9892
|
+
const [nowMs, setNowMs] = useState40(() => Date.now());
|
|
9893
|
+
const [reduced] = useState40(
|
|
9884
9894
|
() => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches
|
|
9885
9895
|
);
|
|
9886
9896
|
const withinDay = data.kickoffUnix * 1e3 - nowMs < DAY_MS3;
|
|
@@ -9903,7 +9913,7 @@ function CountdownCard({ card, ui }) {
|
|
|
9903
9913
|
}
|
|
9904
9914
|
|
|
9905
9915
|
// src/components/dashboard/InjuriesCard.tsx
|
|
9906
|
-
import { useState as
|
|
9916
|
+
import { useState as useState41 } from "react";
|
|
9907
9917
|
import { jsx as jsx46, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
9908
9918
|
var SHOWN = 3;
|
|
9909
9919
|
function ColHead({ name, crestUrl }) {
|
|
@@ -9926,7 +9936,7 @@ function InjuryList({ rows, emptyLabel, limit }) {
|
|
|
9926
9936
|
}
|
|
9927
9937
|
function InjuriesCard({ card, ui }) {
|
|
9928
9938
|
const { data } = card;
|
|
9929
|
-
const [expanded, setExpanded] =
|
|
9939
|
+
const [expanded, setExpanded] = useState41(false);
|
|
9930
9940
|
const hidden = Math.max(0, data.ours.length - SHOWN) + Math.max(0, data.theirs.length - SHOWN);
|
|
9931
9941
|
const limit = expanded ? void 0 : SHOWN;
|
|
9932
9942
|
const { showMore, showLess } = ui;
|
|
@@ -10031,7 +10041,7 @@ function LinksCard({ card }) {
|
|
|
10031
10041
|
}
|
|
10032
10042
|
|
|
10033
10043
|
// src/components/dashboard/PostMatchResultCard.tsx
|
|
10034
|
-
import { useState as
|
|
10044
|
+
import { useState as useState42 } from "react";
|
|
10035
10045
|
import { jsx as jsx52, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
10036
10046
|
function initials3(name) {
|
|
10037
10047
|
return name.trim().slice(0, 3).toUpperCase();
|
|
@@ -10041,7 +10051,7 @@ function PostMatchCrest({
|
|
|
10041
10051
|
name,
|
|
10042
10052
|
side
|
|
10043
10053
|
}) {
|
|
10044
|
-
const [failed, setFailed] =
|
|
10054
|
+
const [failed, setFailed] = useState42(false);
|
|
10045
10055
|
const cls = `ss-w-fandash-postmatch-crest ss-w-fandash-postmatch-crest--${side}`;
|
|
10046
10056
|
if (url && !failed) {
|
|
10047
10057
|
return /* @__PURE__ */ jsx52("img", { className: cls, src: url, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
@@ -10240,10 +10250,10 @@ function RestingFormCard({ card }) {
|
|
|
10240
10250
|
}
|
|
10241
10251
|
|
|
10242
10252
|
// src/components/dashboard/LiveScoreCard.tsx
|
|
10243
|
-
import { useRef as useRef27, useState as
|
|
10253
|
+
import { useRef as useRef27, useState as useState44 } from "react";
|
|
10244
10254
|
|
|
10245
10255
|
// src/useLiveClock.ts
|
|
10246
|
-
import { useEffect as useEffect32, useState as
|
|
10256
|
+
import { useEffect as useEffect32, useState as useState43 } from "react";
|
|
10247
10257
|
var TICK_MS = 6e4;
|
|
10248
10258
|
var MAX_LIVE_TICK_MINUTES = 15;
|
|
10249
10259
|
function computeDisplayMinute(minute, clockRunning, receivedAtMs) {
|
|
@@ -10252,7 +10262,7 @@ function computeDisplayMinute(minute, clockRunning, receivedAtMs) {
|
|
|
10252
10262
|
return minute + Math.min(Math.max(0, elapsedMinutes), MAX_LIVE_TICK_MINUTES);
|
|
10253
10263
|
}
|
|
10254
10264
|
function useLiveClock(minute, clockRunning, receivedAtMs) {
|
|
10255
|
-
const [displayMinute, setDisplayMinute] =
|
|
10265
|
+
const [displayMinute, setDisplayMinute] = useState43(
|
|
10256
10266
|
() => computeDisplayMinute(minute, clockRunning, receivedAtMs)
|
|
10257
10267
|
);
|
|
10258
10268
|
useEffect32(() => {
|
|
@@ -10272,7 +10282,7 @@ function initials5(name) {
|
|
|
10272
10282
|
return name.trim().slice(0, 3).toUpperCase();
|
|
10273
10283
|
}
|
|
10274
10284
|
function LiveCrest({ url, name, side }) {
|
|
10275
|
-
const [failed, setFailed] =
|
|
10285
|
+
const [failed, setFailed] = useState44(false);
|
|
10276
10286
|
const cls = `ss-w-fandash-live-crest ss-w-fandash-live-crest--${side}`;
|
|
10277
10287
|
if (url && !failed) {
|
|
10278
10288
|
return /* @__PURE__ */ jsx61("img", { className: cls, src: url, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
@@ -10340,7 +10350,7 @@ function LiveScoreCard({
|
|
|
10340
10350
|
}
|
|
10341
10351
|
|
|
10342
10352
|
// src/components/dashboard/LiveTimelineCard.tsx
|
|
10343
|
-
import { useState as
|
|
10353
|
+
import { useState as useState45 } from "react";
|
|
10344
10354
|
import { jsx as jsx62, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
10345
10355
|
var SHOWN2 = 3;
|
|
10346
10356
|
function EventIcon({ type }) {
|
|
@@ -10382,7 +10392,7 @@ function EventRow({ e }) {
|
|
|
10382
10392
|
] });
|
|
10383
10393
|
}
|
|
10384
10394
|
function LiveTimelineCard({ card, ui }) {
|
|
10385
|
-
const [expanded, setExpanded] =
|
|
10395
|
+
const [expanded, setExpanded] = useState45(false);
|
|
10386
10396
|
const events = card.data.events;
|
|
10387
10397
|
if (!events || events.length === 0) return null;
|
|
10388
10398
|
const sorted = [...events].sort((a, b) => b.minute - a.minute);
|
|
@@ -10581,7 +10591,7 @@ function FanDashboardCard({ card, onTap, ui, goalEvents }) {
|
|
|
10581
10591
|
// src/components/ChatMessage.tsx
|
|
10582
10592
|
import { jsx as jsx66, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
10583
10593
|
function ChatMessage({ message, disabled, onAct, onTap, ui, slip, monitor, onGreetingSport }) {
|
|
10584
|
-
const [sport, setSport] =
|
|
10594
|
+
const [sport, setSport] = useState46(null);
|
|
10585
10595
|
if (message.role === "user") {
|
|
10586
10596
|
return /* @__PURE__ */ jsx66("div", { className: "ss-w-msg ss-w-user", "data-msg-id": message.id, children: /* @__PURE__ */ jsx66("div", { className: "ss-w-bubble", children: message.text }) });
|
|
10587
10597
|
}
|
|
@@ -10698,10 +10708,10 @@ function MessageList({ controller, ui, slip, onDashboardTap, monitor, onGreeting
|
|
|
10698
10708
|
}
|
|
10699
10709
|
|
|
10700
10710
|
// src/components/ChatInput.tsx
|
|
10701
|
-
import { forwardRef, useEffect as useEffect34, useImperativeHandle, useRef as useRef29, useState as
|
|
10711
|
+
import { forwardRef, useEffect as useEffect34, useImperativeHandle, useRef as useRef29, useState as useState47 } from "react";
|
|
10702
10712
|
import { jsx as jsx69, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
10703
10713
|
var ChatInput = forwardRef(function ChatInput2({ placeholder, streaming, onSend, onStop, stopLabel, sendLabel, disabled = false }, ref) {
|
|
10704
|
-
const [value, setValue] =
|
|
10714
|
+
const [value, setValue] = useState47("");
|
|
10705
10715
|
const textareaRef = useRef29(null);
|
|
10706
10716
|
const stopRef = useRef29(null);
|
|
10707
10717
|
const textBoxWantsFocusRef = useRef29(false);
|
|
@@ -10902,7 +10912,7 @@ function MarketAccordion({ match, monitor, ui, slip }) {
|
|
|
10902
10912
|
}
|
|
10903
10913
|
|
|
10904
10914
|
// src/components/MonitorFormH2H.tsx
|
|
10905
|
-
import { useState as
|
|
10915
|
+
import { useState as useState48 } from "react";
|
|
10906
10916
|
import { Fragment as Fragment14, jsx as jsx72, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
10907
10917
|
function resultClass2(result) {
|
|
10908
10918
|
if (result === "W") return "ss-w-h2h-result--win";
|
|
@@ -10918,7 +10928,7 @@ function FormDots({ form, ui }) {
|
|
|
10918
10928
|
return /* @__PURE__ */ jsx72("div", { className: "ss-w-h2h-dots", children: form.map((m, i) => /* @__PURE__ */ jsx72("span", { className: `ss-w-h2h-result ${resultClass2(m.result)}`, children: resultLabel(m.result, ui) }, i)) });
|
|
10919
10929
|
}
|
|
10920
10930
|
function MonitorFormH2H({ formAndH2H, homeTeamName, awayTeamName, ui }) {
|
|
10921
|
-
const [expanded, setExpanded] =
|
|
10931
|
+
const [expanded, setExpanded] = useState48(false);
|
|
10922
10932
|
const { homeForm, awayForm, h2h, homeShortCode, awayShortCode } = formAndH2H;
|
|
10923
10933
|
if (homeForm.length === 0 && awayForm.length === 0 && !h2h) {
|
|
10924
10934
|
return /* @__PURE__ */ jsx72(Fragment14, {});
|
|
@@ -11145,7 +11155,7 @@ function MonitorSkeleton({ pin, monitor, ui }) {
|
|
|
11145
11155
|
}
|
|
11146
11156
|
|
|
11147
11157
|
// src/components/NbaMonitorCard.tsx
|
|
11148
|
-
import { useState as
|
|
11158
|
+
import { useState as useState52 } from "react";
|
|
11149
11159
|
|
|
11150
11160
|
// src/sportLabel.ts
|
|
11151
11161
|
var CODE = { football: "football", basketball: "nba", nba: "nba", americanfootball: "nfl", nfl: "nfl", tennis: "tennis" };
|
|
@@ -11155,7 +11165,7 @@ var sportLabel = (ui, sport) => {
|
|
|
11155
11165
|
};
|
|
11156
11166
|
|
|
11157
11167
|
// src/components/NbaFormSection.tsx
|
|
11158
|
-
import { useState as
|
|
11168
|
+
import { useState as useState49 } from "react";
|
|
11159
11169
|
|
|
11160
11170
|
// src/components/NbaFormRest.tsx
|
|
11161
11171
|
import { jsx as jsx75, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
@@ -11254,8 +11264,8 @@ function Row2({ game, abbr, tonight, ui }) {
|
|
|
11254
11264
|
] });
|
|
11255
11265
|
}
|
|
11256
11266
|
function NbaFormSection({ match, monitor, ui }) {
|
|
11257
|
-
const [open, setOpen] =
|
|
11258
|
-
const [side, setSide] =
|
|
11267
|
+
const [open, setOpen] = useState49(false);
|
|
11268
|
+
const [side, setSide] = useState49("away");
|
|
11259
11269
|
const form = useNbaForm(match, monitor);
|
|
11260
11270
|
const b = match.basketball;
|
|
11261
11271
|
if (!form || !b || !form.home && !form.away) return null;
|
|
@@ -11297,10 +11307,10 @@ function NbaFormSection({ match, monitor, ui }) {
|
|
|
11297
11307
|
}
|
|
11298
11308
|
|
|
11299
11309
|
// src/components/NbaPropsSection.tsx
|
|
11300
|
-
import { useEffect as useEffect37, useState as
|
|
11310
|
+
import { useEffect as useEffect37, useState as useState51 } from "react";
|
|
11301
11311
|
|
|
11302
11312
|
// src/components/PropsPieces.tsx
|
|
11303
|
-
import { useEffect as useEffect36, useState as
|
|
11313
|
+
import { useEffect as useEffect36, useState as useState50 } from "react";
|
|
11304
11314
|
import { Fragment as Fragment15, jsx as jsx77, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
11305
11315
|
var livePlayer = (bundle, p) => bundle.live === true || !p.live && !p.nflLive ? p : { ...p, live: null, nflLive: null };
|
|
11306
11316
|
var hasLiveLine = (p) => p.live != null || p.nflLive != null;
|
|
@@ -11313,7 +11323,7 @@ function preKickoff(match) {
|
|
|
11313
11323
|
return Number.isFinite(kickoff) && Date.now() < kickoff;
|
|
11314
11324
|
}
|
|
11315
11325
|
function usePreKickoff(match) {
|
|
11316
|
-
const [, setTick] =
|
|
11326
|
+
const [, setTick] = useState50(0);
|
|
11317
11327
|
const pre = preKickoff(match);
|
|
11318
11328
|
useEffect36(() => {
|
|
11319
11329
|
if (!pre || !match.kickoffUtc) return;
|
|
@@ -11407,7 +11417,7 @@ function PropBars({ bars, line, title, wide, ui, note }) {
|
|
|
11407
11417
|
function PropPlayerPanel({ player: given, bundle, descriptor, ui, slip }) {
|
|
11408
11418
|
const player = livePlayer(bundle, given);
|
|
11409
11419
|
const stats = descriptor.stats.map((k) => player.stats.find((s) => s.stat === k)).filter((s) => s != null);
|
|
11410
|
-
const [picked, setPicked] =
|
|
11420
|
+
const [picked, setPicked] = useState50(null);
|
|
11411
11421
|
const active = stats.find((s) => s.stat === picked) ?? stats[0];
|
|
11412
11422
|
const sample = active?.games?.length ?? 0;
|
|
11413
11423
|
const hitsOf = (price, text2) => descriptor.showHits && sample > 0 && price.hits != null ? text2(price.hits) : null;
|
|
@@ -11456,8 +11466,8 @@ function PropPlayerPanel({ player: given, bundle, descriptor, ui, slip }) {
|
|
|
11456
11466
|
] });
|
|
11457
11467
|
}
|
|
11458
11468
|
function PropRoster({ bundle, players, side, descriptor, ui, slip }) {
|
|
11459
|
-
const [openId, setOpenId] =
|
|
11460
|
-
const [brokenShots, setBrokenShots] =
|
|
11469
|
+
const [openId, setOpenId] = useState50(null);
|
|
11470
|
+
const [brokenShots, setBrokenShots] = useState50(/* @__PURE__ */ new Set());
|
|
11461
11471
|
return /* @__PURE__ */ jsx77("div", { className: "ss-w-props-list", children: players.map((given) => {
|
|
11462
11472
|
const p = livePlayer(bundle, given);
|
|
11463
11473
|
const isOpen = openId === p.playerId;
|
|
@@ -11503,7 +11513,7 @@ function PropRoster({ bundle, players, side, descriptor, ui, slip }) {
|
|
|
11503
11513
|
}
|
|
11504
11514
|
var BOX_QUIET_MS = 12e4;
|
|
11505
11515
|
function StatsClock({ boxAsOfUtc, match, live, atBreak: atBreak2, ago, ui }) {
|
|
11506
|
-
const [tick, setTick] =
|
|
11516
|
+
const [tick, setTick] = useState50(0);
|
|
11507
11517
|
const time = clock2(boxAsOfUtc, ui);
|
|
11508
11518
|
const at2 = time === "" ? Number.NaN : Date.parse(boxAsOfUtc);
|
|
11509
11519
|
const valid = !Number.isNaN(at2);
|
|
@@ -11569,7 +11579,7 @@ var nbaDescriptor = (ui, match) => ({
|
|
|
11569
11579
|
tenGameBars: false
|
|
11570
11580
|
});
|
|
11571
11581
|
function StatsClock2({ bundle, match, ui }) {
|
|
11572
|
-
const [tick, setTick] =
|
|
11582
|
+
const [tick, setTick] = useState51(0);
|
|
11573
11583
|
const at2 = bundle.live === true && bundle.boxAsOfUtc ? Date.parse(bundle.boxAsOfUtc) : Number.NaN;
|
|
11574
11584
|
const time = clock2(bundle.boxAsOfUtc, ui);
|
|
11575
11585
|
const valid = !Number.isNaN(at2) && time !== "";
|
|
@@ -11588,7 +11598,7 @@ function StatsClock2({ bundle, match, ui }) {
|
|
|
11588
11598
|
return /* @__PURE__ */ jsx78("span", { className: "ss-w-props-asof ss-w-props-asof--live", children: ui.nba.propsStatsLive(time) });
|
|
11589
11599
|
}
|
|
11590
11600
|
function NbaPropsSection({ match, monitor, ui, slip }) {
|
|
11591
|
-
const [side, setSide] =
|
|
11601
|
+
const [side, setSide] = useState51("home");
|
|
11592
11602
|
const descriptor = nbaDescriptor(ui, match);
|
|
11593
11603
|
const { bundle, live, open } = usePropsOpen(match, monitor, descriptor);
|
|
11594
11604
|
if (!open || !bundle || bundle.players.length === 0 || (bundle.live ?? false) !== live) return null;
|
|
@@ -11626,7 +11636,7 @@ function city(teamName, nickname) {
|
|
|
11626
11636
|
return name.slice(0, name.length - nickname.length).trim() || null;
|
|
11627
11637
|
}
|
|
11628
11638
|
function BadgeCrest({ url, abbreviation }) {
|
|
11629
|
-
const [failed, setFailed] =
|
|
11639
|
+
const [failed, setFailed] = useState52(false);
|
|
11630
11640
|
if (url && !failed) {
|
|
11631
11641
|
return /* @__PURE__ */ jsx79("img", { className: "ss-w-nbamon-badge ss-w-nbamon-badge--img", src: url, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
11632
11642
|
}
|
|
@@ -11744,7 +11754,7 @@ function NbaMonitorCard({ match, monitor, ui, slip }) {
|
|
|
11744
11754
|
}
|
|
11745
11755
|
|
|
11746
11756
|
// src/components/NflFormSection.tsx
|
|
11747
|
-
import { useState as
|
|
11757
|
+
import { useState as useState53 } from "react";
|
|
11748
11758
|
import { Fragment as Fragment17, jsx as jsx80, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
11749
11759
|
var outcomeOf = (g) => g.teamScore > g.opponentScore ? "win" : g.teamScore < g.opponentScore ? "loss" : "tie";
|
|
11750
11760
|
var signedSpread2 = (v) => v > 0 ? `+${v}` : String(v);
|
|
@@ -11796,7 +11806,7 @@ function H2hRow({ game, home, ui }) {
|
|
|
11796
11806
|
] });
|
|
11797
11807
|
}
|
|
11798
11808
|
function NflFormSection({ match, monitor, ui }) {
|
|
11799
|
-
const [segment, setSegment] =
|
|
11809
|
+
const [segment, setSegment] = useState53("away");
|
|
11800
11810
|
const { live, open } = usePropsOpen(match, monitor, { sport: "americanfootball" });
|
|
11801
11811
|
const bundle = monitor.playerProps?.[monitorMatchKey("americanfootball", match.matchId)]?.bundle;
|
|
11802
11812
|
const form = bundle?.form;
|
|
@@ -11829,7 +11839,7 @@ function NflFormSection({ match, monitor, ui }) {
|
|
|
11829
11839
|
}
|
|
11830
11840
|
|
|
11831
11841
|
// src/components/NflPropsSection.tsx
|
|
11832
|
-
import { useState as
|
|
11842
|
+
import { useState as useState54 } from "react";
|
|
11833
11843
|
import { Fragment as Fragment18, jsx as jsx81, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
11834
11844
|
var TRENDS_SHOWN = 3;
|
|
11835
11845
|
var SCORERS_SHOWN = 8;
|
|
@@ -11902,7 +11912,7 @@ function ShowMore({ label, onClick }) {
|
|
|
11902
11912
|
return /* @__PURE__ */ jsx81("button", { type: "button", className: "ss-w-props-more", onClick, children: label });
|
|
11903
11913
|
}
|
|
11904
11914
|
function Trends({ bundle, facts, descriptor, ui, slip }) {
|
|
11905
|
-
const [all, setAll] =
|
|
11915
|
+
const [all, setAll] = useState54(false);
|
|
11906
11916
|
const shown2 = all ? facts : facts.slice(0, TRENDS_SHOWN);
|
|
11907
11917
|
return /* @__PURE__ */ jsxs75("section", { className: "ss-w-props ss-w-props-trends", lang: ui.locale, children: [
|
|
11908
11918
|
/* @__PURE__ */ jsx81("div", { className: "ss-w-props-head", children: ui.nfl.propsTrends }),
|
|
@@ -11935,7 +11945,7 @@ function Trends({ bundle, facts, descriptor, ui, slip }) {
|
|
|
11935
11945
|
] });
|
|
11936
11946
|
}
|
|
11937
11947
|
function Scorers({ bundle, scorers, abbreviations, descriptor, ui, slip }) {
|
|
11938
|
-
const [all, setAll] =
|
|
11948
|
+
const [all, setAll] = useState54(false);
|
|
11939
11949
|
const shown2 = all ? scorers : scorers.slice(0, SCORERS_SHOWN);
|
|
11940
11950
|
const cell2 = (name, column, price, stat) => price && stat ? /* @__PURE__ */ jsx81(PropPrice, { price, label: "", ariaName: `${name}, ${column}`, player: name, stat, bundle, descriptor, ui, slip }) : /* @__PURE__ */ jsx81("span", { className: "ss-w-props-scorer-none", children: "\u2014" });
|
|
11941
11951
|
return /* @__PURE__ */ jsxs75("div", { className: "ss-w-props-scorers", children: [
|
|
@@ -11949,9 +11959,12 @@ function Scorers({ bundle, scorers, abbreviations, descriptor, ui, slip }) {
|
|
|
11949
11959
|
const sample = s.anytimeStat.games?.length ?? 0;
|
|
11950
11960
|
const meta = sample > 0 && s.anytime.hits != null ? `${abbreviations[s.player.side]} \xB7 ${fillNfl(ui.nfl.propsScoredIn, { h: s.anytime.hits, n: sample })}` : abbreviations[s.player.side];
|
|
11951
11961
|
return /* @__PURE__ */ jsxs75("div", { className: "ss-w-props-scorer", children: [
|
|
11952
|
-
/* @__PURE__ */ jsxs75("span", { className: "ss-w-props-
|
|
11953
|
-
/* @__PURE__ */ jsx81(
|
|
11954
|
-
/* @__PURE__ */
|
|
11962
|
+
/* @__PURE__ */ jsxs75("span", { className: "ss-w-props-scorer-who", children: [
|
|
11963
|
+
/* @__PURE__ */ jsx81(Pic, { src: s.player.imagePath, kind: "player" }),
|
|
11964
|
+
/* @__PURE__ */ jsxs75("span", { className: "ss-w-props-pn", children: [
|
|
11965
|
+
/* @__PURE__ */ jsx81("span", { className: "ss-w-props-scorer-name", children: s.player.name }),
|
|
11966
|
+
/* @__PURE__ */ jsx81("span", { className: "ss-w-props-scorer-meta", children: meta })
|
|
11967
|
+
] })
|
|
11955
11968
|
] }),
|
|
11956
11969
|
cell2(s.player.name, ui.nfl.propsAnytime, s.anytime, s.anytimeStat),
|
|
11957
11970
|
cell2(s.player.name, "2+", s.two, s.anytimeStat),
|
|
@@ -11962,7 +11975,7 @@ function Scorers({ bundle, scorers, abbreviations, descriptor, ui, slip }) {
|
|
|
11962
11975
|
] });
|
|
11963
11976
|
}
|
|
11964
11977
|
function NflPropsSection({ match, monitor, ui, slip }) {
|
|
11965
|
-
const [tab, setTab] =
|
|
11978
|
+
const [tab, setTab] = useState54(null);
|
|
11966
11979
|
const descriptor = nflDescriptor(ui);
|
|
11967
11980
|
const { bundle, live, open } = usePropsOpen(match, monitor, descriptor);
|
|
11968
11981
|
if (!open || !bundle || bundle.players.length === 0 || (bundle.live ?? false) !== live) return null;
|
|
@@ -12104,13 +12117,13 @@ function NflMonitorCard({ match, monitor, ui, slip }) {
|
|
|
12104
12117
|
/* @__PURE__ */ jsx84(PinToggle, { ui, monitor, pin: { kind: "match", matchId: match.matchId, sport: "americanfootball" } })
|
|
12105
12118
|
] }),
|
|
12106
12119
|
/* @__PURE__ */ jsxs78("div", { className: "ss-w-nbamon-main", children: [
|
|
12107
|
-
/* @__PURE__ */ jsx84(Side, { abbreviation: f.awayAbbreviation, nickname: f.awayNickname, teamName: match.awayTeamName, away: true }),
|
|
12120
|
+
/* @__PURE__ */ jsx84(Side, { abbreviation: f.awayAbbreviation, nickname: f.awayNickname, teamName: match.awayTeamName, crestUrl: match.awayCrestUrl, away: true }),
|
|
12108
12121
|
scored ? /* @__PURE__ */ jsxs78("span", { className: "ss-w-mon-score", children: [
|
|
12109
12122
|
match.awayScore ?? 0,
|
|
12110
12123
|
/* @__PURE__ */ jsx84("i", { children: "\u2013" }),
|
|
12111
12124
|
match.homeScore ?? 0
|
|
12112
12125
|
] }) : /* @__PURE__ */ jsx84("span", { className: "ss-w-mon-vs", children: ui.venue.away }),
|
|
12113
|
-
/* @__PURE__ */ jsx84(Side, { abbreviation: f.homeAbbreviation, nickname: f.homeNickname, teamName: match.homeTeamName })
|
|
12126
|
+
/* @__PURE__ */ jsx84(Side, { abbreviation: f.homeAbbreviation, nickname: f.homeNickname, teamName: match.homeTeamName, crestUrl: match.homeCrestUrl })
|
|
12114
12127
|
] }),
|
|
12115
12128
|
scored && /* @__PURE__ */ jsxs78("table", { className: "ss-w-nbamon-ls", children: [
|
|
12116
12129
|
/* @__PURE__ */ jsx84("thead", { children: /* @__PURE__ */ jsxs78("tr", { children: [
|
|
@@ -12155,7 +12168,7 @@ import { toWireSport as toWireSport5 } from "@sensiblestats/widget-sdk";
|
|
|
12155
12168
|
import { matchKey as matchKey4 } from "@sensiblestats/widget-sdk";
|
|
12156
12169
|
|
|
12157
12170
|
// src/components/FixtureRow.tsx
|
|
12158
|
-
import { useState as
|
|
12171
|
+
import { useState as useState55 } from "react";
|
|
12159
12172
|
import { slipSportOf as slipSportOf8 } from "@sensiblestats/widget-sdk";
|
|
12160
12173
|
import { Fragment as Fragment20, jsx as jsx85, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
12161
12174
|
function splitAtFirstSpace(label) {
|
|
@@ -12169,7 +12182,7 @@ function kickoffLabel(kickoffUnix, tag2, clock3, timeZone) {
|
|
|
12169
12182
|
return formatTime(kickoffUnix * 1e3, tag2, clock3, { timeZone });
|
|
12170
12183
|
}
|
|
12171
12184
|
function Side2({ name, crest, abbr, away = false }) {
|
|
12172
|
-
const [failed, setFailed] =
|
|
12185
|
+
const [failed, setFailed] = useState55(false);
|
|
12173
12186
|
return /* @__PURE__ */ jsxs79("span", { className: away ? "ss-w-drow-side ss-w-drow-side--away" : "ss-w-drow-side", children: [
|
|
12174
12187
|
crest && !failed ? /* @__PURE__ */ jsx85("img", { className: abbr ? "ss-w-drow-crest ss-w-drow-crest--wide" : "ss-w-drow-crest", src: crest, alt: "", onError: () => setFailed(true) }) : abbr ? /* @__PURE__ */ jsx85("span", { className: "ss-w-drow-crest ss-w-drow-crest--abbr", children: abbr }) : null,
|
|
12175
12188
|
/* @__PURE__ */ jsx85("span", { className: "ss-w-drow-nm", children: name })
|
|
@@ -12411,7 +12424,7 @@ function TennisLiveScoreboard({ t, score, live, ui }) {
|
|
|
12411
12424
|
}
|
|
12412
12425
|
|
|
12413
12426
|
// src/components/TennisStatsTables.tsx
|
|
12414
|
-
import { Fragment as Fragment22, useEffect as useEffect38, useState as
|
|
12427
|
+
import { Fragment as Fragment22, useEffect as useEffect38, useState as useState56 } from "react";
|
|
12415
12428
|
import { Fragment as Fragment23, jsx as jsx88, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
12416
12429
|
function formatStat(row, value, locale) {
|
|
12417
12430
|
if (value == null) return "\u2013";
|
|
@@ -12449,7 +12462,7 @@ function Tables({ table, labels, names, locale }) {
|
|
|
12449
12462
|
] });
|
|
12450
12463
|
}
|
|
12451
12464
|
function TennisStatsTables({ serveReturn, today, labels, names, ui, resetKey }) {
|
|
12452
|
-
const [tab, setTab] =
|
|
12465
|
+
const [tab, setTab] = useState56("match");
|
|
12453
12466
|
useEffect38(() => {
|
|
12454
12467
|
setTab("match");
|
|
12455
12468
|
}, [resetKey]);
|
|
@@ -13038,7 +13051,7 @@ function TrendsPanel({ monitor, ui, slip }) {
|
|
|
13038
13051
|
}
|
|
13039
13052
|
|
|
13040
13053
|
// src/components/LivePanel.tsx
|
|
13041
|
-
import { useMemo as useMemo10, useState as
|
|
13054
|
+
import { useMemo as useMemo10, useState as useState58 } from "react";
|
|
13042
13055
|
import { matchKey as matchKey8 } from "@sensiblestats/widget-sdk";
|
|
13043
13056
|
|
|
13044
13057
|
// src/scheduleView.ts
|
|
@@ -13213,7 +13226,7 @@ function LeagueGroup({ view, open, onToggle, disambiguate, rowCap, onShowAll, on
|
|
|
13213
13226
|
}
|
|
13214
13227
|
|
|
13215
13228
|
// src/components/MatchSheet.tsx
|
|
13216
|
-
import { useId as useId2, useState as
|
|
13229
|
+
import { useId as useId2, useState as useState57 } from "react";
|
|
13217
13230
|
import { localIdOf as localIdOf4, qualifiedId as qualifiedId2, slipSportOf as slipSportOf9, toWireSport as toWireSport6 } from "@sensiblestats/widget-sdk";
|
|
13218
13231
|
|
|
13219
13232
|
// src/useModalDialog.ts
|
|
@@ -13279,7 +13292,7 @@ function MatchSheet({ match, league, state, stale, ui, monitor, onAsk, onClose,
|
|
|
13279
13292
|
const { dialogRef, onKeyDown } = useModalDialog(onClose, { opener });
|
|
13280
13293
|
const log = useEventLog();
|
|
13281
13294
|
const titleId = useId2();
|
|
13282
|
-
const [limitHit, setLimitHit] =
|
|
13295
|
+
const [limitHit, setLimitHit] = useState57(false);
|
|
13283
13296
|
const pinSport = slipSportOf9(match.sport);
|
|
13284
13297
|
const tour = pinSport === "tennis" && isKnownTour(match.tour) ? match.tour : void 0;
|
|
13285
13298
|
const followable = pinSport !== "tennis" || tour !== void 0;
|
|
@@ -13380,9 +13393,9 @@ var OPEN_TOP_GROUPS = 2;
|
|
|
13380
13393
|
var QUIET_ROWS = 4;
|
|
13381
13394
|
function LivePanel({ discovery, ui, monitor, sport, offered, onSport, league, onLeague, onSeeAll, onAsk }) {
|
|
13382
13395
|
const { groups, states, stale } = discovery;
|
|
13383
|
-
const [mine, setMine] =
|
|
13384
|
-
const [toggled, setToggled] =
|
|
13385
|
-
const [sheet, setSheet] =
|
|
13396
|
+
const [mine, setMine] = useState58(false);
|
|
13397
|
+
const [toggled, setToggled] = useState58(/* @__PURE__ */ new Map());
|
|
13398
|
+
const [sheet, setSheet] = useState58(null);
|
|
13386
13399
|
const pinnedKeys = useMemo10(
|
|
13387
13400
|
() => new Set(monitor.pins.filter((p) => p.kind === "match").map((p) => matchKey8(p.sport, p.matchId, p.tour))),
|
|
13388
13401
|
[monitor.pins]
|
|
@@ -13489,15 +13502,15 @@ function LivePanel({ discovery, ui, monitor, sport, offered, onSport, league, on
|
|
|
13489
13502
|
}
|
|
13490
13503
|
|
|
13491
13504
|
// src/components/ScheduleMatchesPanel.tsx
|
|
13492
|
-
import { useEffect as useEffect43, useId as useId3, useMemo as useMemo11, useRef as useRef37, useState as
|
|
13505
|
+
import { useEffect as useEffect43, useId as useId3, useMemo as useMemo11, useRef as useRef37, useState as useState60 } from "react";
|
|
13493
13506
|
import { matchKey as matchKey10 } from "@sensiblestats/widget-sdk";
|
|
13494
13507
|
|
|
13495
13508
|
// src/useTennisRowPrices.ts
|
|
13496
|
-
import { useEffect as useEffect41, useRef as useRef34, useState as
|
|
13509
|
+
import { useEffect as useEffect41, useRef as useRef34, useState as useState59 } from "react";
|
|
13497
13510
|
import { matchKey as matchKey9 } from "@sensiblestats/widget-sdk";
|
|
13498
13511
|
var TENNIS_PRICE_POLL_MS = 6e4;
|
|
13499
13512
|
function useTennisRowPrices(a) {
|
|
13500
|
-
const [state, setState] =
|
|
13513
|
+
const [state, setState] = useState59({ byId: null, stale: false });
|
|
13501
13514
|
const getPricesRef = useRef34(a.getPrices);
|
|
13502
13515
|
getPricesRef.current = a.getPrices;
|
|
13503
13516
|
const latest = useRef34(0);
|
|
@@ -13660,11 +13673,11 @@ var SKELETON_ROWS = 3;
|
|
|
13660
13673
|
function ScheduleMatchesPanel({ discovery, ui, monitor, sport, offered, onSport, day, onDay, loaded, onOpenLive, onAsk, locale, getTennisPrices, slip }) {
|
|
13661
13674
|
const { localDate: today, states, stale } = discovery;
|
|
13662
13675
|
const searchId = useId3();
|
|
13663
|
-
const [query, setQuery] =
|
|
13664
|
-
const [toggled, setToggled] =
|
|
13665
|
-
const [expanded, setExpanded] =
|
|
13676
|
+
const [query, setQuery] = useState60("");
|
|
13677
|
+
const [toggled, setToggled] = useState60(/* @__PURE__ */ new Map());
|
|
13678
|
+
const [expanded, setExpanded] = useState60(/* @__PURE__ */ new Set());
|
|
13666
13679
|
const listRef = useRef37(null);
|
|
13667
|
-
const [sheet, setSheet] =
|
|
13680
|
+
const [sheet, setSheet] = useState60(null);
|
|
13668
13681
|
const { chips, selected } = loaded;
|
|
13669
13682
|
useEffect43(() => {
|
|
13670
13683
|
if (selected !== day) onDay(selected);
|
|
@@ -13808,7 +13821,7 @@ function ScheduleMatchesPanel({ discovery, ui, monitor, sport, offered, onSport,
|
|
|
13808
13821
|
}
|
|
13809
13822
|
|
|
13810
13823
|
// src/components/GamesPanel.tsx
|
|
13811
|
-
import { useEffect as useEffect47, useState as
|
|
13824
|
+
import { useEffect as useEffect47, useState as useState75 } from "react";
|
|
13812
13825
|
|
|
13813
13826
|
// src/components/GamesLoginWall.tsx
|
|
13814
13827
|
import { jsx as jsx103 } from "react/jsx-runtime";
|
|
@@ -13817,7 +13830,7 @@ function GamesLoginWall({ ui }) {
|
|
|
13817
13830
|
}
|
|
13818
13831
|
|
|
13819
13832
|
// src/components/GamesHub.tsx
|
|
13820
|
-
import { useEffect as useEffect44, useState as
|
|
13833
|
+
import { useEffect as useEffect44, useState as useState61 } from "react";
|
|
13821
13834
|
|
|
13822
13835
|
// src/components/games/ui/gameMeta.ts
|
|
13823
13836
|
function prettifyGameId(gameId) {
|
|
@@ -13968,7 +13981,7 @@ function pickHeroGame(games) {
|
|
|
13968
13981
|
}
|
|
13969
13982
|
var tileKey = (g) => `${g.gameId}-${g.gameDay}-${g.fixtureId}`;
|
|
13970
13983
|
function GamesHub({ games, myWeeklyRow, weeklyPrize, onOpen, ui }) {
|
|
13971
|
-
const [, setTick] =
|
|
13984
|
+
const [, setTick] = useState61(0);
|
|
13972
13985
|
useEffect44(() => {
|
|
13973
13986
|
const id = setInterval(() => setTick((t) => t + 1), 6e4);
|
|
13974
13987
|
return () => clearInterval(id);
|
|
@@ -14029,10 +14042,10 @@ function GamesHub({ games, myWeeklyRow, weeklyPrize, onOpen, ui }) {
|
|
|
14029
14042
|
}
|
|
14030
14043
|
|
|
14031
14044
|
// src/components/GameScreenHost.tsx
|
|
14032
|
-
import { useEffect as useEffect46, useRef as useRef40, useState as
|
|
14045
|
+
import { useEffect as useEffect46, useRef as useRef40, useState as useState73 } from "react";
|
|
14033
14046
|
|
|
14034
14047
|
// src/useGamePlay.ts
|
|
14035
|
-
import { useCallback as useCallback26, useRef as useRef38, useState as
|
|
14048
|
+
import { useCallback as useCallback26, useRef as useRef38, useState as useState62 } from "react";
|
|
14036
14049
|
function toSubmitResult(payload) {
|
|
14037
14050
|
return {
|
|
14038
14051
|
// 'pending' means the play is recorded but awaiting resolution (fixture games)
|
|
@@ -14044,9 +14057,9 @@ function toSubmitResult(payload) {
|
|
|
14044
14057
|
};
|
|
14045
14058
|
}
|
|
14046
14059
|
function useGamePlay(conversation, { gameId, gameDay, fixtureId, locale, refresh }) {
|
|
14047
|
-
const [result, setResult] =
|
|
14048
|
-
const [submitting, setSubmitting] =
|
|
14049
|
-
const [rawStatus, setRawStatus] =
|
|
14060
|
+
const [result, setResult] = useState62(null);
|
|
14061
|
+
const [submitting, setSubmitting] = useState62(false);
|
|
14062
|
+
const [rawStatus, setRawStatus] = useState62(null);
|
|
14050
14063
|
const inFlightRef = useRef38(false);
|
|
14051
14064
|
const convRef = useRef38(conversation);
|
|
14052
14065
|
convRef.current = conversation;
|
|
@@ -14104,7 +14117,7 @@ function useGamePlay(conversation, { gameId, gameDay, fixtureId, locale, refresh
|
|
|
14104
14117
|
}
|
|
14105
14118
|
|
|
14106
14119
|
// src/components/games/MysteryTigerGame.tsx
|
|
14107
|
-
import { useState as
|
|
14120
|
+
import { useState as useState64, useId as useId4 } from "react";
|
|
14108
14121
|
|
|
14109
14122
|
// src/components/games/nationFlags.ts
|
|
14110
14123
|
var FLAGS = {
|
|
@@ -14315,7 +14328,7 @@ function isNationCode(flag) {
|
|
|
14315
14328
|
}
|
|
14316
14329
|
|
|
14317
14330
|
// src/components/games/PlayerAvatar.tsx
|
|
14318
|
-
import { useState as
|
|
14331
|
+
import { useState as useState63 } from "react";
|
|
14319
14332
|
import { jsx as jsx108 } from "react/jsx-runtime";
|
|
14320
14333
|
function initialsOf(name) {
|
|
14321
14334
|
const parts2 = name.trim().split(/\s+/).filter(Boolean);
|
|
@@ -14333,7 +14346,7 @@ function PlayerAvatar({
|
|
|
14333
14346
|
imagePath,
|
|
14334
14347
|
className
|
|
14335
14348
|
}) {
|
|
14336
|
-
const [failed, setFailed] =
|
|
14349
|
+
const [failed, setFailed] = useState63(false);
|
|
14337
14350
|
const showImage = Boolean(imagePath) && !isPlaceholderImage(imagePath) && !failed;
|
|
14338
14351
|
return /* @__PURE__ */ jsx108("div", { className, "aria-hidden": "true", children: showImage ? /* @__PURE__ */ jsx108("img", { src: imagePath, alt: "", loading: "lazy", onError: () => setFailed(true) }) : /* @__PURE__ */ jsx108("span", { className: "ss-w-av-initials", children: initialsOf(name) }) });
|
|
14339
14352
|
}
|
|
@@ -14577,7 +14590,7 @@ function MysteryTigerGame({
|
|
|
14577
14590
|
onBack
|
|
14578
14591
|
}) {
|
|
14579
14592
|
const t = ui.games.mysteryTiger;
|
|
14580
|
-
const [query, setQuery] =
|
|
14593
|
+
const [query, setQuery] = useState64("");
|
|
14581
14594
|
const inputId = useId4();
|
|
14582
14595
|
const clientState = parseClientState(result?.clientStateJson);
|
|
14583
14596
|
const guessResults = clientState?.guessResults ?? [];
|
|
@@ -14839,13 +14852,13 @@ function HigherOrLowerGame({
|
|
|
14839
14852
|
}
|
|
14840
14853
|
|
|
14841
14854
|
// src/components/games/CareerPathGame.tsx
|
|
14842
|
-
import { useState as
|
|
14855
|
+
import { useState as useState66, useId as useId5 } from "react";
|
|
14843
14856
|
|
|
14844
14857
|
// src/components/games/ui/CrestShield.tsx
|
|
14845
|
-
import { useState as
|
|
14858
|
+
import { useState as useState65 } from "react";
|
|
14846
14859
|
import { jsx as jsx119 } from "react/jsx-runtime";
|
|
14847
14860
|
function CrestShield({ src, name, size = 28 }) {
|
|
14848
|
-
const [failed, setFailed] =
|
|
14861
|
+
const [failed, setFailed] = useState65(false);
|
|
14849
14862
|
if (src && !isPlaceholderImage(src) && !failed) {
|
|
14850
14863
|
return /* @__PURE__ */ jsx119("img", { className: "ss-g-crest", src, alt: name, width: size, height: size, loading: "lazy", onError: () => setFailed(true) });
|
|
14851
14864
|
}
|
|
@@ -14877,7 +14890,7 @@ function CareerPathGame({
|
|
|
14877
14890
|
}) {
|
|
14878
14891
|
const s = ui.games.careerPath;
|
|
14879
14892
|
const title = gameTitle({ gameId: "career-path" }, ui.games.titles);
|
|
14880
|
-
const [query, setQuery] =
|
|
14893
|
+
const [query, setQuery] = useState66("");
|
|
14881
14894
|
const inputId = useId5();
|
|
14882
14895
|
const clientState = parseClientState3(result?.clientStateJson);
|
|
14883
14896
|
const alreadyGuessedIds = new Set(clientState?.guessResults.map((g) => g.playerId) ?? []);
|
|
@@ -14984,7 +14997,7 @@ function CareerPathGame({
|
|
|
14984
14997
|
}
|
|
14985
14998
|
|
|
14986
14999
|
// src/components/games/BeatTheGridGame.tsx
|
|
14987
|
-
import React, { useEffect as useEffect45, useId as useId6, useRef as useRef39, useState as
|
|
15000
|
+
import React, { useEffect as useEffect45, useId as useId6, useRef as useRef39, useState as useState67 } from "react";
|
|
14988
15001
|
|
|
14989
15002
|
// src/components/games/ui/OptionList.tsx
|
|
14990
15003
|
import { jsx as jsx121 } from "react/jsx-runtime";
|
|
@@ -15073,7 +15086,7 @@ function SearchSheet({
|
|
|
15073
15086
|
ui
|
|
15074
15087
|
}) {
|
|
15075
15088
|
const s = ui.games.beatTheGrid;
|
|
15076
|
-
const [query, setQuery] =
|
|
15089
|
+
const [query, setQuery] = useState67("");
|
|
15077
15090
|
const inputId = useId6();
|
|
15078
15091
|
const inputRef = useRef39(null);
|
|
15079
15092
|
useEffect45(() => {
|
|
@@ -15141,7 +15154,7 @@ function BeatTheGridGame({
|
|
|
15141
15154
|
}) {
|
|
15142
15155
|
const s = ui.games.beatTheGrid;
|
|
15143
15156
|
const title = gameTitle({ gameId: "beat-the-grid" }, ui.games.titles);
|
|
15144
|
-
const [activeCell, setActiveCell] =
|
|
15157
|
+
const [activeCell, setActiveCell] = useState67(null);
|
|
15145
15158
|
const clientState = parseClientState4(result?.clientStateJson);
|
|
15146
15159
|
const filledCells = clientState?.cells ?? [];
|
|
15147
15160
|
const isLocked2 = result?.alreadyPlayed === true || clientState?.isComplete === true;
|
|
@@ -15296,7 +15309,7 @@ function BeatTheGridGame({
|
|
|
15296
15309
|
}
|
|
15297
15310
|
|
|
15298
15311
|
// src/components/games/GuessTheXiGame.tsx
|
|
15299
|
-
import { useState as
|
|
15312
|
+
import { useState as useState68, useId as useId7 } from "react";
|
|
15300
15313
|
|
|
15301
15314
|
// src/components/games/ui/PitchSvg.tsx
|
|
15302
15315
|
import { Fragment as Fragment36, jsx as jsx123, jsxs as jsxs109 } from "react/jsx-runtime";
|
|
@@ -15385,7 +15398,7 @@ function GuessTheXiGame({
|
|
|
15385
15398
|
onBack
|
|
15386
15399
|
}) {
|
|
15387
15400
|
const t = ui.games.guessTheXi;
|
|
15388
|
-
const [query, setQuery] =
|
|
15401
|
+
const [query, setQuery] = useState68("");
|
|
15389
15402
|
const inputId = useId7();
|
|
15390
15403
|
const clientState = parseClientState5(result?.clientStateJson);
|
|
15391
15404
|
const isOver = result?.alreadyPlayed === true || clientState?.status === "solved" || clientState?.status === "failed";
|
|
@@ -15528,7 +15541,7 @@ function GuessTheXiGame({
|
|
|
15528
15541
|
}
|
|
15529
15542
|
|
|
15530
15543
|
// src/components/games/DailyQuizGame.tsx
|
|
15531
|
-
import { useState as
|
|
15544
|
+
import { useState as useState69 } from "react";
|
|
15532
15545
|
import { Fragment as Fragment38, jsx as jsx125, jsxs as jsxs111 } from "react/jsx-runtime";
|
|
15533
15546
|
function parseClientState6(json) {
|
|
15534
15547
|
if (!json) return null;
|
|
@@ -15569,8 +15582,8 @@ function DailyQuizGame({
|
|
|
15569
15582
|
}) {
|
|
15570
15583
|
const s = ui.games.dailyQuiz;
|
|
15571
15584
|
const title = gameTitle({ gameId: "daily-quiz" }, ui.games.titles);
|
|
15572
|
-
const [selections, setSelections] =
|
|
15573
|
-
const [page, setPage] =
|
|
15585
|
+
const [selections, setSelections] = useState69(/* @__PURE__ */ new Map());
|
|
15586
|
+
const [page, setPage] = useState69(0);
|
|
15574
15587
|
const clientState = parseClientState6(result?.clientStateJson);
|
|
15575
15588
|
const results2 = clientState?.results ?? [];
|
|
15576
15589
|
const isRevealed = results2.length > 0 || result?.alreadyPlayed === true;
|
|
@@ -15680,7 +15693,7 @@ function DailyQuizGame({
|
|
|
15680
15693
|
}
|
|
15681
15694
|
|
|
15682
15695
|
// src/components/games/MatchdayPredictorGame.tsx
|
|
15683
|
-
import { useId as useId8, useState as
|
|
15696
|
+
import { useId as useId8, useState as useState70 } from "react";
|
|
15684
15697
|
import { jsx as jsx126, jsxs as jsxs112 } from "react/jsx-runtime";
|
|
15685
15698
|
var SCORER_SEARCH_THRESHOLD = 9;
|
|
15686
15699
|
function parseClientState7(json) {
|
|
@@ -15776,11 +15789,11 @@ function MatchdayPredictorGame({
|
|
|
15776
15789
|
onBack
|
|
15777
15790
|
}) {
|
|
15778
15791
|
const t = ui.games.predictor;
|
|
15779
|
-
const [homeScore, setHomeScore] =
|
|
15780
|
-
const [awayScore, setAwayScore] =
|
|
15781
|
-
const [firstScorerPlayerId, setFirstScorerPlayerId] =
|
|
15782
|
-
const [lastEdited, setLastEdited] =
|
|
15783
|
-
const [query, setQuery] =
|
|
15792
|
+
const [homeScore, setHomeScore] = useState70(0);
|
|
15793
|
+
const [awayScore, setAwayScore] = useState70(0);
|
|
15794
|
+
const [firstScorerPlayerId, setFirstScorerPlayerId] = useState70(null);
|
|
15795
|
+
const [lastEdited, setLastEdited] = useState70("home");
|
|
15796
|
+
const [query, setQuery] = useState70("");
|
|
15784
15797
|
const searchId = useId8();
|
|
15785
15798
|
const clientState = parseClientState7(result?.clientStateJson);
|
|
15786
15799
|
const alreadyPlayed = result?.alreadyPlayed === true;
|
|
@@ -15948,7 +15961,7 @@ function MatchdayPredictorGame({
|
|
|
15948
15961
|
}
|
|
15949
15962
|
|
|
15950
15963
|
// src/components/games/StartingXiGame.tsx
|
|
15951
|
-
import { useId as useId9, useState as
|
|
15964
|
+
import { useId as useId9, useState as useState71 } from "react";
|
|
15952
15965
|
import { Fragment as Fragment39, jsx as jsx127, jsxs as jsxs113 } from "react/jsx-runtime";
|
|
15953
15966
|
var POINTS_PER_STARTER = 8;
|
|
15954
15967
|
var XI_SIZE = 11;
|
|
@@ -15992,9 +16005,9 @@ function StartingXiGame({
|
|
|
15992
16005
|
lockAtUtc
|
|
15993
16006
|
}) {
|
|
15994
16007
|
const t = ui.games.startingXi;
|
|
15995
|
-
const [slotPlayers, setSlotPlayers] =
|
|
15996
|
-
const [active, setActive] =
|
|
15997
|
-
const [query, setQuery] =
|
|
16008
|
+
const [slotPlayers, setSlotPlayers] = useState71(() => Array(XI_SIZE).fill(null));
|
|
16009
|
+
const [active, setActive] = useState71(0);
|
|
16010
|
+
const [query, setQuery] = useState71("");
|
|
15998
16011
|
const searchId = useId9();
|
|
15999
16012
|
const clientState = parseClientState8(result?.clientStateJson);
|
|
16000
16013
|
const alreadyPlayed = result?.alreadyPlayed === true;
|
|
@@ -16134,7 +16147,7 @@ function StartingXiGame({
|
|
|
16134
16147
|
}
|
|
16135
16148
|
|
|
16136
16149
|
// src/components/games/StatLadderGame.tsx
|
|
16137
|
-
import { useId as useId10, useState as
|
|
16150
|
+
import { useId as useId10, useState as useState72 } from "react";
|
|
16138
16151
|
import { jsx as jsx128, jsxs as jsxs114 } from "react/jsx-runtime";
|
|
16139
16152
|
function ladderClue(ladder) {
|
|
16140
16153
|
const mystery = ladder.find((r) => r.rank === 2);
|
|
@@ -16171,8 +16184,8 @@ function StatLadderGame({
|
|
|
16171
16184
|
onBack
|
|
16172
16185
|
}) {
|
|
16173
16186
|
const t = ui.games.statLadder;
|
|
16174
|
-
const [query, setQuery] =
|
|
16175
|
-
const [selectedId, setSelectedId] =
|
|
16187
|
+
const [query, setQuery] = useState72("");
|
|
16188
|
+
const [selectedId, setSelectedId] = useState72(null);
|
|
16176
16189
|
const searchId = useId10();
|
|
16177
16190
|
const clientState = parseClientState9(result?.clientStateJson);
|
|
16178
16191
|
const revealed = clientState != null;
|
|
@@ -16379,7 +16392,7 @@ function GameScreenHost({
|
|
|
16379
16392
|
ui
|
|
16380
16393
|
}) {
|
|
16381
16394
|
const { gameId, fixtureId, gameDay = "", lockAtUtc = null } = selected;
|
|
16382
|
-
const [configJson, setConfigJson] =
|
|
16395
|
+
const [configJson, setConfigJson] = useState73(null);
|
|
16383
16396
|
useEffect46(() => {
|
|
16384
16397
|
setConfigJson(null);
|
|
16385
16398
|
if (!conversation) return;
|
|
@@ -16521,7 +16534,7 @@ function GameScreenHost({
|
|
|
16521
16534
|
}
|
|
16522
16535
|
|
|
16523
16536
|
// src/components/Leaderboard.tsx
|
|
16524
|
-
import { useState as
|
|
16537
|
+
import { useState as useState74 } from "react";
|
|
16525
16538
|
|
|
16526
16539
|
// src/components/LeaderboardRow.tsx
|
|
16527
16540
|
import { jsx as jsx131, jsxs as jsxs116 } from "react/jsx-runtime";
|
|
@@ -16608,7 +16621,7 @@ function Leaderboard({
|
|
|
16608
16621
|
ui,
|
|
16609
16622
|
onPlay
|
|
16610
16623
|
}) {
|
|
16611
|
-
const [segment, setSegment] =
|
|
16624
|
+
const [segment, setSegment] = useState74("weekly");
|
|
16612
16625
|
const myRow = segment === "weekly" ? data.myWeeklyRow : data.myAllTimeRow;
|
|
16613
16626
|
const offBoard = myRow !== null && myRow !== void 0 && myRow.rank === -1;
|
|
16614
16627
|
const isEmpty = segment === "weekly" ? data.weeklyTop.length === 0 : data.allTimeTop.length === 0;
|
|
@@ -16713,8 +16726,8 @@ function GamesPanel({
|
|
|
16713
16726
|
leaderboardLoading,
|
|
16714
16727
|
refreshHub
|
|
16715
16728
|
}) {
|
|
16716
|
-
const [selected, setSelected] =
|
|
16717
|
-
const [segment, setSegment] =
|
|
16729
|
+
const [selected, setSelected] = useState75(null);
|
|
16730
|
+
const [segment, setSegment] = useState75("play");
|
|
16718
16731
|
useEffect47(() => {
|
|
16719
16732
|
ensureGamesFonts();
|
|
16720
16733
|
}, []);
|
|
@@ -16779,10 +16792,10 @@ function GamesPanel({
|
|
|
16779
16792
|
}
|
|
16780
16793
|
|
|
16781
16794
|
// src/components/FavouritesPanel.tsx
|
|
16782
|
-
import { useEffect as useEffect50, useRef as useRef42, useState as
|
|
16795
|
+
import { useEffect as useEffect50, useRef as useRef42, useState as useState78 } from "react";
|
|
16783
16796
|
|
|
16784
16797
|
// src/components/FavouriteChips.tsx
|
|
16785
|
-
import { useEffect as useEffect48, useState as
|
|
16798
|
+
import { useEffect as useEffect48, useState as useState76 } from "react";
|
|
16786
16799
|
import { Fragment as Fragment41, jsx as jsx136, jsxs as jsxs120 } from "react/jsx-runtime";
|
|
16787
16800
|
async function toggleWithNotice(controller, kind, id, onNotice) {
|
|
16788
16801
|
const outcome = await controller.toggle(kind, id);
|
|
@@ -16829,7 +16842,7 @@ function Group({ title, entities, sport, ui, controller, onNotice }) {
|
|
|
16829
16842
|
] });
|
|
16830
16843
|
}
|
|
16831
16844
|
function FavouriteChips({ controller, ui, sport, sportLabel: sportLabel2, onNotice }) {
|
|
16832
|
-
const [confirming, setConfirming] =
|
|
16845
|
+
const [confirming, setConfirming] = useState76(false);
|
|
16833
16846
|
const data = controller.data;
|
|
16834
16847
|
useEffect48(() => {
|
|
16835
16848
|
setConfirming(false);
|
|
@@ -16888,14 +16901,14 @@ function FavouriteChips({ controller, ui, sport, sportLabel: sportLabel2, onNoti
|
|
|
16888
16901
|
}
|
|
16889
16902
|
|
|
16890
16903
|
// src/components/FavouritesSearch.tsx
|
|
16891
|
-
import { useEffect as useEffect49, useRef as useRef41, useState as
|
|
16904
|
+
import { useEffect as useEffect49, useRef as useRef41, useState as useState77 } from "react";
|
|
16892
16905
|
import { jsx as jsx137, jsxs as jsxs121 } from "react/jsx-runtime";
|
|
16893
16906
|
var MIN_LETTERS = 2;
|
|
16894
16907
|
var MAX_LENGTH = 64;
|
|
16895
16908
|
var DEBOUNCE_MS = 250;
|
|
16896
16909
|
function FavouritesSearch({ controller, ui, sport, onNotice }) {
|
|
16897
|
-
const [query, setQuery] =
|
|
16898
|
-
const [answer, setAnswer] =
|
|
16910
|
+
const [query, setQuery] = useState77("");
|
|
16911
|
+
const [answer, setAnswer] = useState77(null);
|
|
16899
16912
|
const controllerRef = useRef41(controller);
|
|
16900
16913
|
controllerRef.current = controller;
|
|
16901
16914
|
const trimmed = query.trim();
|
|
@@ -16965,7 +16978,7 @@ function FavouritesSearch({ controller, ui, sport, onNotice }) {
|
|
|
16965
16978
|
// src/components/FavouritesPanel.tsx
|
|
16966
16979
|
import { jsx as jsx138, jsxs as jsxs122 } from "react/jsx-runtime";
|
|
16967
16980
|
function FavouritesPanel({ controller, ui, sport, sports, onSportChange }) {
|
|
16968
|
-
const [notice, setNotice] =
|
|
16981
|
+
const [notice, setNotice] = useState78(null);
|
|
16969
16982
|
const refreshRef = useRef42(controller.refresh);
|
|
16970
16983
|
refreshRef.current = controller.refresh;
|
|
16971
16984
|
useEffect50(() => {
|
|
@@ -16997,7 +17010,7 @@ function FavouritesPanel({ controller, ui, sport, sports, onSportChange }) {
|
|
|
16997
17010
|
}
|
|
16998
17011
|
|
|
16999
17012
|
// src/components/PresetTools.tsx
|
|
17000
|
-
import { useId as useId11, useState as
|
|
17013
|
+
import { useId as useId11, useState as useState79 } from "react";
|
|
17001
17014
|
import { Fragment as Fragment42, jsx as jsx139, jsxs as jsxs123 } from "react/jsx-runtime";
|
|
17002
17015
|
function PresetToolModal({ title, closeLabel, onClose, children, footer, className }) {
|
|
17003
17016
|
const { dialogRef, onKeyDown } = useModalDialog(onClose, { restoreFocus: false });
|
|
@@ -17051,9 +17064,9 @@ function BuildComboTool({ grid, strings, streaming, formatKickoff, initialTotal,
|
|
|
17051
17064
|
const totalOptions = comboTotals(grid);
|
|
17052
17065
|
const totals = totalOptions.map((o) => o.value);
|
|
17053
17066
|
const legChoices = comboLegChoices(grid);
|
|
17054
|
-
const [total, setTotal] =
|
|
17055
|
-
const [legs, setLegs] =
|
|
17056
|
-
const [announcement, setAnnouncement] =
|
|
17067
|
+
const [total, setTotal] = useState79(() => nearest(totals, initialTotal));
|
|
17068
|
+
const [legs, setLegs] = useState79(() => legsForTotal(grid, nearest(totals, initialTotal), clampLegs(legChoices, initialLegs)));
|
|
17069
|
+
const [announcement, setAnnouncement] = useState79("");
|
|
17057
17070
|
const cell2 = findCombo(grid, total, legs);
|
|
17058
17071
|
const minLegs = legChoices[0] ?? legs;
|
|
17059
17072
|
const maxLegs = legChoices[legChoices.length - 1] ?? legs;
|
|
@@ -17092,7 +17105,7 @@ function FavouritesSheet({ ui, controller, sport, sports, onSportChange, onClose
|
|
|
17092
17105
|
}
|
|
17093
17106
|
|
|
17094
17107
|
// src/components/dashboard/v8/SentenceBuilder.tsx
|
|
17095
|
-
import { useEffect as useEffect52, useRef as useRef44, useState as
|
|
17108
|
+
import { useEffect as useEffect52, useRef as useRef44, useState as useState80 } from "react";
|
|
17096
17109
|
import { Fragment as Fragment43, jsx as jsx141, jsxs as jsxs124 } from "react/jsx-runtime";
|
|
17097
17110
|
var TOTALS = ["any", "3", "5", "10", "20", "50"];
|
|
17098
17111
|
var BASE_LEGS = [1, 2, 3, 4];
|
|
@@ -17118,8 +17131,8 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
17118
17131
|
const opening = openingGames(preset);
|
|
17119
17132
|
const gamesOptions = opening.options;
|
|
17120
17133
|
const marketOptions = usableMarkets(preset);
|
|
17121
|
-
const [fingerprint] =
|
|
17122
|
-
const [saved] =
|
|
17134
|
+
const [fingerprint] = useState80(() => JSON.stringify(preset));
|
|
17135
|
+
const [saved] = useState80(() => {
|
|
17123
17136
|
const kept = memory3?.savedView(sport);
|
|
17124
17137
|
return kept && kept.fingerprint === fingerprint ? kept : null;
|
|
17125
17138
|
});
|
|
@@ -17133,9 +17146,9 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
17133
17146
|
// The server never widens by itself: an all-games preset with no ids asks for it.
|
|
17134
17147
|
widen: opening.option ? opening.option.matchIds.length === 0 : preset.gamesScope === "all" && preset.matchIds.length === 0
|
|
17135
17148
|
};
|
|
17136
|
-
const [view, setView] =
|
|
17149
|
+
const [view, setView] = useState80(() => saved?.view ?? openingView);
|
|
17137
17150
|
const autoWidened = useRef44(false);
|
|
17138
|
-
const [widenedNote, setWidenedNote] =
|
|
17151
|
+
const [widenedNote, setWidenedNote] = useState80(saved?.widenedNote ?? false);
|
|
17139
17152
|
const requestFor = (v) => ({
|
|
17140
17153
|
sport,
|
|
17141
17154
|
...v.marketKey !== null ? { marketKey: v.marketKey } : {},
|
|
@@ -17147,7 +17160,7 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
17147
17160
|
...operatorUserId ? { operatorUserId } : {},
|
|
17148
17161
|
...anonymousUserId ? { anonymousUserId } : {}
|
|
17149
17162
|
});
|
|
17150
|
-
const [first] =
|
|
17163
|
+
const [first] = useState80(() => requestFor(view));
|
|
17151
17164
|
const { grid, status: status2, confirmed, request } = useBuilderGrid({ conversation, locale: ui.hostTag, memory: memory3, initial: first });
|
|
17152
17165
|
const lastRequest = useRef44(first);
|
|
17153
17166
|
useEffect52(() => {
|
|
@@ -17183,13 +17196,13 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
17183
17196
|
const rows = ready && grid.status === "ok" ? legsOf(grid, sport) : null;
|
|
17184
17197
|
const rowSlip = rows ? guardLegsPreMatch(slip, rows, ui) : slip;
|
|
17185
17198
|
useNextKickoffRender(rows ? rows.map((l) => l.kickoffUtc) : []);
|
|
17186
|
-
const [startedNote, setStartedNote] =
|
|
17199
|
+
const [startedNote, setStartedNote] = useState80(false);
|
|
17187
17200
|
const anyStarted = rows !== null && rows.some((l) => !preMatchOpen(l.kickoffUtc, Date.now()));
|
|
17188
17201
|
useEffect52(() => {
|
|
17189
17202
|
if (startedNote && status2 === "ready" && !anyStarted) setStartedNote(false);
|
|
17190
17203
|
}, [startedNote, status2, anyStarted]);
|
|
17191
17204
|
const market = rows?.[0]?.market;
|
|
17192
|
-
const [seen2, setSeen] =
|
|
17205
|
+
const [seen2, setSeen] = useState80(null);
|
|
17193
17206
|
useEffect52(() => {
|
|
17194
17207
|
if (market) setSeen(market);
|
|
17195
17208
|
}, [market]);
|
|
@@ -17613,10 +17626,10 @@ function Squad({ squad, loading, ui, view, onToggleView, stats, statsLoading, se
|
|
|
17613
17626
|
}
|
|
17614
17627
|
|
|
17615
17628
|
// src/components/PlayerPhoto.tsx
|
|
17616
|
-
import { useState as
|
|
17629
|
+
import { useState as useState81 } from "react";
|
|
17617
17630
|
import { jsx as jsx147 } from "react/jsx-runtime";
|
|
17618
17631
|
function PlayerPhoto({ photoUrl, jerseyNumber, size }) {
|
|
17619
|
-
const [failed, setFailed] =
|
|
17632
|
+
const [failed, setFailed] = useState81(false);
|
|
17620
17633
|
const box = { width: size, height: size };
|
|
17621
17634
|
if (photoUrl && !failed) {
|
|
17622
17635
|
return /* @__PURE__ */ jsx147("img", { className: "ss-w-pd-photo", style: box, src: photoUrl, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
@@ -17651,7 +17664,7 @@ function MiniPitch({ positionCode }) {
|
|
|
17651
17664
|
}
|
|
17652
17665
|
|
|
17653
17666
|
// src/components/PerformanceBars.tsx
|
|
17654
|
-
import { useState as
|
|
17667
|
+
import { useState as useState82 } from "react";
|
|
17655
17668
|
import { jsx as jsx149, jsxs as jsxs130 } from "react/jsx-runtime";
|
|
17656
17669
|
var GROUPS = ["shooting", "passing", "possession", "defending"];
|
|
17657
17670
|
function finite4(v) {
|
|
@@ -17697,7 +17710,7 @@ function unrankedLine(ui, reason) {
|
|
|
17697
17710
|
}
|
|
17698
17711
|
}
|
|
17699
17712
|
function PerformanceBars({ performance, competitionName, strings }) {
|
|
17700
|
-
const [mode, setMode] =
|
|
17713
|
+
const [mode, setMode] = useState82("total");
|
|
17701
17714
|
const labelled = performance.metrics.filter((m) => Object.prototype.hasOwnProperty.call(strings.perfMetric, m.key));
|
|
17702
17715
|
if (!labelled.some((m) => valueOf(m, "total") !== null || valueOf(m, "per90") !== null)) return null;
|
|
17703
17716
|
const subtitle = !performance.ranked ? unrankedLine(strings, performance.unrankedReason) : competitionName ? strings.perfRankedAgainst(competitionName, performance.positionGroup) : null;
|
|
@@ -17906,7 +17919,7 @@ function SettingsSheet({ ui, onClose }) {
|
|
|
17906
17919
|
import { Fragment as Fragment46, jsx as jsx152, jsxs as jsxs133 } from "react/jsx-runtime";
|
|
17907
17920
|
var FULLSCREEN_QUERY = "(max-width: 639px)";
|
|
17908
17921
|
function useIsModal() {
|
|
17909
|
-
const [modal, setModal] =
|
|
17922
|
+
const [modal, setModal] = useState83(false);
|
|
17910
17923
|
useEffect53(() => {
|
|
17911
17924
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
|
|
17912
17925
|
const mql = window.matchMedia(FULLSCREEN_QUERY);
|
|
@@ -17921,8 +17934,8 @@ var HIDDEN_LAYER_STYLE = { position: "absolute", inset: 0, visibility: "hidden",
|
|
|
17921
17934
|
var SQUAD_LAYER_STYLE = { display: "flex", flexDirection: "column", flex: 1, minHeight: 0 };
|
|
17922
17935
|
function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, schedule, gamesResult, leaderboardResult, clubFixturesResult, clubStandingsResult, clubSquadResult, clubSquadStatsResult, clubPlayerDetailResult, loggedIn, conversation, presetGrid, favouritesEnabled, favourites, builder, onCloseRequested, onRegisterBack }) {
|
|
17923
17936
|
const { state, close, stop, send, reset } = controller;
|
|
17924
|
-
const [squadView, setSquadView] =
|
|
17925
|
-
const [selectedPlayerId, setSelectedPlayerId] =
|
|
17937
|
+
const [squadView, setSquadView] = useState83("roster");
|
|
17938
|
+
const [selectedPlayerId, setSelectedPlayerId] = useState83(null);
|
|
17926
17939
|
const clearPlayerDetail = clubPlayerDetailResult?.clear;
|
|
17927
17940
|
const fetchPlayerDetail = clubPlayerDetailResult?.fetch;
|
|
17928
17941
|
const squadLayerRef = useRef45(null);
|
|
@@ -18000,10 +18013,10 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
18000
18013
|
const limitRef = useRef45(null);
|
|
18001
18014
|
const typedSendRef = useRef45(false);
|
|
18002
18015
|
const focusAfterCloseRef = useRef45(null);
|
|
18003
|
-
const [tool, setTool] =
|
|
18016
|
+
const [tool, setTool] = useState83(null);
|
|
18004
18017
|
const panelRef = useRef45(null);
|
|
18005
18018
|
const settings = useOddsSettings();
|
|
18006
|
-
const [settingsOpen, setSettingsOpen] =
|
|
18019
|
+
const [settingsOpen, setSettingsOpen] = useState83(false);
|
|
18007
18020
|
const hasSettings = settings.oddsOffered || !settings.themeLocked;
|
|
18008
18021
|
const openSettings = useCallback27(() => {
|
|
18009
18022
|
setTool(null);
|
|
@@ -18748,6 +18761,8 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
18748
18761
|
.ss-w-nfl-kick { margin-left: auto; white-space: nowrap; }
|
|
18749
18762
|
.ss-w-nfl-title { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--ss-w-ink); overflow-wrap: anywhere; }
|
|
18750
18763
|
.ss-w-nfl-badge { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 16px; padding: 0 3px; border-radius: 4px; font-size: 9px; font-weight: 800; letter-spacing: .02em; line-height: 1; color: var(--ss-w-ink); background: var(--ss-w-bubble); border: 1px solid var(--ss-w-line); box-sizing: border-box; }
|
|
18764
|
+
.ss-w-nfl-badge--img { min-width: 0; width: 16px; padding: 1px; object-fit: contain; }
|
|
18765
|
+
.ss-w-props-scorer-who { display: flex; align-items: center; min-width: 0; }
|
|
18751
18766
|
.ss-w-nfl-who { margin: 0; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-weight: 600; font-size: 13px; color: var(--ss-w-ink); overflow-wrap: anywhere; }
|
|
18752
18767
|
.ss-w-nfl-pos { font-size: 10px; font-weight: 600; color: var(--ss-w-faint); border: 1px solid var(--ss-w-line); border-radius: 999px; padding: 0 6px; }
|
|
18753
18768
|
.ss-w-nfl-n { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ss-w-ink); text-align: right; white-space: nowrap; }
|
|
@@ -21163,7 +21178,7 @@ function StatsWidget(props) {
|
|
|
21163
21178
|
return [...seen2];
|
|
21164
21179
|
}, [discovery.matchDays, discovery.groups]);
|
|
21165
21180
|
const scheduleSport = useScheduleSport(offeredSports);
|
|
21166
|
-
const [liveLeague, setLiveLeague] =
|
|
21181
|
+
const [liveLeague, setLiveLeague] = useState84(null);
|
|
21167
21182
|
const [matchesDay, setMatchesDay] = useMatchesDayPick(discovery.localDate);
|
|
21168
21183
|
const matchesLoaded = useMatchesDay({
|
|
21169
21184
|
discovery,
|
|
@@ -21214,7 +21229,7 @@ function StatsWidget(props) {
|
|
|
21214
21229
|
const clubSquadResult = useClubSquad(built?.conversation ?? null, { activeTab: monitor.activeTab, enabled: clubFixturesResult.enabled });
|
|
21215
21230
|
const clubSquadStatsResult = useClubSquadStats(built?.conversation ?? null, { activeTab: monitor.activeTab, enabled: clubFixturesResult.enabled });
|
|
21216
21231
|
const clubPlayerDetailResult = useClubPlayerDetail(built?.conversation ?? null);
|
|
21217
|
-
const [favSportPick, setFavSportPick] =
|
|
21232
|
+
const [favSportPick, setFavSportPick] = useState84(null);
|
|
21218
21233
|
const latestGreeting = useMemo13(() => {
|
|
21219
21234
|
for (const m of [...controller.state.messages].reverse()) {
|
|
21220
21235
|
if (m.role === "assistant" && m.defaultSport !== void 0) return m;
|
|
@@ -21230,12 +21245,12 @@ function StatsWidget(props) {
|
|
|
21230
21245
|
const favSport = [favSportPick, rememberedSport, latestGreeting?.defaultSport].find(offered) ?? "football";
|
|
21231
21246
|
const favSports = favSportOptions.length > 0 ? favSportOptions : [{ sport: favSport, label: sportLabel(ui, favSport) }];
|
|
21232
21247
|
const hasFavouritesIdentity = !!(operatorUserId || anonymousUserId);
|
|
21233
|
-
const [builderSportPick, setBuilderSportPick] =
|
|
21248
|
+
const [builderSportPick, setBuilderSportPick] = useState84(null);
|
|
21234
21249
|
const builderGreeting = useMemo13(
|
|
21235
21250
|
() => [...controller.state.messages].reverse().find((m) => m.role === "assistant" && (m.greetingDashboard !== void 0 || m.greetingDashboards !== void 0)) ?? null,
|
|
21236
21251
|
[controller.state.messages]
|
|
21237
21252
|
);
|
|
21238
|
-
const [coolOff, setCoolOff] =
|
|
21253
|
+
const [coolOff, setCoolOff] = useState84(null);
|
|
21239
21254
|
const onBuilderCoolOff = useCallback28((sport) => {
|
|
21240
21255
|
if (!builderGreeting) return;
|
|
21241
21256
|
setCoolOff((prev) => {
|
|
@@ -21256,7 +21271,7 @@ function StatsWidget(props) {
|
|
|
21256
21271
|
return options.filter((o) => !cooled.includes(o.sport));
|
|
21257
21272
|
}, [builderGreeting, coolOff, ui]);
|
|
21258
21273
|
const builderSport = [builderSportPick, rememberedSport, latestGreeting?.defaultSport].find((s) => !!s && builderOptions.some((o) => o.sport === s)) ?? builderOptions[0]?.sport ?? "";
|
|
21259
|
-
const [panelEverOpened, setPanelEverOpened] =
|
|
21274
|
+
const [panelEverOpened, setPanelEverOpened] = useState84(panelOpen);
|
|
21260
21275
|
if (panelOpen && !panelEverOpened) setPanelEverOpened(true);
|
|
21261
21276
|
const favourites = useFavourites({
|
|
21262
21277
|
conversation: built?.conversation ?? null,
|
|
@@ -21268,7 +21283,7 @@ function StatsWidget(props) {
|
|
|
21268
21283
|
onChanged: discovery.refreshSchedule
|
|
21269
21284
|
});
|
|
21270
21285
|
const favouritesEnabled = hasFavouritesIdentity && favourites.status !== "refused";
|
|
21271
|
-
const [favouritesOpen, setFavouritesOpen] =
|
|
21286
|
+
const [favouritesOpen, setFavouritesOpen] = useState84(false);
|
|
21272
21287
|
if (!panelOpen && favouritesOpen) setFavouritesOpen(false);
|
|
21273
21288
|
const getPricePresets = useCallback28(
|
|
21274
21289
|
(locale) => built ? built.conversation.getPricePresets(locale, { pool: "open" }) : Promise.resolve(null),
|