@sensiblestats/widget-react 0.153.0 → 0.153.1
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 +6 -0
- package/dist/index.cjs +607 -570
- 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 +327 -290
- package/dist/index.js.map +1 -1
- package/dist/styles.css +2 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/StatsWidget.tsx
|
|
2
|
-
import { useCallback as
|
|
2
|
+
import { useCallback as useCallback31, useEffect as useEffect59, useMemo as useMemo17, useRef as useRef50, useState as useState89 } from "react";
|
|
3
3
|
import { StatsWidgetClient } from "@sensiblestats/widget-sdk";
|
|
4
4
|
|
|
5
5
|
// src/strings/tag.ts
|
|
@@ -1378,7 +1378,7 @@ function parseCustomTotal(text2, format2) {
|
|
|
1378
1378
|
}
|
|
1379
1379
|
|
|
1380
1380
|
// src/version.generated.ts
|
|
1381
|
-
var WIDGET_REACT_VERSION = "0.153.
|
|
1381
|
+
var WIDGET_REACT_VERSION = "0.153.1";
|
|
1382
1382
|
|
|
1383
1383
|
// src/config.ts
|
|
1384
1384
|
function hostTag(cfg) {
|
|
@@ -2631,6 +2631,10 @@ function slipKey(ref) {
|
|
|
2631
2631
|
function sameLeg(a, b) {
|
|
2632
2632
|
return a.matchOddsId === b.matchOddsId && sportOf2(a.sport) === sportOf2(b.sport);
|
|
2633
2633
|
}
|
|
2634
|
+
function slipSportOfWire(sport) {
|
|
2635
|
+
const hit = Object.entries(SPORTS).find(([, spec]) => spec.wireKey === sport);
|
|
2636
|
+
return hit ? hit[0] : void 0;
|
|
2637
|
+
}
|
|
2634
2638
|
|
|
2635
2639
|
// src/monitorMatch.ts
|
|
2636
2640
|
import { SPORTS as SPORTS2, localIdOf, sportOf as sportOf3 } from "@sensiblestats/widget-sdk";
|
|
@@ -5756,7 +5760,7 @@ function useFavourites({ conversation, sport, operatorUserId, anonymousUserId, e
|
|
|
5756
5760
|
}
|
|
5757
5761
|
|
|
5758
5762
|
// src/components/dashboard/GreetingDashboard.tsx
|
|
5759
|
-
import { useEffect as useEffect26, useMemo as useMemo10, useState as
|
|
5763
|
+
import { useEffect as useEffect26, useMemo as useMemo10, useState as useState32 } from "react";
|
|
5760
5764
|
|
|
5761
5765
|
// src/eventLogContext.ts
|
|
5762
5766
|
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
@@ -6014,7 +6018,7 @@ function SportSwitch({ sports, selected, onSelect, liveLabel: liveLabel3, groupL
|
|
|
6014
6018
|
}
|
|
6015
6019
|
|
|
6016
6020
|
// src/components/dashboard/v2/MarketFirstGreeting.tsx
|
|
6017
|
-
import { useContext as useContext10, useEffect as useEffect20, useRef as useRef19, useState as
|
|
6021
|
+
import { useContext as useContext10, useEffect as useEffect20, useRef as useRef19, useState as useState22 } from "react";
|
|
6018
6022
|
|
|
6019
6023
|
// src/useFeaturedHighlight.ts
|
|
6020
6024
|
import { createContext as createContext5, useEffect as useEffect17, useState as useState16 } from "react";
|
|
@@ -6075,7 +6079,7 @@ function SinceLines({ since, ui }) {
|
|
|
6075
6079
|
}
|
|
6076
6080
|
|
|
6077
6081
|
// src/components/dashboard/v2/FeaturedCard.tsx
|
|
6078
|
-
import { useContext as
|
|
6082
|
+
import { useContext as useContext8 } from "react";
|
|
6079
6083
|
|
|
6080
6084
|
// src/components/PinToggle.tsx
|
|
6081
6085
|
import { useCallback as useCallback13, useState as useState18 } from "react";
|
|
@@ -6196,10 +6200,30 @@ function MarketMenu({ markets, current, label, onPick }) {
|
|
|
6196
6200
|
}
|
|
6197
6201
|
|
|
6198
6202
|
// src/components/dashboard/v2/MarketRows.tsx
|
|
6199
|
-
import { useContext as
|
|
6203
|
+
import { useContext as useContext7, useMemo as useMemo6 } from "react";
|
|
6204
|
+
|
|
6205
|
+
// src/components/dashboard/v2/Price.tsx
|
|
6206
|
+
import { useCallback as useCallback15, useRef as useRef17, useState as useState20 } from "react";
|
|
6207
|
+
|
|
6208
|
+
// src/slipSettled.ts
|
|
6209
|
+
import { useCallback as useCallback14, useState as useState19 } from "react";
|
|
6210
|
+
|
|
6211
|
+
// src/slipStateContext.ts
|
|
6212
|
+
import { createContext as createContext7, useContext as useContext6 } from "react";
|
|
6213
|
+
var SlipStateContext = createContext7(null);
|
|
6214
|
+
function useSlipState() {
|
|
6215
|
+
return useContext6(SlipStateContext);
|
|
6216
|
+
}
|
|
6217
|
+
|
|
6218
|
+
// src/slipSettled.ts
|
|
6219
|
+
function useSettledMarks() {
|
|
6220
|
+
const slipState = useSlipState();
|
|
6221
|
+
const [local, setLocal] = useState19({});
|
|
6222
|
+
const localSettle = useCallback14((key) => setLocal((prev) => prev[key] ? prev : { ...prev, [key]: true }), []);
|
|
6223
|
+
return slipState ? { isSettled: (key) => !!slipState.settled[key], settle: slipState.settle } : { isSettled: (key) => !!local[key], settle: localSettle };
|
|
6224
|
+
}
|
|
6200
6225
|
|
|
6201
6226
|
// src/components/dashboard/v2/Price.tsx
|
|
6202
|
-
import { useCallback as useCallback14, useRef as useRef17, useState as useState19 } from "react";
|
|
6203
6227
|
import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
6204
6228
|
function logRowTap(events, slot) {
|
|
6205
6229
|
return (e) => {
|
|
@@ -6207,21 +6231,29 @@ function logRowTap(events, slot) {
|
|
|
6207
6231
|
events?.cardTap(slot);
|
|
6208
6232
|
};
|
|
6209
6233
|
}
|
|
6234
|
+
function DonePill({ text: text2 }) {
|
|
6235
|
+
return /* @__PURE__ */ jsxs7("span", { className: "ss-w-pill ss-w-pill--done", children: [
|
|
6236
|
+
/* @__PURE__ */ jsx9("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsx9("path", { d: "M5 12.5l4.5 4.5L19 7.5" }) }),
|
|
6237
|
+
text2
|
|
6238
|
+
] });
|
|
6239
|
+
}
|
|
6210
6240
|
function Pill({ price }) {
|
|
6211
6241
|
return /* @__PURE__ */ jsxs7("span", { className: "ss-w-pill", children: [
|
|
6212
6242
|
/* @__PURE__ */ jsx9("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsx9("path", { d: "M12 5v14M5 12h14" }) }),
|
|
6213
6243
|
price
|
|
6214
6244
|
] });
|
|
6215
6245
|
}
|
|
6216
|
-
function PriceButtons({ selections, ui, onAdd, rowLabel }) {
|
|
6246
|
+
function PriceButtons({ selections, ui, onAdd, rowLabel, sport }) {
|
|
6217
6247
|
const { oddsFormat } = useOddsSettings();
|
|
6218
|
-
const
|
|
6219
|
-
const
|
|
6220
|
-
const [
|
|
6221
|
-
const
|
|
6248
|
+
const marks = useSettledMarks();
|
|
6249
|
+
const keyOf4 = (s) => slipKey({ matchOddsId: s.matchOddsId, sport: slipSportOfWire(sport) });
|
|
6250
|
+
const [busy, setBusy] = useState20(/* @__PURE__ */ new Set());
|
|
6251
|
+
const [goneFor, setGoneFor] = useState20(null);
|
|
6252
|
+
const [toast, setToast] = useState20(null);
|
|
6253
|
+
const dismiss = useCallback15(() => setToast(null), []);
|
|
6222
6254
|
const inFlight2 = useRef17(/* @__PURE__ */ new Set());
|
|
6223
6255
|
const tap = async (s) => {
|
|
6224
|
-
if (!onAdd || inFlight2.current.has(s.matchOddsId)) return;
|
|
6256
|
+
if (!onAdd || inFlight2.current.has(s.matchOddsId) || marks.isSettled(keyOf4(s))) return;
|
|
6225
6257
|
inFlight2.current.add(s.matchOddsId);
|
|
6226
6258
|
setBusy(new Set(inFlight2.current));
|
|
6227
6259
|
setGoneFor(null);
|
|
@@ -6233,6 +6265,7 @@ function PriceButtons({ selections, ui, onAdd, rowLabel }) {
|
|
|
6233
6265
|
inFlight2.current.delete(s.matchOddsId);
|
|
6234
6266
|
setBusy(new Set(inFlight2.current));
|
|
6235
6267
|
}
|
|
6268
|
+
if (result.outcome === "added") marks.settle(keyOf4(s));
|
|
6236
6269
|
if (result.outcome === "gone") setGoneFor(selections);
|
|
6237
6270
|
if (result.toast) setToast({ toast: result.toast, for: selections });
|
|
6238
6271
|
};
|
|
@@ -6240,19 +6273,22 @@ function PriceButtons({ selections, ui, onAdd, rowLabel }) {
|
|
|
6240
6273
|
const buttons = selections.map((s) => {
|
|
6241
6274
|
const label = asRow ? rowLabel ?? s.label : s.label;
|
|
6242
6275
|
const price = formatOdds(s.formats, oddsFormat);
|
|
6276
|
+
const done = marks.isSettled(keyOf4(s));
|
|
6243
6277
|
return /* @__PURE__ */ jsxs7(
|
|
6244
6278
|
"button",
|
|
6245
6279
|
{
|
|
6246
6280
|
type: "button",
|
|
6247
6281
|
className: asRow ? "ss-w-v2-row" : "ss-w-v2-tile",
|
|
6248
|
-
"aria-label": ui.v2AddLabel(label, price),
|
|
6249
|
-
|
|
6250
|
-
|
|
6282
|
+
"aria-label": done ? `${label}, ${ui.inSlip}` : ui.v2AddLabel(label, price),
|
|
6283
|
+
"data-settled": done || void 0,
|
|
6284
|
+
"aria-disabled": done || void 0,
|
|
6285
|
+
disabled: busy.has(s.matchOddsId) || done,
|
|
6286
|
+
onClick: onAdd && !done ? () => {
|
|
6251
6287
|
void tap(s);
|
|
6252
6288
|
} : void 0,
|
|
6253
6289
|
children: [
|
|
6254
6290
|
/* @__PURE__ */ jsx9("span", { children: label }),
|
|
6255
|
-
/* @__PURE__ */ jsx9(Pill, { price })
|
|
6291
|
+
done ? /* @__PURE__ */ jsx9(DonePill, { text: ui.inSlip }) : /* @__PURE__ */ jsx9(Pill, { price })
|
|
6256
6292
|
]
|
|
6257
6293
|
},
|
|
6258
6294
|
s.matchOddsId
|
|
@@ -6269,25 +6305,25 @@ function PriceButtons({ selections, ui, onAdd, rowLabel }) {
|
|
|
6269
6305
|
// src/components/dashboard/v2/MarketRows.tsx
|
|
6270
6306
|
import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
6271
6307
|
var FACT_KEY = { GOALS_OVER_UNDER: "goals", BOTH_TEAMS_TO_SCORE: "btts", FULLTIME_RESULT: "result" };
|
|
6272
|
-
function FactRowView({ row, ui, matchId, add, lead }) {
|
|
6273
|
-
const events =
|
|
6308
|
+
function FactRowView({ row, ui, matchId, add, lead, sport }) {
|
|
6309
|
+
const events = useContext7(GreetingEventsContext);
|
|
6274
6310
|
const hook = lead ? events?.hook : { kind: "fact", factKey: FACT_KEY[row.market] ?? row.market };
|
|
6275
6311
|
const selections = useMemo6(() => [row.selection], [row.selection]);
|
|
6276
6312
|
return /* @__PURE__ */ jsxs8("div", { className: "ss-w-v2-fact", children: [
|
|
6277
6313
|
/* @__PURE__ */ jsx10("p", { children: row.stat }),
|
|
6278
|
-
/* @__PURE__ */ jsx10(PriceButtons, { selections, ui, rowLabel: row.label, onAdd: add ? (s) => add(matchId, row.market, s, hook) : void 0 })
|
|
6314
|
+
/* @__PURE__ */ jsx10(PriceButtons, { selections, ui, rowLabel: row.label, sport, onAdd: add ? (s) => add(matchId, row.market, s, hook) : void 0 })
|
|
6279
6315
|
] });
|
|
6280
6316
|
}
|
|
6281
|
-
function FactRows({ rows, hide, ui, matchId, add, lead = false }) {
|
|
6317
|
+
function FactRows({ rows, hide, ui, matchId, add, lead = false, sport }) {
|
|
6282
6318
|
const shown2 = rows.filter((r) => r.market !== hide);
|
|
6283
6319
|
if (shown2.length === 0) return null;
|
|
6284
|
-
return /* @__PURE__ */ jsx10(Fragment3, { children: shown2.map((r) => /* @__PURE__ */ jsx10(FactRowView, { row: r, ui, matchId, add, lead }, `${r.market}:${r.selection.matchOddsId}`)) });
|
|
6320
|
+
return /* @__PURE__ */ jsx10(Fragment3, { children: shown2.map((r) => /* @__PURE__ */ jsx10(FactRowView, { row: r, ui, matchId, add, lead, sport }, `${r.market}:${r.selection.matchOddsId}`)) });
|
|
6285
6321
|
}
|
|
6286
6322
|
|
|
6287
6323
|
// src/components/dashboard/v2/FeaturedCard.tsx
|
|
6288
6324
|
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
6289
6325
|
function FeaturedCard({ card, ui, tag: tag2, sport, open, onToggleMenu, onPick, picked, highlighted = false, add }) {
|
|
6290
|
-
const events =
|
|
6326
|
+
const events = useContext8(GreetingEventsContext);
|
|
6291
6327
|
const monitor = usePersonalGreeting()?.monitor;
|
|
6292
6328
|
const title = card.title ?? ui.v2GameTitle(card.home.label, card.away.label, sport);
|
|
6293
6329
|
const meta = [instantMs(card.startsAtUtc) === null ? null : ui.v2KickoffLine(card.startsAtUtc), card.competition].filter(Boolean).join(" \xB7 ");
|
|
@@ -6307,7 +6343,7 @@ function FeaturedCard({ card, ui, tag: tag2, sport, open, onToggleMenu, onPick,
|
|
|
6307
6343
|
/* @__PURE__ */ jsx11(PinToggle, { ui, monitor, market: card.market, pin: { kind: "match", matchId: Number(card.matchId), ...sport === "nba" ? { sport: "basketball" } : {} } })
|
|
6308
6344
|
] }),
|
|
6309
6345
|
meta ? /* @__PURE__ */ jsx11("p", { className: "ss-w-v2-meta", children: meta }) : null,
|
|
6310
|
-
card.hook ? /* @__PURE__ */ jsx11(FactRows, { rows: [card.hook], hide: picked, ui, matchId: card.matchId, add, lead: true }) : null,
|
|
6346
|
+
card.hook ? /* @__PURE__ */ jsx11(FactRows, { rows: [card.hook], hide: picked, ui, matchId: card.matchId, add, lead: true, sport }) : null,
|
|
6311
6347
|
/* @__PURE__ */ jsxs9("div", { className: "ss-w-v2-head", children: [
|
|
6312
6348
|
markets.length > 0 ? /* @__PURE__ */ jsxs9("button", { type: "button", className: "ss-w-v2-mkt", "aria-label": ui.v2ChangeMarket(card.marketLabel), "aria-expanded": open, onClick: onToggleMenu, children: [
|
|
6313
6349
|
card.marketLabel,
|
|
@@ -6316,20 +6352,20 @@ function FeaturedCard({ card, ui, tag: tag2, sport, open, onToggleMenu, onPick,
|
|
|
6316
6352
|
card.yourMarket ? /* @__PURE__ */ jsx11("span", { className: "ss-w-v2-tag", children: tag2 }) : null
|
|
6317
6353
|
] }),
|
|
6318
6354
|
open ? /* @__PURE__ */ jsx11(MarketMenu, { markets, current: card.market, label: ui.v2ChangeMarket(card.marketLabel), onPick }) : null,
|
|
6319
|
-
/* @__PURE__ */ jsx11(PriceButtons, { selections: card.selections, ui, onAdd: add ? (s) => add(card.matchId, card.market, s, events?.hook) : void 0 }),
|
|
6355
|
+
/* @__PURE__ */ jsx11(PriceButtons, { selections: card.selections, ui, sport, onAdd: add ? (s) => add(card.matchId, card.market, s, events?.hook) : void 0 }),
|
|
6320
6356
|
add ? /* @__PURE__ */ jsx11("p", { className: "ss-w-v2-hint", children: ui.v2PriceHint }) : null,
|
|
6321
6357
|
card.stat ? /* @__PURE__ */ jsx11("p", { className: "ss-w-v2-stat", children: card.stat }) : null,
|
|
6322
|
-
/* @__PURE__ */ jsx11(FactRows, { rows: card.facts ?? [], hide: picked, ui, matchId: card.matchId, add })
|
|
6358
|
+
/* @__PURE__ */ jsx11(FactRows, { rows: card.facts ?? [], hide: picked, ui, matchId: card.matchId, add, sport })
|
|
6323
6359
|
]
|
|
6324
6360
|
}
|
|
6325
6361
|
);
|
|
6326
6362
|
}
|
|
6327
6363
|
|
|
6328
6364
|
// src/components/dashboard/v2/useRepriceAdd.ts
|
|
6329
|
-
import { useCallback as
|
|
6365
|
+
import { useCallback as useCallback17, useMemo as useMemo7, useRef as useRef18 } from "react";
|
|
6330
6366
|
|
|
6331
6367
|
// src/nflKickoff.ts
|
|
6332
|
-
import { useEffect as useEffect19, useState as
|
|
6368
|
+
import { useEffect as useEffect19, useState as useState21 } from "react";
|
|
6333
6369
|
import { sportOf as sportOf6 } from "@sensiblestats/widget-sdk";
|
|
6334
6370
|
var MAX_TIMEOUT_MS = 2147483647;
|
|
6335
6371
|
var isNfl = (sport) => sportOf6(sport) === "americanfootball";
|
|
@@ -6357,7 +6393,7 @@ function guardLegsPreMatch(slip, legs, ui) {
|
|
|
6357
6393
|
};
|
|
6358
6394
|
}
|
|
6359
6395
|
function useNextKickoffRender(kickoffs) {
|
|
6360
|
-
const [tick, setTick] =
|
|
6396
|
+
const [tick, setTick] = useState21(0);
|
|
6361
6397
|
const key = kickoffs.map((k) => k ?? "").join("|");
|
|
6362
6398
|
useEffect19(() => {
|
|
6363
6399
|
const now = Date.now();
|
|
@@ -6371,23 +6407,16 @@ function useNextKickoffRender(kickoffs) {
|
|
|
6371
6407
|
}
|
|
6372
6408
|
|
|
6373
6409
|
// src/slipAdd.ts
|
|
6374
|
-
import { useCallback as
|
|
6410
|
+
import { useCallback as useCallback16 } from "react";
|
|
6375
6411
|
import { isAddToSlipResult, toWireSport as toWireSport4 } from "@sensiblestats/widget-sdk";
|
|
6376
6412
|
|
|
6377
6413
|
// src/trackingContext.ts
|
|
6378
|
-
import { createContext as
|
|
6414
|
+
import { createContext as createContext8, useContext as useContext9 } from "react";
|
|
6379
6415
|
var noop = () => {
|
|
6380
6416
|
};
|
|
6381
|
-
var TrackingContext =
|
|
6417
|
+
var TrackingContext = createContext8(noop);
|
|
6382
6418
|
function useTrack() {
|
|
6383
|
-
return
|
|
6384
|
-
}
|
|
6385
|
-
|
|
6386
|
-
// src/slipStateContext.ts
|
|
6387
|
-
import { createContext as createContext8, useContext as useContext9 } from "react";
|
|
6388
|
-
var SlipStateContext = createContext8(null);
|
|
6389
|
-
function useSlipState() {
|
|
6390
|
-
return useContext9(SlipStateContext);
|
|
6419
|
+
return useContext9(TrackingContext);
|
|
6391
6420
|
}
|
|
6392
6421
|
|
|
6393
6422
|
// src/slipAdd.ts
|
|
@@ -6419,7 +6448,7 @@ function useSlipAdd(slip, ui) {
|
|
|
6419
6448
|
const handler = slip.onAddToSlip;
|
|
6420
6449
|
const rawLabels = !!ui?.rawBettingLabels;
|
|
6421
6450
|
const operatorFormat = ui?.oddsFormat ?? "decimal";
|
|
6422
|
-
return
|
|
6451
|
+
return useCallback16(async (selection, { marketDeveloperName, selectionLabel, line, fact, hook }) => {
|
|
6423
6452
|
if (!handler) return { kind: "failed" };
|
|
6424
6453
|
const display = slipDisplay({ ...selection.display, market: marketDeveloperName, selection: selectionLabel, line });
|
|
6425
6454
|
const out = toHostSelection(display ? { ...selection, display } : selection, operatorFormat);
|
|
@@ -6480,11 +6509,6 @@ function useSlipAdd(slip, ui) {
|
|
|
6480
6509
|
}
|
|
6481
6510
|
|
|
6482
6511
|
// src/components/dashboard/v8/builderLegs.ts
|
|
6483
|
-
import { SPORTS as SPORTS5 } from "@sensiblestats/widget-sdk";
|
|
6484
|
-
function slipSportOfWire(sport) {
|
|
6485
|
-
const hit = Object.entries(SPORTS5).find(([, spec]) => spec.wireKey === sport);
|
|
6486
|
-
return hit ? hit[0] : void 0;
|
|
6487
|
-
}
|
|
6488
6512
|
function readLeg(raw, sport) {
|
|
6489
6513
|
const vm = toComboLegVM(raw);
|
|
6490
6514
|
const slipSport = slipSportOfWire(sport);
|
|
@@ -6532,7 +6556,7 @@ function useRepriceAdd({ conversation, locale, slip, ui, sport = "football" }) {
|
|
|
6532
6556
|
}, [slip, host, ui]);
|
|
6533
6557
|
const addToSlip = useSlipAdd(guarded, ui);
|
|
6534
6558
|
const canAdd2 = !!conversation && !!host;
|
|
6535
|
-
const add =
|
|
6559
|
+
const add = useCallback17(async (matchId, market, selection, hook) => {
|
|
6536
6560
|
if (!conversation || !slip) return { outcome: "failed" };
|
|
6537
6561
|
try {
|
|
6538
6562
|
const grid = await conversation.getBuilderGrid(locale, {
|
|
@@ -6577,14 +6601,14 @@ function MarketFirstGreeting({ section: section2, ui, slip, sport, onAct }) {
|
|
|
6577
6601
|
const personal = usePersonalGreeting();
|
|
6578
6602
|
const openTab = personal?.openTab;
|
|
6579
6603
|
const add = useRepriceAdd({ conversation: personal?.conversation ?? null, locale: ui.hostTag, slip, ui, sport });
|
|
6580
|
-
const [chosen, setChosen] =
|
|
6581
|
-
const [open, setOpen] =
|
|
6604
|
+
const [chosen, setChosen] = useState22(null);
|
|
6605
|
+
const [open, setOpen] = useState22(false);
|
|
6582
6606
|
const base = section2.coolOff ? void 0 : section2.featured;
|
|
6583
6607
|
const pickedRow = base && chosen && chosen.matchId === base.matchId ? chosen.row : null;
|
|
6584
|
-
const card = base && pickedRow ? { ...base, market: pickedRow.market, marketLabel: pickedRow.marketLabel, selections: pickedRow.selections, stat: pickedRow.stat, yourMarket:
|
|
6608
|
+
const card = base && pickedRow ? { ...base, market: pickedRow.market, marketLabel: pickedRow.marketLabel, selections: pickedRow.selections, stat: pickedRow.stat, yourMarket: pickedRow.yourMarket } : base;
|
|
6585
6609
|
const menu = base && pickedRow ? [{ market: base.market, marketLabel: base.marketLabel, yourMarket: base.yourMarket, selections: base.selections, stat: base.stat }, ...base.markets ?? []] : base?.markets ?? [];
|
|
6586
6610
|
const rootRef = useRef19(null);
|
|
6587
|
-
const [pickCount, setPickCount] =
|
|
6611
|
+
const [pickCount, setPickCount] = useState22(0);
|
|
6588
6612
|
useEffect20(() => {
|
|
6589
6613
|
if (pickCount === 0) return;
|
|
6590
6614
|
rootRef.current?.querySelector(".ss-w-v2-featured .ss-w-v2-tile, .ss-w-v2-featured > .ss-w-v2-row, .ss-w-v2-chips button")?.focus();
|
|
@@ -6630,7 +6654,7 @@ function MarketFirstGreeting({ section: section2, ui, slip, sport, onAct }) {
|
|
|
6630
6654
|
import { useEffect as useEffect24, useMemo as useMemo8 } from "react";
|
|
6631
6655
|
|
|
6632
6656
|
// src/useBuilderGrid.ts
|
|
6633
|
-
import { useCallback as
|
|
6657
|
+
import { useCallback as useCallback18, useEffect as useEffect21, useRef as useRef20, useState as useState23 } from "react";
|
|
6634
6658
|
|
|
6635
6659
|
// src/builderMemory.ts
|
|
6636
6660
|
var GRID_TTL_MS = 5 * 6e4;
|
|
@@ -6726,18 +6750,18 @@ function forget(memory3, key, flight) {
|
|
|
6726
6750
|
if (flights?.get(key) === flight) flights.delete(key);
|
|
6727
6751
|
}
|
|
6728
6752
|
function useBuilderGrid({ conversation, locale, memory: memory3, initial: initial2 }) {
|
|
6729
|
-
const [seed] =
|
|
6730
|
-
const [grid, setGrid] =
|
|
6731
|
-
const [status2, setStatus] =
|
|
6732
|
-
const [confirmed, setConfirmed] =
|
|
6733
|
-
const [answered, setAnswered] =
|
|
6753
|
+
const [seed] = useState23(() => memory3 && conversation && initial2 ? memory3.cachedGrid(gridKey(locale, initial2)) : void 0);
|
|
6754
|
+
const [grid, setGrid] = useState23(seed ?? null);
|
|
6755
|
+
const [status2, setStatus] = useState23(seed ? "ready" : "idle");
|
|
6756
|
+
const [confirmed, setConfirmed] = useState23(false);
|
|
6757
|
+
const [answered, setAnswered] = useState23(seed && initial2 ? { req: initial2, locale } : null);
|
|
6734
6758
|
const seq = useRef20(0);
|
|
6735
6759
|
const mounted = useRef20(true);
|
|
6736
6760
|
const hung = useRef20(void 0);
|
|
6737
6761
|
const waiting = useRef20(null);
|
|
6738
6762
|
const memoryRef = useRef20(memory3);
|
|
6739
6763
|
memoryRef.current = memory3;
|
|
6740
|
-
const stopWaiting =
|
|
6764
|
+
const stopWaiting = useCallback18((release, keep) => {
|
|
6741
6765
|
window.clearTimeout(hung.current);
|
|
6742
6766
|
const w = waiting.current;
|
|
6743
6767
|
waiting.current = null;
|
|
@@ -6752,7 +6776,7 @@ function useBuilderGrid({ conversation, locale, memory: memory3, initial: initia
|
|
|
6752
6776
|
stopWaiting(true);
|
|
6753
6777
|
};
|
|
6754
6778
|
}, [stopWaiting]);
|
|
6755
|
-
const request =
|
|
6779
|
+
const request = useCallback18(async (req) => {
|
|
6756
6780
|
if (!conversation) return;
|
|
6757
6781
|
const mine = ++seq.current;
|
|
6758
6782
|
const key = memory3 ? gridKey(locale, req) : null;
|
|
@@ -6828,13 +6852,13 @@ function useBuilderGrid({ conversation, locale, memory: memory3, initial: initia
|
|
|
6828
6852
|
}
|
|
6829
6853
|
|
|
6830
6854
|
// src/components/AddToSlipButton.tsx
|
|
6831
|
-
import { useCallback as
|
|
6855
|
+
import { useCallback as useCallback19, useState as useState24 } from "react";
|
|
6832
6856
|
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
6833
6857
|
function SlipButton({ selection, marketDeveloperName, selectionLabel, line, slip, ui, price, ariaLabel, hold, fact }) {
|
|
6834
|
-
const [pending, setPending] =
|
|
6835
|
-
const [settledLocal, setSettledLocal] =
|
|
6836
|
-
const [toast, setToast] =
|
|
6837
|
-
const dismiss =
|
|
6858
|
+
const [pending, setPending] = useState24(false);
|
|
6859
|
+
const [settledLocal, setSettledLocal] = useState24(false);
|
|
6860
|
+
const [toast, setToast] = useState24(null);
|
|
6861
|
+
const dismiss = useCallback19(() => setToast(null), []);
|
|
6838
6862
|
const add = useSlipAdd(slip, ui);
|
|
6839
6863
|
const slipState = useSlipState();
|
|
6840
6864
|
const { oddsFormat } = useOddsSettings();
|
|
@@ -6862,6 +6886,7 @@ function SlipButton({ selection, marketDeveloperName, selectionLabel, line, slip
|
|
|
6862
6886
|
type: "button",
|
|
6863
6887
|
className: "ss-w-slip-btn ss-w-slip-btn--price",
|
|
6864
6888
|
"data-settled": settled || void 0,
|
|
6889
|
+
"aria-disabled": settled || void 0,
|
|
6865
6890
|
"aria-label": `${price.ariaLabel}, ${settled ? ui.inSlip : ui.addToSlip}`,
|
|
6866
6891
|
disabled: pending || settled || hold,
|
|
6867
6892
|
onClick,
|
|
@@ -6904,7 +6929,7 @@ function AddToSlipButton({ it, slip, ui }) {
|
|
|
6904
6929
|
}
|
|
6905
6930
|
|
|
6906
6931
|
// src/components/MarketOddsCardList.tsx
|
|
6907
|
-
import { useEffect as useEffect23, useState as
|
|
6932
|
+
import { useEffect as useEffect23, useState as useState29 } from "react";
|
|
6908
6933
|
import { mayPinOrSlip as mayPinOrSlip4, slipSportOf as slipSportOf5, sportOf as sportOf8 } from "@sensiblestats/widget-sdk";
|
|
6909
6934
|
|
|
6910
6935
|
// src/components/OddsMovementBadge.tsx
|
|
@@ -6932,14 +6957,14 @@ function OddsMovementBadge({
|
|
|
6932
6957
|
}
|
|
6933
6958
|
|
|
6934
6959
|
// src/components/Crest.tsx
|
|
6935
|
-
import { useState as
|
|
6960
|
+
import { useState as useState25 } from "react";
|
|
6936
6961
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
6937
6962
|
function initials(name) {
|
|
6938
6963
|
return (name ?? "").trim().slice(0, 1).toUpperCase() || "?";
|
|
6939
6964
|
}
|
|
6940
6965
|
function Crest({ url, name, kind, abbr }) {
|
|
6941
6966
|
const cls = kind === "comp" ? "ss-w-bi-comp-logo" : kind === "player" ? "ss-w-bi-crest ss-w-bi-crest--player" : "ss-w-bi-crest";
|
|
6942
|
-
const [failed, setFailed] =
|
|
6967
|
+
const [failed, setFailed] = useState25(false);
|
|
6943
6968
|
if (url && !failed) {
|
|
6944
6969
|
return /* @__PURE__ */ jsx15("img", { className: cls, src: url, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
6945
6970
|
}
|
|
@@ -6948,11 +6973,11 @@ function Crest({ url, name, kind, abbr }) {
|
|
|
6948
6973
|
}
|
|
6949
6974
|
|
|
6950
6975
|
// src/components/PriceHistoryButton.tsx
|
|
6951
|
-
import { useCallback as
|
|
6976
|
+
import { useCallback as useCallback20, useState as useState26 } from "react";
|
|
6952
6977
|
import { jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
6953
6978
|
function PriceHistoryButton({ selection, monitor, ui, displayLabel }) {
|
|
6954
|
-
const [toast, setToast] =
|
|
6955
|
-
const dismiss =
|
|
6979
|
+
const [toast, setToast] = useState26(null);
|
|
6980
|
+
const dismiss = useCallback20(() => setToast(null), []);
|
|
6956
6981
|
const log = useEventLog();
|
|
6957
6982
|
if (!monitor || !monitor.enabled) return null;
|
|
6958
6983
|
const name = displayLabel ?? joinSelection(selection.selectionLabel ?? void 0, selection.line ?? void 0);
|
|
@@ -6979,7 +7004,7 @@ function PriceHistoryButton({ selection, monitor, ui, displayLabel }) {
|
|
|
6979
7004
|
}
|
|
6980
7005
|
|
|
6981
7006
|
// src/components/LiveFactBlock.tsx
|
|
6982
|
-
import { useRef as useRef22, useState as
|
|
7007
|
+
import { useRef as useRef22, useState as useState27 } from "react";
|
|
6983
7008
|
import { localIdOf as localIdOf4, qualifiedId as qualifiedId2, toWireSport as toWireSport5 } from "@sensiblestats/widget-sdk";
|
|
6984
7009
|
|
|
6985
7010
|
// src/useFactView.ts
|
|
@@ -7040,7 +7065,7 @@ function evidenceText(f, ui) {
|
|
|
7040
7065
|
return parts2.length > 0 ? parts2.join(" \xB7 ") : void 0;
|
|
7041
7066
|
}
|
|
7042
7067
|
function LiveFactBlock({ facts, match, ui, slip, onAsk, scope }) {
|
|
7043
|
-
const [expanded, setExpanded] =
|
|
7068
|
+
const [expanded, setExpanded] = useState27(false);
|
|
7044
7069
|
const { oddsFormat } = useOddsSettings();
|
|
7045
7070
|
const log = useEventLog();
|
|
7046
7071
|
const sectionRef = useRef22(null);
|
|
@@ -7131,7 +7156,7 @@ function LiveFactBlock({ facts, match, ui, slip, onAsk, scope }) {
|
|
|
7131
7156
|
}
|
|
7132
7157
|
|
|
7133
7158
|
// src/components/AllMarketsButton.tsx
|
|
7134
|
-
import { useCallback as
|
|
7159
|
+
import { useCallback as useCallback21, useState as useState28 } from "react";
|
|
7135
7160
|
import { sportOf as sportOf7 } from "@sensiblestats/widget-sdk";
|
|
7136
7161
|
import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
7137
7162
|
function allMarketsCount(vm, monitor) {
|
|
@@ -7140,8 +7165,8 @@ function allMarketsCount(vm, monitor) {
|
|
|
7140
7165
|
}
|
|
7141
7166
|
function AllMarketsButton({ vm, count: count2, monitor, ui, surface }) {
|
|
7142
7167
|
const log = useEventLog();
|
|
7143
|
-
const [toast, setToast] =
|
|
7144
|
-
const dismiss =
|
|
7168
|
+
const [toast, setToast] = useState28(null);
|
|
7169
|
+
const dismiss = useCallback21(() => setToast(null), []);
|
|
7145
7170
|
const onClick = () => {
|
|
7146
7171
|
if (monitor.pinMatch({ matchId: vm.matchId, marketDeveloperName: vm.marketDeveloperName }) === "match_limit") {
|
|
7147
7172
|
setToast({ kind: "error", text: ui.matchLimitToast });
|
|
@@ -7206,7 +7231,7 @@ function fmtHhMm(iso, tag2, clock3, timeZone) {
|
|
|
7206
7231
|
return formatTime(iso, tag2, clock3, { timeZone });
|
|
7207
7232
|
}
|
|
7208
7233
|
function MarketOddsCard({ vm, ui, slip, monitor, inSlipIds, hideHeader, pinRef }) {
|
|
7209
|
-
const [open, setOpen] =
|
|
7234
|
+
const [open, setOpen] = useState29(false);
|
|
7210
7235
|
useNextKickoffRender(isNfl(vm.sport) ? [vm.kickoffUtc] : []);
|
|
7211
7236
|
const kickoffFallback = vm.kickoffUtc ? ui.bettingKickoff(vm.kickoffUtc) : void 0;
|
|
7212
7237
|
const kickoff = vm.kickoffLabel ?? (kickoffFallback ? `${kickoffFallback.dayLabel} ${kickoffFallback.time}` : void 0);
|
|
@@ -7217,7 +7242,7 @@ function MarketOddsCard({ vm, ui, slip, monitor, inSlipIds, hideHeader, pinRef }
|
|
|
7217
7242
|
const asOfMs = live ? new Date(live.asOfUtc).getTime() : NaN;
|
|
7218
7243
|
const isStale = live != null && !isClosed && (vm.awaitingLiveUpdate === true || Date.now() - asOfMs > STALE_AFTER_MS);
|
|
7219
7244
|
const staleTime = isStale && live ? fmtHhMm(live.asOfUtc, ui.locale, clockOf(ui), ui.timeZone) : null;
|
|
7220
|
-
const [, setStaleTick] =
|
|
7245
|
+
const [, setStaleTick] = useState29(0);
|
|
7221
7246
|
const watchStale = live != null && !isClosed && !isStale;
|
|
7222
7247
|
useEffect23(() => {
|
|
7223
7248
|
if (!watchStale) return;
|
|
@@ -7408,10 +7433,10 @@ function CardLine({ card, ui, slip, sport, marketKey, conversation, operatorUser
|
|
|
7408
7433
|
}
|
|
7409
7434
|
|
|
7410
7435
|
// src/components/dashboard/v8/Pic.tsx
|
|
7411
|
-
import { useState as
|
|
7436
|
+
import { useState as useState30 } from "react";
|
|
7412
7437
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
7413
7438
|
function Pic({ src, kind = "team" }) {
|
|
7414
|
-
const [failed, setFailed] =
|
|
7439
|
+
const [failed, setFailed] = useState30(null);
|
|
7415
7440
|
if (!src || failed === src) return null;
|
|
7416
7441
|
return /* @__PURE__ */ jsx21("img", { className: kind === "player" ? "ss-w-v8-pic ss-w-v8-pic--player" : "ss-w-v8-pic", src, alt: "", "aria-hidden": "true", onError: () => setFailed(src) });
|
|
7417
7442
|
}
|
|
@@ -7529,7 +7554,7 @@ function FavouritesInvite({ ui, sport, onOpen }) {
|
|
|
7529
7554
|
}
|
|
7530
7555
|
|
|
7531
7556
|
// src/components/dashboard/v8/useFollow.ts
|
|
7532
|
-
import { useState as
|
|
7557
|
+
import { useState as useState31 } from "react";
|
|
7533
7558
|
|
|
7534
7559
|
// src/favouriteKinds.ts
|
|
7535
7560
|
function favouriteKinds(sport) {
|
|
@@ -7548,7 +7573,7 @@ function favouriteKindLabel(ui, sport, kind) {
|
|
|
7548
7573
|
var isFavouriteKind = (kind) => kind === "team" || kind === "player" || kind === "competition";
|
|
7549
7574
|
var keyOf2 = (sport, t) => `${sport}:${t.kind}:${t.id}`;
|
|
7550
7575
|
function useFollow(controller, ui, holds, sport) {
|
|
7551
|
-
const [notice, setNotice] =
|
|
7576
|
+
const [notice, setNotice] = useState31(null);
|
|
7552
7577
|
const isOpen = (t) => isFavouriteKind(t.kind) && !holds.followed.has(keyOf2(sport, t)) && !controller.isStarred(t.kind, t.id);
|
|
7553
7578
|
const follow = async (t) => {
|
|
7554
7579
|
if (!isFavouriteKind(t.kind)) return;
|
|
@@ -7990,7 +8015,7 @@ function GreetingDashboard({ dashboard, dashboards, defaultSport, greeting, onTa
|
|
|
7990
8015
|
const { oddsFormat } = useOddsSettings();
|
|
7991
8016
|
const scope = useSportScope();
|
|
7992
8017
|
const sets = switchSets(dashboards);
|
|
7993
|
-
const [selected, setSelected] =
|
|
8018
|
+
const [selected, setSelected] = useState32(() => initialSport(sets, defaultSport));
|
|
7994
8019
|
const active = sets?.find((s) => s.sport === selected) ?? null;
|
|
7995
8020
|
const shown2 = active ? active.dashboard : dashboard;
|
|
7996
8021
|
const personal = shown2.personal;
|
|
@@ -8038,33 +8063,33 @@ function GreetingDashboard({ dashboard, dashboards, defaultSport, greeting, onTa
|
|
|
8038
8063
|
}
|
|
8039
8064
|
|
|
8040
8065
|
// src/useScheduleSport.ts
|
|
8041
|
-
import { useCallback as
|
|
8066
|
+
import { useCallback as useCallback22, useEffect as useEffect27, useState as useState33 } from "react";
|
|
8042
8067
|
function useScheduleSport(offered) {
|
|
8043
|
-
const [chosen, setChosen] =
|
|
8068
|
+
const [chosen, setChosen] = useState33("all");
|
|
8044
8069
|
const sport = chosen === "all" || offered.includes(chosen) ? chosen : "all";
|
|
8045
8070
|
useEffect27(() => {
|
|
8046
8071
|
if (sport !== chosen) setChosen("all");
|
|
8047
8072
|
}, [sport, chosen]);
|
|
8048
|
-
const setSport =
|
|
8073
|
+
const setSport = useCallback22((s) => setChosen(s), []);
|
|
8049
8074
|
return { sport, setSport, offered };
|
|
8050
8075
|
}
|
|
8051
8076
|
|
|
8052
8077
|
// src/useMatchesDay.ts
|
|
8053
|
-
import { useCallback as
|
|
8078
|
+
import { useCallback as useCallback24, useMemo as useMemo11, useState as useState35 } from "react";
|
|
8054
8079
|
|
|
8055
8080
|
// src/useScheduleDay.ts
|
|
8056
|
-
import { useCallback as
|
|
8081
|
+
import { useCallback as useCallback23, useEffect as useEffect28, useRef as useRef23, useState as useState34 } from "react";
|
|
8057
8082
|
var EMPTY = [];
|
|
8058
8083
|
function useScheduleDay(opts) {
|
|
8059
8084
|
const { localDate, today, todayGroups, enabled, resetKey, timeZone } = opts;
|
|
8060
8085
|
const getRef = useRef23(opts.getSchedule);
|
|
8061
8086
|
getRef.current = opts.getSchedule;
|
|
8062
8087
|
const daysRef = useRef23(/* @__PURE__ */ new Map());
|
|
8063
|
-
const [fetched, setFetched] =
|
|
8064
|
-
const [retryKey, setRetryKey] =
|
|
8065
|
-
const [seenDate, setSeenDate] =
|
|
8066
|
-
const [seenReset, setSeenReset] =
|
|
8067
|
-
const [seenZone, setSeenZone] =
|
|
8088
|
+
const [fetched, setFetched] = useState34({ status: "idle", groups: EMPTY });
|
|
8089
|
+
const [retryKey, setRetryKey] = useState34(0);
|
|
8090
|
+
const [seenDate, setSeenDate] = useState34(localDate);
|
|
8091
|
+
const [seenReset, setSeenReset] = useState34(resetKey);
|
|
8092
|
+
const [seenZone, setSeenZone] = useState34(timeZone);
|
|
8068
8093
|
if (seenDate !== localDate) {
|
|
8069
8094
|
setSeenDate(localDate);
|
|
8070
8095
|
setFetched({ status: "idle", groups: EMPTY });
|
|
@@ -8098,7 +8123,7 @@ function useScheduleDay(opts) {
|
|
|
8098
8123
|
cancelled = true;
|
|
8099
8124
|
};
|
|
8100
8125
|
}, [localDate, isToday, enabled, retryKey, resetKey, timeZone]);
|
|
8101
|
-
const retry =
|
|
8126
|
+
const retry = useCallback23(() => {
|
|
8102
8127
|
setRetryKey((k) => k + 1);
|
|
8103
8128
|
}, []);
|
|
8104
8129
|
if (isToday) return { status: "ready", groups: todayGroups, retry };
|
|
@@ -8125,8 +8150,8 @@ function useMatchesDay({ discovery, day, sport, getSchedule, enabled, timeZone }
|
|
|
8125
8150
|
return { ...loaded, chips, selected };
|
|
8126
8151
|
}
|
|
8127
8152
|
function useMatchesDayPick(today) {
|
|
8128
|
-
const [pick, setPick] =
|
|
8129
|
-
const setDay =
|
|
8153
|
+
const [pick, setPick] = useState35(null);
|
|
8154
|
+
const setDay = useCallback24((d) => setPick({ day: d, madeOn: today }), [today]);
|
|
8130
8155
|
return [pick !== null && pick.madeOn === today ? pick.day : today, setDay];
|
|
8131
8156
|
}
|
|
8132
8157
|
|
|
@@ -8223,7 +8248,7 @@ var WIRE_TO_PUBLIC = {
|
|
|
8223
8248
|
};
|
|
8224
8249
|
|
|
8225
8250
|
// src/popupTelemetry.ts
|
|
8226
|
-
import { useCallback as
|
|
8251
|
+
import { useCallback as useCallback25, useEffect as useEffect29, useRef as useRef24 } from "react";
|
|
8227
8252
|
function usePopupTelemetry(log, isOpen, popupText, dismissPopup, confirmedShown) {
|
|
8228
8253
|
const shownRef = useRef24(/* @__PURE__ */ new Set());
|
|
8229
8254
|
const closedTextRef = useRef24(null);
|
|
@@ -8240,14 +8265,14 @@ function usePopupTelemetry(log, isOpen, popupText, dismissPopup, confirmedShown)
|
|
|
8240
8265
|
log?.log({ name: "popup_shown" });
|
|
8241
8266
|
}
|
|
8242
8267
|
}, [log, isOpen, popupText, confirmedShown]);
|
|
8243
|
-
return
|
|
8268
|
+
return useCallback25(() => {
|
|
8244
8269
|
log?.log({ name: "popup_dismissed" });
|
|
8245
8270
|
dismissPopup();
|
|
8246
8271
|
}, [log, dismissPopup]);
|
|
8247
8272
|
}
|
|
8248
8273
|
|
|
8249
8274
|
// src/mobileBinding.ts
|
|
8250
|
-
import { useCallback as
|
|
8275
|
+
import { useCallback as useCallback26, useEffect as useEffect30, useRef as useRef25, useState as useState36 } from "react";
|
|
8251
8276
|
var CLEARED = { text: null, asks: [] };
|
|
8252
8277
|
function useMobileBinding(args) {
|
|
8253
8278
|
const { binding, panelOpen, popupText, asks, cta, price } = args;
|
|
@@ -8258,7 +8283,7 @@ function useMobileBinding(args) {
|
|
|
8258
8283
|
const backRef = useRef25(null);
|
|
8259
8284
|
const priceRef = useRef25(null);
|
|
8260
8285
|
const priceInFlight = useRef25(/* @__PURE__ */ new Set()).current;
|
|
8261
|
-
const [confirmedShown, setConfirmedShown] =
|
|
8286
|
+
const [confirmedShown, setConfirmedShown] = useState36(null);
|
|
8262
8287
|
const teaserKey = panelOpen || !popupText ? "" : JSON.stringify([popupText, asks.map((a) => a.label), cta, price]);
|
|
8263
8288
|
const reported = useRef25({ binding: void 0, key: "" });
|
|
8264
8289
|
useEffect30(() => {
|
|
@@ -8295,14 +8320,14 @@ function useMobileBinding(args) {
|
|
|
8295
8320
|
});
|
|
8296
8321
|
return () => binding.onHandle(null);
|
|
8297
8322
|
}, [binding]);
|
|
8298
|
-
const onCloseRequested =
|
|
8299
|
-
const onRegisterBack =
|
|
8323
|
+
const onCloseRequested = useCallback26(() => bindingRef.current?.onCloseRequested(), []);
|
|
8324
|
+
const onRegisterBack = useCallback26((fn) => {
|
|
8300
8325
|
backRef.current = fn;
|
|
8301
8326
|
}, []);
|
|
8302
|
-
const onRegisterPrice =
|
|
8327
|
+
const onRegisterPrice = useCallback26((fn) => {
|
|
8303
8328
|
priceRef.current = fn;
|
|
8304
8329
|
}, []);
|
|
8305
|
-
const onPriceResult =
|
|
8330
|
+
const onPriceResult = useCallback26((result) => bindingRef.current?.onPriceResult(result), []);
|
|
8306
8331
|
if (!binding) return { confirmedShown: void 0, onCloseRequested: void 0, onRegisterBack: void 0, onRegisterPrice: void 0, onPriceResult: void 0, priceInFlight: void 0 };
|
|
8307
8332
|
return { confirmedShown, onCloseRequested, onRegisterBack, onRegisterPrice, onPriceResult, priceInFlight };
|
|
8308
8333
|
}
|
|
@@ -8323,13 +8348,13 @@ function useOpenTelemetry(log, isOpen) {
|
|
|
8323
8348
|
}
|
|
8324
8349
|
|
|
8325
8350
|
// src/components/ChatFab.tsx
|
|
8326
|
-
import { useEffect as useEffect32, useRef as useRef27, useState as
|
|
8351
|
+
import { useEffect as useEffect32, useRef as useRef27, useState as useState38 } from "react";
|
|
8327
8352
|
|
|
8328
8353
|
// src/components/BrandMark.tsx
|
|
8329
|
-
import { useState as
|
|
8354
|
+
import { useState as useState37 } from "react";
|
|
8330
8355
|
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
8331
8356
|
function BrandMark({ logoUrl, className }) {
|
|
8332
|
-
const [failed, setFailed] =
|
|
8357
|
+
const [failed, setFailed] = useState37(false);
|
|
8333
8358
|
if (!logoUrl || failed) return /* @__PURE__ */ jsx34(SsMark, { className });
|
|
8334
8359
|
return /* @__PURE__ */ jsx34("img", { className, src: logoUrl, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
8335
8360
|
}
|
|
@@ -8373,7 +8398,7 @@ function ChatFab({ label, busy = false, greeting, popupText, logoUrl, onOpen, on
|
|
|
8373
8398
|
const bubble = popupText ?? greeting;
|
|
8374
8399
|
const hidden = busy && !label;
|
|
8375
8400
|
const track = useTrack();
|
|
8376
|
-
const [intro, setIntro] =
|
|
8401
|
+
const [intro, setIntro] = useState38(false);
|
|
8377
8402
|
const armedRef = useRef27(introAllowed);
|
|
8378
8403
|
useEffect32(() => {
|
|
8379
8404
|
if (armedRef.current && bubble) {
|
|
@@ -8401,22 +8426,32 @@ import { jsx as jsx37 } from "react/jsx-runtime";
|
|
|
8401
8426
|
function BubblePrice({ matchId, price, conversation, slip, ui, hook, sport }) {
|
|
8402
8427
|
const selections = useMemo12(() => [price.selection], [price.selection]);
|
|
8403
8428
|
const add = useRepriceAdd({ conversation, locale: ui.hostTag, slip, ui, sport });
|
|
8404
|
-
return /* @__PURE__ */ jsx37("div", { className: "ss-w-greeting-pick", children: /* @__PURE__ */ jsx37(PriceButtons, { selections, ui, rowLabel: price.label || price.selection.label, onAdd: add ? (s) => add(matchId, price.market, s, hook) : void 0 }) });
|
|
8429
|
+
return /* @__PURE__ */ jsx37("div", { className: "ss-w-greeting-pick", children: /* @__PURE__ */ jsx37(PriceButtons, { selections, ui, rowLabel: price.label || price.selection.label, sport, onAdd: add ? (s) => add(matchId, price.market, s, hook) : void 0 }) });
|
|
8405
8430
|
}
|
|
8406
8431
|
|
|
8407
8432
|
// src/components/MobileBubblePrice.tsx
|
|
8408
8433
|
import { useEffect as useEffect33, useRef as useRef28 } from "react";
|
|
8409
8434
|
function MobileBubblePrice(props) {
|
|
8410
8435
|
const add = useRepriceAdd({ conversation: props.conversation, locale: props.ui.hostTag, slip: props.slip, ui: props.ui, sport: props.sport });
|
|
8411
|
-
const
|
|
8412
|
-
latest
|
|
8436
|
+
const marks = useSettledMarks();
|
|
8437
|
+
const latest = useRef28({ props, add, marks });
|
|
8438
|
+
latest.current = { props, add, marks };
|
|
8413
8439
|
const { onRegister, inFlight: inFlight2 } = props;
|
|
8414
8440
|
useEffect33(() => {
|
|
8415
8441
|
onRegister(() => {
|
|
8416
|
-
const { props: p, add: run } = latest.current;
|
|
8442
|
+
const { props: p, add: run, marks: m } = latest.current;
|
|
8417
8443
|
const id = p.price.selection.matchOddsId;
|
|
8418
8444
|
if (inFlight2.has(id)) return;
|
|
8445
|
+
const key = slipKey({ matchOddsId: id, sport: slipSportOfWire(p.sport) });
|
|
8446
|
+
if (m.isSettled(key)) {
|
|
8447
|
+
try {
|
|
8448
|
+
p.onResult({ matchOddsId: id, outcome: "added", text: null });
|
|
8449
|
+
} catch {
|
|
8450
|
+
}
|
|
8451
|
+
return;
|
|
8452
|
+
}
|
|
8419
8453
|
const report = (r) => {
|
|
8454
|
+
if (r.outcome === "added") latest.current.marks.settle(key);
|
|
8420
8455
|
const now = latest.current.props;
|
|
8421
8456
|
try {
|
|
8422
8457
|
now.onResult({ matchOddsId: id, outcome: r.outcome, text: r.toast?.text ?? (r.outcome === "gone" ? now.ui.v2PriceGone : null) });
|
|
@@ -8438,10 +8473,10 @@ function MobileBubblePrice(props) {
|
|
|
8438
8473
|
}
|
|
8439
8474
|
|
|
8440
8475
|
// src/components/ChatPanel.tsx
|
|
8441
|
-
import { useCallback as
|
|
8476
|
+
import { useCallback as useCallback30, useEffect as useEffect58, useLayoutEffect as useLayoutEffect2, useMemo as useMemo16, useRef as useRef49, useState as useState88 } from "react";
|
|
8442
8477
|
|
|
8443
8478
|
// src/components/ChatHeader.tsx
|
|
8444
|
-
import { useEffect as useEffect34, useRef as useRef29, useState as
|
|
8479
|
+
import { useEffect as useEffect34, useRef as useRef29, useState as useState39 } from "react";
|
|
8445
8480
|
import { jsx as jsx38, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
8446
8481
|
function ChatHeader({
|
|
8447
8482
|
onClose,
|
|
@@ -8457,7 +8492,7 @@ function ChatHeader({
|
|
|
8457
8492
|
onOpenFavourites,
|
|
8458
8493
|
favouritesLabel
|
|
8459
8494
|
}) {
|
|
8460
|
-
const [menuOpen, setMenuOpen] =
|
|
8495
|
+
const [menuOpen, setMenuOpen] = useState39(false);
|
|
8461
8496
|
const wrapRef = useRef29(null);
|
|
8462
8497
|
const kebabRef = useRef29(null);
|
|
8463
8498
|
const firstItemRef = useRef29(null);
|
|
@@ -8559,7 +8594,7 @@ function ChatHeader({
|
|
|
8559
8594
|
import { useEffect as useEffect38, useRef as useRef32 } from "react";
|
|
8560
8595
|
|
|
8561
8596
|
// src/components/ChatMessage.tsx
|
|
8562
|
-
import { useState as
|
|
8597
|
+
import { useState as useState50 } from "react";
|
|
8563
8598
|
|
|
8564
8599
|
// src/components/Markdown.tsx
|
|
8565
8600
|
import ReactMarkdown from "react-markdown";
|
|
@@ -8577,7 +8612,7 @@ function Markdown({ text: text2 }) {
|
|
|
8577
8612
|
}
|
|
8578
8613
|
|
|
8579
8614
|
// src/components/EntityCardList.tsx
|
|
8580
|
-
import { useState as
|
|
8615
|
+
import { useState as useState40 } from "react";
|
|
8581
8616
|
import { jsx as jsx40, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
8582
8617
|
var MAX_VISIBLE = 3;
|
|
8583
8618
|
var RECORD_RE = /^(\d+)-(\d+)-(\d+)$/;
|
|
@@ -8680,7 +8715,7 @@ function ScopeTabs({ scopes, active, onSelect }) {
|
|
|
8680
8715
|
)) });
|
|
8681
8716
|
}
|
|
8682
8717
|
function EntityCardItem({ c }) {
|
|
8683
|
-
const [active, setActive] =
|
|
8718
|
+
const [active, setActive] = useState40(0);
|
|
8684
8719
|
const hasBody = c.scopes.length > 0;
|
|
8685
8720
|
if (!hasBody) {
|
|
8686
8721
|
return /* @__PURE__ */ jsx40("div", { className: "ss-w-ecard ss-w-ecard-bare", "data-kind": c.kind, children: /* @__PURE__ */ jsx40(CardHeader, { c, showScopeCrest: false }) });
|
|
@@ -8695,7 +8730,7 @@ function EntityCardItem({ c }) {
|
|
|
8695
8730
|
] });
|
|
8696
8731
|
}
|
|
8697
8732
|
function EntityCardList({ cards, disabled, showLessLabel, showMoreLabel }) {
|
|
8698
|
-
const [expanded, setExpanded] =
|
|
8733
|
+
const [expanded, setExpanded] = useState40(false);
|
|
8699
8734
|
if (cards.length === 0) return null;
|
|
8700
8735
|
const visible = expanded ? cards : cards.slice(0, MAX_VISIBLE);
|
|
8701
8736
|
const overflow = cards.length - MAX_VISIBLE;
|
|
@@ -8847,17 +8882,17 @@ function BettingInsightList({ insights, ui, slip, monitor }) {
|
|
|
8847
8882
|
import { useId } from "react";
|
|
8848
8883
|
|
|
8849
8884
|
// src/components/AddAllToSlipButton.tsx
|
|
8850
|
-
import { useCallback as
|
|
8885
|
+
import { useCallback as useCallback27, useState as useState41 } from "react";
|
|
8851
8886
|
import { jsx as jsx43, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
8852
8887
|
function AddAllToSlipButton({ legs, slip, ui, labels, combo, chatCombo, sizeless, hold, onStartedGame }) {
|
|
8853
8888
|
const add = useSlipAdd(slip, ui);
|
|
8854
8889
|
const slipState = useSlipState();
|
|
8855
8890
|
const log = useEventLog();
|
|
8856
8891
|
const track = useTrack();
|
|
8857
|
-
const [pending, setPending] =
|
|
8858
|
-
const [settledLocal, setSettledLocal] =
|
|
8859
|
-
const [toast, setToast] =
|
|
8860
|
-
const dismiss =
|
|
8892
|
+
const [pending, setPending] = useState41(false);
|
|
8893
|
+
const [settledLocal, setSettledLocal] = useState41({});
|
|
8894
|
+
const [toast, setToast] = useState41(null);
|
|
8895
|
+
const dismiss = useCallback27(() => setToast(null), []);
|
|
8861
8896
|
if (!slip.onAddToSlip || legs.length < 2) return null;
|
|
8862
8897
|
const settled = slipState ? slipState.settled : settledLocal;
|
|
8863
8898
|
const open = legs.filter((leg) => !settled[slipKey(leg)]);
|
|
@@ -9571,7 +9606,7 @@ function NbaInsightList({ insights, ui, slip, monitor }) {
|
|
|
9571
9606
|
}
|
|
9572
9607
|
|
|
9573
9608
|
// src/components/NflInsightList.tsx
|
|
9574
|
-
import { useState as
|
|
9609
|
+
import { useState as useState42 } from "react";
|
|
9575
9610
|
|
|
9576
9611
|
// src/strings/types.ts
|
|
9577
9612
|
var fillNfl = (template, values) => template.replace(/\{(\w+)\}/g, (whole, key) => key in values ? String(values[key]) : whole);
|
|
@@ -9588,7 +9623,7 @@ function teamImage(vm, abbr) {
|
|
|
9588
9623
|
return void 0;
|
|
9589
9624
|
}
|
|
9590
9625
|
function Badge({ abbr, url }) {
|
|
9591
|
-
const [failed, setFailed] =
|
|
9626
|
+
const [failed, setFailed] = useState42(false);
|
|
9592
9627
|
if (url && !failed) {
|
|
9593
9628
|
return /* @__PURE__ */ jsx46("img", { className: "ss-w-nfl-badge ss-w-nfl-badge--img", src: url, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
9594
9629
|
}
|
|
@@ -10199,7 +10234,7 @@ function TennisInsightList({ insights, ui }) {
|
|
|
10199
10234
|
}
|
|
10200
10235
|
|
|
10201
10236
|
// src/components/CompactOddsList.tsx
|
|
10202
|
-
import { useEffect as useEffect35, useRef as useRef30, useState as
|
|
10237
|
+
import { useEffect as useEffect35, useRef as useRef30, useState as useState43 } from "react";
|
|
10203
10238
|
import { mayPinOrSlip as mayPinOrSlip5, slipSportOf as slipSportOf6, sportOf as sportOf10 } from "@sensiblestats/widget-sdk";
|
|
10204
10239
|
|
|
10205
10240
|
// src/compactList.ts
|
|
@@ -10321,9 +10356,9 @@ function Row2({ row, columns, ui, slip, monitor, rowRef }) {
|
|
|
10321
10356
|
] });
|
|
10322
10357
|
}
|
|
10323
10358
|
function CompactOddsList({ list, ui, slip, monitor }) {
|
|
10324
|
-
const [shown2, setShown] =
|
|
10359
|
+
const [shown2, setShown] = useState43(COMPACT_PAGE);
|
|
10325
10360
|
const hidden = list.rowCount - shown2;
|
|
10326
|
-
const [focusIndex, setFocusIndex] =
|
|
10361
|
+
const [focusIndex, setFocusIndex] = useState43(null);
|
|
10327
10362
|
const focusRef = useRef30(null);
|
|
10328
10363
|
useEffect35(() => {
|
|
10329
10364
|
if (focusIndex !== null) focusRef.current?.focus();
|
|
@@ -10560,7 +10595,7 @@ function FixtureCard({ card, ui }) {
|
|
|
10560
10595
|
}
|
|
10561
10596
|
|
|
10562
10597
|
// src/components/dashboard/CountdownCard.tsx
|
|
10563
|
-
import { Fragment as Fragment15, useEffect as useEffect36, useState as
|
|
10598
|
+
import { Fragment as Fragment15, useEffect as useEffect36, useState as useState44 } from "react";
|
|
10564
10599
|
import { jsx as jsx52, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
10565
10600
|
var DAY_MS3 = 864e5;
|
|
10566
10601
|
function remainingSegments(kickoffUnix, nowMs, withSeconds) {
|
|
@@ -10579,8 +10614,8 @@ function remainingSegments(kickoffUnix, nowMs, withSeconds) {
|
|
|
10579
10614
|
function CountdownCard({ card, ui }) {
|
|
10580
10615
|
const { data } = card;
|
|
10581
10616
|
const unitLabel = { d: data.daysUnit, h: data.hoursUnit, m: data.minutesUnit, s: data.secondsUnit };
|
|
10582
|
-
const [nowMs, setNowMs] =
|
|
10583
|
-
const [reduced] =
|
|
10617
|
+
const [nowMs, setNowMs] = useState44(() => Date.now());
|
|
10618
|
+
const [reduced] = useState44(
|
|
10584
10619
|
() => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches
|
|
10585
10620
|
);
|
|
10586
10621
|
const withinDay = data.kickoffUnix * 1e3 - nowMs < DAY_MS3;
|
|
@@ -10603,7 +10638,7 @@ function CountdownCard({ card, ui }) {
|
|
|
10603
10638
|
}
|
|
10604
10639
|
|
|
10605
10640
|
// src/components/dashboard/InjuriesCard.tsx
|
|
10606
|
-
import { useState as
|
|
10641
|
+
import { useState as useState45 } from "react";
|
|
10607
10642
|
import { jsx as jsx53, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
10608
10643
|
var SHOWN = 3;
|
|
10609
10644
|
function ColHead({ name, crestUrl }) {
|
|
@@ -10626,7 +10661,7 @@ function InjuryList({ rows, emptyLabel, limit }) {
|
|
|
10626
10661
|
}
|
|
10627
10662
|
function InjuriesCard({ card, ui }) {
|
|
10628
10663
|
const { data } = card;
|
|
10629
|
-
const [expanded, setExpanded] =
|
|
10664
|
+
const [expanded, setExpanded] = useState45(false);
|
|
10630
10665
|
const hidden = Math.max(0, data.ours.length - SHOWN) + Math.max(0, data.theirs.length - SHOWN);
|
|
10631
10666
|
const limit = expanded ? void 0 : SHOWN;
|
|
10632
10667
|
const { showMore, showLess } = ui;
|
|
@@ -10731,7 +10766,7 @@ function LinksCard({ card }) {
|
|
|
10731
10766
|
}
|
|
10732
10767
|
|
|
10733
10768
|
// src/components/dashboard/PostMatchResultCard.tsx
|
|
10734
|
-
import { useState as
|
|
10769
|
+
import { useState as useState46 } from "react";
|
|
10735
10770
|
import { jsx as jsx59, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
10736
10771
|
function initials3(name) {
|
|
10737
10772
|
return name.trim().slice(0, 3).toUpperCase();
|
|
@@ -10741,7 +10776,7 @@ function PostMatchCrest({
|
|
|
10741
10776
|
name,
|
|
10742
10777
|
side
|
|
10743
10778
|
}) {
|
|
10744
|
-
const [failed, setFailed] =
|
|
10779
|
+
const [failed, setFailed] = useState46(false);
|
|
10745
10780
|
const cls = `ss-w-fandash-postmatch-crest ss-w-fandash-postmatch-crest--${side}`;
|
|
10746
10781
|
if (url && !failed) {
|
|
10747
10782
|
return /* @__PURE__ */ jsx59("img", { className: cls, src: url, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
@@ -10940,10 +10975,10 @@ function RestingFormCard({ card }) {
|
|
|
10940
10975
|
}
|
|
10941
10976
|
|
|
10942
10977
|
// src/components/dashboard/LiveScoreCard.tsx
|
|
10943
|
-
import { useRef as useRef31, useState as
|
|
10978
|
+
import { useRef as useRef31, useState as useState48 } from "react";
|
|
10944
10979
|
|
|
10945
10980
|
// src/useLiveClock.ts
|
|
10946
|
-
import { useEffect as useEffect37, useState as
|
|
10981
|
+
import { useEffect as useEffect37, useState as useState47 } from "react";
|
|
10947
10982
|
var TICK_MS = 6e4;
|
|
10948
10983
|
var MAX_LIVE_TICK_MINUTES = 15;
|
|
10949
10984
|
function computeDisplayMinute(minute, clockRunning, receivedAtMs) {
|
|
@@ -10952,7 +10987,7 @@ function computeDisplayMinute(minute, clockRunning, receivedAtMs) {
|
|
|
10952
10987
|
return minute + Math.min(Math.max(0, elapsedMinutes), MAX_LIVE_TICK_MINUTES);
|
|
10953
10988
|
}
|
|
10954
10989
|
function useLiveClock(minute, clockRunning, receivedAtMs) {
|
|
10955
|
-
const [displayMinute, setDisplayMinute] =
|
|
10990
|
+
const [displayMinute, setDisplayMinute] = useState47(
|
|
10956
10991
|
() => computeDisplayMinute(minute, clockRunning, receivedAtMs)
|
|
10957
10992
|
);
|
|
10958
10993
|
useEffect37(() => {
|
|
@@ -10972,7 +11007,7 @@ function initials5(name) {
|
|
|
10972
11007
|
return name.trim().slice(0, 3).toUpperCase();
|
|
10973
11008
|
}
|
|
10974
11009
|
function LiveCrest({ url, name, side }) {
|
|
10975
|
-
const [failed, setFailed] =
|
|
11010
|
+
const [failed, setFailed] = useState48(false);
|
|
10976
11011
|
const cls = `ss-w-fandash-live-crest ss-w-fandash-live-crest--${side}`;
|
|
10977
11012
|
if (url && !failed) {
|
|
10978
11013
|
return /* @__PURE__ */ jsx68("img", { className: cls, src: url, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
@@ -11040,7 +11075,7 @@ function LiveScoreCard({
|
|
|
11040
11075
|
}
|
|
11041
11076
|
|
|
11042
11077
|
// src/components/dashboard/LiveTimelineCard.tsx
|
|
11043
|
-
import { useState as
|
|
11078
|
+
import { useState as useState49 } from "react";
|
|
11044
11079
|
import { jsx as jsx69, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
11045
11080
|
var SHOWN2 = 3;
|
|
11046
11081
|
function EventIcon({ type }) {
|
|
@@ -11082,7 +11117,7 @@ function EventRow({ e }) {
|
|
|
11082
11117
|
] });
|
|
11083
11118
|
}
|
|
11084
11119
|
function LiveTimelineCard({ card, ui }) {
|
|
11085
|
-
const [expanded, setExpanded] =
|
|
11120
|
+
const [expanded, setExpanded] = useState49(false);
|
|
11086
11121
|
const events = card.data.events;
|
|
11087
11122
|
if (!events || events.length === 0) return null;
|
|
11088
11123
|
const sorted2 = [...events].sort((a, b) => b.minute - a.minute);
|
|
@@ -11281,7 +11316,7 @@ function FanDashboardCard({ card, onTap, ui, goalEvents }) {
|
|
|
11281
11316
|
// src/components/ChatMessage.tsx
|
|
11282
11317
|
import { jsx as jsx73, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
11283
11318
|
function ChatMessage({ message, disabled, onAct, onTap, ui, slip, monitor, onGreetingSport }) {
|
|
11284
|
-
const [sport, setSport] =
|
|
11319
|
+
const [sport, setSport] = useState50(null);
|
|
11285
11320
|
if (message.role === "user") {
|
|
11286
11321
|
return /* @__PURE__ */ jsx73("div", { className: "ss-w-msg ss-w-user", "data-msg-id": message.id, children: /* @__PURE__ */ jsx73("div", { className: "ss-w-bubble", children: message.text }) });
|
|
11287
11322
|
}
|
|
@@ -11399,10 +11434,10 @@ function MessageList({ controller, ui, slip, onDashboardTap, monitor, onGreeting
|
|
|
11399
11434
|
}
|
|
11400
11435
|
|
|
11401
11436
|
// src/components/ChatInput.tsx
|
|
11402
|
-
import { forwardRef, useEffect as useEffect39, useImperativeHandle, useRef as useRef33, useState as
|
|
11437
|
+
import { forwardRef, useEffect as useEffect39, useImperativeHandle, useRef as useRef33, useState as useState51 } from "react";
|
|
11403
11438
|
import { jsx as jsx76, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
11404
11439
|
var ChatInput = forwardRef(function ChatInput2({ placeholder, streaming, onSend, onStop, stopLabel, sendLabel, disabled = false }, ref) {
|
|
11405
|
-
const [value, setValue] =
|
|
11440
|
+
const [value, setValue] = useState51("");
|
|
11406
11441
|
const textareaRef = useRef33(null);
|
|
11407
11442
|
const stopRef = useRef33(null);
|
|
11408
11443
|
const textBoxWantsFocusRef = useRef33(false);
|
|
@@ -11640,7 +11675,7 @@ function MarketAccordion({ match, monitor, ui, slip }) {
|
|
|
11640
11675
|
}
|
|
11641
11676
|
|
|
11642
11677
|
// src/components/MonitorFormH2H.tsx
|
|
11643
|
-
import { useState as
|
|
11678
|
+
import { useState as useState52 } from "react";
|
|
11644
11679
|
import { Fragment as Fragment17, jsx as jsx79, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
11645
11680
|
function resultClass2(result) {
|
|
11646
11681
|
if (result === "W") return "ss-w-h2h-result--win";
|
|
@@ -11656,7 +11691,7 @@ function FormDots({ form, ui }) {
|
|
|
11656
11691
|
return /* @__PURE__ */ jsx79("div", { className: "ss-w-h2h-dots", children: form.map((m, i) => /* @__PURE__ */ jsx79("span", { className: `ss-w-h2h-result ${resultClass2(m.result)}`, children: resultLabel(m.result, ui) }, i)) });
|
|
11657
11692
|
}
|
|
11658
11693
|
function MonitorFormH2H({ formAndH2H, homeTeamName, awayTeamName, ui }) {
|
|
11659
|
-
const [expanded, setExpanded] =
|
|
11694
|
+
const [expanded, setExpanded] = useState52(false);
|
|
11660
11695
|
const { homeForm, awayForm, h2h, homeShortCode, awayShortCode } = formAndH2H;
|
|
11661
11696
|
if (homeForm.length === 0 && awayForm.length === 0 && !h2h) {
|
|
11662
11697
|
return /* @__PURE__ */ jsx79(Fragment17, {});
|
|
@@ -11734,10 +11769,10 @@ function MonitorFormH2H({ formAndH2H, homeTeamName, awayTeamName, ui }) {
|
|
|
11734
11769
|
}
|
|
11735
11770
|
|
|
11736
11771
|
// src/components/CompLogo.tsx
|
|
11737
|
-
import { useState as
|
|
11772
|
+
import { useState as useState53 } from "react";
|
|
11738
11773
|
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
11739
11774
|
function CompLogo({ url }) {
|
|
11740
|
-
const [failed, setFailed] =
|
|
11775
|
+
const [failed, setFailed] = useState53(null);
|
|
11741
11776
|
if (!url || failed === url) return null;
|
|
11742
11777
|
return /* @__PURE__ */ jsx80("img", { className: "ss-w-mon-comp-logo", src: url, alt: "", "aria-hidden": "true", onError: () => setFailed(url) });
|
|
11743
11778
|
}
|
|
@@ -11895,7 +11930,7 @@ function MonitorSkeleton({ pin, monitor, ui }) {
|
|
|
11895
11930
|
}
|
|
11896
11931
|
|
|
11897
11932
|
// src/components/NbaMonitorCard.tsx
|
|
11898
|
-
import { useState as
|
|
11933
|
+
import { useState as useState57 } from "react";
|
|
11899
11934
|
|
|
11900
11935
|
// src/sportLabel.ts
|
|
11901
11936
|
var CODE = { football: "football", basketball: "nba", nba: "nba", americanfootball: "nfl", nfl: "nfl", tennis: "tennis" };
|
|
@@ -11905,7 +11940,7 @@ var sportLabel = (ui, sport) => {
|
|
|
11905
11940
|
};
|
|
11906
11941
|
|
|
11907
11942
|
// src/components/NbaFormSection.tsx
|
|
11908
|
-
import { useState as
|
|
11943
|
+
import { useState as useState54 } from "react";
|
|
11909
11944
|
|
|
11910
11945
|
// src/components/NbaFormRest.tsx
|
|
11911
11946
|
import { jsx as jsx83, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
@@ -12005,8 +12040,8 @@ function Row3({ game, abbr, tonight, ui }) {
|
|
|
12005
12040
|
] });
|
|
12006
12041
|
}
|
|
12007
12042
|
function NbaFormSection({ match, monitor, ui }) {
|
|
12008
|
-
const [open, setOpen] =
|
|
12009
|
-
const [side, setSide] =
|
|
12043
|
+
const [open, setOpen] = useState54(false);
|
|
12044
|
+
const [side, setSide] = useState54("away");
|
|
12010
12045
|
const form = useNbaForm(match, monitor);
|
|
12011
12046
|
const b = match.basketball;
|
|
12012
12047
|
if (!form || !b || !form.home && !form.away) return null;
|
|
@@ -12051,10 +12086,10 @@ function NbaFormSection({ match, monitor, ui }) {
|
|
|
12051
12086
|
}
|
|
12052
12087
|
|
|
12053
12088
|
// src/components/NbaPropsSection.tsx
|
|
12054
|
-
import { useEffect as useEffect42, useState as
|
|
12089
|
+
import { useEffect as useEffect42, useState as useState56 } from "react";
|
|
12055
12090
|
|
|
12056
12091
|
// src/components/PropsPieces.tsx
|
|
12057
|
-
import { useEffect as useEffect41, useState as
|
|
12092
|
+
import { useEffect as useEffect41, useState as useState55 } from "react";
|
|
12058
12093
|
import { Fragment as Fragment18, jsx as jsx85, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
12059
12094
|
var livePlayer = (bundle, p) => bundle.live === true || !p.live && !p.nflLive ? p : { ...p, live: null, nflLive: null };
|
|
12060
12095
|
var hasLiveLine = (p) => p.live != null || p.nflLive != null;
|
|
@@ -12067,7 +12102,7 @@ function preKickoff(match) {
|
|
|
12067
12102
|
return Number.isFinite(kickoff) && Date.now() < kickoff;
|
|
12068
12103
|
}
|
|
12069
12104
|
function usePreKickoff(match) {
|
|
12070
|
-
const [, setTick] =
|
|
12105
|
+
const [, setTick] = useState55(0);
|
|
12071
12106
|
const pre = preKickoff(match);
|
|
12072
12107
|
useEffect41(() => {
|
|
12073
12108
|
if (!pre || !match.kickoffUtc) return;
|
|
@@ -12161,7 +12196,7 @@ function PropBars({ bars, line, title, wide, ui, note }) {
|
|
|
12161
12196
|
function PropPlayerPanel({ player: given, bundle, descriptor, ui, slip }) {
|
|
12162
12197
|
const player = livePlayer(bundle, given);
|
|
12163
12198
|
const stats = descriptor.stats.map((k) => player.stats.find((s) => s.stat === k)).filter((s) => s != null);
|
|
12164
|
-
const [picked, setPicked] =
|
|
12199
|
+
const [picked, setPicked] = useState55(null);
|
|
12165
12200
|
const active = stats.find((s) => s.stat === picked) ?? stats[0];
|
|
12166
12201
|
const sample = active?.games?.length ?? 0;
|
|
12167
12202
|
const hitsOf = (price, text2) => descriptor.showHits && sample > 0 && price.hits != null ? text2(price.hits) : null;
|
|
@@ -12210,8 +12245,8 @@ function PropPlayerPanel({ player: given, bundle, descriptor, ui, slip }) {
|
|
|
12210
12245
|
] });
|
|
12211
12246
|
}
|
|
12212
12247
|
function PropRoster({ bundle, players, side, descriptor, ui, slip }) {
|
|
12213
|
-
const [openId, setOpenId] =
|
|
12214
|
-
const [brokenShots, setBrokenShots] =
|
|
12248
|
+
const [openId, setOpenId] = useState55(null);
|
|
12249
|
+
const [brokenShots, setBrokenShots] = useState55(/* @__PURE__ */ new Set());
|
|
12215
12250
|
return /* @__PURE__ */ jsx85("div", { className: "ss-w-props-list", children: players.map((given) => {
|
|
12216
12251
|
const p = livePlayer(bundle, given);
|
|
12217
12252
|
const isOpen = openId === p.playerId;
|
|
@@ -12257,7 +12292,7 @@ function PropRoster({ bundle, players, side, descriptor, ui, slip }) {
|
|
|
12257
12292
|
}
|
|
12258
12293
|
var BOX_QUIET_MS = 12e4;
|
|
12259
12294
|
function StatsClock({ boxAsOfUtc, match, live, atBreak: atBreak2, ago, ui }) {
|
|
12260
|
-
const [tick, setTick] =
|
|
12295
|
+
const [tick, setTick] = useState55(0);
|
|
12261
12296
|
const time = clock2(boxAsOfUtc, ui);
|
|
12262
12297
|
const at2 = time === "" ? Number.NaN : Date.parse(boxAsOfUtc);
|
|
12263
12298
|
const valid = !Number.isNaN(at2);
|
|
@@ -12323,7 +12358,7 @@ var nbaDescriptor = (ui, match) => ({
|
|
|
12323
12358
|
tenGameBars: false
|
|
12324
12359
|
});
|
|
12325
12360
|
function StatsClock2({ bundle, match, ui }) {
|
|
12326
|
-
const [tick, setTick] =
|
|
12361
|
+
const [tick, setTick] = useState56(0);
|
|
12327
12362
|
const at2 = bundle.live === true && bundle.boxAsOfUtc ? Date.parse(bundle.boxAsOfUtc) : Number.NaN;
|
|
12328
12363
|
const time = clock2(bundle.boxAsOfUtc, ui);
|
|
12329
12364
|
const valid = !Number.isNaN(at2) && time !== "";
|
|
@@ -12342,7 +12377,7 @@ function StatsClock2({ bundle, match, ui }) {
|
|
|
12342
12377
|
return /* @__PURE__ */ jsx86("span", { className: "ss-w-props-asof ss-w-props-asof--live", children: ui.nba.propsStatsLive(time) });
|
|
12343
12378
|
}
|
|
12344
12379
|
function NbaPropsSection({ match, monitor, ui, slip }) {
|
|
12345
|
-
const [side, setSide] =
|
|
12380
|
+
const [side, setSide] = useState56("home");
|
|
12346
12381
|
const descriptor = nbaDescriptor(ui, match);
|
|
12347
12382
|
const { bundle, live, open } = usePropsOpen(match, monitor, descriptor);
|
|
12348
12383
|
if (!open || !bundle || bundle.players.length === 0 || (bundle.live ?? false) !== live) return null;
|
|
@@ -12380,7 +12415,7 @@ function city(teamName, nickname) {
|
|
|
12380
12415
|
return name.slice(0, name.length - nickname.length).trim() || null;
|
|
12381
12416
|
}
|
|
12382
12417
|
function BadgeCrest({ url, abbreviation }) {
|
|
12383
|
-
const [failed, setFailed] =
|
|
12418
|
+
const [failed, setFailed] = useState57(false);
|
|
12384
12419
|
if (url && !failed) {
|
|
12385
12420
|
return /* @__PURE__ */ jsx87("img", { className: "ss-w-nbamon-badge ss-w-nbamon-badge--img", src: url, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
12386
12421
|
}
|
|
@@ -12515,7 +12550,7 @@ function NbaMonitorCard({ match, monitor, ui, slip, onAsk }) {
|
|
|
12515
12550
|
}
|
|
12516
12551
|
|
|
12517
12552
|
// src/components/NflFormSection.tsx
|
|
12518
|
-
import { useState as
|
|
12553
|
+
import { useState as useState58 } from "react";
|
|
12519
12554
|
import { Fragment as Fragment20, jsx as jsx88, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
12520
12555
|
var outcomeOf = (g) => g.teamScore > g.opponentScore ? "win" : g.teamScore < g.opponentScore ? "loss" : "tie";
|
|
12521
12556
|
var signedSpread2 = (v) => v > 0 ? `+${v}` : String(v);
|
|
@@ -12568,7 +12603,7 @@ function H2hRow({ game, home, ui }) {
|
|
|
12568
12603
|
] });
|
|
12569
12604
|
}
|
|
12570
12605
|
function NflFormSection({ match, monitor, ui }) {
|
|
12571
|
-
const [segment, setSegment] =
|
|
12606
|
+
const [segment, setSegment] = useState58("away");
|
|
12572
12607
|
const { live, open } = usePropsOpen(match, monitor, { sport: "americanfootball" });
|
|
12573
12608
|
const bundle = monitor.playerProps?.[monitorMatchKey("americanfootball", match.matchId)]?.bundle;
|
|
12574
12609
|
const form = bundle?.form;
|
|
@@ -12601,7 +12636,7 @@ function NflFormSection({ match, monitor, ui }) {
|
|
|
12601
12636
|
}
|
|
12602
12637
|
|
|
12603
12638
|
// src/components/NflPropsSection.tsx
|
|
12604
|
-
import { useState as
|
|
12639
|
+
import { useState as useState59 } from "react";
|
|
12605
12640
|
import { Fragment as Fragment21, jsx as jsx89, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
12606
12641
|
var TRENDS_SHOWN = 3;
|
|
12607
12642
|
var SCORERS_SHOWN = 8;
|
|
@@ -12674,7 +12709,7 @@ function ShowMore({ label, onClick }) {
|
|
|
12674
12709
|
return /* @__PURE__ */ jsx89("button", { type: "button", className: "ss-w-props-more", onClick, children: label });
|
|
12675
12710
|
}
|
|
12676
12711
|
function Trends({ bundle, facts, descriptor, ui, slip }) {
|
|
12677
|
-
const [all, setAll] =
|
|
12712
|
+
const [all, setAll] = useState59(false);
|
|
12678
12713
|
const shown2 = all ? facts : facts.slice(0, TRENDS_SHOWN);
|
|
12679
12714
|
return /* @__PURE__ */ jsxs80("section", { className: "ss-w-props ss-w-props-trends", lang: ui.locale, children: [
|
|
12680
12715
|
/* @__PURE__ */ jsx89("div", { className: "ss-w-props-head", children: ui.nfl.propsTrends }),
|
|
@@ -12707,7 +12742,7 @@ function Trends({ bundle, facts, descriptor, ui, slip }) {
|
|
|
12707
12742
|
] });
|
|
12708
12743
|
}
|
|
12709
12744
|
function Scorers({ bundle, scorers, abbreviations, descriptor, ui, slip }) {
|
|
12710
|
-
const [all, setAll] =
|
|
12745
|
+
const [all, setAll] = useState59(false);
|
|
12711
12746
|
const shown2 = all ? scorers : scorers.slice(0, SCORERS_SHOWN);
|
|
12712
12747
|
const cell2 = (name, column, price, stat) => price && stat ? /* @__PURE__ */ jsx89(PropPrice, { price, label: "", ariaName: `${name}, ${column}`, player: name, stat, bundle, descriptor, ui, slip }) : /* @__PURE__ */ jsx89("span", { className: "ss-w-props-scorer-none", children: "\u2014" });
|
|
12713
12748
|
return /* @__PURE__ */ jsxs80("div", { className: "ss-w-props-scorers", children: [
|
|
@@ -12737,7 +12772,7 @@ function Scorers({ bundle, scorers, abbreviations, descriptor, ui, slip }) {
|
|
|
12737
12772
|
] });
|
|
12738
12773
|
}
|
|
12739
12774
|
function NflPropsSection({ match, monitor, ui, slip }) {
|
|
12740
|
-
const [tab, setTab] =
|
|
12775
|
+
const [tab, setTab] = useState59(null);
|
|
12741
12776
|
const descriptor = nflDescriptor(ui);
|
|
12742
12777
|
const { bundle, live, open } = usePropsOpen(match, monitor, descriptor);
|
|
12743
12778
|
if (!open || !bundle || bundle.players.length === 0 || (bundle.live ?? false) !== live) return null;
|
|
@@ -12944,7 +12979,7 @@ import { toWireSport as toWireSport6 } from "@sensiblestats/widget-sdk";
|
|
|
12944
12979
|
import { matchKey as matchKey4 } from "@sensiblestats/widget-sdk";
|
|
12945
12980
|
|
|
12946
12981
|
// src/components/FixtureRow.tsx
|
|
12947
|
-
import { useState as
|
|
12982
|
+
import { useState as useState60 } from "react";
|
|
12948
12983
|
import { slipSportOf as slipSportOf8 } from "@sensiblestats/widget-sdk";
|
|
12949
12984
|
import { Fragment as Fragment23, jsx as jsx93, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
12950
12985
|
function splitAtFirstSpace(label) {
|
|
@@ -12958,7 +12993,7 @@ function kickoffLabel(kickoffUnix, tag2, clock3, timeZone) {
|
|
|
12958
12993
|
return formatTime(kickoffUnix * 1e3, tag2, clock3, { timeZone });
|
|
12959
12994
|
}
|
|
12960
12995
|
function Side2({ name, crest, abbr, away = false }) {
|
|
12961
|
-
const [failed, setFailed] =
|
|
12996
|
+
const [failed, setFailed] = useState60(false);
|
|
12962
12997
|
return /* @__PURE__ */ jsxs84("span", { className: away ? "ss-w-drow-side ss-w-drow-side--away" : "ss-w-drow-side", children: [
|
|
12963
12998
|
crest && !failed ? /* @__PURE__ */ jsx93("img", { className: abbr ? "ss-w-drow-crest ss-w-drow-crest--wide" : "ss-w-drow-crest", src: crest, alt: "", onError: () => setFailed(true) }) : abbr ? /* @__PURE__ */ jsx93("span", { className: "ss-w-drow-crest ss-w-drow-crest--abbr", children: abbr }) : null,
|
|
12964
12999
|
/* @__PURE__ */ jsx93("span", { className: "ss-w-drow-nm", children: name })
|
|
@@ -13200,7 +13235,7 @@ function TennisLiveScoreboard({ t, score, live, ui }) {
|
|
|
13200
13235
|
}
|
|
13201
13236
|
|
|
13202
13237
|
// src/components/TennisStatsTables.tsx
|
|
13203
|
-
import { Fragment as Fragment25, useEffect as useEffect43, useState as
|
|
13238
|
+
import { Fragment as Fragment25, useEffect as useEffect43, useState as useState61 } from "react";
|
|
13204
13239
|
import { Fragment as Fragment26, jsx as jsx96, jsxs as jsxs87 } from "react/jsx-runtime";
|
|
13205
13240
|
function formatStat(row, value, locale) {
|
|
13206
13241
|
if (value == null) return "\u2013";
|
|
@@ -13238,7 +13273,7 @@ function Tables({ table, labels, names, locale }) {
|
|
|
13238
13273
|
] });
|
|
13239
13274
|
}
|
|
13240
13275
|
function TennisStatsTables({ serveReturn, today, labels, names, ui, resetKey }) {
|
|
13241
|
-
const [tab, setTab] =
|
|
13276
|
+
const [tab, setTab] = useState61("match");
|
|
13242
13277
|
useEffect43(() => {
|
|
13243
13278
|
setTab("match");
|
|
13244
13279
|
}, [resetKey]);
|
|
@@ -13827,7 +13862,7 @@ function TrendsPanel({ monitor, ui, slip }) {
|
|
|
13827
13862
|
}
|
|
13828
13863
|
|
|
13829
13864
|
// src/components/LivePanel.tsx
|
|
13830
|
-
import { useMemo as useMemo14, useState as
|
|
13865
|
+
import { useMemo as useMemo14, useState as useState63 } from "react";
|
|
13831
13866
|
import { matchKey as matchKey8 } from "@sensiblestats/widget-sdk";
|
|
13832
13867
|
|
|
13833
13868
|
// src/scheduleView.ts
|
|
@@ -14002,7 +14037,7 @@ function LeagueGroup({ view, open, onToggle, disambiguate, rowCap, onShowAll, on
|
|
|
14002
14037
|
}
|
|
14003
14038
|
|
|
14004
14039
|
// src/components/MatchSheet.tsx
|
|
14005
|
-
import { useId as useId3, useState as
|
|
14040
|
+
import { useId as useId3, useState as useState62 } from "react";
|
|
14006
14041
|
import { localIdOf as localIdOf5, qualifiedId as qualifiedId3, slipSportOf as slipSportOf9, toWireSport as toWireSport7 } from "@sensiblestats/widget-sdk";
|
|
14007
14042
|
|
|
14008
14043
|
// src/useModalDialog.ts
|
|
@@ -14068,7 +14103,7 @@ function MatchSheet({ match, league, state, stale, ui, monitor, onAsk, onClose,
|
|
|
14068
14103
|
const { dialogRef, onKeyDown } = useModalDialog(onClose, { opener });
|
|
14069
14104
|
const log = useEventLog();
|
|
14070
14105
|
const titleId = useId3();
|
|
14071
|
-
const [limitHit, setLimitHit] =
|
|
14106
|
+
const [limitHit, setLimitHit] = useState62(false);
|
|
14072
14107
|
const pinSport = slipSportOf9(match.sport);
|
|
14073
14108
|
const tour = pinSport === "tennis" && isKnownTour(match.tour) ? match.tour : void 0;
|
|
14074
14109
|
const followable = pinSport !== "tennis" || tour !== void 0;
|
|
@@ -14169,9 +14204,9 @@ var OPEN_TOP_GROUPS = 2;
|
|
|
14169
14204
|
var QUIET_ROWS = 4;
|
|
14170
14205
|
function LivePanel({ discovery, ui, monitor, sport, offered, onSport, league, onLeague, onSeeAll, onAsk }) {
|
|
14171
14206
|
const { groups, states, stale } = discovery;
|
|
14172
|
-
const [mine, setMine] =
|
|
14173
|
-
const [toggled, setToggled] =
|
|
14174
|
-
const [sheet, setSheet] =
|
|
14207
|
+
const [mine, setMine] = useState63(false);
|
|
14208
|
+
const [toggled, setToggled] = useState63(/* @__PURE__ */ new Map());
|
|
14209
|
+
const [sheet, setSheet] = useState63(null);
|
|
14175
14210
|
const pinnedKeys = useMemo14(
|
|
14176
14211
|
() => new Set(monitor.pins.filter((p) => p.kind === "match").map((p) => matchKey8(p.sport, p.matchId, p.tour))),
|
|
14177
14212
|
[monitor.pins]
|
|
@@ -14278,15 +14313,15 @@ function LivePanel({ discovery, ui, monitor, sport, offered, onSport, league, on
|
|
|
14278
14313
|
}
|
|
14279
14314
|
|
|
14280
14315
|
// src/components/ScheduleMatchesPanel.tsx
|
|
14281
|
-
import { useEffect as useEffect48, useId as useId4, useMemo as useMemo15, useRef as useRef41, useState as
|
|
14316
|
+
import { useEffect as useEffect48, useId as useId4, useMemo as useMemo15, useRef as useRef41, useState as useState65 } from "react";
|
|
14282
14317
|
import { matchKey as matchKey10 } from "@sensiblestats/widget-sdk";
|
|
14283
14318
|
|
|
14284
14319
|
// src/useTennisRowPrices.ts
|
|
14285
|
-
import { useEffect as useEffect46, useRef as useRef38, useState as
|
|
14320
|
+
import { useEffect as useEffect46, useRef as useRef38, useState as useState64 } from "react";
|
|
14286
14321
|
import { matchKey as matchKey9 } from "@sensiblestats/widget-sdk";
|
|
14287
14322
|
var TENNIS_PRICE_POLL_MS = 6e4;
|
|
14288
14323
|
function useTennisRowPrices(a) {
|
|
14289
|
-
const [state, setState] =
|
|
14324
|
+
const [state, setState] = useState64({ byId: null, stale: false });
|
|
14290
14325
|
const getPricesRef = useRef38(a.getPrices);
|
|
14291
14326
|
getPricesRef.current = a.getPrices;
|
|
14292
14327
|
const latest = useRef38(0);
|
|
@@ -14362,7 +14397,7 @@ function DayStrip({ chips, selected, onSelect, ui, locale }) {
|
|
|
14362
14397
|
}
|
|
14363
14398
|
|
|
14364
14399
|
// src/components/games/ui/SearchField.tsx
|
|
14365
|
-
import { useCallback as
|
|
14400
|
+
import { useCallback as useCallback28, useRef as useRef40 } from "react";
|
|
14366
14401
|
|
|
14367
14402
|
// src/components/games/ui/icons.tsx
|
|
14368
14403
|
import { jsx as jsx108 } from "react/jsx-runtime";
|
|
@@ -14402,7 +14437,7 @@ var IconFlame = ({ size = 16 }) => svg(size, /* @__PURE__ */ jsx108("path", { d:
|
|
|
14402
14437
|
import { jsx as jsx109, jsxs as jsxs98 } from "react/jsx-runtime";
|
|
14403
14438
|
function SearchField({ id, label, labelHidden = false, placeholder, value, onChange, disabled, inputRef, onKeyDown, clearLabel }) {
|
|
14404
14439
|
const localRef = useRef40(null);
|
|
14405
|
-
const setInputRef =
|
|
14440
|
+
const setInputRef = useCallback28((node) => {
|
|
14406
14441
|
localRef.current = node;
|
|
14407
14442
|
if (typeof inputRef === "function") inputRef(node);
|
|
14408
14443
|
else if (inputRef) inputRef.current = node;
|
|
@@ -14449,11 +14484,11 @@ var SKELETON_ROWS = 3;
|
|
|
14449
14484
|
function ScheduleMatchesPanel({ discovery, ui, monitor, sport, offered, onSport, day, onDay, loaded, onOpenLive, onAsk, locale, getTennisPrices, slip }) {
|
|
14450
14485
|
const { localDate: today, states, stale } = discovery;
|
|
14451
14486
|
const searchId = useId4();
|
|
14452
|
-
const [query, setQuery] =
|
|
14453
|
-
const [toggled, setToggled] =
|
|
14454
|
-
const [expanded, setExpanded] =
|
|
14487
|
+
const [query, setQuery] = useState65("");
|
|
14488
|
+
const [toggled, setToggled] = useState65(/* @__PURE__ */ new Map());
|
|
14489
|
+
const [expanded, setExpanded] = useState65(/* @__PURE__ */ new Set());
|
|
14455
14490
|
const listRef = useRef41(null);
|
|
14456
|
-
const [sheet, setSheet] =
|
|
14491
|
+
const [sheet, setSheet] = useState65(null);
|
|
14457
14492
|
const { chips, selected } = loaded;
|
|
14458
14493
|
useEffect48(() => {
|
|
14459
14494
|
if (selected !== day) onDay(selected);
|
|
@@ -14597,7 +14632,7 @@ function ScheduleMatchesPanel({ discovery, ui, monitor, sport, offered, onSport,
|
|
|
14597
14632
|
}
|
|
14598
14633
|
|
|
14599
14634
|
// src/components/GamesPanel.tsx
|
|
14600
|
-
import { useEffect as useEffect52, useState as
|
|
14635
|
+
import { useEffect as useEffect52, useState as useState80 } from "react";
|
|
14601
14636
|
|
|
14602
14637
|
// src/components/GamesLoginWall.tsx
|
|
14603
14638
|
import { jsx as jsx111 } from "react/jsx-runtime";
|
|
@@ -14606,7 +14641,7 @@ function GamesLoginWall({ ui }) {
|
|
|
14606
14641
|
}
|
|
14607
14642
|
|
|
14608
14643
|
// src/components/GamesHub.tsx
|
|
14609
|
-
import { useEffect as useEffect49, useState as
|
|
14644
|
+
import { useEffect as useEffect49, useState as useState66 } from "react";
|
|
14610
14645
|
|
|
14611
14646
|
// src/components/games/ui/gameMeta.ts
|
|
14612
14647
|
function prettifyGameId(gameId) {
|
|
@@ -14757,7 +14792,7 @@ function pickHeroGame(games) {
|
|
|
14757
14792
|
}
|
|
14758
14793
|
var tileKey = (g) => `${g.gameId}-${g.gameDay}-${g.fixtureId}`;
|
|
14759
14794
|
function GamesHub({ games, myWeeklyRow, weeklyPrize, onOpen, ui }) {
|
|
14760
|
-
const [, setTick] =
|
|
14795
|
+
const [, setTick] = useState66(0);
|
|
14761
14796
|
useEffect49(() => {
|
|
14762
14797
|
const id = setInterval(() => setTick((t) => t + 1), 6e4);
|
|
14763
14798
|
return () => clearInterval(id);
|
|
@@ -14818,10 +14853,10 @@ function GamesHub({ games, myWeeklyRow, weeklyPrize, onOpen, ui }) {
|
|
|
14818
14853
|
}
|
|
14819
14854
|
|
|
14820
14855
|
// src/components/GameScreenHost.tsx
|
|
14821
|
-
import { useEffect as useEffect51, useRef as useRef44, useState as
|
|
14856
|
+
import { useEffect as useEffect51, useRef as useRef44, useState as useState78 } from "react";
|
|
14822
14857
|
|
|
14823
14858
|
// src/useGamePlay.ts
|
|
14824
|
-
import { useCallback as
|
|
14859
|
+
import { useCallback as useCallback29, useRef as useRef42, useState as useState67 } from "react";
|
|
14825
14860
|
function toSubmitResult(payload) {
|
|
14826
14861
|
return {
|
|
14827
14862
|
// 'pending' means the play is recorded but awaiting resolution (fixture games)
|
|
@@ -14833,9 +14868,9 @@ function toSubmitResult(payload) {
|
|
|
14833
14868
|
};
|
|
14834
14869
|
}
|
|
14835
14870
|
function useGamePlay(conversation, { gameId, gameDay, fixtureId, locale, refresh }) {
|
|
14836
|
-
const [result, setResult] =
|
|
14837
|
-
const [submitting, setSubmitting] =
|
|
14838
|
-
const [rawStatus, setRawStatus] =
|
|
14871
|
+
const [result, setResult] = useState67(null);
|
|
14872
|
+
const [submitting, setSubmitting] = useState67(false);
|
|
14873
|
+
const [rawStatus, setRawStatus] = useState67(null);
|
|
14839
14874
|
const inFlightRef = useRef42(false);
|
|
14840
14875
|
const convRef = useRef42(conversation);
|
|
14841
14876
|
convRef.current = conversation;
|
|
@@ -14843,7 +14878,7 @@ function useGamePlay(conversation, { gameId, gameDay, fixtureId, locale, refresh
|
|
|
14843
14878
|
optsRef.current = { gameId, gameDay, fixtureId, locale, refresh };
|
|
14844
14879
|
const resultRef = useRef42(null);
|
|
14845
14880
|
resultRef.current = result;
|
|
14846
|
-
const refetch =
|
|
14881
|
+
const refetch = useCallback29(async () => {
|
|
14847
14882
|
const conv = convRef.current;
|
|
14848
14883
|
if (!conv) return;
|
|
14849
14884
|
const opts = optsRef.current;
|
|
@@ -14859,7 +14894,7 @@ function useGamePlay(conversation, { gameId, gameDay, fixtureId, locale, refresh
|
|
|
14859
14894
|
} catch {
|
|
14860
14895
|
}
|
|
14861
14896
|
}, []);
|
|
14862
|
-
const submit =
|
|
14897
|
+
const submit = useCallback29(async (answerJson) => {
|
|
14863
14898
|
const conv = convRef.current;
|
|
14864
14899
|
if (!conv || inFlightRef.current) return;
|
|
14865
14900
|
inFlightRef.current = true;
|
|
@@ -14886,14 +14921,14 @@ function useGamePlay(conversation, { gameId, gameDay, fixtureId, locale, refresh
|
|
|
14886
14921
|
setSubmitting(false);
|
|
14887
14922
|
}
|
|
14888
14923
|
}, [refetch]);
|
|
14889
|
-
const hydrate =
|
|
14924
|
+
const hydrate = useCallback29(() => {
|
|
14890
14925
|
void refetch();
|
|
14891
14926
|
}, [refetch]);
|
|
14892
14927
|
return { result, submitting, submit, hydrate, rawStatus };
|
|
14893
14928
|
}
|
|
14894
14929
|
|
|
14895
14930
|
// src/components/games/MysteryTigerGame.tsx
|
|
14896
|
-
import { useState as
|
|
14931
|
+
import { useState as useState69, useId as useId5 } from "react";
|
|
14897
14932
|
|
|
14898
14933
|
// src/components/games/nationFlags.ts
|
|
14899
14934
|
var FLAGS = {
|
|
@@ -15104,7 +15139,7 @@ function isNationCode(flag) {
|
|
|
15104
15139
|
}
|
|
15105
15140
|
|
|
15106
15141
|
// src/components/games/PlayerAvatar.tsx
|
|
15107
|
-
import { useState as
|
|
15142
|
+
import { useState as useState68 } from "react";
|
|
15108
15143
|
import { jsx as jsx116 } from "react/jsx-runtime";
|
|
15109
15144
|
function initialsOf(name) {
|
|
15110
15145
|
const parts2 = name.trim().split(/\s+/).filter(Boolean);
|
|
@@ -15122,7 +15157,7 @@ function PlayerAvatar({
|
|
|
15122
15157
|
imagePath,
|
|
15123
15158
|
className
|
|
15124
15159
|
}) {
|
|
15125
|
-
const [failed, setFailed] =
|
|
15160
|
+
const [failed, setFailed] = useState68(false);
|
|
15126
15161
|
const showImage = Boolean(imagePath) && !isPlaceholderImage(imagePath) && !failed;
|
|
15127
15162
|
return /* @__PURE__ */ jsx116("div", { className, "aria-hidden": "true", children: showImage ? /* @__PURE__ */ jsx116("img", { src: imagePath, alt: "", loading: "lazy", onError: () => setFailed(true) }) : /* @__PURE__ */ jsx116("span", { className: "ss-w-av-initials", children: initialsOf(name) }) });
|
|
15128
15163
|
}
|
|
@@ -15366,7 +15401,7 @@ function MysteryTigerGame({
|
|
|
15366
15401
|
onBack
|
|
15367
15402
|
}) {
|
|
15368
15403
|
const t = ui.games.mysteryTiger;
|
|
15369
|
-
const [query, setQuery] =
|
|
15404
|
+
const [query, setQuery] = useState69("");
|
|
15370
15405
|
const inputId = useId5();
|
|
15371
15406
|
const clientState = parseClientState(result?.clientStateJson);
|
|
15372
15407
|
const guessResults = clientState?.guessResults ?? [];
|
|
@@ -15628,13 +15663,13 @@ function HigherOrLowerGame({
|
|
|
15628
15663
|
}
|
|
15629
15664
|
|
|
15630
15665
|
// src/components/games/CareerPathGame.tsx
|
|
15631
|
-
import { useState as
|
|
15666
|
+
import { useState as useState71, useId as useId6 } from "react";
|
|
15632
15667
|
|
|
15633
15668
|
// src/components/games/ui/CrestShield.tsx
|
|
15634
|
-
import { useState as
|
|
15669
|
+
import { useState as useState70 } from "react";
|
|
15635
15670
|
import { jsx as jsx127 } from "react/jsx-runtime";
|
|
15636
15671
|
function CrestShield({ src, name, size = 28 }) {
|
|
15637
|
-
const [failed, setFailed] =
|
|
15672
|
+
const [failed, setFailed] = useState70(false);
|
|
15638
15673
|
if (src && !isPlaceholderImage(src) && !failed) {
|
|
15639
15674
|
return /* @__PURE__ */ jsx127("img", { className: "ss-g-crest", src, alt: name, width: size, height: size, loading: "lazy", onError: () => setFailed(true) });
|
|
15640
15675
|
}
|
|
@@ -15666,7 +15701,7 @@ function CareerPathGame({
|
|
|
15666
15701
|
}) {
|
|
15667
15702
|
const s = ui.games.careerPath;
|
|
15668
15703
|
const title = gameTitle({ gameId: "career-path" }, ui.games.titles);
|
|
15669
|
-
const [query, setQuery] =
|
|
15704
|
+
const [query, setQuery] = useState71("");
|
|
15670
15705
|
const inputId = useId6();
|
|
15671
15706
|
const clientState = parseClientState3(result?.clientStateJson);
|
|
15672
15707
|
const alreadyGuessedIds = new Set(clientState?.guessResults.map((g) => g.playerId) ?? []);
|
|
@@ -15773,7 +15808,7 @@ function CareerPathGame({
|
|
|
15773
15808
|
}
|
|
15774
15809
|
|
|
15775
15810
|
// src/components/games/BeatTheGridGame.tsx
|
|
15776
|
-
import React, { useEffect as useEffect50, useId as useId7, useRef as useRef43, useState as
|
|
15811
|
+
import React, { useEffect as useEffect50, useId as useId7, useRef as useRef43, useState as useState72 } from "react";
|
|
15777
15812
|
|
|
15778
15813
|
// src/components/games/ui/OptionList.tsx
|
|
15779
15814
|
import { jsx as jsx129 } from "react/jsx-runtime";
|
|
@@ -15862,7 +15897,7 @@ function SearchSheet({
|
|
|
15862
15897
|
ui
|
|
15863
15898
|
}) {
|
|
15864
15899
|
const s = ui.games.beatTheGrid;
|
|
15865
|
-
const [query, setQuery] =
|
|
15900
|
+
const [query, setQuery] = useState72("");
|
|
15866
15901
|
const inputId = useId7();
|
|
15867
15902
|
const inputRef = useRef43(null);
|
|
15868
15903
|
useEffect50(() => {
|
|
@@ -15930,7 +15965,7 @@ function BeatTheGridGame({
|
|
|
15930
15965
|
}) {
|
|
15931
15966
|
const s = ui.games.beatTheGrid;
|
|
15932
15967
|
const title = gameTitle({ gameId: "beat-the-grid" }, ui.games.titles);
|
|
15933
|
-
const [activeCell, setActiveCell] =
|
|
15968
|
+
const [activeCell, setActiveCell] = useState72(null);
|
|
15934
15969
|
const clientState = parseClientState4(result?.clientStateJson);
|
|
15935
15970
|
const filledCells = clientState?.cells ?? [];
|
|
15936
15971
|
const isLocked2 = result?.alreadyPlayed === true || clientState?.isComplete === true;
|
|
@@ -16085,7 +16120,7 @@ function BeatTheGridGame({
|
|
|
16085
16120
|
}
|
|
16086
16121
|
|
|
16087
16122
|
// src/components/games/GuessTheXiGame.tsx
|
|
16088
|
-
import { useState as
|
|
16123
|
+
import { useState as useState73, useId as useId8 } from "react";
|
|
16089
16124
|
|
|
16090
16125
|
// src/components/games/ui/PitchSvg.tsx
|
|
16091
16126
|
import { Fragment as Fragment39, jsx as jsx131, jsxs as jsxs114 } from "react/jsx-runtime";
|
|
@@ -16174,7 +16209,7 @@ function GuessTheXiGame({
|
|
|
16174
16209
|
onBack
|
|
16175
16210
|
}) {
|
|
16176
16211
|
const t = ui.games.guessTheXi;
|
|
16177
|
-
const [query, setQuery] =
|
|
16212
|
+
const [query, setQuery] = useState73("");
|
|
16178
16213
|
const inputId = useId8();
|
|
16179
16214
|
const clientState = parseClientState5(result?.clientStateJson);
|
|
16180
16215
|
const isOver = result?.alreadyPlayed === true || clientState?.status === "solved" || clientState?.status === "failed";
|
|
@@ -16317,7 +16352,7 @@ function GuessTheXiGame({
|
|
|
16317
16352
|
}
|
|
16318
16353
|
|
|
16319
16354
|
// src/components/games/DailyQuizGame.tsx
|
|
16320
|
-
import { useState as
|
|
16355
|
+
import { useState as useState74 } from "react";
|
|
16321
16356
|
import { Fragment as Fragment41, jsx as jsx133, jsxs as jsxs116 } from "react/jsx-runtime";
|
|
16322
16357
|
function parseClientState6(json) {
|
|
16323
16358
|
if (!json) return null;
|
|
@@ -16358,8 +16393,8 @@ function DailyQuizGame({
|
|
|
16358
16393
|
}) {
|
|
16359
16394
|
const s = ui.games.dailyQuiz;
|
|
16360
16395
|
const title = gameTitle({ gameId: "daily-quiz" }, ui.games.titles);
|
|
16361
|
-
const [selections, setSelections] =
|
|
16362
|
-
const [page, setPage] =
|
|
16396
|
+
const [selections, setSelections] = useState74(/* @__PURE__ */ new Map());
|
|
16397
|
+
const [page, setPage] = useState74(0);
|
|
16363
16398
|
const clientState = parseClientState6(result?.clientStateJson);
|
|
16364
16399
|
const results2 = clientState?.results ?? [];
|
|
16365
16400
|
const isRevealed = results2.length > 0 || result?.alreadyPlayed === true;
|
|
@@ -16469,7 +16504,7 @@ function DailyQuizGame({
|
|
|
16469
16504
|
}
|
|
16470
16505
|
|
|
16471
16506
|
// src/components/games/MatchdayPredictorGame.tsx
|
|
16472
|
-
import { useId as useId9, useState as
|
|
16507
|
+
import { useId as useId9, useState as useState75 } from "react";
|
|
16473
16508
|
import { jsx as jsx134, jsxs as jsxs117 } from "react/jsx-runtime";
|
|
16474
16509
|
var SCORER_SEARCH_THRESHOLD = 9;
|
|
16475
16510
|
function parseClientState7(json) {
|
|
@@ -16565,11 +16600,11 @@ function MatchdayPredictorGame({
|
|
|
16565
16600
|
onBack
|
|
16566
16601
|
}) {
|
|
16567
16602
|
const t = ui.games.predictor;
|
|
16568
|
-
const [homeScore, setHomeScore] =
|
|
16569
|
-
const [awayScore, setAwayScore] =
|
|
16570
|
-
const [firstScorerPlayerId, setFirstScorerPlayerId] =
|
|
16571
|
-
const [lastEdited, setLastEdited] =
|
|
16572
|
-
const [query, setQuery] =
|
|
16603
|
+
const [homeScore, setHomeScore] = useState75(0);
|
|
16604
|
+
const [awayScore, setAwayScore] = useState75(0);
|
|
16605
|
+
const [firstScorerPlayerId, setFirstScorerPlayerId] = useState75(null);
|
|
16606
|
+
const [lastEdited, setLastEdited] = useState75("home");
|
|
16607
|
+
const [query, setQuery] = useState75("");
|
|
16573
16608
|
const searchId = useId9();
|
|
16574
16609
|
const clientState = parseClientState7(result?.clientStateJson);
|
|
16575
16610
|
const alreadyPlayed = result?.alreadyPlayed === true;
|
|
@@ -16737,7 +16772,7 @@ function MatchdayPredictorGame({
|
|
|
16737
16772
|
}
|
|
16738
16773
|
|
|
16739
16774
|
// src/components/games/StartingXiGame.tsx
|
|
16740
|
-
import { useId as useId10, useState as
|
|
16775
|
+
import { useId as useId10, useState as useState76 } from "react";
|
|
16741
16776
|
import { Fragment as Fragment42, jsx as jsx135, jsxs as jsxs118 } from "react/jsx-runtime";
|
|
16742
16777
|
var POINTS_PER_STARTER = 8;
|
|
16743
16778
|
var XI_SIZE = 11;
|
|
@@ -16781,9 +16816,9 @@ function StartingXiGame({
|
|
|
16781
16816
|
lockAtUtc
|
|
16782
16817
|
}) {
|
|
16783
16818
|
const t = ui.games.startingXi;
|
|
16784
|
-
const [slotPlayers, setSlotPlayers] =
|
|
16785
|
-
const [active, setActive] =
|
|
16786
|
-
const [query, setQuery] =
|
|
16819
|
+
const [slotPlayers, setSlotPlayers] = useState76(() => Array(XI_SIZE).fill(null));
|
|
16820
|
+
const [active, setActive] = useState76(0);
|
|
16821
|
+
const [query, setQuery] = useState76("");
|
|
16787
16822
|
const searchId = useId10();
|
|
16788
16823
|
const clientState = parseClientState8(result?.clientStateJson);
|
|
16789
16824
|
const alreadyPlayed = result?.alreadyPlayed === true;
|
|
@@ -16923,7 +16958,7 @@ function StartingXiGame({
|
|
|
16923
16958
|
}
|
|
16924
16959
|
|
|
16925
16960
|
// src/components/games/StatLadderGame.tsx
|
|
16926
|
-
import { useId as useId11, useState as
|
|
16961
|
+
import { useId as useId11, useState as useState77 } from "react";
|
|
16927
16962
|
import { jsx as jsx136, jsxs as jsxs119 } from "react/jsx-runtime";
|
|
16928
16963
|
function ladderClue(ladder) {
|
|
16929
16964
|
const mystery = ladder.find((r) => r.rank === 2);
|
|
@@ -16960,8 +16995,8 @@ function StatLadderGame({
|
|
|
16960
16995
|
onBack
|
|
16961
16996
|
}) {
|
|
16962
16997
|
const t = ui.games.statLadder;
|
|
16963
|
-
const [query, setQuery] =
|
|
16964
|
-
const [selectedId, setSelectedId] =
|
|
16998
|
+
const [query, setQuery] = useState77("");
|
|
16999
|
+
const [selectedId, setSelectedId] = useState77(null);
|
|
16965
17000
|
const searchId = useId11();
|
|
16966
17001
|
const clientState = parseClientState9(result?.clientStateJson);
|
|
16967
17002
|
const revealed = clientState != null;
|
|
@@ -17168,7 +17203,7 @@ function GameScreenHost({
|
|
|
17168
17203
|
ui
|
|
17169
17204
|
}) {
|
|
17170
17205
|
const { gameId, fixtureId, gameDay = "", lockAtUtc = null } = selected;
|
|
17171
|
-
const [configJson, setConfigJson] =
|
|
17206
|
+
const [configJson, setConfigJson] = useState78(null);
|
|
17172
17207
|
useEffect51(() => {
|
|
17173
17208
|
setConfigJson(null);
|
|
17174
17209
|
if (!conversation) return;
|
|
@@ -17310,7 +17345,7 @@ function GameScreenHost({
|
|
|
17310
17345
|
}
|
|
17311
17346
|
|
|
17312
17347
|
// src/components/Leaderboard.tsx
|
|
17313
|
-
import { useState as
|
|
17348
|
+
import { useState as useState79 } from "react";
|
|
17314
17349
|
|
|
17315
17350
|
// src/components/LeaderboardRow.tsx
|
|
17316
17351
|
import { jsx as jsx139, jsxs as jsxs121 } from "react/jsx-runtime";
|
|
@@ -17397,7 +17432,7 @@ function Leaderboard({
|
|
|
17397
17432
|
ui,
|
|
17398
17433
|
onPlay
|
|
17399
17434
|
}) {
|
|
17400
|
-
const [segment, setSegment] =
|
|
17435
|
+
const [segment, setSegment] = useState79("weekly");
|
|
17401
17436
|
const myRow = segment === "weekly" ? data.myWeeklyRow : data.myAllTimeRow;
|
|
17402
17437
|
const offBoard = myRow !== null && myRow !== void 0 && myRow.rank === -1;
|
|
17403
17438
|
const isEmpty = segment === "weekly" ? data.weeklyTop.length === 0 : data.allTimeTop.length === 0;
|
|
@@ -17502,8 +17537,8 @@ function GamesPanel({
|
|
|
17502
17537
|
leaderboardLoading,
|
|
17503
17538
|
refreshHub
|
|
17504
17539
|
}) {
|
|
17505
|
-
const [selected, setSelected] =
|
|
17506
|
-
const [segment, setSegment] =
|
|
17540
|
+
const [selected, setSelected] = useState80(null);
|
|
17541
|
+
const [segment, setSegment] = useState80("play");
|
|
17507
17542
|
useEffect52(() => {
|
|
17508
17543
|
ensureGamesFonts();
|
|
17509
17544
|
}, []);
|
|
@@ -17568,10 +17603,10 @@ function GamesPanel({
|
|
|
17568
17603
|
}
|
|
17569
17604
|
|
|
17570
17605
|
// src/components/FavouritesPanel.tsx
|
|
17571
|
-
import { useEffect as useEffect55, useRef as useRef46, useState as
|
|
17606
|
+
import { useEffect as useEffect55, useRef as useRef46, useState as useState83 } from "react";
|
|
17572
17607
|
|
|
17573
17608
|
// src/components/FavouriteChips.tsx
|
|
17574
|
-
import { useEffect as useEffect53, useState as
|
|
17609
|
+
import { useEffect as useEffect53, useState as useState81 } from "react";
|
|
17575
17610
|
import { Fragment as Fragment44, jsx as jsx144, jsxs as jsxs125 } from "react/jsx-runtime";
|
|
17576
17611
|
async function toggleWithNotice(controller, kind, id, onNotice) {
|
|
17577
17612
|
const outcome = await controller.toggle(kind, id);
|
|
@@ -17617,7 +17652,7 @@ function Group({ title, entities, sport, ui, controller, onNotice }) {
|
|
|
17617
17652
|
] });
|
|
17618
17653
|
}
|
|
17619
17654
|
function FavouriteChips({ controller, ui, sport, sportLabel: sportLabel2, onNotice }) {
|
|
17620
|
-
const [confirming, setConfirming] =
|
|
17655
|
+
const [confirming, setConfirming] = useState81(false);
|
|
17621
17656
|
const data = controller.data;
|
|
17622
17657
|
useEffect53(() => {
|
|
17623
17658
|
setConfirming(false);
|
|
@@ -17676,14 +17711,14 @@ function FavouriteChips({ controller, ui, sport, sportLabel: sportLabel2, onNoti
|
|
|
17676
17711
|
}
|
|
17677
17712
|
|
|
17678
17713
|
// src/components/FavouritesSearch.tsx
|
|
17679
|
-
import { useEffect as useEffect54, useRef as useRef45, useState as
|
|
17714
|
+
import { useEffect as useEffect54, useRef as useRef45, useState as useState82 } from "react";
|
|
17680
17715
|
import { jsx as jsx145, jsxs as jsxs126 } from "react/jsx-runtime";
|
|
17681
17716
|
var MIN_LETTERS = 2;
|
|
17682
17717
|
var MAX_LENGTH = 64;
|
|
17683
17718
|
var DEBOUNCE_MS = 250;
|
|
17684
17719
|
function FavouritesSearch({ controller, ui, sport, onNotice }) {
|
|
17685
|
-
const [query, setQuery] =
|
|
17686
|
-
const [answer, setAnswer] =
|
|
17720
|
+
const [query, setQuery] = useState82("");
|
|
17721
|
+
const [answer, setAnswer] = useState82(null);
|
|
17687
17722
|
const controllerRef = useRef45(controller);
|
|
17688
17723
|
controllerRef.current = controller;
|
|
17689
17724
|
const trimmed = query.trim();
|
|
@@ -17753,7 +17788,7 @@ function FavouritesSearch({ controller, ui, sport, onNotice }) {
|
|
|
17753
17788
|
// src/components/FavouritesPanel.tsx
|
|
17754
17789
|
import { jsx as jsx146, jsxs as jsxs127 } from "react/jsx-runtime";
|
|
17755
17790
|
function FavouritesPanel({ controller, ui, sport, sports, onSportChange }) {
|
|
17756
|
-
const [notice, setNotice] =
|
|
17791
|
+
const [notice, setNotice] = useState83(null);
|
|
17757
17792
|
const refreshRef = useRef46(controller.refresh);
|
|
17758
17793
|
refreshRef.current = controller.refresh;
|
|
17759
17794
|
useEffect55(() => {
|
|
@@ -17785,7 +17820,7 @@ function FavouritesPanel({ controller, ui, sport, sports, onSportChange }) {
|
|
|
17785
17820
|
}
|
|
17786
17821
|
|
|
17787
17822
|
// src/components/PresetTools.tsx
|
|
17788
|
-
import { useId as useId12, useState as
|
|
17823
|
+
import { useId as useId12, useState as useState84 } from "react";
|
|
17789
17824
|
import { Fragment as Fragment45, jsx as jsx147, jsxs as jsxs128 } from "react/jsx-runtime";
|
|
17790
17825
|
function PresetToolModal({ title, closeLabel, onClose, children, footer, className }) {
|
|
17791
17826
|
const { dialogRef, onKeyDown } = useModalDialog(onClose, { restoreFocus: false });
|
|
@@ -17839,9 +17874,9 @@ function BuildComboTool({ grid, strings, streaming, formatKickoff, initialTotal,
|
|
|
17839
17874
|
const totalOptions = comboTotals(grid);
|
|
17840
17875
|
const totals = totalOptions.map((o) => o.value);
|
|
17841
17876
|
const legChoices = comboLegChoices(grid);
|
|
17842
|
-
const [total, setTotal] =
|
|
17843
|
-
const [legs, setLegs] =
|
|
17844
|
-
const [announcement, setAnnouncement] =
|
|
17877
|
+
const [total, setTotal] = useState84(() => nearest(totals, initialTotal));
|
|
17878
|
+
const [legs, setLegs] = useState84(() => legsForTotal(grid, nearest(totals, initialTotal), clampLegs(legChoices, initialLegs)));
|
|
17879
|
+
const [announcement, setAnnouncement] = useState84("");
|
|
17845
17880
|
const cell2 = findCombo(grid, total, legs);
|
|
17846
17881
|
const minLegs = legChoices[0] ?? legs;
|
|
17847
17882
|
const maxLegs = legChoices[legChoices.length - 1] ?? legs;
|
|
@@ -17880,7 +17915,7 @@ function FavouritesSheet({ ui, controller, sport, sports, onSportChange, onClose
|
|
|
17880
17915
|
}
|
|
17881
17916
|
|
|
17882
17917
|
// src/components/dashboard/v8/SentenceBuilder.tsx
|
|
17883
|
-
import { useEffect as useEffect57, useId as useId13, useRef as useRef48, useState as
|
|
17918
|
+
import { useEffect as useEffect57, useId as useId13, useRef as useRef48, useState as useState85 } from "react";
|
|
17884
17919
|
import { MAX_SWAPPED_IDS } from "@sensiblestats/widget-sdk";
|
|
17885
17920
|
import { Fragment as Fragment46, jsx as jsx149, jsxs as jsxs129 } from "react/jsx-runtime";
|
|
17886
17921
|
var TOTALS = ["any", "3", "5", "10", "20", "50"];
|
|
@@ -17921,8 +17956,8 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
17921
17956
|
const opening = openingGames(preset);
|
|
17922
17957
|
const gamesOptions = opening.options;
|
|
17923
17958
|
const marketOptions = usableMarkets(preset);
|
|
17924
|
-
const [fingerprint] =
|
|
17925
|
-
const [saved] =
|
|
17959
|
+
const [fingerprint] = useState85(() => JSON.stringify(preset));
|
|
17960
|
+
const [saved] = useState85(() => {
|
|
17926
17961
|
const kept = memory3?.savedView(sport);
|
|
17927
17962
|
return kept && kept.fingerprint === fingerprint ? kept : null;
|
|
17928
17963
|
});
|
|
@@ -17937,9 +17972,9 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
17937
17972
|
// The server never widens by itself: an all-games preset with no ids asks for it.
|
|
17938
17973
|
widen: opening.option ? opening.option.matchIds.length === 0 : preset.gamesScope === "all" && preset.matchIds.length === 0
|
|
17939
17974
|
};
|
|
17940
|
-
const [view, setView] =
|
|
17975
|
+
const [view, setView] = useState85(() => saved?.view ?? openingView);
|
|
17941
17976
|
const autoWidened = useRef48(false);
|
|
17942
|
-
const [widenedNote, setWidenedNote] =
|
|
17977
|
+
const [widenedNote, setWidenedNote] = useState85(saved?.widenedNote ?? false);
|
|
17943
17978
|
const track = useTrack();
|
|
17944
17979
|
const requestFor = (v, extra) => ({
|
|
17945
17980
|
sport,
|
|
@@ -17955,9 +17990,9 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
17955
17990
|
...operatorUserId ? { operatorUserId } : {},
|
|
17956
17991
|
...anonymousUserId ? { anonymousUserId } : {}
|
|
17957
17992
|
});
|
|
17958
|
-
const [editing, setEditing] =
|
|
17959
|
-
const [draft, setDraft] =
|
|
17960
|
-
const [invalid, setInvalid] =
|
|
17993
|
+
const [editing, setEditing] = useState85(false);
|
|
17994
|
+
const [draft, setDraft] = useState85("");
|
|
17995
|
+
const [invalid, setInvalid] = useState85(null);
|
|
17961
17996
|
const inputRef = useRef48(null);
|
|
17962
17997
|
const pencilRef = useRef48(null);
|
|
17963
17998
|
const noteId = useId13();
|
|
@@ -17982,9 +18017,9 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
17982
18017
|
setEditing(false);
|
|
17983
18018
|
pencilRef.current?.focus();
|
|
17984
18019
|
};
|
|
17985
|
-
const [first] =
|
|
18020
|
+
const [first] = useState85(() => requestFor(view));
|
|
17986
18021
|
const { grid, answeredFor, status: status2, confirmed, request } = useBuilderGrid({ conversation, locale: ui.hostTag, memory: memory3, initial: first });
|
|
17987
|
-
const [shown2, setShown] =
|
|
18022
|
+
const [shown2, setShown] = useState85(null);
|
|
17988
18023
|
if (grid === null) {
|
|
17989
18024
|
if (shown2 !== null && status2 === "ready") setShown(null);
|
|
17990
18025
|
} else if (answeredFor && (shown2?.seen !== grid || shown2.seenReq !== answeredFor)) {
|
|
@@ -18029,7 +18064,7 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
18029
18064
|
};
|
|
18030
18065
|
const canNarrow = preset.matchIds.length > 0;
|
|
18031
18066
|
const ready = status2 === "ready" && grid !== null;
|
|
18032
|
-
const [tapped, setTapped] =
|
|
18067
|
+
const [tapped, setTapped] = useState85(null);
|
|
18033
18068
|
const busy = tapped !== null && status2 === "loading" && shown2 !== null;
|
|
18034
18069
|
const g = ready ? shown2?.grid ?? grid : busy ? shown2.grid : null;
|
|
18035
18070
|
const suggested = g?.status === "miss" || g?.nearest === true ? g.legCountThatLands : null;
|
|
@@ -18056,13 +18091,13 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
18056
18091
|
}, [tapped, status2]);
|
|
18057
18092
|
const rowSlip = rows ? guardLegsPreMatch(slip, rows, ui) : slip;
|
|
18058
18093
|
useNextKickoffRender(rows ? rows.map((l) => l.kickoffUtc) : []);
|
|
18059
|
-
const [startedNote, setStartedNote] =
|
|
18094
|
+
const [startedNote, setStartedNote] = useState85(false);
|
|
18060
18095
|
const anyStarted = rows !== null && rows.some((l) => !preMatchOpen(l.kickoffUtc, Date.now()));
|
|
18061
18096
|
useEffect57(() => {
|
|
18062
18097
|
if (startedNote && status2 === "ready" && !anyStarted) setStartedNote(false);
|
|
18063
18098
|
}, [startedNote, status2, anyStarted]);
|
|
18064
18099
|
const market = rows?.[0]?.market;
|
|
18065
|
-
const [seen2, setSeen] =
|
|
18100
|
+
const [seen2, setSeen] = useState85(null);
|
|
18066
18101
|
useEffect57(() => {
|
|
18067
18102
|
if (market) setSeen(market);
|
|
18068
18103
|
}, [market]);
|
|
@@ -18581,10 +18616,10 @@ function Squad({ squad, loading, ui, view, onToggleView, stats, statsLoading, se
|
|
|
18581
18616
|
}
|
|
18582
18617
|
|
|
18583
18618
|
// src/components/PlayerPhoto.tsx
|
|
18584
|
-
import { useState as
|
|
18619
|
+
import { useState as useState86 } from "react";
|
|
18585
18620
|
import { jsx as jsx155 } from "react/jsx-runtime";
|
|
18586
18621
|
function PlayerPhoto({ photoUrl, jerseyNumber, size }) {
|
|
18587
|
-
const [failed, setFailed] =
|
|
18622
|
+
const [failed, setFailed] = useState86(false);
|
|
18588
18623
|
const box = { width: size, height: size };
|
|
18589
18624
|
if (photoUrl && !failed) {
|
|
18590
18625
|
return /* @__PURE__ */ jsx155("img", { className: "ss-w-pd-photo", style: box, src: photoUrl, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
@@ -18619,7 +18654,7 @@ function MiniPitch({ positionCode }) {
|
|
|
18619
18654
|
}
|
|
18620
18655
|
|
|
18621
18656
|
// src/components/PerformanceBars.tsx
|
|
18622
|
-
import { useState as
|
|
18657
|
+
import { useState as useState87 } from "react";
|
|
18623
18658
|
import { jsx as jsx157, jsxs as jsxs135 } from "react/jsx-runtime";
|
|
18624
18659
|
var GROUPS = ["shooting", "passing", "possession", "defending"];
|
|
18625
18660
|
function finite4(v) {
|
|
@@ -18665,7 +18700,7 @@ function unrankedLine(ui, reason) {
|
|
|
18665
18700
|
}
|
|
18666
18701
|
}
|
|
18667
18702
|
function PerformanceBars({ performance, competitionName, strings }) {
|
|
18668
|
-
const [mode, setMode] =
|
|
18703
|
+
const [mode, setMode] = useState87("total");
|
|
18669
18704
|
const labelled = performance.metrics.filter((m) => Object.prototype.hasOwnProperty.call(strings.perfMetric, m.key));
|
|
18670
18705
|
if (!labelled.some((m) => valueOf(m, "total") !== null || valueOf(m, "per90") !== null)) return null;
|
|
18671
18706
|
const subtitle = !performance.ranked ? unrankedLine(strings, performance.unrankedReason) : competitionName ? strings.perfRankedAgainst(competitionName, performance.positionGroup) : null;
|
|
@@ -18874,7 +18909,7 @@ function SettingsSheet({ ui, onClose }) {
|
|
|
18874
18909
|
import { Fragment as Fragment49, jsx as jsx160, jsxs as jsxs138 } from "react/jsx-runtime";
|
|
18875
18910
|
var FULLSCREEN_QUERY = "(max-width: 639px)";
|
|
18876
18911
|
function useIsModal() {
|
|
18877
|
-
const [modal, setModal] =
|
|
18912
|
+
const [modal, setModal] = useState88(false);
|
|
18878
18913
|
useEffect58(() => {
|
|
18879
18914
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
|
|
18880
18915
|
const mql = window.matchMedia(FULLSCREEN_QUERY);
|
|
@@ -18889,8 +18924,8 @@ var HIDDEN_LAYER_STYLE = { position: "absolute", inset: 0, visibility: "hidden",
|
|
|
18889
18924
|
var SQUAD_LAYER_STYLE = { display: "flex", flexDirection: "column", flex: 1, minHeight: 0 };
|
|
18890
18925
|
function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, schedule, gamesResult, leaderboardResult, clubFixturesResult, clubStandingsResult, clubSquadResult, clubSquadStatsResult, clubPlayerDetailResult, loggedIn, conversation, presetGrid, favouritesEnabled, favourites, builder, onCloseRequested, onRegisterBack }) {
|
|
18891
18926
|
const { state, close, stop, send, reset } = controller;
|
|
18892
|
-
const [squadView, setSquadView] =
|
|
18893
|
-
const [selectedPlayerId, setSelectedPlayerId] =
|
|
18927
|
+
const [squadView, setSquadView] = useState88("roster");
|
|
18928
|
+
const [selectedPlayerId, setSelectedPlayerId] = useState88(null);
|
|
18894
18929
|
const clearPlayerDetail = clubPlayerDetailResult?.clear;
|
|
18895
18930
|
const fetchPlayerDetail = clubPlayerDetailResult?.fetch;
|
|
18896
18931
|
const squadLayerRef = useRef49(null);
|
|
@@ -18939,7 +18974,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
18939
18974
|
const closeTab = tabs?.activeTab ?? "chat";
|
|
18940
18975
|
const lastMessage = state.messages[state.messages.length - 1];
|
|
18941
18976
|
const answering = state.isStreaming && !(lastMessage?.role === "assistant" && lastMessage.isGreeting);
|
|
18942
|
-
const closeWith =
|
|
18977
|
+
const closeWith = useCallback30((method) => {
|
|
18943
18978
|
track({ name: "widget_close", method, tab: closeTab, answering });
|
|
18944
18979
|
if (onCloseRequested) onCloseRequested();
|
|
18945
18980
|
else close();
|
|
@@ -18968,22 +19003,22 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
18968
19003
|
const limitRef = useRef49(null);
|
|
18969
19004
|
const typedSendRef = useRef49(false);
|
|
18970
19005
|
const focusAfterCloseRef = useRef49(null);
|
|
18971
|
-
const [tool, setTool] =
|
|
19006
|
+
const [tool, setTool] = useState88(null);
|
|
18972
19007
|
const panelRef = useRef49(null);
|
|
18973
19008
|
const settings = useOddsSettings();
|
|
18974
|
-
const [settingsOpen, setSettingsOpen] =
|
|
19009
|
+
const [settingsOpen, setSettingsOpen] = useState88(false);
|
|
18975
19010
|
const hasSettings = settings.oddsOffered || !settings.themeLocked;
|
|
18976
|
-
const openSettings =
|
|
19011
|
+
const openSettings = useCallback30(() => {
|
|
18977
19012
|
setTool(null);
|
|
18978
19013
|
setFavouritesOpen?.(false);
|
|
18979
19014
|
setSettingsOpen(true);
|
|
18980
19015
|
}, [setFavouritesOpen]);
|
|
18981
|
-
const closeSettings =
|
|
19016
|
+
const closeSettings = useCallback30(() => {
|
|
18982
19017
|
setSettingsOpen(false);
|
|
18983
19018
|
panelRef.current?.querySelector(".ss-w-kebab")?.focus();
|
|
18984
19019
|
}, []);
|
|
18985
|
-
const openFavourites =
|
|
18986
|
-
const closeFavourites =
|
|
19020
|
+
const openFavourites = useCallback30(() => setFavouritesOpen?.(true), [setFavouritesOpen]);
|
|
19021
|
+
const closeFavourites = useCallback30(() => {
|
|
18987
19022
|
setFavouritesOpen?.(false);
|
|
18988
19023
|
panelRef.current?.querySelector(".ss-w-kebab")?.focus();
|
|
18989
19024
|
}, [setFavouritesOpen]);
|
|
@@ -19001,24 +19036,24 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
19001
19036
|
if (typedSendRef.current) limitRef.current?.focus();
|
|
19002
19037
|
typedSendRef.current = false;
|
|
19003
19038
|
}, [paused]);
|
|
19004
|
-
const openTool =
|
|
19039
|
+
const openTool = useCallback30((next) => {
|
|
19005
19040
|
setTool(next);
|
|
19006
19041
|
}, []);
|
|
19007
19042
|
const toolsValue = useMemo16(
|
|
19008
19043
|
() => presetGrid && !paused ? { openBuilder: (total, legs) => openTool({ total, legs }), changeLabel: ui.presets.changeCombo } : null,
|
|
19009
19044
|
[presetGrid, paused, openTool, ui.presets.changeCombo]
|
|
19010
19045
|
);
|
|
19011
|
-
const closeTool =
|
|
19046
|
+
const closeTool = useCallback30(() => {
|
|
19012
19047
|
focusAfterCloseRef.current = "composer";
|
|
19013
19048
|
setTool(null);
|
|
19014
19049
|
}, []);
|
|
19015
|
-
const sendAsk =
|
|
19050
|
+
const sendAsk = useCallback30((ask) => {
|
|
19016
19051
|
focusAfterCloseRef.current = "composer";
|
|
19017
19052
|
setTool(null);
|
|
19018
19053
|
tabs?.setActiveTab("chat");
|
|
19019
19054
|
send(ask.message, { displayText: ask.displayText, preset: ask.preset, source: "preset" });
|
|
19020
19055
|
}, [tabs, send]);
|
|
19021
|
-
const formatKickoff =
|
|
19056
|
+
const formatKickoff = useCallback30((kickoffUtc) => {
|
|
19022
19057
|
const k = ui.bettingKickoff(kickoffUtc);
|
|
19023
19058
|
return `${k.dayLabel} ${k.time}`;
|
|
19024
19059
|
}, [ui]);
|
|
@@ -22105,6 +22140,8 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
22105
22140
|
.ss-w-tni-price-lab { color: var(--ss-w-faint); font-weight: 600; }
|
|
22106
22141
|
.ss-w-tni-price-val { color: var(--ss-w-ink); font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
|
|
22107
22142
|
.ss-w-tni-price-sep { color: var(--ss-w-faint); font-weight: 400; }
|
|
22143
|
+
.ss-w-v2-row[data-settled], .ss-w-v2-tile[data-settled] { cursor: default; }
|
|
22144
|
+
.ss-w-pill--done { background: var(--ss-w-panel); color: var(--ss-w-faint); box-shadow: inset 0 0 0 1.5px var(--ss-w-line); font-size: 13px; }
|
|
22108
22145
|
`;
|
|
22109
22146
|
|
|
22110
22147
|
// src/StatsWidget.tsx
|
|
@@ -22156,7 +22193,7 @@ function StatsWidget(props) {
|
|
|
22156
22193
|
const oddsSettings = useOddsSettingsState(ui, built?.conversation, cfg?.operatorId || "default");
|
|
22157
22194
|
const rootRef = useRef50(null);
|
|
22158
22195
|
const introDoneRef = useRef50(false);
|
|
22159
|
-
const markIntroDone =
|
|
22196
|
+
const markIntroDone = useCallback31(() => {
|
|
22160
22197
|
introDoneRef.current = true;
|
|
22161
22198
|
}, []);
|
|
22162
22199
|
const language = injectedClient ? void 0 : hostTag(cfg);
|
|
@@ -22195,15 +22232,15 @@ function StatsWidget(props) {
|
|
|
22195
22232
|
});
|
|
22196
22233
|
const operatorUserId = cfg?.userContext?.operatorUserId;
|
|
22197
22234
|
const anonymousUserId = cfg?.userContext?.anonymousUserId;
|
|
22198
|
-
const getSchedule =
|
|
22235
|
+
const getSchedule = useCallback31(
|
|
22199
22236
|
(localDate, utcOffsetMinutes) => built ? built.conversation.getSchedule(localDate, utcOffsetMinutes, operatorUserId, anonymousUserId) : Promise.resolve(null),
|
|
22200
22237
|
[built, operatorUserId, anonymousUserId]
|
|
22201
22238
|
);
|
|
22202
|
-
const getStates =
|
|
22239
|
+
const getStates = useCallback31(
|
|
22203
22240
|
(matchIds, nbaGameIds, nflGameIds, tennisMatches) => built ? built.conversation.getStates(matchIds, nbaGameIds, nflGameIds, requestTag, tennisMatches) : Promise.resolve(null),
|
|
22204
22241
|
[built, requestTag]
|
|
22205
22242
|
);
|
|
22206
|
-
const getTennisPrices =
|
|
22243
|
+
const getTennisPrices = useCallback31(
|
|
22207
22244
|
(keys) => built ? built.conversation.getStates([], [], [], requestTag, [], keys).then((p) => p?.tennisPrices ?? null) : Promise.resolve(null),
|
|
22208
22245
|
[built, requestTag]
|
|
22209
22246
|
);
|
|
@@ -22227,7 +22264,7 @@ function StatsWidget(props) {
|
|
|
22227
22264
|
return [...seen2];
|
|
22228
22265
|
}, [discovery.matchDays, discovery.groups]);
|
|
22229
22266
|
const scheduleSport = useScheduleSport(offeredSports);
|
|
22230
|
-
const [liveLeague, setLiveLeague] =
|
|
22267
|
+
const [liveLeague, setLiveLeague] = useState89(null);
|
|
22231
22268
|
const [matchesDay, setMatchesDay] = useMatchesDayPick(discovery.localDate);
|
|
22232
22269
|
const matchesLoaded = useMatchesDay({
|
|
22233
22270
|
discovery,
|
|
@@ -22278,7 +22315,7 @@ function StatsWidget(props) {
|
|
|
22278
22315
|
const clubSquadResult = useClubSquad(built?.conversation ?? null, { activeTab: monitor.activeTab, enabled: clubFixturesResult.enabled });
|
|
22279
22316
|
const clubSquadStatsResult = useClubSquadStats(built?.conversation ?? null, { activeTab: monitor.activeTab, enabled: clubFixturesResult.enabled });
|
|
22280
22317
|
const clubPlayerDetailResult = useClubPlayerDetail(built?.conversation ?? null);
|
|
22281
|
-
const [favSportPick, setFavSportPick] =
|
|
22318
|
+
const [favSportPick, setFavSportPick] = useState89(null);
|
|
22282
22319
|
const latestGreeting = useMemo17(() => {
|
|
22283
22320
|
for (const m of [...controller.state.messages].reverse()) {
|
|
22284
22321
|
if (m.role === "assistant" && m.defaultSport !== void 0) return m;
|
|
@@ -22294,13 +22331,13 @@ function StatsWidget(props) {
|
|
|
22294
22331
|
const favSport = [favSportPick, rememberedSport, latestGreeting?.defaultSport].find(offered) ?? "football";
|
|
22295
22332
|
const favSports = favSportOptions.length > 0 ? favSportOptions : [{ sport: favSport, label: sportLabel(ui, favSport) }];
|
|
22296
22333
|
const hasFavouritesIdentity = !!(operatorUserId || anonymousUserId);
|
|
22297
|
-
const [builderSportPick, setBuilderSportPick] =
|
|
22334
|
+
const [builderSportPick, setBuilderSportPick] = useState89(null);
|
|
22298
22335
|
const builderGreeting = useMemo17(
|
|
22299
22336
|
() => [...controller.state.messages].reverse().find((m) => m.role === "assistant" && (m.greetingDashboard !== void 0 || m.greetingDashboards !== void 0)) ?? null,
|
|
22300
22337
|
[controller.state.messages]
|
|
22301
22338
|
);
|
|
22302
|
-
const [coolOff, setCoolOff] =
|
|
22303
|
-
const onBuilderCoolOff =
|
|
22339
|
+
const [coolOff, setCoolOff] = useState89(null);
|
|
22340
|
+
const onBuilderCoolOff = useCallback31((sport) => {
|
|
22304
22341
|
if (!builderGreeting) return;
|
|
22305
22342
|
setCoolOff((prev) => {
|
|
22306
22343
|
const sports = prev?.greeting === builderGreeting ? prev.sports : [];
|
|
@@ -22324,7 +22361,7 @@ function StatsWidget(props) {
|
|
|
22324
22361
|
return options.filter((o) => !cooled.includes(o.sport));
|
|
22325
22362
|
}, [builderGreeting, coolOff, ui]);
|
|
22326
22363
|
const builderSport = [builderSportPick, rememberedSport, latestGreeting?.defaultSport].find((s) => !!s && builderOptions.some((o) => o.sport === s)) ?? builderOptions[0]?.sport ?? "";
|
|
22327
|
-
const [panelEverOpened, setPanelEverOpened] =
|
|
22364
|
+
const [panelEverOpened, setPanelEverOpened] = useState89(panelOpen);
|
|
22328
22365
|
if (panelOpen && !panelEverOpened) setPanelEverOpened(true);
|
|
22329
22366
|
const favourites = useFavourites({
|
|
22330
22367
|
conversation: built?.conversation ?? null,
|
|
@@ -22336,9 +22373,9 @@ function StatsWidget(props) {
|
|
|
22336
22373
|
onChanged: discovery.refreshSchedule
|
|
22337
22374
|
});
|
|
22338
22375
|
const favouritesEnabled = hasFavouritesIdentity && favourites.status !== "refused";
|
|
22339
|
-
const [favouritesOpen, setFavouritesOpen] =
|
|
22376
|
+
const [favouritesOpen, setFavouritesOpen] = useState89(false);
|
|
22340
22377
|
if (!panelOpen && favouritesOpen) setFavouritesOpen(false);
|
|
22341
|
-
const getPricePresets =
|
|
22378
|
+
const getPricePresets = useCallback31(
|
|
22342
22379
|
(locale) => built ? built.conversation.getPricePresets(locale, { pool: "open" }) : Promise.resolve(null),
|
|
22343
22380
|
[built]
|
|
22344
22381
|
);
|
|
@@ -22425,15 +22462,15 @@ function StatsWidget(props) {
|
|
|
22425
22462
|
dismissPopupRef.current = dismissPopup;
|
|
22426
22463
|
const greetingMeta = latestGreetingMeta(controller.state.messages);
|
|
22427
22464
|
useBubbleGreetingShown(logger, logger ?? NO_OWNER, controller.state.popupText, greetingMeta, mobile.confirmedShown);
|
|
22428
|
-
const [highlight, setHighlight] =
|
|
22429
|
-
const clearHighlight =
|
|
22465
|
+
const [highlight, setHighlight] = useState89(null);
|
|
22466
|
+
const clearHighlight = useCallback31(() => setHighlight(null), []);
|
|
22430
22467
|
useEffect59(() => {
|
|
22431
22468
|
if (!panelOpen) setHighlight(null);
|
|
22432
22469
|
}, [panelOpen]);
|
|
22433
22470
|
const highlightRequest = useMemo17(() => highlight ? { ...highlight, clear: clearHighlight } : null, [highlight, clearHighlight]);
|
|
22434
22471
|
const { open: openFromCta, state: { greetingBubble } } = controller;
|
|
22435
22472
|
const setTab = monitor.setActiveTab;
|
|
22436
|
-
const logCtaClick =
|
|
22473
|
+
const logCtaClick = useCallback31(() => {
|
|
22437
22474
|
if (!logger || !greetingMeta) return;
|
|
22438
22475
|
logger.log({ name: "greeting_cta_click", greeting: { greetingId: greetingMeta.greetingId, case: greetingMeta.case, sport: greetingMeta.sport, market: greetingMeta.market ?? null } });
|
|
22439
22476
|
}, [logger, greetingMeta]);
|
|
@@ -22450,7 +22487,7 @@ function StatsWidget(props) {
|
|
|
22450
22487
|
if (!bubbleCta) logCtaClick();
|
|
22451
22488
|
openFromCta();
|
|
22452
22489
|
};
|
|
22453
|
-
const onCta =
|
|
22490
|
+
const onCta = useCallback31(() => onCtaRef.current(), []);
|
|
22454
22491
|
useOpenTelemetry(logger, panelOpen);
|
|
22455
22492
|
const onControlRef = useRef50(props.onControl);
|
|
22456
22493
|
onControlRef.current = props.onControl;
|