@sensiblestats/widget-react 0.151.0 → 0.152.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.cjs +440 -364
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -2
- package/dist/index.d.ts +19 -2
- package/dist/index.js +230 -154
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/StatsWidget.tsx
|
|
2
|
-
import { useCallback as useCallback30, useEffect as
|
|
2
|
+
import { useCallback as useCallback30, useEffect as useEffect60, useMemo as useMemo16, useRef as useRef50, useState as useState88 } from "react";
|
|
3
3
|
import { StatsWidgetClient } from "@sensiblestats/widget-sdk";
|
|
4
4
|
|
|
5
5
|
// src/strings/tag.ts
|
|
@@ -1347,7 +1347,7 @@ function parseCustomTotal(text2, format2) {
|
|
|
1347
1347
|
}
|
|
1348
1348
|
|
|
1349
1349
|
// src/version.generated.ts
|
|
1350
|
-
var WIDGET_REACT_VERSION = "0.
|
|
1350
|
+
var WIDGET_REACT_VERSION = "0.152.0";
|
|
1351
1351
|
|
|
1352
1352
|
// src/config.ts
|
|
1353
1353
|
function hostTag(cfg) {
|
|
@@ -8189,14 +8189,16 @@ function usePopupTelemetry(log, isOpen, popupText, dismissPopup, confirmedShown)
|
|
|
8189
8189
|
import { useCallback as useCallback25, useEffect as useEffect30, useRef as useRef25, useState as useState35 } from "react";
|
|
8190
8190
|
var CLEARED = { text: null, asks: [] };
|
|
8191
8191
|
function useMobileBinding(args) {
|
|
8192
|
-
const { binding, panelOpen, popupText, asks, cta } = args;
|
|
8192
|
+
const { binding, panelOpen, popupText, asks, cta, price } = args;
|
|
8193
8193
|
const latest = useRef25(args);
|
|
8194
8194
|
latest.current = args;
|
|
8195
8195
|
const bindingRef = useRef25(binding);
|
|
8196
8196
|
bindingRef.current = binding;
|
|
8197
8197
|
const backRef = useRef25(null);
|
|
8198
|
+
const priceRef = useRef25(null);
|
|
8199
|
+
const priceInFlight = useRef25(/* @__PURE__ */ new Set()).current;
|
|
8198
8200
|
const [confirmedShown, setConfirmedShown] = useState35(null);
|
|
8199
|
-
const teaserKey = panelOpen || !popupText ? "" : JSON.stringify([popupText, asks.map((a) => a.label), cta]);
|
|
8201
|
+
const teaserKey = panelOpen || !popupText ? "" : JSON.stringify([popupText, asks.map((a) => a.label), cta, price]);
|
|
8200
8202
|
const reported = useRef25({ binding: void 0, key: "" });
|
|
8201
8203
|
useEffect30(() => {
|
|
8202
8204
|
if (!binding) return;
|
|
@@ -8204,7 +8206,7 @@ function useMobileBinding(args) {
|
|
|
8204
8206
|
if (prev.binding === binding && prev.key === teaserKey) return;
|
|
8205
8207
|
reported.current = { binding, key: teaserKey };
|
|
8206
8208
|
if (teaserKey === "" && prev.binding !== binding) return;
|
|
8207
|
-
binding.onTeaser(teaserKey === "" ? CLEARED : { text: popupText, asks: asks.map((a, index) => ({ index, label: a.label })), ...cta ? { cta } : {} });
|
|
8209
|
+
binding.onTeaser(teaserKey === "" ? CLEARED : { text: popupText, asks: asks.map((a, index) => ({ index, label: a.label })), ...cta ? { cta } : {}, ...price ? { price } : {} });
|
|
8208
8210
|
}, [binding, teaserKey]);
|
|
8209
8211
|
useEffect30(() => {
|
|
8210
8212
|
if (!binding) return;
|
|
@@ -8220,6 +8222,12 @@ function useMobileBinding(args) {
|
|
|
8220
8222
|
tapCta: () => {
|
|
8221
8223
|
if (latest.current.cta) latest.current.onCta();
|
|
8222
8224
|
},
|
|
8225
|
+
tapTeaser: () => latest.current.onTeaserTap(),
|
|
8226
|
+
tapPrice: (matchOddsId) => {
|
|
8227
|
+
const { panelOpen: open, popupText: text2, price: shown2 } = latest.current;
|
|
8228
|
+
if (open || !text2 || shown2?.matchOddsId !== matchOddsId) return;
|
|
8229
|
+
priceRef.current?.();
|
|
8230
|
+
},
|
|
8223
8231
|
dismissTeaser: () => latest.current.dismissPopup(),
|
|
8224
8232
|
teaserShown: () => setConfirmedShown(latest.current.popupText),
|
|
8225
8233
|
back: () => backRef.current?.() ?? false
|
|
@@ -8230,8 +8238,12 @@ function useMobileBinding(args) {
|
|
|
8230
8238
|
const onRegisterBack = useCallback25((fn) => {
|
|
8231
8239
|
backRef.current = fn;
|
|
8232
8240
|
}, []);
|
|
8233
|
-
|
|
8234
|
-
|
|
8241
|
+
const onRegisterPrice = useCallback25((fn) => {
|
|
8242
|
+
priceRef.current = fn;
|
|
8243
|
+
}, []);
|
|
8244
|
+
const onPriceResult = useCallback25((result) => bindingRef.current?.onPriceResult(result), []);
|
|
8245
|
+
if (!binding) return { confirmedShown: void 0, onCloseRequested: void 0, onRegisterBack: void 0, onRegisterPrice: void 0, onPriceResult: void 0, priceInFlight: void 0 };
|
|
8246
|
+
return { confirmedShown, onCloseRequested, onRegisterBack, onRegisterPrice, onPriceResult, priceInFlight };
|
|
8235
8247
|
}
|
|
8236
8248
|
|
|
8237
8249
|
// src/openTelemetry.ts
|
|
@@ -8333,11 +8345,44 @@ function BubblePrice({ matchId, price, conversation, slip, ui, hook, sport }) {
|
|
|
8333
8345
|
] });
|
|
8334
8346
|
}
|
|
8335
8347
|
|
|
8348
|
+
// src/components/MobileBubblePrice.tsx
|
|
8349
|
+
import { useEffect as useEffect33, useRef as useRef28 } from "react";
|
|
8350
|
+
function MobileBubblePrice(props) {
|
|
8351
|
+
const add = useRepriceAdd({ conversation: props.conversation, locale: props.ui.hostTag, slip: props.slip, ui: props.ui, sport: props.sport });
|
|
8352
|
+
const latest = useRef28({ props, add });
|
|
8353
|
+
latest.current = { props, add };
|
|
8354
|
+
const { onRegister, inFlight: inFlight2 } = props;
|
|
8355
|
+
useEffect33(() => {
|
|
8356
|
+
onRegister(() => {
|
|
8357
|
+
const { props: p, add: run } = latest.current;
|
|
8358
|
+
const id = p.price.selection.matchOddsId;
|
|
8359
|
+
if (inFlight2.has(id)) return;
|
|
8360
|
+
const report = (r) => {
|
|
8361
|
+
const now = latest.current.props;
|
|
8362
|
+
try {
|
|
8363
|
+
now.onResult({ matchOddsId: id, outcome: r.outcome, text: r.toast?.text ?? (r.outcome === "gone" ? now.ui.v2PriceGone : null) });
|
|
8364
|
+
} catch {
|
|
8365
|
+
}
|
|
8366
|
+
};
|
|
8367
|
+
if (!run) {
|
|
8368
|
+
report({ outcome: "failed" });
|
|
8369
|
+
return;
|
|
8370
|
+
}
|
|
8371
|
+
inFlight2.add(id);
|
|
8372
|
+
run(p.matchId, p.price.market, p.price.selection, p.hook).then(report, () => report({ outcome: "failed" })).finally(() => {
|
|
8373
|
+
inFlight2.delete(id);
|
|
8374
|
+
});
|
|
8375
|
+
});
|
|
8376
|
+
return () => onRegister(null);
|
|
8377
|
+
}, [onRegister, inFlight2]);
|
|
8378
|
+
return null;
|
|
8379
|
+
}
|
|
8380
|
+
|
|
8336
8381
|
// src/components/ChatPanel.tsx
|
|
8337
|
-
import { useCallback as useCallback29, useEffect as
|
|
8382
|
+
import { useCallback as useCallback29, useEffect as useEffect59, useLayoutEffect as useLayoutEffect2, useMemo as useMemo15, useRef as useRef49, useState as useState87 } from "react";
|
|
8338
8383
|
|
|
8339
8384
|
// src/components/ChatHeader.tsx
|
|
8340
|
-
import { useEffect as
|
|
8385
|
+
import { useEffect as useEffect34, useRef as useRef29, useState as useState38 } from "react";
|
|
8341
8386
|
import { jsx as jsx38, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
8342
8387
|
function ChatHeader({
|
|
8343
8388
|
onClose,
|
|
@@ -8354,17 +8399,17 @@ function ChatHeader({
|
|
|
8354
8399
|
favouritesLabel
|
|
8355
8400
|
}) {
|
|
8356
8401
|
const [menuOpen, setMenuOpen] = useState38(false);
|
|
8357
|
-
const wrapRef =
|
|
8358
|
-
const kebabRef =
|
|
8359
|
-
const firstItemRef =
|
|
8402
|
+
const wrapRef = useRef29(null);
|
|
8403
|
+
const kebabRef = useRef29(null);
|
|
8404
|
+
const firstItemRef = useRef29(null);
|
|
8360
8405
|
const hasNew = !!(canReset && onNewConversation);
|
|
8361
8406
|
const hasSettings = !!onOpenSettings;
|
|
8362
8407
|
const hasFavourites = !!onOpenFavourites;
|
|
8363
8408
|
const hasMenu = hasFavourites || hasNew || hasSettings;
|
|
8364
|
-
|
|
8409
|
+
useEffect34(() => {
|
|
8365
8410
|
if (menuOpen) firstItemRef.current?.focus();
|
|
8366
8411
|
}, [menuOpen]);
|
|
8367
|
-
|
|
8412
|
+
useEffect34(() => {
|
|
8368
8413
|
if (!menuOpen) return;
|
|
8369
8414
|
const onPointer = (e) => {
|
|
8370
8415
|
if (!(wrapRef.current && e.composedPath().includes(wrapRef.current))) setMenuOpen(false);
|
|
@@ -8452,7 +8497,7 @@ function ChatHeader({
|
|
|
8452
8497
|
}
|
|
8453
8498
|
|
|
8454
8499
|
// src/components/MessageList.tsx
|
|
8455
|
-
import { useEffect as
|
|
8500
|
+
import { useEffect as useEffect38, useRef as useRef32 } from "react";
|
|
8456
8501
|
|
|
8457
8502
|
// src/components/ChatMessage.tsx
|
|
8458
8503
|
import { useState as useState49 } from "react";
|
|
@@ -10095,7 +10140,7 @@ function TennisInsightList({ insights, ui }) {
|
|
|
10095
10140
|
}
|
|
10096
10141
|
|
|
10097
10142
|
// src/components/CompactOddsList.tsx
|
|
10098
|
-
import { useEffect as
|
|
10143
|
+
import { useEffect as useEffect35, useRef as useRef30, useState as useState42 } from "react";
|
|
10099
10144
|
import { mayPinOrSlip as mayPinOrSlip5, slipSportOf as slipSportOf6, sportOf as sportOf10 } from "@sensiblestats/widget-sdk";
|
|
10100
10145
|
|
|
10101
10146
|
// src/compactList.ts
|
|
@@ -10220,8 +10265,8 @@ function CompactOddsList({ list, ui, slip, monitor }) {
|
|
|
10220
10265
|
const [shown2, setShown] = useState42(COMPACT_PAGE);
|
|
10221
10266
|
const hidden = list.rowCount - shown2;
|
|
10222
10267
|
const [focusIndex, setFocusIndex] = useState42(null);
|
|
10223
|
-
const focusRef =
|
|
10224
|
-
|
|
10268
|
+
const focusRef = useRef30(null);
|
|
10269
|
+
useEffect35(() => {
|
|
10225
10270
|
if (focusIndex !== null) focusRef.current?.focus();
|
|
10226
10271
|
}, [focusIndex]);
|
|
10227
10272
|
let left = shown2;
|
|
@@ -10456,7 +10501,7 @@ function FixtureCard({ card, ui }) {
|
|
|
10456
10501
|
}
|
|
10457
10502
|
|
|
10458
10503
|
// src/components/dashboard/CountdownCard.tsx
|
|
10459
|
-
import { Fragment as Fragment15, useEffect as
|
|
10504
|
+
import { Fragment as Fragment15, useEffect as useEffect36, useState as useState43 } from "react";
|
|
10460
10505
|
import { jsx as jsx52, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
10461
10506
|
var DAY_MS3 = 864e5;
|
|
10462
10507
|
function remainingSegments(kickoffUnix, nowMs, withSeconds) {
|
|
@@ -10480,7 +10525,7 @@ function CountdownCard({ card, ui }) {
|
|
|
10480
10525
|
() => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches
|
|
10481
10526
|
);
|
|
10482
10527
|
const withinDay = data.kickoffUnix * 1e3 - nowMs < DAY_MS3;
|
|
10483
|
-
|
|
10528
|
+
useEffect36(() => {
|
|
10484
10529
|
if (reduced) return;
|
|
10485
10530
|
const id = window.setInterval(() => setNowMs(Date.now()), withinDay ? 1e3 : 6e4);
|
|
10486
10531
|
return () => window.clearInterval(id);
|
|
@@ -10836,10 +10881,10 @@ function RestingFormCard({ card }) {
|
|
|
10836
10881
|
}
|
|
10837
10882
|
|
|
10838
10883
|
// src/components/dashboard/LiveScoreCard.tsx
|
|
10839
|
-
import { useRef as
|
|
10884
|
+
import { useRef as useRef31, useState as useState47 } from "react";
|
|
10840
10885
|
|
|
10841
10886
|
// src/useLiveClock.ts
|
|
10842
|
-
import { useEffect as
|
|
10887
|
+
import { useEffect as useEffect37, useState as useState46 } from "react";
|
|
10843
10888
|
var TICK_MS = 6e4;
|
|
10844
10889
|
var MAX_LIVE_TICK_MINUTES = 15;
|
|
10845
10890
|
function computeDisplayMinute(minute, clockRunning, receivedAtMs) {
|
|
@@ -10851,7 +10896,7 @@ function useLiveClock(minute, clockRunning, receivedAtMs) {
|
|
|
10851
10896
|
const [displayMinute, setDisplayMinute] = useState46(
|
|
10852
10897
|
() => computeDisplayMinute(minute, clockRunning, receivedAtMs)
|
|
10853
10898
|
);
|
|
10854
|
-
|
|
10899
|
+
useEffect37(() => {
|
|
10855
10900
|
setDisplayMinute(computeDisplayMinute(minute, clockRunning, receivedAtMs));
|
|
10856
10901
|
if (!clockRunning) return;
|
|
10857
10902
|
const id = window.setInterval(() => {
|
|
@@ -10890,7 +10935,7 @@ function LiveScoreCard({
|
|
|
10890
10935
|
}) {
|
|
10891
10936
|
const { data } = card;
|
|
10892
10937
|
const seedKey = `${data.minute}:${data.homeScore}:${data.awayScore}`;
|
|
10893
|
-
const seedRef =
|
|
10938
|
+
const seedRef = useRef31(null);
|
|
10894
10939
|
if (!seedRef.current || seedRef.current.key !== seedKey) {
|
|
10895
10940
|
seedRef.current = { key: seedKey, receivedAtMs: Date.now() };
|
|
10896
10941
|
}
|
|
@@ -11232,11 +11277,11 @@ function turnAnchor(messages) {
|
|
|
11232
11277
|
function MessageList({ controller, ui, slip, onDashboardTap, monitor, onGreetingSport }) {
|
|
11233
11278
|
const { state, send } = controller;
|
|
11234
11279
|
const { oddsFormat } = useOddsSettings();
|
|
11235
|
-
const listRef =
|
|
11236
|
-
const endRef =
|
|
11237
|
-
const pinnedRef =
|
|
11238
|
-
const anchoredTurnRef =
|
|
11239
|
-
|
|
11280
|
+
const listRef = useRef32(null);
|
|
11281
|
+
const endRef = useRef32(null);
|
|
11282
|
+
const pinnedRef = useRef32(true);
|
|
11283
|
+
const anchoredTurnRef = useRef32(null);
|
|
11284
|
+
useEffect38(() => {
|
|
11240
11285
|
const anchor = turnAnchor(state.messages);
|
|
11241
11286
|
const list = listRef.current;
|
|
11242
11287
|
if (anchor && anchor.turnId !== anchoredTurnRef.current) {
|
|
@@ -11295,13 +11340,13 @@ function MessageList({ controller, ui, slip, onDashboardTap, monitor, onGreeting
|
|
|
11295
11340
|
}
|
|
11296
11341
|
|
|
11297
11342
|
// src/components/ChatInput.tsx
|
|
11298
|
-
import { forwardRef, useEffect as
|
|
11343
|
+
import { forwardRef, useEffect as useEffect39, useImperativeHandle, useRef as useRef33, useState as useState50 } from "react";
|
|
11299
11344
|
import { jsx as jsx76, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
11300
11345
|
var ChatInput = forwardRef(function ChatInput2({ placeholder, streaming, onSend, onStop, stopLabel, sendLabel, disabled = false }, ref) {
|
|
11301
11346
|
const [value, setValue] = useState50("");
|
|
11302
|
-
const textareaRef =
|
|
11303
|
-
const stopRef =
|
|
11304
|
-
const textBoxWantsFocusRef =
|
|
11347
|
+
const textareaRef = useRef33(null);
|
|
11348
|
+
const stopRef = useRef33(null);
|
|
11349
|
+
const textBoxWantsFocusRef = useRef33(false);
|
|
11305
11350
|
const submit = () => {
|
|
11306
11351
|
if (disabled) return;
|
|
11307
11352
|
const t = value.trim();
|
|
@@ -11327,7 +11372,7 @@ var ChatInput = forwardRef(function ChatInput2({ placeholder, streaming, onSend,
|
|
|
11327
11372
|
stopRef.current?.focus();
|
|
11328
11373
|
}
|
|
11329
11374
|
}), []);
|
|
11330
|
-
|
|
11375
|
+
useEffect39(() => {
|
|
11331
11376
|
if (streaming || disabled || !textBoxWantsFocusRef.current) return;
|
|
11332
11377
|
textBoxWantsFocusRef.current = false;
|
|
11333
11378
|
const box = textareaRef.current;
|
|
@@ -11358,7 +11403,7 @@ var ChatInput = forwardRef(function ChatInput2({ placeholder, streaming, onSend,
|
|
|
11358
11403
|
});
|
|
11359
11404
|
|
|
11360
11405
|
// src/components/TabBar.tsx
|
|
11361
|
-
import { useEffect as
|
|
11406
|
+
import { useEffect as useEffect40, useLayoutEffect, useRef as useRef34 } from "react";
|
|
11362
11407
|
import { jsx as jsx77, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
11363
11408
|
var TIGHT_LEVELS = [0, 1, 2, 3, 4, 5, 6, 7];
|
|
11364
11409
|
var FOCUS_EDGE = 24;
|
|
@@ -11381,9 +11426,9 @@ function TabBar({ monitor, ui, matchCount, trendsCount, liveCount, hasSchedule,
|
|
|
11381
11426
|
...gamesEnabled ? [{ tab: "games", label: ui.tabGames, count: 0, dot: false }] : []
|
|
11382
11427
|
];
|
|
11383
11428
|
const track = useTrack();
|
|
11384
|
-
const listRef =
|
|
11429
|
+
const listRef = useRef34(null);
|
|
11385
11430
|
const activeTab = monitor.activeTab;
|
|
11386
|
-
|
|
11431
|
+
useEffect40(() => {
|
|
11387
11432
|
const el = listRef.current?.querySelector("[data-on]");
|
|
11388
11433
|
if (!el || typeof el.scrollIntoView !== "function") return;
|
|
11389
11434
|
const reduce = typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
@@ -11414,7 +11459,7 @@ function TabBar({ monitor, ui, matchCount, trendsCount, liveCount, hasSchedule,
|
|
|
11414
11459
|
fonts?.removeEventListener?.("loadingdone", measure);
|
|
11415
11460
|
};
|
|
11416
11461
|
}, [labelSignature]);
|
|
11417
|
-
const pointerDown =
|
|
11462
|
+
const pointerDown = useRef34(false);
|
|
11418
11463
|
const keepFocusedTabInView = (e) => {
|
|
11419
11464
|
const strip = e.currentTarget;
|
|
11420
11465
|
const tab = e.target;
|
|
@@ -11947,10 +11992,10 @@ function NbaFormSection({ match, monitor, ui }) {
|
|
|
11947
11992
|
}
|
|
11948
11993
|
|
|
11949
11994
|
// src/components/NbaPropsSection.tsx
|
|
11950
|
-
import { useEffect as
|
|
11995
|
+
import { useEffect as useEffect42, useState as useState55 } from "react";
|
|
11951
11996
|
|
|
11952
11997
|
// src/components/PropsPieces.tsx
|
|
11953
|
-
import { useEffect as
|
|
11998
|
+
import { useEffect as useEffect41, useState as useState54 } from "react";
|
|
11954
11999
|
import { Fragment as Fragment18, jsx as jsx85, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
11955
12000
|
var livePlayer = (bundle, p) => bundle.live === true || !p.live && !p.nflLive ? p : { ...p, live: null, nflLive: null };
|
|
11956
12001
|
var hasLiveLine = (p) => p.live != null || p.nflLive != null;
|
|
@@ -11965,7 +12010,7 @@ function preKickoff(match) {
|
|
|
11965
12010
|
function usePreKickoff(match) {
|
|
11966
12011
|
const [, setTick] = useState54(0);
|
|
11967
12012
|
const pre = preKickoff(match);
|
|
11968
|
-
|
|
12013
|
+
useEffect41(() => {
|
|
11969
12014
|
if (!pre || !match.kickoffUtc) return;
|
|
11970
12015
|
const wait = Math.min(Math.max(Date.parse(match.kickoffUtc) - Date.now(), 0), MAX_TIMER_MS);
|
|
11971
12016
|
const id = setTimeout(() => setTick((t) => t + 1), wait);
|
|
@@ -11979,7 +12024,7 @@ function usePropsOpen(match, monitor, descriptor) {
|
|
|
11979
12024
|
const pre = descriptor.sport === "basketball" ? match.phase === "preMatch" : beforeKickoff;
|
|
11980
12025
|
const live = match.phase === "live";
|
|
11981
12026
|
const open = pre || live;
|
|
11982
|
-
|
|
12027
|
+
useEffect41(() => {
|
|
11983
12028
|
if (!open) return;
|
|
11984
12029
|
if (sport) monitor.loadPlayerProps?.(match.matchId, sport);
|
|
11985
12030
|
else monitor.loadPlayerProps?.(match.matchId);
|
|
@@ -12158,7 +12203,7 @@ function StatsClock({ boxAsOfUtc, match, live, atBreak: atBreak2, ago, ui }) {
|
|
|
12158
12203
|
const at2 = time === "" ? Number.NaN : Date.parse(boxAsOfUtc);
|
|
12159
12204
|
const valid = !Number.isNaN(at2);
|
|
12160
12205
|
const onBreak = atBreak(match);
|
|
12161
|
-
|
|
12206
|
+
useEffect41(() => {
|
|
12162
12207
|
if (!valid || onBreak) return;
|
|
12163
12208
|
const age2 = Date.now() - at2;
|
|
12164
12209
|
const wait = age2 < BOX_QUIET_MS ? BOX_QUIET_MS - age2 : 6e4 - age2 % 6e4;
|
|
@@ -12224,7 +12269,7 @@ function StatsClock2({ bundle, match, ui }) {
|
|
|
12224
12269
|
const time = clock2(bundle.boxAsOfUtc, ui);
|
|
12225
12270
|
const valid = !Number.isNaN(at2) && time !== "";
|
|
12226
12271
|
const onBreak = atBreak(match);
|
|
12227
|
-
|
|
12272
|
+
useEffect42(() => {
|
|
12228
12273
|
if (!valid || onBreak) return;
|
|
12229
12274
|
const age2 = Date.now() - at2;
|
|
12230
12275
|
const wait = age2 < BOX_QUIET_MS2 ? BOX_QUIET_MS2 - age2 : 6e4 - age2 % 6e4;
|
|
@@ -12833,7 +12878,7 @@ function NflMonitorCard({ match, monitor, ui, slip, onAsk }) {
|
|
|
12833
12878
|
}
|
|
12834
12879
|
|
|
12835
12880
|
// src/components/TennisMonitorCard.tsx
|
|
12836
|
-
import { useRef as
|
|
12881
|
+
import { useRef as useRef35 } from "react";
|
|
12837
12882
|
import { toWireSport as toWireSport6 } from "@sensiblestats/widget-sdk";
|
|
12838
12883
|
|
|
12839
12884
|
// src/components/TennisFixtureRow.tsx
|
|
@@ -13096,7 +13141,7 @@ function TennisLiveScoreboard({ t, score, live, ui }) {
|
|
|
13096
13141
|
}
|
|
13097
13142
|
|
|
13098
13143
|
// src/components/TennisStatsTables.tsx
|
|
13099
|
-
import { Fragment as Fragment25, useEffect as
|
|
13144
|
+
import { Fragment as Fragment25, useEffect as useEffect43, useState as useState60 } from "react";
|
|
13100
13145
|
import { Fragment as Fragment26, jsx as jsx96, jsxs as jsxs89 } from "react/jsx-runtime";
|
|
13101
13146
|
function formatStat(row, value, locale) {
|
|
13102
13147
|
if (value == null) return "\u2013";
|
|
@@ -13135,7 +13180,7 @@ function Tables({ table, labels, names, locale }) {
|
|
|
13135
13180
|
}
|
|
13136
13181
|
function TennisStatsTables({ serveReturn, today, labels, names, ui, resetKey }) {
|
|
13137
13182
|
const [tab, setTab] = useState60("match");
|
|
13138
|
-
|
|
13183
|
+
useEffect43(() => {
|
|
13139
13184
|
setTab("match");
|
|
13140
13185
|
}, [resetKey]);
|
|
13141
13186
|
const sets = serveReturn.sets.filter((s) => s.table.serve.length + s.table.return.length > 0);
|
|
@@ -13301,7 +13346,7 @@ function HeadToHead({ t, ui }) {
|
|
|
13301
13346
|
] });
|
|
13302
13347
|
}
|
|
13303
13348
|
function TennisMonitorCard({ match, monitor, ui, slip, onAsk }) {
|
|
13304
|
-
const lastTables =
|
|
13349
|
+
const lastTables = useRef35(null);
|
|
13305
13350
|
const t = match.tennis;
|
|
13306
13351
|
if (!t) return /* @__PURE__ */ jsx97(UnavailableCard, { match, monitor, ui, sport: "tennis" });
|
|
13307
13352
|
const preMatch = match.phase === "preMatch";
|
|
@@ -13381,7 +13426,7 @@ function TennisMonitorCard({ match, monitor, ui, slip, onAsk }) {
|
|
|
13381
13426
|
}
|
|
13382
13427
|
|
|
13383
13428
|
// src/components/ScoreboardStrip.tsx
|
|
13384
|
-
import { useEffect as
|
|
13429
|
+
import { useEffect as useEffect44, useRef as useRef36 } from "react";
|
|
13385
13430
|
import { sportOf as sportOf11 } from "@sensiblestats/widget-sdk";
|
|
13386
13431
|
import { jsx as jsx98, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
13387
13432
|
function nbaStatus(m, ui) {
|
|
@@ -13476,8 +13521,8 @@ function rowsFor(m) {
|
|
|
13476
13521
|
];
|
|
13477
13522
|
}
|
|
13478
13523
|
function useStripScroll(selectedKey) {
|
|
13479
|
-
const stripRef =
|
|
13480
|
-
|
|
13524
|
+
const stripRef = useRef36(null);
|
|
13525
|
+
useEffect44(() => {
|
|
13481
13526
|
const strip = stripRef.current;
|
|
13482
13527
|
const pressed = strip?.querySelector('[aria-pressed="true"]');
|
|
13483
13528
|
if (!strip || !pressed) return;
|
|
@@ -13902,16 +13947,16 @@ import { useId as useId3, useState as useState61 } from "react";
|
|
|
13902
13947
|
import { localIdOf as localIdOf5, qualifiedId as qualifiedId3, slipSportOf as slipSportOf9, toWireSport as toWireSport7 } from "@sensiblestats/widget-sdk";
|
|
13903
13948
|
|
|
13904
13949
|
// src/useModalDialog.ts
|
|
13905
|
-
import { useEffect as
|
|
13950
|
+
import { useEffect as useEffect45, useRef as useRef37 } from "react";
|
|
13906
13951
|
var FOCUSABLE = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
13907
13952
|
function useModalDialog(onClose, opts = {}) {
|
|
13908
|
-
const dialogRef =
|
|
13909
|
-
const onCloseRef =
|
|
13953
|
+
const dialogRef = useRef37(null);
|
|
13954
|
+
const onCloseRef = useRef37(onClose);
|
|
13910
13955
|
onCloseRef.current = onClose;
|
|
13911
|
-
const openerRef =
|
|
13956
|
+
const openerRef = useRef37(opts.opener);
|
|
13912
13957
|
openerRef.current = opts.opener;
|
|
13913
13958
|
const restore = opts.restoreFocus ?? true;
|
|
13914
|
-
|
|
13959
|
+
useEffect45(() => {
|
|
13915
13960
|
const dialog = dialogRef.current;
|
|
13916
13961
|
const root = dialog?.getRootNode();
|
|
13917
13962
|
const focusedAtMount = root?.activeElement ?? null;
|
|
@@ -13922,7 +13967,7 @@ function useModalDialog(onClose, opts = {}) {
|
|
|
13922
13967
|
if (target instanceof HTMLElement) target.focus({ preventScroll: true });
|
|
13923
13968
|
};
|
|
13924
13969
|
}, []);
|
|
13925
|
-
|
|
13970
|
+
useEffect45(() => {
|
|
13926
13971
|
const onKey = (e) => {
|
|
13927
13972
|
if (e.key !== "Escape") return;
|
|
13928
13973
|
e.stopPropagation();
|
|
@@ -14174,20 +14219,20 @@ function LivePanel({ discovery, ui, monitor, sport, offered, onSport, league, on
|
|
|
14174
14219
|
}
|
|
14175
14220
|
|
|
14176
14221
|
// src/components/ScheduleMatchesPanel.tsx
|
|
14177
|
-
import { useEffect as
|
|
14222
|
+
import { useEffect as useEffect48, useId as useId4, useMemo as useMemo14, useRef as useRef41, useState as useState64 } from "react";
|
|
14178
14223
|
import { matchKey as matchKey10 } from "@sensiblestats/widget-sdk";
|
|
14179
14224
|
|
|
14180
14225
|
// src/useTennisRowPrices.ts
|
|
14181
|
-
import { useEffect as
|
|
14226
|
+
import { useEffect as useEffect46, useRef as useRef38, useState as useState63 } from "react";
|
|
14182
14227
|
import { matchKey as matchKey9 } from "@sensiblestats/widget-sdk";
|
|
14183
14228
|
var TENNIS_PRICE_POLL_MS = 6e4;
|
|
14184
14229
|
function useTennisRowPrices(a) {
|
|
14185
14230
|
const [state, setState] = useState63({ byId: null, stale: false });
|
|
14186
|
-
const getPricesRef =
|
|
14231
|
+
const getPricesRef = useRef38(a.getPrices);
|
|
14187
14232
|
getPricesRef.current = a.getPrices;
|
|
14188
|
-
const latest =
|
|
14233
|
+
const latest = useRef38(0);
|
|
14189
14234
|
const idsKey = a.keys.filter((k) => isKnownTour(k.tour)).slice(0, MAX_TENNIS_KEYS).map((k) => `${k.tour}:${k.matchId}`).sort().join(",");
|
|
14190
|
-
|
|
14235
|
+
useEffect46(() => {
|
|
14191
14236
|
if (!a.enabled || idsKey === "") {
|
|
14192
14237
|
latest.current++;
|
|
14193
14238
|
setState((prev) => prev.byId === null && !prev.stale ? prev : { byId: null, stale: false });
|
|
@@ -14225,11 +14270,11 @@ function useTennisRowPrices(a) {
|
|
|
14225
14270
|
}
|
|
14226
14271
|
|
|
14227
14272
|
// src/components/DayStrip.tsx
|
|
14228
|
-
import { useEffect as
|
|
14273
|
+
import { useEffect as useEffect47, useRef as useRef39 } from "react";
|
|
14229
14274
|
import { jsx as jsx107, jsxs as jsxs99 } from "react/jsx-runtime";
|
|
14230
14275
|
function DayStrip({ chips, selected, onSelect, ui, locale }) {
|
|
14231
|
-
const listRef =
|
|
14232
|
-
|
|
14276
|
+
const listRef = useRef39(null);
|
|
14277
|
+
useEffect47(() => {
|
|
14233
14278
|
const el = listRef.current?.querySelector('[aria-pressed="true"]');
|
|
14234
14279
|
if (!el || typeof el.scrollIntoView !== "function") return;
|
|
14235
14280
|
const reduce = typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
@@ -14258,7 +14303,7 @@ function DayStrip({ chips, selected, onSelect, ui, locale }) {
|
|
|
14258
14303
|
}
|
|
14259
14304
|
|
|
14260
14305
|
// src/components/games/ui/SearchField.tsx
|
|
14261
|
-
import { useCallback as useCallback27, useRef as
|
|
14306
|
+
import { useCallback as useCallback27, useRef as useRef40 } from "react";
|
|
14262
14307
|
|
|
14263
14308
|
// src/components/games/ui/icons.tsx
|
|
14264
14309
|
import { jsx as jsx108 } from "react/jsx-runtime";
|
|
@@ -14297,7 +14342,7 @@ var IconFlame = ({ size = 16 }) => svg(size, /* @__PURE__ */ jsx108("path", { d:
|
|
|
14297
14342
|
// src/components/games/ui/SearchField.tsx
|
|
14298
14343
|
import { jsx as jsx109, jsxs as jsxs100 } from "react/jsx-runtime";
|
|
14299
14344
|
function SearchField({ id, label, labelHidden = false, placeholder, value, onChange, disabled, inputRef, onKeyDown, clearLabel }) {
|
|
14300
|
-
const localRef =
|
|
14345
|
+
const localRef = useRef40(null);
|
|
14301
14346
|
const setInputRef = useCallback27((node) => {
|
|
14302
14347
|
localRef.current = node;
|
|
14303
14348
|
if (typeof inputRef === "function") inputRef(node);
|
|
@@ -14348,10 +14393,10 @@ function ScheduleMatchesPanel({ discovery, ui, monitor, sport, offered, onSport,
|
|
|
14348
14393
|
const [query, setQuery] = useState64("");
|
|
14349
14394
|
const [toggled, setToggled] = useState64(/* @__PURE__ */ new Map());
|
|
14350
14395
|
const [expanded, setExpanded] = useState64(/* @__PURE__ */ new Set());
|
|
14351
|
-
const listRef =
|
|
14396
|
+
const listRef = useRef41(null);
|
|
14352
14397
|
const [sheet, setSheet] = useState64(null);
|
|
14353
14398
|
const { chips, selected } = loaded;
|
|
14354
|
-
|
|
14399
|
+
useEffect48(() => {
|
|
14355
14400
|
if (selected !== day) onDay(selected);
|
|
14356
14401
|
}, [day, selected, onDay]);
|
|
14357
14402
|
const isToday = selected === today;
|
|
@@ -14493,7 +14538,7 @@ function ScheduleMatchesPanel({ discovery, ui, monitor, sport, offered, onSport,
|
|
|
14493
14538
|
}
|
|
14494
14539
|
|
|
14495
14540
|
// src/components/GamesPanel.tsx
|
|
14496
|
-
import { useEffect as
|
|
14541
|
+
import { useEffect as useEffect52, useState as useState79 } from "react";
|
|
14497
14542
|
|
|
14498
14543
|
// src/components/GamesLoginWall.tsx
|
|
14499
14544
|
import { jsx as jsx111 } from "react/jsx-runtime";
|
|
@@ -14502,7 +14547,7 @@ function GamesLoginWall({ ui }) {
|
|
|
14502
14547
|
}
|
|
14503
14548
|
|
|
14504
14549
|
// src/components/GamesHub.tsx
|
|
14505
|
-
import { useEffect as
|
|
14550
|
+
import { useEffect as useEffect49, useState as useState65 } from "react";
|
|
14506
14551
|
|
|
14507
14552
|
// src/components/games/ui/gameMeta.ts
|
|
14508
14553
|
function prettifyGameId(gameId) {
|
|
@@ -14654,7 +14699,7 @@ function pickHeroGame(games) {
|
|
|
14654
14699
|
var tileKey = (g) => `${g.gameId}-${g.gameDay}-${g.fixtureId}`;
|
|
14655
14700
|
function GamesHub({ games, myWeeklyRow, weeklyPrize, onOpen, ui }) {
|
|
14656
14701
|
const [, setTick] = useState65(0);
|
|
14657
|
-
|
|
14702
|
+
useEffect49(() => {
|
|
14658
14703
|
const id = setInterval(() => setTick((t) => t + 1), 6e4);
|
|
14659
14704
|
return () => clearInterval(id);
|
|
14660
14705
|
}, []);
|
|
@@ -14714,10 +14759,10 @@ function GamesHub({ games, myWeeklyRow, weeklyPrize, onOpen, ui }) {
|
|
|
14714
14759
|
}
|
|
14715
14760
|
|
|
14716
14761
|
// src/components/GameScreenHost.tsx
|
|
14717
|
-
import { useEffect as
|
|
14762
|
+
import { useEffect as useEffect51, useRef as useRef44, useState as useState77 } from "react";
|
|
14718
14763
|
|
|
14719
14764
|
// src/useGamePlay.ts
|
|
14720
|
-
import { useCallback as useCallback28, useRef as
|
|
14765
|
+
import { useCallback as useCallback28, useRef as useRef42, useState as useState66 } from "react";
|
|
14721
14766
|
function toSubmitResult(payload) {
|
|
14722
14767
|
return {
|
|
14723
14768
|
// 'pending' means the play is recorded but awaiting resolution (fixture games)
|
|
@@ -14732,12 +14777,12 @@ function useGamePlay(conversation, { gameId, gameDay, fixtureId, locale, refresh
|
|
|
14732
14777
|
const [result, setResult] = useState66(null);
|
|
14733
14778
|
const [submitting, setSubmitting] = useState66(false);
|
|
14734
14779
|
const [rawStatus, setRawStatus] = useState66(null);
|
|
14735
|
-
const inFlightRef =
|
|
14736
|
-
const convRef =
|
|
14780
|
+
const inFlightRef = useRef42(false);
|
|
14781
|
+
const convRef = useRef42(conversation);
|
|
14737
14782
|
convRef.current = conversation;
|
|
14738
|
-
const optsRef =
|
|
14783
|
+
const optsRef = useRef42({ gameId, gameDay, fixtureId, locale, refresh });
|
|
14739
14784
|
optsRef.current = { gameId, gameDay, fixtureId, locale, refresh };
|
|
14740
|
-
const resultRef =
|
|
14785
|
+
const resultRef = useRef42(null);
|
|
14741
14786
|
resultRef.current = result;
|
|
14742
14787
|
const refetch = useCallback28(async () => {
|
|
14743
14788
|
const conv = convRef.current;
|
|
@@ -15669,7 +15714,7 @@ function CareerPathGame({
|
|
|
15669
15714
|
}
|
|
15670
15715
|
|
|
15671
15716
|
// src/components/games/BeatTheGridGame.tsx
|
|
15672
|
-
import React, { useEffect as
|
|
15717
|
+
import React, { useEffect as useEffect50, useId as useId7, useRef as useRef43, useState as useState71 } from "react";
|
|
15673
15718
|
|
|
15674
15719
|
// src/components/games/ui/OptionList.tsx
|
|
15675
15720
|
import { jsx as jsx129 } from "react/jsx-runtime";
|
|
@@ -15760,8 +15805,8 @@ function SearchSheet({
|
|
|
15760
15805
|
const s = ui.games.beatTheGrid;
|
|
15761
15806
|
const [query, setQuery] = useState71("");
|
|
15762
15807
|
const inputId = useId7();
|
|
15763
|
-
const inputRef =
|
|
15764
|
-
|
|
15808
|
+
const inputRef = useRef43(null);
|
|
15809
|
+
useEffect50(() => {
|
|
15765
15810
|
inputRef.current?.focus();
|
|
15766
15811
|
}, [row, col]);
|
|
15767
15812
|
const filtered = playerPool.filter(
|
|
@@ -17065,7 +17110,7 @@ function GameScreenHost({
|
|
|
17065
17110
|
}) {
|
|
17066
17111
|
const { gameId, fixtureId, gameDay = "", lockAtUtc = null } = selected;
|
|
17067
17112
|
const [configJson, setConfigJson] = useState77(null);
|
|
17068
|
-
|
|
17113
|
+
useEffect51(() => {
|
|
17069
17114
|
setConfigJson(null);
|
|
17070
17115
|
if (!conversation) return;
|
|
17071
17116
|
let cancelled = false;
|
|
@@ -17088,12 +17133,12 @@ function GameScreenHost({
|
|
|
17088
17133
|
fixtureId: fixtureId || void 0,
|
|
17089
17134
|
locale: ui.hostTag
|
|
17090
17135
|
});
|
|
17091
|
-
|
|
17136
|
+
useEffect51(() => {
|
|
17092
17137
|
if (conversation) hydrate();
|
|
17093
17138
|
}, [conversation, gameId]);
|
|
17094
|
-
const hydrateRef =
|
|
17139
|
+
const hydrateRef = useRef44(hydrate);
|
|
17095
17140
|
hydrateRef.current = hydrate;
|
|
17096
|
-
|
|
17141
|
+
useEffect51(() => {
|
|
17097
17142
|
if (!FIXTURE_GAME_IDS.has(gameId)) return;
|
|
17098
17143
|
if (rawStatus !== "pending") return;
|
|
17099
17144
|
const timerId = setInterval(() => {
|
|
@@ -17400,7 +17445,7 @@ function GamesPanel({
|
|
|
17400
17445
|
}) {
|
|
17401
17446
|
const [selected, setSelected] = useState79(null);
|
|
17402
17447
|
const [segment, setSegment] = useState79("play");
|
|
17403
|
-
|
|
17448
|
+
useEffect52(() => {
|
|
17404
17449
|
ensureGamesFonts();
|
|
17405
17450
|
}, []);
|
|
17406
17451
|
if (!loggedIn) return /* @__PURE__ */ jsx143(GamesLoginWall, { ui });
|
|
@@ -17464,10 +17509,10 @@ function GamesPanel({
|
|
|
17464
17509
|
}
|
|
17465
17510
|
|
|
17466
17511
|
// src/components/FavouritesPanel.tsx
|
|
17467
|
-
import { useEffect as
|
|
17512
|
+
import { useEffect as useEffect55, useRef as useRef46, useState as useState82 } from "react";
|
|
17468
17513
|
|
|
17469
17514
|
// src/components/FavouriteChips.tsx
|
|
17470
|
-
import { useEffect as
|
|
17515
|
+
import { useEffect as useEffect53, useState as useState80 } from "react";
|
|
17471
17516
|
import { Fragment as Fragment44, jsx as jsx144, jsxs as jsxs127 } from "react/jsx-runtime";
|
|
17472
17517
|
async function toggleWithNotice(controller, kind, id, onNotice) {
|
|
17473
17518
|
const outcome = await controller.toggle(kind, id);
|
|
@@ -17515,10 +17560,10 @@ function Group({ title, entities, sport, ui, controller, onNotice }) {
|
|
|
17515
17560
|
function FavouriteChips({ controller, ui, sport, sportLabel: sportLabel2, onNotice }) {
|
|
17516
17561
|
const [confirming, setConfirming] = useState80(false);
|
|
17517
17562
|
const data = controller.data;
|
|
17518
|
-
|
|
17563
|
+
useEffect53(() => {
|
|
17519
17564
|
setConfirming(false);
|
|
17520
17565
|
}, [sport]);
|
|
17521
|
-
|
|
17566
|
+
useEffect53(() => {
|
|
17522
17567
|
if (!confirming) return;
|
|
17523
17568
|
const onPointerDown = (e) => {
|
|
17524
17569
|
if (!(e.target instanceof Element) || !e.target.closest("[data-fav-confirm]")) setConfirming(false);
|
|
@@ -17572,7 +17617,7 @@ function FavouriteChips({ controller, ui, sport, sportLabel: sportLabel2, onNoti
|
|
|
17572
17617
|
}
|
|
17573
17618
|
|
|
17574
17619
|
// src/components/FavouritesSearch.tsx
|
|
17575
|
-
import { useEffect as
|
|
17620
|
+
import { useEffect as useEffect54, useRef as useRef45, useState as useState81 } from "react";
|
|
17576
17621
|
import { jsx as jsx145, jsxs as jsxs128 } from "react/jsx-runtime";
|
|
17577
17622
|
var MIN_LETTERS = 2;
|
|
17578
17623
|
var MAX_LENGTH = 64;
|
|
@@ -17580,13 +17625,13 @@ var DEBOUNCE_MS = 250;
|
|
|
17580
17625
|
function FavouritesSearch({ controller, ui, sport, onNotice }) {
|
|
17581
17626
|
const [query, setQuery] = useState81("");
|
|
17582
17627
|
const [answer, setAnswer] = useState81(null);
|
|
17583
|
-
const controllerRef =
|
|
17628
|
+
const controllerRef = useRef45(controller);
|
|
17584
17629
|
controllerRef.current = controller;
|
|
17585
17630
|
const trimmed = query.trim();
|
|
17586
17631
|
const queryKey = `${sport}|${trimmed}`;
|
|
17587
17632
|
const results2 = answer?.key === queryKey ? answer.rows : [];
|
|
17588
17633
|
const settled = answer?.key === queryKey;
|
|
17589
|
-
|
|
17634
|
+
useEffect54(() => {
|
|
17590
17635
|
setAnswer(null);
|
|
17591
17636
|
if (trimmed.length < MIN_LETTERS) return;
|
|
17592
17637
|
let cancelled = false;
|
|
@@ -17650,12 +17695,12 @@ function FavouritesSearch({ controller, ui, sport, onNotice }) {
|
|
|
17650
17695
|
import { jsx as jsx146, jsxs as jsxs129 } from "react/jsx-runtime";
|
|
17651
17696
|
function FavouritesPanel({ controller, ui, sport, sports, onSportChange }) {
|
|
17652
17697
|
const [notice, setNotice] = useState82(null);
|
|
17653
|
-
const refreshRef =
|
|
17698
|
+
const refreshRef = useRef46(controller.refresh);
|
|
17654
17699
|
refreshRef.current = controller.refresh;
|
|
17655
|
-
|
|
17700
|
+
useEffect55(() => {
|
|
17656
17701
|
void refreshRef.current();
|
|
17657
17702
|
}, []);
|
|
17658
|
-
|
|
17703
|
+
useEffect55(() => {
|
|
17659
17704
|
setNotice(null);
|
|
17660
17705
|
}, [sport]);
|
|
17661
17706
|
const sportLabel2 = sports.find((s) => s.sport === sport)?.label ?? sportLabel(ui, sport);
|
|
@@ -17776,10 +17821,10 @@ function FavouritesSheet({ ui, controller, sport, sports, onSportChange, onClose
|
|
|
17776
17821
|
}
|
|
17777
17822
|
|
|
17778
17823
|
// src/components/BuilderPanel.tsx
|
|
17779
|
-
import { useEffect as
|
|
17824
|
+
import { useEffect as useEffect58 } from "react";
|
|
17780
17825
|
|
|
17781
17826
|
// src/components/dashboard/v8/SentenceBuilder.tsx
|
|
17782
|
-
import { useEffect as
|
|
17827
|
+
import { useEffect as useEffect57, useId as useId13, useRef as useRef48, useState as useState84 } from "react";
|
|
17783
17828
|
import { MAX_SWAPPED_IDS } from "@sensiblestats/widget-sdk";
|
|
17784
17829
|
import { Fragment as Fragment46, jsx as jsx149, jsxs as jsxs131 } from "react/jsx-runtime";
|
|
17785
17830
|
var TOTALS = ["any", "3", "5", "10", "20", "50"];
|
|
@@ -17838,7 +17883,7 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, keepMarket
|
|
|
17838
17883
|
widen: opening.option ? opening.option.matchIds.length === 0 : preset.gamesScope === "all" && preset.matchIds.length === 0
|
|
17839
17884
|
};
|
|
17840
17885
|
const [view, setView] = useState84(() => saved?.view ?? openingView);
|
|
17841
|
-
const autoWidened =
|
|
17886
|
+
const autoWidened = useRef48(false);
|
|
17842
17887
|
const [widenedNote, setWidenedNote] = useState84(saved?.widenedNote ?? false);
|
|
17843
17888
|
const track = useTrack();
|
|
17844
17889
|
const requestFor = (v, extra) => ({
|
|
@@ -17858,15 +17903,15 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, keepMarket
|
|
|
17858
17903
|
const [editing, setEditing] = useState84(false);
|
|
17859
17904
|
const [draft, setDraft] = useState84("");
|
|
17860
17905
|
const [invalid, setInvalid] = useState84(null);
|
|
17861
|
-
const inputRef =
|
|
17862
|
-
const pencilRef =
|
|
17906
|
+
const inputRef = useRef48(null);
|
|
17907
|
+
const pencilRef = useRef48(null);
|
|
17863
17908
|
const noteId = useId13();
|
|
17864
17909
|
const customId = useId13();
|
|
17865
|
-
|
|
17910
|
+
useEffect57(() => {
|
|
17866
17911
|
if (editing) inputRef.current?.focus();
|
|
17867
17912
|
}, [editing]);
|
|
17868
17913
|
const customLabel = (c) => c.format === oddsFormat ? c.text : c.decimal;
|
|
17869
|
-
|
|
17914
|
+
useEffect57(() => {
|
|
17870
17915
|
if (view.legs === 1) {
|
|
17871
17916
|
setEditing(false);
|
|
17872
17917
|
setDraft("");
|
|
@@ -17890,8 +17935,8 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, keepMarket
|
|
|
17890
17935
|
} else if (answeredFor && (shown2?.seen !== grid || shown2.seenReq !== answeredFor)) {
|
|
17891
17936
|
setShown(shownAfter(shown2, grid, answeredFor));
|
|
17892
17937
|
}
|
|
17893
|
-
const lastRequest =
|
|
17894
|
-
|
|
17938
|
+
const lastRequest = useRef48(first);
|
|
17939
|
+
useEffect57(() => {
|
|
17895
17940
|
void request(lastRequest.current);
|
|
17896
17941
|
}, [request]);
|
|
17897
17942
|
const send = (req) => {
|
|
@@ -17938,8 +17983,8 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, keepMarket
|
|
|
17938
17983
|
...[preset.legs, suggested].filter((n) => n !== null && n > 4)
|
|
17939
17984
|
])).sort((a, b) => a - b);
|
|
17940
17985
|
const rows = g && g.status === "ok" ? legsOf(g, sport) : null;
|
|
17941
|
-
const sectionRef =
|
|
17942
|
-
|
|
17986
|
+
const sectionRef = useRef48(null);
|
|
17987
|
+
useEffect57(() => {
|
|
17943
17988
|
if (tapped === null || status2 !== "ready") return;
|
|
17944
17989
|
setTapped(null);
|
|
17945
17990
|
const root = sectionRef.current;
|
|
@@ -17958,12 +18003,12 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, keepMarket
|
|
|
17958
18003
|
useNextKickoffRender(rows ? rows.map((l) => l.kickoffUtc) : []);
|
|
17959
18004
|
const [startedNote, setStartedNote] = useState84(false);
|
|
17960
18005
|
const anyStarted = rows !== null && rows.some((l) => !preMatchOpen(l.kickoffUtc, Date.now()));
|
|
17961
|
-
|
|
18006
|
+
useEffect57(() => {
|
|
17962
18007
|
if (startedNote && status2 === "ready" && !anyStarted) setStartedNote(false);
|
|
17963
18008
|
}, [startedNote, status2, anyStarted]);
|
|
17964
18009
|
const market = rows?.[0]?.market;
|
|
17965
18010
|
const [seen2, setSeen] = useState84(null);
|
|
17966
|
-
|
|
18011
|
+
useEffect57(() => {
|
|
17967
18012
|
if (market) setSeen(market);
|
|
17968
18013
|
}, [market]);
|
|
17969
18014
|
const marketName = view.marketKey === null ? null : marketOptions?.find((m) => m.key === view.marketKey)?.label ?? market ?? seen2;
|
|
@@ -18007,14 +18052,14 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, keepMarket
|
|
|
18007
18052
|
};
|
|
18008
18053
|
};
|
|
18009
18054
|
const canWiden = gamesOptions === null || allGames !== null;
|
|
18010
|
-
|
|
18055
|
+
useEffect57(() => {
|
|
18011
18056
|
if (!empty2 || !singles || widened || !canWiden || autoWidened.current) return;
|
|
18012
18057
|
autoWidened.current = true;
|
|
18013
18058
|
const next = { ...view, widen: true, matchIds: [], gamesId: allGames ? allGames.id : view.gamesId };
|
|
18014
18059
|
commit(next, true);
|
|
18015
18060
|
send(requestFor(next));
|
|
18016
18061
|
}, [empty2, singles, widened, canWiden, view]);
|
|
18017
|
-
|
|
18062
|
+
useEffect57(() => {
|
|
18018
18063
|
if (coolOff) onCoolOff?.(sport);
|
|
18019
18064
|
}, [coolOff, onCoolOff, sport]);
|
|
18020
18065
|
if (coolOff) return null;
|
|
@@ -18214,7 +18259,7 @@ function BuilderPanel({ options, sport, onSportChange, ui, slip, onCoolOff, onHa
|
|
|
18214
18259
|
const scope = useSportScope();
|
|
18215
18260
|
const active = options.find((o) => o.sport === sport) ?? options[0];
|
|
18216
18261
|
const handingOff = active?.keepMarket === true;
|
|
18217
|
-
|
|
18262
|
+
useEffect58(() => {
|
|
18218
18263
|
if (handingOff) onHandOffMounted?.();
|
|
18219
18264
|
}, [handingOff]);
|
|
18220
18265
|
if (!active) return null;
|
|
@@ -18780,7 +18825,7 @@ import { Fragment as Fragment49, jsx as jsx160, jsxs as jsxs140 } from "react/js
|
|
|
18780
18825
|
var FULLSCREEN_QUERY = "(max-width: 639px)";
|
|
18781
18826
|
function useIsModal() {
|
|
18782
18827
|
const [modal, setModal] = useState87(false);
|
|
18783
|
-
|
|
18828
|
+
useEffect59(() => {
|
|
18784
18829
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
|
|
18785
18830
|
const mql = window.matchMedia(FULLSCREEN_QUERY);
|
|
18786
18831
|
const sync = () => setModal(mql.matches);
|
|
@@ -18798,8 +18843,8 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
18798
18843
|
const [selectedPlayerId, setSelectedPlayerId] = useState87(null);
|
|
18799
18844
|
const clearPlayerDetail = clubPlayerDetailResult?.clear;
|
|
18800
18845
|
const fetchPlayerDetail = clubPlayerDetailResult?.fetch;
|
|
18801
|
-
const squadLayerRef =
|
|
18802
|
-
const squadScrollRef =
|
|
18846
|
+
const squadLayerRef = useRef49(null);
|
|
18847
|
+
const squadScrollRef = useRef49(null);
|
|
18803
18848
|
const selectPlayer = (playerId) => {
|
|
18804
18849
|
squadScrollRef.current = squadLayerRef.current?.querySelector(".ss-w-mon-list")?.scrollTop ?? null;
|
|
18805
18850
|
setSelectedPlayerId(playerId);
|
|
@@ -18822,7 +18867,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
18822
18867
|
const hasBuilder = !clubBrand && (builderOptions?.length ?? 0) > 0;
|
|
18823
18868
|
const tabs = monitor ?? (hasBuilder ? tabState : void 0);
|
|
18824
18869
|
const activeTab = tabs?.activeTab;
|
|
18825
|
-
|
|
18870
|
+
useEffect59(() => {
|
|
18826
18871
|
if (activeTab === "squad" || selectedPlayerId === null) return;
|
|
18827
18872
|
setSelectedPlayerId(null);
|
|
18828
18873
|
clearPlayerDetail?.();
|
|
@@ -18831,11 +18876,11 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
18831
18876
|
const favouritesOpen = favouritesOffered && (favourites?.open ?? false);
|
|
18832
18877
|
const favouritesAskedOpen = favourites?.open ?? false;
|
|
18833
18878
|
const setFavouritesOpen = favourites?.onOpenChange;
|
|
18834
|
-
|
|
18879
|
+
useEffect59(() => {
|
|
18835
18880
|
if (favouritesAskedOpen && !favouritesOffered) setFavouritesOpen?.(false);
|
|
18836
18881
|
}, [favouritesAskedOpen, favouritesOffered, setFavouritesOpen]);
|
|
18837
18882
|
const storedTab = tabState?.activeTab;
|
|
18838
|
-
|
|
18883
|
+
useEffect59(() => {
|
|
18839
18884
|
const unreachable = storedTab === "builder" ? !hasBuilder : !monitor && storedTab !== void 0 && storedTab !== "chat";
|
|
18840
18885
|
if (unreachable) setMonitorTab?.("chat");
|
|
18841
18886
|
}, [storedTab, hasBuilder, monitor, setMonitorTab]);
|
|
@@ -18849,7 +18894,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
18849
18894
|
if (onCloseRequested) onCloseRequested();
|
|
18850
18895
|
else close();
|
|
18851
18896
|
}, [track, closeTab, answering, close, onCloseRequested]);
|
|
18852
|
-
|
|
18897
|
+
useEffect59(() => {
|
|
18853
18898
|
const onKey = (e) => {
|
|
18854
18899
|
if (e.key === "Escape") closeWith("escape");
|
|
18855
18900
|
};
|
|
@@ -18865,16 +18910,16 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
18865
18910
|
tabs?.setActiveTab("chat");
|
|
18866
18911
|
send(text2, { grounding, source });
|
|
18867
18912
|
};
|
|
18868
|
-
|
|
18913
|
+
useEffect59(() => {
|
|
18869
18914
|
if (monitor && monitor.activeTab !== "chat" && state.isStreaming) monitor.markChatActivity();
|
|
18870
18915
|
}, [monitor, state.isStreaming, state.messages.length]);
|
|
18871
18916
|
const onChatTab = !tabs || tabs.activeTab === "chat";
|
|
18872
|
-
const inputRef =
|
|
18873
|
-
const limitRef =
|
|
18874
|
-
const typedSendRef =
|
|
18875
|
-
const focusAfterCloseRef =
|
|
18917
|
+
const inputRef = useRef49(null);
|
|
18918
|
+
const limitRef = useRef49(null);
|
|
18919
|
+
const typedSendRef = useRef49(false);
|
|
18920
|
+
const focusAfterCloseRef = useRef49(null);
|
|
18876
18921
|
const [tool, setTool] = useState87(null);
|
|
18877
|
-
const panelRef =
|
|
18922
|
+
const panelRef = useRef49(null);
|
|
18878
18923
|
const settings = useOddsSettings();
|
|
18879
18924
|
const [settingsOpen, setSettingsOpen] = useState87(false);
|
|
18880
18925
|
const hasSettings = settings.oddsOffered || !settings.themeLocked;
|
|
@@ -18892,16 +18937,16 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
18892
18937
|
setFavouritesOpen?.(false);
|
|
18893
18938
|
panelRef.current?.querySelector(".ss-w-kebab")?.focus();
|
|
18894
18939
|
}, [setFavouritesOpen]);
|
|
18895
|
-
|
|
18940
|
+
useEffect59(() => {
|
|
18896
18941
|
if (!favouritesOpen) return;
|
|
18897
18942
|
setTool(null);
|
|
18898
18943
|
setSettingsOpen(false);
|
|
18899
18944
|
}, [favouritesOpen]);
|
|
18900
18945
|
const paused = isPaused(state.limit);
|
|
18901
|
-
|
|
18946
|
+
useEffect59(() => {
|
|
18902
18947
|
if (paused) setTool(null);
|
|
18903
18948
|
}, [paused]);
|
|
18904
|
-
|
|
18949
|
+
useEffect59(() => {
|
|
18905
18950
|
if (!paused) return;
|
|
18906
18951
|
if (typedSendRef.current) limitRef.current?.focus();
|
|
18907
18952
|
typedSendRef.current = false;
|
|
@@ -18927,18 +18972,18 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
18927
18972
|
const k = ui.bettingKickoff(kickoffUtc);
|
|
18928
18973
|
return `${k.dayLabel} ${k.time}`;
|
|
18929
18974
|
}, [ui]);
|
|
18930
|
-
|
|
18975
|
+
useEffect59(() => {
|
|
18931
18976
|
if (tool) return;
|
|
18932
18977
|
const target = focusAfterCloseRef.current;
|
|
18933
18978
|
focusAfterCloseRef.current = null;
|
|
18934
18979
|
if (target === "composer") inputRef.current?.focus();
|
|
18935
18980
|
}, [tool]);
|
|
18936
|
-
|
|
18981
|
+
useEffect59(() => {
|
|
18937
18982
|
if (!tool || onChatTab && presetGrid) return;
|
|
18938
18983
|
focusAfterCloseRef.current = "composer";
|
|
18939
18984
|
setTool(null);
|
|
18940
18985
|
}, [tool, onChatTab, presetGrid]);
|
|
18941
|
-
const backRef =
|
|
18986
|
+
const backRef = useRef49(() => false);
|
|
18942
18987
|
backRef.current = () => {
|
|
18943
18988
|
if (favouritesOpen) {
|
|
18944
18989
|
closeFavourites();
|
|
@@ -18962,7 +19007,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
18962
19007
|
}
|
|
18963
19008
|
return false;
|
|
18964
19009
|
};
|
|
18965
|
-
|
|
19010
|
+
useEffect59(() => {
|
|
18966
19011
|
if (!onRegisterBack) return;
|
|
18967
19012
|
onRegisterBack(() => backRef.current());
|
|
18968
19013
|
return () => onRegisterBack(null);
|
|
@@ -22033,9 +22078,9 @@ function StatsWidget(props) {
|
|
|
22033
22078
|
const injectedClient = "client" in props ? props.client : void 0;
|
|
22034
22079
|
const cfg = props.config;
|
|
22035
22080
|
const built = useMemo16(() => buildClient(props), [injectedClient, cfg?.operatorId, cfg?.publicKey, cfg?.baseUrl]);
|
|
22036
|
-
const trackingRef =
|
|
22081
|
+
const trackingRef = useRef50({ envelope: { operatorId: "", widgetVersion: WIDGET_REACT_VERSION } });
|
|
22037
22082
|
const track = useMemo16(() => createTracker(() => trackingRef.current), []);
|
|
22038
|
-
const eventTextRef =
|
|
22083
|
+
const eventTextRef = useRef50(false);
|
|
22039
22084
|
eventTextRef.current = cfg?.eventText === true;
|
|
22040
22085
|
const logger = useMemo16(() => {
|
|
22041
22086
|
if (!built) return null;
|
|
@@ -22052,8 +22097,8 @@ function StatsWidget(props) {
|
|
|
22052
22097
|
[props.config, widgetStrings.strings]
|
|
22053
22098
|
);
|
|
22054
22099
|
const oddsSettings = useOddsSettingsState(ui, built?.conversation, cfg?.operatorId || "default");
|
|
22055
|
-
const rootRef =
|
|
22056
|
-
const introDoneRef =
|
|
22100
|
+
const rootRef = useRef50(null);
|
|
22101
|
+
const introDoneRef = useRef50(false);
|
|
22057
22102
|
const markIntroDone = useCallback30(() => {
|
|
22058
22103
|
introDoneRef.current = true;
|
|
22059
22104
|
}, []);
|
|
@@ -22135,8 +22180,8 @@ function StatsWidget(props) {
|
|
|
22135
22180
|
enabled: panelOpen && monitor.activeTab === "matches",
|
|
22136
22181
|
timeZone: ui.timeZone
|
|
22137
22182
|
});
|
|
22138
|
-
const prevLiveSnapshotRef =
|
|
22139
|
-
|
|
22183
|
+
const prevLiveSnapshotRef = useRef50(monitor.snapshot);
|
|
22184
|
+
useEffect60(() => {
|
|
22140
22185
|
const snap = monitor.snapshot;
|
|
22141
22186
|
if (!snap || snap === prevLiveSnapshotRef.current) return;
|
|
22142
22187
|
prevLiveSnapshotRef.current = snap;
|
|
@@ -22248,8 +22293,8 @@ function StatsWidget(props) {
|
|
|
22248
22293
|
);
|
|
22249
22294
|
const presetGrid = usePresetGrid({ getPricePresets, isOpen: panelOpen, locale: ui.hostTag });
|
|
22250
22295
|
const markLiveActivity = monitor.markLiveActivity;
|
|
22251
|
-
const prevLiveCountRef =
|
|
22252
|
-
|
|
22296
|
+
const prevLiveCountRef = useRef50(0);
|
|
22297
|
+
useEffect60(() => {
|
|
22253
22298
|
const rose = prevLiveCountRef.current === 0 && discovery.liveCount > 0;
|
|
22254
22299
|
prevLiveCountRef.current = discovery.liveCount;
|
|
22255
22300
|
if (rose) markLiveActivity();
|
|
@@ -22297,17 +22342,28 @@ function StatsWidget(props) {
|
|
|
22297
22342
|
log: logger
|
|
22298
22343
|
})
|
|
22299
22344
|
}));
|
|
22300
|
-
const dismissPopupRef =
|
|
22345
|
+
const dismissPopupRef = useRef50(() => {
|
|
22301
22346
|
});
|
|
22302
|
-
const onCtaRef =
|
|
22347
|
+
const onCtaRef = useRef50(() => {
|
|
22303
22348
|
});
|
|
22349
|
+
const onTeaserTapRef = useRef50(() => {
|
|
22350
|
+
});
|
|
22351
|
+
const bubble = controller.state.greetingBubble;
|
|
22352
|
+
const bubblePrice = !stringsPending && controller.state.popupText && bubble?.price && bubble.matchId ? { matchId: bubble.matchId, price: bubble.price, sport: bubble.sport } : null;
|
|
22304
22353
|
const bubbleCta = controller.state.popupText ? controller.state.greetingBubble?.cta ?? null : null;
|
|
22305
22354
|
const mobile = useMobileBinding({
|
|
22306
22355
|
binding: props.mobile,
|
|
22307
22356
|
panelOpen,
|
|
22308
22357
|
popupText: controller.state.popupText,
|
|
22309
22358
|
cta: bubbleCta,
|
|
22359
|
+
price: bubblePrice ? {
|
|
22360
|
+
matchOddsId: bubblePrice.price.selection.matchOddsId,
|
|
22361
|
+
marketLabel: bubblePrice.price.marketLabel,
|
|
22362
|
+
label: bubblePrice.price.selection.label,
|
|
22363
|
+
odds: formatOdds(bubblePrice.price.selection.formats, oddsSettings.oddsFormat)
|
|
22364
|
+
} : null,
|
|
22310
22365
|
onCta: () => onCtaRef.current(),
|
|
22366
|
+
onTeaserTap: () => onTeaserTapRef.current(),
|
|
22311
22367
|
asks,
|
|
22312
22368
|
open: controller.open,
|
|
22313
22369
|
close: controller.close,
|
|
@@ -22316,10 +22372,10 @@ function StatsWidget(props) {
|
|
|
22316
22372
|
const dismissPopup = usePopupTelemetry(logger, panelOpen, controller.state.popupText, controller.dismissPopup, mobile.confirmedShown);
|
|
22317
22373
|
dismissPopupRef.current = dismissPopup;
|
|
22318
22374
|
const greetingMeta = latestGreetingMeta(controller.state.messages);
|
|
22319
|
-
useBubbleGreetingShown(logger, logger ?? NO_OWNER, controller.state.popupText,
|
|
22375
|
+
useBubbleGreetingShown(logger, logger ?? NO_OWNER, controller.state.popupText, greetingMeta, mobile.confirmedShown);
|
|
22320
22376
|
const [highlight, setHighlight] = useState88(null);
|
|
22321
22377
|
const clearHighlight = useCallback30(() => setHighlight(null), []);
|
|
22322
|
-
|
|
22378
|
+
useEffect60(() => {
|
|
22323
22379
|
if (!panelOpen) setHighlight(null);
|
|
22324
22380
|
}, [panelOpen]);
|
|
22325
22381
|
const highlightRequest = useMemo16(() => highlight ? { ...highlight, clear: clearHighlight } : null, [highlight, clearHighlight]);
|
|
@@ -22336,12 +22392,18 @@ function StatsWidget(props) {
|
|
|
22336
22392
|
const matchId = greetingBubble?.matchId;
|
|
22337
22393
|
if (matchId) setHighlight((prev) => ({ matchId, token: (prev?.token ?? 0) + 1 }));
|
|
22338
22394
|
};
|
|
22395
|
+
onTeaserTapRef.current = () => {
|
|
22396
|
+
if (!controller.state.popupText) return;
|
|
22397
|
+
track({ name: "bubble_click" });
|
|
22398
|
+
if (!bubbleCta) logCtaClick();
|
|
22399
|
+
openFromCta();
|
|
22400
|
+
};
|
|
22339
22401
|
const onCta = useCallback30(() => onCtaRef.current(), []);
|
|
22340
22402
|
useOpenTelemetry(logger, panelOpen);
|
|
22341
|
-
const onControlRef =
|
|
22403
|
+
const onControlRef = useRef50(props.onControl);
|
|
22342
22404
|
onControlRef.current = props.onControl;
|
|
22343
22405
|
const { open: openPanel, close: closePanel } = controller;
|
|
22344
|
-
|
|
22406
|
+
useEffect60(() => {
|
|
22345
22407
|
onControlRef.current?.({ open: openPanel, close: closePanel });
|
|
22346
22408
|
return () => onControlRef.current?.(null);
|
|
22347
22409
|
}, [openPanel, closePanel]);
|
|
@@ -22358,11 +22420,11 @@ function StatsWidget(props) {
|
|
|
22358
22420
|
page: cfg?.page
|
|
22359
22421
|
}
|
|
22360
22422
|
};
|
|
22361
|
-
|
|
22423
|
+
useEffect60(() => {
|
|
22362
22424
|
if (!logger) return;
|
|
22363
22425
|
logger.setIdentity({ operatorUserId, anonymousUserId, conversationId });
|
|
22364
22426
|
}, [logger, operatorUserId, anonymousUserId, conversationId]);
|
|
22365
|
-
|
|
22427
|
+
useEffect60(() => {
|
|
22366
22428
|
if (!logger) return;
|
|
22367
22429
|
logger.resume();
|
|
22368
22430
|
const onHide = () => {
|
|
@@ -22380,7 +22442,7 @@ function StatsWidget(props) {
|
|
|
22380
22442
|
logger.dispose();
|
|
22381
22443
|
};
|
|
22382
22444
|
}, [logger]);
|
|
22383
|
-
|
|
22445
|
+
useEffect60(() => {
|
|
22384
22446
|
if (!built || !ui.injectStyles || widgetStrings.state === "unavailable") return;
|
|
22385
22447
|
const node = rootRef.current?.getRootNode();
|
|
22386
22448
|
if (node) injectStyles(node);
|
|
@@ -22438,7 +22500,21 @@ function StatsWidget(props) {
|
|
|
22438
22500
|
onCloseRequested: mobile.onCloseRequested,
|
|
22439
22501
|
onRegisterBack: mobile.onRegisterBack
|
|
22440
22502
|
}
|
|
22441
|
-
) }) }) : props.mobile ?
|
|
22503
|
+
) }) }) : props.mobile ? bubblePrice && mobile.onRegisterPrice && mobile.onPriceResult && mobile.priceInFlight ? /* @__PURE__ */ jsx162(
|
|
22504
|
+
MobileBubblePrice,
|
|
22505
|
+
{
|
|
22506
|
+
matchId: bubblePrice.matchId,
|
|
22507
|
+
price: bubblePrice.price,
|
|
22508
|
+
conversation: built?.conversation ?? null,
|
|
22509
|
+
slip,
|
|
22510
|
+
ui,
|
|
22511
|
+
hook: hookOf(greetingMeta),
|
|
22512
|
+
sport: bubblePrice.sport,
|
|
22513
|
+
inFlight: mobile.priceInFlight,
|
|
22514
|
+
onRegister: mobile.onRegisterPrice,
|
|
22515
|
+
onResult: mobile.onPriceResult
|
|
22516
|
+
}
|
|
22517
|
+
) : null : /* @__PURE__ */ jsx162(
|
|
22442
22518
|
ChatFab,
|
|
22443
22519
|
{
|
|
22444
22520
|
label: stringsPending ? cfg?.launcherLabel : ui.launcherLabel,
|
|
@@ -22455,16 +22531,16 @@ function StatsWidget(props) {
|
|
|
22455
22531
|
cta: bubbleCta ?? void 0,
|
|
22456
22532
|
onCta,
|
|
22457
22533
|
onBubbleClick: logCtaClick,
|
|
22458
|
-
price:
|
|
22534
|
+
price: bubblePrice ? /* @__PURE__ */ jsx162(
|
|
22459
22535
|
BubblePrice,
|
|
22460
22536
|
{
|
|
22461
|
-
matchId:
|
|
22462
|
-
price:
|
|
22537
|
+
matchId: bubblePrice.matchId,
|
|
22538
|
+
price: bubblePrice.price,
|
|
22463
22539
|
conversation: built?.conversation ?? null,
|
|
22464
22540
|
slip,
|
|
22465
22541
|
ui,
|
|
22466
22542
|
hook: hookOf(greetingMeta),
|
|
22467
|
-
sport:
|
|
22543
|
+
sport: bubblePrice.sport
|
|
22468
22544
|
}
|
|
22469
22545
|
) : void 0
|
|
22470
22546
|
}
|