@sensiblestats/widget-react 0.129.0 → 0.130.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 +19 -0
- package/dist/index.cjs +114 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +114 -36
- package/dist/index.js.map +1 -1
- package/dist/styles.css +4 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @sensiblestats/widget-react
|
|
2
2
|
|
|
3
|
+
## 0.130.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- NBA and NFL prop insight cards now put the player and the stat in the add-to-slip `display`, so a host can tell two players' "Over 24.5" picks apart. NBA "Add both" legs name each leg's own player and stat instead of the card title. The `SlipDisplay.selection` doc now says that an insight card's label can carry the team name and the line.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @sensiblestats/widget-sdk@0.93.1
|
|
10
|
+
|
|
11
|
+
## 0.130.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- Smart Acca cools off per sport: a builder 404 for one sport no longer hides the tab for the others. Every add-to-slip selection now carries `display` (match names, kickoff, raw market, selection and line, the player on a prop, and the market as the widget showed it), so a host can label a pick it cannot look up; display never rides tracking or event-log payloads. Acca legs wrap long player and team names instead of cutting them, and the added-to-slip toast sits on its own row.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
- @sensiblestats/widget-sdk@0.93.0
|
|
21
|
+
|
|
3
22
|
## 0.129.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -1295,6 +1295,21 @@ function buildLocaleStrings(table, tag2, clock3 = "24h", timeZone) {
|
|
|
1295
1295
|
}
|
|
1296
1296
|
|
|
1297
1297
|
// src/odds.ts
|
|
1298
|
+
var DISPLAY_KEYS = ["home", "away", "kickoffUtc", "market", "marketLabel", "selection", "line", "player"];
|
|
1299
|
+
var DISPLAY_MAX = 80;
|
|
1300
|
+
function slipDisplay(parts2) {
|
|
1301
|
+
const out = {};
|
|
1302
|
+
for (const k of DISPLAY_KEYS) {
|
|
1303
|
+
const v = typeof parts2[k] === "string" ? parts2[k].trim() : "";
|
|
1304
|
+
if (!v || k === "kickoffUtc" && !Number.isFinite(Date.parse(v))) continue;
|
|
1305
|
+
out[k] = v.slice(0, DISPLAY_MAX);
|
|
1306
|
+
}
|
|
1307
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
1308
|
+
}
|
|
1309
|
+
function withMatch(selection, match) {
|
|
1310
|
+
const display = slipDisplay({ home: match.home, away: match.away, kickoffUtc: match.kickoffUtc, marketLabel: match.marketLabel, player: match.player });
|
|
1311
|
+
return display ? { ...selection, display } : selection;
|
|
1312
|
+
}
|
|
1298
1313
|
function formatOdds(forms, format2) {
|
|
1299
1314
|
return (format2 === "american" ? forms.american : format2 === "fractional" ? forms.fractional : forms.decimal) ?? forms.decimal;
|
|
1300
1315
|
}
|
|
@@ -1308,7 +1323,7 @@ function parseOddsFormat(value) {
|
|
|
1308
1323
|
}
|
|
1309
1324
|
|
|
1310
1325
|
// src/version.generated.ts
|
|
1311
|
-
var WIDGET_REACT_VERSION = "0.
|
|
1326
|
+
var WIDGET_REACT_VERSION = "0.130.1";
|
|
1312
1327
|
|
|
1313
1328
|
// src/config.ts
|
|
1314
1329
|
function hostTag(cfg) {
|
|
@@ -1986,7 +2001,7 @@ function toSlipSelection(vm, conversationId) {
|
|
|
1986
2001
|
if (vm.quotedAtUtc !== void 0) selection.quotedAtUtc = vm.quotedAtUtc;
|
|
1987
2002
|
if (vm.id !== void 0) selection.insightId = vm.id;
|
|
1988
2003
|
if (conversationId !== void 0) selection.conversationId = conversationId;
|
|
1989
|
-
return selection;
|
|
2004
|
+
return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc, marketLabel: vm.market });
|
|
1990
2005
|
}
|
|
1991
2006
|
function toMarketOddsVM(card) {
|
|
1992
2007
|
const rows = Array.isArray(card.rows) ? card.rows : [];
|
|
@@ -2103,7 +2118,7 @@ function marketOddsRowToSlipSelection(vm, row, conversationId) {
|
|
|
2103
2118
|
const slipSport = (0, import_widget_sdk.slipSportOf)(vm.sport);
|
|
2104
2119
|
if (slipSport) selection.sport = slipSport;
|
|
2105
2120
|
if (conversationId !== void 0) selection.conversationId = conversationId;
|
|
2106
|
-
return selection;
|
|
2121
|
+
return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc, marketLabel: vm.market });
|
|
2107
2122
|
}
|
|
2108
2123
|
function finite(v) {
|
|
2109
2124
|
return typeof v === "number" && Number.isFinite(v) ? v : void 0;
|
|
@@ -2177,7 +2192,7 @@ function comboLegToSlipSelection(leg, conversationId) {
|
|
|
2177
2192
|
if (leg.quotedAtUtc !== void 0) selection.quotedAtUtc = leg.quotedAtUtc;
|
|
2178
2193
|
if (leg.sport !== void 0) selection.sport = leg.sport;
|
|
2179
2194
|
if (conversationId !== void 0) selection.conversationId = conversationId;
|
|
2180
|
-
return selection;
|
|
2195
|
+
return withMatch(selection, { home: leg.homeTeamName, away: leg.awayTeamName, kickoffUtc: leg.kickoffUtc, marketLabel: leg.market, player: leg.player });
|
|
2181
2196
|
}
|
|
2182
2197
|
var isNum = (v) => typeof v === "number" && Number.isFinite(v);
|
|
2183
2198
|
var isObj = (v) => typeof v === "object" && v !== null;
|
|
@@ -2310,7 +2325,37 @@ function toNbaSlipSelection(vm, key, conversationId) {
|
|
|
2310
2325
|
sport: "basketball"
|
|
2311
2326
|
};
|
|
2312
2327
|
if (conversationId !== void 0) selection.conversationId = conversationId;
|
|
2313
|
-
return selection;
|
|
2328
|
+
return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc, ...nbaPropOf(vm.evidence, key) });
|
|
2329
|
+
}
|
|
2330
|
+
function nbaPropOf(evidence, key) {
|
|
2331
|
+
switch (evidence.kind) {
|
|
2332
|
+
case "prop_reason":
|
|
2333
|
+
return { player: evidence.propReason.playerName, marketLabel: evidence.propReason.statLabel };
|
|
2334
|
+
case "vs_opponent":
|
|
2335
|
+
return { player: evidence.vsOpponent.playerName, marketLabel: evidence.vsOpponent.statLabel };
|
|
2336
|
+
case "teammate_out": {
|
|
2337
|
+
const row = evidence.teammateOut.rows.find((r) => r.selectionKey === key);
|
|
2338
|
+
return row ? { player: row.playerName, marketLabel: row.statLabel } : null;
|
|
2339
|
+
}
|
|
2340
|
+
case "co_hit": {
|
|
2341
|
+
const leg = evidence.coHit.legs.find((l) => l.selectionKey === key);
|
|
2342
|
+
return leg ? { player: leg.playerName, marketLabel: leg.statLabel } : null;
|
|
2343
|
+
}
|
|
2344
|
+
case "ladder": {
|
|
2345
|
+
const stat = evidence.ladder.stats.find((st) => st.rungs.some((r) => r.selectionKey === key));
|
|
2346
|
+
return stat ? { player: evidence.ladder.playerName, marketLabel: stat.statLabel } : null;
|
|
2347
|
+
}
|
|
2348
|
+
case "quarter_ladder": {
|
|
2349
|
+
const stat = evidence.quarterLadder.stats.find((st) => st.rungs.some((r) => r.selectionKey === key));
|
|
2350
|
+
return stat ? { player: evidence.quarterLadder.playerName, marketLabel: stat.statLabel } : null;
|
|
2351
|
+
}
|
|
2352
|
+
case "matchup": {
|
|
2353
|
+
const pos = evidence.matchup.position;
|
|
2354
|
+
return pos?.playerName && (pos.overSelectionKey === key || pos.underSelectionKey === key) ? { player: pos.playerName, marketLabel: pos.statLabel } : null;
|
|
2355
|
+
}
|
|
2356
|
+
default:
|
|
2357
|
+
return null;
|
|
2358
|
+
}
|
|
2314
2359
|
}
|
|
2315
2360
|
function nbaCoHitLegs(vm, conversationId) {
|
|
2316
2361
|
if (vm.evidence.kind !== "co_hit") return [];
|
|
@@ -2323,7 +2368,9 @@ function nbaCoHitLegs(vm, conversationId) {
|
|
|
2323
2368
|
matchId: vm.matchId,
|
|
2324
2369
|
homeTeamName: vm.homeTeamName ?? "",
|
|
2325
2370
|
awayTeamName: vm.awayTeamName ?? "",
|
|
2326
|
-
|
|
2371
|
+
kickoffUtc: vm.kickoffUtc ?? void 0,
|
|
2372
|
+
market: leg.statLabel,
|
|
2373
|
+
player: leg.playerName,
|
|
2327
2374
|
marketDeveloperName: s.marketDeveloperName,
|
|
2328
2375
|
selection: s.selectionLabel,
|
|
2329
2376
|
selectionLabel: s.selectionLabel,
|
|
@@ -2429,7 +2476,17 @@ function toNflSlipSelection(vm, key, nowMs, conversationId) {
|
|
|
2429
2476
|
sport: "americanfootball"
|
|
2430
2477
|
};
|
|
2431
2478
|
if (conversationId !== void 0) selection.conversationId = conversationId;
|
|
2432
|
-
return selection;
|
|
2479
|
+
return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc, ...nflPropOf(vm.evidence) });
|
|
2480
|
+
}
|
|
2481
|
+
function nflPropOf(evidence) {
|
|
2482
|
+
switch (evidence.kind) {
|
|
2483
|
+
case "prop_reason":
|
|
2484
|
+
return { player: evidence.propReason.playerName, marketLabel: evidence.propReason.propLabel };
|
|
2485
|
+
case "ladder":
|
|
2486
|
+
return { player: evidence.ladder.playerName, marketLabel: evidence.ladder.propLabel };
|
|
2487
|
+
default:
|
|
2488
|
+
return null;
|
|
2489
|
+
}
|
|
2433
2490
|
}
|
|
2434
2491
|
|
|
2435
2492
|
// src/slipKey.ts
|
|
@@ -2488,11 +2545,11 @@ function slipPickFields(selection, label, line) {
|
|
|
2488
2545
|
if (Number.isFinite(odds) && odds > 1 && odds <= MAX_ODDS) fields.odds = odds;
|
|
2489
2546
|
return fields;
|
|
2490
2547
|
}
|
|
2491
|
-
function chipSelection(market,
|
|
2548
|
+
function chipSelection(market, match, conversationId) {
|
|
2492
2549
|
if (!market || !market.addToSlipEnabled || typeof market.matchOddsId !== "number" || typeof market.price !== "number" || !market.priceFormats) return null;
|
|
2493
|
-
const selection = { matchOddsId: market.matchOddsId, matchId, oddsDecimal: market.price, forms: market.priceFormats };
|
|
2550
|
+
const selection = { matchOddsId: market.matchOddsId, matchId: match.matchId, oddsDecimal: market.price, forms: market.priceFormats };
|
|
2494
2551
|
if (conversationId !== void 0) selection.conversationId = conversationId;
|
|
2495
|
-
return selection;
|
|
2552
|
+
return withMatch(selection, { home: match.homeTeamName, away: match.awayTeamName, kickoffUtc: match.kickoffUtc, marketLabel: market.marketLabel });
|
|
2496
2553
|
}
|
|
2497
2554
|
function chipPriceText(market, format2) {
|
|
2498
2555
|
return typeof market.price === "number" && market.priceFormats ? formatOdds(market.priceFormats, format2) : void 0;
|
|
@@ -5985,7 +6042,8 @@ function useSlipAdd(slip, ui) {
|
|
|
5985
6042
|
const operatorFormat = ui?.oddsFormat ?? "decimal";
|
|
5986
6043
|
return (0, import_react25.useCallback)(async (selection, { marketDeveloperName, selectionLabel, line }) => {
|
|
5987
6044
|
if (!handler) return { kind: "failed" };
|
|
5988
|
-
const
|
|
6045
|
+
const display = slipDisplay({ ...selection.display, market: marketDeveloperName, selection: selectionLabel, line });
|
|
6046
|
+
const out = toHostSelection(display ? { ...selection, display } : selection, operatorFormat);
|
|
5989
6047
|
const pick = slipPickFields(out, rawLabels ? selectionLabel : void 0, line);
|
|
5990
6048
|
const wireSport = (0, import_widget_sdk16.toWireSport)(out.sport);
|
|
5991
6049
|
const sportField = {
|
|
@@ -10558,7 +10616,7 @@ function MarketAccordion({ match, monitor, ui, slip }) {
|
|
|
10558
10616
|
// src/components/LiveFactBlock.tsx
|
|
10559
10617
|
var import_react61 = require("react");
|
|
10560
10618
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
10561
|
-
function LiveFactBlock({ facts,
|
|
10619
|
+
function LiveFactBlock({ facts, match, ui, slip, onAsk }) {
|
|
10562
10620
|
const [expanded, setExpanded] = (0, import_react61.useState)(false);
|
|
10563
10621
|
const { oddsFormat } = useOddsSettings();
|
|
10564
10622
|
const [current, ...earlier] = facts;
|
|
@@ -10587,7 +10645,7 @@ function LiveFactBlock({ facts, matchId, ui, slip, onAsk }) {
|
|
|
10587
10645
|
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
10588
10646
|
SlipButton,
|
|
10589
10647
|
{
|
|
10590
|
-
selection: chipSelection(m,
|
|
10648
|
+
selection: chipSelection(m, match, slip.conversationId),
|
|
10591
10649
|
marketDeveloperName: m.marketDeveloperName,
|
|
10592
10650
|
selectionLabel: m.selectionLabel,
|
|
10593
10651
|
slip,
|
|
@@ -10609,7 +10667,7 @@ function LiveFactBlock({ facts, matchId, ui, slip, onAsk }) {
|
|
|
10609
10667
|
{
|
|
10610
10668
|
type: "button",
|
|
10611
10669
|
className: "ss-w-fact-link",
|
|
10612
|
-
onClick: () => onAsk(current.text, { kind: "liveFact", matchId, subject: current.text.slice(0, 400) }),
|
|
10670
|
+
onClick: () => onAsk(current.text, { kind: "liveFact", matchId: match.matchId, subject: current.text.slice(0, 400) }),
|
|
10613
10671
|
children: ui.liveFactAsk
|
|
10614
10672
|
}
|
|
10615
10673
|
),
|
|
@@ -10800,11 +10858,11 @@ function MonitorMatchCard({ match, promotedPins, monitor, ui, slip, onAsk }) {
|
|
|
10800
10858
|
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "ss-w-mon-scorers-ball", "aria-hidden": "true", children: "\u26BD" }),
|
|
10801
10859
|
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("ul", { className: "ss-w-mon-scorers-col ss-w-mon-scorers-away", children: awayScorers.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("li", { children: s.label }, `${s.player}-${i}`)) })
|
|
10802
10860
|
] }),
|
|
10803
|
-
live && match.facts && match.facts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(LiveFactBlock, { facts: match.facts,
|
|
10861
|
+
live && match.facts && match.facts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(LiveFactBlock, { facts: match.facts, match, ui, slip, onAsk }),
|
|
10804
10862
|
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "ss-w-mon-stats", children: orderedRows.map((row) => {
|
|
10805
10863
|
const { home, away } = splitWidths2(row.homeNum, row.awayNum);
|
|
10806
10864
|
const promoted = isPromoted(row, promotedPins);
|
|
10807
|
-
const selection = chipSelection(row.market, match
|
|
10865
|
+
const selection = chipSelection(row.market, match, slip.conversationId);
|
|
10808
10866
|
const chipPrice = row.market ? chipPriceText(row.market, oddsFormat) : void 0;
|
|
10809
10867
|
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: promoted ? "ss-w-mon-stat ss-w-mon-pstrip" : "ss-w-mon-stat", children: [
|
|
10810
10868
|
/* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "ss-w-mon-stat-row", children: [
|
|
@@ -11058,7 +11116,7 @@ function usePropsOpen(match, monitor, descriptor) {
|
|
|
11058
11116
|
}, [match.matchId, match.asOfUtc, open]);
|
|
11059
11117
|
return { bundle: monitor.playerProps?.[monitorMatchKey(sport, match.matchId)]?.bundle, live, open };
|
|
11060
11118
|
}
|
|
11061
|
-
function PropPrice({ price, label, ariaName, stat, bundle, descriptor, ui, slip }) {
|
|
11119
|
+
function PropPrice({ price, label, ariaName, player, stat, bundle, descriptor, ui, slip }) {
|
|
11062
11120
|
const { oddsFormat } = useOddsSettings();
|
|
11063
11121
|
const shown2 = formatOdds(price.priceFormats, oddsFormat);
|
|
11064
11122
|
if (bundle.addToSlipEnabled && takesSport(slip, descriptor.sport)) {
|
|
@@ -11074,7 +11132,7 @@ function PropPrice({ price, label, ariaName, stat, bundle, descriptor, ui, slip
|
|
|
11074
11132
|
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
11075
11133
|
SlipButton,
|
|
11076
11134
|
{
|
|
11077
|
-
selection,
|
|
11135
|
+
selection: withMatch(selection, { home: bundle.homeAbbreviation, away: bundle.awayAbbreviation, kickoffUtc: bundle.startsAtUtc, marketLabel: stat.label, player }),
|
|
11078
11136
|
marketDeveloperName: stat.marketDeveloperName,
|
|
11079
11137
|
selectionLabel: price.label,
|
|
11080
11138
|
line: price.line != null ? String(price.line) : void 0,
|
|
@@ -11135,7 +11193,7 @@ function PropPlayerPanel({ player: given, bundle, descriptor, ui, slip }) {
|
|
|
11135
11193
|
const hitsOf = (price, text2) => descriptor.showHits && sample > 0 && price.hits != null ? text2(price.hits) : null;
|
|
11136
11194
|
const bars = active ? descriptor.bars(active, player) : [];
|
|
11137
11195
|
const title = typeof descriptor.barsTitle === "function" ? descriptor.barsTitle(bars.length, bars.some((b) => b.live)) : descriptor.barsTitle;
|
|
11138
|
-
const priceProps = { bundle, descriptor, ui, slip };
|
|
11196
|
+
const priceProps = { bundle, descriptor, ui, slip, player: player.name };
|
|
11139
11197
|
const liveValue = (s) => hasLiveLine(player) ? descriptor.live?.(s, player) ?? null : null;
|
|
11140
11198
|
const liveChips = stats.some((s) => liveValue(s) !== null);
|
|
11141
11199
|
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "ss-w-props-panel", children: [
|
|
@@ -11626,6 +11684,7 @@ function Trends({ bundle, facts, descriptor, ui, slip }) {
|
|
|
11626
11684
|
price: f.price,
|
|
11627
11685
|
label: "",
|
|
11628
11686
|
ariaName: `${f.playerName}, ${bet}`,
|
|
11687
|
+
player: f.playerName,
|
|
11629
11688
|
stat: f,
|
|
11630
11689
|
bundle,
|
|
11631
11690
|
descriptor,
|
|
@@ -11641,7 +11700,7 @@ function Trends({ bundle, facts, descriptor, ui, slip }) {
|
|
|
11641
11700
|
function Scorers({ bundle, scorers, abbreviations, descriptor, ui, slip }) {
|
|
11642
11701
|
const [all, setAll] = (0, import_react67.useState)(false);
|
|
11643
11702
|
const shown2 = all ? scorers : scorers.slice(0, SCORERS_SHOWN);
|
|
11644
|
-
const cell2 = (name, column, price, stat) => price && stat ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(PropPrice, { price, label: "", ariaName: `${name}, ${column}`, stat, bundle, descriptor, ui, slip }) : /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "ss-w-props-scorer-none", children: "\u2014" });
|
|
11703
|
+
const cell2 = (name, column, price, stat) => price && stat ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(PropPrice, { price, label: "", ariaName: `${name}, ${column}`, player: name, stat, bundle, descriptor, ui, slip }) : /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "ss-w-props-scorer-none", children: "\u2014" });
|
|
11645
11704
|
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "ss-w-props-scorers", children: [
|
|
11646
11705
|
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "ss-w-props-scorer ss-w-props-scorer-head", children: [
|
|
11647
11706
|
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { children: ui.nfl.propsPlayer }),
|
|
@@ -11956,12 +12015,12 @@ var hasGames = (s) => s.sets.some((x) => (x.p1Games ?? 0) > 0 || (x.p2Games ?? 0
|
|
|
11956
12015
|
|
|
11957
12016
|
// src/components/TennisFixtureRow.tsx
|
|
11958
12017
|
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
11959
|
-
function TennisSidePrice({ matchId, tour, price, forms, value, oddsId, player, ui, slip, name, lead, movedLabel }) {
|
|
12018
|
+
function TennisSidePrice({ matchId, tour, pair, price, forms, value, oddsId, player, ui, slip, name, lead, movedLabel }) {
|
|
11960
12019
|
const { oddsFormat } = useOddsSettings();
|
|
11961
12020
|
const added = useSlipState()?.added;
|
|
11962
12021
|
const slipAllowed = !!slip && price.addToSlipEnabled && slipOpenFor(slip, "tennis");
|
|
11963
12022
|
const label = formatOdds(forms, oddsFormat);
|
|
11964
|
-
const selection = slipAllowed && oddsId != null ? {
|
|
12023
|
+
const selection = slipAllowed && oddsId != null ? withMatch({
|
|
11965
12024
|
matchOddsId: oddsId,
|
|
11966
12025
|
matchId,
|
|
11967
12026
|
oddsDecimal: value,
|
|
@@ -11970,7 +12029,7 @@ function TennisSidePrice({ matchId, tour, price, forms, value, oddsId, player, u
|
|
|
11970
12029
|
sport: "tennis",
|
|
11971
12030
|
...tour ? { tour } : {},
|
|
11972
12031
|
...slip.conversationId !== void 0 ? { conversationId: slip.conversationId } : {}
|
|
11973
|
-
} : null;
|
|
12032
|
+
}, pair) : null;
|
|
11974
12033
|
const inSlip = oddsId != null && !!added?.[slipKey({ matchOddsId: oddsId, sport: "tennis" })];
|
|
11975
12034
|
const ariaLabel = `${player} ${label}${movedLabel ? `, ${movedLabel}` : ""}`;
|
|
11976
12035
|
if (selection) {
|
|
@@ -12006,7 +12065,14 @@ function TennisSidePrice({ matchId, tour, price, forms, value, oddsId, player, u
|
|
|
12006
12065
|
] });
|
|
12007
12066
|
}
|
|
12008
12067
|
function TennisPriceCell({ match, price, ui, slip }) {
|
|
12009
|
-
const common = {
|
|
12068
|
+
const common = {
|
|
12069
|
+
matchId: match.matchId,
|
|
12070
|
+
tour: match.tour,
|
|
12071
|
+
price,
|
|
12072
|
+
ui,
|
|
12073
|
+
slip,
|
|
12074
|
+
pair: { home: match.homeTeamName, away: match.awayTeamName, kickoffUtc: match.kickoffUnix > 0 ? new Date(match.kickoffUnix * 1e3).toISOString() : null }
|
|
12075
|
+
};
|
|
12010
12076
|
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("span", { className: "ss-w-trow-prices", children: [
|
|
12011
12077
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(TennisSidePrice, { ...common, forms: price.p1, value: price.p1Value, oddsId: price.p1OddsId, player: match.homeTeamName }),
|
|
12012
12078
|
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(TennisSidePrice, { ...common, forms: price.p2, value: price.p2Value, oddsId: price.p2OddsId, player: match.awayTeamName })
|
|
@@ -12214,7 +12280,7 @@ function WinnerPrice({ match, t, price, ui, slip }) {
|
|
|
12214
12280
|
const liveBlock = t.live ?? null;
|
|
12215
12281
|
const paused = !!liveBlock?.pricesPaused;
|
|
12216
12282
|
const effective = price && paused ? { ...price, addToSlipEnabled: false } : price;
|
|
12217
|
-
const common = effective ? { matchId: match.matchId, tour: t.header.tour, price: effective, ui, slip } : null;
|
|
12283
|
+
const common = effective ? { matchId: match.matchId, tour: t.header.tour, price: effective, ui, slip, pair: { home: t.p1.name, away: t.p2.name, kickoffUtc: t.header.startsAtUtc } } : null;
|
|
12218
12284
|
const moved = price && (direction(price.p1Direction) || direction(price.p2Direction));
|
|
12219
12285
|
const since = price?.previousAtUtc ? ui.bettingKickoff(price.previousAtUtc).dayLabel : null;
|
|
12220
12286
|
const sides = price && common ? [
|
|
@@ -16811,8 +16877,8 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
16811
16877
|
send(requestFor(next));
|
|
16812
16878
|
}, [empty2, singles, widened, canWiden, view]);
|
|
16813
16879
|
(0, import_react97.useEffect)(() => {
|
|
16814
|
-
if (coolOff) onCoolOff?.();
|
|
16815
|
-
}, [coolOff, onCoolOff]);
|
|
16880
|
+
if (coolOff) onCoolOff?.(sport);
|
|
16881
|
+
}, [coolOff, onCoolOff, sport]);
|
|
16816
16882
|
if (coolOff) return null;
|
|
16817
16883
|
const nextGames = preset.nextGames?.trim() || null;
|
|
16818
16884
|
const nextAtMs = instantMs(preset.nextGamesAtUtc);
|
|
@@ -18509,7 +18575,10 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
18509
18575
|
.ss-w-combo-leg-market { font-size: 11.5px; font-weight: 600; line-height: 1.25; color: var(--ss-w-faint); overflow-wrap: break-word; }
|
|
18510
18576
|
.ss-w-combo-leg-sel { font-size: 13px; font-weight: 700; line-height: 1.2; color: var(--ss-w-ink); overflow-wrap: break-word; }
|
|
18511
18577
|
.ss-w-combo-leg-price { flex: none; font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 17px; font-weight: 800; line-height: 1.05; color: var(--ss-w-accent); }
|
|
18512
|
-
.ss-w-combo-leg-pick .ss-w-slip {
|
|
18578
|
+
.ss-w-combo-leg-pick .ss-w-slip { display: contents; }
|
|
18579
|
+
.ss-w-combo-leg-pick .ss-w-slip-btn { flex: none; }
|
|
18580
|
+
.ss-w-combo-leg .ss-w-bi-team { white-space: normal; text-overflow: clip; overflow-wrap: break-word; line-height: 1.25; }
|
|
18581
|
+
.ss-w-combo-leg-pick .ss-w-toast { position: static; flex-basis: 100%; width: auto; max-width: none; box-shadow: none; }
|
|
18513
18582
|
.ss-w-combo-leg-stat { font-size: 12px; line-height: 1.45; color: var(--ss-w-ink); background: var(--ss-w-bubble); border-radius: 8px; padding: 6px 9px; }
|
|
18514
18583
|
.ss-w-combo-math { font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 700; line-height: 1.4; color: var(--ss-w-ink); text-align: right; background: color-mix(in srgb, var(--ss-w-accent) 9%, var(--ss-w-panel)); border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; }
|
|
18515
18584
|
.ss-w-combo-note { font-size: 11px; line-height: 1.4; color: var(--ss-w-faint); }
|
|
@@ -20847,17 +20916,26 @@ function StatsWidget(props) {
|
|
|
20847
20916
|
() => [...controller.state.messages].reverse().find((m) => m.role === "assistant" && (m.greetingDashboard !== void 0 || m.greetingDashboards !== void 0)) ?? null,
|
|
20848
20917
|
[controller.state.messages]
|
|
20849
20918
|
);
|
|
20850
|
-
const [
|
|
20851
|
-
const onBuilderCoolOff = (0, import_react102.useCallback)(() =>
|
|
20919
|
+
const [coolOff, setCoolOff] = (0, import_react102.useState)(null);
|
|
20920
|
+
const onBuilderCoolOff = (0, import_react102.useCallback)((sport) => {
|
|
20921
|
+
if (!builderGreeting) return;
|
|
20922
|
+
setCoolOff((prev) => {
|
|
20923
|
+
const sports = prev?.greeting === builderGreeting ? prev.sports : [];
|
|
20924
|
+
return sports.includes(sport) ? prev : { greeting: builderGreeting, sports: [...sports, sport] };
|
|
20925
|
+
});
|
|
20926
|
+
}, [builderGreeting]);
|
|
20852
20927
|
const builderOptions = (0, import_react102.useMemo)(() => {
|
|
20853
20928
|
const greeting = builderGreeting;
|
|
20854
|
-
if (!greeting
|
|
20929
|
+
if (!greeting) return [];
|
|
20930
|
+
const cooled = coolOff?.greeting === greeting ? coolOff.sports : [];
|
|
20855
20931
|
const sets = switchSets(greeting.greetingDashboards);
|
|
20856
|
-
|
|
20857
|
-
|
|
20858
|
-
|
|
20859
|
-
|
|
20860
|
-
|
|
20932
|
+
const options = sets ? sets.flatMap((s) => s.dashboard.personal?.builder ? [{ sport: s.sport, label: s.label, preset: s.dashboard.personal.builder }] : []) : (() => {
|
|
20933
|
+
const preset = greeting.greetingDashboard?.personal?.builder;
|
|
20934
|
+
const sport = greeting.defaultSport || "football";
|
|
20935
|
+
return preset ? [{ sport, label: sportLabel(ui, sport), preset }] : [];
|
|
20936
|
+
})();
|
|
20937
|
+
return options.filter((o) => !cooled.includes(o.sport));
|
|
20938
|
+
}, [builderGreeting, coolOff, ui]);
|
|
20861
20939
|
const builderSport = [builderSportPick, rememberedSport, latestGreeting?.defaultSport].find((s) => !!s && builderOptions.some((o) => o.sport === s)) ?? builderOptions[0]?.sport ?? "";
|
|
20862
20940
|
const [panelEverOpened, setPanelEverOpened] = (0, import_react102.useState)(panelOpen);
|
|
20863
20941
|
if (panelOpen && !panelEverOpened) setPanelEverOpened(true);
|