@sensiblestats/widget-react 0.136.1 → 0.138.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 +22 -0
- package/dist/index.cjs +466 -407
- 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 +543 -484
- package/dist/index.js.map +1 -1
- package/dist/styles.css +3 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -908,7 +908,7 @@ var BUNDLED_EN_GB = {
|
|
|
908
908
|
};
|
|
909
909
|
|
|
910
910
|
// src/strings/fill.ts
|
|
911
|
-
var pickForm = (row,
|
|
911
|
+
var pickForm = (row, count2, tag2) => row[new Intl.PluralRules(tag2).select(count2)] ?? row.other;
|
|
912
912
|
function fill(template, tokens, tag2) {
|
|
913
913
|
const text2 = typeof template === "string" ? template : pickForm(template, Number(tokens[template.$count ?? "count"]), tag2);
|
|
914
914
|
return text2.replace(/\{(\w+)\}/g, (match, name) => Object.prototype.hasOwnProperty.call(tokens, name) ? String(tokens[name]) : match);
|
|
@@ -1337,7 +1337,7 @@ function parseOddsFormat(value) {
|
|
|
1337
1337
|
}
|
|
1338
1338
|
|
|
1339
1339
|
// src/version.generated.ts
|
|
1340
|
-
var WIDGET_REACT_VERSION = "0.
|
|
1340
|
+
var WIDGET_REACT_VERSION = "0.138.0";
|
|
1341
1341
|
|
|
1342
1342
|
// src/config.ts
|
|
1343
1343
|
function hostTag(cfg) {
|
|
@@ -1902,6 +1902,19 @@ function str(v) {
|
|
|
1902
1902
|
function num(v) {
|
|
1903
1903
|
return typeof v === "number" && Number.isFinite(v) ? String(v) : void 0;
|
|
1904
1904
|
}
|
|
1905
|
+
function count(v) {
|
|
1906
|
+
return typeof v === "number" && Number.isFinite(v) && v >= 0 ? v : void 0;
|
|
1907
|
+
}
|
|
1908
|
+
function readRecord(raw) {
|
|
1909
|
+
if (typeof raw !== "object" || raw === null) return void 0;
|
|
1910
|
+
const r = raw;
|
|
1911
|
+
const wins = count(r.wins);
|
|
1912
|
+
const losses = count(r.losses);
|
|
1913
|
+
if (wins === void 0 || losses === void 0) return void 0;
|
|
1914
|
+
const draws = count(r.draws);
|
|
1915
|
+
const ties = count(r.ties);
|
|
1916
|
+
return { wins, losses, ...draws !== void 0 ? { draws } : {}, ...ties !== void 0 ? { ties } : {} };
|
|
1917
|
+
}
|
|
1905
1918
|
function readStatCells(raw) {
|
|
1906
1919
|
if (!Array.isArray(raw)) return [];
|
|
1907
1920
|
const cells = [];
|
|
@@ -1910,7 +1923,8 @@ function readStatCells(raw) {
|
|
|
1910
1923
|
const value = num(entry.value) ?? str(entry.value);
|
|
1911
1924
|
if (label === void 0 || value === void 0) continue;
|
|
1912
1925
|
const note = str(entry.note);
|
|
1913
|
-
|
|
1926
|
+
const record2 = readRecord(entry.record);
|
|
1927
|
+
cells.push({ label, value, ...note !== void 0 ? { note } : {}, ...entry.muted === true ? { muted: true } : {}, ...record2 ? { record: record2 } : {} });
|
|
1914
1928
|
}
|
|
1915
1929
|
return cells;
|
|
1916
1930
|
}
|
|
@@ -1929,7 +1943,7 @@ function toCardVM(card) {
|
|
|
1929
1943
|
};
|
|
1930
1944
|
}).filter((s) => s !== null) : [];
|
|
1931
1945
|
return {
|
|
1932
|
-
id:
|
|
1946
|
+
id: `${kind}:${card.entityId}`,
|
|
1933
1947
|
kind,
|
|
1934
1948
|
name: card.canonicalName,
|
|
1935
1949
|
image: str(card.imagePath) ?? str(card.imageUrl) ?? str(card.image_url) ?? str(card.logoUrl) ?? str(card.logo),
|
|
@@ -6605,7 +6619,7 @@ function allMarketsCount(vm, monitor) {
|
|
|
6605
6619
|
if (!monitor?.enabled || !vm.pinEnabled || (0, import_widget_sdk20.sportOf)(vm.sport) !== void 0) return null;
|
|
6606
6620
|
return vm.marketCount !== void 0 && vm.marketCount >= 2 ? vm.marketCount : null;
|
|
6607
6621
|
}
|
|
6608
|
-
function AllMarketsButton({ vm, count, monitor, ui, surface }) {
|
|
6622
|
+
function AllMarketsButton({ vm, count: count2, monitor, ui, surface }) {
|
|
6609
6623
|
const log = useEventLog();
|
|
6610
6624
|
const [toast, setToast] = (0, import_react34.useState)(null);
|
|
6611
6625
|
const dismiss = (0, import_react34.useCallback)(() => setToast(null), []);
|
|
@@ -6622,9 +6636,9 @@ function AllMarketsButton({ vm, count, monitor, ui, surface }) {
|
|
|
6622
6636
|
outcome: surface === "card" ? "all_markets_card" : "all_markets_list"
|
|
6623
6637
|
});
|
|
6624
6638
|
};
|
|
6625
|
-
const label = vm.homeTeamName && vm.awayTeamName ? ui.allMarketsAria(
|
|
6639
|
+
const label = vm.homeTeamName && vm.awayTeamName ? ui.allMarketsAria(count2, vm.homeTeamName, vm.awayTeamName) : void 0;
|
|
6626
6640
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: surface === "card" ? "ss-w-allmk-wrap" : "ss-w-allmk-wrap ss-w-allmk-wrap--chip", children: [
|
|
6627
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { type: "button", className: surface === "card" ? "ss-w-allmk" : "ss-w-allmk ss-w-allmk--chip", "aria-label": label ?? ui.allMarkets(
|
|
6641
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { type: "button", className: surface === "card" ? "ss-w-allmk" : "ss-w-allmk ss-w-allmk--chip", "aria-label": label ?? ui.allMarkets(count2), onClick, children: [
|
|
6628
6642
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
6629
6643
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("rect", { x: "3", y: "5", width: "5", height: "5", rx: "1.2" }),
|
|
6630
6644
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("rect", { x: "9.5", y: "5", width: "5", height: "5", rx: "1.2" }),
|
|
@@ -6633,7 +6647,7 @@ function AllMarketsButton({ vm, count, monitor, ui, surface }) {
|
|
|
6633
6647
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("rect", { x: "9.5", y: "14", width: "5", height: "5", rx: "1.2" }),
|
|
6634
6648
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("rect", { x: "16", y: "14", width: "5", height: "5", rx: "1.2" })
|
|
6635
6649
|
] }),
|
|
6636
|
-
surface === "card" ? ui.allMarkets(
|
|
6650
|
+
surface === "card" ? ui.allMarkets(count2) : count2
|
|
6637
6651
|
] }),
|
|
6638
6652
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Toast, { toast, onDismiss: dismiss })
|
|
6639
6653
|
] });
|
|
@@ -7335,7 +7349,7 @@ function PersonalGreeting({ personal, ui, slip, sport, starsElsewhere = false, o
|
|
|
7335
7349
|
const since = personal.since ?? [];
|
|
7336
7350
|
const asks = personal.asks ?? [];
|
|
7337
7351
|
const noFavourites = controller?.status === "ready" && controller.data !== null && [controller.data.competitions, controller.data.teams, controller.data.players].every((list) => list.length === 0) && (personal.ribbon?.stars ?? []).length === 0 && !starsElsewhere && personal.hasStarsElsewhere !== true;
|
|
7338
|
-
const showInvite = ctx?.
|
|
7352
|
+
const showInvite = ctx?.favouritesOffered === true && noFavourites;
|
|
7339
7353
|
const cards = hasCards ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("section", { className: "ss-w-v8-sec ss-w-v8-cards", children: [
|
|
7340
7354
|
ofYours ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h3", { className: "ss-w-v8-sec-title", children: ui.v8YourTeams }) : null,
|
|
7341
7355
|
teamCards.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
@@ -7819,7 +7833,9 @@ function ChatHeader({
|
|
|
7819
7833
|
newConversationLabel,
|
|
7820
7834
|
moreOptionsLabel,
|
|
7821
7835
|
onOpenSettings,
|
|
7822
|
-
settingsLabel
|
|
7836
|
+
settingsLabel,
|
|
7837
|
+
onOpenFavourites,
|
|
7838
|
+
favouritesLabel
|
|
7823
7839
|
}) {
|
|
7824
7840
|
const [menuOpen, setMenuOpen] = (0, import_react48.useState)(false);
|
|
7825
7841
|
const wrapRef = (0, import_react48.useRef)(null);
|
|
@@ -7827,7 +7843,8 @@ function ChatHeader({
|
|
|
7827
7843
|
const firstItemRef = (0, import_react48.useRef)(null);
|
|
7828
7844
|
const hasNew = !!(canReset && onNewConversation);
|
|
7829
7845
|
const hasSettings = !!onOpenSettings;
|
|
7830
|
-
const
|
|
7846
|
+
const hasFavourites = !!onOpenFavourites;
|
|
7847
|
+
const hasMenu = hasFavourites || hasNew || hasSettings;
|
|
7831
7848
|
(0, import_react48.useEffect)(() => {
|
|
7832
7849
|
if (menuOpen) firstItemRef.current?.focus();
|
|
7833
7850
|
}, [menuOpen]);
|
|
@@ -7853,6 +7870,10 @@ function ChatHeader({
|
|
|
7853
7870
|
setMenuOpen(false);
|
|
7854
7871
|
onNewConversation?.();
|
|
7855
7872
|
};
|
|
7873
|
+
const runFavourites = () => {
|
|
7874
|
+
setMenuOpen(false);
|
|
7875
|
+
onOpenFavourites?.();
|
|
7876
|
+
};
|
|
7856
7877
|
const runSettings = () => {
|
|
7857
7878
|
setMenuOpen(false);
|
|
7858
7879
|
onOpenSettings?.();
|
|
@@ -7875,13 +7896,24 @@ function ChatHeader({
|
|
|
7875
7896
|
}
|
|
7876
7897
|
),
|
|
7877
7898
|
menuOpen ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "ss-w-menu", role: "menu", "aria-label": moreOptionsLabel, children: [
|
|
7878
|
-
|
|
7899
|
+
hasFavourites ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
7879
7900
|
"button",
|
|
7880
7901
|
{
|
|
7881
7902
|
type: "button",
|
|
7882
7903
|
className: "ss-w-menu-item",
|
|
7883
7904
|
role: "menuitem",
|
|
7884
7905
|
ref: firstItemRef,
|
|
7906
|
+
onClick: runFavourites,
|
|
7907
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: favouritesLabel })
|
|
7908
|
+
}
|
|
7909
|
+
) : null,
|
|
7910
|
+
hasNew ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
7911
|
+
"button",
|
|
7912
|
+
{
|
|
7913
|
+
type: "button",
|
|
7914
|
+
className: "ss-w-menu-item",
|
|
7915
|
+
role: "menuitem",
|
|
7916
|
+
ref: hasFavourites ? void 0 : firstItemRef,
|
|
7885
7917
|
onClick: runNewConversation,
|
|
7886
7918
|
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: newConversationLabel })
|
|
7887
7919
|
}
|
|
@@ -7892,7 +7924,7 @@ function ChatHeader({
|
|
|
7892
7924
|
type: "button",
|
|
7893
7925
|
className: "ss-w-menu-item",
|
|
7894
7926
|
role: "menuitem",
|
|
7895
|
-
ref: hasNew ? void 0 : firstItemRef,
|
|
7927
|
+
ref: hasFavourites || hasNew ? void 0 : firstItemRef,
|
|
7896
7928
|
onClick: runSettings,
|
|
7897
7929
|
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: settingsLabel })
|
|
7898
7930
|
}
|
|
@@ -7957,6 +7989,13 @@ function cellClass(s) {
|
|
|
7957
7989
|
return s.muted ? "ss-w-ecard-cell ss-w-ecard-cell--muted" : "ss-w-ecard-cell";
|
|
7958
7990
|
}
|
|
7959
7991
|
function StatCellView({ s }) {
|
|
7992
|
+
if (s.record) {
|
|
7993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: cellClass(s), children: [
|
|
7994
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "ss-w-ecard-cval", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(FormBar, { w: s.record.wins, d: s.record.draws ?? s.record.ties ?? 0, l: s.record.losses }) }),
|
|
7995
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "ss-w-ecard-clabel", children: `${s.label} ${s.value}` }),
|
|
7996
|
+
s.note ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "ss-w-ecard-note", children: s.note }) : null
|
|
7997
|
+
] });
|
|
7998
|
+
}
|
|
7960
7999
|
const m = RECORD_RE.exec(s.value);
|
|
7961
8000
|
if (m) {
|
|
7962
8001
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: cellClass(s), children: [
|
|
@@ -8017,7 +8056,7 @@ function ScopeTabs({ scopes, active, onSelect }) {
|
|
|
8017
8056
|
onClick: () => onSelect(i),
|
|
8018
8057
|
children: s.image ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Crest2, { image: s.image }) : s.label
|
|
8019
8058
|
},
|
|
8020
|
-
String(s.competitionId
|
|
8059
|
+
s.competitionId == null ? `i${i}` : String(s.competitionId)
|
|
8021
8060
|
)) });
|
|
8022
8061
|
}
|
|
8023
8062
|
function EntityCardItem({ c }) {
|
|
@@ -9562,7 +9601,7 @@ function Cell({ row, cell: cell2, ui, slip }) {
|
|
|
9562
9601
|
function Row({ row, columns, ui, slip, monitor, rowRef }) {
|
|
9563
9602
|
const vm = row.card;
|
|
9564
9603
|
useNextKickoffRender(isNfl(vm.sport) ? [vm.kickoffUtc] : []);
|
|
9565
|
-
const
|
|
9604
|
+
const count2 = allMarketsCount(vm, monitor);
|
|
9566
9605
|
const nflPin = (0, import_widget_sdk23.sportOf)(vm.sport) === "americanfootball" && !vm.isLive;
|
|
9567
9606
|
const kickoffFallback = vm.kickoffUtc ? ui.bettingKickoff(vm.kickoffUtc) : void 0;
|
|
9568
9607
|
const when = vm.isLive ? ui.liveLabel : vm.kickoffLabel ?? (kickoffFallback ? `${kickoffFallback.dayLabel} ${kickoffFallback.time}` : void 0);
|
|
@@ -9581,7 +9620,7 @@ function Row({ row, columns, ui, slip, monitor, rowRef }) {
|
|
|
9581
9620
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "ss-w-mol-cells", style: { gridTemplateColumns: `repeat(${row.cells.length || columns}, minmax(0, 1fr))` }, children: row.cells.map((cell2) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Cell, { row, cell: cell2, ui, slip }, cell2.row.key)) }),
|
|
9582
9621
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: vm.isLive ? "ss-w-mol-side ss-w-mol-side--live" : "ss-w-mol-side", children: [
|
|
9583
9622
|
when ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "ss-w-mol-when", children: when }) : null,
|
|
9584
|
-
|
|
9623
|
+
count2 !== null && monitor && ui ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AllMarketsButton, { vm, count: count2, monitor, ui, surface: "list" }) : monitor && (vm.pinEnabled && vm.isLive || nflPin) && (0, import_widget_sdk23.mayPinOrSlip)(vm.sport) ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(PinToggle, { ui, monitor, pin: { kind: "match", matchId: vm.matchId, sport: (0, import_widget_sdk23.slipSportOf)(vm.sport) } }) : null
|
|
9585
9624
|
] })
|
|
9586
9625
|
] });
|
|
9587
9626
|
}
|
|
@@ -10728,8 +10767,8 @@ var ChatInput = (0, import_react62.forwardRef)(function ChatInput2({ placeholder
|
|
|
10728
10767
|
// src/components/TabBar.tsx
|
|
10729
10768
|
var import_react63 = require("react");
|
|
10730
10769
|
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
10731
|
-
var
|
|
10732
|
-
function TabBar({ monitor, ui, matchCount, trendsCount, liveCount, hasSchedule, hasBuilder = false, gamesEnabled, clubEnabled
|
|
10770
|
+
var TIGHT_LEVELS = [0, 1, 2, 3, 4, 5, 6];
|
|
10771
|
+
function TabBar({ monitor, ui, matchCount, trendsCount, liveCount, hasSchedule, hasBuilder = false, gamesEnabled, clubEnabled }) {
|
|
10733
10772
|
const tabs = [
|
|
10734
10773
|
{ tab: "chat", label: ui.tabChat, count: 0, dot: monitor.chatDot },
|
|
10735
10774
|
...clubEnabled ? [
|
|
@@ -10745,8 +10784,7 @@ function TabBar({ monitor, ui, matchCount, trendsCount, liveCount, hasSchedule,
|
|
|
10745
10784
|
...matchCount > 0 ? [{ tab: "following", label: ui.tabFollowing, count: matchCount, dot: monitor.matchesDot }] : [],
|
|
10746
10785
|
...trendsCount > 0 ? [{ tab: "trends", label: ui.tabTrends, count: trendsCount, dot: monitor.trendsDot }] : []
|
|
10747
10786
|
],
|
|
10748
|
-
...gamesEnabled ? [{ tab: "games", label: ui.tabGames, count: 0, dot: false }] : []
|
|
10749
|
-
...favouritesEnabled && !clubEnabled ? [{ tab: "favourites", label: ui.tabFavourites, count: 0, dot: false }] : []
|
|
10787
|
+
...gamesEnabled ? [{ tab: "games", label: ui.tabGames, count: 0, dot: false }] : []
|
|
10750
10788
|
];
|
|
10751
10789
|
const track = useTrack();
|
|
10752
10790
|
const listRef = (0, import_react63.useRef)(null);
|
|
@@ -10761,12 +10799,10 @@ function TabBar({ monitor, ui, matchCount, trendsCount, liveCount, hasSchedule,
|
|
|
10761
10799
|
(0, import_react63.useLayoutEffect)(() => {
|
|
10762
10800
|
const strip = listRef.current;
|
|
10763
10801
|
if (!strip) return;
|
|
10764
|
-
const fav = strip.querySelector("[data-fav-tab]");
|
|
10765
10802
|
const measure = () => {
|
|
10766
|
-
for (const
|
|
10803
|
+
for (const tight of TIGHT_LEVELS) {
|
|
10767
10804
|
if (tight === 0) strip.removeAttribute("data-tight");
|
|
10768
10805
|
else strip.setAttribute("data-tight", String(tight));
|
|
10769
|
-
fav?.toggleAttribute("data-compact", compact);
|
|
10770
10806
|
if (strip.scrollWidth <= strip.clientWidth) return;
|
|
10771
10807
|
}
|
|
10772
10808
|
};
|
|
@@ -10781,7 +10817,7 @@ function TabBar({ monitor, ui, matchCount, trendsCount, liveCount, hasSchedule,
|
|
|
10781
10817
|
};
|
|
10782
10818
|
}, [labelSignature]);
|
|
10783
10819
|
if (tabs.length < 2) return null;
|
|
10784
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "ss-w-tabs", role: "tablist", ref: listRef, children: tabs.map(({ tab, label, count, dot }) => {
|
|
10820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "ss-w-tabs", role: "tablist", ref: listRef, children: tabs.map(({ tab, label, count: count2, dot }) => {
|
|
10785
10821
|
const active = monitor.activeTab === tab;
|
|
10786
10822
|
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
10787
10823
|
"button",
|
|
@@ -10790,19 +10826,15 @@ function TabBar({ monitor, ui, matchCount, trendsCount, liveCount, hasSchedule,
|
|
|
10790
10826
|
role: "tab",
|
|
10791
10827
|
"aria-selected": active,
|
|
10792
10828
|
"data-on": active ? "" : void 0,
|
|
10793
|
-
"
|
|
10794
|
-
"aria-label": tab === "favourites" ? label : tab === "live" && count > 0 ? `${label} \xB7 ${ui.liveCountLabel(count)}` : void 0,
|
|
10829
|
+
"aria-label": tab === "live" && count2 > 0 ? `${label} \xB7 ${ui.liveCountLabel(count2)}` : void 0,
|
|
10795
10830
|
className: "ss-w-tab",
|
|
10796
10831
|
onClick: () => {
|
|
10797
10832
|
if (tab !== monitor.activeTab) track({ name: "tab_change", from: monitor.activeTab, to: tab });
|
|
10798
10833
|
monitor.setActiveTab(tab);
|
|
10799
10834
|
},
|
|
10800
10835
|
children: [
|
|
10801
|
-
|
|
10802
|
-
|
|
10803
|
-
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "ss-w-tab-star", "aria-hidden": "true", children: "\u2605" })
|
|
10804
|
-
] }) : label,
|
|
10805
|
-
count > 0 && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "ss-w-tab-count", "aria-hidden": tab === "live" ? true : void 0, children: count }),
|
|
10836
|
+
label,
|
|
10837
|
+
count2 > 0 && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "ss-w-tab-count", "aria-hidden": tab === "live" ? true : void 0, children: count2 }),
|
|
10806
10838
|
dot && !active && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "ss-w-tab-dot", "aria-hidden": "true" })
|
|
10807
10839
|
]
|
|
10808
10840
|
},
|
|
@@ -11845,7 +11877,7 @@ var nflDescriptor = (ui) => ({
|
|
|
11845
11877
|
statShort: (stat) => stat.shortLabel,
|
|
11846
11878
|
mainStat: (p) => STAT_ORDER2.map((k) => p.stats.find((s) => s.stat === k)).find((s) => s != null && hasMainLine(s)),
|
|
11847
11879
|
bars: (stat) => [...stat.games ?? []].reverse().map((g) => ({ label: g.opponent, away: !g.isHome, value: g.value })),
|
|
11848
|
-
barsTitle: (
|
|
11880
|
+
barsTitle: (count2) => count2 === 1 ? ui.nfl.propsLastOne : fillNfl(ui.nfl.propsLastN, { n: count2 }),
|
|
11849
11881
|
showHits: true,
|
|
11850
11882
|
live: (stat, player) => {
|
|
11851
11883
|
const now = LIVE_VALUE2[stat.stat];
|
|
@@ -15939,10 +15971,10 @@ function formationSlots(formation) {
|
|
|
15939
15971
|
const lines = [1, ...outfield];
|
|
15940
15972
|
const template = FORMATION_POSITIONS[used];
|
|
15941
15973
|
const slots = [];
|
|
15942
|
-
lines.forEach((
|
|
15974
|
+
lines.forEach((count2, li) => {
|
|
15943
15975
|
const top = 88 - li * (77 / (lines.length - 1));
|
|
15944
|
-
for (let ci = 0; ci <
|
|
15945
|
-
const left =
|
|
15976
|
+
for (let ci = 0; ci < count2; ci++) {
|
|
15977
|
+
const left = count2 === 1 ? 50 : 12 + ci * (76 / (count2 - 1));
|
|
15946
15978
|
slots.push({ index: slots.length, label: template?.[li]?.[ci] ?? lineFallback(li, lines.length), left, top });
|
|
15947
15979
|
}
|
|
15948
15980
|
});
|
|
@@ -16946,7 +16978,7 @@ function FavouritesPanel({ controller, ui, sport, sports, onSportChange }) {
|
|
|
16946
16978
|
}, [sport]);
|
|
16947
16979
|
const sportLabel2 = sports.find((s) => s.sport === sport)?.label ?? sportLabel(ui, sport);
|
|
16948
16980
|
const noticeText = notice === null ? null : notice.type === "cap" ? ui.favAtCap(favouriteKindLabel(ui, sport, notice.kind)) : ui.favError;
|
|
16949
|
-
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("div", { className: "ss-w-
|
|
16981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("div", { className: "ss-w-fav", children: [
|
|
16950
16982
|
sports.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("div", { className: "ss-w-dash-sports", role: "group", "aria-label": ui.sportGroupLabel, children: sports.map((s) => /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
|
|
16951
16983
|
"button",
|
|
16952
16984
|
{
|
|
@@ -16966,9 +16998,104 @@ function FavouritesPanel({ controller, ui, sport, sports, onSportChange }) {
|
|
|
16966
16998
|
] });
|
|
16967
16999
|
}
|
|
16968
17000
|
|
|
16969
|
-
// src/components/
|
|
17001
|
+
// src/components/PresetTools.tsx
|
|
16970
17002
|
var import_react100 = require("react");
|
|
16971
17003
|
var import_jsx_runtime138 = require("react/jsx-runtime");
|
|
17004
|
+
function PresetToolModal({ title, closeLabel, onClose, children, footer, className }) {
|
|
17005
|
+
const { dialogRef, onKeyDown } = useModalDialog(onClose, { restoreFocus: false });
|
|
17006
|
+
const titleId = (0, import_react100.useId)();
|
|
17007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("div", { className: className ? `ss-w-tool-backdrop ${className}` : "ss-w-tool-backdrop", children: /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { ref: dialogRef, className: "ss-w-tool", role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, tabIndex: -1, onKeyDown, children: [
|
|
17008
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "ss-w-tool-head", children: [
|
|
17009
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("h2", { id: titleId, className: "ss-w-tool-title", children: title }),
|
|
17010
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("button", { type: "button", className: "ss-w-tool-close", "aria-label": closeLabel, onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(CloseIcon, {}) })
|
|
17011
|
+
] }),
|
|
17012
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("div", { className: "ss-w-tool-body", children }),
|
|
17013
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("div", { className: "ss-w-tool-foot", children: footer }) : null
|
|
17014
|
+
] }) });
|
|
17015
|
+
}
|
|
17016
|
+
function SendButton({ label, display, disabled, onClick }) {
|
|
17017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("button", { type: "button", className: "ss-w-tool-send", "aria-label": `${label}: ${display}`, disabled, onClick, children: label });
|
|
17018
|
+
}
|
|
17019
|
+
function PickList({ picks, formatKickoff }) {
|
|
17020
|
+
const { oddsFormat } = useOddsSettings();
|
|
17021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("ul", { className: "ss-w-tool-picks", role: "list", children: picks.map((p) => /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("li", { className: "ss-w-tool-pick", children: [
|
|
17022
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("span", { className: "ss-w-tool-pick-match", children: [
|
|
17023
|
+
p.homeTeamName,
|
|
17024
|
+
" \u2013 ",
|
|
17025
|
+
p.awayTeamName
|
|
17026
|
+
] }),
|
|
17027
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("span", { className: "ss-w-tool-pick-sel", children: [
|
|
17028
|
+
p.marketLabel,
|
|
17029
|
+
": ",
|
|
17030
|
+
p.selectionLabel,
|
|
17031
|
+
p.line ? ` ${p.line}` : ""
|
|
17032
|
+
] }),
|
|
17033
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("span", { className: "ss-w-tool-pick-kick", children: formatKickoff(p.kickoffUtc) }),
|
|
17034
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("span", { className: "ss-w-tool-pick-price", children: formatOdds(p.priceFormats, oddsFormat) })
|
|
17035
|
+
] }, p.matchOddsId)) });
|
|
17036
|
+
}
|
|
17037
|
+
function ComboPreview({ cell: cell2, formatKickoff }) {
|
|
17038
|
+
const { oddsFormat } = useOddsSettings();
|
|
17039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_jsx_runtime138.Fragment, { children: [
|
|
17040
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(PickList, { picks: cell2.combo.legs, formatKickoff }),
|
|
17041
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("div", { className: "ss-w-tool-math", children: oddsFormat === "decimal" ? cell2.combo.multiplication : formatOdds(cell2.combo.totalFormats, oddsFormat) })
|
|
17042
|
+
] });
|
|
17043
|
+
}
|
|
17044
|
+
function Unavailable({ text: text2 }) {
|
|
17045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("p", { className: "ss-w-tool-unavailable", children: text2 });
|
|
17046
|
+
}
|
|
17047
|
+
var textOf = (options, value, format2) => {
|
|
17048
|
+
const o = options.find((x) => samePrice(x.value, value));
|
|
17049
|
+
return o ? formatOdds(o.formats, format2) : "";
|
|
17050
|
+
};
|
|
17051
|
+
function BuildComboTool({ grid, strings, streaming, formatKickoff, initialTotal, initialLegs, onSend, onClose }) {
|
|
17052
|
+
const { oddsFormat } = useOddsSettings();
|
|
17053
|
+
const totalOptions = comboTotals(grid);
|
|
17054
|
+
const totals = totalOptions.map((o) => o.value);
|
|
17055
|
+
const legChoices = comboLegChoices(grid);
|
|
17056
|
+
const [total, setTotal] = (0, import_react100.useState)(() => nearest(totals, initialTotal));
|
|
17057
|
+
const [legs, setLegs] = (0, import_react100.useState)(() => legsForTotal(grid, nearest(totals, initialTotal), clampLegs(legChoices, initialLegs)));
|
|
17058
|
+
const [announcement, setAnnouncement] = (0, import_react100.useState)("");
|
|
17059
|
+
const cell2 = findCombo(grid, total, legs);
|
|
17060
|
+
const minLegs = legChoices[0] ?? legs;
|
|
17061
|
+
const maxLegs = legChoices[legChoices.length - 1] ?? legs;
|
|
17062
|
+
const display = strings.comboDisplay(legs, textOf(totalOptions, total, oddsFormat));
|
|
17063
|
+
const choose = (nextTotal, nextLegs) => {
|
|
17064
|
+
setTotal(nextTotal);
|
|
17065
|
+
setLegs(nextLegs);
|
|
17066
|
+
const d = strings.comboDisplay(nextLegs, textOf(totalOptions, nextTotal, oddsFormat));
|
|
17067
|
+
setAnnouncement(findCombo(grid, nextTotal, nextLegs) ? d : `${d}. ${strings.unavailable}`);
|
|
17068
|
+
};
|
|
17069
|
+
const footer = /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(SendButton, { label: strings.send, display, disabled: !cell2 || streaming, onClick: () => {
|
|
17070
|
+
if (cell2) onSend(comboAsk(cell2, strings, oddsFormat));
|
|
17071
|
+
} });
|
|
17072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(PresetToolModal, { title: strings.buildCombo, closeLabel: strings.close, onClose, footer, children: [
|
|
17073
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "ss-w-tool-section", role: "group", "aria-label": strings.totalLabel, children: [
|
|
17074
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("span", { className: "ss-w-tool-label", "aria-hidden": "true", children: strings.totalLabel }),
|
|
17075
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("div", { className: "ss-w-tool-chips", children: totalOptions.map((o) => /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("button", { type: "button", className: "ss-w-tool-chip", "aria-pressed": samePrice(o.value, total), onClick: () => choose(o.value, samePrice(o.value, total) ? legs : legsForTotal(grid, o.value, legs)), children: formatOdds(o.formats, oddsFormat) }, o.key)) })
|
|
17076
|
+
] }),
|
|
17077
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "ss-w-tool-section", role: "group", "aria-label": strings.matchesLabel, children: [
|
|
17078
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("span", { className: "ss-w-tool-label", "aria-hidden": "true", children: strings.matchesLabel }),
|
|
17079
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "ss-w-tool-stepper", children: [
|
|
17080
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("button", { type: "button", className: "ss-w-tool-step", "aria-label": strings.fewerMatches, disabled: legs <= minLegs, onClick: () => choose(total, legs - 1), children: "\u2212" }),
|
|
17081
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("span", { className: "ss-w-tool-count", children: legs }),
|
|
17082
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("button", { type: "button", className: "ss-w-tool-step", "aria-label": strings.moreMatches, disabled: legs >= maxLegs, onClick: () => choose(total, legs + 1), children: "+" })
|
|
17083
|
+
] })
|
|
17084
|
+
] }),
|
|
17085
|
+
cell2 ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(ComboPreview, { cell: cell2, formatKickoff }) : /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(Unavailable, { text: strings.unavailable }),
|
|
17086
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)("p", { className: "ss-w-vh", "aria-live": "polite", children: announcement })
|
|
17087
|
+
] });
|
|
17088
|
+
}
|
|
17089
|
+
|
|
17090
|
+
// src/components/FavouritesSheet.tsx
|
|
17091
|
+
var import_jsx_runtime139 = require("react/jsx-runtime");
|
|
17092
|
+
function FavouritesSheet({ ui, controller, sport, sports, onSportChange, onClose }) {
|
|
17093
|
+
return /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(PresetToolModal, { title: ui.tabFavourites, closeLabel: ui.closeSheetLabel, onClose, className: "ss-w-set-backdrop-in ss-w-fav-sheet", children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(FavouritesPanel, { controller, ui, sport, sports, onSportChange }) });
|
|
17094
|
+
}
|
|
17095
|
+
|
|
17096
|
+
// src/components/dashboard/v8/SentenceBuilder.tsx
|
|
17097
|
+
var import_react101 = require("react");
|
|
17098
|
+
var import_jsx_runtime140 = require("react/jsx-runtime");
|
|
16972
17099
|
var TOTALS = ["any", "3", "5", "10", "20", "50"];
|
|
16973
17100
|
var BASE_LEGS = [1, 2, 3, 4];
|
|
16974
17101
|
var isTotal = (v) => TOTALS.includes(v);
|
|
@@ -16993,8 +17120,8 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
16993
17120
|
const opening = openingGames(preset);
|
|
16994
17121
|
const gamesOptions = opening.options;
|
|
16995
17122
|
const marketOptions = usableMarkets(preset);
|
|
16996
|
-
const [fingerprint] = (0,
|
|
16997
|
-
const [saved] = (0,
|
|
17123
|
+
const [fingerprint] = (0, import_react101.useState)(() => JSON.stringify(preset));
|
|
17124
|
+
const [saved] = (0, import_react101.useState)(() => {
|
|
16998
17125
|
const kept = memory3?.savedView(sport);
|
|
16999
17126
|
return kept && kept.fingerprint === fingerprint ? kept : null;
|
|
17000
17127
|
});
|
|
@@ -17008,9 +17135,9 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
17008
17135
|
// The server never widens by itself: an all-games preset with no ids asks for it.
|
|
17009
17136
|
widen: opening.option ? opening.option.matchIds.length === 0 : preset.gamesScope === "all" && preset.matchIds.length === 0
|
|
17010
17137
|
};
|
|
17011
|
-
const [view, setView] = (0,
|
|
17012
|
-
const autoWidened = (0,
|
|
17013
|
-
const [widenedNote, setWidenedNote] = (0,
|
|
17138
|
+
const [view, setView] = (0, import_react101.useState)(() => saved?.view ?? openingView);
|
|
17139
|
+
const autoWidened = (0, import_react101.useRef)(false);
|
|
17140
|
+
const [widenedNote, setWidenedNote] = (0, import_react101.useState)(saved?.widenedNote ?? false);
|
|
17014
17141
|
const requestFor = (v) => ({
|
|
17015
17142
|
sport,
|
|
17016
17143
|
...v.marketKey !== null ? { marketKey: v.marketKey } : {},
|
|
@@ -17022,10 +17149,10 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
17022
17149
|
...operatorUserId ? { operatorUserId } : {},
|
|
17023
17150
|
...anonymousUserId ? { anonymousUserId } : {}
|
|
17024
17151
|
});
|
|
17025
|
-
const [first] = (0,
|
|
17152
|
+
const [first] = (0, import_react101.useState)(() => requestFor(view));
|
|
17026
17153
|
const { grid, status: status2, confirmed, request } = useBuilderGrid({ conversation, locale: ui.hostTag, memory: memory3, initial: first });
|
|
17027
|
-
const lastRequest = (0,
|
|
17028
|
-
(0,
|
|
17154
|
+
const lastRequest = (0, import_react101.useRef)(first);
|
|
17155
|
+
(0, import_react101.useEffect)(() => {
|
|
17029
17156
|
void request(lastRequest.current);
|
|
17030
17157
|
}, [request]);
|
|
17031
17158
|
const send = (req) => {
|
|
@@ -17058,14 +17185,14 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
17058
17185
|
const rows = ready && grid.status === "ok" ? legsOf(grid, sport) : null;
|
|
17059
17186
|
const rowSlip = rows ? guardLegsPreMatch(slip, rows, ui) : slip;
|
|
17060
17187
|
useNextKickoffRender(rows ? rows.map((l) => l.kickoffUtc) : []);
|
|
17061
|
-
const [startedNote, setStartedNote] = (0,
|
|
17188
|
+
const [startedNote, setStartedNote] = (0, import_react101.useState)(false);
|
|
17062
17189
|
const anyStarted = rows !== null && rows.some((l) => !preMatchOpen(l.kickoffUtc, Date.now()));
|
|
17063
|
-
(0,
|
|
17190
|
+
(0, import_react101.useEffect)(() => {
|
|
17064
17191
|
if (startedNote && status2 === "ready" && !anyStarted) setStartedNote(false);
|
|
17065
17192
|
}, [startedNote, status2, anyStarted]);
|
|
17066
17193
|
const market = rows?.[0]?.market;
|
|
17067
|
-
const [seen2, setSeen] = (0,
|
|
17068
|
-
(0,
|
|
17194
|
+
const [seen2, setSeen] = (0, import_react101.useState)(null);
|
|
17195
|
+
(0, import_react101.useEffect)(() => {
|
|
17069
17196
|
if (market) setSeen(market);
|
|
17070
17197
|
}, [market]);
|
|
17071
17198
|
const marketName = view.marketKey === null ? null : marketOptions?.find((m) => m.key === view.marketKey)?.label ?? market ?? seen2;
|
|
@@ -17078,14 +17205,14 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
17078
17205
|
const quotedAt = rows ? oldestQuote(rows) : null;
|
|
17079
17206
|
const combo = ready && grid.total !== null ? { sport, totalChosen: view.total, totalActual: grid.total } : void 0;
|
|
17080
17207
|
const canWiden = gamesOptions === null || allGames !== null;
|
|
17081
|
-
(0,
|
|
17208
|
+
(0, import_react101.useEffect)(() => {
|
|
17082
17209
|
if (!empty2 || !singles || widened || !canWiden || autoWidened.current) return;
|
|
17083
17210
|
autoWidened.current = true;
|
|
17084
17211
|
const next = { ...view, widen: true, matchIds: [], gamesId: allGames ? allGames.id : view.gamesId };
|
|
17085
17212
|
commit(next, true);
|
|
17086
17213
|
send(requestFor(next));
|
|
17087
17214
|
}, [empty2, singles, widened, canWiden, view]);
|
|
17088
|
-
(0,
|
|
17215
|
+
(0, import_react101.useEffect)(() => {
|
|
17089
17216
|
if (coolOff) onCoolOff?.(sport);
|
|
17090
17217
|
}, [coolOff, onCoolOff, sport]);
|
|
17091
17218
|
if (coolOff) return null;
|
|
@@ -17094,13 +17221,13 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
17094
17221
|
const nextWhen = nextAtMs !== null && nextAtMs > Date.now() ? kickoffText(ui, preset.nextGamesAtUtc) : null;
|
|
17095
17222
|
const phrase = preset.nextGamesAtUtc == null ? nextGames : null;
|
|
17096
17223
|
const mineGames = gamesOptions?.find((o) => o.id === view.gamesId)?.mine === true;
|
|
17097
|
-
return /* @__PURE__ */ (0,
|
|
17224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("section", { className: "ss-w-v8-sec ss-w-v8-builder", "data-testid": "v8-builder", "aria-busy": status2 === "loading" || void 0, children: conversation && paused ? /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("p", { className: "ss-w-v8-builder-note", "data-kind": "paused", children: nextWhen ? ui.v8PausedNext(nextWhen) : /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(import_jsx_runtime140.Fragment, { children: [
|
|
17098
17225
|
ui.v8Paused,
|
|
17099
|
-
phrase ? /* @__PURE__ */ (0,
|
|
17100
|
-
] }) }) : conversation ? /* @__PURE__ */ (0,
|
|
17101
|
-
marketOptions ? /* @__PURE__ */ (0,
|
|
17102
|
-
/* @__PURE__ */ (0,
|
|
17103
|
-
/* @__PURE__ */ (0,
|
|
17226
|
+
phrase ? /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "ss-w-v8-builder-next", "data-testid": "v8-next-games", children: phrase }) : null
|
|
17227
|
+
] }) }) : conversation ? /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(import_jsx_runtime140.Fragment, { children: [
|
|
17228
|
+
marketOptions ? /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "ss-w-v8-builder-ln", children: [
|
|
17229
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "ss-w-v8-builder-w", children: ui.v8BuilderShow }),
|
|
17230
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("div", { className: "ss-w-v8-slot", "data-mine": marketOptions.find((m) => m.key === view.marketKey)?.usual || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(
|
|
17104
17231
|
"select",
|
|
17105
17232
|
{
|
|
17106
17233
|
className: "ss-w-v8-select",
|
|
@@ -17111,18 +17238,18 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
17111
17238
|
if (picked !== view.marketKey) ask({ ...view, marketKey: picked });
|
|
17112
17239
|
},
|
|
17113
17240
|
children: [
|
|
17114
|
-
/* @__PURE__ */ (0,
|
|
17115
|
-
marketOptions.map((m) => /* @__PURE__ */ (0,
|
|
17241
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("option", { value: ALL_MARKETS, children: ui.v8AllMarkets }),
|
|
17242
|
+
marketOptions.map((m) => /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("option", { value: m.key, children: m.usual ? `${ui.v8UsualPrefix}${m.label}` : m.label }, m.key))
|
|
17116
17243
|
]
|
|
17117
17244
|
}
|
|
17118
17245
|
) })
|
|
17119
|
-
] }) : marketName ? /* @__PURE__ */ (0,
|
|
17120
|
-
/* @__PURE__ */ (0,
|
|
17121
|
-
/* @__PURE__ */ (0,
|
|
17246
|
+
] }) : marketName ? /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "ss-w-v8-builder-ln", children: [
|
|
17247
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "ss-w-v8-builder-w", children: ui.v8BuilderShow }),
|
|
17248
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "ss-w-v8-builder-market", children: marketName })
|
|
17122
17249
|
] }) : null,
|
|
17123
|
-
/* @__PURE__ */ (0,
|
|
17124
|
-
/* @__PURE__ */ (0,
|
|
17125
|
-
gamesOptions ? /* @__PURE__ */ (0,
|
|
17250
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "ss-w-v8-builder-ln", children: [
|
|
17251
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "ss-w-v8-builder-w", children: ui.v8BuilderIn }),
|
|
17252
|
+
gamesOptions ? /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("div", { className: "ss-w-v8-slot", "data-mine": mineGames || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
|
|
17126
17253
|
"select",
|
|
17127
17254
|
{
|
|
17128
17255
|
className: "ss-w-v8-select",
|
|
@@ -17132,16 +17259,16 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
17132
17259
|
const picked = gamesOptions.find((o) => o.id === e.target.value);
|
|
17133
17260
|
if (picked && picked.id !== view.gamesId) pickGames(picked);
|
|
17134
17261
|
},
|
|
17135
|
-
children: /* @__PURE__ */ (0,
|
|
17262
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(GamesOptions, { options: gamesOptions, ui })
|
|
17136
17263
|
}
|
|
17137
|
-
) }) : /* @__PURE__ */ (0,
|
|
17264
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("button", { type: "button", className: "ss-w-v8-builder-btn", "aria-pressed": view.widen, disabled: view.widen && !canNarrow, onClick: () => {
|
|
17138
17265
|
const next = { ...view, widen: canNarrow ? !view.widen : true, matchIds: canNarrow && view.widen && view.matchIds.length === 0 ? preset.matchIds : view.matchIds };
|
|
17139
17266
|
ask(next);
|
|
17140
17267
|
}, children: ui.v8UseAllGames })
|
|
17141
17268
|
] }),
|
|
17142
|
-
/* @__PURE__ */ (0,
|
|
17143
|
-
/* @__PURE__ */ (0,
|
|
17144
|
-
/* @__PURE__ */ (0,
|
|
17269
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "ss-w-v8-builder-ln", children: [
|
|
17270
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "ss-w-v8-builder-w", children: ui.v8BuilderAs }),
|
|
17271
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("div", { className: "ss-w-v8-builder-btns", role: "group", "aria-label": ui.v8BuilderAs, children: legButtons.map((n) => /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
|
|
17145
17272
|
"button",
|
|
17146
17273
|
{
|
|
17147
17274
|
type: "button",
|
|
@@ -17156,9 +17283,9 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
17156
17283
|
n
|
|
17157
17284
|
)) })
|
|
17158
17285
|
] }),
|
|
17159
|
-
view.legs > 1 ? /* @__PURE__ */ (0,
|
|
17160
|
-
/* @__PURE__ */ (0,
|
|
17161
|
-
/* @__PURE__ */ (0,
|
|
17286
|
+
view.legs > 1 ? /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "ss-w-v8-builder-ln ss-w-v8-builder-ln--total", children: [
|
|
17287
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { className: "ss-w-v8-builder-w", children: ui.v8BuilderTotal }),
|
|
17288
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("div", { className: "ss-w-v8-builder-btns", role: "group", "aria-label": ui.v8BuilderTotal, children: totals.map((t) => /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
|
|
17162
17289
|
"button",
|
|
17163
17290
|
{
|
|
17164
17291
|
type: "button",
|
|
@@ -17172,31 +17299,31 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
17172
17299
|
t
|
|
17173
17300
|
)) })
|
|
17174
17301
|
] }) : null,
|
|
17175
|
-
ready && singles && widenedNote && !empty2 ? /* @__PURE__ */ (0,
|
|
17176
|
-
ready && !widenedNote && !empty2 && preset.widenedForMarket === true && onOpeningChoice && view.marketKey !== null ? /* @__PURE__ */ (0,
|
|
17177
|
-
startedNote ? /* @__PURE__ */ (0,
|
|
17178
|
-
status2 === "loading" ? /* @__PURE__ */ (0,
|
|
17179
|
-
status2 === "error" ? /* @__PURE__ */ (0,
|
|
17180
|
-
/* @__PURE__ */ (0,
|
|
17181
|
-
/* @__PURE__ */ (0,
|
|
17302
|
+
ready && singles && widenedNote && !empty2 ? /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("p", { className: "ss-w-v8-builder-note", "data-kind": "widened", children: ui.v8SinglesWidened(marketName) }) : null,
|
|
17303
|
+
ready && !widenedNote && !empty2 && preset.widenedForMarket === true && onOpeningChoice && view.marketKey !== null ? /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("p", { className: "ss-w-v8-builder-note", children: ui.v8Widened }) : null,
|
|
17304
|
+
startedNote ? /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("p", { className: "ss-w-v8-builder-note", "data-kind": "started", role: "status", children: ui.slipStarted }) : null,
|
|
17305
|
+
status2 === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("p", { className: "ss-w-v8-builder-note", "data-kind": "loading", children: ui.v8BuilderLoading }) : null,
|
|
17306
|
+
status2 === "error" ? /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(import_jsx_runtime140.Fragment, { children: [
|
|
17307
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("p", { className: "ss-w-v8-builder-note", "data-kind": "error", children: ui.v8BuilderError }),
|
|
17308
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("button", { type: "button", className: "ss-w-v8-builder-btn", onClick: () => {
|
|
17182
17309
|
setStartedNote(false);
|
|
17183
17310
|
void request(lastRequest.current);
|
|
17184
17311
|
}, children: ui.v8BuilderRetry })
|
|
17185
17312
|
] }) : null,
|
|
17186
|
-
empty2 && singles && (widened || !canWiden) ? /* @__PURE__ */ (0,
|
|
17187
|
-
empty2 && !singles ? /* @__PURE__ */ (0,
|
|
17188
|
-
/* @__PURE__ */ (0,
|
|
17189
|
-
gamesOptions && allGames && !widened ? /* @__PURE__ */ (0,
|
|
17313
|
+
empty2 && singles && (widened || !canWiden) ? /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("p", { className: "ss-w-v8-builder-note", "data-kind": "no-prices", children: ui.v8NoPrices(marketName) }) : null,
|
|
17314
|
+
empty2 && !singles ? /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(import_jsx_runtime140.Fragment, { children: [
|
|
17315
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("p", { className: "ss-w-v8-builder-note", "data-kind": "miss", children: ui.v8Miss }),
|
|
17316
|
+
gamesOptions && allGames && !widened ? /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("button", { type: "button", className: "ss-w-v8-builder-btn", onClick: () => pickGames(allGames), children: ui.v8UseAllGames }) : null
|
|
17190
17317
|
] }) : null,
|
|
17191
|
-
rows && rows.length > 0 ? /* @__PURE__ */ (0,
|
|
17192
|
-
/* @__PURE__ */ (0,
|
|
17193
|
-
/* @__PURE__ */ (0,
|
|
17194
|
-
grid && grid.requestedLegs > 1 ? /* @__PURE__ */ (0,
|
|
17318
|
+
rows && rows.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(import_jsx_runtime140.Fragment, { children: [
|
|
17319
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "ss-w-v8-builder-rows", children: [
|
|
17320
|
+
/* @__PURE__ */ (0, import_jsx_runtime140.jsx)("ol", { className: "ss-w-combo-legs", role: "list", children: rows.map((leg) => /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(ComboLegRow, { leg, addToSlipEnabled: !!slip.onAddToSlip, ui, slip: rowSlip, hold: !confirmed, closed: !preMatchOpen(leg.kickoffUtc, Date.now()) }, leg.key)) }),
|
|
17321
|
+
grid && grid.requestedLegs > 1 ? /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(AddAllToSlipButton, { legs: rows, slip: rowSlip, ui, labels: { add: ui.v8AddAll, done: ui.allInSlip }, combo, sizeless: true, hold: !confirmed, onStartedGame: () => {
|
|
17195
17322
|
setStartedNote(true);
|
|
17196
17323
|
void request(lastRequest.current);
|
|
17197
17324
|
} }) : null
|
|
17198
17325
|
] }),
|
|
17199
|
-
quotedAt ? /* @__PURE__ */ (0,
|
|
17326
|
+
quotedAt ? /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("p", { className: "ss-w-v8-builder-note", "data-testid": "v8-asof", children: ui.v8PricesAsOf(fmtHhMm(quotedAt, ui.locale, clockOf(ui), ui.timeZone)) }) : null
|
|
17200
17327
|
] }) : null
|
|
17201
17328
|
] }) : null });
|
|
17202
17329
|
}
|
|
@@ -17204,25 +17331,25 @@ function GamesOptions({ options, ui }) {
|
|
|
17204
17331
|
const top = options.filter((o) => o.group !== "league" && o.group !== "game");
|
|
17205
17332
|
const leagues = options.filter((o) => o.group === "league");
|
|
17206
17333
|
const games = options.filter((o) => o.group === "game");
|
|
17207
|
-
return /* @__PURE__ */ (0,
|
|
17208
|
-
top.map((o) => /* @__PURE__ */ (0,
|
|
17209
|
-
leagues.length > 0 ? /* @__PURE__ */ (0,
|
|
17210
|
-
games.length > 0 ? /* @__PURE__ */ (0,
|
|
17334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(import_jsx_runtime140.Fragment, { children: [
|
|
17335
|
+
top.map((o) => /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("option", { value: o.id, children: o.label }, o.id)),
|
|
17336
|
+
leagues.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("optgroup", { label: ui.v8LeaguesGroup, children: leagues.map((o) => /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("option", { value: o.id, children: o.label }, o.id)) }) : null,
|
|
17337
|
+
games.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("optgroup", { label: ui.v8GamesGroup, children: games.map((o) => {
|
|
17211
17338
|
const at2 = kickoffText(ui, o.startsAtUtc);
|
|
17212
|
-
return /* @__PURE__ */ (0,
|
|
17339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("option", { value: o.id, children: at2 ? `${o.label} \xB7 ${at2}` : o.label }, o.id);
|
|
17213
17340
|
}) }) : null
|
|
17214
17341
|
] });
|
|
17215
17342
|
}
|
|
17216
17343
|
|
|
17217
17344
|
// src/components/BuilderPanel.tsx
|
|
17218
|
-
var
|
|
17345
|
+
var import_jsx_runtime141 = require("react/jsx-runtime");
|
|
17219
17346
|
function BuilderPanel({ options, sport, onSportChange, ui, slip, onCoolOff }) {
|
|
17220
17347
|
const ctx = usePersonalGreeting();
|
|
17221
17348
|
const scope = useSportScope();
|
|
17222
17349
|
const active = options.find((o) => o.sport === sport) ?? options[0];
|
|
17223
17350
|
if (!active) return null;
|
|
17224
|
-
return /* @__PURE__ */ (0,
|
|
17225
|
-
options.length > 1 ? /* @__PURE__ */ (0,
|
|
17351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("div", { className: "ss-w-mon-list ss-w-builder-tab", children: [
|
|
17352
|
+
options.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("div", { className: "ss-w-dash-sports", role: "group", "aria-label": ui.sportGroupLabel, children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
17226
17353
|
"button",
|
|
17227
17354
|
{
|
|
17228
17355
|
type: "button",
|
|
@@ -17233,7 +17360,7 @@ function BuilderPanel({ options, sport, onSportChange, ui, slip, onCoolOff }) {
|
|
|
17233
17360
|
},
|
|
17234
17361
|
o.sport
|
|
17235
17362
|
)) }) : null,
|
|
17236
|
-
/* @__PURE__ */ (0,
|
|
17363
|
+
/* @__PURE__ */ (0, import_jsx_runtime141.jsx)("div", { className: "ss-w-v8", children: /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
|
|
17237
17364
|
SentenceBuilder,
|
|
17238
17365
|
{
|
|
17239
17366
|
preset: active.preset,
|
|
@@ -17252,7 +17379,7 @@ function BuilderPanel({ options, sport, onSportChange, ui, slip, onCoolOff }) {
|
|
|
17252
17379
|
}
|
|
17253
17380
|
|
|
17254
17381
|
// src/components/Fixtures.tsx
|
|
17255
|
-
var
|
|
17382
|
+
var import_jsx_runtime142 = require("react/jsx-runtime");
|
|
17256
17383
|
function groupByRound(fixtures) {
|
|
17257
17384
|
const groups = [];
|
|
17258
17385
|
for (const fx of fixtures) {
|
|
@@ -17264,31 +17391,31 @@ function groupByRound(fixtures) {
|
|
|
17264
17391
|
}
|
|
17265
17392
|
function Fixtures({ fixtures, loading, ui }) {
|
|
17266
17393
|
if (fixtures.length === 0) {
|
|
17267
|
-
if (loading) return /* @__PURE__ */ (0,
|
|
17268
|
-
return /* @__PURE__ */ (0,
|
|
17394
|
+
if (loading) return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "ss-w-mon-list" });
|
|
17395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "ss-w-mon-empty", children: ui.clubFixturesEmpty });
|
|
17269
17396
|
}
|
|
17270
|
-
return /* @__PURE__ */ (0,
|
|
17271
|
-
group.round && /* @__PURE__ */ (0,
|
|
17397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "ss-w-mon-list", children: groupByRound(fixtures).map((group, gi) => /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { children: [
|
|
17398
|
+
group.round && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "ss-w-club-eyebrow", children: group.round }),
|
|
17272
17399
|
group.items.map((fx) => {
|
|
17273
17400
|
const played = fx.homeScore !== null && fx.awayScore !== null;
|
|
17274
17401
|
const kickoff = fx.matchDateTime ? ui.bettingKickoff(fx.matchDateTime) : null;
|
|
17275
|
-
return /* @__PURE__ */ (0,
|
|
17276
|
-
/* @__PURE__ */ (0,
|
|
17277
|
-
fx.competitionName && /* @__PURE__ */ (0,
|
|
17278
|
-
!played && kickoff && /* @__PURE__ */ (0,
|
|
17402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "ss-w-mon", children: [
|
|
17403
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "ss-w-mon-top", children: [
|
|
17404
|
+
fx.competitionName && /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-mon-comp", children: fx.competitionName }),
|
|
17405
|
+
!played && kickoff && /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("span", { className: "ss-w-mon-pill", children: [
|
|
17279
17406
|
kickoff.dayLabel,
|
|
17280
17407
|
" \xB7 ",
|
|
17281
17408
|
kickoff.time
|
|
17282
17409
|
] })
|
|
17283
17410
|
] }),
|
|
17284
|
-
/* @__PURE__ */ (0,
|
|
17285
|
-
/* @__PURE__ */ (0,
|
|
17286
|
-
played ? /* @__PURE__ */ (0,
|
|
17411
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "ss-w-mon-main", children: [
|
|
17412
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-mon-side", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-mon-name", children: fx.homeTeamName }) }),
|
|
17413
|
+
played ? /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("span", { className: "ss-w-mon-score", children: [
|
|
17287
17414
|
fx.homeScore,
|
|
17288
|
-
/* @__PURE__ */ (0,
|
|
17415
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("i", { children: "-" }),
|
|
17289
17416
|
fx.awayScore
|
|
17290
|
-
] }) : /* @__PURE__ */ (0,
|
|
17291
|
-
/* @__PURE__ */ (0,
|
|
17417
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-mon-vs", children: ui.venue.home }),
|
|
17418
|
+
/* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-mon-side ss-w-mon-side--away", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: "ss-w-mon-name", children: fx.awayTeamName }) })
|
|
17292
17419
|
] })
|
|
17293
17420
|
] }, fx.id);
|
|
17294
17421
|
})
|
|
@@ -17296,7 +17423,7 @@ function Fixtures({ fixtures, loading, ui }) {
|
|
|
17296
17423
|
}
|
|
17297
17424
|
|
|
17298
17425
|
// src/components/Standings.tsx
|
|
17299
|
-
var
|
|
17426
|
+
var import_jsx_runtime143 = require("react/jsx-runtime");
|
|
17300
17427
|
function groupByTable(rows) {
|
|
17301
17428
|
const groups = [];
|
|
17302
17429
|
for (const row of rows) {
|
|
@@ -17307,30 +17434,30 @@ function groupByTable(rows) {
|
|
|
17307
17434
|
return groups;
|
|
17308
17435
|
}
|
|
17309
17436
|
function Standings({ standings, loading, ui }) {
|
|
17310
|
-
if (standings === null && loading) return /* @__PURE__ */ (0,
|
|
17311
|
-
if (standings === null || standings.length === 0) return /* @__PURE__ */ (0,
|
|
17312
|
-
return /* @__PURE__ */ (0,
|
|
17313
|
-
group.table && /* @__PURE__ */ (0,
|
|
17314
|
-
/* @__PURE__ */ (0,
|
|
17315
|
-
/* @__PURE__ */ (0,
|
|
17316
|
-
/* @__PURE__ */ (0,
|
|
17317
|
-
/* @__PURE__ */ (0,
|
|
17318
|
-
/* @__PURE__ */ (0,
|
|
17319
|
-
/* @__PURE__ */ (0,
|
|
17320
|
-
/* @__PURE__ */ (0,
|
|
17321
|
-
/* @__PURE__ */ (0,
|
|
17322
|
-
/* @__PURE__ */ (0,
|
|
17323
|
-
/* @__PURE__ */ (0,
|
|
17437
|
+
if (standings === null && loading) return /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("div", { className: "ss-w-mon-list" });
|
|
17438
|
+
if (standings === null || standings.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("div", { className: "ss-w-mon-empty", children: ui.clubStandingsEmpty });
|
|
17439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("div", { className: "ss-w-mon-list", children: groupByTable(standings).map((group, gi) => /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("div", { className: "ss-w-table-wrap", children: [
|
|
17440
|
+
group.table && /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("div", { className: "ss-w-club-eyebrow", children: group.table }),
|
|
17441
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("table", { className: "ss-w-md-table", children: [
|
|
17442
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("tr", { children: [
|
|
17443
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("th", { children: "#" }),
|
|
17444
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("th", { children: ui.standingsColClub }),
|
|
17445
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("th", { children: ui.standingsColPlayed }),
|
|
17446
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("th", { children: ui.standingsColWon }),
|
|
17447
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("th", { children: ui.standingsColDrawn }),
|
|
17448
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("th", { children: ui.standingsColLost }),
|
|
17449
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("th", { children: ui.standingsColGoalDiff }),
|
|
17450
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("th", { children: ui.standingsColPoints })
|
|
17324
17451
|
] }) }),
|
|
17325
|
-
/* @__PURE__ */ (0,
|
|
17326
|
-
/* @__PURE__ */ (0,
|
|
17327
|
-
/* @__PURE__ */ (0,
|
|
17328
|
-
/* @__PURE__ */ (0,
|
|
17329
|
-
/* @__PURE__ */ (0,
|
|
17330
|
-
/* @__PURE__ */ (0,
|
|
17331
|
-
/* @__PURE__ */ (0,
|
|
17332
|
-
/* @__PURE__ */ (0,
|
|
17333
|
-
/* @__PURE__ */ (0,
|
|
17452
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("tbody", { children: group.items.map((row) => /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("tr", { children: [
|
|
17453
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("td", { children: row.position }),
|
|
17454
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("td", { children: row.teamName }),
|
|
17455
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("td", { children: row.playedGames }),
|
|
17456
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("td", { children: row.wins }),
|
|
17457
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("td", { children: row.draws }),
|
|
17458
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("td", { children: row.losses }),
|
|
17459
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("td", { children: row.goalDifference }),
|
|
17460
|
+
/* @__PURE__ */ (0, import_jsx_runtime143.jsx)("td", { children: row.points })
|
|
17334
17461
|
] }, row.teamId)) })
|
|
17335
17462
|
] })
|
|
17336
17463
|
] }, `${gi}-${group.table ?? "none"}`)) });
|
|
@@ -17387,7 +17514,7 @@ function statsEyebrow(ui, season, competition, matches) {
|
|
|
17387
17514
|
}
|
|
17388
17515
|
|
|
17389
17516
|
// src/components/SquadStats.tsx
|
|
17390
|
-
var
|
|
17517
|
+
var import_jsx_runtime144 = require("react/jsx-runtime");
|
|
17391
17518
|
function leader(stats, pick) {
|
|
17392
17519
|
let best = null;
|
|
17393
17520
|
for (const p of stats) {
|
|
@@ -17401,53 +17528,53 @@ function ratingClass(rating) {
|
|
|
17401
17528
|
return Number(rating.toFixed(1)) >= 7 ? "ss-w-sq-c36 ss-w-sq-rtg ss-w-pos-ink" : "ss-w-sq-c36 ss-w-sq-rtg";
|
|
17402
17529
|
}
|
|
17403
17530
|
function SquadStats({ stats, loading, ui, onSelectPlayer }) {
|
|
17404
|
-
if (stats === null && loading) return /* @__PURE__ */ (0,
|
|
17405
|
-
if (stats === null || stats.length === 0) return /* @__PURE__ */ (0,
|
|
17531
|
+
if (stats === null && loading) return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("div", { className: "ss-w-mon-list" });
|
|
17532
|
+
if (stats === null || stats.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("div", { className: "ss-w-mon-empty", children: ui.clubSquadStatsEmpty });
|
|
17406
17533
|
const scorer = leader(stats, (p) => p.goals);
|
|
17407
17534
|
const assister = leader(stats, (p) => p.assists);
|
|
17408
17535
|
const footer = [
|
|
17409
17536
|
scorer && ui.squadTopScorer(scorer.playerName, scorer.goals),
|
|
17410
17537
|
assister && ui.squadTopAssists(assister.playerName, assister.assists)
|
|
17411
17538
|
].filter((part) => !!part).join(" \xB7 ");
|
|
17412
|
-
return /* @__PURE__ */ (0,
|
|
17413
|
-
/* @__PURE__ */ (0,
|
|
17414
|
-
/* @__PURE__ */ (0,
|
|
17415
|
-
/* @__PURE__ */ (0,
|
|
17416
|
-
/* @__PURE__ */ (0,
|
|
17417
|
-
/* @__PURE__ */ (0,
|
|
17418
|
-
/* @__PURE__ */ (0,
|
|
17419
|
-
/* @__PURE__ */ (0,
|
|
17420
|
-
/* @__PURE__ */ (0,
|
|
17421
|
-
/* @__PURE__ */ (0,
|
|
17422
|
-
/* @__PURE__ */ (0,
|
|
17423
|
-
/* @__PURE__ */ (0,
|
|
17539
|
+
return /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("div", { className: "ss-w-mon-list ss-w-sq-stats", children: [
|
|
17540
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("div", { className: "ss-w-sq-card", children: [
|
|
17541
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("div", { className: "ss-w-sq-row ss-w-sq-head", "aria-hidden": "true", children: [
|
|
17542
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-name" }),
|
|
17543
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-pos", children: ui.statHeadPos }),
|
|
17544
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c30", children: ui.statColApps }),
|
|
17545
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c36", children: ui.statHeadMins }),
|
|
17546
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c20", children: ui.statHeadGoals }),
|
|
17547
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c20", children: ui.statHeadAssists }),
|
|
17548
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c20 ss-w-sq-yr", children: ui.statHeadYellow }),
|
|
17549
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c20 ss-w-sq-yr", children: ui.statHeadRed }),
|
|
17550
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c36", children: ui.statHeadRating })
|
|
17424
17551
|
] }),
|
|
17425
|
-
stats.map((p) => /* @__PURE__ */ (0,
|
|
17426
|
-
/* @__PURE__ */ (0,
|
|
17427
|
-
p.jerseyNumber !== null && /* @__PURE__ */ (0,
|
|
17428
|
-
/* @__PURE__ */ (0,
|
|
17552
|
+
stats.map((p) => /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("button", { type: "button", className: "ss-w-sq-row ss-w-sq-tap", onClick: () => onSelectPlayer(p.playerId), children: [
|
|
17553
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("span", { className: "ss-w-sq-player", children: [
|
|
17554
|
+
p.jerseyNumber !== null && /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-badge", children: p.jerseyNumber }),
|
|
17555
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-name ss-w-sq-name-1", children: p.playerName })
|
|
17429
17556
|
] }),
|
|
17430
|
-
/* @__PURE__ */ (0,
|
|
17431
|
-
/* @__PURE__ */ (0,
|
|
17432
|
-
/* @__PURE__ */ (0,
|
|
17433
|
-
/* @__PURE__ */ (0,
|
|
17434
|
-
/* @__PURE__ */ (0,
|
|
17435
|
-
/* @__PURE__ */ (0,
|
|
17436
|
-
/* @__PURE__ */ (0,
|
|
17437
|
-
/* @__PURE__ */ (0,
|
|
17557
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-pos", children: positionShort(ui, p.positionCode, p.positionName) }),
|
|
17558
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c30", children: p.appearances }),
|
|
17559
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c36", children: p.minutesPlayed }),
|
|
17560
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c20", children: p.goals }),
|
|
17561
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c20", children: p.assists }),
|
|
17562
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c20 ss-w-sq-yr", children: p.yellowCards }),
|
|
17563
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: "ss-w-sq-c20 ss-w-sq-yr", children: p.redCards }),
|
|
17564
|
+
/* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: ratingClass(p.averageRating), children: p.averageRating === null ? "\u2013" : formatFixed(p.averageRating, ui.locale, 1) })
|
|
17438
17565
|
] }, p.playerId))
|
|
17439
17566
|
] }),
|
|
17440
|
-
footer !== "" && /* @__PURE__ */ (0,
|
|
17567
|
+
footer !== "" && /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("div", { className: "ss-w-sq-foot", children: footer })
|
|
17441
17568
|
] });
|
|
17442
17569
|
}
|
|
17443
17570
|
|
|
17444
17571
|
// src/components/Squad.tsx
|
|
17445
|
-
var
|
|
17572
|
+
var import_jsx_runtime145 = require("react/jsx-runtime");
|
|
17446
17573
|
function Squad({ squad, loading, ui, view, onToggleView, stats, statsLoading, seasonName = null, competitionName = null, matchesPlayed = null, onSelectPlayer }) {
|
|
17447
17574
|
const eyebrow = view === "stats" ? statsEyebrow(ui, seasonName, competitionName, matchesPlayed) : null;
|
|
17448
|
-
const toggle = /* @__PURE__ */ (0,
|
|
17449
|
-
eyebrow !== null && /* @__PURE__ */ (0,
|
|
17450
|
-
/* @__PURE__ */ (0,
|
|
17575
|
+
const toggle = /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("div", { className: "ss-w-sq-bar", children: [
|
|
17576
|
+
eyebrow !== null && /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { className: "ss-w-sq-eyebrow", children: eyebrow }),
|
|
17577
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { className: "ss-w-sq-seg", role: "group", children: ["roster", "stats"].map((v) => /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
|
|
17451
17578
|
"button",
|
|
17452
17579
|
{
|
|
17453
17580
|
type: "button",
|
|
@@ -17462,45 +17589,45 @@ function Squad({ squad, loading, ui, view, onToggleView, stats, statsLoading, se
|
|
|
17462
17589
|
)) })
|
|
17463
17590
|
] });
|
|
17464
17591
|
if (view === "stats") {
|
|
17465
|
-
return /* @__PURE__ */ (0,
|
|
17592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(import_jsx_runtime145.Fragment, { children: [
|
|
17466
17593
|
toggle,
|
|
17467
|
-
/* @__PURE__ */ (0,
|
|
17594
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)(SquadStats, { stats, loading: statsLoading, ui, onSelectPlayer })
|
|
17468
17595
|
] });
|
|
17469
17596
|
}
|
|
17470
|
-
if (squad === null && loading) return /* @__PURE__ */ (0,
|
|
17597
|
+
if (squad === null && loading) return /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(import_jsx_runtime145.Fragment, { children: [
|
|
17471
17598
|
toggle,
|
|
17472
|
-
/* @__PURE__ */ (0,
|
|
17599
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { className: "ss-w-mon-list" })
|
|
17473
17600
|
] });
|
|
17474
|
-
if (squad === null || squad.length === 0) return /* @__PURE__ */ (0,
|
|
17601
|
+
if (squad === null || squad.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(import_jsx_runtime145.Fragment, { children: [
|
|
17475
17602
|
toggle,
|
|
17476
|
-
/* @__PURE__ */ (0,
|
|
17603
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { className: "ss-w-mon-empty", children: ui.clubSquadEmpty })
|
|
17477
17604
|
] });
|
|
17478
|
-
return /* @__PURE__ */ (0,
|
|
17605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(import_jsx_runtime145.Fragment, { children: [
|
|
17479
17606
|
toggle,
|
|
17480
|
-
/* @__PURE__ */ (0,
|
|
17481
|
-
group.positionName && /* @__PURE__ */ (0,
|
|
17482
|
-
group.items.map((p) => /* @__PURE__ */ (0,
|
|
17483
|
-
/* @__PURE__ */ (0,
|
|
17484
|
-
/* @__PURE__ */ (0,
|
|
17607
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { className: "ss-w-mon-list", children: groupByPosition(squad).map((group, gi) => /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("div", { children: [
|
|
17608
|
+
group.positionName && /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { className: "ss-w-club-eyebrow", children: positionLabel(ui, group.positionName) }),
|
|
17609
|
+
group.items.map((p) => /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("button", { type: "button", className: "ss-w-sq-row ss-w-sq-tap", onClick: () => onSelectPlayer(p.playerId), children: [
|
|
17610
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)("span", { className: "ss-w-sq-num", children: p.jerseyNumber ?? "" }),
|
|
17611
|
+
/* @__PURE__ */ (0, import_jsx_runtime145.jsx)("span", { className: "ss-w-sq-name", children: p.playerName })
|
|
17485
17612
|
] }, p.playerId))
|
|
17486
17613
|
] }, `${gi}-${group.positionName ?? "none"}`)) })
|
|
17487
17614
|
] });
|
|
17488
17615
|
}
|
|
17489
17616
|
|
|
17490
17617
|
// src/components/PlayerPhoto.tsx
|
|
17491
|
-
var
|
|
17492
|
-
var
|
|
17618
|
+
var import_react102 = require("react");
|
|
17619
|
+
var import_jsx_runtime146 = require("react/jsx-runtime");
|
|
17493
17620
|
function PlayerPhoto({ photoUrl, jerseyNumber, size }) {
|
|
17494
|
-
const [failed, setFailed] = (0,
|
|
17621
|
+
const [failed, setFailed] = (0, import_react102.useState)(false);
|
|
17495
17622
|
const box = { width: size, height: size };
|
|
17496
17623
|
if (photoUrl && !failed) {
|
|
17497
|
-
return /* @__PURE__ */ (0,
|
|
17624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("img", { className: "ss-w-pd-photo", style: box, src: photoUrl, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
17498
17625
|
}
|
|
17499
|
-
return /* @__PURE__ */ (0,
|
|
17626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("span", { className: "ss-w-pd-photo ss-w-pd-avatar", style: { ...box, fontSize: Math.round(size * 0.35) }, "aria-hidden": "true", children: jerseyNumber ?? "" });
|
|
17500
17627
|
}
|
|
17501
17628
|
|
|
17502
17629
|
// src/components/MiniPitch.tsx
|
|
17503
|
-
var
|
|
17630
|
+
var import_jsx_runtime147 = require("react/jsx-runtime");
|
|
17504
17631
|
var SPOT = {
|
|
17505
17632
|
GK: [50, 90],
|
|
17506
17633
|
CB: [50, 75],
|
|
@@ -17522,12 +17649,12 @@ var SPOT = {
|
|
|
17522
17649
|
function MiniPitch({ positionCode }) {
|
|
17523
17650
|
const spot = SPOT[positionCode?.trim().toUpperCase() ?? ""];
|
|
17524
17651
|
if (spot === void 0) return null;
|
|
17525
|
-
return /* @__PURE__ */ (0,
|
|
17652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "ss-w-pd-pitch", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "ss-w-pd-pitch-dot", style: { left: `${spot[0]}%`, top: `${spot[1]}%` } }) });
|
|
17526
17653
|
}
|
|
17527
17654
|
|
|
17528
17655
|
// src/components/PerformanceBars.tsx
|
|
17529
|
-
var
|
|
17530
|
-
var
|
|
17656
|
+
var import_react103 = require("react");
|
|
17657
|
+
var import_jsx_runtime148 = require("react/jsx-runtime");
|
|
17531
17658
|
var GROUPS = ["shooting", "passing", "possession", "defending"];
|
|
17532
17659
|
function finite4(v) {
|
|
17533
17660
|
return typeof v === "number" && Number.isFinite(v) ? v : null;
|
|
@@ -17572,40 +17699,40 @@ function unrankedLine(ui, reason) {
|
|
|
17572
17699
|
}
|
|
17573
17700
|
}
|
|
17574
17701
|
function PerformanceBars({ performance, competitionName, strings }) {
|
|
17575
|
-
const [mode, setMode] = (0,
|
|
17702
|
+
const [mode, setMode] = (0, import_react103.useState)("total");
|
|
17576
17703
|
const labelled = performance.metrics.filter((m) => Object.prototype.hasOwnProperty.call(strings.perfMetric, m.key));
|
|
17577
17704
|
if (!labelled.some((m) => valueOf(m, "total") !== null || valueOf(m, "per90") !== null)) return null;
|
|
17578
17705
|
const subtitle = !performance.ranked ? unrankedLine(strings, performance.unrankedReason) : competitionName ? strings.perfRankedAgainst(competitionName, performance.positionGroup) : null;
|
|
17579
17706
|
const cards = GROUPS.map((g) => {
|
|
17580
17707
|
const rows = labelled.filter((m) => m.group === g && valueOf(m, mode) !== null);
|
|
17581
17708
|
if (rows.length === 0) return null;
|
|
17582
|
-
return /* @__PURE__ */ (0,
|
|
17583
|
-
/* @__PURE__ */ (0,
|
|
17709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { className: "ss-w-pd-card ss-w-pd-perf-card", children: [
|
|
17710
|
+
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { className: "ss-w-pd-perf-group", children: groupTitle(strings, g) }),
|
|
17584
17711
|
rows.map((m) => {
|
|
17585
17712
|
const v = valueOf(m, mode);
|
|
17586
17713
|
const rank2 = performance.ranked ? rankOf(m, mode) : null;
|
|
17587
|
-
return /* @__PURE__ */ (0,
|
|
17588
|
-
/* @__PURE__ */ (0,
|
|
17589
|
-
/* @__PURE__ */ (0,
|
|
17590
|
-
/* @__PURE__ */ (0,
|
|
17714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { className: "ss-w-pd-bar-row", children: [
|
|
17715
|
+
/* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { className: "ss-w-pd-bar-top", children: [
|
|
17716
|
+
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)("span", { className: "ss-w-pd-bar-label", children: strings.perfMetric[m.key] }),
|
|
17717
|
+
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)("span", { className: "ss-w-pd-bar-value", children: format(m, v, mode, strings.locale) })
|
|
17591
17718
|
] }),
|
|
17592
|
-
rank2 !== null && /* @__PURE__ */ (0,
|
|
17719
|
+
rank2 !== null && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { className: "ss-w-pd-track", children: /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { className: `ss-w-pd-fill ss-w-pd-fill--${band(rank2)}`, style: { width: `${rank2}%` } }) })
|
|
17593
17720
|
] }, m.key);
|
|
17594
17721
|
})
|
|
17595
17722
|
] }, g);
|
|
17596
17723
|
});
|
|
17597
|
-
return /* @__PURE__ */ (0,
|
|
17598
|
-
/* @__PURE__ */ (0,
|
|
17599
|
-
/* @__PURE__ */ (0,
|
|
17600
|
-
/* @__PURE__ */ (0,
|
|
17724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { children: [
|
|
17725
|
+
/* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { className: "ss-w-pd-perf-head", children: [
|
|
17726
|
+
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { className: "ss-w-pd-eyebrow", children: strings.perfTitle }),
|
|
17727
|
+
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { className: "ss-w-pd-seg", role: "group", children: ["total", "per90"].map((m) => /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("button", { type: "button", className: "ss-w-pd-seg-btn", "aria-pressed": mode === m, onClick: () => setMode(m), children: m === "total" ? strings.perfTotal : strings.perfPer90 }, m)) })
|
|
17601
17728
|
] }),
|
|
17602
|
-
subtitle !== null && /* @__PURE__ */ (0,
|
|
17603
|
-
/* @__PURE__ */ (0,
|
|
17729
|
+
subtitle !== null && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { className: "ss-w-pd-perf-sub", children: subtitle }),
|
|
17730
|
+
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { className: "ss-w-pd-perf-cards", children: cards })
|
|
17604
17731
|
] });
|
|
17605
17732
|
}
|
|
17606
17733
|
|
|
17607
17734
|
// src/components/PlayerDetail.tsx
|
|
17608
|
-
var
|
|
17735
|
+
var import_jsx_runtime149 = require("react/jsx-runtime");
|
|
17609
17736
|
var DASH = "\u2014";
|
|
17610
17737
|
function ageFrom(dobMs) {
|
|
17611
17738
|
if (dobMs === null) return DASH;
|
|
@@ -17625,16 +17752,16 @@ function ratingTone(rounded) {
|
|
|
17625
17752
|
return "neg";
|
|
17626
17753
|
}
|
|
17627
17754
|
function Bio({ label, value }) {
|
|
17628
|
-
return /* @__PURE__ */ (0,
|
|
17629
|
-
/* @__PURE__ */ (0,
|
|
17755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-pd-bio-item", children: [
|
|
17756
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)("span", { className: "ss-w-pd-faint", children: label }),
|
|
17630
17757
|
" ",
|
|
17631
|
-
/* @__PURE__ */ (0,
|
|
17758
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)("span", { children: value })
|
|
17632
17759
|
] });
|
|
17633
17760
|
}
|
|
17634
17761
|
function Tile({ label, value, pos }) {
|
|
17635
|
-
return /* @__PURE__ */ (0,
|
|
17636
|
-
/* @__PURE__ */ (0,
|
|
17637
|
-
/* @__PURE__ */ (0,
|
|
17762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-pd-tile", children: [
|
|
17763
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-tile-label", children: label }),
|
|
17764
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: pos ? "ss-w-pd-tile-value ss-w-pd-pos-ink" : "ss-w-pd-tile-value", children: value })
|
|
17638
17765
|
] });
|
|
17639
17766
|
}
|
|
17640
17767
|
function AvailabilityCard({ ui, next, availability }) {
|
|
@@ -17650,12 +17777,12 @@ function AvailabilityCard({ ui, next, availability }) {
|
|
|
17650
17777
|
pill = availability.status === "injured" ? { text: ui.availabilityInjured, tone: "neg" } : availability.status === "suspended" ? { text: ui.availabilitySuspended, tone: "warn" } : { text: ui.availabilityUnavailable, tone: "warn" };
|
|
17651
17778
|
}
|
|
17652
17779
|
}
|
|
17653
|
-
return /* @__PURE__ */ (0,
|
|
17654
|
-
/* @__PURE__ */ (0,
|
|
17655
|
-
next !== null && /* @__PURE__ */ (0,
|
|
17656
|
-
note !== null && /* @__PURE__ */ (0,
|
|
17780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-pd-card ss-w-pd-avail", children: [
|
|
17781
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-pd-avail-text", children: [
|
|
17782
|
+
next !== null && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-avail-next", children: ui.availabilityNext(next.opponentName, next.isHome, validMs(next.kickoffUnixMs)) }),
|
|
17783
|
+
note !== null && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-avail-note", children: note })
|
|
17657
17784
|
] }),
|
|
17658
|
-
pill !== null && /* @__PURE__ */ (0,
|
|
17785
|
+
pill !== null && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: `ss-w-pd-pill ss-w-pd-pill--${pill.tone}`, children: pill.text })
|
|
17659
17786
|
] });
|
|
17660
17787
|
}
|
|
17661
17788
|
function MatchRow({ ui, row }) {
|
|
@@ -17669,28 +17796,28 @@ function MatchRow({ ui, row }) {
|
|
|
17669
17796
|
const sub = [`${ui.resultLetter[row.result]} ${row.goalsFor}\u2013${row.goalsAgainst}`, `${row.minutes}\u2032`, ...extras].join(" \xB7 ");
|
|
17670
17797
|
const rating = typeof row.rating === "number" && Number.isFinite(row.rating) ? Math.round(row.rating * 10) / 10 : null;
|
|
17671
17798
|
const pillTone = row.result === "W" ? "pos" : row.result === "L" ? "neg" : "draw";
|
|
17672
|
-
return /* @__PURE__ */ (0,
|
|
17673
|
-
/* @__PURE__ */ (0,
|
|
17674
|
-
/* @__PURE__ */ (0,
|
|
17675
|
-
/* @__PURE__ */ (0,
|
|
17676
|
-
/* @__PURE__ */ (0,
|
|
17799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-pd-match", children: [
|
|
17800
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-match-date", children: date === null ? "" : ui.logShortDate(date) }),
|
|
17801
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-pd-match-main", children: [
|
|
17802
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-match-opp", children: ui.matchLogOpponent(row.opponentName, row.isHome) }),
|
|
17803
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-match-sub", children: sub })
|
|
17677
17804
|
] }),
|
|
17678
|
-
/* @__PURE__ */ (0,
|
|
17679
|
-
rating === null ? /* @__PURE__ */ (0,
|
|
17805
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: `ss-w-pd-pill ss-w-pd-pill--${pillTone}`, children: ui.resultLetter[row.result] }),
|
|
17806
|
+
rating === null ? /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-chip-empty" }) : /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: `ss-w-pd-chip ss-w-pd-chip--${ratingTone(rating)}`, children: formatFixed(rating, ui.locale, 1) })
|
|
17680
17807
|
] });
|
|
17681
17808
|
}
|
|
17682
17809
|
function PlayerDetail({ detail, loading, ui, seasonName, onClose }) {
|
|
17683
|
-
const back = /* @__PURE__ */ (0,
|
|
17684
|
-
/* @__PURE__ */ (0,
|
|
17810
|
+
const back = /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("button", { type: "button", className: "ss-w-pd-back", onClick: onClose, children: [
|
|
17811
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("path", { d: "M15 18l-6-6 6-6" }) }),
|
|
17685
17812
|
ui.clubPlayerBack
|
|
17686
17813
|
] });
|
|
17687
17814
|
if (detail === null) {
|
|
17688
|
-
return loading ? /* @__PURE__ */ (0,
|
|
17689
|
-
/* @__PURE__ */ (0,
|
|
17690
|
-
/* @__PURE__ */ (0,
|
|
17691
|
-
] }) : /* @__PURE__ */ (0,
|
|
17692
|
-
/* @__PURE__ */ (0,
|
|
17693
|
-
/* @__PURE__ */ (0,
|
|
17815
|
+
return loading ? /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(import_jsx_runtime149.Fragment, { children: [
|
|
17816
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-bar", children: back }),
|
|
17817
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-mon-list" })
|
|
17818
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(import_jsx_runtime149.Fragment, { children: [
|
|
17819
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-bar", children: back }),
|
|
17820
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-mon-empty", children: ui.clubPlayerDetailEmpty })
|
|
17694
17821
|
] });
|
|
17695
17822
|
}
|
|
17696
17823
|
const s = detail.seasonStats;
|
|
@@ -17703,163 +17830,74 @@ function PlayerDetail({ detail, loading, ui, seasonName, onClose }) {
|
|
|
17703
17830
|
const next = detail.nextFixture ?? null;
|
|
17704
17831
|
const availability = detail.availability ?? null;
|
|
17705
17832
|
const log = detail.matchLog ?? [];
|
|
17706
|
-
return /* @__PURE__ */ (0,
|
|
17707
|
-
/* @__PURE__ */ (0,
|
|
17708
|
-
/* @__PURE__ */ (0,
|
|
17709
|
-
/* @__PURE__ */ (0,
|
|
17710
|
-
/* @__PURE__ */ (0,
|
|
17711
|
-
/* @__PURE__ */ (0,
|
|
17712
|
-
/* @__PURE__ */ (0,
|
|
17713
|
-
subLine !== "" && /* @__PURE__ */ (0,
|
|
17714
|
-
/* @__PURE__ */ (0,
|
|
17715
|
-
/* @__PURE__ */ (0,
|
|
17716
|
-
/* @__PURE__ */ (0,
|
|
17717
|
-
foot !== null && /* @__PURE__ */ (0,
|
|
17718
|
-
/* @__PURE__ */ (0,
|
|
17833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(import_jsx_runtime149.Fragment, { children: [
|
|
17834
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-bar", children: back }),
|
|
17835
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-mon-list ss-w-pd-list", children: [
|
|
17836
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-pd-card ss-w-pd-profile", children: [
|
|
17837
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(PlayerPhoto, { photoUrl: detail.photoUrl, jerseyNumber: detail.jerseyNumber, size: 52 }, detail.photoUrl ?? ""),
|
|
17838
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-pd-profile-main", children: [
|
|
17839
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-name", children: detail.playerName }),
|
|
17840
|
+
subLine !== "" && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-sub", children: subLine }),
|
|
17841
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-pd-bio", children: [
|
|
17842
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Bio, { label: ui.detailAge, value: ageFrom(detail.dateOfBirthUnixMs) }),
|
|
17843
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Bio, { label: ui.detailHeight, value: detail.heightCm === null ? DASH : `${detail.heightCm} cm` }),
|
|
17844
|
+
foot !== null && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Bio, { label: ui.detailFoot, value: foot }),
|
|
17845
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Bio, { label: ui.detailNatShort, value: detail.nationality ?? DASH })
|
|
17719
17846
|
] })
|
|
17720
17847
|
] }),
|
|
17721
|
-
/* @__PURE__ */ (0,
|
|
17848
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(MiniPitch, { positionCode: detail.positionCode })
|
|
17722
17849
|
] }),
|
|
17723
|
-
(next !== null || availability !== null) && /* @__PURE__ */ (0,
|
|
17724
|
-
/* @__PURE__ */ (0,
|
|
17725
|
-
eyebrow !== null && /* @__PURE__ */ (0,
|
|
17726
|
-
/* @__PURE__ */ (0,
|
|
17727
|
-
/* @__PURE__ */ (0,
|
|
17728
|
-
/* @__PURE__ */ (0,
|
|
17729
|
-
typeof s.starts === "number" && /* @__PURE__ */ (0,
|
|
17730
|
-
/* @__PURE__ */ (0,
|
|
17731
|
-
/* @__PURE__ */ (0,
|
|
17732
|
-
rating !== null && /* @__PURE__ */ (0,
|
|
17733
|
-
/* @__PURE__ */ (0,
|
|
17734
|
-
/* @__PURE__ */ (0,
|
|
17850
|
+
(next !== null || availability !== null) && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(AvailabilityCard, { ui, next, availability }),
|
|
17851
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { children: [
|
|
17852
|
+
eyebrow !== null && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-eyebrow ss-w-pd-eyebrow--block", children: eyebrow }),
|
|
17853
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "ss-w-pd-tiles", children: [
|
|
17854
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Tile, { label: ui.statColGoals, value: String(s.goals) }),
|
|
17855
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Tile, { label: ui.statColAssists, value: String(s.assists) }),
|
|
17856
|
+
typeof s.starts === "number" && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Tile, { label: ui.detailStarted, value: String(s.starts) }),
|
|
17857
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Tile, { label: ui.detailMatches, value: String(s.appearances) }),
|
|
17858
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Tile, { label: ui.statColMinutes, value: String(s.minutesPlayed) }),
|
|
17859
|
+
rating !== null && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Tile, { label: ui.statColRating, value: formatFixed(rating, ui.locale, 2), pos: Math.round(rating * 100) / 100 >= 7 }),
|
|
17860
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Tile, { label: ui.detailYellows, value: String(s.yellowCards) }),
|
|
17861
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Tile, { label: ui.detailReds, value: String(s.redCards) })
|
|
17735
17862
|
] })
|
|
17736
17863
|
] }),
|
|
17737
|
-
detail.performance != null && /* @__PURE__ */ (0,
|
|
17738
|
-
log.length > 0 && /* @__PURE__ */ (0,
|
|
17739
|
-
/* @__PURE__ */ (0,
|
|
17740
|
-
/* @__PURE__ */ (0,
|
|
17864
|
+
detail.performance != null && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(PerformanceBars, { performance: detail.performance, competitionName: competition, strings: ui }),
|
|
17865
|
+
log.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { children: [
|
|
17866
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-eyebrow ss-w-pd-eyebrow--block", children: ui.matchLogTitle }),
|
|
17867
|
+
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "ss-w-pd-card ss-w-pd-log", children: log.map((row) => /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(MatchRow, { ui, row }, row.matchId)) })
|
|
17741
17868
|
] })
|
|
17742
17869
|
] })
|
|
17743
17870
|
] });
|
|
17744
17871
|
}
|
|
17745
17872
|
|
|
17746
|
-
// src/components/PresetTools.tsx
|
|
17747
|
-
var import_react103 = require("react");
|
|
17748
|
-
var import_jsx_runtime148 = require("react/jsx-runtime");
|
|
17749
|
-
function PresetToolModal({ title, closeLabel, onClose, children, footer, className }) {
|
|
17750
|
-
const { dialogRef, onKeyDown } = useModalDialog(onClose, { restoreFocus: false });
|
|
17751
|
-
const titleId = (0, import_react103.useId)();
|
|
17752
|
-
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { className: className ? `ss-w-tool-backdrop ${className}` : "ss-w-tool-backdrop", children: /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { ref: dialogRef, className: "ss-w-tool", role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, tabIndex: -1, onKeyDown, children: [
|
|
17753
|
-
/* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { className: "ss-w-tool-head", children: [
|
|
17754
|
-
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)("h2", { id: titleId, className: "ss-w-tool-title", children: title }),
|
|
17755
|
-
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)("button", { type: "button", className: "ss-w-tool-close", "aria-label": closeLabel, onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(CloseIcon, {}) })
|
|
17756
|
-
] }),
|
|
17757
|
-
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { className: "ss-w-tool-body", children }),
|
|
17758
|
-
footer ? /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { className: "ss-w-tool-foot", children: footer }) : null
|
|
17759
|
-
] }) });
|
|
17760
|
-
}
|
|
17761
|
-
function SendButton({ label, display, disabled, onClick }) {
|
|
17762
|
-
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("button", { type: "button", className: "ss-w-tool-send", "aria-label": `${label}: ${display}`, disabled, onClick, children: label });
|
|
17763
|
-
}
|
|
17764
|
-
function PickList({ picks, formatKickoff }) {
|
|
17765
|
-
const { oddsFormat } = useOddsSettings();
|
|
17766
|
-
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("ul", { className: "ss-w-tool-picks", role: "list", children: picks.map((p) => /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("li", { className: "ss-w-tool-pick", children: [
|
|
17767
|
-
/* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("span", { className: "ss-w-tool-pick-match", children: [
|
|
17768
|
-
p.homeTeamName,
|
|
17769
|
-
" \u2013 ",
|
|
17770
|
-
p.awayTeamName
|
|
17771
|
-
] }),
|
|
17772
|
-
/* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("span", { className: "ss-w-tool-pick-sel", children: [
|
|
17773
|
-
p.marketLabel,
|
|
17774
|
-
": ",
|
|
17775
|
-
p.selectionLabel,
|
|
17776
|
-
p.line ? ` ${p.line}` : ""
|
|
17777
|
-
] }),
|
|
17778
|
-
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)("span", { className: "ss-w-tool-pick-kick", children: formatKickoff(p.kickoffUtc) }),
|
|
17779
|
-
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)("span", { className: "ss-w-tool-pick-price", children: formatOdds(p.priceFormats, oddsFormat) })
|
|
17780
|
-
] }, p.matchOddsId)) });
|
|
17781
|
-
}
|
|
17782
|
-
function ComboPreview({ cell: cell2, formatKickoff }) {
|
|
17783
|
-
const { oddsFormat } = useOddsSettings();
|
|
17784
|
-
return /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)(import_jsx_runtime148.Fragment, { children: [
|
|
17785
|
-
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)(PickList, { picks: cell2.combo.legs, formatKickoff }),
|
|
17786
|
-
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { className: "ss-w-tool-math", children: oddsFormat === "decimal" ? cell2.combo.multiplication : formatOdds(cell2.combo.totalFormats, oddsFormat) })
|
|
17787
|
-
] });
|
|
17788
|
-
}
|
|
17789
|
-
function Unavailable({ text: text2 }) {
|
|
17790
|
-
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("p", { className: "ss-w-tool-unavailable", children: text2 });
|
|
17791
|
-
}
|
|
17792
|
-
var textOf = (options, value, format2) => {
|
|
17793
|
-
const o = options.find((x) => samePrice(x.value, value));
|
|
17794
|
-
return o ? formatOdds(o.formats, format2) : "";
|
|
17795
|
-
};
|
|
17796
|
-
function BuildComboTool({ grid, strings, streaming, formatKickoff, initialTotal, initialLegs, onSend, onClose }) {
|
|
17797
|
-
const { oddsFormat } = useOddsSettings();
|
|
17798
|
-
const totalOptions = comboTotals(grid);
|
|
17799
|
-
const totals = totalOptions.map((o) => o.value);
|
|
17800
|
-
const legChoices = comboLegChoices(grid);
|
|
17801
|
-
const [total, setTotal] = (0, import_react103.useState)(() => nearest(totals, initialTotal));
|
|
17802
|
-
const [legs, setLegs] = (0, import_react103.useState)(() => legsForTotal(grid, nearest(totals, initialTotal), clampLegs(legChoices, initialLegs)));
|
|
17803
|
-
const [announcement, setAnnouncement] = (0, import_react103.useState)("");
|
|
17804
|
-
const cell2 = findCombo(grid, total, legs);
|
|
17805
|
-
const minLegs = legChoices[0] ?? legs;
|
|
17806
|
-
const maxLegs = legChoices[legChoices.length - 1] ?? legs;
|
|
17807
|
-
const display = strings.comboDisplay(legs, textOf(totalOptions, total, oddsFormat));
|
|
17808
|
-
const choose = (nextTotal, nextLegs) => {
|
|
17809
|
-
setTotal(nextTotal);
|
|
17810
|
-
setLegs(nextLegs);
|
|
17811
|
-
const d = strings.comboDisplay(nextLegs, textOf(totalOptions, nextTotal, oddsFormat));
|
|
17812
|
-
setAnnouncement(findCombo(grid, nextTotal, nextLegs) ? d : `${d}. ${strings.unavailable}`);
|
|
17813
|
-
};
|
|
17814
|
-
const footer = /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(SendButton, { label: strings.send, display, disabled: !cell2 || streaming, onClick: () => {
|
|
17815
|
-
if (cell2) onSend(comboAsk(cell2, strings, oddsFormat));
|
|
17816
|
-
} });
|
|
17817
|
-
return /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)(PresetToolModal, { title: strings.buildCombo, closeLabel: strings.close, onClose, footer, children: [
|
|
17818
|
-
/* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { className: "ss-w-tool-section", role: "group", "aria-label": strings.totalLabel, children: [
|
|
17819
|
-
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)("span", { className: "ss-w-tool-label", "aria-hidden": "true", children: strings.totalLabel }),
|
|
17820
|
-
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { className: "ss-w-tool-chips", children: totalOptions.map((o) => /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("button", { type: "button", className: "ss-w-tool-chip", "aria-pressed": samePrice(o.value, total), onClick: () => choose(o.value, samePrice(o.value, total) ? legs : legsForTotal(grid, o.value, legs)), children: formatOdds(o.formats, oddsFormat) }, o.key)) })
|
|
17821
|
-
] }),
|
|
17822
|
-
/* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { className: "ss-w-tool-section", role: "group", "aria-label": strings.matchesLabel, children: [
|
|
17823
|
-
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)("span", { className: "ss-w-tool-label", "aria-hidden": "true", children: strings.matchesLabel }),
|
|
17824
|
-
/* @__PURE__ */ (0, import_jsx_runtime148.jsxs)("div", { className: "ss-w-tool-stepper", children: [
|
|
17825
|
-
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)("button", { type: "button", className: "ss-w-tool-step", "aria-label": strings.fewerMatches, disabled: legs <= minLegs, onClick: () => choose(total, legs - 1), children: "\u2212" }),
|
|
17826
|
-
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)("span", { className: "ss-w-tool-count", children: legs }),
|
|
17827
|
-
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)("button", { type: "button", className: "ss-w-tool-step", "aria-label": strings.moreMatches, disabled: legs >= maxLegs, onClick: () => choose(total, legs + 1), children: "+" })
|
|
17828
|
-
] })
|
|
17829
|
-
] }),
|
|
17830
|
-
cell2 ? /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(ComboPreview, { cell: cell2, formatKickoff }) : /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(Unavailable, { text: strings.unavailable }),
|
|
17831
|
-
/* @__PURE__ */ (0, import_jsx_runtime148.jsx)("p", { className: "ss-w-vh", "aria-live": "polite", children: announcement })
|
|
17832
|
-
] });
|
|
17833
|
-
}
|
|
17834
|
-
|
|
17835
17873
|
// src/components/SettingsSheet.tsx
|
|
17836
|
-
var
|
|
17874
|
+
var import_jsx_runtime150 = require("react/jsx-runtime");
|
|
17837
17875
|
var SAMPLE = { decimal: "2.50", american: "+150", fractional: "3/2" };
|
|
17838
17876
|
var ODDS = ["decimal", "fractional", "american"];
|
|
17839
17877
|
var THEMES2 = ["light", "dark", "auto"];
|
|
17840
17878
|
function SettingsSheet({ ui, onClose }) {
|
|
17841
17879
|
const s = useOddsSettings();
|
|
17842
17880
|
const t = ui.settings;
|
|
17843
|
-
return /* @__PURE__ */ (0,
|
|
17881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(
|
|
17844
17882
|
PresetToolModal,
|
|
17845
17883
|
{
|
|
17846
17884
|
title: t.title,
|
|
17847
17885
|
closeLabel: t.close,
|
|
17848
17886
|
onClose,
|
|
17849
17887
|
className: "ss-w-set-backdrop-in",
|
|
17850
|
-
footer: /* @__PURE__ */ (0,
|
|
17888
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("p", { className: "ss-w-set-foot", children: t.foot }),
|
|
17851
17889
|
children: [
|
|
17852
|
-
s.oddsOffered && /* @__PURE__ */ (0,
|
|
17853
|
-
/* @__PURE__ */ (0,
|
|
17854
|
-
/* @__PURE__ */ (0,
|
|
17855
|
-
/* @__PURE__ */ (0,
|
|
17856
|
-
/* @__PURE__ */ (0,
|
|
17890
|
+
s.oddsOffered && /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("div", { className: "ss-w-set-row", children: [
|
|
17891
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)("div", { className: "ss-w-tool-label", id: "ss-w-set-odds", children: t.oddsLabel }),
|
|
17892
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("div", { className: "ss-w-set-sample", children: [
|
|
17893
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)("span", { children: t.sampleLabel }),
|
|
17894
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)("b", { children: formatOdds(SAMPLE, s.oddsFormat) })
|
|
17857
17895
|
] }),
|
|
17858
|
-
/* @__PURE__ */ (0,
|
|
17896
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)("div", { className: "ss-w-set-seg", role: "group", "aria-labelledby": "ss-w-set-odds", children: ODDS.map((f) => /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("button", { type: "button", "aria-pressed": s.oddsFormat === f, onClick: () => s.setOddsFormat(f), children: t[f] }, f)) })
|
|
17859
17897
|
] }),
|
|
17860
|
-
!s.themeLocked && /* @__PURE__ */ (0,
|
|
17861
|
-
/* @__PURE__ */ (0,
|
|
17862
|
-
/* @__PURE__ */ (0,
|
|
17898
|
+
!s.themeLocked && /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("div", { className: "ss-w-set-row", children: [
|
|
17899
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)("div", { className: "ss-w-tool-label", id: "ss-w-set-theme", children: t.themeLabel }),
|
|
17900
|
+
/* @__PURE__ */ (0, import_jsx_runtime150.jsx)("div", { className: "ss-w-set-seg", role: "group", "aria-labelledby": "ss-w-set-theme", children: THEMES2.map((m) => /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("button", { type: "button", "aria-pressed": s.theme === m, onClick: () => s.setTheme(m), children: t[m] }, m)) })
|
|
17863
17901
|
] })
|
|
17864
17902
|
]
|
|
17865
17903
|
}
|
|
@@ -17867,7 +17905,7 @@ function SettingsSheet({ ui, onClose }) {
|
|
|
17867
17905
|
}
|
|
17868
17906
|
|
|
17869
17907
|
// src/components/ChatPanel.tsx
|
|
17870
|
-
var
|
|
17908
|
+
var import_jsx_runtime151 = require("react/jsx-runtime");
|
|
17871
17909
|
var FULLSCREEN_QUERY = "(max-width: 639px)";
|
|
17872
17910
|
function useIsModal() {
|
|
17873
17911
|
const [modal, setModal] = (0, import_react104.useState)(false);
|
|
@@ -17918,9 +17956,13 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
17918
17956
|
setSelectedPlayerId(null);
|
|
17919
17957
|
clearPlayerDetail?.();
|
|
17920
17958
|
}, [activeTab, selectedPlayerId, clearPlayerDetail]);
|
|
17959
|
+
const favouritesOffered = !!monitor && (favouritesEnabled ?? false) && !!favourites;
|
|
17960
|
+
const favouritesOpen = favouritesOffered && (favourites?.open ?? false);
|
|
17961
|
+
const favouritesAskedOpen = favourites?.open ?? false;
|
|
17962
|
+
const setFavouritesOpen = favourites?.onOpenChange;
|
|
17921
17963
|
(0, import_react104.useEffect)(() => {
|
|
17922
|
-
if (
|
|
17923
|
-
}, [
|
|
17964
|
+
if (favouritesAskedOpen && !favouritesOffered) setFavouritesOpen?.(false);
|
|
17965
|
+
}, [favouritesAskedOpen, favouritesOffered, setFavouritesOpen]);
|
|
17924
17966
|
const storedTab = tabState?.activeTab;
|
|
17925
17967
|
(0, import_react104.useEffect)(() => {
|
|
17926
17968
|
const unreachable = storedTab === "builder" ? !hasBuilder : !monitor && storedTab !== void 0 && storedTab !== "chat";
|
|
@@ -17967,12 +18009,23 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
17967
18009
|
const hasSettings = settings.oddsOffered || !settings.themeLocked;
|
|
17968
18010
|
const openSettings = (0, import_react104.useCallback)(() => {
|
|
17969
18011
|
setTool(null);
|
|
18012
|
+
setFavouritesOpen?.(false);
|
|
17970
18013
|
setSettingsOpen(true);
|
|
17971
|
-
}, []);
|
|
18014
|
+
}, [setFavouritesOpen]);
|
|
17972
18015
|
const closeSettings = (0, import_react104.useCallback)(() => {
|
|
17973
18016
|
setSettingsOpen(false);
|
|
17974
18017
|
panelRef.current?.querySelector(".ss-w-kebab")?.focus();
|
|
17975
18018
|
}, []);
|
|
18019
|
+
const openFavourites = (0, import_react104.useCallback)(() => setFavouritesOpen?.(true), [setFavouritesOpen]);
|
|
18020
|
+
const closeFavourites = (0, import_react104.useCallback)(() => {
|
|
18021
|
+
setFavouritesOpen?.(false);
|
|
18022
|
+
panelRef.current?.querySelector(".ss-w-kebab")?.focus();
|
|
18023
|
+
}, [setFavouritesOpen]);
|
|
18024
|
+
(0, import_react104.useEffect)(() => {
|
|
18025
|
+
if (!favouritesOpen) return;
|
|
18026
|
+
setTool(null);
|
|
18027
|
+
setSettingsOpen(false);
|
|
18028
|
+
}, [favouritesOpen]);
|
|
17976
18029
|
const paused = isPaused(state.limit);
|
|
17977
18030
|
(0, import_react104.useEffect)(() => {
|
|
17978
18031
|
if (paused) setTool(null);
|
|
@@ -18016,6 +18069,10 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
18016
18069
|
}, [tool, onChatTab, presetGrid]);
|
|
18017
18070
|
const backRef = (0, import_react104.useRef)(() => false);
|
|
18018
18071
|
backRef.current = () => {
|
|
18072
|
+
if (favouritesOpen) {
|
|
18073
|
+
closeFavourites();
|
|
18074
|
+
return true;
|
|
18075
|
+
}
|
|
18019
18076
|
if (settingsOpen && hasSettings) {
|
|
18020
18077
|
closeSettings();
|
|
18021
18078
|
return true;
|
|
@@ -18039,8 +18096,8 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
18039
18096
|
onRegisterBack(() => backRef.current());
|
|
18040
18097
|
return () => onRegisterBack(null);
|
|
18041
18098
|
}, [onRegisterBack]);
|
|
18042
|
-
return /* @__PURE__ */ (0,
|
|
18043
|
-
/* @__PURE__ */ (0,
|
|
18099
|
+
return /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { ref: panelRef, className: "ss-w-panel", role: "dialog", "aria-modal": isModal, "aria-label": ui.chatDialogLabel, children: [
|
|
18100
|
+
/* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
|
|
18044
18101
|
ChatHeader,
|
|
18045
18102
|
{
|
|
18046
18103
|
onClose: () => closeWith("button"),
|
|
@@ -18052,10 +18109,12 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
18052
18109
|
newConversationLabel: ui.newConversation,
|
|
18053
18110
|
moreOptionsLabel: ui.moreOptions,
|
|
18054
18111
|
onOpenSettings: hasSettings ? openSettings : void 0,
|
|
18055
|
-
settingsLabel: ui.settings.title
|
|
18112
|
+
settingsLabel: ui.settings.title,
|
|
18113
|
+
onOpenFavourites: favouritesOffered ? openFavourites : void 0,
|
|
18114
|
+
favouritesLabel: ui.tabFavourites
|
|
18056
18115
|
}
|
|
18057
18116
|
),
|
|
18058
|
-
tabs && /* @__PURE__ */ (0,
|
|
18117
|
+
tabs && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
|
|
18059
18118
|
TabBar,
|
|
18060
18119
|
{
|
|
18061
18120
|
monitor: tabs,
|
|
@@ -18066,15 +18125,14 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
18066
18125
|
hasSchedule: !!monitor && !!discovery && !!schedule,
|
|
18067
18126
|
hasBuilder,
|
|
18068
18127
|
gamesEnabled: !!monitor && (gamesResult?.enabled ?? false),
|
|
18069
|
-
clubEnabled: clubFixturesResult?.enabled ?? false
|
|
18070
|
-
favouritesEnabled: !!monitor && (favouritesEnabled ?? false)
|
|
18128
|
+
clubEnabled: clubFixturesResult?.enabled ?? false
|
|
18071
18129
|
}
|
|
18072
18130
|
),
|
|
18073
|
-
/* @__PURE__ */ (0,
|
|
18074
|
-
/* @__PURE__ */ (0,
|
|
18075
|
-
tool && presetGrid && onChatTab && !paused ? /* @__PURE__ */ (0,
|
|
18131
|
+
/* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "ss-w-chat-layer", style: onChatTab ? void 0 : HIDDEN_LAYER_STYLE, children: [
|
|
18132
|
+
/* @__PURE__ */ (0, import_jsx_runtime151.jsx)(PresetToolsContext.Provider, { value: toolsValue, children: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(MessageList, { controller, ui, slip, onDashboardTap, monitor, onGreetingSport: favourites?.onSportChange }) }),
|
|
18133
|
+
tool && presetGrid && onChatTab && !paused ? /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(BuildComboTool, { grid: presetGrid, strings: ui.presets, streaming: state.isStreaming, formatKickoff, initialTotal: tool.total, initialLegs: tool.legs, onSend: sendAsk, onClose: closeTool }) : null
|
|
18076
18134
|
] }),
|
|
18077
|
-
monitor && discovery && schedule && monitor.activeTab === "live" && /* @__PURE__ */ (0,
|
|
18135
|
+
monitor && discovery && schedule && monitor.activeTab === "live" && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
|
|
18078
18136
|
LivePanel,
|
|
18079
18137
|
{
|
|
18080
18138
|
discovery,
|
|
@@ -18092,7 +18150,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
18092
18150
|
}
|
|
18093
18151
|
}
|
|
18094
18152
|
),
|
|
18095
|
-
monitor && discovery && schedule && monitor.activeTab === "matches" && /* @__PURE__ */ (0,
|
|
18153
|
+
monitor && discovery && schedule && monitor.activeTab === "matches" && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
|
|
18096
18154
|
ScheduleMatchesPanel,
|
|
18097
18155
|
{
|
|
18098
18156
|
discovery,
|
|
@@ -18114,19 +18172,19 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
18114
18172
|
}
|
|
18115
18173
|
}
|
|
18116
18174
|
),
|
|
18117
|
-
tabs && tabs.activeTab === "builder" && hasBuilder && builder && /* @__PURE__ */ (0,
|
|
18118
|
-
monitor && monitor.activeTab === "following" && /* @__PURE__ */ (0,
|
|
18119
|
-
monitor && monitor.activeTab === "trends" && /* @__PURE__ */ (0,
|
|
18120
|
-
monitor && monitor.activeTab === "fixtures" && /* @__PURE__ */ (0,
|
|
18121
|
-
monitor && monitor.activeTab === "standings" && /* @__PURE__ */ (0,
|
|
18122
|
-
monitor && monitor.activeTab === "squad" && /* @__PURE__ */ (0,
|
|
18123
|
-
/* @__PURE__ */ (0,
|
|
18175
|
+
tabs && tabs.activeTab === "builder" && hasBuilder && builder && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(BuilderPanel, { options: builder.options, sport: builder.sport, onSportChange: builder.onSportChange, ui, slip, onCoolOff: builder.onCoolOff }),
|
|
18176
|
+
monitor && monitor.activeTab === "following" && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(MatchesPanel, { monitor, ui, slip, onAsk: paused ? void 0 : handleAsk, discovery }),
|
|
18177
|
+
monitor && monitor.activeTab === "trends" && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(TrendsPanel, { monitor, ui, slip }),
|
|
18178
|
+
monitor && monitor.activeTab === "fixtures" && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(Fixtures, { fixtures: clubFixturesResult?.fixtures ?? [], loading: clubFixturesResult?.loading ?? false, ui }),
|
|
18179
|
+
monitor && monitor.activeTab === "standings" && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(Standings, { standings: clubStandingsResult?.data ?? null, loading: clubStandingsResult?.loading ?? false, ui }),
|
|
18180
|
+
monitor && monitor.activeTab === "squad" && /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)(import_jsx_runtime151.Fragment, { children: [
|
|
18181
|
+
/* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
|
|
18124
18182
|
"div",
|
|
18125
18183
|
{
|
|
18126
18184
|
ref: squadLayerRef,
|
|
18127
18185
|
style: selectedPlayerId === null ? SQUAD_LAYER_STYLE : HIDDEN_LAYER_STYLE,
|
|
18128
18186
|
"aria-hidden": selectedPlayerId !== null ? true : void 0,
|
|
18129
|
-
children: /* @__PURE__ */ (0,
|
|
18187
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
|
|
18130
18188
|
Squad,
|
|
18131
18189
|
{
|
|
18132
18190
|
squad: clubSquadResult?.data ?? null,
|
|
@@ -18144,9 +18202,9 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
18144
18202
|
)
|
|
18145
18203
|
}
|
|
18146
18204
|
),
|
|
18147
|
-
selectedPlayerId !== null && /* @__PURE__ */ (0,
|
|
18205
|
+
selectedPlayerId !== null && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(PlayerDetail, { detail: clubPlayerDetailResult?.data ?? null, loading: clubPlayerDetailResult?.loading ?? false, ui, seasonName: clubSquadStatsResult?.seasonName ?? null, onClose: closePlayer })
|
|
18148
18206
|
] }),
|
|
18149
|
-
monitor && monitor.activeTab === "games" && gamesResult && /* @__PURE__ */ (0,
|
|
18207
|
+
monitor && monitor.activeTab === "games" && gamesResult && /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
|
|
18150
18208
|
GamesPanel,
|
|
18151
18209
|
{
|
|
18152
18210
|
loggedIn: !!loggedIn,
|
|
@@ -18161,10 +18219,9 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
18161
18219
|
}
|
|
18162
18220
|
}
|
|
18163
18221
|
),
|
|
18164
|
-
|
|
18165
|
-
|
|
18166
|
-
/* @__PURE__ */ (0,
|
|
18167
|
-
paused ? null : /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
18222
|
+
(!tabs || tabs.activeTab !== "games" && tabs.activeTab !== "builder") && /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)(import_jsx_runtime151.Fragment, { children: [
|
|
18223
|
+
/* @__PURE__ */ (0, import_jsx_runtime151.jsx)("div", { ref: limitRef, className: "ss-w-limit", role: "status", tabIndex: -1, children: state.limit ? limitText(state.limit, ui) : null }),
|
|
18224
|
+
paused ? null : /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
|
|
18168
18225
|
ChatInput,
|
|
18169
18226
|
{
|
|
18170
18227
|
ref: inputRef,
|
|
@@ -18178,14 +18235,15 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
18178
18235
|
}
|
|
18179
18236
|
)
|
|
18180
18237
|
] }),
|
|
18181
|
-
settingsOpen && hasSettings ? /* @__PURE__ */ (0,
|
|
18238
|
+
settingsOpen && hasSettings ? /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(SettingsSheet, { ui, onClose: closeSettings }) : null,
|
|
18239
|
+
favouritesOpen && favourites ? /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(FavouritesSheet, { ui, controller: favourites.controller, sport: favourites.sport, sports: favourites.sports, onSportChange: favourites.onSportChange, onClose: closeFavourites }) : null
|
|
18182
18240
|
] });
|
|
18183
18241
|
}
|
|
18184
18242
|
|
|
18185
18243
|
// src/components/HostEventsProvider.tsx
|
|
18186
|
-
var
|
|
18244
|
+
var import_jsx_runtime152 = require("react/jsx-runtime");
|
|
18187
18245
|
function HostEventsProvider({ value, children }) {
|
|
18188
|
-
return /* @__PURE__ */ (0,
|
|
18246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(SlipStateContext.Provider, { value: value.slipState, children });
|
|
18189
18247
|
}
|
|
18190
18248
|
|
|
18191
18249
|
// src/styles/css.generated.ts
|
|
@@ -19524,9 +19582,6 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
19524
19582
|
/* The dot sits on the tab's corner and takes no width: a poll landing late must not push the last tab out of a strip that already fits to the pixel */
|
|
19525
19583
|
.ss-w-tab { position: relative; }
|
|
19526
19584
|
.ss-w-tab-dot { position: absolute; top: 4px; right: 2px; width: 6px; height: 6px; border-radius: 50%; background: var(--ss-w-neg); }
|
|
19527
|
-
.ss-w-tab-star { display: none; font-size: 15px; line-height: 1; }
|
|
19528
|
-
.ss-w-tab[data-compact] .ss-w-tab-star { display: inline; }
|
|
19529
|
-
.ss-w-tab[data-compact] .ss-w-tab-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
|
|
19530
19585
|
.ss-w-sportchips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 3px; }
|
|
19531
19586
|
.ss-w-sportchips::-webkit-scrollbar { display: none; }
|
|
19532
19587
|
.ss-w-sportchip { display: inline-flex; align-items: center; gap: 5px; flex: none; min-height: 32px; padding: 4px 11px; font: inherit; font-size: 12.5px; font-weight: 620; white-space: nowrap; color: var(--ss-w-ink); background: var(--ss-w-panel); border: 1px solid var(--ss-w-line); border-radius: 999px; cursor: pointer; }
|
|
@@ -19719,7 +19774,9 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
19719
19774
|
}
|
|
19720
19775
|
.ss-w-lg-showall { align-self: flex-start; min-height: 28px; background: none; border: none; font: inherit; font-size: 11px; font-weight: 700; color: var(--ss-w-faint); cursor: pointer; padding: 4px 2px 0; }
|
|
19721
19776
|
.ss-w-lg-showall:focus-visible { outline: 2px solid var(--ss-w-accent); outline-offset: -2px; }
|
|
19722
|
-
.
|
|
19777
|
+
/* The sheet's body scrolls, so the panel inside is a plain column. A set height keeps the sheet still while search results come and go. */
|
|
19778
|
+
.ss-w-fav-sheet > .ss-w-tool { height: 85%; }
|
|
19779
|
+
.ss-w-fav { display: flex; flex-direction: column; gap: 14px; }
|
|
19723
19780
|
.ss-w-fav-saved { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ss-w-faint); }
|
|
19724
19781
|
.ss-w-fav-saved::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ss-w-accent); flex: none; }
|
|
19725
19782
|
.ss-w-fav-saved--browser::before { background: var(--ss-w-warn); }
|
|
@@ -20984,7 +21041,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
20984
21041
|
`;
|
|
20985
21042
|
|
|
20986
21043
|
// src/StatsWidget.tsx
|
|
20987
|
-
var
|
|
21044
|
+
var import_jsx_runtime153 = require("react/jsx-runtime");
|
|
20988
21045
|
function buildClient(props) {
|
|
20989
21046
|
try {
|
|
20990
21047
|
if ("client" in props && props.client) {
|
|
@@ -21207,6 +21264,8 @@ function StatsWidget(props) {
|
|
|
21207
21264
|
onChanged: discovery.refreshSchedule
|
|
21208
21265
|
});
|
|
21209
21266
|
const favouritesEnabled = hasFavouritesIdentity && favourites.status !== "refused";
|
|
21267
|
+
const [favouritesOpen, setFavouritesOpen] = (0, import_react105.useState)(false);
|
|
21268
|
+
if (!panelOpen && favouritesOpen) setFavouritesOpen(false);
|
|
21210
21269
|
const getPricePresets = (0, import_react105.useCallback)(
|
|
21211
21270
|
(locale) => built ? built.conversation.getPricePresets(locale, { pool: "open" }) : Promise.resolve(null),
|
|
21212
21271
|
[built]
|
|
@@ -21329,17 +21388,17 @@ function StatsWidget(props) {
|
|
|
21329
21388
|
const personalGreeting = (0, import_react105.useMemo)(() => ({
|
|
21330
21389
|
favourites: favouritesEnabled && monitor.enabled ? favourites : null,
|
|
21331
21390
|
conversation: built?.conversation ?? null,
|
|
21332
|
-
openFavourites: () =>
|
|
21333
|
-
// Not before the club probe has answered: a club brand has no Favourites
|
|
21334
|
-
|
|
21335
|
-
// The
|
|
21391
|
+
openFavourites: () => setFavouritesOpen(true),
|
|
21392
|
+
// Not before the club probe has answered: a club brand has no Favourites sheet, and the invite must not appear and then go.
|
|
21393
|
+
favouritesOffered: favouritesEnabled && monitor.enabled && clubFixturesResult.settled && !clubFixturesResult.enabled,
|
|
21394
|
+
// The sheet is offered, so a link to it opens it: the probe is out for at most CLUB_TAB_WAIT_MS before it is.
|
|
21336
21395
|
favouritesReady: favouritesEnabled && monitor.enabled && clubFixturesResult.tabReady && !clubFixturesResult.enabled,
|
|
21337
21396
|
holds,
|
|
21338
21397
|
memory: builderMemory
|
|
21339
|
-
}), [favouritesEnabled, monitor.enabled, clubFixturesResult.settled, clubFixturesResult.tabReady, clubFixturesResult.enabled,
|
|
21398
|
+
}), [favouritesEnabled, monitor.enabled, clubFixturesResult.settled, clubFixturesResult.tabReady, clubFixturesResult.enabled, favourites, built, holds, builderMemory]);
|
|
21340
21399
|
if (!built || widgetStrings.state === "unavailable") return null;
|
|
21341
21400
|
const attrs = themeAttrs(ui, oddsSettings.userTheme);
|
|
21342
|
-
return /* @__PURE__ */ (0,
|
|
21401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(EventLogContext.Provider, { value: logger, children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(TrackingContext.Provider, { value: track, children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(SportScopeContext.Provider, { value: sportScope, children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(OddsSettingsContext.Provider, { value: oddsSettings, children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(HostEventsProvider, { value: hostEvents, children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { ref: rootRef, className: "ss-w-root", "data-ss-w-theme": attrs["data-ss-w-theme"], "data-ss-w-pos": attrs["data-ss-w-pos"], "data-ss-w-mobile": props.mobile ? "" : void 0, style: attrs.style, children: panelOpen ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(PersonalGreetingContext.Provider, { value: personalGreeting, children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
21343
21402
|
ChatPanel,
|
|
21344
21403
|
{
|
|
21345
21404
|
controller,
|
|
@@ -21370,12 +21429,12 @@ function StatsWidget(props) {
|
|
|
21370
21429
|
conversation: built?.conversation ?? null,
|
|
21371
21430
|
presetGrid,
|
|
21372
21431
|
favouritesEnabled: favouritesEnabled && clubFixturesResult.tabReady && !clubFixturesResult.enabled,
|
|
21373
|
-
favourites: { controller: favourites, sport: favSport, sports: favSports, onSportChange: setFavSportPick },
|
|
21432
|
+
favourites: { controller: favourites, sport: favSport, sports: favSports, onSportChange: setFavSportPick, open: favouritesOpen, onOpenChange: setFavouritesOpen },
|
|
21374
21433
|
builder: { options: builderOptions, sport: builderSport, onSportChange: setBuilderSportPick, onCoolOff: onBuilderCoolOff, tabs: monitor },
|
|
21375
21434
|
onCloseRequested: mobile.onCloseRequested,
|
|
21376
21435
|
onRegisterBack: mobile.onRegisterBack
|
|
21377
21436
|
}
|
|
21378
|
-
) }) : props.mobile ? null : /* @__PURE__ */ (0,
|
|
21437
|
+
) }) : props.mobile ? null : /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
21379
21438
|
ChatFab,
|
|
21380
21439
|
{
|
|
21381
21440
|
label: stringsPending ? cfg?.launcherLabel : ui.launcherLabel,
|